/
aliases.bash
61 lines (53 loc) · 2 KB
/
aliases.bash
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
alias ls='ls -lhF'
alias tf='tail -f'
alias tn='tail -n'
alias grepr='grep --color -d recurse -n' # recursive grep with line numbers
alias grepo='grep -R -h -o -E' # recursive grep with only matching text printed
alias lsenv='printenv | ack -i' # search for strings in environment variables
alias password='head /dev/random | md5' # generate a random password
alias readme='test -x `which redcarpet` && test -f ./README.md && redcarpet --render-fenced_code_blocks --render-no_intra_emphasis --render-autolink README.md > ~/.Trash/readme.html && open ~/.Trash/readme.html'
alias pjson='python -mjson.tool'
alias vb='VBoxManage'
alias cpkey='cat ~/.ssh/id_rsa.pub | pbcopy'
alias til='grep -d recurse -h `date "+%m/%d"` /usr/share/calendar/'
alias jbgo='cd ~/projects/opensource/jbgo'
# git
alias g='git'
alias sg='sudo git'
alias gs='g s' # I typically don't want to run ghostscript, I want to run git status
alias cleanwd='rm $(g ls-files -o)' # remove untracked files from working dir
alias grmd='g rm $(g ls-files -d)' # stage all deleted files
# ssh
alias ssh-hosts='grep -E "^Host [a-zA-Z]" ~/.ssh/config'
alias nginx_start='sudo launchctl load -F ~/Library/LaunchAgents/nginx.plist'
alias nginx_stop='sudo launchctl unload -F ~/Library/LaunchAgents/nginx.plist'
# mac os x
alias vf='open -a Finder .' # view current directory in Finder
# ruby
alias bx='bundle exec'
alias guard='bx guard -c'
alias sp='bx rspec --color'
alias cuke='bx cucumber'
# heroku
alias h=heroku
alias hr='heroku run'
# ansible
alias an=ansible
alias anp=ansible-playbook
alias ang=ansible-galaxy
function markdown() {
if [ `which redcarpet` ];
then
redcarpet --render-fenced_code_blocks --render-no_intra_emphasis --render-autolink $1 > ~/.Trash/markdown.html && \
open ~/.Trash/markdown.html
else
echo "Please install redcarpet: gem install redcarpet"
return 1
fi
}
function git_branch_wipeout() {
remote=$2
if [[ ! $remote ]]; then remote=origin; fi
git branch -d $1 && git push $remote :refs/heads/$1
}
alias gbw=git_branch_wipeout