Skip to content

Instantly share code, notes, and snippets.

View voxxit's full-sized avatar

Josh Delsman voxxit

View GitHub Profile
#!/bin/sh
#
# -- virtualdj-historian.sh --
# A helper script for proper OBS track IDs from Virtual DJ tracklist.txt
#
# USAGE:
#
# 1. Download to your home directory
# 2. chmod +x virtualdj-historian.sh
# 3. ./virtualdj-historian.sh
@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/ \
Event.onDOMReady(function () {
var triggerIDs = ["trigger320", "trigger480", "trigger640"];
var HDMovieURL = "http://stream.qtv.apple.com/events/sep/1009qpeijrfn/1009oiubqherbfoteg_hd_ref.mov";
var HDTrigger = $('triggerHD');
var qt = null; /*snowLeopard url*/
var slURL = "http://qthttp.apple.com.edgesuite.net/1009qpeijrfn/sl.m3u8";
// http://qthttp.apple.com.edgesuite.net/1009qpeijrfn/sl.m3u8
// var slURL= 'http://qthttp.apple.com.edgesuite.net/100716iab73asc/sl_all_w.m3u8';
/* non-snowLeopard url*/
@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 / digitalocean-dyndns
Last active July 14, 2019 12:45
Dynamic DNS script for DigitalOcean. For example: to use with OpenWRT routers, install bash (opkg install bash) then place this script in /etc/hotplug.d/iface/
#!/usr/bin/env bash
set -x
# Domain you wish to update
DOMAIN="example.com"
# Get the v4/v6 addresses from icanhazip.com [pretty reliable!]
IPV4_ADDR=`wget -4 -q -O - icanhazip.com`
IPV6_ADDR=`wget -6 -q -O - icanhazip.com`
#!/bin/sh
#
# Downloads and installs the startssl CA certs into the global Java keystore
# on Alpine Linux.
#
# Check if JAVA_HOME is set
[ "$JAVA_HOME" = "" ] && echo "ERROR: JAVA_HOME must be set" && exit 1
# Check if cacerts file is present
@voxxit
voxxit / curlt
Created July 19, 2018 22:55
Wrapper script for curl to publish timings as JSON
#!/bin/bash
#
# curl wrapper returning timing information.
#
# curl format adapted from
# http://josephscott.org/archives/2011/10/timing-details-with-curl/
#
# Example usage:
# $ curlt http://www.apple.com
# $ time curlt http://www.apple.com -v
@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 / pre-commit
Created July 25, 2013 18:16
Simple Git pre-commit hook for running specs on a Rails project before committing. Install by pasting into .git/hooks/pre-commit, then do "chmod g+x .git/hooks/pre-commit"
#!/bin/bash
# Stash unstaged changes before running tests
git stash -q --keep-index
# Run tests
NUM_FAILS=`bundle exec rspec --format=progress | grep "example" | grep "fail" | awk {'print $3'}`
# Unstash
git stash pop -q
@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"]