Skip to content

Instantly share code, notes, and snippets.

View otterley's full-sized avatar

Michael S. Fischer otterley

  • Amazon Web Services
  • Seattle, WA
View GitHub Profile
@otterley
otterley / tmux-cssh
Created January 18, 2012 23:03
tmux fanout
#!/bin/sh
# Usage: tmux-cssh user1@host1 user2@host2 host3 host4 host5 host6 [...]
SESSION=cssh-$$
tmux new-session -d -s $SESSION "exec ssh $1"
shift
for host in "$@"; do
tmux split-window -t $SESSION "exec ssh $host"
tmux select-layout -t $SESSION tiled >/dev/null
done
tmux set-window-option -t $SESSION status off >/dev/null
@otterley
otterley / ssh_precopy.sh
Created May 12, 2011 17:34
ssh precopy bash script
# Those of you who frequently log in to different hosts and prefer your experience to be consistent may appreciate an "ssh precopy"
# function. The idea is that when you intend to ssh to a host, a set of files (usually dotfiles such as .profile, .gitconfig, etc.)
# that you designate is copied immediately before the actual remote login takes place.
# Simply include the function in your .profile on your "base station" (e.g., your laptop). Then edit $HOME/.briefcase; each line
# should contain a file (relative to $HOME) you want to copy.
# Store ssh(1)'s path.
__SSH="`type -path ssh 2>/dev/null`";
@otterley
otterley / gist:742355
Created December 15, 2010 18:03
latin1 test
use strict;
use Test::More;
use t::Redis;
test_redis {
my $r = shift;
$r->{encoding} = 'utf8';
$r->all_cv->begin(sub { $_[0]->send });
" Only do this part when compiled with support for autocommands.
if has("autocmd")
" Enable file type detection.
" Use the default filetype settings, so that mail gets 'tw' set to 72,
" 'cindent' is on in C files, etc.
" Also load indent files, to automatically do language-dependent indenting.
filetype plugin indent on
" Put these in an autocmd group, so that we can delete them easily.