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.
I publicly released mgmt to the internet 10 years ago. I can’t believe it’s been 10 years. In this post I’ll talk about:
mgmt companyAnd more…
I’ve officially started a company. I’ve been working on this for some time now,
and it’s time to let you all know about it officially. As you already know
(mgmt, purpleidea, etc…) I’ve never been great at naming. The company is
called:
I’ve been using git status for quite a long time now. Let’s make it better.
My ~/.gitconfig has had:
[alias]
s = status
d = diff
l = log --show-signature
for as long as I can remember. They’ve served me well.
In one of my projects, I occasionally
have a bunch of untracked files, particularly when I’m hacking on something new
that isn’t committed yet. This may include notes, new tests, and so on. My
terminal is usually between 24 and 37 lines tall. (Eg: run tput lines.) If
there’s a lot of untracked stuff here, I’ll quickly go over this limit and have
to scroll to see what’s staged and so on.
Want to tunnel etcd traffic over SSH? Here’s a pitfall I ran into.
Mgmt supports tunnelling the etcd traffic over SSH.
This is quite useful, because it means that for it to connect to etcd, it
doesn’t need to open up any new ports other than 22.
You can run the agent like so:
mgmt run --ssh-url=etcd@etcdserver:22 --seeds=http://127.0.0.1:2379 --no-server --no-magic empty
and it just works!
Read MoreiPXE is a terrific tool, but despite their very respectable documentation, it has some rough edges, and it still feels like an “in crowd” kind of thing, where you have to learn the common tricks by knowing someone.
I’ve been building a provisioning tool in mgmt and instead of always relying on distro-specific boot images, I decided to use iPXE to handle the early boot, and have it hand-off to the kernel installer.
Read MoreMgmt modules are used for structuring your code across multiple files. This keeps things readable and allows for code reusability. For example, it should be easy to write a single module which can be effectively used by many different parties. To me, it never felt like code reuse was a core design objective with other tools. In mgmt it has been since the very beginning. I’m very proud of our module system, so let me introduce you to it properly.
Read MoreIt’s been a little while since I introduced the Mgmt Configuration Language. I originally wrote this article in 2019, and as I was working on it alongside the code for functions, when I realized that lambdas didn’t work properly. It took some time to finally solve that properly. Since then I’ve been working to get mgmt production ready. It’s properly useful for production now, and so it’s time for me to catch up on my documentation. I’ve revived and updated this article, let’s go…
Read MoreI 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.
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.
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.
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. I eventually realized and accepted the shortcomings of the tool after
a failed attempt to combine puppet and some python scripts into a provisioning
and clustering tool that I was trying to build for greenfield environments. The
idea is that it would bootstrap a whole suite of infrastructure services for a
new data centre.
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!
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 MoreThere are three upcoming mgmtconfig events happening within the next seven days!
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 MoreIf 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 |
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. I also commonly use bug/. You
can see all of the branches with git branch -a.
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.
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. I also have an old pair of analog headphones that work okay and don’t run out of battery! I got a free USB to analog dongle, but for some reason the left and right audio channels are reversed!
Read MoreYou’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.
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…
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 MoreEveryone 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…
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.
+ // Hello blog readers!
close(obj.closeChan)
obj.wg.Wait() // block so we don't exit by the closure of obj.events
close(obj.events)
The git diff command shows these to help you differentiate between the source
and the destination files. In most cases you are in the midst of looking at and
writing code, so you’ll probably instinctively know whether you or something
just added or deleted those lines. (Because if you flipped a and b you’d
have the opposite diff.)
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.
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 MoreI 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!
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. I was wrong, but I was on the right
track and it did help me find what I was looking for. Let me explain the subtlety…
Ever find yourself typing more characters than is necessary when using some annoying application or website? Here’s a quick hack around that.
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.
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. |
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. In any case, in a stroke of luck, I happened upon a used boombox that was getting discarded due to a broken CD player. Nobody seemed either able or interested in getting USB audio working, so I took it home and gave it a go!
Read MoreTL;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 |
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. I am thankful that I was able to do so for so long. It was time to dive back in, and here I am.
Read MoreTL;DR: I’m available for hire. Experienced at Linux/Golang/Mentoring/etc. More information below!
|
|
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. My years of experience building mgmt has taught me a lot about open source, golang and mentoring others, and I hope this makes me a valuable addition to your team.
Read MoreThe 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.
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. I think we need an inexpensive
way of giving up-and-coming GNU+Linux hackers a way to ssh home, and run their
irssi sessions,
without having to pay. I also wanted something reliable that wouldn’t disappear
the way dyndns did.
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 MoreIt’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.
You might remember that the mgmt
language called mcl has both statements, and expressions. Statements
ultimately produce the resources and edges that make up our output graph,
and expressions produce the values (strings, integers, lists, etc) that make up
the inputs to those statements.
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