Skip to content

Instantly share code, notes, and snippets.

@jphase
Last active February 18, 2016 01:40
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 jphase/db1fcc88102277a7131a to your computer and use it in GitHub Desktop.
Save jphase/db1fcc88102277a7131a to your computer and use it in GitHub Desktop.
Mac Bash Profile
# Bash shortcuts
alias ll='ls -Ghal $@'
alias ls='ls -G $@'
alias grep='grep --colour $@'
alias mkdir='mkdir -p $@'
# Git shortcuts
alias gitclean='git diff --diff-filter=D --name-only -z | xargs -0 git rm'
alias gitquick='git pull && git add . && echo "Enter a commit message (optional): " && read MSG && git commit -m "$MSG" && git push origin master'
alias gadd='git add .'
alias gpull='git pull origin master'
alias gpush='git push origin master'
# Application shortcuts
alias sublime='/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl $1'
# SSH shortcuts
alias dev='ssh `whoami`@s1.moguldom.com'
alias prod='ssh `whoami`@afktravel.com'
alias zion='ssh zion "find /www/*/logs/ -maxdepth 1 -type f -iname access.log -print0 | xargs -0 tail -f" | logstalgia --sync'
# Service shortcuts
alias nginxrestart='launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist && launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist'
alias nginxstart='launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist'
alias nginxstop='launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist'
alias phprestart='launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.php56.plist && launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.php56.plist'
alias phpstart='launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.php56.plist'
alias phpstop='launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.php56.plist'
alias mysqlrestart='mysql.server restart'
alias mysqlstart='mysql.server start'
alias mysqlstop='mysql.server stop'
# Show git branch
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
# Colors and path stuffs
export PS1="\[\033[00m\]\e[36;1m\]\u\e[33;1m\]@\e[32;1m\]\h\[\033[01;33m\] \w \[\033[31m\]\$(parse_git_branch)\[\033[00m\]$\[\033[00m\] "
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad
export PATH=$PATH:/bin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment