From f38e2eca07c19870c1a938133f550c7bcb397233 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Wed, 3 Jun 2015 20:19:13 +0100 Subject: bashrc --- bashrc | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 bashrc (limited to 'bashrc') diff --git a/bashrc b/bashrc new file mode 100644 index 0000000..113760c --- /dev/null +++ b/bashrc @@ -0,0 +1,92 @@ +body() { + IFS= read -r header + printf '%s\n' "$header" + "$@" +} + +safedir() { + echo "$@ $(pwd)" | md5sum | cut -b-32 +} + +diffWith() { + diffCmd=$1 + diffFile="/tmp/diffwith-$(safedir $diffCmd).patch" + $diffCmd > $diffFile + dos2unix -q $diffFile + ( gvim -f $diffFile ; rm $diffFile ) & +} + +PATH="/usr/lib/ccache/bin:$PATH" +CORES=$(grep core\ id /proc/cpuinfo | sort -u | wc -l) +alias :e="gvim" +alias l="/bin/ls -lhvF --color" +alias grep="/bin/grep -I --color=auto --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.svn --exclude-dir=bin --exclude=tags --exclude-dir=docs/html" +alias emerge-state='watch "( ps -fC sandbox ; tail /var/log/emerge.log /var/tmp/portage/*/*/temp/build.log 2> /dev/null )"' +alias build='b2 -j$CORES $TARGET' +alias autobuild="build ; while inotifywait -qr . --exclude '/bin/|\.sw.|/\.git/' -e modify ; do clear ; printf '\e[3J' ; build ; done" +# CVS +export CVSROOT=":pserver:danielg@hawking.howden.press.net:/usr/local/src/CVS_SOURCE_TREE" +alias cvsd='diffWith "cvs diff -wubB"' +# SVN +alias svnd='diffWith "svn diff --force --no-diff-deleted -x -b"' +# Git +alias gitd='diffWith "git diff --no-prefix --relative -b -M"' +alias gitdc='diffWith "git diff --cached --no-prefix --relative -b -M"' +alias gst='git status' +# Hg +alias hgd='diffWith "hg diff -p -b"' +# Java +PATH=$JAVA_HOME/bin:$PATH +export CATALINA_HOME="/usr/share/tomcat-5.5/" +export M2_HOME="/usr/share/maven-bin-3.0" + +if [ "$(awk '$5=="/" {print $1}'