pasksa

Notes

Short things I wanted to remember. No particular order.

Find what is listening on a port

On Linux, without guessing at process names:

ss -ltnp | grep :443

-l listening, -t TCP, -n numeric, -p the owning process. Needs root to see PIDs you don't own.

A swap file for a short, memory-hungry build

fallocate -l 4G /swapfile
chmod 600 /swapfile
mkswap /swapfile && swapon /swapfile

Remove it afterwards with swapoff /swapfile && rm /swapfile. Handy when a link step would otherwise get OOM-killed on a small box.

Keep a systemd service alive across crashes

[Service]
Restart=on-failure
RestartSec=3

Pair it with WantedBy=multi-user.target so it also comes back after a reboot.

Let one machine's clock trust another over TLS

A failed certificate check with ssl_verify_result that isn't 0 is, more often than you'd expect, just a wrong system clock. Check timedatectl before blaming the CA.

← Home