bjorn.now

#how-to

Tutorial-style posts with concrete steps

28 August, 2026

Reset an IKEA Kajplats lightbulb by power cycling it 6 times and then leaving it on until it blinks, then it’ll be in pairing mode again. Thanks fishymanbits on Reddit!

Step by step:

  1. Turn off the bulb for 30s
  2. Power cycle 6 times; on until it lights up, off immediately, count “one one thousand”, repeat
  3. On the sixth on, leave it on and wait
  4. When the bulb blinks it’ll be in pairing mode again

Matter over Thread requires IPv6 on your local network, so if you can’t pair the IKEA Kajplats bulb that might be why.

I didn’t have IPv6 enabled, and my ISP doesn’t assign IPv6, so I used unique-local-ipv6.com to get a unique prefix. Configured it as static in my local network setup, alongside the IPv4 configuration, on my UniFi Dream Machine and then all my bulbs connected.

Now my niece is learning to pronounce English colors as she cycles my apartment through every shade of the rainbow 😁

08 October, 2025

The regex | (or) operator splits the pattern left or right unless explicitly grouped. Group it using (pattern) if you need to use the match later, or as a non-capturing group (?:pattern) if you do it for clarity.

I used to think there was some magic rule about how | decided where to split, but it’s simply: characters and subpatterns concatenate into a single pattern first, then | splits the entire thing left and right unless you explicitly group it. That’s because | has the lowest precedence so all other operations happen first.

So while I used to think that prefix_cat|dog would match prefix_cat and prefix_dog, it actually matches prefix_cat and then dog.

And that exact problem in a real-world example, to find if a page is linking to another, both relative or full URL:

[… more]
til Updated 2 min read #how-to, #regex, #background-work

01 October, 2025

Use curl -k --resolve bjorn.now:443:127.0.0.1 https://bjorn.now when testing an HTTPS site locally using Caddy, instead of curl -k -H "Host: bjorn.now" https://localhost, because Caddy relies on SNI and refuses the connection if it doesn’t know which host you’re trying to connect to.

[… more]
til 2 min read #how-to, #linux

17 September, 2025

to refresh a link preview in Telegram open a chat with Webpage Bot and send the URL, for those cases where you fix a typo or update the image.

07 September, 2025

Arvid Nordquist mellanrost coffee recipe

…making do without the gooseneck

My recipe for Arvid Nordquist mellanrost. I started by trying to replicate The Ultimate V60 technique by James Hoffmann (which is what I normally brew) and I realized just how hard it is to control the flow rate now that I don’t have my gooseneck kettle (being shipped from Singapore), and I hadn’t really realized just what a difference controlling the pour makes for the taste!

Coffee brewing setup on a wooden surface showing a Commandante hand grinder with wooden knob, a white V60 dripper with filter paper on a mug, a bag of Arvid Nordquist Mellanrost coffee, a digital scale reading 253g, and a stainless steel electric kettle.

My current brewing setup which has my Commandante grinder and V60 and then a normal wide spout kettle which gives me very poor flow control, and a bag of Arvid Nordquist mellanrost

[… more]
blog 4 min read #how-to, #genie

01 August, 2025

You can enable the fingerprint reader for sudo on macOS, and pressing my finger on a button beats having to type the password, steps:

  1. cp /etc/pam.d/sudo_local{.template,}
  2. Edit /etc/pam.d/sudo_local and uncomment auth sufficient pam_tid.so.

The reason for doing this in sudo_local is that this file will not get reset with system changes from Apple.

til Singapore • #how-to, #macos

07 July, 2025

Working with Go's test cache on CI

be fast by avoiding work, while doing the important work

I was trying to speed up our slow CI by caching Go builds. The easy win was caching Go’s module downloads (via GOPATH), but when I added GOCACHE for the build cache, I got a pleasant surprise: the tests were caching too. 🥳

I shared the change for review, and a colleague raised a great point: “What about our black box integration tests?” These tests hit APIs and external services that Go can’t track as dependencies. If they cache when they shouldn’t, we might miss real failures: the tests would pass because they didn’t re-run, not because the code actually works.

[… more]
blog Updated 8 min read Singapore • #how-to, #golang, #ci, #testing, #integration-testing

15 April, 2024

Day-to-day automation using Alfred on your Mac

reducing TOIL outside of your DevOps practice

I try to be aware of where I have friction in my day-to-day when working at my computer, keeping an eye out for TOIL to remove. Whether it’s from manually repeated actions, or from differing behaviors across apps and services I use. When I identify any of these I try to spend some small amount of time automating or changing how I work to improve.

All of these things don’t necessarily make a lot of sense from how much time I save, but, it also makes me happy to spend a bit of time improving my environment, and spending a bit of time to make me happy is good enough for me.

[… more]
blog Updated 12 min read Singapore • #how-to, #automation, #alfredapp, #productivity, #macos

01 February, 2024

05 February, 2022

Sticky blocks in Roam

floating along in your sidebar

I use Roam Research as my primary way of thinking and keeping track of tasks. My current workflow has me creating a list of all tasks I want to get done, and then I drag them to either Done or some follow-up/waiting area for future action. So I only see things I can act on now.

My list of things to action can get quite long, and when I’m processing follow-up items, I would have a hard time dragging them to Done because it was too far away in the sidebar. So I wished I would make the Done float with me, so I could always have a quick way of pulling it there.

[… more]
blog 3 min read Singapore • #roam-research, #how-to

14 November, 2015

How to find your Apple Watch when you've misplaced it

How I ended up being a sonar bear

I just misplaced my Apple Watch in my apartment. Walking around looking for it, and getting frustrated, I was thinking, “There ought to be a way to make it make some sound, then I can play Marco Polo with the watch”. But my Google-fu failed me: no obvious way to “ping my watch”. There’s functionality for pinging the phone from the watch though.

But there’s a way to make some noise: testing out the alert volume in the companion app on the phone.

[… more]
blog 1 min read Singapore • #how-to

07 January, 2011

Keeping your Varnish farms configuration in sync

I spend some of my free time helping out with server administration and programming for the Swedish Pirate Party, Piratpartiet (look ma, X-Varnish), and we use Varnish for our caches. At the moment it’s just used on some of our projects, but we’re going to migrate most of our projects to be behind our Varnish caches.

The thing is though that we got two hosts running the exact same configuration, and we’d like to keep those hosts in sync. A quick search on Google gave me nothing for syncing varnish configuration over several hosts, or a farm as it were. So I took matters into my own hands and wrote varnishsync, a little bash script that uses rsync and ssh to sync the configuration folder and then to load and use the new configuration.

[… more]
blog 1 min read #how-to, #linux

05 December, 2010

How to: Setting up a Wikileaks mirror

Yesterday I wrote a quick step-by-step guide for installing apache and setting your system up for Wikileaks mass-mirror project in Swedish and I’ve had requests for it to be translated into English.

This guide assumes you’re running Ubuntu or a Debian based system.

I’ve made a script that does all the steps below, feel free to use it!
The script: http://sanitarium.se/files/wikileaks-mirror.sh
Usage: wget http://sanitarium.se/files/wikileaks-mirror.sh && chmod +x wikileaks-mirror.sh && ./wikileaks-mirror.sh

Installing Apache and adding the wikileaks user

# is the prompt as root:

[… more]
blog 2 min read #how-to, #linux

04 December, 2010

How to: Sätta upp en Wikileaksspegling

A translation of this post is available in English.

En kommentar i Rick Falkvinges inlägg Fullt krig om informationen så efterfrågades en snabbguide för att dra igång en Wikileaksspegling i ett vanligt Linuxssystem.

Jag utgår från Ubuntu eftersom det är vanligt och vad jag själv använder.

Uppdatering 2010-12-05: Jag har gjort ett script som utför alla stegen nedan, använd gärna det!
Filen: http://sanitarium.se/files/wikileaks-mirror.sh
Användning: wget http://sanitarium.se/files/wikileaks-mirror.sh && chmod +x wikileaks-mirror.sh && ./wikileaks-mirror.sh

Installera Apache

# är prompten som root:

[… more]
blog 2 min read #how-to, #linux

21 February, 2010

How to disable bold fonts in xterm

Why sometimes repeating yourself really does get the message through

I’ve so far in all my travels never found a terminal I like better than xterm, maybe urxvt, but I’ve had a problem disabling bold fonts for a very long time. Update: Seems this is a known bug for xterm.

There are a lot of X resource configuration options that makes you think you can disable bold fonts, but alas, I’ve had no luck with any of them. But if you set the same font for both normal and bold fonts it’ll work! This little gem of knowledge I found as an off-hand remark on a configuration page by Emil Mikulic, thank you!

[… more]
blog 1 min read #how-to, #linux