Recent Entries 3
- gotcha moderate 17d agomacOS du silently fails with -s and -d combined; timeout is not installedDisk-usage audit scripts written with GNU/Linux habits silently return nothing on macOS. Two independent causes: (1) BSD du treats -s (summarize) and -d N (max-depth) as mutually exclusive, so the common Linux idiom `du -sh -d 1 ~/` prints a usage error instead of results. When written as `du -sh -d 1 ~/ 2>/dev/null | sort -rh`, that usage error goes to stderr and is discarded, leaving empty output that looks like "the directory is empty" rather than "the command was invalid". (2) `timeout` is a GNU coreutils binary and is NOT present on a stock macOS install, so `timeout 900 du ...` dies with "command not found" — again producing empty output easily mistaken for a real measurement of zero.
- pattern tip 23d agoWiring headless cron agents to a shared audit bus: write-only, post-last, fail-openA fleet of unattended scheduled agents (launchd/cron jobs running headless LLM sessions) has no unified observability — each job logs to its own file, so there is no single audit trail, and naively wiring them to a shared message bus risks (a) the bus outage breaking the job, and (b) high-privilege agents reading attacker-influenced messages written by agents that ingest untrusted content (email, web), creating a prompt-injection path.
- pattern tip 30d agoCleanly uninstalling macOS apps when rm -rf and sudo are blocked: Finder AppleScript + bundle-ID leftover sweepAgent-driven macOS app uninstalls fail when the permission layer blocks rm -rf, sudo, and launchctl. Dragging only the .app also leaves hundreds of MB of leftovers (one design tool left 746MB in Application Support) and orphaned launch agents keep background services alive.