Skip to content

Instantly share code, notes, and snippets.

View boldfield's full-sized avatar

Brian Oldfield boldfield

View GitHub Profile
version: v1alpha1 # Indicates the schema used to decode the contents.
debug: true # Enable verbose logging to the console.
persist: true
machine:
type: controlplane # Defines the role of the machine within the cluster.
token: <token>
ca:
crt: <crt>
key: <key>
certSANs: []
@boldfield
boldfield / report_retrieval.sh
Created August 13, 2021 05:58
Script to retrieve all WA covid breakthrough reports available from the Way Back Machine
#!/bin/bash
WAYBACK_URL="http://timetravel.mementoweb.org/timemap/json/https://www.doh.wa.gov/Portals/1/Documents/1600/coronavirus/data-tables/420-339-VaccineBreakthroughReport.pdf"
for item in $(curl "$WAYBACK_URL" | jq -r '.mementos.list[] | .datetime, .uri')
do
if [[ -z $date ]]
then
date=$(echo $item | sed 's|2021-\([0-9][0-9]-[0-9][0-9]\).*|\1|g')
else
curl "$item" --output "${date}-420-339-VaccineBreakthroughReport.pdf"
@boldfield
boldfield / data_processor.py
Last active August 15, 2021 18:02
Python script used to analyze Washington State COVID breakthrough data
#!/usr/bin/env python
import csv
import gspread
import hashlib
import math
import os
import re
from datetime import datetime, timedelta
@boldfield
boldfield / bootstrap-mac.sh
Created August 13, 2019 05:40
Bash script to bootstrap a new Mac OS Machine
#!/bin/bash
# CHECKPOINTING -- INCOMPLETE SCRIPT
# A script to bootstrap a new Mac OS machine from scratch using ansible and
# the approach taken here: https://github.com/geerlingguy/mac-dev-playbook#installation
# To use this script, for that repo, update to reflect requirements to your system, and
# change the following to your github username:
GITHUB_USER=boldfield
# Location that temporary files will be stored. Directory will be removed
# at the end of the script.
@boldfield
boldfield / main.c
Created December 19, 2018 16:31
Direct IO testing...
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#define HDD_PATH "/dev/sdc"
#define BLOCK_SIZE 1
@boldfield
boldfield / README.md
Last active March 8, 2016 16:57
Simple PoC for chunked client side uploads to S3

Very basic PoC for uploading files to S3 clientside using presigned URLs provided by the AWS Ruby SDK.

@boldfield
boldfield / README.md
Last active June 18, 2020 12:08 — forked from seebk/README.md
Extract embedded certificates and keys from OpenVPN config files

This python script is intended to automate the extraction of embedded certificates and keys from OpenVPN config files.

Unfortunately the GNOME Network-Manager is not able to automatically import OpenVPN config files with embedded certificates and keys. A workaround is to manually extract these and store them in separate files (e.g. see https://naveensnayak.wordpress.com/2013/03/04/ubuntu-openvpn-with-ovpn-file/).

Instructions:

  • Make shure all the required packages are installed. For example on Ubuntu and Debian run:

    $ sudo apt-get install python3 network-manager-openvpn-gnome

@boldfield
boldfield / fetch_restore_spec.py
Last active December 30, 2015 07:19
Script to pull down the latest database restore spec from backup for use with the WAL-E backup-fetch command.
#!/usr/bin/env python
import sys
import os
import json
from collections import namedtuple
from wal_e.storage.base import StorageLayout
ENV_MAP = {
'WABS_ACCESS_KEY': 'access_key',
@boldfield
boldfield / wal-e-env
Last active December 29, 2015 00:49
Simple environment manager for use in WAL-E development.
#!/bin/bash
if [ -z $WALE_ENV_DIR ]
then
WALE_ENV_DIR='/etc/wal-e/env'
fi
STORE=$(echo $1 | tr '[:upper:]' '[:lower:]')
USTORE=$(echo $STORE | tr '[:lower:]' '[:upper:]')
BOX=$(echo $2 | tr '[:upper:]' '[:lower:]')
@boldfield
boldfield / README.md
Last active December 11, 2015 05:08 — forked from gabrielfalcao/README.md