RSSAmplifier

Blog

gpk blog

Recent content on gpk blog

blog.gpkb.orgRSS feed ↗30 posts

Latest posts

Resetting an Ideal Halo Zigbee Thermostat

I recently bought a house with an Ideal boiler and a wireless thermostat called a “Halo”. The boiler has a “Halo Smart Interface” fitted into it, which should tell the boiler when to fire. The Halo itself contains the thermostat and communicates with the Smart Interface using Zigbee. During some decorating work the thermostat became disconnected from the boiler. This really…

My Homelab

It’s been about eight years since I started running network services in my home. It all started with Pi-hole , which I ran not on a Raspberry Pi, but an Atom-powered Dell Mini “thin client” I acquired from eBay. Today I run a lot more and it’s become what is now known as a Homelab. I’m quite fond of it all, so thought I might as well write about it. NAS I built my NAS…

Run AI Agents in Lightweight Sandboxes

Currently, “AI agents” like Claude Code are all the rage for software development. These programs facilitate feeding context into LLMs directly from your codebase and environment by empowering the LLM to read/write files and run arbitrary code on your system. If you’re at all security conscious, the above should make you very uncomfortable. An intentionally non-deterministic…

Think Twice about Boolean Fields in your Data Model

The SQL standard includes a boolean type which, unsurprisingly, represents a Boolean value. This can be useful, but I’m going to argue that it should almost never be used in a normalised data model. The Problems with Boolean Here are few of the problems you’ll inevitably run into if you use boolean in a normalised data model: It’s not really binary So you’re chatting to…

Just Send Me the Prompt

If you are thinking about using an LLM to communicate with me, you will be glad to hear I’ve just developed an exciting new technique which will save us both time. Rarely are such wins possible, so this is surely cause for a celebration. The technique goes as follows: Type up your LLM prompt, (Here’s where it gets really exciting), instead of sending your prompt to an LLM, just send…

Automating Metabase Upgrades on Kubernetes with Flux

Metabase is a really nice free software business intelligence tool. It’s quite easy to deploy; they provide a Docker image and all you really need for a production instance is your own database. I use Flux to manage my cluster so I thought it would be nice to utilise image update automation to keep up to date with updates automatically. But Metabase makes this slightly difficult because it…

Clean Domain Models with SQLAlchemy

One of the most tried and tested techniques in programming is to build components that map closely to the real-world problems you are trying to solve. In domain-driven design (DDD), one of the key tenets is to have a domain model at the centre of your application. The domain model should be built in close collaboration with domain experts and, crucially, should consist purely of high-level domain…

Talos Linux on XCP-ng

Talos Linux is a minimal Linux distribution designed purely for running Kubernetes nodes. It’s pretty neat, check out its website here: https://www.talos.dev/ I use XCP-ng in my homelab for running virtual machines and decided to set up a Talos cluster there. I followed the excellent Getting Started guide but there are a few additional things I wanted to do right from the start: Have the Xen…

Hillshading on my Static Maps

In a previous article I wrote about adding maps to my blog, which is a static site. I use these maps to write about walks I’ve done. These maps can be dragged, rotated and zoomed, but there is no backend tileserver supporting it, it all comes from a single static file. This is thanks to the PMTiles format and support by the frontend renderer maplibre-gl. In the original article I took a…

West Highland Way

The West Highland Way is a waymarked, long-distance path in Scotland. It starts just north of Glasgow and ends at Fort William in the Highlands. It is probably the most famous of Scotland’s Great Trails (similar to the National Trails in England and Wales). In September 2024 I walked the West Highland Way over seven days with my partner Vicki . Planning At 154 km the WHW will take most…

Kubernetes Ingress vs Load Balancer

I’ve been using Kubernetes successfully for a while, but I felt like I still didn’t fully understand the difference between an Ingress and a LoadBalancer. Whenever I tried to find an explanation I’d find some vague thing like “they are sort of the same, but not really”. The problem is I was thinking about these things wrong. One is not a replacement for the other;…

Make Reading a Habit

Habits are really important. Long-term goals are too but, ultimately, habits are what you are doing to yourself day in, day out. Your habits determine what goes into your body (your diet), your physical condition (diet and exercise) and your mental condition (sleep and everything else). I think you should make reading one of your habits. The benefits of reading are many. First of all, it’s a…

Odd Problem Accessing OPNsense Web UI via "OPT1" Interface

I ran into a weird problem where I couldn’t access the OPNsense web UI using an OPT1 interface. The fix is easy, but it can be very confusing and it’s all caused by an unintuitive default. tl;dr If you can’t access the web UI via an OPT1 interface, try disabling the “reply-to” feature: https://docs.opnsense.org/manual/interfaces.html I’ve been playing around…

Git is a Version Control System

The title of this post isn’t supposed to be provocative. After all, it’s simply the textbook definition of what git is. So why bother stating it? Well, I’ve worked with a fair few junior developers now and I’m starting to see a pattern. Many of these developers have never programmed without git and they see git simply as “the way to get new code into a…

Norfolk Coast Path

The Norfolk Coast Path (NCP) is a waymarked, long-distance footpath and National Trail in England. It stretches from Hunstanton all the way along the Norfolk coastline to Hopton. I walked it with my partner Vicki over the course of seven days in September 2022. Planning The NCP is around 135 km (83 miles) long and quite flat. The way is mostly on good, well trodden paths with some slower sections…

Emacs Undo Redo

At first glance, undo seems like a simple thing expected of most software these days and hardly worth writing about. Indeed, when I say Emacs has a very powerful undo system—probably more so than any other text editor—you may wonder what could make an undo system powerful. So let’s start by considering two big problems most undo systems have: If you undo something, make some…

Bash History Hacks

When you work a lot on the command line, history can be invaluable. I’ve lost count of the number of times I’ve forgotten how I ran some earlier command and used my bash history to find out what it was. This is one of the big advantages of using CLIs over GUIs. Accessing history The main interface I use to my history is ^P ( Ctrl-P ). This recalls the previous command from history.…

A Lament for the Firefox Quick Find Key

For as long as I’ve been a Firefox user—almost 20 years at this point—it has featured a “quick find” bound to the venerable / (forward slash) key. Following a pattern established by other software like less , man , and vi the slash key was simple: it finds stuff in the current page. Common patterns like this are great. It’s why everyone has agreed on what Ctrl-C…

Using Nerd Icons in Org Agenda

Org mode supports icons in its agenda views. The icons can be given as either file paths to images (like SVGs), as image data or as a display property. I use a Nerd Font along with the nerd-icons package in my Emacs config, so I thought I might as well enable icons in my org agenda views. The nice thing about using nerd fonts is this works perfectly in text mode too (assuming you have a nerd font…

Custom Static Vector Maps on your Hugo Static Site

This blog is a static site built with Hugo . Being static means it can be served from a basic, standard (you might say stupid ) web server with no server-side scripting at all. In fact, this blog is currently hosted on Github Pages, but it could be anywhere. Up until now, if you wanted to include an interactive map on a static site you were limited to using an external service like Google Maps or…

Working on Multiple Web Projects with Docker Compose and Traefik

Docker Compose is a brilliant tool for bringing up local development environments for web projects. But working with multiple projects can be a pain due to clashes. For example, all projects want to listen to port 80 (or perhaps one of the super common higher ones like 8000 etc.). This forces developers to only bring one project up at a time, or hack the compose files to change the port numbers.

Resolving Private IP Addresses with pfSense DNS Resolver

I use the Unbound DNS resolver built in to pfSense. By default the resolver filters out any results that are private IP addresses. Normally this makes sense: no public domain should have a private address. But sometimes it does make sense. For example there are some useful services like sslip.io that will resolve to any IP address that you like. So 127.0.0.1.sslip.io resolves to to 127.0.0.1 .…

Why is Emacs Hanging?

Even after using Emacs for 15 years there’s still so much I can learn. I probably should have already known this, but there’s a first time for everything. It’s rare that Emacs hangs. Exceedingly rare. Which is probably why I didn’t know how to deal with it. Today Emacs started hanging when trying to open files over a remote TRAMP session (SSH). The most important key of all…

Replacing Strings in an Entire Project

This is a little trick I just applied and thought was cool enough to write down. Let’s say you want to replace a name that is used throughout a project. Due to various conventions/restrictions in use the name might appear in several forms like: MY_COOL_NAME , my-cool-name , my_cool_name etc. In Emacs you can invoke regexp replace across an entire project by invoking…

My 2023 Emacs Python Setup

I’ve been using Emacs for almost 15 years now. Somewhat surprisingly, I hadn’t touched my config in three years! It’s been working that well. But now that Emacs 29 has been released I’ve decided to take a look at what’s new and there have been some big changes, particularly for Python. Goodbye Elpy, Goodbye Projectile Elpy has been the primary mode for Python…

Install Calibre without Root

On Linux, software should generally be installed with your system package manager (apt, yum, portage etc.) However, Calibre is a bit “special” in this respect. While well-loved, it’s known to be a bit difficult to package (to say the least) and most distro packages you’ll find are out of date. The official website recommends against using any distro packages and instead…

Cooking with Make

In which I compare cooking food with building software

Arduino Programming with Emacs

If you want to start Arduino programming you’ll notice a lot of the documentation and tutorials are centred around the Arduino IDE. Now, obviously, as an Emacs user you’ll be loath to install something like Arduino IDE, let alone actually use it. The good news is it’s super easy to get started with Arduino with any editor, including Emacs and even Vim if you so desire. All the…

Building a Home Cinema on a Shoestring

I love going to the cinema, but I’ve always been disappointed that I can’t see older films and I can’t see them when it’s convenient for me. There have always been ways to watch films at home, but even today when large screens and high-definition formats are ubiquitous, it’s just not the same as the cinema experience. There’s something completely different about…

Writing a Blog with Org-mode

I’ve always thought I should write a blog, but I just never got around to setting it up. I know there are services you can simply sign up to and start writing, but that isn’t for me. I have two requirements for this thing: I can write using tools of my choice, I can host it anywhere. My tool of choice for writing anything is emacs and, for natural language in particular, org-mode .…