Pragmatism in the real world

Responding to StreamDeck buttons with Keyboard Maestro

I run Apple Music on my Mac desktop and send the output to my HomePod minis. To control the volume, you need to manipulate the Apple Music volume slider rather than the global volume controls for the Mac. It's easier to press buttons than use a mouse, so I used Keyboard Maestro to respond to two buttons on my Stream Deck instead. This is possible because Keyboard Maestro has a Stream Deck Plugin, so you… continue reading.

Step-debugging Docker Compose NestJS services

I'm working on a NestJS project that uses monorepo mode. It consists of a number of separate microservice applications that each have their own Docker container that are managed in development using Docker Compose. I like step-debugging in my IDE and so needed to set it up for this application. This is what I did. The application setup Each service in our project has its own container in docker-compose.yaml and we use a reverse proxy to… continue reading.

QuickSS: Screenshot the active window on Mac

Back in 2016, I wrote about using QuickGrab to take a screenshot of the active window via a single key press with no mouse use required. It's now 2025 and I'm still using this and Apple has announced that Rosetta 2 will be phased out in a couple of years. As QuickGrab is one of the few Intel-only apps I still use, I thought I'd recompile for Apple Silicon and it was then that I… continue reading.

Notarising a macOS standalone binary

I've been writing a simple Swift command line tool called QuickSS. It's a single file swift file, that I compile to a standalone binaryusing: swiftc quickss.swift -o quickss To distribute it on modern Macs, I need to sign it and then get Apple to notarise it. Signing the binary To sign the binary, you need a "Developer ID Application" certificate from your paid developer account. If you don't have one there already create a new… continue reading.

Using the 1Password CLI in a script

I'm currently writing a script that notarises a macOS CLI app which needs to access a password. Rather than put it in an environment variable, I thought I'd use the 1Password CLI. This is the first time I've used it, so these are my notes. The 1Password CLI tool is call op. I installed it via Homebrew with: brew install 1password-cli Sign in You need to sign in. op signin As I have multiple accounts… continue reading.

Accessing my printer's web app remotely via Tailscale

We have an HP all-in-one scanner and printer that is on our local network. Recently, I was away from home and needed to reconfigure the scanning settings for unimportant reasons. Usually, when I'm not in the office, I use Tailscale to connect back to machines as required, but the printer isn't running Tailscale, so its built-in web app isn't directly available. To solve this problem, I set up Tailscale subnet route on the Linux box… continue reading.

FIxing Linux Tailscale exit node routing

I run a Tailscale network so that remote computers can access local services. I also have a Linux box at home on that network that advertises itself as an exit node and recently noticed that it wasn't working. I had some time recently to sit down and work out what was going on. My initial suspicion was that it was DNS related as a cursory search brought up lots of results related to DNS. However,… continue reading.

Renaming files with Hazel

I'm a member of a number of groups that publish a magazine, either paper-based or PDF. I prefer the PDF version, so download from the website and then move to the relevant directory. Recently, I realised that I could use Hazel to do this for me. To take one example, the filename of the PDF that I download is of the format PE-{issue number}-web{some random characters}.pdf, for example: PE-123-web9j45s3gd.pdf. There's sometimes a hyphen after web,… continue reading.

Updating SMTP relay in postfix

On a server that I help to maintain, it has postfix installed for emailing results of cron jobs and other status updates. This was set up to relay through SendGrid as they had a 100 email per month plan and we send out significantly fewer than that. Unfortunately, SendGrid are retiring their free plan, so I had to move to a new service and picked SMTP2GO and so had to update the postfix configuration. As… continue reading.

Global word count on Mac using Shortcuts

I've had a few cases recently when I wanted to know the number of words that I had written. To do this, I've copied the text to BBEdit which displays the word count in its status bar, but this is a bit of a faff. I finally sat down and created a Shortcut for it that took 10 mins. This is the shortcut: The idea is that I want to select the text and run… continue reading.