Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
77 lines (62 sloc) 3.04 KB
# Shortcuts
alias s="cd ~/Sites"
alias dl="cd ~/Downloads"
alias dt="cd ~/Desktop"
alias dot="cd ~/Cloud/Repos/dotfiles"
alias g="git"
alias h="history"
alias v="vim"
alias o="open"
alias oo="open ."
alias subl="/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl -n"
# Lamp Shortcuts
alias lamp-start="sudo apachectl start; mysql.server start"
alias lamp-stop="sudo apachectl stop; mysql.server stop"
alias lamp-restart="sudo apachectl restart; mysql.server restart"
alias apache-start="sudo apachectl start"
alias apache-stop="sudo apachectl stop"
alias apache-restart="sudo apachectl restart"
alias apache-debug="sudo apachectl -k start -e Debug -E /dev/stdout"
alias mysql-start="mysql.server start"
alias mysql-stop="mysql.server stop"
alias mysql-restart="mysql.server restart"
# Recursively delete `.DS_Store` files
alias cleanup="find . -type f -name '*.DS_Store' -ls -delete"
# Stopwatch
alias timer='echo "Timer started. Stop with Ctrl-D." && date && time cat && date'
# Get OS X Software Updates, and update installed Ruby gems, Homebrew, npm, and their installed packages
# alias update='sudo softwareupdate -i -a; brew update; brew upgrade; brew cleanup; npm update npm -g; npm update -g; sudo gem update'
# IP addresses
alias ip="dig +short myip.opendns.com @resolver1.opendns.com"
alias localip="ipconfig getifaddr en1"
alias ips="ifconfig -a | grep -o 'inet6\? \(\([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+\)\|[a-fA-F0-9:]\+\)' | sed -e 's/inet6* //'"
# Enhanced WHOIS lookups
alias whois="whois -h whois-servers.net"
# Empty the Trash on all mounted volumes and the main HDD
# Also, clear Apple’s System Logs to improve shell startup speed
alias emptytrash="sudo rm -rfv /Volumes/*/.Trashes; sudo rm -rfv ~/.Trash; sudo rm -rfv /private/var/log/asl/*.asl"
# Show/hide hidden files in Finder
alias show="defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder"
alias hide="defaults write com.apple.finder AppleShowAllFiles -bool false && killall Finder"
# Hide/show all desktop icons (useful when presenting)
alias hidedesktop="defaults write com.apple.finder CreateDesktop -bool false && killall Finder"
alias showdesktop="defaults write com.apple.finder CreateDesktop -bool true && killall Finder"
# Merge PDF files
# Usage: `mergepdf -o output.pdf input{1,2,3}.pdf`
alias mergepdf='/System/Library/Automator/Combine\ PDF\ Pages.action/Contents/Resources/join.py'
# Ring the terminal bell, and put a badge on Terminal.app’s Dock icon
# (useful when executing time-consuming commands)
alias badge="tput bel"
#################################
# Development aliases
alias dr="drush"
alias dx='export XDEBUG_CONFIG="idekey=PHPSTORM" && echo "Xdebug activated"'
alias dxx='unset XDEBUG_CONFIG && echo "Xdebug de-activated"'
# Tail logs
alias tphp="tail -f /Applications/MAMP/logs/php_error.log"
alias tdd="tail -f /Applications/MAMP/tmp/php/drupal_debug.txt"
# Site specific shortcuts
alias ddd="cd ~/Sites/drupal/d7/docroot"
alias pub="cd ~/Sites/publisher/7/docroot"
alias bln="cd ~/Sites/bleen.net/docroot"
alias c21="cd ~/Sites/c21hull/docroot"