Created
October 27, 2016 23:06
-
-
Save trystant/0713102ac601bd743d90e4d0157e8aa8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# System-wide .bashrc file for interactive bash(1) shells. | |
# command to mount the android file image | |
function mountAndroid { hdiutil attach ~/AndroidDev.dmg -mountpoint /Volumes/Android; } | |
# Function to upload a screenshot to grandkru.com | |
upload_error_image() { | |
screen_shot_file=`ls -at ~/Desktop/Screen* | head -1` | |
command="scp -2 -v \"${screen_shot_file}\" [email protected]:public_html/grandkru.com/images/${1}" | |
echo "Running ${command}" | |
sh -c "${command}" | |
} | |
# Clear screenshots from the desktop | |
clear_desktop_screenshots() { | |
if [ ! -f /Volumes/test ] | |
then | |
mkdir /Volumes/test | |
mount_smbfs //test:test@mss-ffb436/Test /Volumes/test | |
fi | |
mv ~/Desktop/Screen* /Volumes/test/My\ Photos | |
} | |
# Function to change multiple files in a directory with a regular expression | |
rename_multiple_files_regular_expression() { | |
# TODO: Figure out argument syntax | |
# if [$# -lt 3]; then | |
# echo "Usage: $0 <directory> <search pattern> <replacement pattern>" | |
# exit 1 | |
# fi | |
cd $1 | |
for file in * | |
do | |
mv $file ${file/$2/$3} | |
done | |
} | |
nanets_cap_deploy() { | |
cap $1 deploy | |
cap $1 deploy:upload_directories:link | |
cap $1 deploy:cleanup | |
cap $1 passenger:restart | |
cap $1 deploy:upload_directories:link_videos | |
} | |
# setting patch for rmagick configuration | |
export PKG_CONFIG_PATH=/usr/local/Cellar/imagemagick/6.7.5-7/lib/pkgconfig | |
export DYLD_LIBRARY_PATH="/usr/local/mysql/lib:$DYLD_LIBRARY_PATH" | |
# EC2 Variables | |
export EC2_HOME=/usr/local/amazon/ec2_api | |
export EC2_AMITOOL_HOME=/usr/local/amazon/ec2_ami | |
export EC2_PRIVATE_KEY=/Users/mnyon/.ec2/pk-SGCRWTN3M7HRX4F5BMHLBN6KQXIRFGGC.pem | |
#export EC2_CERT=/Users/mnyon/.ec2/cert-GJW7QGWGWPFT36HQSX3J4DKWL2E4XTPJ.pem | |
export EC2_CERT=/Users/mnyon/.ec2/cert-SGCRWTN3M7HRX4F5BMHLBN6KQXIRFGGC.pem | |
export EC2_KEYPAIR=/Users/mnyon/.ssh/id_rsa_gsg-keypair | |
# Image Magick installation | |
export MAGICK_HOME=/usr/local/image_magick | |
export LD_LIBRARY_PATH=$MAGICK_HOME/lib | |
# Have less use line numbers by default | |
export LESS='-RS#3NM~g' | |
export HISTSIZE=10000000 | |
export HISTTIMEFORMAT="%h/%d/%y-%H:%M:%S " | |
# Set paths | |
export PATH=$MAGICK_HOME/bin:$EC2_HOME/bin:$EC2_AMITOOL_HOME/bin:/usr/local/mongo/bin:/usr/local/depot_tools:/usr/local/mongodb/bin:/Users/mnyon/.rvm/bin:/usr/local/apache/bin:/usr/bin:/usr/local/bin:/Users/mnyon/bin:/usr/local/mysql/bin:/opt/local/bin:/opt/local/sbin:/usr/local/ant/bin:/usr/local/cruisecontrol/java/main/bin:/Users/mnyon/.rvm/bin:$PATH | |
export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home | |
export MANPATH=/usr/local/d_trace_toolkit/Man:/usr/local/man:/opt/local/share/man:$MANPATH | |
export EDITOR=emacs | |
export IRBRC=/Users/mnyon/.irbrc | |
export AUTOFEATURE=false | |
export RSPEC=true | |
export R_HOME=/Library/Frameworks/R.framework/Resources | |
# Fink initialization | |
test -r /sw/bin/init.sh && . /sw/bin/init.sh | |
# Bash functions | |
s_all() { | |
grep -R $1 * | |
} | |
# Run spec on one class with options | |
quickspec() { | |
bundle exec spec --autospec $1 -O spec/spec.opts | |
} | |
# migrate one shortcut | |
migrate_one() { | |
rake db:migrate_one VERSION=$1 DIRECTION=$2 $3 | |
} | |
migrate_up() { | |
rake db:migrate:up VERSION=$1 | |
} | |
# Set ruby interpreter for TextMate | |
export TM_RUBY=/usr/local/bin/ruby | |
# Aliases | |
alias mup='migrate_up' | |
alias mvr='rename_multiple_files_regular_expression' | |
alias ncd='nanets_cap_deploy' | |
alias cds='clear_desktop_screenshots' | |
alias td='ls -alt | head' | |
alias pd='lp -d Officejet_7200_series__2A73FF_' | |
alias cmi='./configure && make && sudo make install' | |
alias cmti='./configure && make && make test && sudo make install' | |
alias pmi='perl Makefile.pl && make && sudo make install' | |
alias change='emacs -nw ~/.bash_profile; source ~/.bash_profile' | |
alias dir='ls -alF | l' | |
alias cx='chmod +x' | |
alias res='touch tmp/restart' | |
alias resd='touch tmp/restart.txt; touch tmp/debug.txt' | |
alias gimme='git clone' | |
alias ag='alias | grep' | |
# Working Directory Aliases | |
alias apps='cd /Applications' | |
alias docs='cd ~/Documents' | |
alias downs='cd ~/Downloads' | |
alias desk='cd ~/Desktop' | |
alias mdowns='cd ~/Library/Mail\ Downloads' | |
alias ws='cd ~/Documents/workspace' | |
alias cr='cd ~/Documents/workspace/career' | |
# Ford Models | |
alias fo='cd /Users/mnyon/Documents/workspace/ford_models' | |
alias dfqa='RAILS_ENV=qa cap deploy -Sbranch=new_private_site' | |
alias dfp='RAILS_ENV=production cap deploy' | |
# NANETS | |
alias csd='cap staging deploy && cap staging deploy:upload_directories:link && cap staging passenger:restart && cap staging deploy:cleanup' | |
alias cpd='cap production deploy && cap production deploy:upload_directories:link && cap production passenger:restart && cap production deploy:cleanup' | |
# Nodating | |
alias nd='cd /Users/mnyon/Documents/workspace/nodating' | |
# Peregrine | |
alias pdg='ssh [email protected]' | |
# Locationstar | |
alias lst='ssh [email protected]' | |
# Good to go out | |
alias gt='cd ~/Documents/workspace/gtgo' | |
# General aliases | |
alias hig='history | grep' | |
alias pg='ps aux | grep' | |
alias l='less' | |
alias lock='/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend' | |
alias sleep='/Users/mnyon/work/bin/osx/sleep.sh' | |
alias pdf='open -a Preview.app' | |
alias rls="ls -ct /tmp/status* | awk '{ print $0}' | xargs less" | |
alias vjar='jar -tf ' | |
alias uei='upload_error_image' | |
alias spk='cat ~/.ssh/id_dsa.pub | pbcopy' | |
# Rails development aliases | |
alias qs='quickspec' | |
alias s-a='script/autospec' | |
alias s-c='script/console' | |
alias s-st='script/server thin' | |
alias s-sm='script/server mongrel' | |
alias todev='RAILS_ENV=development; export RAILS_ENV' | |
alias totest='RAILS_ENV=test; export RAILS_ENV' | |
alias todev='RAILS_ENV=development; export RAILS_ENV' | |
alias totest='RAILS_ENV=test; export RAILS_ENV' | |
alias b='bundle' | |
alias bi='bundle install' | |
alias bid='bundle install --disable-shared-gems' | |
alias dihg='gem list --local' | |
alias be='bundle exec' | |
alias berg2='bundle exec script/generate' | |
alias berg3='bundle exec script/rails generate' | |
alias bers2='bundle exec script/server' | |
alias bers3='bundle exec script/rails server' | |
alias bescu2='bundle exec script/cucumber' | |
alias bescu3='bundle exec script/rails cucumber' | |
alias besc2='bundle exec script/console' | |
alias besc3='bundle exec script/rails console' | |
alias bu='bundle update' | |
alias tdl='tail -f log/development.log' | |
alias ttl='tail -f log/test.log' | |
alias ni='gem install nokogiri -- --with-xml2-lib=/usr/local/lib --with-xml2-include=/usr/local/include/libxml2 --with-xslt-lib=/usr/local/lib --with-xslt-include=/usr/local/include' | |
# GitC aliases | |
alias btb='backup_to_branch' | |
alias cgr='create_git_repo' | |
alias fb='git log | grep ' | |
alias ga='git add' | |
alias gap='git add -p' | |
alias gb='git blame' | |
alias gbr='git branch' | |
alias gc='git clone' | |
alias gchm='git checkout master' | |
alias gcho='git checkout' | |
alias gcp='git cherry-pick' | |
alias gd='git diff' | |
alias gf='git fetch' | |
alias gfo='git fetch origin' | |
alias gl='git log' | |
alias gm='git merge' | |
alias gmom='git merge origin/master' | |
alias gp='git pull' | |
alias gpu='git push' | |
alias gpo='git push origin' | |
alias gpom='git push origin master' | |
alias gco='git commit -m' | |
alias gca='git commit -a -m' | |
alias gr='git remote' | |
alias grv='git remote -v' | |
alias grim='git rebase -i -m' | |
alias grv='git remote -v' | |
alias grim='git rebase -i -m' | |
alias gs='git stash' | |
alias gsa='git stash apply' | |
alias gsh='git show' | |
alias gst='git status' | |
alias gsu='git submodule update --init' | |
alias grs='git reset --soft HEAD^' | |
alias grh='git reset --hard HEAD^' | |
# RVM aliases | |
alias rvg='rvm gemset' | |
alias rvge='rvm get' | |
alias rvi='rvm info' | |
alias rvr='rvm reload' | |
alias rvu='rvm use' | |
alias rvup='rvm update' | |
# SVN Aliases | |
alias sci='svn ci -m' | |
alias sd='svn diff' | |
alias sst='svn status' | |
alias sva='svn add' | |
alias svu='svn update' | |
# SSH Aliases | |
alias mnyon='ssh [email protected]' | |
alias slice='ssh -p 62474 [email protected]' | |
alias gkgit='ssh-add /Users/mnyon/.ssh/id_dsa_github.pub' | |
alias uc='update_config' | |
alias gkt='ssh -D 8080 -fN [email protected] -p 62474' | |
alias gkbt='ssh -D 8080 -fN [email protected]' | |
alias gkl='ssh -p 62474 [email protected]' | |
alias dgdl='ssh -p 2112 [email protected]' | |
alias bch='ssh [email protected]' | |
alias zo='ssh [email protected]' | |
alias vw='ssh [email protected]' | |
alias pgt='ssh -i ~/ec2/PF.pem [email protected]' | |
alias pgwh='ssh -i ~/ec2/PF.pem [email protected]' | |
alias pgpo='ssh -i ~/ec2/PF.pem [email protected]' | |
alias pgces='ssh -i ~/ec2/PF.pem [email protected]' | |
alias pgprod='ssh -i ~/ec2/PF.pem [email protected]' | |
alias odp='ssh [email protected]' | |
alias ods='ssh [email protected] -p 62474' | |
alias nn='ssh [email protected] -p 22022' | |
# Source bash files: | |
source /Users/mnyon/bin/sudo.bash | |
source /Users/mnyon/bin/git-completion.sh | |
export DISPLAY=:0.0 | |
# Variables | |
export RAILS_PERF_DATA=/Users/mnyon/Documents/performance | |
export JRUBY_HOME=/usr/local/jruby | |
export ANT_HOME=/usr/local/ant | |
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' | |
if [ -f ~/bin/git_svn_check.sh ] ; then source ~/bin/git_svn_check.sh ; fi | |
## | |
# Your previous /Users/mnyon/.bash_profile file was backed up as /Users/mnyon/.bash_profile.macports-saved_2010-11-09_at_20:52:12 | |
## | |
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function* | |
0Looking |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment