Skip to content

Instantly share code, notes, and snippets.

@Oshuma
Created October 11, 2009 01:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Oshuma/207320 to your computer and use it in GitHub Desktop.
Save Oshuma/207320 to your computer and use it in GitHub Desktop.
mac.zsh
# ----------------------
# variables
# ----------------------
PATH="$PATH:/opt/local/bin:/opt/local/sbin:/usr/games:/usr/local/mysql/bin:/usr/local/sbin"
MANPATH="$MANPATH:/opt/local/man"
IRB_HISTORY_FILE=$HOME/.irb_history
LESS='-M -R -X'
# ----------------------
# bindings
# ----------------------
bindkey "^A" beginning-of-line
bindkey "^E" end-of-line
# ----------------------
# aliases
# ----------------------
alias cp='cp -i'
alias mv='mv -i'
alias rm='rm -i'
alias :='cd ../'
alias ::='cd ../../'
alias :::='cd ../../../'
alias ::::='cd ../../../../'
alias ls='ls -G -F'
alias l='ls -l'
alias la='ls -a'
alias lh='ls -lh'
# git stuff
alias git='nocorrect git' # no zsh correction for 'git'
alias ga='git add'
alias gb='git branch -a -v'
alias gd='git diff'
alias gi='git status; echo; git branch -av'
alias gm='git merge '
alias gnb='git checkout -b ' # must pass new branch name
alias gx='gitx'
alias ra='rake'
alias rt='rake --tasks'
alias gemi='gem install --no-ri --no-rdoc '
alias sgemi='sudo gem install --no-ri --no-rdoc '
alias pfind='ps aux |grep '
alias enable_wireshark='sudo chgrp admin /dev/bpf*; sudo chmod g+rw /dev/bpf*'
alias firefox='/Applications/Firefox.app/Contents/MacOS/firefox -ProfileManager'
alias getip="curl -s http://checkip.dyndns.org | sed 's/[^0-9.]//g'"
alias stop_privoxy='sh /Library/Privoxy/StopPrivoxy.command'
alias start_cupsd='sudo launchctl load /System/Library/LaunchDaemons/org.cups.cupsd.plist'
alias stop_cupsd='sudo launchctl unload /System/Library/LaunchDaemons/org.cups.cupsd.plist'
# ----------------------
# functions
# ----------------------
function anonymize {
privoxy_dir='/Library/Privoxy'
current_dir=`pwd`
cd $privoxy_dir &&
sudo $privoxy_dir/privoxy --pidfile /var/run/privoxy.pid ./config > /dev/null 2>&1 &&
open /Applications/Vidalia.app &&
cd $current_dir
}
# gc => git checkout master
# gc bugs => git checkout bugs
unalias gc
function gc {
if [ -z "$1" ]; then
git checkout master
else
git checkout $1
fi
}
function trash {
mv -i $* $HOME/.Trash/
}
function mamp_start {
current_dir=`pwd`
echo "Starting Apache..."
sudo apachectl start &&
cd /usr/local/mysql/ &&
echo "Starting MySQL..."
sudo ./bin/mysqld_safe
cd $current_dir
}
function mamp_stop {
echo "Stopping Apache..."
sudo apachectl stop &&
echo "Stopping MySQL..."
sudo mysqladmin shutdown
echo "...done."
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment