-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.bashrc
143 lines (119 loc) · 3.06 KB
/
.bashrc
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
############################
# Make it so that I can execute binaries in my local node_modules path
############################
export PATH=$PATH:./node_modules/.bin
############################
# colors for output
############################
NC='\e[0m' # No Color
red='\e[0;31m'
black='\e[0;30m'
blue='\e[0;34m'
green='\e[0;32m'
cyan='\e[0;36m'
red='\e[0;31m'
purple='\e[0;35m'
orange='\e[0;33m'
yellow='\e[1;33m'
white='\e[1;37m'
lgray='\e[0;37m'
dgray='\e[1;30m'
lblue='\e[1;34m'
lgreen='\e[1;32m'
lcyan='\e[1;36m'
lred='\e[1;31m'
lpurple='\e[1;35m'
function kill-that-habit() {
echo -e "${red}Stop ${lgreen}that ${yellow}jackass${NC}"
}
alias updatepow="curl get.pow.cx | sh"
alias labrador-start="cd $HOME/.labrador && bundle exec rails s -e production -p 7488"
alias pg-start="postgres -D /usr/local/var/postgres"
alias dot="cd ~/dotfiles"
alias ebash="vim ~/dotfiles/.bashrc"
alias evim="vim ~/dotfiles/.vimrc"
alias v="vim"
alias cpath="pwd | tr -d '\n' | pbcopy"
alias p="cd ~/projects"
alias xx="exit"
alias h="history"
alias :q=kill-that-habit
alias :Q=kill-that-habit
alias ll="ls -ahl"
alias l="ls -l"
alias vim=/usr/local/bin/vim
##############
# ANSIBLE
##############
alias play="ansible-playbook"
alias vault="ansible-vault"
# mostly tmuxinator, but others like it too.
export EDITOR='vim'
#Git-Svn is sad about perl moving in xcode
export PERL5LIB="/Applications/Xcode.app/Contents/Developer/Library/Perl/5.16/darwin-thread-multi-2level"
############################
# Git
############################
alias g="git"
alias ap="git add -p"
alias b="git branch"
alias co="git checkout"
alias ob="git checkout -b"
alias up="git pull --rebase && git remote update origin --prune"
alias ga="git add"
alias gc="git commit"
alias gmf="git merge --ff-only"
alias gp="git push"
alias gpu="git push -u"
alias gs="git status"
alias gsh="git show"
alias ghi="git hist"
alias gfuckit="git reset --hard HEAD@{upstream}"
alias branch="git symbolic-ref --short HEAD 2> /dev/null"
alias cbranch="git symbolic-ref --short HEAD 2> /dev/null | tr -d '\n' | pbcopy"
alias clean-branches="git branch --merged | grep -v master | xargs git branch -d"
alias gd="git diff"
alias gdn="git diff --name-only"
alias grb="git rebase"
alias gcp="git cherry-pick"
alias gpp='git-poooosh'
############################
# Conveniences
############################
alias gpg=gpg2
export GPG_TTY=$(tty) # Needed for gpg2
function mcd() {
mkdir $1
cd $1
}
function cdl() {
cd $1
ls
}
# Examples:
# whats-listening-to 8000
function whats-listening-to() {
lsof -i tcp:$1
}
function wreck() {
pushd .
WRECKDIR=`mktemp -d /tmp/wreckXXXXXXXXX` && {
cd $WRECKDIR
}
}
function clear-dns-cache() {
sudo killall -HUP mDNSResponder
}
export TERM="xterm-256color"
############################
# Docker
############################
alias d=docker
alias dc=docker-compose
alias dm=docker-machine
alias dsh=docker-shell
# Shell into a running docker container with dsh <CONTAINER_ID>
function docker-shell(){
docker exec -it "$@" /bin/bash
}
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting