The Technical Blog of James


This is the The Technical Blog of James!

A full list of all posts can be found in the archives.

This blog was formerly available here, however all posts have been migrated over.


Better dmesg in five minutes Posted on Nov 17, 2024
How to handle dmesg on a modern computer


I last wrote about dmesg in 2016. It has mostly not changed since then, but I’ve changed my setup slightly. Here’s a short article about what I did so that you can do it too, and so that I can remember for the next time. Previously: Previous I had a bash alias which looked like this: alias dmesg='dmesg --follow || dmesg' since some machines didn’t yet support the --follow flag.

Read More

A new provisioning tool built with mgmt Posted on Mar 27, 2024
A modern, easy and powerful provisioning tool


Today I’m announcing a new type of provisioning tool. This is both the culmination of a long road, and the start of a new era. Please read on for all of the details. Feel free to skip to the relevant sections you’re interested in if you don’t want all of the background. Ten years: The vision for this specific tool started around ten years ago. Previously, as a sysadmin, I spent a lot of my time using a configuration management tool called puppet.

Read More

Bash $PATH filtering Posted on Mar 2, 2024
How to filter things out of bash completion


As most modern GNU+Linux distro users already know, you get a lot of tools included for free! Many of these may clutter up your $PATH and make bash tab completion more difficult than it has to be. Here’s a way to improve this! A mess: Here’s what I see when I tab-complete cd<TAB>: james@computer:~$ cd cd cddb_query cd-info cd-read cd-convert cd-drive cd-it8 cdrecord cd-create-profile cd-fix-profile cdmkdir cdtmpmkdir cdda-player cd-iccdump cd-paranoia I genuinely only use three of those commands.

Read More

Upcoming Speaking and Events Posted on Jan 31, 2024
Where to get your mgmt fix in the next month


There are three upcoming mgmtconfig events happening within the next seven days! mgmt @ FOSDEM: On February 3rd, I’ll be giving a talk in the golang devroom at FOSDEM. Please come early (1hr+) if you want to get a seat, usually this room is especially full. This happens in Brussels, but it should be recorded if there aren’t any technical glitches. (I got rejected for the main track, but it’s my fault because I need to make my work more generally appealing first.

Read More

Git branch filtering Posted on Jan 28, 2024
How to make git branch filtering more palatable


If you have more than one git branch up in the air at the same time, having a system to track them and filter them is essential. Here are the stages I went through with git branch. xkcd reminds us that we're insane Prefixes: My first tip involves using a memorable prefix. For new features I name my branches with feat/. For example feat/my-new-feature. Yes the slash and the dashes are treated like any regular character.

Read More

Five minute hacks: Swapping left and right headphone audio in wireplumber Posted on Nov 22, 2023
How to actually make this happen.


I’m on Fedora 37 at the moment. My headphone audio is backwards. How do we fix it? I’ve apparently never found the right magic until now. The Setup: I have a crappy “couch computer”. It’s used for casual internet browsing and video watching. It has an analog audio out which goes to my speakers. I’d like to use headphones for when I don’t want to annoy my neighbours. I have a pair of wireless headphones that I got for free, but the battery doesn’t last longer than an hour.

Read More

One minute hacks: Saving time inserting images in Libreoffice Posted on Aug 2, 2023
How to anchor as character by default.


You’ve probably used libreoffice. You opened a document, and proceeded to insert an image into the text. It wiggles all over and never rests where you want it to. The solution: You most likely want the “anchor as character” option. Right-click on the newly inserted image, go to the Anchor menu item, and choose As Character. You will have to do this for each image you insert which is annoying…

Read More

UEFI booting, and with a new kernel module Posted on Jul 24, 2023
How to get your dracut-built initramfs machine to boot with UEFI when you're missing a kernel module.


Picture this. You’ve got a supermicro server. It’s got eight hot-swappable 3.5" HDD’s. You want to use all of those for storage, so you buy a nifty add-on that let’s you add four additional 2.5" SSD’s. Those are great for your OS. That’s a great way to keep your data separate. The motherboard only supports eight drives, so you’ll need an HBA for the additional four… What are some catches and things you need to watch out for?

Read More

Improving git diff output in 5 min Posted on Jun 1, 2023
How to get rid of the annoying a/ and b/ prefixes.


Everyone uses git diff. But there’s that odd annoyance that you’ve probably seen before but are so used to that you’ve forgotten about it. The a/ and b/ prefixes… Example: james@computer:~/code/mgmt (feat/cool-feature)$ git diff diff --git a/lang/funcs/core/os/readfile_func.go b/lang/funcs/core/os/readfile_func.go index 206ba798d..48ac29dc7 100644 --- a/lang/funcs/core/os/readfile_func.go +++ b/lang/funcs/core/os/readfile_func.go @@ -228,6 +228,8 @@ func (obj *ReadFileFunc) Stream() error { // Close runs some shutdown code for this function and turns off the stream. func (obj *ReadFileFunc) Close() error { + // TODO: Port to the new ctx-in-Stream close API.

Read More

Blocked select logging (deadlock finding) in golang Posted on May 26, 2023
How to log when you're waiting for a blocked select statement...


I’ve been writing some massively concurrent code for mgmt lately. The concurrency makes it incredibly bug prone. In this case it’s usually races or deadlocks. I’ve got a new trick to make the process more pleasant. The Problem: I’m sure many of you have written some code like this before: // just a small excerpt for { select { case <-someEvent: // some awesome thing happened! case <-ctx.Done(): return ctx.Err() } } And during debugging, you might have gotten frustrated and added some printf’s:

Read More

Deadline context test cancellation in golang Posted on Feb 24, 2023
How to map the cancellation context into your golang tests...


I decided to write a fancy test harness in golang today. The test wraps a big internal engine for mgmt and at the top-level it takes a context for cancellation. If you don’t know about the context package, then you should go understand that and then come back here… Don’t feel bad, I had no idea what it was about at first either! The Problem: I assumed there would be some way to follow a notification from the test runner down into my test to tell it when it was time to cleanup and exit early… I expected that making my own ^C signal handler wouldn’t be correct, and I (incorrectly) assumed that the interface I’d be looking for would offer a golang context that I could pass into my code.

Read More

Magic typing with shortcuts on Linux Posted on Jun 16, 2021
How to workaround bad software by automating your typing.


Ever find yourself typing more characters than is necessary when using some annoying application or website? Here’s a quick hack around that. Intro: There’s a magic program called xdotool written by Jordan Sissel that solves this problem. I’ve known about his excellent work for years, but only today did I learn he also wrote xdotool. It’s named as such because it tells the X server to do something for you.

Read More

USB Audio on a Boombox Posted on Jan 11, 2021
Getting USB audio working on a Sony ZS-RS60BT


In an earlier post, I got USB audio working on my used, manual, 2013 Honda Civic EX. Today I’ll do the same for a Sony ZS-RS60BT boombox. Here it is in all its used glory after a little cleaning. Background: I decided I should get a small portable boombox to practice my dope dance moves. I currently still suck because I think I spend more time computering than out on the floor.

Read More

Working at Amazon Posted on Dec 28, 2020
I found a new job


TL;DR: I’ve got a new job working for Amazon, in the “Open Source Program Office”. I’m now an Amazoner! More information below… The Amazon. Source: https://en.wikipedia.org/wiki/Amazon_rainforest Background: A little over three months ago, I decided to get back into full-time work. For the past 2.5 years since I left my job at Red Hat, I’ve been mostly working full-time on Mgmt Config and my DevOps/SWE Mentoring Program. To do such things, I had to live off of my savings, which isn’t sustainable long-term.

Read More

James is available for hire! Posted on Sep 10, 2020
Looking For A Job


TL;DR: I’m available for hire. Experienced at Linux/Golang/Mentoring/etc. More information below! A drawing of me coding away. A photo of me giving a talk to a sold-out crowd. Background: Two years ago, I left my job at Red Hat to work on mgmt config full-time. I’m still passionate about this project, and I’m proud of the progress that has been made in the last two years, but it’s time for me to explore new opportunities as well.

Read More

Inexpensive Dynamic DNS over IRC Posted on Sep 1, 2020
Building inexpensive dynamic dns infrastructure for sysadmins


The one thing that I’ve been using for longer than ssh is dynamic dns. In this article I’ll explain how I built an inexpensive, reliable, private alternative to the mainstream tools commonly available today using only golang and IRC. Background: I’ve had an account with dyndns.org for a long time. They used to be free, but then they cut off the free tier, but left existing accounts alone, until they eventually cut all the non-payers off entirely.

Read More

USB Car Audio in a Civic Posted on Aug 24, 2020
Getting USB car audio working in a 2013 Honda Civic EX


Transportation is very important to me. My whole life I’ve never owned a car. I have gotten by with biking, public transit, and various car sharing services. Sadly, biking is incredibly dangerous and stressful, because most cars don’t respect bicycles, and in the winter it’s not very practical, the STM (public transit) offers an incredibly unreliable and unpleasant service, and Car2Go (car sharing) now requires that you use their proprietary smart phone app (you used to be able to just swipe the membership card) so I finally gave up and decided to buy a used car.

Read More

Mgmt Configuration Language: Class and Include Posted on Jul 26, 2019
Class and Include statements in the Mgmt Configuration Language


It’s been a little over a year since I introduced the Mgmt Configuration Language. A lot has happened since then, and I’d like to introduce some of the missing features that weren’t available when the language was first introduced. If you haven’t already read that post, please start there and come back when you’re finished. In this article we’ll learn about classes. Classes: You might remember that the mgmt language called mcl has both statements, and expressions.

Read More

Upcoming Speaking and Events Posted on Feb 2, 2019
Where to get your mgmt fix in the next month


mgmt @ FOSDEM: Later today I’m giving four talks about mgmt at FOSDEM. I’m also giving two more on the following day. (One is a 5 min lightning talk.) I don’t know how I got accepted for so many talks, I just replied to the CFP for every room where I thought I had something interesting to share, and well, here we are! I got rejected for the main track again, but I guess it’s up to me to make my work more generally appealing first.

Read More

A guide to fighting with a Cisco access point Posted on Dec 21, 2018
How eight hours with Cisco Aironet gear made me angry for life


In my hands is a Cisco AIR-CAP-3502-E-A-K9 that I saved from the landfill. After about eight hours of suffering, and what was surely a cancer causing dose of RF-radiation, I now know: How to convince this access point to provide me with wifi. Why Cisco products are probably best left in the garbage. What follows is my setup guide and review for using a Cisco Aironet device. This guide will likely be useful with other models of Cisco devices, but use your own best judgment.

Read More

The End of a Red Giant Posted on Oct 30, 2018
Thoughts on IBM's acquisition of Red Hat


As I’m sure you’ve now heard, Red Hat is being acquired by IBM. Reactions have ranged from: The first two emotions everyone experienced. to: The classic humourous response. to: The classy response. to: The thing we're all curious about. to everything in between. If someone were to leak me a copy of the memo-list 2018-October.txt.gz mailman archive, I’d sure love to see that! (Of course I’m joking and I wouldn’t actually ask anyone to do this.

Read More

Hyperlinks in GNOME terminal Posted on Jun 29, 2018
how to benefit from fancy hyperlinks in your terminal...


Over the years I’ve learned about many of the advantages of using a modern terminal and shell. I’m talking about using bash with GNOME terminal on a modern GNU/Linux distribution. I particularly like switching between the terminal and GUI applications. It’s now even better. Automatic Hyperlinks: Occasionally, some program running in your shell might output what looked like a link: gnome terminal and vte will automatically add links to text that looks like a web hyperlink or an email address They can be seen when you hover over them, and a right-click will display a useful context menu:

Read More

Breaking out of the Slack walled garden Posted on Jun 22, 2018
how to use Slack via IRC since the gateway closed...


I’m old school cool. Real hackers chat on open, distributed platforms. Most technical discussion can be found on the Libera.chat IRC network. It’s not perfect, but the advantages clearly outweigh the drawbacks. Recently, I needed to join an existing large “community” on the centralized, proprietary walled garden that is the Slack network. The Problem: Connecting to the the Slack server requires that you use either the proprietary client or their proprietary web app.

Read More

A new sync primitive in golang Posted on May 20, 2018
a new synchronization primitive for golang...


I’ve been working on lots of new stuff in mgmt and I had a synchronization problem that needed solving… Long story short, I built it into a piece of re-usable functionality, exactly like you might find in the sync package. For details and examples, please continue reading… The Problem: I want to multicast a signal to an arbitrary number of goroutines. As you might already know, this can already be done with a chan struct{}.

Read More

Leaving Red Hat Posted on Apr 4, 2018
purpleidea is moving on...


I’ve spent about four years at Red Hat, and now it’s time to move on… TL;DR: had to leave Red Hat and start Patreon to fund mgmt. What follows is a bit of historical rambling, and some forward looking statements. Retrospective: Long-time readers of my blog will know that I was very active in the puppet ecosystem for many years. I learned a lot while writing puppet code, and while building some of my outrageous puppet hacks.

Read More

Links...

 A full list of all posts can be found in the archives.