-
Notifications
You must be signed in to change notification settings - Fork 1
/
.bash_aliases
176 lines (142 loc) · 5.97 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# Terminal Commands
alias .1='cd ..'
alias ..='cd ..'
alias .2='cd ../..'
alias ...='cd ../..'
alias ....='cd ../..'
alias .....='cd ../../..'
alias ......='cd ../../..'
alias .3='cd ../../..'
alias staging='cd ~/GIT/decal/werdlists/staging'
# X11 commands
#alias winsize=xwininfo
# Safety Commands
[ `uname -s` == 'Darwin' ] && alias rm='rm -P' || alias rm='rm -I --preserve-root --one-file-system'
#alias rm='rm -i'
#alias mv='mv -i'
#alias cp='cp -i'
# ASCII-enable all grep variants
alias grep='grep -a' egrep='egrep -a' fgrep='fgrep -a'
alias zgrep='zgrep -a' zegrep='zegrep -a' zfgrep='zfgrep -a'
# Directory Creation Commands
alias mkdir='mkdir -pv' mkd='mkdir -pv'
alias mkdp='mkdir -p' mkdirp='mkdir -p'
# Process table commands
alias psx='COLUMNS=10240 ps axel'
alias psg='ps aux | grep'
# Lock Commands
alias reboot='sudo reboot 00' shutdown='sudo shutdown 00'
# Install commands
alias install='sudo apt install' fixdpkg='sudo dpkg --configure -a'
# Git Commands
alias add="git add $*" status='git status'
alias commit='git commit -a' push='git push'
# Ping Commands
alias ping='ping -c 5' fping='ping -c 100 -s.2'
# Vim commands
alias sv='sudo vi'
alias edit='vim'
# Bash commands
alias bp='bash --posix'
alias sb='sudo bash'
# Wget commands
alias wget='wget --continue --show-progress -U "MSIE" --no-check-certificate'
alias mirror='wget -m -np --no-check-certificate'
# Python commands
alias python2='python2 -OO' python3='python3.5 -OO'
alias py=python py2=python2 py3=python3
# Crystal
alias cr=crystal crb='crystal build' cre='crystal eval' crr='crystal run'
alias crde='crystal deps' crdo='crystal docs' crd='crystal deps'
##TODO: write gith function so 'gith clone' works..
alias gith-clone="git clone --verbose --recurse-submodules --no-single-branch --progress -- \"https://github.com/${BASH_ARGV[1]}/${BASH_ARGV[2]}\""
alias start="/mnt/c/Windows/System32/cmd.exe /c START /MAX /NODE 0 /D 'C:\Users\decal\AppData\Local\lxss\home\decal' /I /ABOVENORMAL"
## Typos
# PAGER commands
alias More=more omre=more mor=more
alias Less=less elss=less les=less less=more
alias Most=most omst=most mos=most
## TODO: write program that genenerates aliases bashed on char swaps that can be: eval $(genswaps zipinfo)
# host
alias Host=host ohst=host hos=host
# list commands
alias ls='ls -C'
alias l1='ls -1' ls1='ls -1'
alias lsl='ls -l' lsa='ls -A'
alias lsd='ls -d'
alias lsa1='ls -A1' ls1a='ls -1A'
alias lsld='ls -ld' lsdl='ls -dl'
alias slld='ls -ld' sldl='ls -dl'
alias lsal='ls -Al' lsla='ls -lA'
alias slal='ls -Al' slla='ls -lA'
# -@ Display extended attribute keys and sizes in long (-l) output.
alias lsl@='ls -l@' ls@l='ls -@l'
alias lsla@='ls -lA@' lsal@='ls -Al@' ls@al='ls -@al' lsa@l='ls -A@l' lsl@a='ls -l@A'
alias ks=ls
alias lsalt='ls -Alt'
alias lsald='ls -Ald' lsdal='ls -dAl' lslda='ls -ldA'
alias lsadl='ls -Adl' lsdla='ls -dlA' lslad='ls -lAd'
alias lsalr='ls -AlR' lslar='ls -lAR' lsrla='ls -RlA'
alias lsral='ls -RAl' lslra='ls -lRA' lsarl='ls -ARl'
alias lshalt='ls -hAlt' lsdalt='ls -dAlt'
alias lsdhalt='ls -lsdhAlt'
alias ll='ls -AlF'
alias la='ls -A'
alias lc='ls -C'
alias l='ls -CF'
alias lh='ls -hAlt'
alias lh1='ls -hAlt | head -10' lh2='ls -hAlt | head -20'
alias lh3='ls -hAlt | head -30' lh4='ls -hAlt | head -40'
alias lh5='ls -hAlt | head -50' lh6='ls -hAlt | head -60'
alias lh7='ls -hAlt | head -70' lh8='ls -hAlt | head -80'
alias lh9='ls -hAlt | head -90' lh10='ls -hAlt | head -100'
# Aliases related to the usage and/or free'ing of disk space
alias dusk='du -sk . | sort -n'
alias duhd1='du -hd1 .' duhd2='du -hd2 .'
alias duhd3='du -hd3 .' duhd4='du -hd4 .'
alias duhd5='du -hd5 .' duhd6='du -hd6 .'
alias duhd7='du -hd7 .' duhd8='du -hd8 .'
alias duhd9='du -hd9 .' duhd10='du -hd10 .'
alias duhd1g='du -hd1 . | egrep "(G|M)"' duhd2g='du -hd2 . | egrep "(G|M)"'
alias duhd3g='du -hd3 . | egrep "(G|M)"' duhd4g='du -hd4 . | egrep "(G|M)"'
alias duhd5g='du -hd5 . | egrep "(G|M)"' duhd6g='du -hd6 . | egrep "(G|M)"'
alias duhd7g='du -hd7 . | egrep "(G|M)"' duhd8g='du -hd8 . | egrep "(G|M)"'
alias duhd9g='du -hd9 . | egrep "(G|M)"' duhd10g='du -hd10 . | egrep "(G|M)"'
# Add an "alert" alias for long running commands. Use like so:
# sleep 10; 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$//'\'')"'
alias configure-help="./configure --help > configure-help.out 2>&1 && $PAGER configure-help.out"
alias ren='renice'
#alias ssl2='openssl s_client -ssl2 -connect'
#alias ssl3='openssl s_client -ssl3 -connect'
#alias ssl='openssl s_client -quiet -connect'
#alias tls='openssl s_client -connect'
#alias tls1='openssl s_client -tls1 -connect'
#alias tls11='openssl s_client -tls1_1 -connect'
#alias tls1_1='openssl s_client -tls1_1 -connect'
#alias tls12='openssl s_client -tls1_2 -connect'
#alias tls1_2='openssl s_client -tls1_2 -connect'
#alias tls13='openssl s_client -tls13 -connect'
#alias tls1_3='openssl s_client -tls1_3 -connect'
alias s_client='openssl s_client -connect'
alias sclient='openssl s_client -connect'
alias GIT="cd /home/decal/GIT/decal;cd -- '$1'"
alias github="cd /home/decal/github;cd -- '*/$1'"
# Security Tools
alias xnmap="nmap -T5 -Pn -n -A -p0-65535 -sS '$1' -oG '$1.nmap'"
# Package Management
alias update='sudo apt-get -y update'
alias upgrade='sudo apt-get -y upgrade'
alias dist-upgrade='sudo apt-get -y dist-upgrade'
alias autoremove='sudo apt-get -y autoremove'
alias auto-update='update; upgrade; dist-upgrade; autoremove'
alias recent-installs='awk "$3~/^install$/ {print$4}" /var/log/dpkg.log | tail -n 22 | cut -d ":" -f1'
# Shell names
###TODO: alias generator as zsh/bash/ksh and all shells possible polyglot for strings: Bash, BASH, bsah & basH
alias Bash=bash BASH=bash bsah=bash
alias Zsh=zsh ZSH=zsh szh=zsh
alias Sh=sh SH=zsh hs=sh
# Utility Aliases
alias grepenv="strings -- '$1' | egrep '^[A-Z0-9_]{3,12}$' | grep -v '^[a-z]{2,}$' | egrep -v '^[0-9]'"
# Security-related or reverse engineering commands
alias yesbof='yes `perl -wle "print(qq{A}x4096)"`'