Skip to content

Instantly share code, notes, and snippets.

@TRPB
TRPB / arch-macbook2018.md
Last active April 10, 2025 06:11
Guide: Running Arch on a 2018 MacBook Pro

Hardware Prerequisites

You'll need at least the following hardware:

  • At least 3 USB-A to USB-C converters or hub with enough ports for at least 3 USB devices if all your devices are USB-A then:
  • A USB drive
  • A USB keyboard
  • USB to Ethernet adapter, compatible USB dongle or USB tethering on a phone
@ideoforms
ideoforms / sox-cheat-sheet.sh
Last active April 23, 2025 12:49
sox cheat sheet
################################################################################
# sox cheat sheet
################################################################################
# Example commands for the sox command-line audio processing tool,
# for manipulating or batch processing audio files.
################################################################################
# Daniel Jones <[email protected]>
################################################################################
################################################################################
@afanjul
afanjul / install-docker-inside-lxc.txt
Last active June 14, 2023 18:08
Install Docker inside LXC container - Proxmox VE
1.Add “aufs” or “overlay” (or both) to /etc/modules-load.d/modules.conf in your PVE host and reboot. Check it with lsmod | grep -E 'overlay|aufs'
2.Use a LXC image with unprivilege features (you can check them here: https://uk.images.linuxcontainers.org/)
3.Create the container with unprivilege option, and “keyctl=1, nesting=1” features (Options section in proxmox).
4.Maybe you would want to mount an external point into /var/lib/docker (Resources section in proxmox)
5.Check this link (https://docs.docker.com/storage/storagedriver/overlayfs-driver/#configure-docker-with-the-overlay-or-overlay2-storage-driver) to change your storage-driver in docker to use aufs or overlay2.
6.Install portainer: https://portainer.readthedocs.io/en/latest/deployment.html
Voilá…
[ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[ 0.000000] Linux version 5.1.0-rc6 (ubuntu@nanopi-m4) (gcc version 7.4.0 (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04)) #1 SMP PREEMPT Sun Apr 21 22:58:24 UTC 2019
[ 0.000000] Machine model: FriendlyElec NanoPi M4
[ 0.000000] efi: Getting EFI parameters from FDT:
[ 0.000000] efi: UEFI not found.
[ 0.000000] cma: Reserved 32 MiB at 0x000000007e000000
[ 0.000000] NUMA: No NUMA configuration found
[ 0.000000] NUMA: Faking a node at [mem 0x0000000000200000-0x000000007fffffff]
[ 0.000000] NUMA: NODE_DATA [mem 0x7da92840-0x7da93fff]
[ 0.000000] Zone ranges:
@ashalkhakov
ashalkhakov / main.dats
Last active August 7, 2019 13:50
IO monad in ATS
(*
HX-2019-03-26-2:
The original code is available at
https://gist.github.com/ashalkhakov/c3577e97b20020fde31f84447fd1e056
I turned runCommand into a polymorphic function and
also made Command a linear datatype (i.e., dataviewtype)
AS-2019-03-26:
@cgrand
cgrand / heredoc.clj
Last active March 6, 2021 17:16
An ugly hacky heredoc for Clojure
(defn heredoc []
(let [delim (.readLine *in*)]
(->> (repeatedly #(.readLine *in*))
(take-while #(not= delim %))
(interpose \newline)
(apply str))))
; The following lines are read (by the reader) as:
; "Look )(\"\\T\na here doc!\n"
#=(heredoc)"""
@i3v
i3v / cdm_fio.sh
Last active May 15, 2024 13:10
Reproducing CrystalDiskMark tests with fio - fixes for https://unix.stackexchange.com/revisions/480191/9
#!/bin/bash
# This script is based on https://unix.stackexchange.com/revisions/480191/9 .
# The following changes proved to be necessary to make it work on CentOS 7:
# * removed disk info (model, size) - not very useful, might not work in many cases.
# * using "bw" instead of "bw_bytes" to support fio version 3.1 (those availible through yum @base)
# * escaping exclamation mark in sed command
# * the ".fiomark.txt" is not auto-removed
LOOPS=5 #How many times to run each test
@jamieparfet
jamieparfet / macOS-mojave-iso.sh
Last active December 10, 2024 14:38
Create an ISO from the mojave installer app
#!/bin/bash
# This assumes that the ~6GB mojave installer is in the /Applications folder.
# If it's not, just open the App Store, search Mojave, and you can download the installer file from there.
hdiutil create -o /tmp/mojave.cdr -size 6g -layout SPUD -fs HFS+J
hdiutil attach /tmp/mojave.cdr.dmg -noverify -mountpoint /Volumes/install_mojave
sudo /Applications/Install\ macOS\ mojave.app/Contents/Resources/createinstallmedia --volume /Volumes/install_mojave
mv /tmp/mojave.cdr.dmg ~/Desktop/InstallSystem.dmg
hdiutil detach /Volumes/Install\ macOS\ mojave
@WJWH
WJWH / c10k.ru
Created October 15, 2018 09:12
The double hijack trick, serving 65k connections from a single ruby process
# This server demo does a socket hijack in Rack and then saves the socket to a global variable
# to prevent it from being GCed when the Puma thread ends. It will then write "BEEP" to each
# socket every ten seconds to prevent the connection timing out. During testing, it easily
# handled up to 65523 connections, after which it ran into the `ulimit` for open file descriptors.
# The bit with the waiting area is there because a normal `Set` is not thread safe and it would
# drop socket due to race conditions. The `Queue` is thread safe and will make sure all sockets
# are preserved.
# run with `rackup -q -p 8000 -o 0.0.0.0 c10k.ru`
# testing: install `ab` and then run `ab -c 20000 -n 20000 <ip adress of server>:8000/
@marcomorain
marcomorain / clojure.md
Last active October 17, 2018 08:55
Clojure Error Messages

Clojure 1.8

$ clj -Sdeps '{:deps {org.clojure/clojure {:mvn/version "1.8.0"}}}'
Clojure 1.8.0
user=>  (let [2])
IllegalArgumentException let requires an even number of forms in binding vector in user:1  clojure.core/let (core.clj:4333)

Clojure 1.9

$ clj -Sdeps '{:deps {org.clojure/clojure {:mvn/version "1.9.0"}}}'