Archive
Posts from 2019
Linting Jenkinsfiles to find syntax errors
As a long time Jenkins user I periodically need to add new steps or Groovy logic to my Jenkinsfiles. The last thing you want to do when updating your pipeline configuration is to make a typo which causes a build to break. To avoid these scenarios, I like to use a git pre-commit hook along with the Jenkins CLI "declarative-linter" option. To use this super useful feature to check for syntax errors, you will first need to download the Jenkins CLI client…
$ read more →Converting X509 certificates to JSON objects
Years ago when I wrote ssl-cert-check I looked far and wide for an easy way to parse X509 certificates. I wasn't able to find a utility so I ended up using a combination of sed and awk to extract various fields from the certificate. That worked, but over the years it's proven to be an unmaintable solution due to diferences in formatting between the issuers. I was recently converting some certificate management scripts to Ansible roles when I came across Cloudflare's certinfo utility…
$ read more →Seeing what changed in a docker containers file system
Docker has a number of nifty options to help investigate containers and container images. One option I have used over and over to debug issues is the docker ["diff" command.] (https://docs.docker.com/engine/reference/commandline/diff/) This dumps out the files that have been aded ), deleted ) and created ) since the container started. Here's a simple example showing diff in action: Cool stuff!
$ read more →Creating a set of random numbers from the command line
This past weekend I was doing some database testing and needed to generate some random numbers to populate a table. My typical go-to utility for generating one random number is head piped to od and tr: This works well and can be aded to a loop to get more than one number. But I was curious if there was a native Linux utility available to do this work. A quick poke through the Linux man pages turned up the coreutils shuf utility: This was exactly what I was after…
$ read more →The beginners guide to creating Kubernetes manifests
As a long time Kubernetes user the question I hear most often is "how do I create manifests (the file that describes how to create and manage resources in a cluster)?" When I ask the person posing the question how they are creating resources today, I frequently hear that they cobbled together a bunch of random manifests they found on the 'net or are using $(kubectl apply -f http://site/manifest) based on a website suggestion. Learning how to generate manifests from scratch baffled me when I was first getting started with Kubernetes. I couldn't find a comprehensive guide showing how to create resources from scratch, and the information needed to become proficient with this process was scattered across various sites. To assist folks who are just entering the K8S space I thought I would document the process I use to approach the "how do I create a manifest from scratch?" question…
$ read more →