-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.bashrc backup
302 lines (226 loc) · 8.34 KB
/
.bashrc backup
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
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
# _ _ ____ _
# / \ _ __ ___| |__ | __ ) __ _ ___| |__ _ __ ___
# / _ \ | '__/ __| '_ \ | _ \ / _` / __| '_ \| '__/ __|
# / ___ \| | | (__| | | | | |_) | (_| \__ \ | | | | | (__
#/_/ \_\_| \___|_| |_| |____/ \__,_|___/_| |_|_| \___|
#
#
#
# ~/.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
alias ls='ls --color=auto'
#
# # Arch latest news
# if [ "$PS1" ] && [[ $(ping -c1 www.google.com 2>&-) ]]; then
# # The characters "£, §" are used as metacharacters. They should not be encountered in a feed...
# echo -e "$(echo $(curl --silent https://www.archlinux.org/feeds/news/ | sed -e ':a;N;$!ba;s/\n/ /g') | \
# sed -e 's/&/\&/g
# s/<\|</</g
# s/>\|>/>/g
# s/<\/a>/£/g
# s/href\=\"/§/g
# s/<title>/\\n\\n\\n :: \\e[01;31m/g; s/<\/title>/\\e[00m ::\\n/g
# s/<link>/ [ \\e[01;36m/g; s/<\/link>/\\e[00m ]/g
# s/<description>/\\n\\n\\e[00;37m/g; s/<\/description>/\\e[00m\\n\\n/g
# s/<p\( [^>]*\)\?>\|<br\s*\/\?>/\n/g
# s/<b\( [^>]*\)\?>\|<strong\( [^>]*\)\?>/\\e[01;30m/g; s/<\/b>\|<\/strong>/\\e[00;37m/g
# s/<i\( [^>]*\)\?>\|<em\( [^>]*\)\?>/\\e[41;37m/g; s/<\/i>\|<\/em>/\\e[00;37m/g
# s/<u\( [^>]*\)\?>/\\e[4;37m/g; s/<\/u>/\\e[00;37m/g
# s/<code\( [^>]*\)\?>/\\e[00m/g; s/<\/code>/\\e[00;37m/g
# s/<a[^§|t]*§\([^\"]*\)\"[^>]*>\([^£]*\)[^£]*£/\\e[01;31m\2\\e[00;37m \\e[01;34m[\\e[00;37m \\e[04m\1\\e[00;37m\\e[01;34m ]\\e[00;37m/g
# s/<li\( [^>]*\)\?>/\n \\e[01;34m*\\e[00;37m /g
# s/<!\[CDATA\[\|\]\]>//g
# s/\|>\s*<//g
# s/ *<[^>]\+> */ /g
# s/[<>£§]//g')\n\n";
# fi
PS1='\[\e[97m\u\]@\e[96m\h\]] \w $ '
#list
alias ls='ls --color=auto'
alias la='ls -a'
alias ll='ls -la'
alias l='ls'
alias l.="ls -A | egrep '^\.'"
alias back='cd..'
#Custom
#
#
#
#
#Pacman
#alias update='sudo ./update.sh'
alias update='sudo pacman -Syu'
alias yupdate='yay -Syu'
alias cache='sudo paccache -r'
#Obvio
alias r='ranger'
alias e='exit'
alias pacman='sudo pacman'
alias search='sudo pacman -Ss'
alias remove='sudo pacman -Rns '
alias depend='sudo pacman -Qi'
alias install='sudo pacman -S'
alias chmod='sudo chmod'
alias chown='sudo chown'
alias mkdir='sudo mkdir'
alias nano='sudo nano'
alias systemctl='sudo systemctl'
#Power Management
alias sdn='sudo shutdown -h now'
alias sr="sudo reboot"
alias hib='sudo systemctl hibernate'
alias suspend='sudo systemctl suspend'
alias coffee='xset s off -dpms'
#Configs
alias config='nano .config/i3/config'
alias i3bar='nano .i3status.conf'
alias ipv6='sudo nano /etc/sysctl.d/40-ipv6.conf'
alias update-grub="sudo grub-mkconfig -o /boot/grub/grub.cfg"
alias display='sudo nano .Xresources'
alias umount='sudo umount'
alias pmount-list='nano /etc/pmount.allow'
alias uz='aunpack'
#Network
alias fw='sudo ufw status numbered'
alias fwf='sudo ufw disable'
alias fwn='sudo ufw enable'
alias test='ping -c2 9.9.9.9'
alias nwr='sudo systemctl restart NetworkManager'
alias ip='curl icanhazip.com'
alias speed='speedtest'
alias vmfix='sudo modprobe -a vmw_vmci vmmon vmnet'
alias vmnetwork='sudo systemctl start vmware-networks.service'
alias mac='sudo ifconfig wlp0s20f3 down && sudo macchanger -r wlp0s20f3 && sudo ifconfig wlp0s20f3 up'
alias macshow='macchanger wlp0s20f3 -s'
alias tailscale='sudo systemctl start tailscaled && sudo tailscale up --shields-up --accept-dns=false --accept-routes'
alias clients='sudo tailscale status'
alias wifi='nmtui'
#Sensors
alias gpu='optimus-manager --status'
alias cpu='cd /sys/devices/platform/coretemp.0/hwmon && ls && cd'
alias s='sensors | grep Core && sensors | grep fan'
#Random
alias calen='calcurse'
alias neo='neofetch --w3m ~/Downloads/Icons/mrtowley.png'
alias weather='curl wttr.in/78251'
alias space='df -hT'
alias clock='tty-clock -xct -C4'
alias birth='stat -c %w /'
alias name='uname -r'
alias logout='figlet See you space cowboy | lolcat'
alias dont='espeak -s 150 -v en+f2 "dont worry about it"'
#No Use
#alias speedtest='./librespeed-cli'
#alias email='neomutt'
alias spotify='cd /usr/share/applications && gtk-launch spotify-adblock.desktop'
#fix obvious typo's
alias cd..='cd ..'
alias pdw="pwd"
alias udpate='sudo pacman -Syu'
## Colorize the grep command output for ease of use (good for log files)##
alias grep='grep --color=auto'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
#readable output
alias df='df -h'
#pacman unlock
alias unlock="sudo rm /var/lib/pacman/db.lck"
alias rmpacmanlock="sudo rm /var/lib/pacman/db.lck"
#arcolinux logout unlock
alias rmlogoutlock="sudo rm /tmp/arcologout.lock"
#free
alias free="free -mt"
#use all cores
alias uac="sh ~/.bin/main/000*"
#continue download
alias wget="wget -c"
#userlist
alias userlist="cut -d: -f1 /etc/passwd"
#merge new settings
alias merge="xrdb -merge ~/.Xresources"
# Aliases for software managment
# pacman or pm
alias pacman='sudo pacman --color auto'
#skip integrity check
alias yayskip='yay -S --mflags --skipinteg'
#check vulnerabilities microcode
alias microcode='grep . /sys/devices/system/cpu/vulnerabilities/*'
#get fastest mirrors in your neighborhood
alias mirror="sudo reflector -f 30 -l 30 --number 10 --verbose --save /etc/pacman.d/mirrorlist"
alias mirrord="sudo reflector --latest 50 --number 20 --sort delay --save /etc/pacman.d/mirrorlist"
alias mirrors="sudo reflector --latest 50 --number 20 --sort score --save /etc/pacman.d/mirrorlist"
alias mirrora="sudo reflector --latest 50 --number 20 --sort age --save /etc/pacman.d/mirrorlist"
#shopt
shopt -s autocd # change to named directory
shopt -s cdspell # autocorrects cd misspellings
shopt -s cmdhist # save multi-line commands in history as single line
shopt -s dotglob
shopt -s histappend # do not overwrite history
shopt -s expand_aliases # expand aliases
#youtube-dl
alias yta-aac="youtube-dl --extract-audio --audio-format aac "
alias yta-best="youtube-dl --extract-audio --audio-format best "
alias yta-flac="youtube-dl --extract-audio --audio-format flac "
alias yta-m4a="youtube-dl --extract-audio --audio-format m4a "
alias yta-mp3="youtube-dl --extract-audio --audio-format mp3 "
alias yta-opus="youtube-dl --extract-audio --audio-format opus "
alias yta-vorbis="youtube-dl --extract-audio --audio-format vorbis "
alias yta-wav="youtube-dl --extract-audio --audio-format wav "
alias ytv-best="youtube-dl -f bestvideo+bestaudio "
#Recent Installed Packages
alias rip="expac --timefmt='%Y-%m-%d %T' '%l\t%n %v' | sort | tail -200 | nl"
alias riplong="expac --timefmt='%Y-%m-%d %T' '%l\t%n %v' | sort | tail -3000 | nl"
#Cleanup orphaned packages
alias cleanup='sudo pacman -Rns $(pacman -Qtdq)'
#get the error messages from journalctl
alias jctl="journalctl -p 3 -xb"
#nano for important configuration files
#know what you do in these files
alias nlightdm="sudo nano /etc/lightdm/lightdm.conf"
alias npacman="sudo nano /etc/pacman.conf"
alias ngrub="sudo nano /etc/default/grub"
alias nmkinitcpio="sudo nano /etc/mkinitcpio.conf"
alias nslim="sudo nano /etc/slim.conf"
alias noblogout="sudo nano /etc/oblogout.conf"
alias nmirrorlist="sudo nano /etc/pacman.d/mirrorlist"
alias nconfgrub="sudo nano /boot/grub/grub.cfg"
alias bls="betterlockscreen -u /usr/share/backgrounds/arcolinux/"
#gpg
#verify signature for isos
alias gpg-check="gpg2 --keyserver-options auto-key-retrieve --verify"
#receive the key of a developer
alias gpg-retrieve="gpg2 --keyserver-options auto-key-retrieve --receive-keys"
# # ex = EXtractor for all kinds of archives
# # usage: ex <file>
ex ()
{
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xjf $1 ;;
*.tar.gz) tar xzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) unrar x $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xf $1 ;;
*.tbz2) tar xjf $1 ;;
*.tgz) tar xzf $1 ;;
*.zip) unzip $1 ;;
*.Z) uncompress $1;;
*.7z) 7z x $1 ;;
*.deb) ar x $1 ;;
*.tar.xz) tar xf $1 ;;
*.tar.zst) unzstd $1 ;;
*) echo "'$1' cannot be extracted via ex()" ;;
esac
else
echo "'$1' is not a valid file"
fi
}
#create a file called .bashrc-personal and put all your personal aliases
#in there. They will not be overwritten by skel.
[[ -f ~/.bashrc-personal ]] && . ~/.bashrc-personal
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH="$PATH:$HOME/.rvm/bin"
bind -s 'set completion-ignore-case on'