-
-
Save patrickandre/6413422 to your computer and use it in GitHub Desktop.
This file contains 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
#!/usr/bin/env bash | |
# Helpful Aliases | |
alias ex="exit" | |
alias e="subl" | |
alias c="clear" | |
alias ls="ls -lh" | |
alias la="ls -lah" | |
alias pwd="pwd -LP" | |
# Helpful Python Aiases | |
alias rmpyc='find . -name "*.pyc" | xargs rm' | |
alias pyinit="touch __init__.py" | |
alias mkvirtualenv="mkvirtualenv --no-site-packages" | |
alias virtualenv="virtualenv --no-site-packages" | |
alias cdwenworld="cd ~/Sites/wenworld" | |
alias pep8="pep8 --ignore=E501,E401 $@" | |
# A short cut for adding files and directories to your .gitignore file | |
function gitignore() { | |
if [ ! -f .gitignore ]; then | |
echo ".gitignore" >> .gitignore; | |
fi | |
echo "$1" >> .gitignore ; | |
} | |
# -------------------------------------------------------------------------- # | |
# DAEMON SHORTCUTS | |
# -------------------------------------------------------------------------- # | |
# st = Start | |
# sp = Stop | |
# r = Reload | |
# rst = Restart | |
# MySQL | |
alias mst="/usr/local/bin/mysql.server start" | |
alias msp="/usr/local/bin/mysql.server stop" | |
# Apache | |
alias ast="sudo apachectl start" | |
alias asp="sudo apachectl stop" | |
alias ar="sudo apachectl graceful" | |
alias arst="sudo apachectl restart" | |
function amemtotal() { | |
ps -u www -o pid,rss,command | awk '{total+=$2}END{printf("%d MB\n", total/1024)}' | |
} | |
# Nginx | |
alias nst="sudo nginx" | |
alias nsp="sudo nginx -s stop" | |
alias nr="sudo nginx -s reload" | |
# Postgres | |
alias pgst="pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start" | |
alias pgsp="pg_ctl -D /usr/local/var/postgres stop -s -m fast" | |
alias pgps="ps -u postgres -o pid,rss,command" | |
function pgmemtotal() { | |
ps -u postgres -o pid,rss,command | awk '{total+=$2}END{printf("%d MB\n", total/1024)}' | |
} | |
# Load any additional local alias | |
if [ -f ~/.dotfiles/aliases/local_aliases ]; then | |
. ~/.dotfiles/aliases/local_aliases | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment