You don't need CGO to use SQLite in your Go binary

At least not for most use cases. You can just use modernc.org/sqlite instead as your SQLite driver. For people who aren’t in the Go know, “pure” Go programs are trivially easy to compile cross-platform to all the major platforms by default. You read that right - you can just go build a single Windows executable, Mac executable, and Linux executable on the same machine and just ship it: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 # This can all happen on the same box! export CGO_ENABLED=0 # no c cross-compilation please export GOOS=linux GOARCH=amd64 go build -o hello-linux-amd64 hello.go GOARCH=arm64 go build -o hello-linux-arm64 hello.go export GOOS=darwin # aka mac GOARCH=amd64 go build -o hello-darwin-amd64 hello.go GOARCH=arm64 go build -o hello-darwin-arm64 hello.go export GOOS=windows GOARCH=amd64 go build -o hello-windows-amd64.exe hello.go GOARCH=arm64 go build -o hello-windows-arm64.exe hello.go This was the real reason I chose Go over Python for tsk, my instant-search Finnish to English pocket dictionary. I wanted to be able to give Windows users a single .exe they could just run and have work out of the box. ...

July 18, 2025

LLMs make Perl great again

Perl 5 went through a long nadir of unpopularity due in large part to its deserved “Write Once, Read Never” reputation. So I was surprised to find out not only is it installed by default on Debian, it’s installed nearly everywhere by default. It’s even the non-shell scripting language of choice on OpenBSD! Perhaps the only thing more impressive than Perl’s utter ubiquity is its longevity. The latest major version of Perl was first released in 1994. It came into existence on this planet less than a year after I did. It’s even arguably more portable than the median shell script - different Unices might use Bash, Zsh, Ksh, or even something newfangled like Fish, but for the most part a Perl 5 program is a Perl 5 program is a Perl 5 program. ...

May 24, 2025

Cross-platform TUIs are easier than cross-platform GUIs

Below is a GIF of tsk, my pocket Finnish-to-English dictionary, running in my terminal emulator of choice under Linux. It’s what the kids call a TUI, a graphical program that just happens to drive its graphics using terminal graphics instead of graphics-graphics. Insert GIF here. You can probably tell that this program fits neatly into the “home-cooked meal” clade of programs. There is a very straightforward problem I want solved - fast, single-executable-portable dictionary lookup, with a few conveniences for the busy language learner layered on top. I am quite happy with tsk in its current iteration and don’t plan to add much more to it anytime soon. It would still save me a lot of time and hassle if I were the only person who could use it. ...

May 20, 2025

The self-hosted to DevOps engineer pipeline

What’s the best way to get a job? Show someone with a job to do that you can do the job within their iron triangle. What’s the best way you can show someone you can handle a complicated k8s deployment, with 7 different CNCF-approved add-ons, zero-downtime rollouts and a whole bunch of YAML files? Probably by competently and publicly running your own complicated k8s infrastructure. Self-hosters remind me a lot of the sysadmins of yore, who mostly ended up in the profession because they just couldn’t help but mess around with their underlying computing machine until they knew all kinds of weird nooks and crannies within it. I trace my own lineage in software deveopment back to the day my parents finally purchased a Dell laptop and a 300 Kbps Internet connection (residential wiring in Boston left something to be desired), and promptly broke the Windows registry and installed Ubuntu without them ever realizing anything had changed. The next year I got my first internship through a high school program as a Unix admin intern at Akamai, and the rest is history. ...

September 18, 2024

PHP, Go, and Braindead Deployment

If you’ve been following my posts recently, you might have noticed that I’ve been working more and more with PHP lately. As someone who was curiously allergic to web dev as a teenager, it has been a strangely healing experience for me. I’d like to say it’s because my experiments with Laravel, the only OSS work of which I can point to is testing the Homestead VM’s compatibility for Shell Bling Ubuntu, convinced me. But no – Laravel is pretty sweet, but so is Django, but Django has the advantage of using an underlying language that ...

September 16, 2024

What scripting languages come out of the box on Debian 12?

Poking around in a fresh VM in Vagrant, I see bash dash, a POSIX compliant shell linked under sh python3, 3.11.2 at the time of writing awk, specifically mawk sed, if you count that (I do) perl, specifically Perl 5 There may be others I missed. Why I’m curious: Knowing that a language is installed by default on the most popular Linux distribution can simplify certain concerns considerably, which are of special interest to people who don’t work on Internet-connected boxes. Knowing that Python/Perl is already on there means that, provided your script only relies on the standard library, you should be able to just scp it over in a pinch and have it “just work”. ...

June 23, 2024

Layers of abstraction for me, not for thee

Consider the problem of “how do I run more than 1 terminal at a time”. At this moment, I have at least 5 different ways I can effectively solve this issue: I can, from a different physical computer, SSH in to a new session. I can, from the same physical computer, switch to a different tty session with … C-S-F2 through 6 or something. (Rare, but sometimes it comes in really handy.) I can, in the same user session, open 2 separate windows of a terminal emulator. I can, in the same terminal emulator, open a new tab. I can, in the same emulated terminal, run tmux and open a new pane. There are yet more exotic options like Serial over LAN that I’m only theoretically aware of. ...

June 18, 2024

OpenBSD, the computer appliance maker's secret weapon

Between our ESP32 prokaryotic organisms and our 24/7 Internet-enabled megafauna servers, there exists a vast and loosely-defined ecosystem of things the B2B world likes to call computer appliances. Picture a bespoke Pi 4 packaged up neatly with some Python scripts, a little fancy plastic embossing, and maybe a well-guarded id_ed25519.pub in case you end up in hot water during the (long - very long, stable cash flow for generations long) maintenance contract, and you’re in the ballpark. ...

June 5, 2024

Quickstarts and Slowstarts

A while back I stirred up some controversy on Hacker News by talking about why I liked it when tutorials take you from clean VM to working, installed software. I’ve since taken to calling this the “tutorial-in-a-box” method. When I write them myself, I usually put them under the header Slowstart, a riff on the proverbial Quickstart. Two examples: A gentle introduction to reposurgeon. The Slowstart for selkokortti, some flashcard generating software based around my Finnish language news archive. The point of a Slowstart is to make it so that even absolute beginners can start to pick up some pointers about how people “in the know” of your chosen software ecosystem actually get things done. Instead of a Dockerfile or a shell script, you take them by the hand, spin up a totally fresh virtual machine from the ground up using something like Vagrant or virt-builder, and walk them through each and every command they need to execute in order to get to a working install. ...

June 4, 2024

The unreasonable effectiveness of VMs in hacker pedagogy

Here’s a secret. If you have Vagrant and VirtualBox installed, and your colleague does too, then you can both bring up an near-totally identical blank slate Debian 12 Linux VM by running 1 2 3 4 5 6 mkdir tutorial/ cd tutorial/ vagrant init debian/bookworm64 vagrant up vagrant ssh . This works regardless of whether you or they are on Linux, Mac1, BSD, or even Windows. (Through the magic of aliasing, mkdir and cd even work in PowerShell.) ...

March 31, 2024