A picture of a frying pan on an induction hob. Frying in the pan is a Docker logo and some small books.

While I’ve haven’t been as active lately working on blog posts, I have been cooking up various bits and pieces, often assisted by clankers what we at $COMPANY call Omnibot. Omnibot is whichever flavour of LLM we can get our hands on at work, and the name has stuck when I’ve been AI-assisted at home. Here’s some of the little projects I’ve put together recently.

MCP Linux Log Server#

One of the things I’ve been most impressed about with LLMs is definitely not their ability to write awesome, super well engineered code. Instead, they’re able to take multiple different data sources and cross reference them really well, finding insights that it would take a meat machine much longer to work out. So when I had a couple of weird issues on both my local PC and the Grumpy Server, it seemed like a good opportunity to get Omnibot to put together a simple MCP server to surface the logs to a model so that it could work out what the fuck was going on. The code for it lives here.

And how did it work out? Amazingly well. A number of very annoying issues on my local PC went away after Omnibot was able to correlate some weird graphics card issue with a setting that was MIA. Meanwhile, on the server, it caught some weirdness in one of my docker setups, and managed to free up some resources to stop it being so heavily loaded. Victory after relatively little effort.

As an aside, when debugging a Linux hardware problem where the front headphone jack on my PC didn’t work after unplugging and plugging back in again, an Omnibot web chat session worked incredibly well. If you paste in the symptoms, it will ask for the output of various commands, and drill down into a solution very very quickly. While this is something that I could do, I don’t particularly want to waste hours of my time chasing down obscure web links on forums and personal blogs (irony noted). It turns out that this is just what LLMs are good at, so as long as you aren’t copy/pasta-ing PII to Omnibot, using it this way is a good use of your monthly subscription.

The Docker Image Pusher#

Of course, now that I’ve written an MCP server of my very own, I need to deploy it around the home network. I mean, I could do the easy thing and pull the repo on each machine and install it that way… or, I could have the MCP server built as a docker image, deploy it to a personal home-hosted Docker registry, and then use docker compose to just pull it down when I need it. Simples!

In the everlasting Grumpy tradition of making everything far more complicated than it needs to be, this is what I ended up doing. But as I did, I realised that I wasn’t tracking the semantic version numbers properly for my docker images. I was surprised to find that there was no obvious way to manage the versioning of published docker images other than manually. So on top of setting up my own registry, I decided to get Omnibot help with a small utility that would manage storing version numbers, handle bumping them, and then pushing them to the registry. Thus, the Docker Image Pusher was born.

It’s intended to be pretty lightweight. All you need to do is configure the docker registry you want to push your image to, and it will attempt to sniff out a version number from the usual places (pyproject.toml, etc). It will then ask which version you want to use to push to the registry under, and will write this to a VERSION.txt file with some information inside it to keep track of the last built version. It will call docker build and then push to the registry as versions latest, x.y.z, x.y and x.

Certainly not the world’s greatest tool, but it’s functional and has helped me around Grumpy Manor, so if it helps you, then even better.

Directory Constraint Pi Extension#

So I’ve been fiddling around with pi lately, and am enjoying it so far. In particular, the philosophy behind it resonated somewhat when watching some of Mario Zechner’s YouTube talks. One of the things that make it quite neat is that it ships with no guardrails at all. So if it were to do the equivalent of rm -rf / or similar, you’d be shit out of luck. But it turns out that the standard approach to anything you don’t like about pi is - ask pi to write an extension to add the behaviour you want. So I did.

The Directory Constraint (dircon) extension is a crude attempt at stopping the harness from allowing writes outside of the project root by default. It does this by checking for various command line parameter patterns, and will block them if found, which leads to the user being asked if they want to allow that operation. Probably overkill really, but I’m a relatively risk-averse kind of guy, so this makes me feel a little happier about running with no training wheels guard rails on.

The Blog-Post Auto PII Stripper Git Commit Hook#

This is probably not the stripper you’re looking for. One thing I’d had open in my Firefox sessions was something I’d seen a while back about auto-applying black formatting via a pre-commit hook when uploading into a remote git repository. The tricky part of this is not the auto-formatting, but making sure tht the formatted output is re-added to the commit, otherwise it won’t be included.

This seemed like the sort of thing I could wrangle to instead strip all image metadata from images that I uploaded to GMG itself. It took a couple of goes, but I think I’ve got it right now. I’ve shoved it in a gist so that I wouldn’t lose it or anything later on. If this helps you see how the (black) magic happens, then you’ll have learned your one new thing for the day.