DevOps engineer · Australia SRE / Linux / networks / CI/CD

Docs / 3 entries

Documentation

Commands and references I keep close at hand.

RSS feed

This entire category exists so I have my references, commands, and links close at hand.

Unprivileged to privileged container on Proxmox

ROOTFS=/local-single/subvol-<PCTID>-disk-0
python3 - "$ROOTFS" <<'PYEOF'
import os, sys
base = sys.argv[1]; shift = 100000; rng = 65536
changed = 0
def remap(p):
    global changed
    st = os.lstat(p)
    nu = st.st_uid - shift if shift <= st.st_uid < shift + rng else -1
    ng = st.st_gid - shift if shift <= st.st_gid < shift + rng else -1
    if nu != -1 or ng != -1:
        os.lchown(p, nu, ng); changed += 1
try: remap(base)
except OSError as e: print(f"warn top: {e}", file=sys.stderr)
for root, dirs, files in os.walk(base):
    for n in dirs + files:
        try: remap(os.path.join(root, n))
        except OSError as e: print(f"warn: {e}", file=sys.stderr)
print(f"remapped {changed} entries")
PYEOF

Autohotkey (v2) clipboard typer

#Requires AutoHotkey v2.0
!v::
{
	text := A_Clipboard
	i := 1
	len := StrLen(text)
	while i <= len
	{
		char := SubStr(text, i, 1)
		if (char = "`r")
		{
			if (i < len && SubStr(text, i+1, 1) = "`n")
			{
				SendInput("{Enter}")
				i += 2
				continue
			}
			SendInput("{Enter}")
			i++
			continue
		}
		if (char = "`n")
		{
			SendInput("{Enter}")
			i++
			continue
		}
		SendInput("{Raw}" . char)
		Sleep 30
		i++
	}
	return
}

Tailcat

Some reference stuff for Tailcat

GPG/PGP Stuff

GPG / PGP References, commands or other stuff

FFmpeg

FFmpeg helper commands or commands I use frequently