~/archive
The whole notebook.
5 articles, 12 short notes, and plenty of rabbit holes. Find a topic or a familiar command.
17 entries
Using Arch Metapackages to Manage Project Dependencies
Use small Arch metapackages to declare a project's native development dependencies, so pacman can safely remove what is no longer needed.
Stop grep matching itself without grep -v grep
ps aux | grep nginx always lists the grep nginx process too, which is why | grep -v grep is so common. Wrap one character of the pattern in brackets instead: The regex [n]ginx…
ldd may run the binary you are inspecting
ldd is not a parser. It is a shell script that asks the dynamic loader to trace itself — normally by running the loader with --list, and in some versions and some situations by…
MemoryHigh is a slope, MemoryMax is a cliff
A container that runs out of memory did not run out of machine memory — it hit a limit recorded under /sys/fs/cgroup, which is why free -h inside the container shows the host's…
FreeBSD, NetBSD, OpenBSD and DragonFlyBSD: what actually differs
Same 4.4BSD skeleton, four different answers to what to optimise: kernel locking, filesystems, security models, architecture coverage, and how each project runs Linux binaries.
Core dumps are free until you need one
The kernel refuses to write core dumps by default (RLIMIT_CORE starts at 0), which is why production crashes usually leave nothing behind. systemd raises that limit for everything…
Give AI agents privileged access with pkexec
AI coding agents usually run unprivileged and stall when they need root — installing a package, writing under /etc, restarting a service. Instead of running the whole agent as…
Find and kill the process using a TCP port
When a port is already in use, find who owns it before reaching for a reboot: ss -ltnp shows the PID in the users:(...) column (use sudo to see other users' processes); lsof -i…
perf counts, perf samples — pick the right one
perf has two modes and they answer different questions. Decide which one you are asking before you collect anything. Count when the question is how much: cycles, instructions,…
Deleted files can still fill a disk
When df says a filesystem is full but du can't find the space, a process is usually holding a deleted file open. The blocks aren't freed until the last file descriptor closes. +L1…
Ask the package manager what changed on disk
Every package manager already stores checksums for the files it installed, which turns "has anything been modified since installation?" into one command instead of a…
Debugging a systemd service without guessing
A repeatable path from failed unit to useful evidence using systemctl, journalctl, exit status, and the unit's real runtime context.
Measure durations with the monotonic clock
Linux has several clocks, and mixing them up is a reliable way to ship a bug that only appears in production. CLOCK_REALTIME is the wall clock: NTP, settimeofday and leap seconds…
Why is boot slow? Ask for the critical chain
systemd-analyze blame sorts units by how long they took to start, but units start in parallel, so the slowest one often isn't what delayed boot. This shows the chain of units that…
Write boring shell scripts
A few conventions that make small Bash automation safer to rerun, easier to debug, and less surprising six months later.
Print a value in reusable shell quoting
Bash 4.4 added the @Q parameter transformation, which quotes a value so it can be pasted back into a shell unchanged: Handy in logs: echo "running: ${cmd[*]@Q}" shows exactly…
Linux load average is not CPU usage
Why a high load average can point at CPU pressure, blocked I/O, or scheduling pressure—and what to inspect next.
No matching entries.
Try another phrase, clear a topic filter, or use full-text search to look inside the articles.