+--+
--+  +--
  +--+
ISK
"One of my most productive days was throwing away 1000 lines of code."
Ken Thompson

TIL (Today I Learned)

Short notes about things I learn.


2026-04-02 ssh sdf
sshfs lets you mount your SDF home directory locally
# Linux: install sshfs

sudo apt install sshfs  # or: dnf install fuse-sshfs

# macOS: 'brew install sshfs' FAILS — Linux-only formula
# correct: use FUSE-T (no kernel extension, no reboot needed)
# the tap is mandatory — without it fuse-t-sshfs is not found
brew tap macos-fuse-t/homebrew-cask
brew install fuse-t
brew install fuse-t-sshfs

# mount SDF home directory
mkdir -p ~/mnt/sdf
sshfs your_username@meta.sdf.org: ~/mnt/sdf \
    -o reconnect,ServerAliveInterval=30,ServerAliveCountMax=3

# edit locally, deploy instantly
ls ~/mnt/sdf/html/
cp til.html ~/mnt/sdf/html/

# unmount
fusermount -u ~/mnt/sdf   # Linux
umount ~/mnt/sdf           # macOS

# cleaner with ~/.ssh/config alias (Host sdf / HostName meta.sdf.org)
sshfs sdf: ~/mnt/sdf -o reconnect,ServerAliveInterval=30


FUSE-T replaces macFUSE using a local NFS v4 server instead of a kernel extension — the reason brew install sshfs breaks on macOS is that macFUSE requires a signed kext that Homebrew can't build. FUSE-T sidesteps that entirely. The tap step is mandatory; skipping it makes fuse-t-sshfs invisible to Homebrew even after fuse-t is installed.
2026-01-12 Unix history
Pipes were invented to make small Unix programs work together
Early Unix programs were small, sharp, and stubbornly simple. The real problem wasn’t power, it was how to make them talk. At Bell Labs, Douglas McIlroy proposed a simple idea: let one program pour its output straight into another, like a garden hose. Ken Thompson wired this into the system in 1973.

The shell made it usable through the | operator. Behind the scenes, | just redirects stdout from one process into stdin of the next using file descriptors and fork(). To the programs, nothing special is happening. They just read and write streams.

That simplicity killed temp files, encouraged chaining tools, and locked in a core Unix truth: composition beats cleverness.


Sources:
https://en.wikipedia.org/wiki/Pipeline_(Unix)
https://wiki.tuhs.org/doku.php?id=features:pipes
2026-01-08 Unix history Ken Thompson
grep exists because Ken Thompson liked regex
Right off, Bell Labs wasn’t pushing grep as its own thing. Ken Thompson cared more about changing the editor, called ed - that curiosity about regular patterns changed everything. While building a newer version, qed, ed grew into something tighter and sharper; soon, there was a way to scan lines using patterns without fuss. That’s when regular expressions quietly made their way into the editor. Then came grep, dressed like a tight jacket around the core framework. It just felt right to use grep - thanks to how much Thompson loved regex at its core, not limited to typing commands alone.
2026-01-07 kubernetes debugging
OOMKilled is a Linux decision
When a Pod exceeds its memory limit, the Linux kernel (cgroups) kills the process with SIGKILL.
Kubernetes only reports the event.

Exit code 137 = OOM kill.
2025-12-30 Unix/Linux/Shell
Fix your typos like a pro with `fc`
The fc (fix command) command opens your last executed command in $EDITOR. Works in bash, zsh, ksh, and other POSIX-compliant shells. When you save and quit, the command runs automatically.
2025-12-23 kubernetes
Test DNS resolution inside a Kubernetes pod
bash
kubectl run -it --rm debug --image=busybox -- nslookup <service>.<namespace>.svc.cluster.local

Creates a temporary pod to test internal DNS resolution. First step to debug "connection refused" between services.
2025-12-23 Kubernetes
Pod logs after crash
kubectl logs <pod> --previous
shows logs from the previous container instance. Essential for debugging crashloops.