Added a butt load of new aliases. Added comments

pull/1/merge
Adam Veldhousen 2015-01-13 09:38:52 -06:00
parent 22e61fc0a5
commit c2582b05fd
2 changed files with 43 additions and 4 deletions

View File

@ -29,6 +29,47 @@ alias gk='git fetch origin; git remote prune origin; gitk --all &'
alias dlb='dml'
alias gl='git log --pretty=format:"%h %ar by %an: %s"'
# Get week number
alias week='date +%V'
# 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 install npm -g; npm update -g; sudo gem update --system; sudo gem update'
# IP addresses
alias ip="dig +short myip.opendns.com @resolver1.opendns.com"
alias localip="ipconfig getifaddr en0"
alias ips="ifconfig -a | grep -o 'inet6\? \(addr:\)\?\s\?\(\(\([0-9]\+\.\)\{3\}[0-9]\+\)\|[a-fA-F0-9:]\+\)' | awk '{ sub(/inet6? (addr:)? ?/, \"\"); print }'"
# Empty the Trash on all mounted volumes and the main HDD
# Also, clear Apples 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"
# Recursively delete `.DS_Store` files
alias cleanup="find . -type f -name '*.DS_Store' -ls -delete"
# 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"
# Stuff I never really use but cannot delete either because of http://xkcd.com/530/
alias stfu="osascript -e 'set volume output muted true'"
alias pumpitup="osascript -e 'set volume 7'"
# Kill all the tabs in Chrome to free up memory
# [C] explained: http://www.commandlinefu.com/commands/view/402/exclude-grep-from-your-grepped-output-of-ps-alias-included-in-description
alias chromekill="ps ux | grep '[C]hrome Helper --type=renderer' | grep -v extension-process | tr -s ' ' | cut -d ' ' -f2 | xargs kill"
# Lock the screen (when going AFK)
alias afk="/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend"
alias mongodps="mongod --config /usr/local/etc/mongod.conf --fork --logpath ~/.docs/mongo.log"
# delete merged local branches

View File

@ -1,5 +1,7 @@
#!/bin/bash
# Setup go paths and source go bin
if [ -d "C:/Windows" ]; then
export WINDOWS="TRUE"
export GOPATH="D:/Projects/Programming/Go"
@ -20,17 +22,13 @@ export VISUAL=$EDITOR # Visual not really used differently from EDITOR anymore
export LESS='-iMR' # Case insensite search, verbose prompting and raw output
export PAGER=less # Used to display text / man files
#
# History
#
HISTCONTROL=ignoredups # No duplicate commands in history
HISTSIZE=50000 # For a huge history
export HISTIGNORE="[ ]*:&:bg:fg:exit:clear" # Don't save these commands in the history
shopt -s histappend # Append to the history file, not overwrite
#
# Bash behavior
#
shopt -s checkwinsize # Checks window size to get proper line wrapping
shopt -s cdspell # Corrects minor spelling errors when cd-ing
set -o vi # Set prompt to vi mode