Quick Script for TMUX pair sessions

Update 2013-06-14: Improved the script, removing the github-auth dependency, some of the OS X dependencies, and added firewall punch-through (user specific) and ssh-command with external IP auto-copy to clipboard I wanted a quick and easy way to set up a new TMUX session with a brand new pair, so I came up with this: #!/bin/sh gh-auth add $1 sudo cp ~/.ssh/authorized_keys /Users/pair/.ssh/authorized_keys sudo chown pair:staff /Users/pair/.ssh/authorized_keys gh-auth remove $1 tmux -S /tmp/pairing new -ds pairing && chgrp staff /tmp/pairing && tmux -S /tmp/pairing attach -t pairing sudo rm -f /Users/pair/.ssh/authorized_keys That will download ssh keys, create a tmux session, and attach to it. When you’re done it will cleanup so the other person has no access to your box. ...

June 6, 2013 · 2 min · Mark Simoneau

Git Bisect For Great Justice

About a week ago, we had an elusive error that appeared when we deployed our latest app to staging. Suddenly, any submission resulted in a “Stack trace too deep” error that gave no meaningful way to determine where the issue was coming from. We were stuck for a couple of days, but then I was reminded of git bisect. git bisect is a great way to trace down problems to a specific commit for purposes of isolation or blame (though I’d suggest against the latter). Like you’d expect from a programmer, it even searches efficiently, using a binary search, hence bisect. ...

April 12, 2012 · 2 min · Mark Simoneau

Installing memcached 1.4.4 on Mac OS X 10.6 Snow Leopard

Wincent.com has a great article on how to install memcached 1.4.1 on Mac OS X 10.6 Snow Leopard. Now that memcached 1.4.4 is out, I thought it would be nice to update it: curl -O http://www.monkey.org/~provos/libevent-1.4.13-stable.tar.gz tar xzvf libevent-1.4.13-stable.tar.gz cd libevent-1.4.13-stable ./configure make make verify sudo make install curl -O http://memcached.googlecode.com/files/memcached-1.4.4.tar.gz tar xzvf memcached-1.4.4.tar.gz cd memcached-1.4.4 ./configure make make test sudo make install #!/usr/bin/env ruby require 'pathname' # memcached requires an absolute path for the -P switch root = (Pathname.new(__FILE__).dirname + '..').realpath pidfile = root + 'tmp' + 'memcached.pid' if not pidfile.exist? puts "memcached not running: starting" system 'memcached', '-d', '-P', pidfile, '-l', '127.0.0.1' else puts "memcached running: stopping" pid = pidfile.read.chomp system 'kill', pid # it appears that memcached doesn't clean up its pid file # unless you send it a QUIT signal (TERM, KILL, HUP don't) # unfortuantely, QUIT on Mac OS X causes memcached to crash pidfile.delete end

December 2, 2009 · 1 min · Mark Simoneau

25 Tips for Intermediate Git Users

Version Control Systems are critical when it comes to keeping your code in a place you can actually use it. Git is one of those systems that will change how you think about VCS because it suddenly makes it easy and fast to branch and merge. Become more efficient at git and quit wasting time with Subversion merges and remote repositories: 25 Tips for Intermediate Git Users

November 23, 2009 · 1 min · Mark Simoneau