A brief experience with GitHub Actions and CatLight

After deciding I couldn’t get the URLs I wanted for my blog using Cloudflare Pages without some actual real honest-to-goodness rewrites I had to use GitHub Actions for the first time in anger.

An incredibly powerful platform with a misery-inducing YAML syntax. Little more to be said.

What was nice was the chance to use CatLight for the first time since reading about it a few years ago when Matthew Somerville first mentioned it. At the time he needed to write some code to make the output from GitHub Actions available, but happily this is now built-in and so whilst iterating on my YAML mistakes I was getting nice desktop notifications about it.

I don’t get the chance to write much code any more, but tooling that makes it easier to follow the process from local commit to being aware of whether your commit has worked is always a benefit.

Books of January 2024

First in what is likely to be a short-lived series.

The Murderbot Diaries books 1-7 by Martha Wells, mostly good, mostly novellas and thus totally overpriced at around 10p per page (most other books I compared to came in at between 2 and 5 pence per page). They’re good but not that good. Get them from the library or borrow from a friend.

Lockwood and Co books 1 and 2 by Jonathan Stroud: The Screaming Staircase And The Whispering Skull. These are the two books which made up the first 8-episode season of the Netflix TV show directed by Joe Cornish (which was definitely cancelled before its time). The books were good fun, and the premise (ghosts are overrunning the UK, but only children can see or fight them) was novel and well-executed.

The Kaiju Preservation Society by John Scalzi – more boring than expected given that it won the Locus award and was nominated for the Hugo. Multiverse traversal and kaiju sounds like a good principle. It does not pay off.

Tell me an Ending by Jo Harkin – what happens if you can have memories selectively wiped? And what if you can have the memory of having your memory erased, erased? A good story that I enjoyed.

That’s 11 books in January supported by a whole bunch of novellas in the Murderbot series, and a pace I totally can’t sustain, but it felt good to be reading this number of books again!

Preparing to move from WordPress to Zola

In Feb 2021 I said I was planning on moving from WordPress to Zola. I am still not done. Eking the work out really hasn’t worked. Who’d have thought?

If I didn’t care about maintaining URLs then I would probably be done by now, but I do because, y’know, I desperately want to be cool.

So, important URLs to maintain in priority order:

  1. Main entry point (/blog)
  2. Individual post entry URL (/blog/year/month/title)
  3. Feed URL (/blog/feed)
  4. Year URL (/blog/year/)
  5. Month URL(/blog/year/month)

Nice to have URLs:

  1. Tag URL (/blog/tag/tagname)

URLs I’m going to ignore:

  1. Category URLs (/blog/category/catname/) – I’ll merge this with tags
  2. All pagination URLs (blog/page/x/)

Of the URLs I want to keep only the feed URL looks impossible – I don’t think Zola can create a feed at two levels deep, which means I’ll need a rewrite, which needs I’ll need a host which supports rewrites which I thought meant I’d have to actually get a proper host (like Hetzner’s CAX11) but actually it looks like my plan of hosting on Cloudflare Pages is still good to go because they support redirects!

I’m using a custom plugin to get my content out of WordPress in the first place. I’ll write about that another time.

mdtable-pretty-printer is a plugin for Inkdrop

mdtable-pretty-printer is a plugin for Inkdrop which tidies markdown tables in your notes.

This is the first plugin I’ve written for Inkdrop, and was an interesting experience. Plugins are written in JavaScript, which I don’t write a lot of, and follow React-based patterns which I’m not very familiar with and I ended up having to revert my intended plugin structure (one file with the entrance point and the actual class doing the work in another) to just bundling everything in one file.

The markdown tidying is done by Ian McNaughton’s zero-dependency mdTablePrettyPrinter library, which worked great. It also powers his website https://www.mdtableprettyprinter.com/ which is what I’d been copy/pasting my tables into to tidy them previously.

I don’t recommend using my plugin, instead I recommend table-editor which is far more powerful and formats tables safely with fewer error edge cases than mine, and which I didn’t find until after I’d written my plugin!

Habit forming

Tom Scott has just finished ten years of his weekly Things You Might Not Know series on YouTube.

Simon Willison has written about streak-forming and not holding yourself too tightly to doing something every day – this is something I feel a great sympathy with; there is so much advice about doing something every day, and seeing the streak increase and using your unwillingness to break that streak to inspire you to continue.

This doesn’t work for me. Setting an extrinsic goal (increasing an external value) doesn’t work as well for me as competing with someone else – my intrinsic desire to keep up with or exceed someone else (in particular if I know them) doing something similar is a much stronger motivation.

This is because, as Simon says, life can just get in the way. If it’s an exercise streak and I’m ill for a few days, then I’ll miss my goals and away goes that streak. If it’s a blogging streak and my internet connection goes down on the day I need to make my post then away that goes too. 

The unpredictable impact of externalities can affect your goals too easily. This is disheartening and can lead to abandoning the goal altogether. Far better to build in a certain amount of slack into either your initial expectation or how the streak is being tracked. A lot of goal-tracking processes (and apps), in particular in New Year’s resolution season, don’t seem to take this into account.

I am trying to do more cycling this year; I was doing well last year but injured myself in September and completely fell off the wagon. So this year I’ll be tracking my progress in two ways. Firstly I’m competing with my wife who has also started an exercise programme (and neither of us wants to “lose” to the other – a highly effective motivation!) and secondly I’ve got a physical year-long tracker on the wall in my office where I’m tracking when I do and don’t get on my bike. I’m expecting that there will be full weeks of no cycling (when I’m on holiday and when I’m inevitably ill), but so long as I can keep more green than red across the full year, I’ll be happy. 

Hopefully this will prove to be a far healthier way of both staying on track, and being fair to myself, rather than focusing on simply incrementing a number.

Getting going with Gemini

I’ve been really interested in Gemini space for about a year now, having read the protocol and used a few web proxies to explore Gemini space

I finally gone whole hog and downloaded a Gemini browser, Lagrange on my home computer in order to explore Gemini space better, faster and using the experience the actual Gemini users get. (Kudos to Lagrange for being a browser written in C which actually compiled first time when I wanted to make a small change!)

Gemini has been great!  

It’s incredible to find all these people publishing content on the internet which is totally invisible to the web. It’s been said many times before but it really does feel like the early days of blogging, where people are exploring the new formats, new types of engagement and ways of browsing, editing, uploading and exploring each other’s content.

The limitations of the format (no styles!) means there are some really interesting pieces of functionality in the client, like auto-selecting a colour palette based on the domain name, or adding in-page references or tables of contents as part of the native browser, rather than through a plugin. This works especially well in Gemini because there is no server-side layout to consider, so the browser is free to use the full width of its window to provide affordances in a consistent way across multiple sites.

Another of the really interesting aspects is Titan. This is an extension to the Gemini protocol which allows for editing and uploading of content in Gemini space, in a way much more similar to the original envisioning of the read/write web by Tim Berners-Lee back in the 90s. A good example of this is through using the Phoebe wiki software.

And so the question remains what best to do to join in with this fun?

Well, it turns out that it’s absolutely trivial to run a Gemini server on a Raspberry Pi, of which I have many in a box, and so I chose agate (download binary, execute binary), created some pages, added some firewall rules and lo! up and running!

So, plenty of playing to do now and to see if I can use some conversion tools (and editing discipline) to multi post both to here and its Gemini equivalent. Exciting!

When my bins go out

I had to write some PHP to tell me when to put out my bins because my council doesn’t follow their own rules for collections.

Every week my council organises the collection of our 5 bins – but there is a pattern to how they are collected.

This is a pretty simple pattern, with 3 of the bins going out every week and the two largest (general waste and garden waste) alternating each week.

Except that it’s not. 

What actually happens is that for the first three months the garden waste is collected in the first week and then for the second three months the black bins are collected first, and so on. Mostly this works out fine and it looks like the collections simply alternate each week. But August 2023 (which is in the middle of the third quarter of the year) had 5 weeks, meaning there should have been two weeks in a row where the general waste was not collected, and the garden waste was collected. This did not happen.

This means that the document they provide residents with dates of collections is now wrong. The PDF with this info is also wrong. The way to find out what’s being collected is to use their website. The website does everything using ajax and does not push state to the URL, and so the page with your individual information on it is not bookmarkable. This is annoying.

Luckily, watching the network requests revealed a very simple JSON file that covers the bin collection timing of my area and thus I could extract it trivially to provide the useful service that neither the council leaflet nor website provide.

Prefer planned rework to big bang delivery

We have a few large projects on at work to replace key legacy systems and are discussing how to do that.

Most of the discussions so far have tended to end up in a position where an incremental piece of delivery of the large overall system has been rejected because we know it will require rework later.

In this case, knowing about the rework is good!

For large projects which do not plan to deliver in an incremental way, the total amount of work required is unknown. It is in our interests to make as much of that work as known as possible as early as possible, but if a large system does not go into production until is fully complete, then the amount of bugs and rework to be done are both a) unknown in advance and b) time-critical. This is the worst of all worlds.

Far better is to incrementally deliver over an up-front longer timescale (you’re going to have a longer timescale than your big bang delivery plan accommodates anyway, you can just choose to ignore that fact by drawing a gantt chart of how many days a task 2 years from now will take) and know that what you’re delivering actually works, and that reworking it will be a time-bounded effort because you will have both the experience of doing the delivery and evidence of real-world usage and behaviours of your system.