A neat trick I found in glibc

While digging in and doing research for my previous post, I came across a really cool trick that glibc uses to provide a single macro for invoking system calls, no matter how many arguments they take. I thought I'd share the trick here, along with an explanation on how it works for those unfamiliar with the C preprocessor.

Read More...
Posted on 2024-07-24

bpftrace: needing to cast when filtering on negative numbers and why

A few months ago I was using bpftrace to implement a program to monitor writes to a specific directory, and while working on this program I encountered some noteworthy behavior around bpftrace and its filters that I thought I should share.

Read More...
Posted on 2024-07-02

Applying Git's pickaxe option across multiple lines of YAML using textconv

For this post, I wanted to talk about a trick I came up a few years ago with to apply Git's pickaxe option in a situation where the change I was interested in wasn't contained in a single line. I'm hoping that readers of this post take away not only the trick itself, but also a perspective on how we can leverage Git's flexibility to create even more powerful tools for searching history!

Read More...
Posted on 2024-05-06

Monitoring systemd user manager with node exporter

I use systemd and its timers to run various tasks on my machines on a regular basis, and since that's all happening in the background, I want to know if those jobs fail. Now, it's better to have a job-specific alert rule that checks that the state of the world is desirable (for example - instead of checking "did the e-mail backup job succeed?", check "is the most recent file in the e-mail backup destination less than 24 hours old?"), but it's nice to have the general "did the service succeed?" check as a backstop for when a specific alert is hard to set up, or when I just haven't gotten around to it yet.

Read More...
Posted on 2024-04-07

My trick for "hot reloading"

A lot of the software I use embeds a scripting language for easy extension - this is great, but much of it doesn't provide facilties for "hot reloading"; that is, iterating on an extension without needing to restart the application and blow away its current state.

Read More...
Posted on 2024-03-17