Skip to content

Instantly share code, notes, and snippets.

@jpluscplusm
jpluscplusm / dontfeedthebeast.md
Created July 1, 2024 12:07 — forked from anonymous/dontfeedthebeast.md
Don’t Feed the Beast – the Great Recruitment Agency Infestation

Don’t Feed the Beast – the Great Recruitment Agency Infestation

“Don’t move to that London” warned my northern grandfather once. “It’s full of spivs”.

The Oxford Dictionary (somewhat chauvinistically) defines a spiv as:

A man, typically a flashy dresser, who makes a living by disreputable dealings

“But I work in IT” I told him. “engineers aren’t like that”.

@jpluscplusm
jpluscplusm / dec2ip.awk
Created February 5, 2020 22:32
AWK IPv4 to/from decimal
#!/usr/bin/awk
# 1-liner: awk '{for(i=0;i<4;i++){byte=$1%256;ip="." byte ip;$1-=byte;$1/=256}}END{sub(".","",ip);print ip}'
{
for(i=0; i<4; i++) {
byte = $1 % 256
ip = "." byte ip
$1 -= byte
$1 /= 256
}
@jpluscplusm
jpluscplusm / log-indent-test.sh
Created December 3, 2019 21:39
Shell log formatter with increment/decrement indentation thingy
#!/usr/bin/env bash
set -ueo pipefail
outofbandlogstring="This string must NEVER appear in the script's stdout/err ..." # or, like, simply "§" ...
function enter() {
echo "$@"
echo "${outofbandlogstring}+2"
}
@jpluscplusm
jpluscplusm / vpnc-script-aws
Last active July 12, 2018 12:53 — forked from alext/vpnc-script-aws
vpnc script to route all AWS IP ranges over VPN.
#!/bin/bash
# vpnc-script wrapper for use with openconnect that routes all AWS IP ranges over the VPN.
# Pass any additional IP ranges to be routed as args to the script.
#
# Requirements: bash, curl and jq.
#
# Example usage:
# openconnect https://vpn.example.com/profile --script '/path/to/vpnc-script-aws'
#
@jpluscplusm
jpluscplusm / instance.tf
Created July 13, 2017 11:10
Dagnammit, Terraform
resource "aws_instance" "instance" {
ami = "ami-32rrg4334f"
instance_type = "t2.small"
subnet_id = "subnet-abc123dasf"
key_name = "key"
associate_public_ip_address = false
vpc_security_group_ids = [
"${aws_security_group.1.id}",
@jpluscplusm
jpluscplusm / test.bats
Last active July 22, 2017 01:34
Per-file setup/teardown support for BATS
setup() {
# Global setup
if [ $BATS_TEST_NUMBER -eq 1 ]; then
{
echo export FOO=bar
} >${BATS_TMPDIR}/bats.import.$PPID
fi
. ${BATS_TMPDIR}/bats.import.$PPID
# Per-test setup as per documentation
@jpluscplusm
jpluscplusm / .gitignore
Last active September 17, 2016 00:03
Terraform Makefile wrapper with remote state mgmt/bootstrap
/.terraform/terraform.tfstate*
/plan.out
/.plan.out.*
@jpluscplusm
jpluscplusm / awk-ad
Last active August 22, 2016 15:21
AWK invocations for ASCII-delimited operation
#!/bin/bash
# ASCII-delimited input and output
awk -vFS="\x1F" -vRS="\x1E" -vOFS="\x1F" -vORS="\x1E" "$@"
@jpluscplusm
jpluscplusm / infra-secret-management-overview.md
Created May 9, 2016 18:54 — forked from maxvt/infra-secret-management-overview.md
Infrastructure Secret Management Software Overview

Currently, there is an explosion of tools that aim to manage secrets for automated, cloud native infrastructure management. Daniel Somerfield did some work classifying the various approaches, but (as far as I know) no one has made a recent effort to summarize the various tools.

This is an attempt to give a quick overview of what can be found out there. The list is alphabetical. There will be tools that are missing, and some of the facts might be wrong--I welcome your corrections. For the purpose, I can be reached via @maxvt on Twitter, or just leave me a comment here.

There is a companion feature matrix of various tools. Comments are welcome in the same manner.