TIL
Today I Learned — snippets and quick notes to remind myself.
- REPLICA IDENTITY on a partitioned table doesn't cascadeALTER on the parent looks like it configured CDC, but the leaf partition is what counts.
- EIO vs ENOENT: the error tells you if the disk droppedI/O error and 'no such file' point to different causes.
- Make a service go down together with a disk's mountBindsTo + Wants couples the service's lifecycle to the mount's.
- Never run umount -a on a host with snapIt unmounts securityfs and bricks every snap binary until reboot.
- Protect a mount's base directory with chattr +iStops silent writes to the wrong disk when the mount doesn't come up.
- docker exec -t injects CR into your pg_dump-t allocates a TTY and turns \n into \r\n across the whole dump.
- rclone sync without losing what got deleted--backup-dir turns a deletion into a dated version instead of erasing it.
- Create a systemd service from scratchThe minimum to turn a command into a managed service.
- add-wants fails on a .mount unit generated from fstabGenerated units are read-only; use a drop-in.
- Multiple GitHub accounts on the same deviceSwitch account and SSH key automatically per directory, via includeIf and ~/.ssh/config.
- Postgres LATERAL join for top-N per groupGet the N most recent rows of each group without a window function.
- xargs in parallel with -PRun a command over many items using all cores.