This website is not masterful. It is devoted to things I do either because they need doing, or because I enjoy doing them, and which someone else might possibly want to do. Perhaps if my mistakes are included here in enough detail someone else might not make them…

I am not an engineer, or a software developer, or a mechanic, or a carpenter, or a bookbinder, or anything else I might pretend to be on these pages. I am just an Amateur, but in real life I’m a PhD student in Theology. Except insofar as the aformentioned things I am not come in to it, this is unlikely to be apparent here.

This website is purely static, and is the successor to a wordpress blog.

Repairing an Electric Scooter

Here is one of those electric scooters, already anaethetised ready for surgery. It’s in a pretty sorry state: the front fork has sheared right off and is bent and mangled, while the steering bearing is loose and wobbles alarmingly. The thing is almost impossible to open, but can be forced.

Too Many Directories

My PhD has too many directories in it.

I have—currently—three parts, and each of those has several chapters. All the chapters have been written independently, so I have a structure which more or less looks like this:

titlepage.tex
thesis.tex
-- 1.part1
  |
  +- 1.chapter1
    |
    +-- standalone.tex
    +-- title.tex
    +-- chapter1.tex
  +- 2.chapter2

etc, only with three parts and sensible names. Each of the chapters builds to a separate pdf with standalone.tex, but now the Final Thing is upon me and I needed to write thesis.tex.

[Read More]

Migrating Home Assistant (and thoughts on over-engineering)

Home Automation is largely a gimmic. Even the founder of Home Assistant writes blog posts pointing out that turning the lights on from your phone is pretty pointless, except for showing off (not that I’ve ever turned a light on from my phone to show off…). Another of these posts tries to think of a useful smart light and comes up with:

Imagine a brave new world where you walk into a room and the light is already on, as you have naturally come to expect after years of living with such a technology. When you leave the room the light is turned off and nobody even takes note of it because it is completely taken for granted. This leaves you more mental capactiy to worry about other things.

[Read More]

Hacked

I got hacked.

There are all kinds of fun exploits people use to get into systems they’re not supposed to be in. In my case they used ssh. Normally ssh is secure. None of my passwords are brute-forceable. (Yes, you shouldn’t have public-facing password ssh… but that’s no fun when you’re on someone else’s computer and need to get in in a hurry.) But in a moment of weakness I had needed a blank slate to test an environment regression against. So I did useradd test with the password test, and set up a home directory and shell. It was only supposed to last ten minutes. I suppose I must have been called away.

[Read More]

Tracking down a faulty ABS sensor

Like many ageing Honda Civics our VSA and ABS lights have been coming on sporadically for the last few months. Now they’re stuck on all the time.

First I suspected the battery, so I duly measured the no-load voltage (~12.6V: not great, but not awful either), the voltage dip when running the fuel pumps, (~11.6V) and the voltage dip when starting (briefly around 10V, but I didn’t have a scope on it). Yep, the battery is ageing. What about its internal resistance? Everyone did this at school, right—you put a load across the battery, measure the current through the load and the voltage across the terminals before and after; then you assume that voltage was dropped across the internal resistance and do R=V/I. The trouble is that the voltage drop is tiny, so you need a reasonable current. I couldn’t find any decent loads, but any load will do if you have an ammeter in series, so I disconnected the negative lead and used the car itself. Since the alarm promptly started going off (next time lock the car door!) that formed one data point, and then I turned the running lights on for the other. With the multimeter in relative mode even the subtraction was done for me:

[Read More]

Ignition Barrel Repair

Halfway down the country, at 7.30 in the morning (having been on the road since 5.30) the key stopped turning in the ignition. We have an old (‘06) Honda Civic, and the AA man blamed the age. He was able to force the key round, doing much the same thing I’d been doing, only more effectively, and we drove on, to repeat the same rigmarole the next time it was started. The AA had been free (it turned out the car had cover from being serviced at a Honda dealership), but a locksmith wasn’t going to be. Thus I ran to screwfix and bought a screwdriver and removed the plastics in a slightly wet carpark in Bedford: but I couldn’t get the last screw to get the antenna off the barrel, and anyhow it wasn’t coming without more tools. Thus after fighting for long enough it turned, and the car was driven down to London and put in the garage; and we went off on holiday.

[Read More]

Python Is (sort-of) Functional

I recently had to parse a csv file which looks like this:

"key","val"
"key","val"
"key","val"

"col1","col2","col3","col4"
... row data here

The obvious, imperative solution would be:

from csv import DictReader

def parse(f):
    props = {}
    
    for line in  f:
        if not line.strip():
            break
        k, v = line.strip().replace('"', "").split(",")
        props[k] = v

    reader = DictReader(f)
    data = list(reader)

    return props, data

With the walrus operator we can save a few lines at the cost of non-obvious syntax:

def parse(f):
    props = {}
    while line := next(f).strip():
        ...

I suppose there might be people who think that is neat.

[Read More]

“Modern Authentication”: Outlook365 in Emacs

A few weeks ago I received an email from the university stating:

Further to our previous communication advising about a change to basic authentication for Durham mailboxes, on 28th October 2021 we will be removing the ability to connect to University email via IMAP and our records indicate that you currently access email in this way.

This, apparently, is down to the fact that

Basic authentication is no longer secure enough to support modern working as it does not support security features such as Multi-Factor Authentication (MFA). Using modern authentication will mean we can protect our mailboxes from unauthorised access, however, this does mean that email clients configured to use legacy authentication will stop working.

[Read More]

ClosedFridge: RIP OpenFridge

Refrigerate in peace, OpenFridge.

The hardware OpenFridge was controlling is no more. It now looks like this:

Obviously, it should not look like this. What follows is a post-mortem, because it is worth learning from one’s mistakes.

The final moments of a fridge

After fixing the defrost I did not get around to replacing the blown thermal fuse. The Chinese sensors were supplied with some kind of wire which breaks if you so much as look at it, and I was afraid I would knock the wire at some point and crash the system. Two nights ago, putting something in the fridge, I knocked one block and wondered if I had indeed snapped the wire—but I didn’t look. Last night my wife complained that the fridge was ‘melting’, at which point I assumed the sensor had indeed failed, and the fridge had used stale data and failed to cool. No, she meant the fridge was melting, or more specifically the freezer: the plastic has melted, flown down into the heat exchange, and then fused in situ. The whole thing is now one lump and cannot be separated.

[Read More]

Plane Repair

Exactly how flat does a sharpening stone need to be? Exactly how flat, for that matter, does a plane need to be?

I’m on holiday. Here is a toy plane, a soft building block, and a half brick (not cut by me):

/img/plane-repair/plane1.jpg

The plane started out rather rusty, as did the iron (why do I always forget to take ‘before’ photos?). The plane sole, lubricated with water, was used to flatten off the soft building block, and it was then used to take the rust off the iron. The half-brick did a much better job of sharpening, but it wasn’t perfect. Then I found a better stone:

[Read More]