Skip to content

Instantly share code, notes, and snippets.

@enriquesanchezb
Created November 8, 2014 09:55
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 enriquesanchezb/b90c9bf9089c7f92ef00 to your computer and use it in GitHub Desktop.
Save enriquesanchezb/b90c9bf9089c7f92ef00 to your computer and use it in GitHub Desktop.
bash_profile
export PS1="\[\e[00;37m\]\n\[\e[0m\]\[\e[01;36m\][\A]\[\e[0m\]\[\e[00;37m\] \[\e[0m\]\[\e[01;32m\]\u\[\e[0m\]\[\e[01;36m\]@\[\e[0m\]\[\e[01;33m\]\h:\[\e[0m\]\[\e[00;37m\] \[\e[0m\]\[\e[01;35m\]\w\[\e[0m\]\[\e[00;37m\]\n\[\e[0m\]\[\e[01;35m\]->\[\e[0m\]\[\e[00;37m\] \[\e[0m\]"
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
# Composer Alias
alias composer='php /usr/bin/composer.phar'
# Laravel 4 Artisan
alias art='php artisan'
# Open file with Sublime Text 2 $ st /folder/example.php
alias st='open -a "Sublime Text 2"'
# Jump back n directories at a time
alias ..='cd ..'
alias ...='cd ../../'
alias ....='cd ../../../'
alias .....='cd ../../../../'
alias ......='cd ../../../../../'
alias cd..='cd ..'
alias 3.='cd ../../..'
alias 4.='cd ../../../..'
alias 5.='cd ../../../../..'
# Flush DNS (Mac OS X Moutain Lion or Lion)
alias dnsflush='sudo killall -HUP mDNSResponder'
# To clear terminal
alias c='clear'
# To exit terminal
alias e='exit'
# See http://www.shellperson.net/using-sudo-with-an-alias/
alias sudo='sudo '
# This helps me edit files that my user isn't the owner of
alias edit='SUDO_EDITOR="open -FWne" sudo -e'
# The alias that takes me here - to editing these very aliases
alias edit_profile='open -e ~/.bash_profile'
# I do a lot of web development, so I need to edit these non-owned files fairly often
alias edit_hosts='edit /etc/hosts'
alias edit_httpd='edit /etc/apache2/httpd.conf'
alias edit_php='edit /etc/php.ini'
alias edit_vhosts='edit /etc/apache2/extra/httpd-vhosts.conf'
# Some of my goto commands, including one to open the php extension folder for when I need to install custom extensions
alias goto_web='cd ~/Sites'
alias goto_phpext='sudo open /usr/lib/php/extensions/no-debug-non-zts-20100525'
# Go to MAMP/htdocs
alias goto_htdocs='cd /Applications/MAMP/htdocs'
# This alias recursively destroys all .DS_Store files in the folder I am currently in
alias killDS='find . -name *.DS_Store -type f -delete'
# This alias kill all the process active with the same name
kl () {
sudo kill -9 `ps -ef | grep $1 | grep -v grep | awk '{print $2}'`;
}
# An alias to start my custom MySQL installation instead of the default one
alias mysql='/usr/local/mysql-5.5.25-osx10.6-x86_64/bin/mysql -u root'
# This alias reloads this file
alias reload_profile='. ~/.bash_profile'
# Mac get stuck very often and are extremely slow and unstable on shutdowns. This forces a shutdown.
alias poweroff='sudo /sbin/shutdown -h now'
# All other aliases
alias ll='ls -la'
## Show hidden files ##
alias l.='ls -d .* --color=auto'
alias search=grep
alias ports='sudo lsof -iTCP -sTCP:LISTEN -P'
# handy short cuts #
alias h='history'
alias j='jobs -l'
# Run second instance of Skype (Good for using multiple accounts)
alias ss='sudo /Applications/Skype.app/Contents/MacOS/Skype /secondary'
# Get OS X Software Updates, update Homebrew itself, and upgrade installed Homebrew packages
alias update="sudo softwareupdate -i -a; brew update; brew upgrade"
# Speed-up Terminal load time by clearing system logs
alias speedup="sudo rm -rf /private/var/log/asl/*"
# 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; speedup"
# IP addresses #
# To get my external IP
alias myip='curl icanhazip.com'
# Other IP / Method
alias ip="dig +short myip.opendns.com @resolver1.opendns.com"
alias localip="ifconfig en0 inet | grep 'inet ' | awk ' { print $2 } '"
alias ips="ifconfig -a | perl -nle'/(\d+\.\d+\.\d+\.\d+)/ && print $1'"
alias ports='netstat -tulanp'
# Enhanced WHOIS lookups
alias whois="whois -h whois-servers.net"
# Show Hidden files in Finder
alias finder_s='defaults write com.apple.Finder AppleShowAllFiles TRUE; killAll Finder'
# Hide Hidden files in Finder
alias finder_h='defaults write com.apple.Finder AppleShowAllFiles FALSE; killAll Finder'
export PATH=$PATH:/Users/enriquesanchez/Library/android-sdk-macosx/platform-tools:/Users/enriquesanchez/Library/android-sdk-macosx/tools:/Users/enriquesanchez/Library/Chromedriver/
export PATH=/usr/local/bin:$PATH
export ANDROID_HOME=/Users/enriquesanchez/Library/android-sdk-macosx/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment