This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Modified version of technique borrowed from | |
# http://theantway.com/2012/08/how-to-create-ssh-tunnel-at-boot-time-under-ubuntu/ | |
# Place in /etc/init/ | |
# autossh | |
description "autossh daemon" | |
start on net-device-up IFACE=eth1 | |
stop on runlevel [01S6] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MiniTest::Mock errors are especially vague, particularly when you need more than one mock in your test. | |
To improve things slightly, add this to the bottom of your test_helper... | |
module MiniTest | |
class NamedMock < Mock | |
attr_reader :name | |
def initialize(name) | |
@name = name | |
super() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# | |
# Take automatic rotating snapshots of your AWS EC2 linux instance(s). | |
# | |
# Slap this file into /etc/cron.hourly/ on your EC2 instance, | |
# edit the constants at the top of the class to your liking, | |
# and give it the execute bit. | |
# | |
# Known to work on Ubuntu 14.04 64bit. Presumed to work on most other flavors. | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add to your .bashrc or sourced alias file | |
# | |
# Without any arguments, lists the last 9 branches you've been | |
# on, prompts for a number, and then switches you back to the | |
# corresponding branch. | |
# | |
# When passed a number as an argument, instantly switches you | |
# to the corresponding branch. This is particularly useful for | |
# toggeling back to your previous branch with `grb 1`. | |
function grb() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ for f in *CANON/*.CR2; do dcraw -D -4 -j -c "$f" | pamsumm -max; done | cut -f 7 -d ' ' | sort -n | tail -1 |