public
Last active — forked from bxt/.bashrc

  • Download Gist
.bashrc
Shell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
# .bashrc commands by bxt
 
# color promt:
PS1="\@ \[\033[0;35m\]\u@\\h\[\033[0m\]:\w> "
 
# ha ha
alias gn8="exit"
 
# check network config
alias myip="/sbin/ifconfig"
 
# process-finder
alias psf='ps aux | grep -v grep | grep '
 
# calculator
? () { echo "$*" | bc -l; }
 
# avoid duplicate entries in history
export HISTCONTROL=ignoredups
 
# save history for multiple terminals
shopt -s histappend
# make history long
export HISTSIZE=1000000 HISTFILESIZE=1000000
# ignore exit commands
declare -x HISTIGNORE=exit:gn8
 
# Share pwd via http on port 8000
alias webshare='python -c "import SimpleHTTPServer;SimpleHTTPServer.test()"'
## http://www.shell-fu.org/lister.php?id=54
 
# set my fav editor
export EDITOR=vim
 
# colored grep rulz
export GREP_OPTIONS='--color=auto'
 
# german greetings
if [ `date +%H` -lt 12 ]; then
echo "Moin. "
else
echo "Tach. "
fi
 
# remember DOS? ;)
alias dir='ls -la'
 
# list size of all files and dirs and sort
# very useful if you want to know wherer all your TB are gone...
alias imbadu="du -sk ./* | sort -n | awk 'BEGIN{ pref[1]=\"K\"; pref[2]=\"M\"; pref[3]=\"G\";} { total = total + \$1; x = \$1; y = 1; while( x > 1024 ) { x = (x + 1023)/1024; y++; } printf(\"%g%s\t%s\n\",int(x*10)/10,pref[y],\$2); } END { y = 1; while( total > 1024 ) { total = (total + 1023)/1024; y++; } printf(\"Total: %g%s\n\",int(total*10)/10,pref[y]); }'"
 
# Cool History Summerizer
historyawk(){ history|awk '{a[$2]++}END{for(i in a){printf"%5d\t%s\n",a[i],i}}'|sort -nr|head; }
## https://gist.github.com/87359
 
# handy find/grep aliases
rgrep() { fgrep -niIR "${1}" .; }
finame() { find . -iname "*${1}*"; }
 
# produce noise:
alias noise="cat /usr/share/icons/*/* > /dev/dsp"
## http://techfreaks4u.com/blog/posts/geekist-things-i-ever-did-in-linux/
 
# coin sound:
alias coin='play -q http://store.ukd1.co.uk.s3.amazonaws.com/coin.wav'
## https://gist.github.com/769923
.bashrc.mkd
Markdown

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.