-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.bash_aliases
89 lines (77 loc) · 2.41 KB
/
.bash_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
# standard
alias s="sudo"
alias ls="ls --color=auto"
alias lg="ls | grep"
alias llg="ls -lh | grep"
alias psgrep="ps -aux | grep"
alias clr="clear"
alias ll="ls -lh"
alias la="ls -alh"
alias gr="grep"
initd() { sudo /etc/init.d/$1 $2;};
alias untar="tar -zxvf"
# special
alias cinnamon_fix="export DISPLAY=:0; cinnamon &"
alias fn_fix="echo 2 > /sys/module/hid_apple/parameters/fnmode"
javar() { java -Xmx$1M -Xms$1M -jar $2; };
top-ten() { print -l -- ${(o)history%% *} | uniq -c | sort -nr | head -n 10; };
alias pg="ping google.com"
alias xrandr-laptop="xrandr --output LVDS1 --auto --output HDMI2 --off"
alias xrandr-hdmi2="xrandr --output LVDS1 --off --output HDMI2 --auto"
# apps
alias xflux-on="xflux -l 52 -g 21"
alias xflux-off="killall xflux"
alias d="sudo docker"
alias scratch=scratch-text-editor
alias http="http -s solarized"
# config
alias alias_edit="vim ~/.bash_aliases"
alias gitconf="vim ~/.gitconfig"
# usage: command; 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$//'\'')"'
# git
# `g` with no arguments is `git status` and with arguments acts like `hub`
function g() {
if [ $# -eq 0 ]; then
git status
else
git "$@"
fi
}
# cd
alias ..="cd ../"
alias ...="cd ../../"
alias ....="cd ../../../"
alias .....="cd ../../../../"
# install
alias install="sudo apt-get install"
alias pinstall="pip install"
alias pipreq="pip install -r requirements.txt"
# python
alias py="python"
bpython() {
if test -n "$VIRTUAL_ENV"; then
PYTHONPATH="$(python -c 'import sys; print ":".join(sys.path)')" \
command bpython "$@"
else
command bpython "$@"
fi
}
alias bpy="bpython"
alias ipy="ipython"
alias ptp="ptpython"
alias nt="nosetests"
alias pyc="find . -name \"*.pyc\" -delete"
# django
alias mpy="python manage.py"
alias dadmin="django-admin.py"
alias dadmincreate="python manage.py createsuperuser --username admin --email [email protected]"
superuser() { python manage.py createsuperuser --username $1 --email [email protected]; };
# coffeescript
alias cfc="coffee -c"
# virtualenvs
alias mkvirtualenv3="mkvirtualenv --python=/usr/bin/python3"
cddev-here() { DIR=`pwd`; cdvirtualenv && cd bin && echo "alias cddev='cd $DIR'" >> postactivate && cat postactivate; };
# vagrant
alias v="vagrant"
alias vfix="sudo apt-get install linux-headers-`uname -r`; sudo /etc/init.d/vboxdrv setup; vagrant up"