Skip to content

Instantly share code, notes, and snippets.

# install lastest virtualbox and extenion pack releases
VBOX_LATEST_FILE_OSX=$(wget -q${VBOX_LATEST_VERSION}/MD5SUMS -O- | grep -i "OSX.dmg" | cut -d"*" -f2)
hdiutil mount /tmp/${VBOX_LATEST_FILE_OSX}
sudo installer -pkg /Volumes/VirtualBox/VirtualBox.pkg -target /
hdiutil unmount /Volumes/VirtualBox
tomdavidson /
Created Jun 16, 2015
database load script to use with docker, waits for db server to reply to ping.
tar -xvf /tmp/build-data/sandbox_sql.tar.gz -C /tmp/build-data
while ! ping -c1 expressionengine &>/dev/null; do sleep 2; echo "waiting on expressionengine"; done
mysql -hexpressionengine -uroot -proot sandbox_expressionengine < /tmp/build-data/sandbox_expressionengine.sql
while ! ping -c1 wowzalicensing &>/dev/null; do sleep 2; echo "waiting on wowzalicensing"; done
mysql -hwowzalicensing -uroot -proot sandbox_wowzalicensing < /tmp/build-data/sandbox_wowzalicensing.sql
while ! ping -c1 wowzamedia &>/dev/null; do sleep 2; echo "waiting on wowzamedia"; done
tomdavidson / geoip-ut-to-ut.js
Created Dec 31, 2015
redirects utah ip addresses to the utah home page
View geoip-ut-to-ut.js
(function() {
var geoIpServiceUrl = '';
var redirectUrl = '';
var isBotSpider = Boolean(navigator.userAgent.match(/bot|spider/i));
var alreadyUtRedirected = Boolean(document.cookie.replace(/(?:(?:^|.*;\s*)utRedirected\s*\=\s*([^;]*).*$)|^.*$/, '$1'));
var atRoot = window.location.pathname === '/';
var shouldRedirect = atRoot && !alreadyUtRedirected && !isBotSpider;
function redirect(response) {
tomdavidson /
Last active May 16, 2016
install ssl cert on aws, including creating intermediate for a complete chain
# unofficial bash strict mode
set -euo pipefail
# Run script from dir with both certificate files and the private key
# certificate name on AWS
View allow-user-iam.json
"Version": "2012-10-17",
"Sid": "AllowAllUsersToListAccounts",
"Effect": "Allow",
tomdavidson /
Created Jun 17, 2016
wrapper scirpt that assumes aws role
#! /usr/bin/env bash
# Wrapper scirpt that assumes aws role and then runs your script that needs the creds.
# Im not remembering where I got it, but it was at least inspired by another if not verbarium.
tomdavidson /
Last active Feb 24, 2018
* Defaults and other config items for the K8S Installer
terraform {
backend "s3" {}
required_version = ">= 0.10.7"
tomdavidson /
Created Jul 19, 2015
Installs GNU Command Line Tools & then some.
#!/usr/bin/env bash
# Installs GNU Command Line Tools & then some. Requires homebrew.
# Most are newer and more powerful that than OSX’s but also solves most OS compatibility issues
echo "Installing GNU coreutils and various."
export PATH="$(brew --prefix coreutils)/libexec/gnubin:/usr/local/bin:$PATH"
brew install coreutils
brew install binutils
brew install diffutils
brew install ed --with-default-names
brew install findutils --with-default-names
You can’t perform that action at this time.