interesting shell aliases added
[dotfiles] / .bash_aliases
1 #!/bin/sh
2 # my weird aliases
3
4 # test disk read/write speed
5 my_disk_write_speed="dd if=/dev/zero of=/tmp/output.img bs=8k count=256k conv=fdatasync; rm -rf /tmp/output.img"
6 my_disk_read_speed="hdparm -Tt /dev/sda"
7
8 # generate random password, 16 char long
9 my_gen_pwd="LANG=c < /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-16};echo;"
10 my_gen_pwd2="openssl rand -base64 16"
11
12 # go to root dir
13 alias git-root='cd $(git rev-parse --show-cdup)'
14
15 alias my_installed_packages="dpkg --get-selections"
16 alias my_manually_installed_packages="aptitude search '~i !~M'"
17
18 alias my_tcp_sockets='ss -s'
19 alias my_tcp_sockets2='netstat -s'
20 alias my_open_ports2='ss -l'
21 alias my_open_ports='netstat -tupln'
22 alias my_open_tcp_port='netstat -plnt'
23
24
25 # emacsclient is too long to write
26 alias emax="emacsclient -c"
27
28 alias my_laptop_serial_number='sudo dmidecode -t 1 | grep -i serial'
29
30 alias my_show_user_process='ps wu -U'
31
32
33 alias my_send_email="emacsclient -c --eval '(mail)'"
34 alias my_emails="emacsclient -c --eval '(gnus)'"
35
36 alias my_architecture='dpkg --print-architecture'
37 alias my_number_of_cores='cat /proc/cpuinfo |grep processor'
38
39 alias ip='sudo ip'
40 alias dhclient='sudo dhclient'
41
42 alias my_debian_version='sudo cat /etc/debian_version'
43 alias my_ubuntu_version='sudo cat /etc/issue'
44 alias my_kernel_info='uname -a'
45 alias my_kernel_release='uname -r'
46
47 alias emacs="emacs -nw"
48 alias grep="grep --color=auto"
49 alias fgrep="fgrep --color=auto"
50 alias egrep="egrep --color=auto"
51
52 alias mkdir='mkdir -p'
53
54 alias my_processes='ps aux | grep'
55
56 # some more ls aliases
57 alias ls='ls --hide="*~" --color'
58 alias dir='dir --color=auto'
59 alias vdir='vdir --color=auto'
60 alias ll='ls -lh'
61 alias la='ls -lah'
62
63 # some more mor aliases
64 alias aptitude="sudo aptitude"
65 alias service="sudo service"
66 alias halt='sudo halt'
67 alias wvdial='sudo wvdial'
68 alias apt-get='sudo apt-get'
69 alias dpkg='sudo dpkg'
70
71 alias h="history"
72 alias j="jobs -l"
73
74 alias ..="cd .."
75 alias ....="cd ../.."
76 alias ......="cd ../../.."
77
78 #git
79 alias gstatus='git status'
80 alias gcheckout='git checkout'
81 alias gcommit='git commit'
82 alias grebase='git rebase'
83 alias gbranch='git branch'
84 alias gpull='git pull'
85 alias gpush='git push'
86 alias gadd='git add'
87 alias gmergetool='git mergetool'
88 alias gdiff='git diff --color'
89 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"'
90 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"'
91
92 alias du="du -kh" # Makes a more readable output.
93 alias df="df -kTh"
94
95 alias ifconfig='/sbin/ifconfig'
96 alias sshx='ssh dev_server'
97 alias my_gatewayaddress="netstat -nr"
98
99 alias reload_tmuxconf="tmux source-file ~/.tmux.conf"
100 alias reload_bash="source ~/.bashrc"
101 alias reload_alsa="service alsa-utils restart"
102 alias reload_bluetooth='service bluetooth restart'
103
104 # virtualenv
105 alias my_wifi_list="sudo iw wlan0 scan | less"