-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathaliases
164 lines (129 loc) · 4.84 KB
/
aliases
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
153
154
155
156
157
158
159
160
161
162
163
164
# Collect my vim usage for _something_…
# http://www.patrick-wied.at/projects/heatmap-keyboard/
if command -v nvim &> /dev/null; then
alias vim="nvim -w ~/.vim_keystrokes"
else
alias vim="vim -w ~/.vim_keystrokes"
fi
# God have mercy on my soul
# alias vim="$HOME/bin/edit"
alias e="$HOME/bin/edit"
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
alias less='less -FirSX'
alias ag='ag --pager "\less -FirSX"'
# Add an "alert" alias for long running commands. Use like so:
# sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
# Colored up cat!
# Easy Insall & Pygments: sudo apt-get install python-pip && sudo pip install Pygments
alias c='pygmentize -O style=monokai -f console256 -g'
# I'm dumb
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias :q='exit'
# I'm <strike>smart</strike> dumb
# alias cd='cd -P'
# be nice
alias please='sudo'
# alias ll="ls -AlFh"
# alias l="ls -AlFh --group-directories-first"
alias l="tree --dirsfirst -ChF -L 1"
alias ll=" tree --dirsfirst --timefmt='%F %H:%M:%S' -CDhFupag -L 1"
alias tlog="tail -f /var/log/syslog"
# View HTTP traffic
alias httpdump="sudo tcpdump -i eth0 -nns 0 -w - | grep -a -E \"Host:|GET\""
alias sniff="sudo ngrep -d 'eth0' -t '^(GET|POST) ' 'tcp and port 80'"
alias localip="/sbin/ifconfig eth0 | awk '/inet addr:.*/ { split(\$2,a,\":\"); print a[2]; }'"
# Recursively delete `.DS_Store` files
alias cleanup="find . -name '*.DS_Store' -type f -ls -delete"
# Shortcuts
alias v="vim"
alias s="svn"
alias plan="$HOME/bin/edit $HOME/.dotfiles/plan"
# File size
alias fs="stat -c \"%s bytes\""
alias sosh=". \"${HOME}/.$(basename $SHELL)rc\""
# IP addresses
alias extip="dig +short myip.opendns.com @resolver1.opendns.com"
alias ips="ifconfig -a | perl -nle'/(\d+\.\d+\.\d+\.\d+)/ && print $1'"
# Enhanced WHOIS lookups
alias whois="whois -h whois-servers.net"
# tmux colors:
alias tmux="TERM=screen-256color-bce tmux"
alias tls="tmux list-sessions"
alias ta="tmux attach-session -t"
alias td="tmux kill-session -t"
# mutt colors
alias mutt="TERM=screen-256color-bce mutt"
alias dotfiles="cd ~/.dotfiles"
alias myvimrc="vim ~/.vimrc"
# SVN
alias sst="svn status"
alias sin="svn info"
alias spl="svn pl"
alias spg="svn pg"
alias scom="svn commit"
alias scat="svn cat"
alias sdif="svn diff"
alias srev="svn revert"
# Git
alias gst='git status'
alias gc='git commit -v'
alias ga='git add'
alias gp='git push'
alias gl='git up'
alias gd='git diff'
alias gg='git ack'
# Will return the current branch name
# Usage example: git pull origin $(current_branch)
alias 'hist?'="history | grep -i"
# Dumb osx
if [ "$(uname -s)" = "Darwin" ]; then
# French Toasting BSD sed
# alias sed='gsed'
# Show and hide files in Finder
alias showhidden="defaults write com.apple.Finder AppleShowAllFiles YES; killall -HUP Finder"
alias hidehidden="defaults write com.apple.Finder AppleShowAllFiles NO; killall -HUP Finder"
alias chrome="open -a google\ chrome"
alias photoshop="open -a '/Applications/Adobe Photoshop CS5/Adobe Photoshop CS5.app'"
alias f='open -a Finder'
# Flush Directory Service cache
alias flushdns="dscacheutil -flushcache"
alias mountainking="osascript -e 'say \"Dum dum dum dum dum dum dum he he he ho ho ho fa lah lah lah lah lah lah fa lah full hoo hoo hoo\" using \"Cellos\"'"
alias localip="ipconfig getifaddr en0"
alias httpdump="sudo tcpdump -i en0 -n -s 0 -w - | grep -a -o -E \"Host\: .*|GET \/.*\""
alias sniff="sudo ngrep -d 'en0' -t '^(GET|POST) ' 'tcp and port 80'"
fi
# Quick scratch pad
alias vpad="vim +set\ buftype=nofile +startinsert"
alias vundle="vim +PluginInstall +qall"
alias vundleup="vim +PluginUpdate +qall"
# In honor of John
alias govag="cd ~/Development/upsync4/"
if command -v dnsyo > /dev/null 2>&1; then
alias checkdns=dnsyo
fi
if command -v hiptext > /dev/null 2>&1; then
alias hiptext="LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib hiptext"
fi
alias ny='telnet miku.acm.uiuc.edu'
alias rr='curl -L http://bit.ly/10hA8iC | bash'
alias sw='telnet towel.blinkenlights.nl'
alias whatisit='curl "http://itsthisforthat.com/api.php?text"'
alias cats="echo && curl -s -k -X GET http://placekitten.com/ | head -n 25 | tail -n 15 && echo"
alias vintage='[ -r "/usr/lib/xscreensaver/apple2" ] && /usr/lib/xscreensaver/apple2 -text -fast -program bash'
if command -v sshecret > /dev/null 2>&1; then
alias sssh='sshecret'
alias ssh='sshecret'
alias scp='scp -S sshecret'
fi