diff --git a/bash/bash_extra_rc b/bash/bash_extra_rc index a3ca7a7..2a8f883 100644 --- a/bash/bash_extra_rc +++ b/bash/bash_extra_rc @@ -1,5 +1,5 @@ # Relevance "etc" scripts -B="~/opensource/etc/bash" +B=~/opensource/etc/bash if [ -d $B ]; then source $B/git.sh @@ -11,7 +11,7 @@ if [ -d $B ]; then fi # Local executables -export PATH=$HOME/bin:$PATH +export PATH=$HOME/bin:$HOME/opensource/etc/scripts:$PATH # Pairhost aliases alias sourcecode="truecrypt -t -k '' --protect-hidden=no $HOME/sourcecode.tc $HOME/src" diff --git a/bash/git_prompt.sh b/bash/git_prompt.sh index 2e69e5a..4acfdbb 100644 --- a/bash/git_prompt.sh +++ b/bash/git_prompt.sh @@ -18,7 +18,7 @@ function git_branch_and_user { branch_pattern="^On branch ([^${IFS}]*)" remote_pattern="Your branch is (.*) of" diverge_pattern="Your branch and (.*) have diverged" - if [[ ! ${git_status} =~ "working directory clean" ]]; then + if [[ ! ${git_status} =~ "working tree clean" ]]; then state=" ${RED}⚡" else state="" diff --git a/scripts/mountsrc b/scripts/mountsrc new file mode 100755 index 0000000..3d5e12b --- /dev/null +++ b/scripts/mountsrc @@ -0,0 +1,32 @@ +#!/bin/sh + +# usage: mountsrc [cryptfile] [mount dir] + +CRYPTFILE=$1 +: ${CRYPTFILE:="/home/pair/sourcecode.tc"} + +MOUNTDIR=$2 +: ${MOUNTDIR:="/home/pair/src"} + + +# check for sudo +if [ `whoami` != "root" ] +then + echo "You should really run this as root." + exit 1 +fi + +# make the dir if it doesn't exist +if ! [ -d $MOUNTDIR ] +then + echo "Creating mount point $MOUNTDIR." + sudo -u pair mkdir $MOUNTDIR +fi + +# the heavy lifting + +echo "Mounting source $CRYPTFILE to $MOUNTDIR." +DEV=`losetup -f` +losetup $DEV $CRYPTFILE +cryptsetup luksOpen $DEV src +mount -t ext4 /dev/mapper/src $MOUNTDIR diff --git a/scripts/pair b/scripts/pair index 6a7e143..ff4cce3 100755 --- a/scripts/pair +++ b/scripts/pair @@ -20,16 +20,23 @@ AUTHORS = { "ba" => "Brenton Ashworth", "bb" => "Brandon Bloom", "bc" => "Bobby Calderwood", + "bk" => "Ben Kamphaus", + "bn" => "Bobby Norton", "bv" => "Ben Vandgrift", + "cm" => "Carin Meier", "ca" => "Craig Andera", - "cd" => "Clinton Dreisbach", + "cd" => "Clinton Dreisbach", + "cm" => "Carin Meier", "cr" => "Chris Redinger", "dc" => "David Chelimsky", "dm" => "Daemian Mack", + "dn" => "David Nolen", "gh" => "Gabriel Horner", "gs" => "Ghadi Shayban", + "jb" => "Jeb Beich", "jd" => "Jon Distad", "jg" => "Justin Gehtland", + "jh" => "Jan Herich", "jk" => "Jamie Kite", "jm" => "Jen Myers", "jam" => "Jen Myers", @@ -48,6 +55,7 @@ AUTHORS = { "mp" => "Michael Parenteau", "nm" => "Nelson Morris", "pd" => "Paul deGrandis", + "pm" => "Philipp Meier", "rh" => "Rich Hickey", "rn" => "Ryan Neufeld", "ro" => "Russ Olsen", diff --git a/scripts/umountsrc b/scripts/umountsrc new file mode 100755 index 0000000..bda74a4 --- /dev/null +++ b/scripts/umountsrc @@ -0,0 +1,27 @@ +#!/bin/sh + +# usage: umountsrc [cryptfile] [mount dir] + +# check for sudo +if [ `whoami` != "root" ] +then + echo "You should really run this as root." + exit 1 +fi + +CRYPTFILE=$1 +: ${CRYPTFILE:="/home/pair/sourcecode.tc"} + +MOUNTDIR=$2 +: ${MOUNTDIR:="/home/pair/src"} + +echo "Dismounting source code volume $CRYPTFILE from $MOUNTDIR" + +umount $MOUNTDIR +cryptsetup luksClose src +for lodevice in `sudo losetup -j $CRYPTFILE | awk -F ':' ' { print $1 } '` +do + # we remove the loopback binding for each device + losetup -d $lodevice +done + diff --git a/tmux.conf b/tmux.conf index f653a36..630b57f 100644 --- a/tmux.conf +++ b/tmux.conf @@ -1,5 +1,5 @@ # Work nicely with emacs key combos -set -g default-terminal "screen-256color" +set -g default-terminal "xterm-256color" set-window-option -g xterm-keys on # Bind to leader