atomicules

Mostly walking the dogs

Optimised Battery Charging On A Netbsd Thinkpad

NetBSD 11 introduced new battery controls for thinkpads (I can’t actually find them documented properly, I just stumbled across them because of this post). On their own I don’t think they are that useful, i.e. I can set these in /etc/sysctl.conf:

hw.acpi.thinkpad0.bat0.charge_start=75
hw.acpi.thinkpad0.bat0.charge_stop=80
hw.acpi.thinkpad0.bat1.charge_start=75
hw.acpi.thinkpad0.bat1.charge_stop=80

But this just means whenever I unplug it I’m already at 80% battery and even with two of the things I only get about three and a half hours usage from that point. So instead I’m trying to eek out a bit more and mimicking the “optimised battery charging” approach and using those in combination with a crontab entries of:

0       7       *       *       *       /sbin/sysctl -w hw.acpi.thinkpad0.bat0.charge_start=85 hw.acpi.thinkpad0.bat1.charge_start=85 hw.acpi.thinkpad0.bat0.charge_stop=95 hw.acpi.thinkpad0.bat1.charge_stop=95
0       8       *       *       *       /sbin/sysctl -w hw.acpi.thinkpad0.bat0.charge_start=75 hw.acpi.thinkpad0.bat1.charge_start=75 /sbin/sysctl -w hw.acpi.thinkpad0.bat0.charge_stop=80 hw.acpi.thinkpad0.bat1.charge_stop=80

I.e. so overnight when plugged in it’ll charge to 80% and sit at that until the morning when it’ll then charge up to 95%. I can adjust those times to suit. I’m probably not unplugging it that early in the morning, I’ll just be sat in front of it plugged in. So I might push those out by a couple of hours. This does mean this is only a one-shot kind of thing - if I re-plug it in in the daytime it’ll just charge to 80%, but that’s fair enough.

I did wonder if instead of using a second crontab entry to drop back down to 80 whether I could make use of /etc/powerd/scripts/sensor_battery, but the batteries don’t seem to have default entries for warning-capacity, high-capacity, etc and I would need to figure out setting those via envstat which seems more hassle than it’s worth if a simple cron entry does the trick.

Later Famous For Mathematics And Anger

"It was not long after this that Monica Douglas, later famous for mathematics and anger, claimed that she had seen Mr Lloyd in the act of kissing Miss Brodie"

— The Prime of Miss Jean Brodie by Muriel Spark

I feel like those two things go hand in hand.

Took me ages to finish reading this (thanks to the moving upheaval) and it’s only a little book. I should probably watch the film now.

LINK: Vagrant Real Estate Wins Scottish Album Of The Year

Aberdeen represent. Felt proud even though my entire contribution is not living there any more and listening to this when it came out last year.

The All I Want track is a banger and made it onto my favourites of last year list.

Note: In the first four weeks since moving my Garmin Body Battery was only over 75 twice. Prime for a run today. If we had a bathroom.

Aberdream

Subtitled: The North is my True North

Subtitled: Scot-ish, but not Scottish*

Subtitled: Where are you from?

A month after having moved I’m finally getting around to publishing this. It has been a busy month.

I should have realised when I moved southwards for the first time in my life a few years ago (only by 30km or so) that that was just the beginning and things weren’t going to stabilise there. It’s a shame: I always thought I’d end up even further north, but it’s not to be; North of England isn’t really north enough for me, but it’s better than nothing.

Having recently left Aberdeen I wanted to write something about it. I feel like Aberdeen unfairly gets a bad rap, but I am actually the only person I know that rates it - it is my “home” (my second after Huddersfield). So I’ll try not to focus on the negatives since I feel like that is the majority of opinion, but the one thing I will mention is the oil and gas legacy and the fact that what happened was the exact opposite of “Private sufficiency: Public luxury” was unfortunate - in my opinion the worse thing about Aberdeen is getting to or from there from literally anywhere else; Better transport links between the rest of Scotland should have been built decades ago instead of relying on air. Aberdeen really is miles away from everywhere else.

Most of our time up here was been spent in the country-side, but we’ve lived (in order) in the: city, suburbs, village, middle of nowhere, and finally back in the city. So we’ve been fortunate enough to experience a lot of different parts of Aberdeen and Aberdeenshire.

The best bits:

  • Long summer nights. Summer is so tiring because you forget to go to bed and then it’s light again a few hours later. I absolutely love it though.
  • Multi-cultural (Perhaps less so now?). But at one point you’d come across French, Nigerian, Spanish, Italian, Scottish, Polish, etc in just one walk through town. It’s a beautiful thing
  • Stunning architecture if you look for it; The granite buildings genuinely do sparkle - unfortunately it does seem to take a certain angle of sunlight, etc so doesn’t happen very often.
  • A city surrounded by beautiful countryside.
    • There is a lot of nature on your doorstep that seems to get overlooked by a lot of people in Aberdeen:
      • Tullos
      • Kincorth
      • Tollohill
      • Brimmond Hill (and Elrick!)
      • Cove Coastal path

      All of these are within running distance of the city centre.

    • Further afield are things like Bennachie (which you can bus + run to)
  • Stunning beaches. There is obviously the huge stretch of beach front just minutes from the city centre, but my favourites have been Collieston and Cruden bay.
  • Wildlife. Being able to see seals in Bridge of Don or Newburgh, seeing deer at Tullos and Tollohill, seeing otters in the river Dee.
  • Butteries

All cities and towns have their issues and rundown parts of the high-street. Frustratingly all cities and towns also have those businesses and events that attracted you to that place (friggin’ Belmont Cinema) that then seem to close down or stop running a few weeks after you move. But at the time of writing these wonderful places are as good as anywhere else in the UK (or world?) for food and coffee (if you end up in a chain coffee-shop in Aberdeen you’ve gone wrong):

  • Rosa’s Sicilian Pizzeria
  • Craftsman
  • Grounded
  • Parx (the veggie breakfast burrito is better than the meat once since it has veggie square sausage instead of bacon)
  • Cafe 52
  • Cafe Boheme (the vegan items are insanely good)
  • Cafe Harmony (completing the trifecta of Cafes)
  • Cult of Coffee
  • Third Circle
  • Foodstory
  • Hammerton

Those are my favourites, but there are more. Aberdeen has also treated me well for music venues. Being far away from everywhere it mostly seems to get smaller bands or huge bands, but I love:

  • Music hall (Mostly older bands touring here, like Suede, Embrace, The Wombats)
  • Lemontree (saw Shelf Lives and Lambrini Girls, amongst others)
  • Cafe Drummonds (saw SPINN here, massively underated band from Liverpool)
  • Tunnels (Lots of great things: Dead Pony, Plasticine, Gomez (that was a messy Sunday night))
  • Krakatoa (saw Coach Party here)

I do have some regrets, but not from living there, just things I didn’t get to do that I thought I’d have time for “one day”, but that day never came. This is a definite downside to me patiently waiting and not demanding things:

  • Only got the the Cairngorms for the Lonach Gathering, never to explore anywhere else or for running
  • Never got over to the West coast
  • Never got to Orkney or Shetland (and there is a ferry from Aberdeen!)
  • Never got to Belladrum (gutted - in my head that was one of my must dos before leaving)
  • Never got to Inverness

So much of my life (those winters cycling! Oh my), my daughters’ childhoods, our marriage, etc was made in Aberdeen that I was always going to have fond memories of it and be sad about leaving. Could Aberdeen have technically been anywhere else? Yeah, sure, but it wasn’t. My memories are rooted in the countryside, the city and the coastline. I’m just grateful that I realised it wasn’t an Aberdream, but beautiful reality.


* Not because I don’t want to be, just because I can’t claim to be (my daughters on the other-hand just are Scottish). If there was a way I could officially give up my nationality and become Scottish I would do it in a heartbeat; I was holding out for a Scottish passport and re-joining the EU becoming a thing for a long time; Will forever be proud I voted for independence.

This is why I was ok with moving (of course, being closer to both daughter’s too). Hoping to get up there again soon in better weather. Should be able to pick up the pace a bit once I have more of a clue where on earth I’m going and aren’t recovering from being ill.

Back-filled this one by a few days. Still so busy post-moving

Note: Farewell beautiful Aberdeen. More words soon.

Probably my last time doing this run. I’m not dying, just moving (although I felt like I was dying at the end of that run).

Note: Belatedly got around to listening to Holly Humberstone's new album and To Love Somebody is one of my favourite songs of the year!

Notes On Building Hammerdb On Netbsd Part 2

Was going to edit the original post, but was easier to do a new one.

Went back to this again recently to make some better changes (did not mean to take two months… sigh) and it wouldn’t build! I’d either completely forgotten some of the steps I took last time or the build has changed a bit? Note that even though my changes are still on HammerDB 5.0 that doesn’t mean there haven’t been upstream changes - The HammerDB source code you obtain from Github is more like a “build system” as opposed to the actual source you are compiling. When you build from source you are actually running Tcl scripts that download source code from the TPC/HammerDB website and then it builds that.

Anyway, further to last time ended up doing this:

  1. Turns out I did need to do this bit:

     sudo ln -s /usr/pkg/bin/python3.12-config /usr/pkg/bin/python3-config
    
  2. Running a ./Build-Linux.sh x64 Setup/HammerDB-Linux.bawt update would fail because the Makefiles wanted to use -ldl which isn’t applicable for (Net)BSD. So instead I stepped through the process manually:
    1. ./Build-Linux.sh x64 Setup/HammerDB-Linux.bawt extract.
    2. ./Build-Linux.sh x64 Setup/HammerDB-Linux.bawt configure.
    3. ./Build-Linux.sh x64 Setup/HammerDB-Linux.bawt compile.
    4. Which would then fail, but I could edit the relevant Makefile and remove the -ldl and re-run the compile and repeat this until all components had built.
    5. ./Build-Linux.sh x64 Setup/HammerDB-Linux.bawt distribute.
    6. ./Build-Linux.sh x64 Setup/HammerDB-Linux.bawt finalize. Weirdly, even though I’m sure these are the same steps update does, this didn’t copy all the required libraries into the distributions so I had one final step of:
    7. ./Build-Linux.sh x64 Setup/HammerDB-Linux.bawt update.
  3. That got me working Dev builds again. I also had a play about withstrace/dtrace/ktrace on the Prod builds and figured out they were actually fine, it was just looking for the libraries in an odd place; Say I had extracted at /home/me/temp/HammerDB-5.0, well, it was looking for /home/me/temp/lib. So I just copied the lib folder from a Dev build to that location and then the Prod builds would run fine; I started with strace just for ease of use, but the version on NetBSD is old and doesn’t print full filepaths which makes it useless. ktrace and kdump are pretty easy to use as well, but only if you know what you are looking for upfront and I didn’t, whereas dtrace is more complex, but I could get it to put all filepaths for HammerDB and eyeball a non-existent one:

     syscall::stat:entry, syscall::lstat:entry, syscall::access:entry
     /execname == "hammerdb"/
     {
         self->path = copyinstr(arg0);
         self->probe = probefunc;
     }
     syscall::stat:return, syscall::lstat:return, syscall::access:return
     /execname == "hammerdb" && self->path != NULL/
     {
         printf("%d %s %s errno=%d\n", pid, self->probe, self->path, errno);
         self->path = 0;
     }
    

Next for me on this: Figuring out a better Makefile fix so that’s less tedious to do. And it might not be impossible to do a Pkgsrc package for this since the separate steps (extract, configure, etc) would align with Pkgsrc.

Your Eyeball Is Not A Well Defined Statistical Procedure

"Your eyeball is not a well defined statistical procedure"

In a past-life I ended up doing quite a bit of statistics. There is some evidence on this blog and I even linked to this website before it was the website it is now and before it was a physical book. Bought the physical book recently and have been reading (re-reading?) it due to a change of role where I’m hopeful I can make use of some statistics again (I have already managed a bit of R ♡).

LINK: Claude Container

There are many different blog posts and repos out there for running Claude in a container, but this was one of the first I found and I liked its simplicity (over options like this).

Made some tweaks to this so I could use it at work with our evil MITM TLS.

Seems pretty good. Limitations so far:

  • Can’t run pre-commit (I could try to support this in the container, but not that bothered as I can run myself)
  • Can only commit with --no-verify (linked to above and also can’t sign my commits since I’m using 1Password for my ssh keys and it can’t trigger that from the container)

But… I feel far more comfortable running it this way and I don’t have to babysit it.

75+75+75+75

A follow-up to 75+75.

I started trying to ramp things up over my base of 75 minutes of running a week at the end of 2023 - I just thought it was sad to let go all those years of work building up my distance. And on and off I’ve managed to do it. I managed nine Brimmond Hill (24km) runs last year, plus one Bennachie (21km, but totalling around 27km with the runs to and from the bus to get there). This year I’ve managed three Brimmond and Elrick (30km) runs. None of that is possible with a limit of just 75 minutes running.

I still struggle for time for running, especially now the dog is so old and can’t really be left alone for more than three hours at a time, but I do want to try to keep my distance up a bit so I’m trying a new weekly base of:

  • 225 minutes running
  • 75 minutes of strength/yoga

Roughly working out as:

  • Mon: 75 minutes of running
  • Tue: 25 minutes of strength
  • Wed: 75 minutes of running
  • Thu: 25 minutes of strength
  • Fri: 75 minutes of running
  • Sat:
  • Sun: 25 minutes of yoga

Although I could do with squeezing in the yoga in the week so it doesn’t interfere with weekends.

If I am lucky enough to find the time to fit in a long run (two to three hours) then all the better. But if need be I can also split the 75 minutes between mornings and evenings.

This actually only works out as 3% of my time - 75+75 was 1.5% - which still feels very reasonable and non-selfish to me, but it’s not my opinion that matters. Maybe one day I can have 3% of my wage as well, but that’s staying at 1.5% for the next couple of years at least.

My dog walking has rapidly decreased due to the age of the dog. She just can’t walk very far any more :-(. Doing more walks a day, just very short.


[EDIT: 2026-10-21] And then we moved house. I don’t know what it is about moving, but it always seems to change things permanently for me, even after things have settled. I did manage a seven week streak of 225 minutes running a week, but I can’t see that happening anymore. Plus I really need to collapse everything down to weekdays only. Maybe I’ll be able to do 2% of my time, ~125 minutes of running?

These are the ten most recent posts (not counting any note drivel), for older posts see the Archive.