A FreeBSD Puppet refresher by Romain Tartière

I mostly live in Ansible land for automation, but I was looking for a quick refresher on Puppet. I didn’t have to look far; FreeBSD’s Romain Tartière did a talk at BSDCan 2018, and his slides are still available. This made my morning!

Thanks to BSDCan for continuing to make these resources available.


Fourier transforming X-ray diffraction patterns before computers

I came to newbedev’s site for some help solving a specific FreeBSD problem, but stayed over lunch reading chemistry Q&A posts. I’m glad someone out there set the record straight on the efficacy of vinegar and bicarb soda as cleaning products, for example.

Here’s their answer for how x-ray diffraction patterns were deciphered before computers:

Diffraction data was measured on film, with gray-scales to assess intensity of signals. To calculate a Fourier transform, pre-computed tables were used, such as the Beevers-Lipson strips. As Andselisk commented, Fourier transform was used late in the 20s, and initially for problems that were one- or two-dimensional.

Not just in the ’20s but up to the ’90s at least, the d-spacings were estimated by hand measurements of diffractometer peaks or film lines and applying the Bragg formula.

I had to look up what a Beevers-Lipson strip was:

Beevers–Lipson strips were a computational aid for early crystallographers in calculating Fourier transforms to determine the structure of crystals from crystallographic data, enabling the creation of models for complex molecules [..] The approach converted the sizable calculations of multi-dimensional Fourier summations needed in crystallography analysis into sums of more manageable one-dimensional values.

I still can’t get over how much civil and commercial engineering was done with slide rules, pencils, carrying 1s, and thick volumes of constants and pre-computed values. My dad was a chemist, maybe one day he’ll let me rifle through his prised Merck tomes.

Cryptography is the closest analogue (hah!) I can think of in my line of work, assuming that I went from maintaining and building computer systems to shipping physical envelopes around if computers ceased to exist. RSA is easy to grok, but imagine having to encrypt a packet with AES and encrypting that key with RSA for secure transmission… by hand. I suppose we wouldn’t need such bullet-proof ciphers if we weren’t threatened by fast computers that could make light work of them.

So much of our world is dependent on maths being handled elsewhere, transparently or otherwise.


Ashe on motivational interviewing

In early June I wrote about motivational interviewing as a positive way to affect change. Berating yourself to change a habit usually doesn’t work, so why do we think that doing that to others will be any different?

Asherah Connor of kivikakk.ee (web feed here) emailed me a while ago (sorry!) with an article in Psyche by Angela and Ralph Wood, who help to break it down:

How can we find more motivation to make positive changes in our lives?

MI practitioners use their counselling skills, such as open-ended questions and ways to reflect, to evoke what’s called change talk – a conversation about what clients are unhappy about and how they’d like to change. Through an accepting, collaborative and guiding style, this approach seeks to strengthen the person’s commitment to goals they identify for themselves.

This is the best summary I’ve read about the approach. Now we just need, as Ash says, the motivation to do it.

(And as a pointless aside, I think the stock photo they included in the article is of Tania Cagnotto, an Italian Olympic diver. That’s the second mention of sport today. Is this a new record here)?


Harukana Receive, and Olympic sports

This is a bit of a disjointed post, but I’m in a bit of a disjointed mood! We start with Erin Riley’s Bird Site comment this evening that I can’t fault:

I saw someone comment on a friend’s thread on FB yesterday that every Olympic event should include one random person selected from the crowd, just for context, and I am 100% here for that.

The Price is Right, but for athletics! Wait, did I just date myself?

That then reminded me of a conversation I was having with Matt of Digitally Downloaded last week, who ranked Olympic sports:

  • Handball
  • Kayak
  • Rhythmic Gymnastics
  • Beach Volleyball
  • Bouldering

Diving was in my top 5 but then Bouldering debuted this Olympics. Volleyball’s awesome too but Beach Volleyball is better.

I’d only make a couple of small tweaks:

  • Put Diving back in and sub out Kayak. I can’t help but admire the patience, skill, and guts it would take to jump off a platform that height and navigate those impossible maneuvers. I also respect the fact that making the smallest splash possible is the antithesis of bombastic showboatyness.

  • Replace Handball with Table Tennis, because Singapore. This also brings in Badminton as an honourable mention. The mechanics and speed of both seem so utterly implausible, they’re the most gripping sports I’ve ever watched. Why they don’t get more publicity in the West confounds me.

I also second Matt’s enthusiasm with Bouldering becoming an Olympic event. I barely pay attention to sport normally, but I love that the Olympics showcases events that don’t involve kicking a ball. Or if they do, it’d likely be an accident, incredibly painful for the male player, and/or worthy of a penalty.

Which leads us to Beach Volleyball, and probably the briefest anime review I’ve ever done here. I watched Harukana Receive back in 2019 after reading a synopsis by Dee over at The Anime Feminist which gave me an appreciation for the sport I didn’t have before.

Screenshot from the opening of Harukana Receive

The series takes places around the island of Okinawa (I still find it funny that I want to explore the north of Japan, and Clara keeps wanting to island hop in the south! I’ll bet the weather is warmer). The colours and landscape backdrops are so bright and optimistic, I ended up using some as desktop backgrounds last winter.

Our protagonist Ōzora Haruka is enamoured with a couple of players she spots on the beach. She befriends and wins back a former player with a troubled past in the sport, and they all train together for a tournament over the course of the series. We learn about the rules and strategy in a surprisingly respectful and engaging way, like all good sports anime. The fan service is mild given the subject matter, though I’ll admit I wouldn’t have thrown together that quick montage below at a coffee shop (cough).

I won’t lie (as opposed to other times?), it gave me K-On! does Beach Volleyball vibes, with the same emphasis on friendship and personal growth among a cast of likeable and relatable characters (Haruka gave me serious Yui vibes). Episode 8’s shrine and coffee shop wanderings were my favourite, not that I’m predictable or anything. That’s my second mention of coffee shops in a post nominally about something else. I miss going to coffee shops.

Screenshots from Harukana Receive, including my favourite scene at the coffee shop in the lower-right.

Maybe now I can appreciate the real thing a bit more. Does this also mean I need to watch Iwa-Kakeru! (the first search result for “bouldering anime”) too? There’s really a series for everything. Would the Free! boys consider diving at some point?

This wasn’t among the most disjointed posts I’ve ever written, but it has to be up there. Before the ball reaches the ground.


Michael Franks, Heart Like an Open Book

Today’s Music Monday takes me back to this site’s musical roots. Frankly I’m surprised it took this long for him to reappear. Get it, because his name is Michael… ah shut up.

Michael Franks has been my favourite singer/songwriter since I was barely old enough to understand what half his witty lyrics meant. Online guides pigeonhole him as a latin jazz musician, but his repotoure repotoire (damn it) repertoire has also included various forms of jazz funk, fusion, and even a sprinkling of pure 1980s electronica. His music never fails to bring a smile to my face every time he comes up on random.

Play Heart Like An Open Book

“Heart Like an Open Book” comes from his 1999 album Barefoot on the Beach. It was the first album of his that came out when I was old enough to leave the house and rush to the music store to buy it. My music player brought it up twice this afternoon, such was its motivation to remind me of its awesomeness.

These Porta Pro headphones recently lead me to rediscover the great bassline and drums on this specific track. Michael always had such excellent backing musicians.


The need for personal iRL concurrency

Concurrency… con currency… is that Bitcoin? Badda boom boom tish! Tish tish! Badda.

While I’m on a bit of a tear talking about rituals and metal thought processes, I thought I’d also mention something I started to do as a teenager. I’m not sure if programming made me think this way, but even today I have to see pretty much everything I do through the lens of what I can run in parallel.

(That was supposed to be mental thought processes, not metal. I can’t stand metal music. I’m enamoured with the material in laptops and structural framing, though. I miss Apple hardware back when they used magnesium, that was amazing. But I digress).

Take the morning routine I was rambling about over the weekend. I know that it takes a couple of minutes for the shower to warm up, so I shave my face while waiting. I know it takes me as much time to get dressed as it does to boil water, so I put the kettle on first. The kettle only runs when I’ve pre-ground the coffee the day before, otherwise I start grinding first, then boil the water while I’m tipping the grounds into the Aeropress so the water is the optimal temperature.

More specifically during Covid Times, I only go down to reception to pick up mail while I’m on my way back from buying groceries, to limit my use of shared lifts and hallways. I do an embarrassing amount of my podcast production and listening while cleaning. I watch engineering and Hololive YouTube while I eat and exercise.

And yes, it spills over to IT. I can’t update one FreeBSD jail, I have to do them concurrently in different tabs. Audio-only conference calls—the best kind—are when I also mindlessly sort and organise email.

Doing these things concurrently, and at the same time (as my illustrious dad would say) presumably came from the desire for efficiency. It doesn’t take a rocket surgeon or the sharpest spoon in the drawer to realise you complete a bunch of tasks faster if you do as many of them at once. It’s another manifestation of my need to feel like I have control over my environment and circumstances, something that is especially true during These Covid Times.

Unfortunately, it introduces the chance for error. My mental orchestrator is a well-oiled machine when things are predictable and going to plan, but throw a spanner in the works and suddenly all the spinning plates wobble and crash around my feet. The metaphors today are all over the place, like lipstick on a pig. That one didn’t even make sense.

There’s also a sense of paralysis when I have to make a decision about what to do, because I can’t perform tasks in isolation. What could I do at the same time morphed into what should I do, and now its what must I do. Yes, I conform my brain to RFC 2119, like a gentleman. Seeing the world through this rigid framework is frustrating, and leads to dissatisfaction and a sense that I’ve failed if I only perform a single task.

I’m also starting to realise that the gains I thought I was making from these increasingly complex processes are feeding anxiety in ways I didn’t understand until recently. There’s a reason mindfulness exists as a concept; there’s value in being deliberate, and excelling at one thing before moving onto the next.

Learned habits are hard. There are some things I’ll keep doing in tandem, but I need to give myself permission to smell the roses. By themselves, not while attempting to water them or perform gymnastics above them with a conference call going on my phone.


Using freebsd-update to upgrade jails

My blog posts about FreeBSD’s fantastic jail container system have sparked interest, so I thought I’d touch on another aspect of their operation: what does the update process look like? Many of the guides online assume you’re using an orchestration tool like ezjail or iocage, but what if you’re like me and are just using FreeBSD’s internal tooling and ZFS snapshots to manage them?

Before we get started, let’s review the cardinal rules for upgrading jails on a FreeBSD system. Memorise them, they’ll be on the test:

  • Read the handbook. Bloggers like me write about what they’ve learned in the hopes it’s helpful, and interests people to give FreeBSD a try. The handbook is the canonical source of truth. No, not that Canoncial.

  • Don’t use freebsd-update(8) within jails. Run it from the host, as I’ll demonstrate shortly.

  • Don’t upgrade a jail to a newer system release than the host. If you do, Colin Percival will materialise in front of you and start reading off all your incompatible library files.

  • Name your jails after Star Trek ships, or anime characters. Okay it’s probably more useful to give them FQDNs, or at least name them after their function.

Walking through a binary upgrade

Say you’re like me and needed to update your prod home box with jails that run Plex, Samba, Netatalk, and Minecraft. It was running 12.2-RELEASE, and you used freebsd-update(8) to upgrade the host to 13.0-RELEASE.

First, you backed up your jails right? A ZFS snapshot, or at least made a tar archive of your jail folder? That’s a relief.

If you have your jails set to autostart on boot in rc.conf, all might appear well when you access them via SSH or jexec(8). But hold on, we have a problem:

holohost:~ $ uname -rs   
==> FreeBSD 13.0-RELEASE-p3
	
holohost:~ $ jexec ina /bin/sh   
==> "Welcome to the Takodachi, friend! Wah!"
	
ina:~ $ uname -UK   
==> 1202000 1300139

Our user environment version (-U) differs from the kernel (-K), which is inherited from the host. Remember that jails aren’t virtual machines; at least, not in the strict sense. I live in Xen land where PV exists, so those in glass houses…

We can use the same freebsd-update tool to upgrade our jails. Say I wanted to upgrade ina from 12.2-RELEASE to 13.0-RELEASE:

holohost:~ # freebsd-update -b /jail/ina \
	--currently-running 12.2-RELEASE -r 13.0-RELEASE \
	upgrade

Note the -b for the base directory of our jail, and that we’ve called out the version the jail currently runs. You may not have had to use these options before on a host, though the former might be familiar if you used bsdinstall(8) to install your jail, as I wrote about.

The process now is similar to what you’d run against a standard FreeBSD machine. You’ll be asked if the new packages look reasonable, and to confirm config files prior to merging. Now you can install the update:

holohost:~ # freebsd-update -b /jail/ina install   
	
==> Kernel updates have been installed.  Please reboot 
==> and run "/usr/sbin/freebsd-update install" again to 
==> finish installing updates.

Reboot your jail if it was running, then run install again:

holohost:~ # service jail restart ina
holohost:~ # freebsd-update -b /jail/ina install   
	
==> Completing this upgrade requires removing old shared
==> object files.  Please rebuild all installed 3rd party
==> software (e.g., programs installed from the ports 
==> tree) and then run "/usr/sbin/freebsd-update install" 
==> again to finish installing updates.

Log into your jail, and confirm the upgrade worked:

ina:~ $ uname -UK
==> 1300139 1300139

Nice! Now we can update our packages. Force pkg(8) to bootstrap again again so we pull the packages for the newer release, then do the upgrade:

ina:~ # pkg bootstrap -f
ina:~ # pkg update
ina:~ # pkg upgrade

You should see the newer build target shown for each package. Here’s Perl, and a package I just made up:

perl5-5.32.1_1 (ABI changed: 'freebsd:12:x86:64' -> 
	'freebsd:13:x86:64')
thank_you_poul_henning_kamp-1.0 (ABI changed: 'freebsd:12:x86:64' -> 
	'freebsd:13:x86:64')

Now back on your host, you can run install against the jail one more time:

holohost:~ # freebsd-update -b /jail/ina install
==> Installing updates... done.

Donezo!

Conclusion

I won’t lie (as opposed to all those other times?), I largely treat jails as compostable, a phrase I started using that sounds like composable, but with the implication that I’m recycling them. All my configuration, databases, and files are backed up and version controlled elsewhere, so I can stand up and install a new jail from Ansible or scripts. I tend to rebuild jails with these when performing large system upgrades as an opportunity to clean house, though generally on a separate ZFS dataset in case things go pear-shaped and I need to refer to the old ones.

Sometimes though, it’s just easier to upgrade. Isn’t that true of life?


Motherboard standoffs for weird case sizes

Some research on how to fit a MiniITX board into my new old Compaq tower I blogged about last week lead me to this page on Bit-Tech by Alex Banks:

One of the points that definitely crosses the mind of folks wishing to jump into the territory of making a case from scratch, is definitely “How do I make everything line up?”

Alex recommends using a tray from an existing case where you can. If those aren’t available, he made a series of templates you can print out at 1:1 scale to create your own trays, or even just use to drill motherboard mounts and standoffs in an existing tray.

Très bien! Ah, so good (lah). 🇫🇷🇸🇬

Templates of ATX, Micro-ATX, and Mini-ITX trays by Alex Banks


Morning routines; tech and otherwise

I thrive on consistency, but we live in a world where that’s not always available. Life has a sneaky habit of throwing wildcards at us, challenging us in ways in which we weren’t prepared, and all those well-intentioned plans just sail away. I think Enya sang a song about that.

Having a morning routine is the best way I’ve found to mentally prepare for the coming day. Even when I’m travelling I like to establish a little base of operations at a hotel, then develop an ad-hoc schedule for myself. If I can establish some structure and control in the morning, it gives me the mental energy and space to take on the rest of the day.

My body gets me up within minutes of 07:00 every day, regardless of whether it’s a work day, weekend, or holiday. I’ve read papers that suggest waking up at the same time, even with insufficient sleep, is important to regulate your circadian rhythm; something I’ve always read as cicada rhythm. I used to joke that those people either don’t have small children, or servers that beep at them at 03:30! I have no say in the matter regardless.

I got into a nasty habit years ago of checking my phone when I first wake up. If you’re at all prone to anxiety like I am, this is terrible idea! The temptation is strong, but I try to resist it.

The next step is a shower. Always. Showers help me sleep, but somehow they also wake me up. If a shower isn’t available, I have to at least wash my face. Travelling in my early 20s with uni friends was fun, but the variable nature of youth hostel showers have meant I’m glad I don’t have to go to them anymore!

Pre-Covid, my next step was to leave the house with a small laptop for a brisk walk to a coffee shop. Both of these were just as important. I need fresh air, the sun on my face, movement, and the promise of a black coffee and a cheerful hello from a barista at the end of it! It’s not just the taste, it’s the atmosphere of a coffee shop that I find so stimulating and wonderful. The sound of the crockery, muffled conversations, the smell of the ground beans. A coffee shop in the morning is just about the best place in the known universe.

During Covid, I’ve substituted the former for pacing on our balcony, and making coffee using our Aeropress. Sydney winters are mild by global standards, but still nippy enough that people looking at me from the street must think I’m daft in all my layers. I keep a snug blanket on some IKEA patio furniture that I can drape over my lap and legs. I source the beans from local coffee shops here in the hopes that it helps them during this downturn… and because we have some excellent stuff around here!

Now I tackle the IT side of things. I check RSS first, then newsgroups, then monitoring dashboards, then email, then Mastodon, then Twitter if I’m feeling especially masochistic, and then my calendar for the day. It’s everyone’s civic duty and responsibility to stay informed and educated about what’s going on in the world, but I try to avoid reading general news first thing. I might do some blogging or novel writing first thing, or save it for the evening.

I head back inside when its time for work or, on weekends, once Clara is up. Then the rest of the day is an open book. A clean slate. A metaphor!

This all might sound a bit silly, but this routine has helped even more during Covid times. I think we all feel anxiety over this not just for the physical symptoms or the fear that we’d spread a dangerous disease to a loved one or someone in our community; it also represents a loss of control. A routine lets me feel like I get just the smallest amount of that back.


Robbie Williams, Good Doctor

The world carries on spinning, we’re mad, innit?
(Take that, take that) …innit? ♫