List files installed by package XXX.
[dotfiles] / .bash_aliases
1 #!/bin/sh
2
3 alias my_list_files_installed_by="dpkg -L "
4
5 alias beroot="sudo -i"
6 alias my_init_system="ps -p 1 -o command"
7 alias my_share_tty='gotty tmux new -A -s go_tty bash'
8 alias my_fqdn='hostname --fqdn'
9 alias rustc='rustc --color auto '
10 alias E='SUDO_EDITOR="emacsclient" sudo -e'
11 alias my_lngst_line_in_file="wc -L"
12
13 alias rmf="rm -rf"
14 alias vnv="pyvenv"
15 alias venv="pyvenv"
16
17 # manually installed packages
18 alias my_installed_packages="apt search -F %p '~i!~M'"
19
20 # apt search ~i lists the installed packages
21 # grep -v "^i A" removes the lines starting with "i A" (automatically pulled in dependencies)
22 # cut -d " " -f 4 > clean.txt filters out the package names
23 alias my_installed_packages2="apt search ~i | grep -v '^i A' | cut -d ' ' -f 4"
24
25 # only to be done by root
26 # alias my_installed_pkg="zgrep -hE '^(Start-Date:|Commandline:)' $(ls -tr /var/log/apt/history.log*.gz ) | egrep -v 'aptdaemon|upgrade' | egrep -B1 '^Commandline: apt-get install'"
27
28 # alias my_installed_pkg2="( zcat $( ls -tr /var/log/apt/history.log*.gz ) ; cat /var/log/apt/history.log ) | egrep '^(Start-Date:|Commandline:)' | grep -v aptdaemon | egrep '^Commandline: apt-get install'"
29
30 # the grep I use the most
31 alias my_grep="grep -Hrnisl"
32
33 # my weird aliases
34 alias djo_runserver="python manage.py runserver"
35 alias djo_shell="python manage.py shell"
36 alias djo_shellp="python manage.py shell_plus"
37 alias djo_make="python manage.py makemigrations"
38 alias djo_mig="python manage.py migrate"
39 alias djo_csu="python manage.py createsuperuser"
40 alias djo_smtpd="python -m smtpd -n -c DebuggingServer localhost:1025"
41
42 alias nimcr="nim c -r"
43
44 alias my_current_shell="echo $0"
45 alias my_shells="cat /etc/shells"
46
47 alias mount="sudo mount"
48 alias umount="sudo umount"
49
50 alias my_public_ip="curl ifconfig.me"
51 alias my_dl_website="wget --random-wait -r -p -e robots=off -U mozilla "
52 alias my_dl_website2="wget robots=off -U mozilla \
53 --recursive \
54 --no-clobber \
55 --page-requisites \
56 --html-extension \
57 --convert-links \
58 --restrict-file-names=windows \
59 --domains website.org \
60 --no-parent "
61 alias my_poor_man_bandwith_monitor="watch -n1 'sudo ifconfig eth0 | grep RX' "
62
63 # curl retrieve header only when doing a post
64 # -D- dump header to stdout
65 # -s no progress bar
66 # -o/dev/null output body to /dev/null
67 alias curlh="curl -s -D- -o/dev/null "
68
69 # test disk read/write speed
70 alias my_disk_write_speed="dd if=/dev/zero of=/tmp/output.img bs=8k count=256k conv=fdatasync; rm -rf /tmp/output.img"
71 alias my_disk_read_speed="hdparm -Tt /dev/sda"
72
73 # generate random password, 16 char long
74 alias my_gen_pwd="LANG=c < /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-16};echo;"
75 alias my_gen_pwd2="openssl rand -base64 16"
76
77 # go to root dir
78 alias git-root='cd $(git rev-parse --show-cdup)'
79
80 alias my_installed_packages="dpkg --get-selections"
81 alias my_manually_installed_packages="apt search '~i !~M'"
82
83 alias my_tcp_sockets='ss -s'
84 alias my_tcp_sockets2='netstat -s'
85 alias my_open_ports2='ss -l'
86 alias my_open_ports='netstat -tupln'
87 alias my_open_tcp_port='netstat -plnt'
88
89
90 # emacsclient is too long to write
91 alias emax="emacsclient -cnw"
92
93 alias my_laptop_serial_number='sudo dmidecode -t 1 | grep -i serial'
94
95 alias my_show_user_process='ps wu -U'
96
97 alias fuck="sudo !!"
98
99
100 alias my_send_email="emacsclient -cnw --eval '(mail)'"
101 alias my_emails="emacsclient -cnw --eval '(gnus)'"
102
103 alias my_architecture='dpkg --print-architecture'
104 alias my_number_of_cores='cat /proc/cpuinfo |grep processor'
105
106 alias ip='sudo ip'
107 alias dhclient='sudo dhclient'
108
109 alias my_debian_version='sudo cat /etc/debian_version'
110 alias my_ubuntu_version='sudo cat /etc/issue'
111 alias my_kernel_info='uname -a'
112 alias my_kernel_release='uname -r'
113
114 alias emacs="emacs -nw"
115 alias grep="grep --color=auto"
116 alias fgrep="fgrep --color=auto"
117 alias egrep="egrep --color=auto"
118
119 alias mkdir='mkdir -p'
120
121 alias my_processes='ps aux | grep'
122
123 # some more ls aliases
124 alias ls='ls --hide="*~" --color'
125 alias dir='dir --color=auto'
126 alias vdir='vdir --color=auto'
127 alias ll='ls -lh'
128 alias la='ls -lah'
129 alias lt='ls -t'
130
131 # some more mor aliases
132 alias apt="sudo apt"
133 alias aptitude="sudo aptitude"
134 alias service="sudo service"
135 alias halt='sudo halt'
136 alias wvdial='sudo wvdial'
137 alias apt-get='sudo apt-get'
138 alias dpkg='sudo dpkg'
139
140 alias h="history"
141 alias j="jobs -l"
142
143 alias ..="cd .."
144 alias ....="cd ../.."
145 alias ......="cd ../../.."
146
147 #git
148 alias gstatus='git status'
149 alias gcheckout='git checkout'
150 alias gcommit='git commit'
151 alias grebase='git rebase'
152 alias gbranch='git branch'
153 alias gpull='git pull'
154 alias gpush='git push'
155 alias gadd='git add'
156 alias gmergetool='git mergetool'
157 alias gdiff='git diff --color'
158 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"'
159 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"'
160
161 alias du="du -kh" # Makes a more readable output.
162 alias df="df -kTh"
163
164 alias ifconfig='/sbin/ifconfig'
165 alias sshx='ssh dev_server'
166 alias my_gatewayaddress="netstat -nr"
167
168 alias reload_tmuxconf="tmux source-file ~/.tmux.conf"
169 alias reload_bash="source ~/.bashrc"
170 alias reload_alsa="service alsa-utils restart"
171 alias reload_bluetooth='service bluetooth restart'
172
173 # virtualenv
174 alias my_wifi_list="sudo iw wlan0 scan | less"
175
176 alias my_top10_running_proc="ps aux | sort -nk +4 | tail"
177
178 # gpg
179 alias gpg_gen="gpg --gen-key "
180 alias gpg_ls="gpg --list-keys "
181 alias gpg_bckp_pubk="gpg -ao mypub.key --export "
182 alias gpg_bckp_privk="gpg -ao mypriv.key --export-secret-keys "
183 alias gpg_share_pubk="gpg --send-keys --keyserver "
184 alias gpg_search="gpg --search-keys --keyserver "
185 alias gpg_enc="gpg --encrypt --recipient "
186 alias gpg_dec="gpg --decrypt "
187
188 alias my_bios='sudo dmidecode -t 1 | grep "Manufacturer\|Product Name\|Serial Number" | tr -d "\t" | sed "s/Manufacturer//" && echo -ne "\nBIOS" && sudo dmidecode -t 0 | grep "Vendor\|Version\|Release" | tr -d "\t" | sed "s/Vendor//"'
189
190 alias ll5='ll -tl | head -4'