-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.aliases
executable file
·237 lines (195 loc) · 7.51 KB
/
.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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
## sudo alias for sudo
alias sudo='sudo '
## Generic
alias clock='xclock -chime &'
alias ll='ls -l --color=auto'
alias ls='ls --color=auto'
alias dirs="ls -al | grep '^d'"
alias grep='grep --color=auto'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
alias ssh="TERM=linux ssh"
alias qp="ps auxwww|more"
alias doMagic="pithos"
#alias df="df -H"
# must install pydf for below
alias df='pydf -h'
alias today='cal | grep -C7 --color=auto "\<$(date +%Oe)\>"'
alias calloop='while true;do clear; today; sleep 30m; done'
alias rand="/bin/bash $HOME/scripts/randomwordgen"
alias chbg="/bin/bash $HOME/scripts/backgroundchanger.sh"
alias changebg="chbg"
alias vpnstart="sudo iked;qikea"
alias reloadxdefaults="xrdb -merge $HOME/.Xresources"
alias update="sudo dnf update"
alias updatey="sudo dnf -y update"
alias hist="history"
alias p="ping -c 5"
alias ping="ping -c 5"
alias tping="time ping -c 5"
alias trace="traceroute"
alias tracert="traceroute"
alias pping="/usr/bin/prettyping -c 5"
alias bashreload="source ~/.bashrc"
alias reloadbash="bashreload"
alias freem="free -hm"
alias du1="du -h --max-depth=1"
alias duTotal="du -csh * | grep total"
alias tailf="tail -f"
alias mkdir='mkdir -pv'
alias mkcd='foo(){ mkdir -p "$1"; cd "$1" }; foo '
alias mnt="mount | awk -F' ' '{ printf \"%s\t%s\n\",\$1,\$3; }' | column -t | egrep ^/dev/ | sort"
alias count='find . -type f | wc -l'
alias blip="echo -ne '\007'"
alias cht.sh="cheatsheet"
## Quick Movements
alias 'cd..'='cd ..'
alias '..'='cd ..'
alias '...'='cd ../..'
## Quick Directories
alias 'linuxstuff'='cd $HOME/git/Linux_Stuff'
alias 'html'='cd $HOME/web'
## Show files with no comment
alias nocomment="grep -Ev '''^(#|$)'''"
## finding files
alias ff='find . -type f -iname'
alias fhere="find . -name "
# GIT
## Simple git help because I can never Remember the order
alias githelp="echo -e 'git add . (add new files) alias=gad\ngit commit (commit the changes made)\ngit push (push to the branch) alias=gpom\ngit status (shows changes that have been made) alias=gs\n-sparky loves alice'"
alias gpom="git push origin master"
alias gs="git status"
alias gb="git branch"
alias gco="git checkout"
alias gad="git add ."
## if ifup and down aren't working use ifconfig
## ifconfig interface down && ifconfig interface up
alias ifconfig='/sbin/ifconfig'
#install colordiff package
alias diff="colordiff"
alias ports="sudo netstat -tuplan"
# do not delete / or prompt if deleting more than 3 files at a time #
alias rm='rm -I --preserve-root'
# confirmation #
alias mv='mv -i'
alias cp='cp -ai'
alias ln='ln -i'
# Parenting changing perms on / #
alias chown='chown --preserve-root'
alias chmod='chmod --preserve-root'
alias chgrp='chgrp --preserve-root'
## Change according to system
#alias checking for OS and applying correct update command based on it
_myos="$(uname -a)"
case $_myos in
*Ubuntu*|*Debian*) alias which_update="/bin/echo 'sudo apt-get update && sudo apt upgrade'";;
*CentOS*) alias which_update="/bin/echo 'yum update'";;
*Fedora*) alias which_update="/bin/echo 'dnf update'" ;;
*) alias which_update="/bin/echo 'Update the alias for New OS'";;
esac
#alias update='sudo dnf update'
#alias update='yum update'
#alias updatey='yum -y update'
#alias update='sudo apt update'
#alias upgrade='sudo apt upgrade'
case $_myos in
*Ubuntu*|*Debian*) alias update="sudo apt-get update && sudo apt upgrade";;
*CentOS*) alias update="sudo yum -y update";;
*Fedora*) alias update="sudo dnf update" ;;
*) alias update="Update the alias for New OS";;
esac
## All of our servers enp0s25 is connected to the Internets via vlan / router etc ##
## Download packages for vnstat,iftop,tcpdump,ethtool
alias dnstop='dnstop -l 5 enp0s25'
alias vnstat='vnstat -i enp0s25'
## Wifi
alias wifiap="nmcli device wifi list"
## Interface traffic
alias iftop='iftop -i enp0s25'
alias tcpdump='tcpdump -i enp0s24'
alias ethtool='/sbin/ethtool'
alias ethtool1='ethtool enp0s25'
## External IP
alias myip="curl icanhazip.com"
## shortcut for iptables and pass it via sudo#
alias ipt='sudo /sbin/iptables'
# display all rules #
alias iptlist='sudo /sbin/iptables -L -n -v --line-numbers'
alias iptlistin='sudo /sbin/iptables -L INPUT -n -v --line-numbers'
alias iptlistout='sudo /sbin/iptables -L OUTPUT -n -v --line-numbers'
alias iptlistfw='sudo /sbin/iptables -L FORWARD -n -v --line-numbers'
alias firewall=iptlist
alias iptpreroute='sudo /sbin/iptables -t nat -L --line-numbers'
alias prerouteDel='sudo /sbin/iptables -t nat -D PREROUTING $1'
## remoting into windows machines
alias remote='rdesktop -g 1820x980'
## xfreerdp as rdesktop get cert errors
##moved to .aliases_hostSpecific to include domain and user info
#alias rdp='xfreerdp'
## Something for python
alias py='python'
alias webserver="python $HOME/scripts/pyhtml.py"
alias web8080="python -m SimpleHTTPServer 8080"
alias pyweb="python -m SimpleHTTPServer $1"
## Shrewsoft VPN Help
alias VPN="/bin/bash $HOME/scripts/shrewVPNconnect.sh"
alias vpnhelp="echo -e 'shrewVPNconnect.sh can be used to connect to the Cisco VPNs via CLI\nThe VPN command will run shrewVPNconnect.sh\nikec -r ConnName -u USER -p PASSWORD -a \nArk-LasVegas\nArk-Lindon\nArk-Lindonfailover\nBay-Health\nBay-Health-Vegas\nBronx\nDHIN\nHASA\nJHIE\nPOC\nor use vpnstart to launch the ShrewSoft GUI'"
# work on wlan0 by default #
# Only useful for laptop as all servers are without wireless interface
alias iwconfig='iwconfig wlan0'
# some memory info
alias vmstat='vmstat -w 5'
alias meminfo='free -m -h -l -t'
## get top process eating memory
alias psmem='ps auxf | sort -nr -k 4'
alias psmem10='ps auxf | sort -nr -k 4 | head -10'
## get top process eating cpu ##
alias pscpu='ps auxf | sort -nr -k 3'
alias pscpu10='ps auxf | sort -nr -k 3 | head -10'
## Get server cpu info ##
alias cpuinfo='lscpu'
## Linux Containers (lxc)
alias lxcDebian="/bin/bash $HOME/scripts/createLxcDebian.sh"
## Start Virtual Windows Machine
alias startvm='VBoxManage startvm Kumonga --type headless'
## Weather
alias W='curl -s -N wttr.in | head -7'
## Emulator
alias psx='pcsxr &'
alias ps2='pcsx2 &'
alias snes='zsnes &'
alias play='sudo rmmod xpad ; sudo xboxdrv --silent &'
alias controller='play &'
alias games='jobs'
## Color tests
alias colortest1='(x=`tput op` y=`printf %76s`;for i in {0..256};do o=00$i;echo -e ${o:${#o}-3:3} `tput setaf $i;tput setab $i`${y// /=}$x;done)'
alias colortest2='/bin/bash $HOME/scripts/colortest'
alias colortest3='for x in {0..8}; do for i in {30..37}; do for a in {40..47}; do echo -ne "\e[$x;$i;$a""m\\\e[$x;$i;$a""m\e[0;37;40m "; done; echo; done; done; echo ""'
## Some History Commands
alias hist10="awk '{print $1}' ~/.bash_history | sort | uniq -c | sort -rn | head -n 10"
## Useless but fun
alias busy="cat /dev/urandom | hexdump -C | grep --color=never 'ca fe'"
## XTerm Fix
alias xtermfix="xrdb ~/.X*"
## Launch xterm for pictures
alias pictures="xterm -bg black -fg grey -ti vt340"
## Pictures in xterm
alias lsix="$HOME/scripts/lsix"
## xclock
alias fix_clock="/usr/bin/xrdb -load $HOME/xclock"
## tmux monitoring session
#alias tmux_mon="tmux -L Monitoring $HOME/.tmuxMon.conf"
## Blade software IPMIview
alias bladectl='$HOME/programs/IPMIView_2.14.0_build.180213_bundleJRE_Linux_x64/IPMIView20'
## Other Programs
alias openxen="~/programs/openxenmanager-master/openxenmanager"
## Bakkin zshow alias
alias zshow='zfs list -o name,used,refer,creation -t snapshot -r'
## test
alias lsl='ls -l --color=no'
## Google Admin CLI
alias gam="$HOME/bin/gamadv-xtd3/gam"
## Winbox for Mikrotik
alias winbox='wine $HOME/programs/winbox64.exe'
## Ookla speedtest
alias speedtest='$HOME/programs/speedtest'