Pragmatism in the real world

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.

Moving a Perforce P4 P4ROOT to a different drive

On one of my servers here, I run a local Perforce P4 server for my son. He's a game developer and as they use P4 at work, he wanted to learn it in a sandbox and to have somewhere familiar to put his own work. Installation onto Ubuntu was easy enough and I provided access outside of our local network via Tailscale and all was well. Recently, I was doing some admin-stuff on the server… continue reading.

Updated rst2pdf website

Earlier this year, Lorna spent some time updating rst2pdf's website to use Sphinx. The nice thing about Sphinx is that it uses restructuredText, the same as rst2pdf does, so we now stay in the same ecosystem. While, we could have continued using Jekyll, it makes much more sense for us to use the same markup language as we use for the main tool, and our manual is written in it too. With the Jekyll system,… continue reading.

Using OneOf for a property in an OpenAPI spec

When writing an OpenAPI specification, I came across the need for a particular property in an error response to be either a string or an object. This situation came about when validating a POST request that takes an items property that is a list of objects As a contrived example of a pet with accessories, consider this example request in curl: curl -X "POST" "http://api.example.com/pets" \ -H 'Content-Type: application/json' \ -d $'{ "name": "Rover", "items": [… continue reading.

Additional parameters on a PHP interface method

On the Roave Discord recently, there was a discussion about not breaking BC in interfaces inspired by this post by Jérôme Tamarelle: It's clearly true that if you add a new parameter to a method on an interface, then that's a BC break as every concrete implementation of the interface needs to change their signature. However, Gina commented that you don't need to use func_get_arg() as concrete implementations can add additional optional arguments. WHAT?!!! I… continue reading.

Some thoughts on LLM usage in my work

While it would be nice to put the genie back in the bottle, that hasn't happened often in human history, so for the foreseeable future, AI in the form of LLMs are here to stay. I imagine that what we use them for will change over time as we collectively internalise their limitations. Personally, I'm now using them for my work as much as I reasonably can. This is involving many different areas, such as… continue reading.

Previewing OpenAPI specs using redocly's Docker container

To provide consistency between the environments of our developers, I'm a strong proponent of using containers so that every developer is using the same versions of our tools. This is really important for command line tooling that depends on a separately installed language such as NodeJS or PHP as a simple npm i -g can install wildly different versions if a dev is running an older (or newer!) version of Node. For OpenAPI specs, listing… continue reading.