Language learning treated as breadth-first search

I am, emphatically, not the language learning type. I’ve done enough of it over my life to know this. It’s certainly one of the better hobbies out there: You can do it for free (in principle), you can sink as many hours as you care to into it, and if you get good enough at it you get to reap some unique cultural and economic1 benefits. But there’s a reason I picked up Python when 14 year old me decided he wanted to get ahead in life instead of (say) German....

April 22, 2024

Check my math - NixOS vs the Most Complicated Program on Earth (MCPOE)

Imagine you had the Most Complicated Program On Earth (MCPOE), with 1,000,000 dependencies. Every dependency must be build correctly exactly right or the MCPOE will fail to compile. MCPOE’s 10x dev team chose their packages so that each dependency has only a 1/1,000,000 chance of having something go wrong when you’re installing them - maybe a whitespace character snuck into the wrong build script, maybe solar wind hit the build computer....

April 14, 2024

fd + xargs + bat = quick document review

I’ve been on vacation this week, and part of what I’ve been up to is fixing up the Selkouutiset Archive. Like most of my websites these days, SA is powered by Hugo, which means handling a lot of Markdown documents, which means I opted to use an intermediate Git repo as a submodule to actually store the custom-processed documents. After a few tweaks here and there, I found myself wanting to quickly flip through all of the Markdown documents I had generated for each news day....

February 25, 2024

Getting `fzf` to print the preview pane

fzf is an incredibly useful bit of software, if someone shows you how to use it. There’s a lot more to it than just fuzzy-switching directories and fuzzy-searching you shell history – it also comes with a preview pane that updates on every keystroke. Try 1 echo '' | fzf --preview 'echo {q} {q}' and typing something to see how it works. ({q} is the query you type in at the bottom of the screen....

December 6, 2023

Vagrant lets you wrap VDI images

At work I’m currently experimenting with using Vagrant to automate getting an entire local network of our tiny embedded Linux systems running all on my local box. Alas! One of our devices uses a custom Yocto distribution! But wait, we have scripts to run these as VDI images, and apparently that’s enough for Vagrant to get to work! 1 vagrant package --base my-virtual-machine Further reading materials for future me: Creating a Base Box, and the Box File Format....

December 5, 2023

Git aliases for fun and profit

haskell-kata’s Quickstart now has this neat little ditty at the start: 1 2 git config --local alias.build '!sh -c \'for file in *.hs; do ghc -o "${file%.hs}-bin" "$file"; done\'' git build Git is the gift that keeps on giving. I was on the hunt for a subdirectory-scoped alias, and I just discovered this incredibly flexible way to create new Git subcommands. History: 2 years ago I read through the 1200 page behemoth Haskell Programming from First Principles....

December 3, 2023

Outage postmortem: Why didn't SelkoArchive get today's news?

For some reason, my daily archive of Finland’s “clear news” broadcast didn’t work today. Why not? TL;DR: Just a Git snafu. Quick recap of the archive: There are 3 Git repos: selkouutiset-scrape simply scrapes the HTML https://yle.fi/selkouutiset at 6 PM every day via a Github Action. selkouutiset-scrape-cleaned pulls in scrape and turns it into a stack of translated, properly-named Markdown files, by the magic of shell scripts, systemd timers, and a tiny VM in a datacenter somewhere....

December 1, 2023

One problem with user-scoped `systemd` timers

I’ve discovered one big downside of [putting systemd times into ~/.config/systemd/user/][1]: They stop running when you log out. Two ways around this problem: Bite the bullet, and install the timers into /etc/systemd/. This means giving up chezmoi version control, making the overall system more snowflake-y. I’m not crazy about it. Remote in with tmux, instead of ever logging out, just use C-b d to detach from the session. I’m going with #2....

November 26, 2023

Promoting Blog Tag Reuse with `fzf`

Some more updates to the main repo of this TIL site today, in particular I have added a new fzf-tags.fish script. til uses this script to Scrapes all the YAML tags: frontmatter from all current Markdown posts, Puts me into a multi-select fzf menu containing them, and Puts anything I select into the tags: of the new blog post. Tags form natural breadcrumb trails throughout a blog as it grows organically over time....

November 25, 2023

No such thing as a Post-Push Hook

Tonight I was hacking away at some more little automations to make this TIL nice and presentable over at https://hiandrewquinn.github.io/til-site/. Git has a wonderful system called “hooks” which live under .git/hooks/, come loaded with examples so you can remember how they all work, and – surprisingly – don’t contain a local post-push hook! There’s post-receive, but that expects to be able to run a script on the server side – not helpful when I’m pushing to one of Github’s many, many anonymous boxes....

November 18, 2023