#!/bin/bash [[ "$-" != *i* ]] && return # If not running interactively, don't do anything if [ "$PS1" ]; then host=$(hostname) [ "$host" = "OPT980-4s7g9p1" ] && host="jhu" [ "$host" = "M1600261" ] && host="cerner" PS1='\n\u@\h\[\033[1;35m\]:\[\033[0m\]\w\[\033[1;33m\]\$\[\033[0m\] ' PS1='$(stty echo)\n\[\033[1;33m\]@\[\033[0m\]$host\[\033[35m\]\$\[\033[0m\]$( dir=$(pwd) [ "$dir" != "${dir#$(echo ~)}" ] && dir="~${dir#$(echo ~)}" [ "$dir" != "${dir##*/...}" ] && dir="\[\033[34m\]∅\[\033[0m\]${dir##*/...}" echo $dir )\[\033[1;33m\]:\[\033[0m\] ' fi # If the default debian config is available, load it [ -z "$SYSCONFIG" ] && SYSCONFIG='.../linux/distro/ubuntu/shell/config/bash' [ -e "$SYSCONFIG" ] && source "$SYSCONFIG" # Mistype: 8/12/2009 alias edit=emacs export EDITOR='emacs -nw' alias src='find \( -name mimis -or -name jquery -or -name eson -or -name rhino -or -name js \) -print0' alias srceach='find \( -name mimis -or -name jquery -or -name eson -or -name rhino -or -name js \) -print0 | xargs -0' function tt() { fortune="$(fortune -s)" git commit -am "${*:-$fortune}"; } function t() { git commit -am "$*"; } alias m='git merge' alias u='git reset --soft HEAD~1' alias hardr='git reset --hard' FIT_EXPR='\sfit\s|\sfocus:\s*true\s|\sbinding.pry[[:space:]]|^\+\+\+' function f() { git status -v | egrep '^\+' | egrep "$FIT_EXPR" git diff | egrep '^\+' | egrep "$FIT_EXPR" } function ff() { find -type f -name \*rb -print0 | xargs -0 egrep -e $EXPR -v --color } alias fp="gg -E '\sp\$|\sp\s|\sp\;|binding\.pry|\sspecify\!' -- '*.rb'" alias r='rescue rspec' alias rspec='rspec --tag focus' function gg() { git grep --line-number "$@"; } alias gp='git push' alias gpw='git push web master' alias pull='git pull' alias aa='git add .' function mit() { git commit -m "$*"; } alias go='git remote add origin' alias co='git checkout' alias mb='git checkout -b' alias gs='git stash --include-untracked' alias sp='git stash pop' alias grate='rake db:migrate' alias rdb='rake db:reset' alias clean='git clean' alias ...='p ...' alias fortune='fortune -a' #alias '-'='popd' alias q='popd' alias p='pushd' alias g='grep --color' function t-() { git commit --amend -m "$*"; } function pp() { dir="$(pwd)"; popd; pushd "$dir"; cd "$@"; } alias eb='e .../config/bash' alias sb='source .../config/bash' alias eb='e ~/.bashrc' alias sb='source ~/.bashrc' alias rb='ruby' alias rb='source ~/.bashrc' alias s='git status' alias b='git branch' function d() { git status -v git diff for file in $(git ls-files --others --exclude-standard); do echo -e "\x1B[0;31mUntracked:\x1B[0m \x1B[1;33m$file\x1B[0m" awk '{ print " " $0 }' "$file" done } alias l='git log -p' alias c='rails console' alias routes='rake routes' bind 'set match-hidden-files off' # Ignore hidden files in tab completion # I've been thinking about the possibility that persistent patterns # exist in electrical fields, but that they are too ephemeral to # persist around the strengths that our reality functions at. I # thought that perhaps the writings of Castaneda described # interactions with these beings. That only when our biochemical # processes aren't driven by our consciousness are they able to # impenge. export RSYNC_RSH=ssh export CVS_RSH=ssh # Will start the gui #which update-manager && update-manager -d # Include OSX specific pathes; and give them precedence for path in /usr/local/bin /opt/local/bin /opt/sfw/bin /sw/bin /usr/local/mysql/bin /usr/X11R6/bin ~/.../bin ~/.../google/adt/sdk/platform-tools ~/bin/adt-bundle-linux-*/sdk/tools/ ~/bin/adt-bundle-linux-*/sdk/platform-tools/; do [ -d "$path" ] && export PATH="$path:$PATH" done [[ -s "/usr/local/rvm/scripts/rvm" ]] && source /usr/local/rvm/scripts/rvm [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function* # [ -d ~/bin ] && export PATH=~/bin:$PATH # [ -d ~/bin/sdcc/bin/ ] && export PATH=$PATH:~/bin/sdcc/bin/ export LANG="en_US.UTF-8" export LC_ALL=$LANG # Make javascripts executable #ToDo: shorten function reg_javascript() { sudo sh -c "echo ':javascript:M:://!::$(echo ~)/.../bin/js:' > /proc/sys/fs/binfmt_misc/register" } alias unreg_javascript="sudo sh -c \"echo -1 > /proc/sys/fs/binfmt_misc/javascript\"" # ToDo: make sorting workflow easier by greying out windows quickly #function setactive() { termcolor('black'); } #function inactive() { termcolor('grey'); } #function termcolor() {} export user="wjh" export REMOTE="wjholcomb@madstones.com" export VERBOSE="t" export MIMIS_ORIGIN="$REMOTE" alias nopasswd="( export d=~/.ssh; [ -e $d/id_rsa.pub ] || { mkdir -p $d; cd $d; ssh-keygen -t rsa; }; ssh-copy-id \$REMOTE )" function dmprecord() { base="$(echo ~/tip/.../journal)" dir="$base/$(date +'%Y-%m-%d@%H:%m:%S')" [ -e "$( ls -1 /media/*/FOLDER01/* | head -n1 )" ] && ( mkdir -v "$dir" mv -v "/media/"*"/FOLDER01/"* "$dir" ) for file in "$base"/*/*.[Ww][Aa][Vv]; do mp3="${file%.*}.mp3" [ -e "$mp3" ] || lame -h -V 8 "$file" "$mp3" done rsync --recursive --progress --exclude .git --exclude *wav ~/tip/.../journal/ $REMOTE:.../journal/ } # Verify a json file function json() { for file in "$@"; do echo "Checking: $file" cat "$file" | python -mjson.tool done } # export USER_NAME="$(cat ~/.../me/name/utf8)" # alias bookz="ii -s irc.undernet.org -n '$(cat ~/.../chat/alias/utf8)' -f '$USER_NAME'" # ToDo: Create a version that takes an arg that will create the directory is non-existent #function mv() { #} alias findbiggitfiles="git ls-files -t \$(find . -type f -size +1M -print0 | xargs -0)" # Push merges to webserver based on config at: # http://hoenir.himinbi.org/2010/01/14/putting-sites-in-git/ function publish() { branch=$(git branch 2> /dev/null | sed -e 's|.* ||') [ -z "$branch" ] && { echo "Error: No git branch found"; return; } remote=$(git remote) [ -z "$remote" ] && { echo "Error: No git remote found"; return; } echo "Publishing $branch to $remote" git push $remote "$branch:refs/remotes/$(hostname -s)/$branch" } # Create git repository and mirror to webserver function addtoserver() { localdir=$(pwd) remotedir="$(echo $localdir | sed -e "s|^$HOME/||")" [ -z "$remotedir" ] && return ssh wjholcomb@madstones.com 'mkdir "'$remotedir'" cd "'$remotedir'" git init echo "read oldrev newrev refname cd .. env -i git checkout -f >> .git/hooks/post-receive chmod a+x .git/hooks/post-receive' git init git remote add webserver "ssh://wjholcomb@madstones.com/~/$remotedir/" } alias tx="git commit -a -m checkpoint" alias sync="git pull && git push" alias sync="git pull origin master && git push origin master" MIRROR[${#MIRROR[*]}]="origin" MIRROR[${#MIRROR[*]}]="web" mirror="origin" alias pub="git push '$mirror' master" alias sub="git pull '$mirror' master" function dump-home-to-media() { DIR=/media/home/ # echo "Resource: '$DIR' not available" && exit -1 || [ -e "$DIR" ] [ ! -e "$DIR" ] && (echo "Resource: '$DIR' not available"; exit -1) [ -z "$BACKUP" ] && ARGS='--delete-after' [ ! -z "" ] && ARGS="$ARGS --dry-run" sudo rsync --rsh=ssh --partial --progress --verbose --recursive \ --archive --compress $ARGS \ --exclude=?*~ --exclude=\".\#*\" --exclude=\"\#*\" \ /home /media/ } # Setup remote login for GIT function setupLogin { KEYDIR=~/"personal/keys/$REMOTE"; [ -e "$KEYDIR" ] || mkdir --parents "$KEYDIR" for KEY in "$KEYDIR"/*; do if [ -e "$KEY" ]; then # Loops even with no matches echo "Testing: $KEY: " ssh -o PasswordAuthentication=no -i "$KEY" $REMOTE "exit 0" && break || echo " Fail" fi done if [ ! -e "$KEY" ]; then echo "Generating ${KEYLENGTH:=3096}-bit key:" USER=$(whoami) ; echo " User: ${user:=USER}" PASSWORD= ; echo " Pass: ${PASSWORD:=00000}" unset PASSWORD; HOST=$(hostname); echo " Host: $host" timestamp=$(date +'%Y-%m-%d@%H:%m:%S'); echo " Time: $timestamp" Key="$KEYDIR/$timestamp.rsa key" ; echo " Out: $KEY(.pub)?" if [ -e "$KEY" ]; then backup="$KEYDIR/"$(tempfile --prefix 'bak: ' --suffix " ${KEY##*/}") mv -v "$KEY" "$backup" fi if [ -e "$KEY.pub" ]; then backup="$KEYDIR/"$(tempfile --prefix 'bak: ' --suffix " ${KEY##*/}.pub") mv -v "$KEY.pub" "$backup" fi rm -fv "$KEY" "$KEY.pub" ssh-keygen -t rsa -b $KEYLENGTH -C "$USER@$HOST:$KEY" -f "$KEY" -P "$PASSWORD" \ | tee "$KEY.out.utf-8" $OUTPUT REMOTE_KEYS=.ssh/authorized_keys echo "Appending $KEY to $REMOTE:$REMOTE_KEYS" && \ cat "$KEY.pub" | tee - | ssh $REMOTE "cat >> '$REMOTE_KEYS'" # Add tipspace make script to add git permissions and drop full access echo " Bootstrap: ${BOOTSTRAP:=.../sys/lib/tip/drop/permission/ssh/bash}" [ -e "${BOOTSTRAP}" ] && \ ssh -i "$KEY" $REMOTE "mkdir --parents ${BOOTSTRAP%/*}" && \ scp -i "$KEY" -r "${BOOTSTRAP}" "$REMOTE:${BOOTSTRAP%/*}" && \ ssh -i "$KEY" $REMOTE "${BOOTSTRAP##*/} '${BOOTSTRAP}'" fi } function dumppub() { # Problems with git on remote end #filename="/tmp/wjh - $(date +'%Y-%m-%d@%H:%m') - public.git bundle" #git bundle create "$filename" master resource="public" timestamp=$(date +'%Y-%m-%d@%H:%m:%S') timestamp="2010-01-05@12:01" filename="/tmp/$user - $timestamp - $resource.tar.bzip2" echo "Dumping: ~/$resource/ to: $filename" pushd ~ > /dev/null [ ! -e "$filename" ] && tar -cjvf "$filename" "$resource" # If the file exists and isn't on the server yet, copy it setupLogin # Sets $KEY #echo ssh -i "$KEY" "$REMOTE" "test -e '${filename##*/}' \|\| echo 'f'" OUTDIR="dump/$resource/$timestamp" [ -z $(ssh -i "$KEY" "$REMOTE" "test -e '$OUTDIR' && echo 't'") ] && \ ssh -i "$KEY" "$REMOTE" "mkdir --parents '$OUTDIR'" REMOTE_FILE="dump/${filename##*/}" [ -e "$filename" ] && \ [ -z $(ssh -i "$KEY" "$REMOTE" "test -e '$REMOTE_FILE' && echo 't'") ] && \ echo "Copying $filename to $REMOTE:$REMOTE_FILE" && \ scp -i "$KEY" "$filename" "$REMOTE:dump/" [ -z $(ssh -i "$KEY" "$REMOTE" "test -e '$REMOTE_FILE' && echo 't'") ] || \ echo "Extracting $REMOTE_FILE to $REMOTE:$OUTDIR" && \ ssh -i "$KEY" "$REMOTE" "cd '$OUTDIR' && cat ~/'$REMOTE_FILE' | tar -xj && \ cd - && ln -s '$OUTDIR/$resource'" popd > /dev/null } function git-fold() { [ $# != 2 ] && { echo "Usage: git-fold $repo $dir" echo echo "Folds $repo into the current repository at $dir" return -1 } repo="$1" dir="$2" git remote rm git-fold-merge-project git remote add -f git-fold-merge-project "$repo" git merge -s ours --no-commit git-fold-merge-project/master git read-tree --prefix="$dir" -u git-fold-merge-project/master git commit -m "Folding in $repo @ $dir" git pull -s subtree git-fold-merge-project master } # To remove language selection menus from windows in Solaris export XIM="htt" export GTK_IM_MODULE=iiim export XMODIFIERS="@im=${XIM}" # Make bash append rather than overwrite the history on disk shopt -s histappend # don't put duplicate lines in the history. See bash(1) for more options HISTCONTROL=$HISTCONTROL${HISTCONTROL+,}ignoredups # Check the window size after each command and update LINES and COLUMNS. shopt -s checkwinsize # Includes filenames beginning with '.' in pathname expansion. shopt -s dotglob # ** matches one or more directories # ToDo: Reenable with error checking when not available shopt -s globstar # Replace cd with p (pushd) and d (pushd^-1) # Put in Himinbiorg/shell # alias p=pushd # alias d=popd alias rm='rm -v' # alias l=ls alias v=start alias e=emacs # Always create intermediate directories alias mkdir="mkdir -p" export AWS_ACCESS_KEY_ID=0BRVRK6FWACPYQ6BCSR2 export AWS_SECRET_ACCESS_KEY=DXbUDzUdDIvyA9x3jajgDoM4/szI783MIujFp39E export S3_BUCKET_NAME=saver-assets # Not set by OSX'S X server #[ -z "$DISPLAY" ] && export DISPLAY=":0" [ ! -z "$INSTALL" ] && ( sudo aptitude install fortune libnotify-bin ) [ -z "$PS1" ] || ( which fortune > /dev/null 2>&1 && ( fortune=$(fortune) which notify-send > /dev/null 2>&1 && [ ! -z "$GUI" ] && ( notify-send -t 1000 -u low -i gtk-dialog-info "$fortune" ) || ( setterm -underline on echo "$fortune" setterm -underline off ) ) ) # From: http://www.cyberciti.biz/tips/spice-up-your-unix-linux-shell-scripts.html function openports() { for port in {1..1023}; do (echo >/dev/tcp/localhost/$port) >/dev/null 2>&1 && echo "$port open" done } function sendhttpexample() { exec 3<> /dev/tcp/${1:-will.dhappy.org}/80 printf "GET /~/config/bash HTTP/1.0\r\n" >&3 printf "Accept: text/html, text/plain\r\n" >&3 printf "Accept-Language: en\r\n" >&3 printf "User-Agent: bash_script v.%s\r\n" "${BASH_VERSION}" >&3 printf "\r\n" >&3 while read LINE <&3; do echo $LINE done } # logger "$0 executed" # For invoking the correct handler for files from the command line which xdg-open > /dev/null 2> /dev/null && alias start=xdg-open # Command for php5 on dreamhost DHPHP5=/usr/local/dh/cgi-system/php5.cgi [ -x $DHPHP5 ] && alias php5=$DHPHP5 MATLAB=/gpfs0/local/x86_64/matlab/2007b/opteron/sysgcc/nonet/bin/matlab_program [ -e "$MATLAB" ] && alias matlab="sh /gpfs0/local/x86_64/matlab/2007b/opteron/sysgcc/nonet/bin/matlab_program" # In OSX, mplayer installs to the home directory # That 'which' doesn't return false in OSX when the program isn't present is dumb function mplayer() { if [ -z "$MPLAYERCMD" ]; then if [ -e /usr/bin/mplayer ]; then MPLAYERCMD=/usr/bin/mplayer else MPLAYERCMD="$(find ~ -name mplayer | head -n1)" fi fi if [ "$0" == "-2ndaudio" ]; then shift MPLAYERARGS="-ao alsa:device=hw=1,0" fi "$MPLAYERCMD" $MPLAYERARGS "$@" } # make less more friendly for non-text input files, see lesspipe(1) [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" # OSX terminal emulators have trouble with the delete key on the command line # stty erase  # Ubuntu maps these keys properly to the XFree86 commands if [ ! -e /etc/debian_version ]; then USBDEVICES=/proc/bus/usb/devices [ -e $USBDEVICES ] && grep --silent "Ergonomic Keyboard 4000" $USBDEVICES && { xmodmap -e 'keycode 162=F22' 2> /dev/null; # Play/Pause key on Microsoft's Natural Keyboard xmodmap -e 'keycode 234=F20' 2> /dev/null; # Back key on Microsoft's Natural Keyboard xmodmap -e 'keycode 233=F21' 2> /dev/null; # Forward key on Microsoft's Natural Keyboard xmodmap -e 'keycode 176=F19' 2> /dev/null; # Volume increase key on Microsoft's Natural Keyboard xmodmap -e 'keycode 174=F18' 2> /dev/null; # Volume decrease key on Microsoft's Natural Keyboard xmodmap -e 'keycode 160=F18' 2> /dev/null; # Mute key on Microsoft's Natural Keyboard } fi BATIK_DIR=~/"Local Applications/batik-1.6/" [ ! -e "$BATIK_DIR" ] && BATIK_DIR=~/bin/batik-1.6 if [ -e "$BATIK_DIR/batik-rasterizer.jar" ]; then function batik-rasterizer() { java -jar "$BATIK_DIR/batik-rasterizer.jar" "$@" } fi # Allow override use of sun's jdk for JDK in /usr/lib/kaffe/bin/ /usr/java/jdk*/bin/ /usr/lib/jdk*/bin/ "/cygdrive/c/Program Files/Java/jdk"*/bin/; do if [[ -e "${JDK}java" || -e "${JDK}java.exe" ]]; then export PATH="$JDK:$PATH" break fi done export JAVACMD=$(which java) #export JAVA_HOME=${JAVACMD%/*/*} #export JAVA_JARPATH=.../lib/java/lib export ANDROID_HOME=~/.../google/adt/sdk/ alias pauseamarok="dcop --user $USER amarok player playPause" [ ! -z "$INSTALL" ] && sudo aptitude install klipper # Allows cutting and pasting from the command line # Usage: echo "test" | clip # clip "test" # clip # displays the clipboard's contents function clip() { ps ax | sed 's/^ *[^ ]\+ \+[^ ]\+ \+[^ ]\+ \+[^ ]\+ \+//' | grep -qe '^klipper' || klipper if [[ $# -eq 0 ]]; then # I don't know how to do nonblocking IO ( read -t1 LINE; if [ ! -z "$LINE" ]; then dcop klipper klipper setClipboardContents "$LINE$(cat)" else dcop klipper klipper getClipboardContents fi ) else dcop klipper klipper setClipboardContents "$*" fi } # Power down the monitor and unpause Amarok for exiting music on a blog post function timeblog() { TIME=${1:-60} # Number of seconds to wait sleep 1 && xset dpms force off && sleep $TIME && qdbus org.kde.amarok /Player org.freedesktop.MediaPlayer.Play } function xscreensaver-disable() { xscreensaver-command -restart } function suspend() { ( sudo sleep 30 && sudo sh -c 'echo -n S3 > /sys/power/state' ) & echo "Suspending in 30 seconds" } function settitle() { echo -n $'\033']0\;$@$'\007' } alias st='settitle' function mp3reencode() { newfile="${1%mp3}new.mp3"; lame --mp3input --preset standard "$1" "$newfile" && (du -h "$1" "$newfile"; mv -i "$newfile" "$1"); } function mp3oggify() { artist=${1% - *}; track=${1#* - }; newfile="${1%mp3}ogg"; lame --mp3input --decode --silent "$1" - | oggenc -o "$newfile" -a "$artist" -t "$track" - && (du -h "$1" "$newfile"); } function wmaoggify() { track=${1#* - }; newfile="${1%wma}ogg"; mplayer -ao pcm -ao pcm:file="$newfile.temp" "$1"; oggenc -o "$newfile" -a "$artist" -t "$track" "$newfile.temp" && (du -h "$1" "$newfile"); rm -fv "$newfile.temp" } function reencode() { BASENAME="${1%%.*}" [ -e "$BASENAME.mkv" ] && { echo "$BASENAME.mkv already exists"; return 1; } # mencoder is missing the -x264encopts option so I'm dumping the # sources to files and reencoding, not idea, but I'm clueless if [ ! -e "$BASENAME.h264.mkv" ]; then # the framerate has to be set on active streaming files mplayer -ao null -fps 25 -fixed-vo -noframedrop -vo yuv4mpeg -vo yuv4mpeg:file="$BASENAME.tmp.y4m" $* # from: http://odin.himinbi.org/Makefile.Coupling ENCOPTS="--progress --subme 7 --analyse all --me umh --8x8dct" ENCOPTS="$ENCOPTS --qp 23 --min-keyint 12 --keyint 125 --bime" ENCOPTS="$ENCOPTS --direct auto --filter 1:1 --ref 16 --mixed-refs" ENCOPTS="$ENCOPTS --bframes 5 --b-pyramid --weightb --b-rdo" ENCOPTS="$ENCOPTS --trellis 2 --cqm jvt" eval x264 -o "$BASENAME.h264.mkv" $ENCOPTS --fps 21.78927 --pass 1 --stats "$BASENAME.x264.stats" "$BASENAME.tmp.y4m" eval x264 -o "$BASENAME.h264.mkv" $ENCOPTS --fps 21.78927 --pass 2 --stats "$BASENAME.x264.stats" "$BASENAME.tmp.y4m" fi if [ ! -e "$BASENAME.tmp.ogg" ]; then COUNT=0 for file in "$@"; do COUNT=$(( COUNT + 1 )) mplayer -ao pcm -ao pcm:nowaveheader -ao pcm:file="$BASENAME.tmp.$COUNT.wav" -vo null "$file" done sox "$BASENAME".tmp.*.wav -t wav "$BASENAME.tmp.wav" oggenc -o "$BASENAME.tmp.ogg" "$BASENAME.tmp.wav" rm -f "$BASENAME".tmp*.wav fi mkvmerge -o "$BASENAME.mkv" "$BASENAME.h264.mkv" "$BASENAME.tmp.ogg" } function playmp3s() { file=$(date "+/tmp/%Y_%m_%d.m3u"); if [ ! -e $file ]; then dirs=$(echo /mnt/media/ ~/.mldonkey/incoming/ /usr/share/music/) # [ -e "${dirs%* }" ] || dirs=$(echo ~/) echo "Finding media in $dirs" find $dirs \( -name \*.mp3 -or -name \*.ogg -or -name \*.wma -or -name \*.m4a \) \ -size +1k -printf "%p\n" > $file; fi settitle Music mplayer -shuffle -playlist $file; } export WEBSITE_DIR=~/sites [ -r ".../config/inputrc" ] && export INPUTRC=".../config/inputrc" XSLTTRANS="$WEBSITE_DIR/himinbi.org/odin/jars/XSLTTransformer.jar" if [ -r "$XSLTTRANS" ]; then which xsltproc > /dev/null 2>&1 || alias xsltproc="java -jar $XSLTTRANS" fi alias groupdini="cx ssh -s 'API' -e staging Bluejay" alias groupdinip="cx ssh -s 'Groupdini API' -e production Bison" alias himinbiorg="ssh wjholcomb@himinbi.org" alias dhappy="ssh wjholcomb@dhappy.org" alias connect_loki="ssh will@loki" alias fenrir="ssh will@fenrir.himinbi.org" alias loki="ssh will@loki.himinbi.org" alias odin="ssh wjholcomb@odin.himinbi.org" alias midgard="ssh wjholcomb@midgard.himinbi.org" alias cl="ssh will@loki" alias lab='ssh wholcol1@10.16.146.90' alias dhsi="ssh wholcol1@drupal-dev.welch.jhmi.edu" alias connect_stderr="ssh will@stderr.org" alias connect_honors="ssh will@honors.tntech.edu" alias connect_dhappy="ssh wjholcomb@dhappy.org" alias connect_home="ssh will@loki.himinbi.org" alias connect_laptop="ssh will@fenrir.himinbi.org" alias connect_sf="ssh -t wjholcomb,ideapool@shell.sourceforge.net create" alias connect_vandy_cluster="ssh holcomwj@vmplogin.accre.vanderbilt.edu" alias connect_vandy_lab="ssh holcomwj@hmtcomp-7.vuse.vanderbilt.edu" alias monitorsleep="sleep 1 && xset dpms force off" # alias rm="rm -i" # alias mv="mv -i" # alias cp="cp -i" if [ "${BASH_VERSINFO[5]/apple/}" != "${BASH_VERSINFO[5]}" ]; then # in OSX alias dir="ls -G" alias flushdns="lookupd -flushcache" tset -i elif [ "${BASH_VERSINFO[5]/solaris/}" != "${BASH_VERSINFO[5]}" ]; then # in solaris alias ls=dir elif [ "${BASH_VERSINFO[5]/cygwin/}" != "${BASH_VERSINFO[5]}" ]; then # in windows KEY=CurrentInstallFolder WINDOWSSDK=$(reg query "HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows" /v $KEY 2> /dev/null | grep $KEY | sed -e 's/.*REG_SZ[[:space:]]*//') if [ ! -z "$WINDOWSSDK" ]; then WINDOWSSDK=$(cygpath -p "$WINDOWSSDK\bin") [ -e "$WINDOWSSDK" ] && PATH="$PATH:$WINDOWSSDK" fi # this fixes a problem with emacs not exiting properly # it will cause the terminal to break though if it is set here rather than in the global env [ -z "$CYGWIN" ] && export CYGWIN=tty export CYGWIN="$CYGWIN winsymlinks" # mingw's compiler needs to be used before cwywin's to compile QT stuff mingwdir="/cygdrive/c/Documents and Settings/$USERNAME/My Documents/Programs/mingw32/bin/" [ -d "$mingwdir" ] && export PATH="$mingwdir:$PATH" # to use the python image library, use the windows binary pythondir=$(echo "/cygdrive/c/Program Files/"[Pp]ython*) [ -d "$pythondir" ] && PATH="$pythondir:$PATH" # Include pathes for QT under Windows # QT's make system relies on make being called from QT rather than cygwin # export QTDIR=$(echo "/cygdrive/c/Documents and Settings/$USERNAME/My Documents/Programs/QT/"*) export QTDIR=$(echo "/cygdrive/c/Qt/"*) [ -d "$QTDIR" ] && export PATH="$QTDIR/bin/:$PATH" which make.bat > /dev/null 2>&1 && alias make="make.bat" PROGRAMS=${ProgramW6432} sevenzipdir="$(cygpath "$PROGRAMS")/7-Zip" [ -d "$sevenzipdir" ] && export PATH="$PATH:$sevenzipdir" alias dir="ls --color" else # suse aliases dir to ls -l alias dir > /dev/null 2> /dev/null && alias dir="ls --color" alias ls="dir --color=auto" fi # set a fancy prompt (non-color, unless we know we "want" color) if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then color_prompt=yes fi # enable programmable completion features (you don't need to enable # this, if it's already enabled in /etc/bash.bashrc and /etc/profile # sources /etc/bash.bashrc). if [ -f /etc/bash_completion ] && ! shopt -oq posix; then . /etc/bash_completion fi if [ ! "${BASH_VERSINFO[5]/solaris/}" != "${BASH_VERSINFO[5]}" ]; then # not in solaris alias emacs="emacs -nw" fi [ -r '~/config/muttrc' ] && alias mutt="mutt -F '~/config/muttrc'" [ -e /usr/local/java/lib/ant/bin/ant ] && alias ant="/usr/local/java/lib/ant/bin/ant" [ -e /Developer/Java/Ant/bin/ant ] && alias ant="/Developer/Java/Ant/bin/ant" alias recent="last -ad | head -n 15" alias mailq="sudo mailq -Ac; sudo mailq" alias putmail="sudo /usr/sbin/sendmail -q" alias getmail="fetchmail --ssl --all honors.tntech.edu" alias getextramail="fetchmail --ssl --keep --folder mail/orgs/cor,mail/dorks,mail/orgs/mentor --protocol IMAP honors.tntech.edu" alias tunnel="ssh -L :2222:wholcomb.intranet:22 root@secure.mpp.org" alias getwork="rsync --recursive --verbose --progress --links --rsh ssh\\ -p2222 wholcomb@localhost2:Public ~/" alias getmusic="rsync --recursive --verbose --progress --links --rsh ssh\\ -p2222 wholcomb@localhost2:Music/ /usr/share/music/" PROG_DIR="$WEBSITE_DIR/pcvs.org/mr/will" alias getpics="$PROG_DIR/bin/getpics.sh" alias forward="$PROG_DIR/bin/forward.sh" alias days="date=\$(date +%Y/%m/%d); \ passed=\$(perl $PROG_DIR/bin/days.pl 2003/6/24 \$date); \ left=\$(perl $PROG_DIR/bin/days.pl \$date 2005/9/16); \ percent=\$(( \$passed * 10000 / (\$passed + \$left) )); \ percent=\${percent:0:\$(( \${#percent} - 2 ))}.\${percent#??}; \ echo \$date - you have been here \$passed days and have \$left left \(\$percent%\)" alias syncfiles="find \"$WEBSITE_DIR\" \\( -name \"*~\" -or -name \".*~\" \\) -printf \"\\\"%p\\\"\\n\" | xargs rm -v; \ rsync --rsh=ssh --partial --progress --verbose --recursive \ --delete-after --archive --compress \ --exclude=Thumbs.db --exclude=\".#*\" --exclude=\"#*\" --exclude=.xvpics \ --exclude=\"sites/awstats/reports/\" --exclude=sites/awstats/data/ \ --exclude=\"sites/pcvs.org/mr/links.html\" \ --exclude=roster/ --exclude=carl/ \ --exclude=\"sites/gallery\" --exclude=\"sites/albums\" \ \"$WEBSITE_DIR\" will@himinbi.org:" export __HASHDIR=".../hashes/" export LOCAL="$__HASHDIR" export REMOTE="wjholcomb@madstones.com" ARGS="--rsh=ssh --partial --progress --verbose --recursive --archive --compress" alias hashbins="find \( -name jpg -or -name png -or -name gif -or -name odp -or -name mpeg -or -name avi -or -name webm -or -name ttf \) -print0 | xargs -0 lnhash" alias pushhashes="eval rsync $ARGS \"\$LOCAL\" \"\$REMOTE:\$__HASHDIR\"" alias pullhashes="rsync $ARGS \"\$REMOTE:\$__HASHDIR\" \"\$LOCAL\"" alias print="eval echo \$OUT" [[ "$(pwd)" == ~ && -d ... ]] && cd ... PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting git config --global user.name "Will Holcomb" git config --global user.email "will@dhappy.org" [ $(hostname) = 'M1600261' ] && git config --global user.email "c_holcomb.william@cerner.com" ### Added by the Heroku Toolbelt export PATH="/usr/local/heroku/bin:$PATH" export NVM_DIR="/home/will/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm