With a little bit of free time for a change, I decided to finally migrate my blog from Ghost to a static site generator. I’ve been putting this off because it’s one of those things that I knew would take longer than I’d expect, and to be honest, it it ain’t broke, then don’t fix it.
So, Why Bother? Reason 1 - I write in vim Reason 2 - I backup on GitHub Reason 3 - My workflow sucks for images Reason 4 - I have two sources of truth Reason 5 - I want to allow people to contribute Reason 6 - I don’t want to manage a server Reason 7 - I need to learn how do this Reason 8 - Static Sites are Fast and Simple Picking a Generator Jekyll Gatsby Hugo The Migration Process Automating Build and Deploy Changing Front Matter to YAML Normalising Newlines Restructuring the Content Bringing the images to the posts Was It Worth It?
Read more
In this chapter, we’ll take a look at the various different types of shell commands that exist and how this can affect your work.
By the end of this chapter, you might even be able to make sense of the horrifying and perfectly syntactically valid code below:
which $(where $(what $(whence $(whereis who)))) Part 1: Navigating the Command Line Part 2: Become a Clipboard Gymnast Part 3: Getting Help Part 4: Moving Around Part 5: Interlude - Understanding the Shell Part 6: Everything You Don’t Need to Know About Job Control Part 7: The Subtleties of Shell Commands What Are Commands?
Read more
Job control is a feature of most shells, which is generally not particularly intuitive to work with. However, knowing the basics can help prevent you from getting yourself into a tangle, and can from time to time make certain tasks a little easier.
In this chapter, we’ll look at the main features of job control, why it can be a problematic, and some alternatives.
Part 1: Navigating the Command Line Part 2: Become a Clipboard Gymnast Part 3: Getting Help Part 4: Moving Around Part 5: Interlude - Understanding the Shell Part 6: Everything You Don’t Need to Know About Job Control Part 7: The Subtleties of Shell Commands What Is Job Control?
Read more
This is the first ‘interlude’ in my Effective Shell series. These interludes give some background, history or more flavour to some of the topics.
Part 1: Navigating the Command Line Part 2: Become a Clipboard Gymnast Part 3: Getting Help Part 4: Moving Around Part 5: Interlude - Understanding the Shell Part 6: Everything You Don’t Need to Know About Job Control Part 7: The Subtleties of Shell Commands This one should be high-level enough for even non-technical readers to enjoy (or at least understand!
Read more
This is the fourth part of my Effective Shell series, a set of practical examples of ways to be more efficient with everyday tasks in the shell or at the command line.
Part 1: Navigating the Command Line Part 2: Become a Clipboard Gymnast Part 3: Getting Help Part 4: Moving Around Part 5: Interlude - Understanding the Shell Part 6: Everything You Don’t Need to Know About Job Control Part 7: The Subtleties of Shell Commands In this article we’ll look at the key elements of navigation in the shell.
Read more
When building Terraform modules, it is a common requirement to want to allow the client to be able to choose which region resources are created in, and which availability zones are used.
I’ve seen a few ways of doing this, none of which felt entirely satisfactory. After a bit of experimentation I’ve come up with a solution which I think really works nicely. This solution avoids having to know in advance how many availability zones we’ll support.
Read more
This little bash snippet will let you open a GitHub or GitLab pull request from the command line on most Unix-like systems (OSX, Ubuntu, etc), without using any magic libraries, ZSH tricks or other dependencies.
tl;dr download the gpr.sh gist.
Here’s how it looks in action OSX:
And Ubuntu:
The script is available as the gpr.sh gist. You can also find it in my dotfiles, in the git.sh file.
The Script Here’s the script in its entirety:
Read more
In this article I’ll demonstrate how to use Golang to manipulate Kubernetes Custom Resources, with Istio as an example. No knowledge of Istio is needed, I’ll just use it to demonstrate the concepts!
Istio is a highly popular Service Mesh platform which allows engineers to quickly add telemetry, advanced traffic management and more to their service-based applications.
One interesting element of how Istio works is that when deployed into a Kubernetes cluster, many key configuration objects are handled as Custom Resources.
Read more
I recently needed to be able to generate a simple face image, with the face being able to scale from happy to sad.
(Why I needed to do this is a long story!)
This gave me the opportunity to have a play with SVG, which is something I’ve not done in a while and always wished I could spend more time with. You can see the result below, move the slider to see the smile animate:
Read more
Recently I needed to be able to quickly adjust the number of replicas in a Kubernetes Replication Controller. The original solution I’d seen pulled down the spec, modified it, then updated it. There’s a better way!
There’s a patch API for Kubernetes resources. Patching resources is faster and easier than pulling them and updating the spec wholesale. However, the documentation is a little limited.
After some trial and error I got it working, here’s the solution.
Read more