-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.aliasrc
executable file
·1632 lines (1355 loc) · 47.9 KB
/
.aliasrc
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
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/env bash
# LANG="UTF-8"
fetch_() {
# Pfetch / Neofetch
# Define a function to check if a command exists
command_exists() {
command -v "$1" >/dev/null 2>&1
}
# Define a function to display system information
if command_exists pfetch; then
pfetch
elif command_exists neofetch; then
NEOFETCH_CONFIG="config/candies.conf" neofetch
else
echo "Error: Neither pfetch nor neofetch are installed."
exit 1
fi
# Set colors for pfetch
if command_exists pfetch; then
export PF_COLORS="lightblue blue"
fi
}
fetch_
############ Todo Workaround ################
# restart sshd
portmaster_restart() {
# sh -c "systemctl status wpa_supplicant.service"
# echo "restart NetworkManager.."
# systemctl restart NetworkManager.service
echo "restarting Portmaster.."
systemctl restart --now portmaster
#nohup >/dev/null 2>&1 sh -c "/opt/safing/portmaster/portmaster-start app --data=/opt/safing/portmaster" &
# Debug info
# curl http://127.0.0.1:817/api/v1/debug/core
}
alias NetworkManager_restart='echo "restart NetworkManager.."; restart NetworkManager'
iinstall__() {
# 1
# 0
paru -Syu --needed
# test #todo
: <<EOF
-------------------------------------
# F-Droid
RethinkDNS
Blokada
InviZible Pro
NetGuard
pdnsf
Obtanium
EOF
}
safety-up() {
sudo systemctl enable --now ufw
sudo systemctl enable --now portmaster
sudo systemctl enable --now fail2ban
}
safety_down() {
sudo systemctl disable --now ufw
sudo systemctl disable --now portmaster
sudo systemctl disable --now fail2ban
}
################## TODO #####################
#############################################
## Alias and Functions ##
set_path() {
# Check if user id is 1000 or higher
id_=$(id -u) || true
[[ "${id_}" -ge 1000 ]] || return
for i in "$@"; do
# Check if the directory exists
[[ -d "${i}" ]] || continue
# Check if it is not already in your $PATH.
echo "${PATH}" | grep -Eq "(^|:)${i}(:|$)" && continue
# Then append it to $PATH and export it
export PATH="${PATH}:${i}"
done
}
set_path ~/bin ~/scripts
# Pretty print the path
# alias path='echo $PATH | tr -s ':' '\n'' # ls
alias path='echo -e ${PATH//:/\\n}' # ll
# PATH
export home_=~/ownCloud
export bin_=~/ownCloud/.bin
export dotfile_=~/ownCloud/dotfile
xfce-backup() {
# xfce4-backup
if [[ ! -d ~/ownCloud/dotfile/ ]]; then
mkdir -v ~/ownCloud/dotfile/ || true
fi
xfce4-panel-profiles save ~/ownCloud/dotfile/xfce4/xfce4-panel-profiles
update-desktop-database ~/.config/mimeapps.list
update-desktop-database ~/.local/share/applications #! deprecated
}
xfce_restore() {
ln -fv ~/ownCloud/dotfile/xfce4/xfce4-keyboard-shortcuts.xml ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml
}
pkglist-backup() {
# sudo pacman -Qqe > pkglist.txt #! not use --combinedupgrade
pkg_=~/ownCloud/dotfile/pkglist.txt
if [[ ! -d ~/ownCloud/dotfile/ ]]; then
mkdir -pv ~/ownCloud/dotfile/ || true
fi
pacman -Qqe >$pkg_ && echo "$pkg_ done"
}
pkglist_restore() {
paru -Syu --needed --cleanafter --batchinstall --noredownload --useask --topdown --sudoloop - <~/ownCloud/dotfile/pkglist.txt
}
f7-pkglist-backup() {
f7_=~/ownCloud/dotfile/pkglist_f7.txt
if [[ ! -d ~/ownCloud/dotfile/ ]]; then
mkdir -pv ~/ownCloud/dotfile/ || true
fi
pacman -Qqe >$f7_ && echo "$f7_ done"
}
f7-pkglist_restore() {
paru -Syu --needed --cleanafter --batchinstall --noredownload --useask --topdown --sudoloop - <~/ownCloud/dotfile/pkglist_f7.txt
Packet Blacklist / Ignorelist /etc/pacman.conf
}
cclean() {
# Systemclean
sudo pacman -Sc --noconfirm
/usr/bin/sudo journalctl --vacuum-time=14d --rotate
sudo journalctl --vacuum-size=33M
if [ -n "$(find -maxdepth 2 -type d -iname 'fr*')" ]; then
# file-roller
sudo find ~/.cache/.fr* -delete -print
fi
fc-cache -fv
for i in /var/tmp/* ~/.dtrash/* /root/.cache/*; do
if [ -e "$i" ]; then
sudo find "$i" -delete -print
fi
done
sudo find /var/cache/* -delete -print
sh -c "sudo rm -rfv /var/lib/pacman/db.lck"
find ~/.local/share/Trash/files/* -atime 8 -delete -print # digikam
find ~/.local/share/Trash/info/* -atime 8 -delete -print
delete_packages
ccache -C
echo ""
echo "if files below then there are older then 88 Days.."
echo "in folder .cache"
sudo find ~/.cache/ -atime 88 -print
}
ccclean() {
# advance cleanup
# rmlint finds space waste and other broken things on your filesystem. Its main focus lies on finding duplicate files and directories.
# sudo find / -iname '*.old' -type f -print -delete
ufw_() {
# old ufw files
sudo find /etc/ufw/ -iname "*202*" -type f -print -delete
}
ufw_
if [ -d ~/.dtrash ]; then
sudo find ~/.dtrash/* -delete -print
fi
# digikam Trash
for i in ~/.local/share/Trash/files/* ~/.local/share/Trash/info/*; do
if [ -e "$i" ]; then
sudo find "$i" -delete -print
fi
done
sudo find / -iname '*.bak' -type f -print
sudo find / -regex /"\(proc\|tmp\|run\)" -prune -o -type f -regex ".*\.pac\(new\|save\|orig\)" -print
echo " Checkout above if you want to handel/delete some <.bak and .pacnew> file.."
}
pacnew() {
# sudo find / -iname '*.pacnew' -type f -not \ -path '/run/'
# todo try to exclude path's
# sudo find / -iname '*.pacnew' -type f -not -path '/proc/*' -not -path '/run/*' -not -path '/timeshift/*' -not -path '/var/log/*' -not -path '.config/VSCodium/' -not -path '/timeshift/*' -print
sudo find / -regex /"\(proc\|tmp\|run\)" -prune -o -type f -regex ".*\.pac\(new\|save\|orig\|.old\)" -print
echo "here is some syncthing conflict:"
syncthing_conflict
# sudo find / \( -path /proc -o -path /run -o -path /tmp \) -prune -o -type f -regex ".*\.pac\(new\|save\|orig\)" -print
# pacdiff -o
}
syncthing_conflict() {
sudo find / -iname '*sync-conflict' -type f -print
}
find_oldstuff() {
find ~/.config -atime 266 -print
find ~/.local -atime 266 -print
find ~/.cache -atime 266 -print
}
findbrokenpkgs() {
# find Broke Symlinks
command findbrokenpkgs
}
findbrokesymlinks() {
yy -S --needed findbrokenpkgs
sudo find / -xtype l -print
}
checkrebuild() {
sudo pacman -S --needed rebuild-detector
checkrebuild -v
}
delete_packages() {
# Deleted not wanted packages >> cclean
# List of packages to delete
packages=(hexchat mousepad audacious kodi nemo-emblems vuescan)
# Loop through the packages and remove them
for package in "${packages[@]}"; do
if paru -Qs "${package}" >/dev/null; then
echo "${package} is installed, deleting..."
paru -Rcns "${package}"
# else
# echo "$package is not installed, skipping..."
fi
done
}
move_to_trash() {
if [[ $# -eq 0 ]]; then
return 0 # return success if no arguments passed
fi
if ! [[ -d ~/.local/share/Trash/files/ ]]; then
mkdir -p ~/.local/share/Trash/files/
fi
for arg in "$@"; do
if [[ -e "${arg}" ]]; then # check for existence of file or directory
# get the base filename without extension
filename=$(basename -- "${arg}")
extension="${filename##*.}"
filename="${filename%.*}"
# get a unique filename by appending a version number
counter=1
while [[ -e ~/.local/share/Trash/files/"${filename}-${counter}.${extension}" ]]; do
counter=$((counter + 1))
done
# move the file or directory to the trash
mv -vf "${arg}" ~/.local/share/Trash/files/"${filename}-${counter}.${extension}"
else
printf "The file or directory '%s' does not exist and was skipped.\n" "${arg}"
fi
done
# find and delete in some days
find ~/.local/share/Trash/files/* -atime 7 -delete -print
}
rm() {
if [ "$(id -u)" != "0" ]; then
echo -e ' to delete \e[38;2;242;29;0m'"$*"'\e[0m press (y/n) or Enter: '
stty -echo
read -r r
stty echo
echo
if [[ "$r" =~ ^[Yy]$ ]] || [[ "$r" == "" ]]; then
sudo /bin/rm -vr "$@"
else
echo "Deletion cancelled"
fi
else
/bin/rm -vr "$@"
fi
}
orphans() {
# sudo pacman -Sy
orphans_="$(sudo pacman -Qtd)"
if [[ -n "${orphans_}" ]]; then
sudo pacman -Qqtd | sudo pacman -Rns - || true
else
sudo pacman -Qtdv
echo -e "\n no orphans to remove"
fi
}
pamacclean() {
pamac clean --no-confirm --keep 1
sudo find /tmp/* -delete -print
sudo find /var/lib/pacman/sync/* -delete -print
sudo find /var/tmp/pamac/dbs/sync/*.* -delete -print
sudo find /etc/pacman.d/gnupg -delete -print
sudo find /var/lib/pacman/db.lck -delete -print
sudo find /root/.gnupg/* -delete -print
sudo find /var/cache/pacman/pkg/*.tar.zst.sig -delete -print
sudo pacman -Sy gnupg archlinux-keyring manjaro-keyring
sudo pacman-key --init
sudo pacman -Syy
sudo pacman-key --populate --populate archlinux manjaro
sudo pacman-key -u --refresh-keys &&
sudo pacman-mirrors -a -P https --fasttrack 22 &&
sudo pacman -Syyu --disable-download-timeout
}
downgrade() {
command /usr/bin/sudo /usr/bin/downgrade "$@"
}
# Arch
alias arch-grub='sudo grub-mkconfig -o /boot/grub/grub.cfg'
alias reflector='sudo reflector --latest 5 --sort rate --save /etc/pacman.d/mirrorlist '
arch-pamacclean() {
pamac clean --no-confirm --keep 1
sudo find /tmp/* -delete -print
sudo find /var/lib/pacman/sync/* -delete -print
sudo find /var/tmp/pamac/dbs/sync/*.* -delete -print
sudo find /etc/pacman.d/gnupg -delete -print
sudo find /var/lib/pacman/db.lck -delete -print
sudo find /root/.gnupg/* -delete -print
sudo find /var/cache/pacman/pkg/*.tar.zst.sig -delete -print
sudo pacman-key --init
sudo pacman -Syy
sudo pacman-key --populate archlinux
sudo pacman-key --refresh-keys
sudo pacman -Syyu --disable-download-timeout
}
# endeavouros
alias eos-update='eos-rankmirrors; sudo pacman -Syu'
wine-config() {
# wine steam
sudo pacman -Syu --needed wine-staging wine-nine gamescope winetricks protontricks wine-mono vulkan-tools linux-steam-integration wine-gecko steam giflib lib32-giflib libpng lib32-libpng libldap lib32-libldap gnutls lib32-gnutls mpg123 lib32-mpg123 openal lib32-openal v4l-utils lib32-v4l-utils libpulse lib32-libpulse libgpg-error lib32-libgpg-error alsa-plugins lib32-alsa-plugins alsa-lib lib32-alsa-lib libjpeg-turbo lib32-libjpeg-turbo sqlite lib32-sqlite libxcomposite lib32-libxcomposite libxinerama lib32-libgcrypt libgcrypt lib32-libxinerama ncurses lib32-ncurses opencl-icd-loader lib32-opencl-icd-loader libxslt lib32-libxslt libva lib32-libva gtk3 lib32-gtk3 gst-plugins-base-libs lib32-gst-plugins-base-libs vulkan-icd-loader lib32-vulkan-icd-loader glew lib32-dbus-glib lib32-freeglut lib32-glew lib32-gtk2 lib32-imlib2 lib32-libappindicator-gtk2 lib32-libcaca lib32-libcurl-compat lib32-libcurl-gnutls lib32-libdbusmenu-glib lib32-libdbusmenu-gtk2 lib32-libgcrypt lib32-libid3tag lib32-libidn11 lib32-libindicator-gtk2 lib32-libjpeg6-turbo lib32-libmikmod lib32-libmodplug lib32-libnm lib32-libpng12 lib32-librtmp0 lib32-libtheora lib32-libtiff lib32-libudev0-shim lib32-libvpx lib32-libwebp lib32-openssl lib32-pipewire lib32-sdl lib32-sdl2_image lib32-sdl2_mixer lib32-sdl2_ttf lib32-sdl_image lib32-sdl_mixer lib32-sdl_ttf lib32-smpeg libcurl-compat libcurl-gnutls libdbusmenu-gtk2 libgcrypt15 libidn11 libindicator-gtk2 libjpeg6-turbo libpng librtmp0 libtiff4 libudev0-shim libvpx openssl opusfile sdl2_image sdl2_mixer sdl2_ttf sdl_image sdl_mixer sdl_ttf smpeg vulkan-extra-layers vulkan-extra-tools lib32-faudio lib32-alsa-lib lib32-alsa-plugins lib32-gnutls lib32-gst-plugins-base-libs lib32-libldap lib32-libpulse lib32-libva lib32-libxml2 lib32-mpg123 lib32-openal lib32-v4l-utils
wineserver -k 15
# mkdir ~/.wine
env WINEPREFIX="$HOME"/.wine wineboot
#!
echo "prefix set.. "
echo ""
# export WINEARCH=win64
# export WINEARCH=win32
sudo winetricks --self-update
echo "starting winetricks -q.."
# winetricks -q -v d3dx9 d3dcompiler_43 d3dcompiler_47 corefonts vcrun2017 cjkfonts allfonts vcrun2005 dotnet48 xinput wined3d xact dxvk d3dx11_43 d3dx11_42 vcrun2008 vcrun2010
#!
# sh -c 'sudo chown -Rv "${USER}":"${USER}" ~/.wine'
echo "wineboot init"
wineboot --init
echo ""
wine --version
echo ""
echo done..
# winetricks
}
# if [[ -d ~/.wine ]]; then
# export WINEARCH=win32 WINEPREFIX="$HOME"/.local/share/wineprefixes/win32
# export WINEESYNC=1
# fi
wine_clean() {
# yy -Rc wine dxvk-bin wine-mono vulkan-tools lutris wine-gecko lib32-vkd3d winetricks vkd3d d3dx9 vulkan-extra-layers vulkan-extra-tools
wineserver -k 15
.local/share/applications
sudo find ~/.local/share/applications/wine -delete -print
sudo find ~/.local/share/wineprefixes/* -delete -print
sudo find ~/.config/menus/applications-merged/wine* -delete -print
sudo find ~/.config/mimeapps.list/wine -delete -print
sudo find ~/.config/mimeapps.list/mimeinfo.cache -delete -print
sudo find ~/.local/share/desktop-directories/wine* -delete -print
sudo find ~/.local/share/icons/????_*.{xpm,png} -delete -print
sudo find ~/.local/share/icons/*-x-wine-*.{xpm,png} -delete -print
sudo find ~/.local/share/mime/packages/x-wine* -delete -print
sudo find ~/.config/mimeapps.list/wine-extension* -delete -print
sudo find ~/.local/share/applications/mimeinfo.cache -delete -print
sudo find ~/.local/share/mime/application/x-wine-extension* -delete -print
sudo find ~/.config/mimeapps.list/wine-extension*.desktop -delete -print
sudo find ~/.local/share/icons/hicolor/*/*/application-x-wine-extension* -delete -print
sudo find /root/.wine -delete -print
sudo find ~/win32 -delete -print
sudo find ~/win64 -delete -print
update-desktop-database ~/.config/mimeapps.list
update-desktop-database ~/.local/share/applications
update-mime-database ~/.local/share/mime/
sudo find ~/.wine/drive_c/users/"${USER}"/Temp ~/.wine/drive_c/windows/temp -delete -print
ln -s /tmp/ ~/.wine/drive_c/users/"${USER}"/Temp
ln -s /tmp/ ~/.wine/drive_c/windows/temp
sudo find ~/.wine -delete -print
}
steam_clean() {
sudo find ~/.local/share/Steam/ -delete -print
sudo find ~/steam* -delete -print
}
# alias §="xdotool - < /home/shaderico/.local/bin/magickeys.sh "
# bindkey -s '§' "xdotool_ "
xdotool_() {
/home/shaderico/.local/bin/magickeys_off.sh
}
# xdotool_() {
# if $toggle; then
# echo hi
# toggle=true
# magickeys.sh
# else
# pkill magickeys.sh
# toggle=false
# echo hiw
# fi
# }
# xdotool_() {
# # keyboard input / automate / macro / xbindkeys #! not on wayland but "xte, ydotool, wtype "
# while true; do
# xdotool key 1
# xdotool key 2
# xdotool key 3
# xdotool key 4
# sleep 0.4
# done
# }
# while true; do
# bindkey -s '1'
# bindkey -s '2'
# bindkey -s '3'
# bindkey -s '4'
# sleep 0.4
# done
# extramaus cursor / mouse
# extramaus
alias cp='cp -vi ' # Confirm before overwriting something
alias df='df -h ' # Human-readable sizes check
alias free='free -h ' # Show sizes in MB
alias whereami='echo $PWD'
alias more='less --use-color'
pacman-update() {
sudo pacman-mirrors -a -P https --fasttrack 11 &&
sudo pacman -Syu --disable-download-timeout
}
alias mirror-check='pacman-mirrors --status'
grub-update() {
# sudo grub-install --recheck && sudo update-grub
sudo grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=manjaro --recheck --verbose
sudo mkinitcpio -P
sudo update-grub && sudo tree /boot/efi
}
alias pacman-grep='pacman -Qe | grep '
alias mv='mv -iv '
# pamac build "$1"
# paru / yay
AUR_helper="paru"
alias zz="yy --disable-download-timeout"
alias yy="${AUR_helper}"
#todo if ( "$AUR_helper" == "$AUR_helper" ) then
# "$AUR_helper" else
# echo "" && paru --show --news && echo "here we go Richard"
# fi
alias rechner-bc=' bc -ql' #Calculator
alias calculator-bc='bc -ql' #Calculator
alias inxi-Fnzy='LANG=C inxi -Fnzy' #Info System #-a uuid info
# Antivirus
alias defenderscan-libredefender='sudo libredefender scan ~/'
alias defenderscan_infection='sudo libredefender infections '
# Network
# https://wiki.archlinux.org/title/Systemd
# open port check
alias port_open_lsof='sudo lsof -i -P -n | grep LISTEN' #port open-list
# alias ps='ps' # ps System Info running like 'whish shell'
alias ss='ss ' # like lsof
alias port-no-ping-input-ip=' nmap -T4 -A -v -Pn ' # nmap -T4 -A -v -Pn 127.0.0.1
alias port-all-input-ip='nmap -p 1-65535 -T4 -A -v ' # nmap -p 1-65535 -T4 -A -v 127.0.0.1
# alias port-all-and-udp='nmap -sS -sU -T4 -A -v ' # nmap -sS -sU -T4 -A -v 127.0.0.1
# alias port-nmap-input-ip='nmap -T4 -A -v ' # nmap -T4 -A -v 127.0.0.1
alias port-live=" watch -n1 'ss -tp'"
alias port_live_2="watch -n1 'lsof -i4 -itcp'"
alias wifi-info='iw list'
# resolve check --> /etc/systemd/resolved.conf
alias resolve_network_check='systemctl status systemd-resolved.service'
# security check
port_check_() {
echo "listening ports"
sudo netstat -tunlp
}
fail2ban_() {
# --- Enable fail2ban
sudo pacman -S --needed fail2ban
if [[ ! -f /etc/fail2ban/jail.local ]]; then
sudo sh -c 'echo "
[DEFAULT]
bantime = 1d
[sshd]
enabled = true" >/etc/fail2ban/jail.local'
fi
# if [[ ! -f /etc/fail2ban/jail.local ]]; then
# print '\n[DEFAULT]\nbantime = 1d\n[sshd]\nenabled = true' | sudo tee /etc/fail2ban/jail.local
# fi
sudo systemctl --now enable fail2ban
sudo systemctl --now start fail2ban
}
# speedtest
alias speedtest=" speedtest --secure" # https
alias h-speedtest_http=" speedtest " # http
# Networkinfo #* Network Mapping status 'rpcbind'
alias ip-c=' ip -c a' # ip-coler ip addr ip -br -c addr show ip route show ip link show
alias ip-cAddr='ip -br -c addr show'
alias ifconfig='ifconfig' # same as ip-coler with netmask info
alias nmcli='nmcli | more '
alias nmtui='xfce4-terminal --geometry=115x30 --hide-scrollbar -H -x zsh -c "nmtui"'
alias myip=" sh -c 'curl http:/ipecho.net/plain; echo'"
alias whatismyip="sh -c 'curl http:/ipecho.net/plain; echo'"
alias traffic-jnettop='xfce4-terminal --geometry=80x20 --hide-scrollbar -H -x zsh -c "sudo jnettop"'
alias networkmanagerlog='journalctl --boot 0 --unit NetworkManager.service --follow' # NetworkManager info scan
alias journalctl-live=' journalctl -f'
alias journalctl-kernel='sudo journalctl -rp 3 -xb|more'
alias journalctl-log=' sudo journalctl -r |more'
alias whois='whois' # whois input-ip 127.0.0.1
alias kernel_info='lsmod'
alias traceroute='traceroute' # traceroute input-ip # traffic-backtrace info scan # mdos tracert google.ch
alias network_bettercap_monitoring='sudo bettercap' # network-monitoring live-scan spoofing
alias network-sniffer-monitoring='xfce4-terminal --geometry=100x28 --hide-scrollbar -H -x zsh -c "sudo sniffer"' # network-monitoring live-scan
# alias netstat="sudo netstat -tapn | sed '1 d' | sort -r +6 | grep -v 'TIME_WAIT' | grep -v 'FIN_WAIT' | grep -v 'LISTEN' | grep -v 'CLOSING' | grep -v 'LAST_ACK'"
alias sniffglue="sudo sniffglue" # Network sniffer
alias netstat-live='xfce4-terminal --geometry=100x28 --hide-scrollbar -H -x zsh -c "sudo netstat -c -i eno1"'
alias networkstatus='networkctl list'
alias ufw-iptables='sudo iptables -L'
alias whowatch='whowatch ' # who is on my network
alias traffic_wavemon='xfce4-terminal --geometry=88x28 --hide-scrollbar -H -x zsh -c "wavemon"' # Network traffic strength
alias tcpdump_wlp59='sudo tcpdump -i wlp59s0' # wireshark cli
alias ping='ping -c 3 ' # Windows nslookup
alias gateway-ping='ping _gateway'
# Gateway
alias route='route -n'
# VPN
alias vpnProtonvpn='protonvpn'
vpn-eth() {
if [[ -d /opt/cisco/anyconnect ]]; then
sh -c "sudo rm -rfv /opt/cisco/anyconnect" || return 1
fi
sh -c "sudo mkdir -pv /opt/cisco/anyconnect/" || true
sh -c "sudo ~/ownCloud/.bin/anyconnect-linux64-4.10.02086-core-vpn-webdeploy-k9.sh"
fail2ban_
}
# sudo dhclient -v
# sudo airmon-ng
# Find / Help /forget
alias help_apropos=' apropos '
alias forget_apropos='apropos '
# Convert
alias ffmpeg='ffmpeg -hide_banner' #'ffmpeg -i input.mp4 output.avi' https:/ffmpeg.org/ffmpeg.html
# cam-info
alias cam-info=' v4l2-ctl --list-devices'
# Downloads youtube-dl, clipgrab
alias yt='mkdir ~/Downloads/yt ; cd ~/Downloads/yt ; yt-dlp --add-metadata -i -f "bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best"'
alias yta='mkdir ~/Downloads/yt ; cd ~/Downloads/; yt -x -f bestaudio/best'
alias wget='wget -c' #web get #Commandline Homepage URL Download > index.html
alias wget-completed='wget -m -c -r -np -p -E -k -K 'target-url-here'' #web get #Commandline Homepage URL Download > index.html
# alias curl-completed='wget -r -k -E -l 8 ' #web get #Commandline Homepage URL Download > index.html
alias server-response='wget --server-response' # Website/Page Speed test
alias speed-wget-speedometer='wget --server-response' # Website/Page Speed test
#todo break stuffs alias curl="curl -C " #web get #Commandline Homepage URL Download > index.html
# pastebin
# https://forum.manjaro.org/t/howto-use-public-command-line-pastebin-services-without-installing-anything/38378
paste_c() {
# https://paste.c-net.org/
"$@" | curl -s --data-binary @- 'https://paste.c-net.org/'
}
paste_0x0() {
# https://0x0.st/
"$@" | curl -F 'file=@-' https://0x0.st
}
paste_clbin() {
# https://clbin.com/
"$@" | curl -F 'clbin=<-' https://clbin.com
}
paste_ix() {
# http://ix.io/
"$@" | curl -F 'f:1=<-' ix.io
}
v() {
if [[ "$(id -u)" != "0" ]]; then
sudo nvim "$@"
else
nvim "$@"
fi
}
f() {
if [ -d "$1" ]; then
if [ "$(id -u)" != "$(stat -c %u "$1")" ]; then
sudo nemo "$1"
else
nemo "$1"
fi
else
nemo
# if [[ ! /bin/nemo ]]; then
# thunar
# fi
fi
}
# change
# alias $HOME="nope"
#nvidia Proprietary
alias nvidia0300='sudo mhwd --force --auto pci nonfree 0300'
alias mhwd-info='vulkaninfo; mhwd -l ; mhwd -li; modprobe nvidia'
# Sound # pipewire-media-session are wireplumber
#todo speaker-test
#todo speaker-test -dhw:0,0 -c2 -l3 -twav
alias sound-info='aplay -L; inxi -Ax; wpctl status' # speaker-test -D pulse -c2 -l2 -t wav
sound_cli() {
alsamixer
}
8888() {
#todo
for file in *.mp4; do ffmpeg -i "$file" -af "volume=3dB" "output_$file"; done
}
alias ls="ls -thaNr --color=auto --sort=time"
alias ll="ls -thaNrl --color=auto --sort=time"
alias ln='/usr/bin/ln -v'
alias chown='chown -c '
alias chmod='chmod -c '
alias grep='grep --color=auto'
alias g='grep --color=auto'
gg() {
# grep man info
man "$1" | grep --color=auto "$2"
}
alias egrep='egrep --colour=auto'
alias fgrep='fgrep --colour=auto'
alias diff='diff --color=auto'
# These common commands are just too long! Abbreviate them.
alias ka='pkill ' #'killall'
alias e='codium '
# alias e='eval "${EDITOR:=neovim}"'
# VISUAL=EDITOR
if [[ -n ${DISPLAY} ]]; then
export EDITOR="/usr/bin/codium --unity-launch"
elif
export EDITOR="neovim"
then
export EDITOR="kate"
fi
# todo
# if command -v codium; then
# echo "codium run"
# elif command -v neovim; then
# echo "neovim run"
# else
# echo "kate"
# fi
ee() {
local count=1
local filename="Untitled-$count"
while [ -e "$filename" ]; do
count=$((count + 1))
filename="Untitled-$count"
done
$EDITOR -w "$filename"
return
}
np() {
#todo
# find ~/ PKGBUILD_ -atime 88 -print -path '!~/Downloads' -exec mv {} ~/Downloads \;
$EDITOR -w PKGBUILD
}
alias makepkg-si='makepkg -si' #git clone - PKGBUILD
# Git
## create git
alias gitinit='git init'
gitup() {
# local
git add .
git add README.md
# git commit -m "$1"
git commit -m "commit"
git commit -m update
git branch -M master
# git remote add origin [email protected]:username/reponame
git push master
}
gh_website() {
git remote add origin [email protected]:terashy88/website.git
git branch -M master
git push -u origin main master
}
alias gitstatus='git status'
alias gitlog-info='git log --pretty=on'
alias gitremotestatus='git remote -v'
alias gitdiff='git diff'
# Create branch
alias gitbranch='git branch'
alias gitcheckout='git checkout -b'
alias gitremoteadd='git remote add'
alias gitremoterm='git remote rm'
# Git Pull
alias gitpull='git pull'
# Git fetch
alias gitfetch='git fetch'
alias gitpull='git merge'
alias gitclone='git clone'
alias gittag='git tag -a -m'
alias gitreflog='git reflog'
alias gitl='git log --graph --oneline --decorate'
alias giti='echo
git log -n 12 --graph --oneline --decorate
echo
git status
echo'
parse_git_branch() {
# Show Git branch/tag, or name-rev if on detached head
(git symbolic-ref -q HEAD || git name-rev --name-only --no-undefined --always HEAD) 2>/dev/null
}
gitdelete_() {
# delete both, remote first
git rm --cached
}
# Git fix chache
alias git_fixcache="git rm -r --cached ."
: <<GIT
# Delete all changes in the branch
git checkout .
# unstack
git reset
GIT
# Quick fast Navigat access
#todo
# please() {
# sudo "$(fc -l -1)" || true
# }
# alias sudo='sudo_'
# sudo_() {
# command sudo "$@"
# }
# please() {
# sudo "$@"
# }
please() {
command sudo !!
echo ""
}
eee() {
# Editor Quick load
$EDITOR ~/ownCloud/p-git/todo
$EDITOR ~/ownCloud/dotfile/cheatsheet
$EDITOR ~/ownCloud/dotfile/.stignore
$EDITOR ~/ownCloud/dotfile/.aliasrc
$EDITOR ~/ownCloud/dotfile/.zshrc
$EDITOR ~/ownCloud/W-link/css/style.css
$EDITOR ~/ownCloud/W-link/js/index.js
}
my_touch() {
# Define my_touch function to create directories and files
for arg in "$@"; do
if [[ -n "${arg}" ]]; then
mkdir -p "$(dirname "${arg}")" && command touch "${arg}" && ls -ld "${arg}"
else
echo "Invalid argument: ${arg}"
fi
done
# Define touch function to call my_touch with -v option
}
touch() {
# Avoid infinite recursion by not calling the touch function here
my_touch "$@"
}
#alias mkdir='mkdir_'
mkdir() {
# make directory if not exist
for dir in "$@"; do
if [[ ! -d "$dir" ]]; then
command mkdir -pv "$dir" || true
fi
done
}
t() {
if [[ ! -d ~/Downloads/test ]]; then
mkdir -p ~/Downloads/test
fi
cd ~/Downloads/test || return
eval ll || ls
}
dl() {
cd ~/Downloads/ || return
ll || ls
}
cd..() {
cd .. || true
ll || ls
}
D-link() {
cd ~/ownCloud/D-link/ || true
eval ll || ls
}
S-link() {
cd ~/ownCloud/S-link/ || true
eval ll || ls
}
M-link() {
cd ~/ownCloud/M-link/ || true
eval ll || ls
}
W-link() {
cd ~/ownCloud/W-link/ || true
eval ll || ls
}
P-link() {
cd ~/ownCloud/P-link/ || true
eval ll || ls
}
bin() {
cd ~/ownCloud/.bin/ || true
eval ll || ls
}
# mount
alias mount='mount |column -t'
# systemctl
alias enable=' sudo systemctl enable --now '
alias disable=' sudo systemctl disable --now '
alias status='more| sudo systemctl status --now '
alias restart=' sudo systemctl restart --now '
alias stop=' sudo systemctl stop --now '
alias start=' sudo systemctl start --now '
alias sys-port='systemctl status|less --use-color'
alias sys-status='systemctl list-unit-files|less ' # stacer
# alias sys-info='pactl list cards pactl list sinks'
alias errors=' sudo systemctl --failed'
alias failed=' sudo systemctl --failed'
alias startup-speed_info=' systemd-analyze'
alias startup-speed2_info=' systemd-analyze blame'
alias startup-speed_analyze=' systemd-analyze critical-chain'
alias shell-echo='echo $SHELL '
# Boottime info
alias boottime='sudo systemd-analyze blame | head -n 20'
alias bootinfo='sudo efibootmgr'
# Akku info
alias batterie-status='sudo tlp-stat --battery'
alias powertop='sudo powertop'
# powertop --calibrate
# swapfile
swap-activate() {
echo "How much MB should your swapfile have?"
echo "Enter here: "
read -r i
while ! [[ "$i" =~ ^[0-9]+$ ]]; do
echo "memory size, has to be numbers"
echo "try again: "
read -r i
done
echo -e 'Do you want to use \e[38;2;242;29;0m'"${i}"'\e[0mMB?'
echo "Press y are Enter to continue"
read -r r
if [[ "$r" =~ ^[Yy]$ ]] || [[ "$r" == "" ]]; then