Skip to content

Instantly share code, notes, and snippets.

View dinomite's full-sized avatar

Drew Stephens dinomite

View GitHub Profile
@dinomite
dinomite / gsrebase.pl
Created December 21, 2010 15:12
Stash local changes before doing `git svn rebase`
#!/usr/bin/env perl
# Drew Stephens <[email protected]>
# 2010-12-17
#
# Stash local changes before doing `git svn rebase`
use strict;
use warnings;
my $applyStash = 0;
@dinomite
dinomite / gitall.pl
Created February 11, 2011 15:50
Perform a git action on a set of subdirectories
#!/usr/bin/env perl
# Drew Stephens <[email protected]>
# 2011-02-11
#
# Perform an action on all Git repos given on the command line, or globbed.
#
# Check the status of all Git repos in this directory:
# gitall.pl status
#
# Check the status of the Git repos "foo" and "bar" in this directory:
==> Downloading http://www.cityinthesky.co.uk/_media/opensource/pdf2svg-0.2.1.tar.gz
File already downloaded and cached to /Users/drew/Library/Caches/Homebrew
/usr/bin/tar xf /Users/drew/Library/Caches/Homebrew/pdf2svg-0.2.1.tar.gz
==> ./configure --prefix=/usr/local/Cellar/pdf2svg/0.2.1 --disable-debug --disable-dependency-tracking
./configure --prefix=/usr/local/Cellar/pdf2svg/0.2.1 --disable-debug --disable-dependency-tracking
checking for a BSD-compatible install... /usr/local/bin/ginstall -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/local/bin/gmkdir -p
checking for gawk... no
checking for mawk... no
@dinomite
dinomite / Trajan Homebrew setup
Created April 12, 2011 14:11
brew --config, brew doctor, and brew missing output from Trajan
trajan:~$ brew --config
HOMEBREW_VERSION: 0.8
HEAD: 72b2570c02cabd8330387a37ee9b3c566a065997
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_REPOSITORY: /usr/local
HOMEBREW_LIBRARY_PATH: /usr/local/Library/Homebrew
Hardware: quad-core 64-bit arrandale
OS X: 10.6.7
Kernel Architecture: i386
trajan:~$ brew install pdf2svg
==> Downloading http://www.cityinthesky.co.uk/_media/opensource/pdf2svg-0.2.1.tar.gz
File already downloaded and cached to /Users/drew/Library/Caches/Homebrew
==> ./configure --prefix=/usr/local/Cellar/pdf2svg/0.2.1 --disable-debug --disable-dependency-tracking
==> make install
/usr/bin/cc -DPACKAGE_NAME=\"pdf2svg\" -DPACKAGE_TARNAME=\"pdf2svg\" -DPACKAGE_VERSION=\"0.2.1\" -DPACKAGE_STRING=\"pdf2svg\ 0.2.1\" -DPACKAGE_BUGREPORT=\"David\ Barton\ \<[email protected]\>\" -DPACKAGE=\"pdf2svg\" -DVERSION=\"0.2.1\" -I. -I/usr/X11R6/include -I/usr/local/Cellar/pixman/0.20.2/include/pixman-1 -I/usr/X11/include/cairo -I/usr/X11/include/freetype2 -I/usr/X11/include -I/usr/X11/include/libpng12 -D_REENTRANT -I/usr/local/Cellar/gtk+/2.24.4/include/gtk-2.0 -I/usr/local/Cellar/gtk+/2.24.4/lib/gtk-2.0/include -I/usr/local/Cellar/atk/2.0.0/include/atk-1.0 -I/usr/local/Cellar/gdk-pixbuf/2.22.1/include/gdk-pixbuf-2.0 -I/usr/local/Cellar/pango/1.28.4/include/pango-1.0 -I/usr/local/C
@dinomite
dinomite / gist:79ce99a9124d207ab01d
Last active August 29, 2015 14:01
Size of Tesla Model S and BMW models
inches width length
BMW 3er
E30 65 176
E36 67 175
E46 69 170
E90 70 182
BMW 5er
E39 71 188
E60 73 190
F10 73 193
@dinomite
dinomite / scrape.rb
Created October 12, 2015 20:16
495/95 express lanes pricing scraper
#!/usr/bin/env ruby
require 'open-uri'
require 'json'
direction = 'Southbound';
origin = '180SO';
destination = '220SD';
date = '10/09/2015';
@curl_cmd = "curl 'https://www.expresslanes.com/historic-rate-data' -H 'Cookie: data=%7B%7D; digest=b9a6341bf276298b85e14530344aeb95a29b39bb; expire=1445866842; __utmt=1; __utma=269898021.1470859880.1444574061.1444574061.1444657244.2; __utmb=269898021.1.10.1444657244; __utmc=269898021; __utmz=269898021.1444574061.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)' -H 'Origin: https://www.expresslanes.com' -H 'Accept-Encoding: gzip, deflate' -H 'Accept-Language: en-US,en;q=0.8' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' -H 'Accept: application/json, text/javascript, */*; q=0.01' -H 'Referer: https://www.expresslanes.com/historic-rates' -H 'X-curl_cmded-With: XMLHttpcurl_cmd' -H 'Connection: keep-alive' --data

Keybase proof

I hereby claim:

  • I am dinomite on github.
  • I am dinomite (https://keybase.io/dinomite) on keybase.
  • I have a public key whose fingerprint is AD54 E78E BBF8 1792 430A D86E 2F11 EEF0 935F CCA5

To claim this, I am signing this object:

#cloud-config
ssh_authorized_keys:
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDaqc90pQAmovrv7+48uBwS9HZwMCBwrqCadf4uKD7yMJY8r+mJ0zSDpqtUHeIKaB13jkTqOJxirVm1o3I1GNgt2EvZ2JSNlQci/D/j0ixlzS1mVpt+OzDk2e7xKe5KoZEbODLUbEYxDh+E9aZfAiDUoK6eInODdVD5sT59pJfljH4YqPkHM9VZtuBcuOGluzFwSkn2OmsQFL9+zAqNFLNt/kF6sP0HVRnZ9+LF/e9ut4rwD5/wobkWAAvKxOT/UVf3QqPiebDk4XkVVqhVRil0Y3WKWoJP/jwLJTrmVWJflgFOxNrgVSHY03Gj80wjAqfDs5cEvGzEoxdYnjIQAA6L dinomite@Caracalla
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDgNqNygJ1Koh1sGGXFCuTTLdxPrPIf9Zp2vDk0ptX8JTX57FQxmP7NzR1kDOqO7ZBQkpWfo40ehsHir1BOo5knTeiuqNbpAWS/ipN/JfjVSYE18G6I14/AMAQM5EpPuWwibGO9Q4e7P7aSnuGFvZPzAD1tyyZPQdvy7LrRlrfwvRguW7tH9934RxjQghwWn2L9sYzjhJV1jKM3QFQ0vDNAOYHD+etn5LU+MqIivrCoK9W2frh4ef8ZMLmGQII5C0ClBnVHuVSZWNbwfPJHpaIWXxW0CuTLIEYh6LLjIq7ZSuq13usBTW+j/69X1EL7e/4BgeqX1e6xvkaYCIvtLtueKV+MqYOpv8yi70xATey7HmUExqvHygcs6pKgcLV7y+JVnceu+3ipaFcpuujFePKmGXmGuYbM4zh4mqrnS37lZWMZFve7r9IYjryTdLpkFGL4ax0t9wF9d+T+ZOX6w8B5+JaP1Fah143Xci1uoSh0e65sX1BV1ALNPON45oJkebMHU0pbAnJmi7bBkDq1FZ4EL1joY
@dinomite
dinomite / lxc-backup.sh
Last active November 2, 2024 03:22
Simple script to backup LXC containers
#!/usr/bin/env bash
set -ex
BACKUP_DIR=/path/to/where/backups/should/live
HOSTS=($(lxc list -c n --format csv))
for HOST in "${HOSTS[@]}"
do
BACKUP_NAME=${HOST}-$(date +"%Y-%m-%d")