Skip to content

Instantly share code, notes, and snippets.

@AndrewReitz
Last active January 2, 2016 10:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndrewReitz/8293401 to your computer and use it in GitHub Desktop.
Save AndrewReitz/8293401 to your computer and use it in GitHub Desktop.
My .bashrc so I can add things and remember them elsewhere
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User specific aliases and functions
#Exports
export ANDROID_HOME="$HOME/.opt/android/sdk"
export GROOVY_HOME="$HOME/.groovy"
#Path
PATH=$HOME/.bin:$PATH
PATH=$ANDROID_HOME/tools:$PATH
PATH=$ANDROID_HOME/platform-tools:$PATH
PATH=$GROOVY_HOME/bin:$PATH
#Aliases
alias addbitbucket='ssh-add $HOME/.ssh/bitbucket'
alias addgithub='ssh-add $HOME/.ssh/github_pieces'
alias c='clear'
alias copy='xclip -sel clip' #copy whatever is piped in into the clipboard
alias top='htop'
alias la='ls -la'
alias ee='emacs -nw';
alias fuck='echo "aww, it will be alright"'
alias ss='static-server'
alias vpnhome='sshuttle --dns 10.0.0.1 -r areitz@tela.nodeath.co:34934 0/0'
alias df='df -H'
alias du='du -ch'
alias open='dolphin . &> /dev/null &'
alias ports='netstat -tulanp'
alias myip='wget http://ipecho.net/plain -O - -q && echo ""'
alias untar='tar -zxvf'
#Functions
# Creates an archive (*.tar.gz) from given directory.
function maketar() { tar cvzf "${1%%/}.tar.gz" "${1%%/}/"; }
# Create a ZIP archive of a file or folder.
function makezip() { zip -r "${1%%/}.zip" "$1" ; }
# Make your directories and files access rights sane.
function sanitize() { chmod -R u=rwX,g=rX,o= "$@" ;}
# Find something in a directory above the one you are in
function upfind() {
dir=`pwd`
while [ "$dir" != "/" ]; do
path=`find "$dir" -maxdepth 1 -name $1`
if [ ! -z $path ]; then
echo "$path"
return
fi
dir=`dirname "$dir"`
done
}
# Finds the gradle wrapper and executes it
function gw() {
$(upfind gradlew) $1
}
#Run these commands when terminal opens
red='\e[0;31m' # Color Red
NC='\e[0m' # No Color
echo -e "${red}"
fortune firefly
echo -e "${NC}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment