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!
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.
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.
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.
Here’s how it looks in action OSX:
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:
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.
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:
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.
The mongo-monitor CLI is a lean and simple tool to check the status of a MongoDB server or cluster. The code is on GitHub:
Here’s how it looks in action:
In this animation I am monitoring a simple sharded cluster, and running some example maintenance operations, adding a node to a replicaset, stepping down a primary and shutting down a replicaset node.
A simple CLI which shows the status in real-time can be very useful to keep open when performing admin, letting you see how your changes affect the cluster as you work on it.
En Español | Reddit Thread | Hacker News Thread
Microservices became a very popular topic over the last couple of years1. ‘Microservice madness’ goes something like this:
Netflix are great at devops. Netflix do microservices. Therefore: If I do microservices, I am great at devops.
There are many cases where great efforts have been made to adopt microservice patterns without necessarily understanding how the costs and benefits will apply to the specifics of the problem at hand.
This is the third part of my Effective Shell series - practical examples of ways to be more efficient with everyday tasks in a shell.
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 I’ll show you how to quickly get help when working with tools in the shell, without disrupting your flow!