Skip to content

Instantly share code, notes, and snippets.

@skorotkiewicz
Created January 4, 2017 03:44
Show Gist options
  • Save skorotkiewicz/6e075bc81032e6ee7e92bfb82a3e62c1 to your computer and use it in GitHub Desktop.
Save skorotkiewicz/6e075bc81032e6ee7e92bfb82a3e62c1 to your computer and use it in GitHub Desktop.
my .bashrc
alias ser='cd /etc/apache2/sites-e*;ls'
alias serR='/etc/init.d/apache2 restart'
alias serlog='tail -f /var/log/apache2/access.log'
alias authlog='tail -f /var/log/auth.log'
alias path='echo -e ${PATH//:/\\n}'
function unzip2dir() {
ls $1|awk -F'.zip' '{print "unzip "$0" -d "$1}'|sh
}
function myip() {
local ip=$(curl http://ip.itunix.eu)
echo $ip
}
function f() {
#find text in files on this directory
grep -i -n -r "$1" .
}
function psa () {
ps aux | grep $1
}
### Extract Archives ###
function unpact () {
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xjvf $1 ;;
*.tar.gz) tar xzvf $1 ;;
*.bz2) bzip2 -d $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xf $1 ;;
*.tbz2) tar xjf $1 ;;
*.tgz) tar xzf $1 ;;
*.zip) unzip2dir $1 ;;
*.Z) uncompress $1 ;;
*.7z) 7z x $1 ;;
*.ace) unace x $1 ;;
*) echo "'$1' cannot be extracted via extract()" ;;
esac
else
echo "'$1' is not a valid file"
fi
}
export PATH="/usr/local/heroku/bin:$PATH"
. /root/torch/install/bin/torch-activate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment