teal coloured gophers cross-compiling an application with spanners, anime cartoon

Why Use Go?

I’ve worked with Go(lang) professionally for over eight years. Now, while some might say I don’t have enough experience to be able to get an entry-level job (looking at you recruiters), others might say that I’m qualified enough to understand Go’s benefits and pitfalls. Today, we look at how Go’s quick and easy cross-compilation can be a deciding factor when answering “Why Use Go?”. The first use case that led me to migrate a project to Go was a requirement to work across multiple platforms to extract, transform and load data....

August 23, 2024 · 4 min · 777 words · Matthew Hartstonge
A cloud containing an open door showing gears inside, being tinkered at by an engineer wearing a hard hat against an abstract background of code

Devlog: 002 - Building Terraform Custom Types

Terraform Plugin Framework Custom Types One of the great new things the Terraform Plugin Framework provides is a stronger focus on strict typing and with that, the ability to develop custom types. One of the first issues I discovered straight out of the gate when attempting to build a new Terraform Provider with the Plugin Framework was that the data I was modelling for a resource used UUIDs for its record ids....

July 22, 2023 · 3 min · 576 words · Matthew Hartstonge
A cloud being constructed by programmers climbing over it with ladders against an abstract background of code

Devlog: 001 - Building Terraform Providers

Terraform If you’ve been living under a rock or happen to be a newcomer in the DevOps/Site Reliability Engineering space, Hashicorp’s Terraform enables provisioning and managing cloud infrastructure. It’s essentially a glorified diffing tool for any cloud resource that, as long as a Terraform Provider exists, can ensure the state of your infrastructure is as expected when written in Hashicorp Config Language (HCL). As a forewarning before digging deeper, it has been common to hear some Linuxy sysadmin-looking neckbeards in-passing talking about infrastructure as code, better known as IaC, being the bee’s knees and how they keep managing to give Dave a good ribbing after causing the Great Network failure of ‘22 after performing a Git force push…...

July 12, 2023 · 5 min · 1004 words · Matthew Hartstonge
a programmer at a laptop panicking over having a substantial amount of code abstract in the background

Else Is Evil

Take the following Go code as an example: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 package main type CodeType int const ( CodeA CodeType = iota + 10 CodeB ) func calculateCodes(codeType CodeType) int { var value int if codeType == CodeA { value = 10 } else { value = 20 } return value } func main() { fmt....

May 30, 2023 · 3 min · 577 words · Matthew Hartstonge
A writer sits at a table with a pencil drawing art with an abstract background containing security iconography

Nginx, Varnish and Wordpress with SSL Termination

TL;DR Assuming you’ve already got your reverse proxy running, in wp-config.php add the following: 1 2 3 4 5 6 7 8 9 <?php /** TLS/HTTPS fixes **/ // in some setups HTTP_X_FORWARDED_PROTO might contain a comma-separated list // e.g. http,https so check for https existence. if (strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false) { // update HTTPS server variable to always 'pretend' incoming requests were // performed via the HTTPS protocol. $_SERVER['HTTPS']='on'; } If you’re getting desperate:...

July 6, 2020 · 8 min · 1650 words · Matthew Hartstonge
A writer with a pencil drawing art around a track while sitting in a formula one car

Superfast WordPress

Introduction WordPress is clearly one of the world’s most used Content Management Systems (CMS) commanding over 35% of the internet, and over 60% of the CMS market [1]. Working in Operations (ops), you see your fair share of friends, family and businesses that ask you to set up a WordPress site as their go to blogging platform. This really comes down to WordPress’ ease of use, massive library of themes and it’s modular nature that enables the extension of it’s core via the use of plugins....

March 29, 2020 · 5 min · 1058 words · Matthew Hartstonge
A squirrel driving a ship on the sea with docker containers in the back

Just Ship It

A while back, I met up with a friend where we started conversing about side projects and how we find it so hard to find the time and motivation to get into them. Moreover, how do we find our way into starting something and keeping at it? Yet, this felt like a rather common dilemma, as you can always find another ’life hack’ or ‘yet another self-help’ book on the matter....

September 10, 2018 · 3 min · 636 words · Matthew Hartstonge