Last active
December 28, 2015 23:59
-
-
Save pabloogc/7582453 to your computer and use it in GitHub Desktop.
bashrc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Path | |
export DEV_FOLDER=~/development | |
export TOOLS_FOLDER=$DEV_FOLDER/tools | |
export PYTHON_VENV=~/development/envs | |
PATH=/usr/local/bin:$PATH | |
PATH=$PATH:/Applications/Android\ Studio.app/sdk/platform-tools | |
PATH=$PATH:$TOOLS_FOLDER/ndk | |
PATH=$PATH:~/development/gradle/gradle-1.9/bin | |
# Aliases | |
alias ls='ls -GFh' | |
alias l='ls -lGFh' | |
alias la='ls -laGHf' | |
alias cdev='cd $DEV_FOLDER' | |
alias amazon='ssh -i ~/.ssh/micro_ec2_amazon.pem [email protected]' | |
# Python | |
function enva() | |
{ # Activate the given virtual enviroment | |
source $PYTHON_VENV/$1/bin/activate | |
} | |
function envd() | |
{ | |
deactivate | |
} | |
# General functions | |
function swap() | |
{ | |
local TMPFILE=tmp.$$ | |
[ $# -ne 2 ] && echo "swap: 2 arguments needed" && return 1 | |
[ ! -e $1 ] && echo "swap: $1 does not exist" && return 1 | |
[ ! -e $2 ] && echo "swap: $2 does not exist" && return 1 | |
mv "$1" $TMPFILE | |
mv "$2" "$1" | |
mv $TMPFILE "$2" | |
} | |
function extract() # Handy Extract Program | |
{ | |
if [ -f $1 ] ; then | |
case $1 in | |
*.tar.bz2) tar xvjf $1 ;; | |
*.tar.gz) tar xvzf $1 ;; | |
*.bz2) bunzip2 $1 ;; | |
*.rar) unrar x $1 ;; | |
*.gz) gunzip $1 ;; | |
*.tar) tar xvf $1 ;; | |
*.tbz2) tar xvjf $1 ;; | |
*.tgz) tar xvzf $1 ;; | |
*.zip) unzip $1 ;; | |
*.Z) uncompress $1 ;; | |
*.7z) 7z x $1 ;; | |
*) echo "'$1' cannot be extracted via >extract<" ;; | |
esac | |
else | |
echo "'$1' is not a valid file!" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment