Patching Ruby dependencies in Nix

I’ve been setting up a whole-audio system with snapcast. One of the services I was excited to come across was pifi-radio. It’s been archived by the owner, but it installed fine alongside mpd on a recent Debian version, and has a lovely UI: The next challenge was wrapping it up in a nix package for easy deployment and management. I’m not a Ruby developer so I’ve not tried using it in Nix, but the instructions at https://ryantm.github.io/nixpkgs/languages-frameworks/ruby/ are pretty easy to follow: ...

October 1, 2025

Exploring Portable Services with Nix

Intro Since reading the excellent systemd has been a complete, utter, unmitigated success and discovering Lennart Poettering’s Pid Eins blog, I’ve been on a bit of a streak of playing around with developing services and managing them with systemd: Experiments with AIS Lightweight services with socket activation and fastcgi Graceful shutdown in async Rust An as-yet-unreleased AIS sharing pipeline, using ais-compact and socket activation Today we’re looking at another component in the systemd ecosystem, namely Portable Services. ...

September 6, 2025

Multi-platform docker images in Nix

I’ve been playing a lot with Nix over the last year, using it for my dev and build environments. The major draw with Nix is the deep focus on build reproducibility: No network access, so all dependencies must be downloaded ahead-of-time No host system access, so all dependencies (build-time and runtime, library and binary) must be declared Outputs are content-addressed, so identical builds and dependencies are de-duplicated As a result, the same Nix definitions should result in the same output (barring things like timestamps and non-determinism). ...

August 28, 2025

Graceful Shutdowns in async Rust

When you’re writing network services, one decision you need to make is how to handle restarting or updating your service. A naïve (but sometimes acceptable) approach is to simply shut down the service and start a new copy. Any clients that are currently connected will have their connections interrupted, and any clients that attempt to connect between the previous copy shutting down and the new one starting up will hit some kind of ‘connection refused’ error. ...

August 26, 2025

Weekly web roundup - 2025-08-22

Interesting articles EICAR test file | Wikipedia Anti-virus test file, harmless but included in a few AV databases for testing purposes Making Sense of Acquire-Release Semantics Great overview of memory synchronisation Emulating Diagnostic Services Useful uses of ncat Learning socat in terms of netcat Good overview of socat’s features in terms of ncat How I accidentally became PureGym’s unofficial Apple Wallet developer Vadim Drobinin reverse-engineers PureGym’s API in a weekend and comes up with a much better app TLS overhead ...

August 22, 2025

Lightweight services with socket activation and fastcgi

I run a small VPS that runs all sorts of odds and ends - test services I’ve playing around with, static pages I’m hosting, etc. The main entrypoint from the outside world is caddy - caddy listens on ports 80 and 443, inspects incoming connections, then decided what to do with them. Thanks to HTTPS, all these services can run off the one VM all sharing the same IP - each service gets its own domain name, then Caddy receive all the connections, check the domain name being requested, and dispatch the right action - anything from: ...

August 21, 2025

[🔦spotlight] geo-locating IP addresses

Occasionally I’ll come across a tool, library or service that solve a problem. Each ‘spotlight’ is a quick post highlighting one of these and how it can be used. Various website profess to tell you your IP address and location. Often they also tell you ‘your location is being exposed!!!’ and try to sell you VPN software to hide your location. Or sometimes you’ll get an email saying ‘you logged in from a new IP address at location XXX, YYY’. ...

August 20, 2025

Announcing ais-compact

In Compressing AIS strings, part 2, we looked at how AIS strings are structured and whether they could be stored more efficiently. The result of all that is a tool to compress text-based AIS strings into binary streams and back, with about a 29% reduction in data size in the process: github.com/JaimeValdemoros/ais-compact. This can be installed directly using the cargo build tool: cargo install --git https://github.com/JaimeValdemoros/ais-compact.git#0.1.0 It provides ais-compress and ais-decompress binaries, that will transfer AIS strings completely losslessly (even if the strings are malformed or contain garbage): ...

August 18, 2025

Compressing AIS streams, part 2

In my previous post, I compared the benefits of using a generic off-the-shelf compressor, with writing a custom compressor. Now that we’ve played around with zstd and seen how it behaves at compressing varying volumes of AIS strings, it would be instructive to take a closer look at the structure of AIS strings and whether there’s any ‘wasted space’ we can take advantage of. A quick primer on AIS sentences With the help of this AIVDM/AIVDO decoding article from the gpsd project, let’s take a look at two example messages from the nmea sample data set we looked at in the last article. ...

August 17, 2025

Compressing AIS streams, part 1

If you’ve read my previous blog posts, you might see a theme: I’ve bought an AIS receiver to pick up ships broadcasts and have been playing with what I can do with the data. Now I’ve got thinking about how that data is transmitted. AIS receivers make the data available in a standard format via IP or serial connection, and various AIS collection services have leveraged that by providing publicly accessible IPs you can configure directly on your AIS device to sent the traffic their way. ...

August 16, 2025