Setting your default AWS profile for the AWS CLI and SDKs (2 mins read).
Setting the default AWS profile when working with multiple profiles and the AWS CLI / SDKs.
Setting your default AWS profile for the AWS CLI and SDKs (2 mins read).
Setting the default AWS profile when working with multiple profiles and the AWS CLI / SDKs.
Chef 14 Upgrade: Custom Resource Properties are Silently Coerced to Hash
if they are a nil
(2 mins read).
Finding out that a nil
gets silently coerced to an empty Hash
if given to a custom resource's property of type Hash
.
Chef 14: ChefSpec Coverage Reporting Deprecation (1 mins read).
Noting the deprecation of using ChefSpec::Coverage.start!
when using Chef 14 and above.
Chef 14 Upgrade: Change in ValidationFailed
error messages when setting required
properties (2 mins read).
The updated error message returned by a Chef ValidationFailed
error, when you're specifying which properties are required
on a custom resource.
Viewing X.509 DER Certificate Details with OpenSSL (2 mins read).
How to convert an X.509 DER file to a human-readable format using openssl
commands.
Viewing X.509 PEM Certificate Details with OpenSSL (2 mins read).
How to convert an X.509 PEM file to a human-readable format using openssl
commands.
Backporting/Replaying Changes Using git cherry-pick
(6 mins read).
Using git cherry-pick
to make it easier to backport or replay Git commits across different versions of your codebase.
Showing response headers with curl -i
(3 mins read).
Showing just response headers when curl
ing a resource, using curl -i
.
Safely Force Pushing with Git using --force-with-lease=ref
(6 mins read).
How git push --force-with-lease=ref
can save you from overriding others' changes on shared Git branches.
Viewing Git history of a file in git log
while ignoring file renames (5 mins read).
How to track changes to files in Git without pesky file renames getting in the way, using git log --follow
.
Test-Driven Chef Cookbook Development Using ChefSpec (and a sprinkling of InSpec) (39 mins read).
Using the example of deploying and running a Java JAR file as a way to show the lifecycle of a fully test-driven Chef cookbook.
Pretty Printing JSON Web Tokens (JWTs) on the Command Line using Ruby (3 mins read).
How to easily introspect and pretty print a signed JWT (JWS) or an encrypted JWT (JWE) on the command line using Ruby's standard library, or using the ruby-jwt external library.
Using chef-shell
to interactively debug attributes and recipes (5 mins read).
How to use chef-shell
to see attribute config and recipes, with and without a Chef Server.
Creating a versionable, self-contained (fat-/uber-) JAR for Cucumber tests (11 mins read).
Why you'd want a fat JAR and how you'd achieve it.
My Path from School to University to Work (25 mins read).
A look back at my journey up to now, the choices I've made, and what advice I have for others who are embarking on their own journeys into tech.
Pretty Printing JSON on the Command Line with Ruby (1 mins read).
Using Ruby's JSON module to pretty print JSON objects from the command line.
Merging multiple repositories into a monorepo, while preserving history, using git subtree
(3 mins read).
How to merge multiple repositories, with their history, into a single repository, using the git subtree add
command.
Sharing Multiple SSH Sessions over the Same Network Socket (3 mins read).
Reusing network sockets for speed and reduction of authentication handshakes with OpenSSH.
Better Git Diff Outputs with Git Submodules (2 mins read).
How to get nicer diff
s when working with submodules.
Beware: delete
ing a file
in Chef doesn't actually delete
it (3 mins read).
Why you should explicitly add backup false
when delete
ing a file
through Chef, to avoid leaving potentially sensitive files still on the box.
Executing an Interactive Python Shell (REPL) for a Script (1 mins read).
Using python -i
to get an interactive REPL after running a Python source file.
Bundling Common Rake Tasks into a Gem (8 mins read).
An example of how to create a helper gem for common Rake task, using the real-world example of Chef cookbooks.
Running docker login
as another user in Chef (2 mins read).
Hitting the error permission denied while trying to connect to the Docker daemon socket
when trying to run docker login
as a non-root user in Chef.
Chef 13 Upgrade: knife-cookbook-doc
Rubocop Updates (1 mins read).
Disabling the Missing space after #
and Do not use block comments
errors for your knife-cookbook-doc
formatted comments.
Chef 13 Upgrade: knife-cookbook-doc
gem upgrade (1 mins read).
Fixing odd Logger
entries in autogenerated knife-cookbook-doc
README.md
s for Chef 13.
Chef 13 Upgrade: Deprecation of Namespace Collisions in Custom Resources (1 mins read).
Preparing for breaking changes in Chef 14 by renaming property_name
to new_resource.property_name
in Custom Resources.
Verify a Ruby Class Method is Called with Arguments in Rspec, Without Doubles or Mocks (1 mins read).
Rspec code to verify that a Ruby Class Method is called from another method, without needing to mock anything.
Testing Chef's ruby_block
s with ChefSpec (3 mins read).
Testing implementation of a ruby_block
in ChefSpec, to ensure that the code executes as expected.
Chef 13 Upgrade: Lessons Learnt and Documented for Posterity (1 mins read).
Notes on the main problems encountered when upgrading from Chef 12 to Chef 13, both with ChefSpec and Rubocop.
Chef 13 Upgrade: Rubocop Changes for lazy
Parameters (1 mins read).
How to resolve the Parenthesize the param lazy
Rubocop error when upgrading your cookbook to Chef 13.
Chef 13 Upgrade: Rubocop Changes for Testing render_file
with ChefSpec and a with_content
Block (1 mins read).
How to resolve the Parenthesize the param render_file
Rubocop error when upgrading your cookbook to Chef 13.
Chef 13 Upgrade: Rubocop Changes for Word Array Literals (%w
) (1 mins read).
A one-liner shell command to fix Rubocop errors %w-literals should be delimited by [ and ]
.
Chef 13 Upgrade: Testing ruby_block
s with ChefSpec (1 mins read).
Replace your block.old_run_action
with block.block.call
to trigger ruby_block
s within ChefSpec 7 and Chef 13.
Emoji Support in Dunst (2 mins read).
How to see Emoji when using the Dunst notification system.
SSLError
When Running Berkshelf Behind a Proxy (2 mins read).
Getting around the pesky OpenSSL::SSL::SSLError SSLv2/v3 read server hello A
error when running Berkshelf behind a proxy.
Running service
resources in Kitchen-Docker (3 mins read).
How to get up and running with service
resources when running Test Kitchen with the Docker driver, in this example for use with GitLab CI.
Trusting Self-Signed Certificates from the Chef Development Kit (2 mins read).
How to get the ChefDK (and associated tools) to trust internal / self-signed certificates, in an easy oneliner.
Getting around Permission Denied
when running ChefSpec (3 mins read).
How to handle getting an EACCES
when trying to run ChefSpec on a recipe.
GitLab Review Apps with Capistrano and Nginx (4 mins read).
Spinning up a version of your application on every push, so others don't have to manually get the code up and running locally.
Testing include_recipe
s with Chef and ChefSpec (2 mins read).
How to best test include_recipe
s within your Chef recipes, as well as how to ensure that you aren't running any dependent recipes in your tests.
Blogumentation - Writing Blog Posts as a Method of Documentation (4 mins read).
Why I'm starting to use blog posts as a form of documentation, and why I think they're so well suited.
Converting YAML to JSON and vice versa (Part 1 - Ruby) (2 mins read).
Coerce YAML to JSON and vice versa, from the comfort of your Gem-studded command line.
Clean up your Git branches (3 mins read).
Remove any merged local or branches from your local Git repository.
Pretty Printing JSON on the Command Line with Python (2 mins read).
Using Python's JSON module to pretty print JSON objects from the command line.
Viewing your diff while writing your commits with git commit --verbose (3 mins read).
Making it easier to write commit messages by having the diff in your editor.
Building Chef Cookbooks with GitLab (Part 1) (12 mins read).
An introduction to how to build a cookbook using GitLab's Continuous Integration platform in conjunction with kitchen-docker
.
Extracting SSL/TLS Certificate Chains Using OpenSSL (1 mins read).
A quick one-liner to get you the full certificate chain in .pem
format.
glances, a top
and htop
replacement (1 mins read).
I share the tool I have been using for system utilisation and monitoring, glances
.
Saving Repetition with Git Commit Templates (3 mins read).
Speed up your commit message writing by providing a template for when you run git commit
.
Cleaning Up Your LaTeX Build Output with latexrun
(3 mins read).
A tool to help reduce the amount of unnecessary output when building LaTeX files.