Skip to content

Instantly share code, notes, and snippets.

View voxxit's full-sized avatar

Josh Delsman voxxit

View GitHub Profile
@voxxit
voxxit / zt-authorize-node.sh
Created June 1, 2018 01:17
Short script to automatically register a new Kubernetes node with the ZeroTier One API
#!/bin/bash
set -e
[ -z ${ZT_API_TOKEN} ] && echo "Missing API token" && exit 1
[ -z ${ZT_NETWORK_ID} ] && echo "Missing network ID" && exit 1
which zerotier-cli # Check whether the zerotier-cli is installed...
if [ $? -ne 0 ]; then
@voxxit
voxxit / Dockerfile
Last active December 14, 2017 21:58 — forked from denilsonsa/README.md
FROM debian
COPY slow /usr/bin/
RUN apt-get update \
&& apt-get -y install --no-install-recommends kmod wget
CMD ["slow", "--help"]
@voxxit
voxxit / s3-rename-mass.rb
Created March 31, 2017 17:32
Rename files en masse on Amazon S3
require "aws-sdk"
s3 = Aws::S3::Client.new(region: ENV.fetch("region", "us-west-2"))
objects = []
start_after = nil
loop do
resp = s3.list_objects_v2(
bucket: ENV.fetch("bucket"),
var sumoURL = process.env.SUMO_ENDPOINT,
zoneID = process.env.CLOUDFLARE_ZONE_ID,
cloudflareAuthEmail = process.env.CLOUDFLARE_AUTH_EMAIL,
cloudflareAuthKey = process.env.CLOUDFLARE_AUTH_KEY,
sourceCategoryOverride = process.env.SOURCE_CATEGORY_OVERRIDE || 'none',
sourceHostOverride = process.env.SOURCE_HOST_OVERRIDE || 'api.cloudflare.com',
sourceNameOverride = process.env.SOURCE_NAME_OVERRIDE || zoneID;
var https = require('https');
var zlib = require('zlib');
@voxxit
voxxit / Dockerfile
Last active September 27, 2020 17:53
FROM haproxy:1.7
ENV CT_VERS=0.16.0 \
CONSUL_HTTP_ADDR=demo.consul.io
RUN apt-get update \
&& apt-get -y install --no-install-recommends curl ca-certificates unzip \
&& curl -O https://releases.hashicorp.com/consul-template/${CT_VERS}/consul-template_${CT_VERS}_linux_amd64.zip \
&& unzip consul-template_${CT_VERS}_linux_amd64.zip \
&& mv consul-template /usr/local/bin/ \
@voxxit
voxxit / large.txt
Last active December 16, 2016 20:24
redis-benchmark on Elasticache instancies
//
// m2.xlarge | vcpu: 2 | memory: 16.7
//
PING_INLINE: 30674.85 requests per second
PING_BULK: 30674.85 requests per second
SET: 30395.14 requests per second
GET: 30674.85 requests per second
INCR: 30959.75 requests per second
LPUSH: 31250.00 requests per second
LPOP: 30030.03 requests per second
@voxxit
voxxit / gist:8bf76779eecd350decbb8117c07f3b7c
Created May 23, 2016 04:43
Init script for hwdsl2/ipsec-vpn-server
#!/bin/bash
case "$1" in
start )
docker run \
--name docker-ipsec-vpn-server \
-p 500:500/udp \
-p 4500:4500/udp \
-v /lib/modules:/lib/modules:ro \
--detach \
@voxxit
voxxit / POSTMORTEM.md
Last active March 10, 2020 15:07
Example/outline of a postmortem to be conducted after a site outage/incident

POSTMORTEM: “Event Title Here”

Issue Summary

This should be a short (4-5 sentences) blurb which succinctly describes the event. At the very least, it should include:

  • the duration (with start & end times in the U.S. Pacific time zone):

…which lasted for roughly 10 minutes between 9:02PM and 9:12PM Pacific…

  • the impact to our users:
@voxxit
voxxit / RUNBOOK.md
Created April 29, 2016 14:26
Example of a solid run book/operations manual

Run Book / Operations Manual

  1. Table of Contents
  2. System Overview
    • Service Overview
    • Contributing Applications, Daemons, and Windows Services
    • Hours of Operation
    • Execution Design
    • Infrastructure and Network Design
    • Resilience, Fault Tolerance and High-Availability
@voxxit
voxxit / .gitconfig
Created April 18, 2016 14:13
Example .gitconfig alias — git prf — which uses the Github PR template
[alias]
..
prf = !hub pull-request -F .github/PULL_REQUEST_TEMPLATE
..