I’ve been writing a little web app in rust lately, and in it I decided to try to do it without an ORM. Instead, I modeled data access in a way that resembles the Data Access Layer pattern: You make a set of abstractions that maps the “business logic” to how the data is stored in the data store. Here are some types that I found useful in this journey so far.
Category: Hacks
Recently, tsnsrv has been getting a lot of high-quality contributions that add better support for Headscale and custom certificates, among other things. As they always do when things change, bugs crept in, and frustratingly, not in a way that existing tests could have caught: Instead of the go code (which has mildly decent test coverage), it was bugs in the nixos module!
This was a great opportunity to investigate if we can test the tsnsrv NixOS module, and maybe improve the baseline quality of the codebase as a whole.
A recent blog post series on the NixOS test driver (part1, part2) made the rounds showing off what it can do, so this felt like a tractable project to take on. Here’s my experience with it.
GitHub have enabled their “merge queue” function, which is really exciting! The “it’s not rocket science rule” of software development is a pretty good guiding principle for developing stuff in a team (if CI is fast, more on that later!) - so I’m very glad it gets easier to achieve.
Unfortunately, it’s only “easier” but not “easy”. I was able to use the feature for about a half year while it was in private beta, and while using it my team and I learned a few lessons that make certain things possible (and some others easier).
Like many people on the internet, I recently saw this great
talk by Xe
Iaso about things you can do on your Tailscale
network with the tsnet
package. It got me wondering what more I
could do with tailscale myself. Then, three days later, I noticed that
my Kobo e-reader had stopped syncing with calibre-web and I knew
something about how I accessed my homelab-hosted services would have
to change.
Recently, I needed to debug a particularly nasty interaction between two programs, one of which was a go tool. To get further in understanding the issue, I had to compile a little test program with cgo
, the dreaded (by go programmers) compilation mode that allows go programs to call C code. Unfortunately, it’s a bit difficult to find out what to concretely do in order to build a program with cgo
.
This problem has been a mystery to me, and I figure to a bunch of other people, too: If you hit F4 in Mac OS X (or macOS) since Lion, it does not have any effect. What.
I use a Mac as my main typing/character-displaying computer, and on
macOS, iTerm2 is the best terminal emulator that I’ve found so
far. In addition to iTerm2, I also use mosh
,
the mobile shell, to get a fast, interactive and
disconnection-resistant SSH-like connection to hosts on which I need
to use the commandline.
At my workplace, we use github pretty extensively, and with github, we use organization teams. They allow assigning permissions on different repos to groups of people, but, are a really great way of @-mentioning people. This is wonderful, but sadly, github doesn’t make it easy for gmail filters to tell the difference between an email notification that you got because it was interesting to you, or because somebody sent a heads-up @-mention to a team you’re on.
I thought that was impossible to solve, but I was so wrong!