-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbashrc
More file actions
152 lines (122 loc) · 4.03 KB
/
Copy pathbashrc
File metadata and controls
152 lines (122 loc) · 4.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
export PATH=/usr/local/bin:/usr/local/sbin:$PATH:/usr/local/share/npm/bin:~/.bin
export NODE_PATH=/usr/local/lib/node
export DISPLAY=:0.0
export EDITOR=mvim
export GEM_EDITOR=mvim
# Colors ----------------------------------------------------------
export TERM=xterm-color
export GREP_OPTIONS='--color=auto' GREP_COLOR='1;32'
export CLICOLOR=1
# Setup some colors to use later in interactive shell or scripts
export COLOR_NC='\033[0m' # No Color
export COLOR_WHITE='\033[1;37m'
export COLOR_BLACK='\033[0;30m'
export COLOR_BLUE='\033[0;34m'
export COLOR_LIGHT_BLUE='\033[1;34m'
export COLOR_GREEN='\033[0;32m'
export COLOR_LIGHT_GREEN='\033[1;32m'
export COLOR_CYAN='\033[0;36m'
export COLOR_LIGHT_CYAN='\033[1;36m'
export COLOR_RED='\033[0;31m'
export COLOR_LIGHT_RED='\033[1;31m'
export COLOR_PURPLE='\033[0;35m'
export COLOR_LIGHT_PURPLE='\033[1;35m'
export COLOR_BROWN='\033[0;33m'
export COLOR_YELLOW='\033[1;33m'
export COLOR_GRAY='\033[1;30m'
export COLOR_LIGHT_GRAY='\033[0;37m'
alias colorslist="set | egrep 'COLOR_\w*'" # lists all the colors
# ls with colors
alias ls='ls -G'
# Shortcut to SSH into Fran's box.
alias irc='ssh lmarb@lukesh.com'
# Use hub: http://github.com/defunkt/hub
alias git=hub
# git aliases
alias g='git'
alias gst='git status -s'
alias gb='git branch'
alias gba='git branch -a'
alias pull='git pull --rebase'
alias pulls='git stash && git pull --rebase && git stash pop'
alias push='git push'
alias stage='git push && git push staging master'
# GitX aliases
alias gx='gitx --all'
alias gxc='gitx --commit'
# Open the current direcotry in MacVim
alias m='mvim .'
alias e='mvim'
alias em='open -a /Applications/Emacs.app'
# Rails aliases
alias r='rails'
alias mig="rake db:migrate && rake db:migrate:redo && rake db:test:prepare"
alias b='bundle'
alias br='bundle install --relock'
alias h='heroku'
# Rails 2.x aliases
alias ss='./script/server'
alias sc='./script/console'
alias gen="script/generate"
# Testing aliases
alias aut='autotest'
alias cuc='rake cucumber'
alias tc='rake test && rake cucumber'
# Check which Ruby version I'm using
alias rv='ruby --version'
# Some services
alias mem="memcached -d"
alias post="pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start"
alias post_stop="pg_ctl -D /usr/local/var/postgres stop -s -m fast"
# Shortcut to start mongod
#alias mongo='mongod run --config /usr/local/Cellar/mongodb/1.2.3-x86_64/mongod.conf'
# Remove the generated _site directory and start the Jekyll server.
alias jek="rm -rf _site && bundle exec jekyll --server --auto --pygments"
alias ejek="rm -rf _site && bundle exec ejekyll --server --auto --pygments"
# Create a new screen session with the name "slime"
alias s="screen -S slime"
# Restart Apache
alias are="sudo apachectl restart"
# QuickLook an image
alias ql='qlmanage -p 2>/dev/null'
# Run input through json gem
alias pj=prettify_json.rb
# Shotcut to pipe input to the clipboard
alias pc=pbcopy
# Print CloudApp Pro stats to Campfire
alias clstats="cloud_nine_ruby ~/Documents/Projects/ruby/cloud_nine/cloud_nine.rb"
# Load the git prompt script.
source ~/.git-prompt
# Load git autocompletion script.
source ~/.git-completion
# Homebrew completion
source `brew --prefix`/Library/Contributions/brew_bash_completion.sh
exec_last_feature_or_test() {
history|sort -r|sed 's/^ *[0-9]* //'|while read i;do if [[ "$i" =~ ^ruby || "$i" =~ ^r?spec || "$i" =~ ^(bundle exec )?cucumber ]];then echo $i|sh;exit;fi;done
}
dusort() {
du -kd 1 | sort -nr | awk '
BEGIN {
split("KB,MB,GB,TB", Units, ",");
}
{
u = 1;
while ($1 >= 1024) {
$1 = $1 / 1024;
u += 1
}
$1 = sprintf("%.1f %s", $1, Units[u]);
print $0;
}
'
}
# Allow ctrl-s to reverse through bash history (ctrl-r)
#stty stop undef
# This loads RVM into a shell session.
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
# REE tuning
export RUBY_HEAP_MIN_SLOTS=1000000
export RUBY_HEAP_SLOTS_INCREMENT=1000000
export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1
export RUBY_GC_MALLOC_LIMIT=1000000000
export RUBY_HEAP_FREE_MIN=500000