One line of bash for every repository

We keep one plain text file that lists every repository we gate, one path per line. Then we needed a new hook in all of them. You don’t need a full programming language, or to do it by hand. Plain ol’ bash does it in one line: while read -r r; do install-hooks "$r"; done < <(grep -vE '^[[:space:]]*(#|$)' repos.txt | sed "s|\$HOME|$HOME|; s|^~|$HOME|") install-hooks stands in for whatever installs your hook. Ours is our commit gate’s own install command. ...

October 2, 2026 · 3 min · Luis Tineo

The dry run that checked nothing

On 7 September we wrote a script to bring every repository on our GitHub account to the same settings: branch protection, secret scanning, the files a public repository should have. It had a dry-run flag. Run with it, the script said: every repository in scope already conforms It had checked none of them. getopts stops at the first word The script took a subcommand and then flags: apply -n. It parsed the flags with getopts, bash’s built-in option parser, which reads arguments from the front and stops at the first one that doesn’t start with a dash. The first argument was apply. So getopts stopped there and never saw -n. ...

September 24, 2026 · 5 min · Luis Tineo

Two loops waiting for themselves

“are these tasks still running?” I asked that on 2 September, about two background jobs Claude had started, which had been sitting at “Running” for 94 minutes. They were waiting for a Flatpak SDK to finish installing. It had finished at about the four-minute mark. Nothing had failed. They were waiting for themselves Both loops tested for the install with pgrep -f "flatpak install", and were written to stop once nothing matched. pgrep -f searches the whole command line of every process. It leaves itself out of the results, but not the shell that called it, and that shell’s command line held the entire loop. So each loop found itself, and each found the other. They were waiting for their own exit. ...

September 24, 2026 · 4 min · Luis Tineo

Connect to a wireless network through the command line

Sometimes you decide that you don’t want to use any GUI to connect to your wireless network, especially when it doesn’t seem to work. One of the main benefits of Linux and any other Unix based operating system is its ability to empower users to do things on their own. So tonight when the latest Ubuntu updates broke my laptop’s wireless, I decided to write a little script to fix it. ...

July 28, 2012 · 2 min · Luis Tineo