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

Most 2 digit numbers not divisible by 2, 3, or 5 are prime

There are only four single-digit primes: 2, 3, 5, and 7. So all two-digit numbers are either prime, or divisible by one of these four numbers. Of the four, 2, 3 and 5 are all very easy to spot check whether a number is divisible by them or not (for 3, add the digits first, and see if that sum is divisible by 3). If a given 2-digit number doesn’t fall into this category, 7 times out of 8, it’s prime....

December 4, 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

Haskell has a rustup now?

Apparently so.. The resemblence is uncanny. I’ve apparently been out of the FP game too long, I thought Stack was the latest and greatest in abstracting over the toolchain.

December 2, 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

Things Word has that SSGs, by and large, don't

Recommendations appreciated. Disclaimer: Most of these make little sense in an Internet medium anyway. An index. An index simply lists the terms and topics discussed in a document, along with the pages they are listed on. A glossary. Could be as simple as a CSV file of terms and definitions, or as complex as a whole extra glossary/ folder. Related: A “Acronyms and Abbreviations” section. Even moreso than the last, this could be a simple CSV....

November 30, 2023

traceroute uses UDP by default, not ICMP

At least on Linux. Don’t believe me? Run tcpdump -nn -i <interface> 'host example.com' in one shell and traceroute example.com in another. tcpdump will pick up all 3 of {ICMP, UDP, TCP}, and on my machine the pattern is clear: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20:58:47.187086 IP 1.2.3.4.41369 > 93.184.216.34.33434: UDP, length 32 20:58:47.187160 IP 1.2.3.4.39830 > 93....

November 29, 2023

Cloud translation is more expensive than I thought

Example from yesterday’s news. Count ’em yourself – there’s 76 of them there. Mass i18n efforts like this are I think an underappreciated benefit of what static site generators like Hugo can give you. Actually, especialy Hugo – it’s multi-language support is very good, like darn near everything about the platform once you get past the initial learning curve. Another underappreciated benefit: When building HTML pages is fast, you can afford to build a lot of them....

November 28, 2023

Pomodoros and leverage ratios

I love pomodoros 🍅. But I have to admit, most of the time when I reach for them, it’s because I"m already having trouble staying on task with whatever I’m doing. I generally don’t get a lot of value out of the ’longer break’ option, a steady beat of work and breaks is enough for me. In those circumstances I often find solace in the idea that a well-constructed pomodoro creates a certain lower bound on my work-to-play leverage ratio....

November 27, 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