Django alias for shell, another one for shell_plus.
[dotfiles] / .bash_aliases
1 #!/bin/sh
2
3 # the grep I use the most
4 alias my_grep="grep -Hrnisl"
5
6 # my weird aliases
7 alias djo_runserver="python manage.py runserver"
8 alias djo_shell="python manage.py shell"
9 alias djo_shellp="python manage.py shell_plus"
10 alias djo_make="python manage.py makemigrations"
11 alias djo_mig="python manage.py migrate"
12 alias djo_csu="python manage.py createsuperuser"
13
14 alias nimcr="nim c -r"
15
16 alias my_current_shell="echo $0"
17 alias my_shells="cat /etc/shells"
18
19 alias mount="sudo mount"
20 alias umount="sudo umount"
21
22 alias my_public_ip="curl ifconfig.me"
23 alias my_dl_website="wget --random-wait -r -p -e robots=off -U mozilla "
24 alias my_poor_man_bandwith_monitor="watch -n1 'ifconfig eth0 | grep RX' "
25
26 # curl retrieve header only when doing a post
27 # -D- dump header to stdout
28 # -s no progress bar
29 # -o/dev/null output body to /dev/null
30 alias curlh="curl -s -D- -o/dev/null "
31
32 # test disk read/write speed
33 alias my_disk_write_speed="dd if=/dev/zero of=/tmp/output.img bs=8k count=256k conv=fdatasync; rm -rf /tmp/output.img"
34 alias my_disk_read_speed="hdparm -Tt /dev/sda"
35
36 # generate random password, 16 char long
37 alias my_gen_pwd="LANG=c < /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-16};echo;"
38 alias my_gen_pwd2="openssl rand -base64 16"
39
40 # go to root dir
41 alias git-root='cd $(git rev-parse --show-cdup)'
42
43 alias my_installed_packages="dpkg --get-selections"
44 alias my_manually_installed_packages="aptitude search '~i !~M'"
45
46 alias my_tcp_sockets='ss -s'
47 alias my_tcp_sockets2='netstat -s'
48 alias my_open_ports2='ss -l'
49 alias my_open_ports='netstat -tupln'
50 alias my_open_tcp_port='netstat -plnt'
51
52
53 # emacsclient is too long to write
54 alias emax="emacsclient -c"
55
56 alias my_laptop_serial_number='sudo dmidecode -t 1 | grep -i serial'
57
58 alias my_show_user_process='ps wu -U'
59
60 alias fuck="sudo !!"
61
62
63 alias my_send_email="emacsclient -c --eval '(mail)'"
64 alias my_emails="emacsclient -c --eval '(gnus)'"
65
66 alias my_architecture='dpkg --print-architecture'
67 alias my_number_of_cores='cat /proc/cpuinfo |grep processor'
68
69 alias ip='sudo ip'
70 alias dhclient='sudo dhclient'
71
72 alias my_debian_version='sudo cat /etc/debian_version'
73 alias my_ubuntu_version='sudo cat /etc/issue'
74 alias my_kernel_info='uname -a'
75 alias my_kernel_release='uname -r'
76
77 alias emacs="emacs -nw"
78 alias grep="grep --color=auto"
79 alias fgrep="fgrep --color=auto"
80 alias egrep="egrep --color=auto"
81
82 alias mkdir='mkdir -p'
83
84 alias my_processes='ps aux | grep'
85
86 # some more ls aliases
87 alias ls='ls --hide="*~" --color'
88 alias dir='dir --color=auto'
89 alias vdir='vdir --color=auto'
90 alias ll='ls -lh'
91 alias la='ls -lah'
92
93 # some more mor aliases
94 alias aptitude="sudo aptitude"
95 alias service="sudo service"
96 alias halt='sudo halt'
97 alias wvdial='sudo wvdial'
98 alias apt-get='sudo apt-get'
99 alias dpkg='sudo dpkg'
100
101 alias h="history"
102 alias j="jobs -l"
103
104 alias ..="cd .."
105 alias ....="cd ../.."
106 alias ......="cd ../../.."
107
108 #git
109 alias gstatus='git status'
110 alias gcheckout='git checkout'
111 alias gcommit='git commit'
112 alias grebase='git rebase'
113 alias gbranch='git branch'
114 alias gpull='git pull'
115 alias gpush='git push'
116 alias gadd='git add'
117 alias gmergetool='git mergetool'
118 alias gdiff='git diff --color'
119 alias glog='git log --date-order --all --graph --format="%C(green)%h%Creset %C(yellow)%an%Creset %C(blue bold)%ar%Creset %C(red bold)%d%Creset%s"'
120 alias glog2='git log --date-order --all --graph --name-status --format="%C(green)%h%Creset %C(yellow)%an%Creset %C(blue bold)%ar%Creset %C(red bold)%d%Creset%s"'
121
122 alias du="du -kh" # Makes a more readable output.
123 alias df="df -kTh"
124
125 alias ifconfig='/sbin/ifconfig'
126 alias sshx='ssh dev_server'
127 alias my_gatewayaddress="netstat -nr"
128
129 alias reload_tmuxconf="tmux source-file ~/.tmux.conf"
130 alias reload_bash="source ~/.bashrc"
131 alias reload_alsa="service alsa-utils restart"
132 alias reload_bluetooth='service bluetooth restart'
133
134 # virtualenv
135 alias my_wifi_list="sudo iw wlan0 scan | less"
136
137 alias my_top10_running_proc="ps aux | sort -nk +4 | tail"