Skip to content

Instantly share code, notes, and snippets.

View mrcrilly's full-sized avatar

Michael Crilly mrcrilly

View GitHub Profile
@mrcrilly
mrcrilly / iac_semver.md
Last active December 6, 2023 16:26
A better way of version controlling IAC

Semantic Versioning for IAC - iacver

When it comes to Infrastructure As Code, the software versioning system known as Semantic Versioning (semver.org) works from an API perspective but falls short elsewhere.

In short a semver is broken down into three "octets" and optional, additional information tagged to the end. Here are a few examples: v1.0.1, v3.1.1, v1.15.0-4. Each of these is a valid semver.

If we take the first example - v1.0.1 - and change the first octet, 1, to 2, we're saying the following:

There has been a change to this code and that change is not compatible with how you're using v1.0.1. The change is a breaking change. You should take care to introduce version v2.0.0 into your code or your environment.

@mrcrilly
mrcrilly / main.go
Created April 9, 2022 03:26
Annoying Azure API
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
"time"

Keybase proof

I hereby claim:

  • I am mrcrilly on github.
  • I am michaelcrilly (https://keybase.io/michaelcrilly) on keybase.
  • I have a public key whose fingerprint is 736B 3A21 FFA5 E68B 7958 6051 ABDC 3DE7 C12B 5131

To claim this, I am signing this object:

@mrcrilly
mrcrilly / terraform_modules.md
Created October 31, 2020 12:27
Opinions on Terraform Modules

Terraform Modules

When developing new modules, or editing existing ones, the following standards should be met to ensure a consistent workflow is used.

Stop! Do you need to write a module?

But before we delve into the rules surrounding modules, considering the following: do you need to write a module to begin with? You should consider copying code before you consider making a module - more often than not it that code you’re writing doesn’t need to be a module

This is a big one because modules are great and it’s easy to get carried away with them, but they’re also not the ideal choice in most cases. There are some (loose) rules regarding modules that should be answered before you begin development…

@mrcrilly
mrcrilly / gist:71d61326ed5955b94203a03a50c70668
Created December 1, 2019 22:39
public announcement of stream
Hello!
A few months back I posted on Hacker News and Reddit about my Ansible and Terraform Crash Courses over at https://www.thecloud.coach/. They were a big success, attracting 3,000+ signups, and now I'd like to tell you about my up and coming live stream on Twitch: https://www.twitch.tv/thecloudcoach
I'll be building a simple infrastructure on AWS to host an MkDocs instance. I'll be using modern tools such as Terraform, Ansible, Packer, GitLab, and more.
Throughout the life of the stream we will implement all the code together, write out documentation (hence hosing an MkDocs instance!), implement CI/CD, monitoring, and much more. Everything will be open source and anyone can issue pull requests and make suggestions.
The schedule is Wednesday and Sunday, 1800 UTC+10 (Brisbane, Australia) and I'll be streaming for three hours. Perhaps more depending on how things go.
module Simple where
inc, increment :: Num a => a -> a
inc x = x + 1
increment x = inc x
double :: Int -> Int
double x = x * 2
exclaim :: String -> String
type Colour = String
type ColourPoint = (Int, Int, Colour)
c1 = (10, 10, "red")
c2 = (90, 90, "yellow")
colourOfPoint (x, y, c) = c
@mrcrilly
mrcrilly / gist:188a563146981197054cc3769aba26a1
Created March 27, 2019 22:30
Example MegaCorp Listing...
Tromp-Cronin:
CEO: Nigel McDermott
CTO: Eleanore Howell
CFO: Adaline Reichel
CIO: Harvey Rippin
Engineers:
Malachi Davis (33)
Access:
package main
import (
"flag"
"fmt"
"html/template"
"io/ioutil"
"os"
"strconv"
"strings"
@mrcrilly
mrcrilly / 1_kubernetes_on_macOS.md
Created September 20, 2018 23:40 — forked from kevin-smets/1_kubernetes_on_macOS.md
Local Kubernetes setup on macOS with minikube on VirtualBox and local Docker registry

Requirements

Minikube requires that VT-x/AMD-v virtualization is enabled in BIOS. To check that this is enabled on OSX / macOS run:

sysctl -a | grep machdep.cpu.features | grep VMX

If there's output, you're good!

Prerequisites