-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bash_aliases-rpi4
1748 lines (1239 loc) · 96.6 KB
/
.bash_aliases-rpi4
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
# Bash aliases file for Raspberry Pi 4 Ubuntu based LEMP web/email server. Based off of tutorials on linuxbabe.com.
# Don't forget to visit https://danran.rocks for my tutorials.
# If you are reading this, then you have obviously installed it using my instructions in the README.me file.
# However, if you want to uninstall this, you can read the readme file again, or run the following command below:
# rm $HOME/.bash_aliases && sudo rm -r $HOME/RP4-Ubuntu-Server-bash_aliases && cp $HOME/.bash_aliases.orig $HOME/.bash_aliases && source $HOME/.bash_aliases
##################################
########## Permissions ###########
##################################
# Reset wordpress permission and ownership to default (Note: Be sure that you are already in your wordpress directory before running this command. Otherwise it is dangerous)
alias wppermreset='sudo chown www-data:www-data -R * && sudo find . -type d -exec chmod 755 {} \; && sudo find . -type f -exec chmod 644 {} \; && echo "Your wordpress ownership and permissions were reset"'
##################################
########## System/Dpkg ###########
##################################
# List the state of the systemd unit files (static, enabled, disabled, masked, indirect). Note: this has nothing to do with the state of the service.
# https://askubuntu.com/questions/710420/why-are-some-systemd-services-in-the-masked-state
alias dpkglistunits='sudo systemctl list-unit-files'
alias dpkglistunits2='sudo systemctl list-units --all'
# List the state of systemd services including "loaded but inactive units".
# https://askubuntu.com/questions/710420/why-are-some-systemd-services-in-the-masked-state
alias dpkglistservices='sudo systemctl list-units --all'
# List the state of systemd services exluding "loaded but inactive units".
# https://askubuntu.com/questions/710420/why-are-some-systemd-services-in-the-masked-state
alias dpkglistservices2='sudo systemctl list-units'
##################################
####### Files and Folders ########
##################################
# Show file/folder permissions in number mode and letter mode
alias perms='ls -la && echo "Just above are the contents of the working directory" && read -p "Which file or folder would you like to show permissions for? " file_or_folder && stat $file_or_folder | grep "Access: ("'
# Search the current directory recursively for a file by filename!
alias ffind='read -p "Find a File! Enter the file name you are searching for. You may use wildcards \"*\" : " filename && sudo find . -type f -name "$filename"'
##################################
#### ParrotOS-bash_aliases #######
##################################
#alias nano='nano -c'
#alias ali='nano ~/.bash_aliases'
#alias sali='source ~/.bash_aliases'
# this is to scale your desktop. Ex: 'scale 1.1x1.1'
alias scale='xrandr --output eDP-1 --scale'
# Put Wireless drivers into monitor mode
alias mm='echo 1 | sudo tee /proc/brcm_monitor0 && sudo airodump-ng prism0'
alias moni='sudo airodump-ng prism0'
alias moni2='sudo airmon-ng start wlp3s0'
alias apup='sudo apt update && sudo apt full-upgrade && sudo apt clean'
alias listtools='sudo apt-get update && apt-cache search parrot-'
# Start torghost
alias tgstart='sudo $HOME/Git/torghost/torghost.py -s'
# Torghost manual
alias tgman='sudo $HOME/Git/torghost/torghost.py -h'
# Change torghost nodes
alias tgswitch='sudo $HOME/Git/torghost/torghost.py -r'
alias tgstop='sudo $HOME/Git/torghost/torghost.py -x'
alias tgupdate='sudo $HOME/Git/torghost/torghost.py -u'
##################################
# RP4-Ubuntu-Server-bash_aliases #
##################################
# Update this aliases file in "$HOME/RP4-Ubuntu-Server-bash_aliases" and source the Ubuntu Users updated aliases file so it reflects changes to the github main repo
alias alup='/usr/bin/git -C $HOME/RP4-Ubuntu-Server-bash_aliases pull origin main ; . $HOME/.bash_aliases'
############################
######## OPEN SSL ##########
############################
# Check for TLS Version 1 on mail.facl.xyz
alias otls1='openssl s_client -connect mail.facl.xyz:443 -tls1'
# Check for TLS Version 1.1 on mail.facl.xyz
alias otls1.1='openssl s_client -connect mail.facl.xyz:443 -tls1_1'
# Check for TLS Version 1.2 on mail.facl.xyz
alias otls1.2='openssl s_client -connect mail.facl.xyz:443 -tls1_2'
# Check for TLS Version 1.3 on mail.facl.xyz
alias otls1.3='openssl s_client -connect mail.facl.xyz:443 -tls1_3'
# Check for all versions of TLS on mail.facl.xyz
alias otlscheck='nmap --script ssl-enum-ciphers mail.facl.xyz'
############################
# USEFUL COMMANDS NO ALIAS #
############################
# COMMENT OUT SAME LINE IN MULTIPLE .CONF FILES AT ONCE USING THE FIND AND SED COMMAND.
# Find and replace a string in all files in current directory recursively, using a seperator (|) other than slash (/) for the sed command since slashes are being used for directory locations.
# In this example we comment out the line "ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot" in every .conf file (NOT RECURSIVELY) in the /etc/nginx/conf.d/ folder
# EX: sudo find . -name '*.conf' -exec sed -i.bak -e 's|ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot|#ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot|g' {} \;
# Search for and reveal what configurationfiles are using your old/static/unchangeable hostname on the raspberry pi 4
# grep -r old_hostname / 2>/dev/null
# Search folder recursively for all files with a specific string in a filename
# grep -r -l "filename-string-to-search" /path/to/search/*
# EX: sudo grep -r -l ".Spotlight-V100" /*
# Find out what processes are using what port (ex: port 80)
# EX-port80: netstat -tulpn | grep --color :80
# EX-port443: netstat -tulpn | grep --color :443
###########################
######## HOSTNAME #########
###########################
# Find all files that use the current hostname or original immutable hostname
alias hostnamefind='sudo grep -r $HOSTNAME / 2>/dev/null'
###########################
########### CRON ##########
###########################
# Get cron status
alias cronstat='systemctl status cron'
# View cron job history
alias cronhist='grep CRON /var/log/syslog && echo "Your cronjob history is printed above!" || echo "Your cronjob history could not be printed!"'
# check if cron is actually running anything at this moment in time
alias croncheck='pstree -apl `pidof cron`'
# View list of root user cronjobs
alias cronlistroot='sudo crontab -l'
# View list of regular user cronjobs
alias cronlist='crontab -l'
###########################
###### .bash_aliases ######
###########################
# Update your bash aliases file with this repo already installed
alias baud='/usr/bin/git -C $HOME/RP4-Ubuntu-Server-bash_aliases pull origin main && source $HOME/.bash_aliases'
###########################
## Raspberry Pi Hardware ##
###########################
# Check the "blocked/unblocked" status of network (Wi-Fi) interfaces with rfkill
alias wifistat='rfkill'
# Enable Wi-Fi on Raspberry Pi 4 with rfkill's software unblock (soft block)
alias wifion='sudo rfkill unblock wifi && echo "Your wifi (wlan0) has been enabled with rfkill." || echo "Your wifi (wlan0) could not be enabled with rfkill."'
# Disable Wi-Fi on Raspberry Pi 4 with rfkill's software block (soft block)
alias wifioff='sudo rfkill block wifi && echo "Your wifi (wlan0) has been disbled with rfkill." || echo "Your wifi (wlan0) could not be disabled with rfkill."'
###########################
######### BACKUPS #########
###########################
# piclone reminder command
alias piclone='echo "please use the piclone20, or piclone22 command to specify which version of Ubuntu you are cloning"'
# UBUNTU 20: Backup your entire Raspberry Pi into a cloned .IMG file
alias piclone20='sudo /usr/local/bin/remove-old-backups.sh; sudo /usr/local/bin/image-backup -u --initial /mnt/RpiDbBackups/Images-Daily/$(date +\%Y\-\%m\-\%d\_\%H\.\%M\.\%S)_mail.facl.xyz.UBUNTU_20_MANUAL_BACKUP.img && echo "SUCCESS! Your Raspberry Pi running Ubuntu 20.04 has been cloned to a disk image." || echo "BUMMER! Your Raspberry Pi running Ubuntu 20 Could Not be cloned. Please check hard drive space and try again."'
# UBUNTU 22:
alias piclone22='sudo /usr/local/bin/remove-old-backups.sh; sudo /usr/local/bin/image-backup -u --initial /mnt/RpiDbBackups/Images-Daily/$(date +\%Y\-\%m\-\%d\_\%H\.\%M\.\%S)_mail.facl.xyz.UBUNTU_22_MANUAL_BACKUP.img && echo "SUCCESS! Your Raspberry Pi running Ubuntu 22.04 has been cloned to a disk image." || echo "BUMMER! Your Raspberry Pi running Ubuntu 22 Could Not be cloned. Please check hard drive space and try again."'
# Backup your wordpress directories and MySql databases to disk
alias pibackup='sudo /usr/local/bin/remove-old-backups.sh; sudo /usr/local/bin/wp+sql_backup.sh && echo "SUCCESS! Your Wordpress directories and MySql Databases have been backed up." || echo "BUMMER! Your Wordpress Directories and MySql Databases could not be backed up."'
###########################
######### NEXTCLOUD #######
###########################
# Run the occ command as www-data php
alias occ='sudo -u www-data php occ'
###########################
######### UNBOUND #########
###########################
# Get Status of Unbound DNS resolver
alias ubstat='sudo systemctl status unbound.service && echo "Here is the status of Unbound." || echo "Unbound DNS could not check status. Check your syntax and try again."'
# Enable unbound DNS resolver
alias ubenable='sudo systemctl enable unbound.service && echo "Unbound DNS has been enabled." || echo "Unbound DNS could not be enabled. Check your syntax and try again."'
# Disable unbound DNS resolver
alias ubdisable='sudo systemctl enable unbound.service && echo "Unbound DNS has been disabled." || echo "Unbound DNS could not be disabled. Check your syntax and try again."'
# Start unbound DNS resolver
alias ubstart='sudo systemctl start unbound.service && echo "Unbound DNS has been started." || echo "Unbound DNS could not start. Check your syntax and try again."'
# Stop unbound DNS resolver
alias ubstop='sudo systemctl stop unbound.service && echo "Unbound DNS has been stopped." || echo "Unbound DNS could not stop. Check your syntax and try again."'
# Restart unbound DNS resolver
alias ubrl='sudo systemctl restart unbound.service && echo "Unbound DNS has been restarted." || echo "Unbound DNS could not be restarted. Is it running?"'
###########################
##### SYSTEMD-RESOLVED ####
###########################
# Get Status of systemd-resolved
alias sdrstat='sudo systemctl status systemd-resolved && echo "Here is the status of systemd-resolved." || echo "systemd-resolved could not check status. Check your syntax and try again."'
# Enable systemd-resolved
alias sdrenable='sudo systemctl enable systemd-resolved --now && echo "systemd-resolved has been enabled." || echo "systemd-resolved could not be enabled. Check your syntax and try again."'
# Disable systemd-resolved
alias sdrdisable='sudo systemctl disable systemd-resolved --now && echo "systemd-resolved has been disabled." || echo "systemd-resolved could not be disabled. Check your syntax and try again."'
# Start systemd-resolved
alias sdrstart='sudo systemctl start systemd-resolved --now && echo "systemd-resolved has been started." || echo "systemd-resolved could not start. Check your syntax and try again."'
# Stop systemd-resolved
alias sdrstop='sudo systemctl stop systemd-resolved --now && echo "systemd-resolved has been stopped." || echo "systemd-resolved could not stop. Check your syntax and try again."'
# Restart systemd-resolved
alias sdrrl='sudo systemctl restart systemd-resolved --now && echo "systemd-resolved has been restarted." || echo "systemd-resolved could not be restarted. Is it running?"'
###########################
###### LOG CHECKING #######
###########################
# AUTH
alias catauthlog='sudo cat /var/log/auth.log'
alias catkernlog='sudo cat /var/log/kern.log'
# MAIL LOG
# Mail log with tail and no -f (Default)
# Check the journal/logs of the main mail program located at /var/log/mail.log
alias maillog='sudo tail /var/log/mail.log'
alias mailerrlog='sudo tail /var/log/mail.err'
# Mail log with cat
alias catmaillog='sudo cat /var/log/mail.log'
alias catmailerrlog='sudo cat /var/log/mail.err'
# Mail Log with tail -f
alias tailmaillog='sudo tail -f /var/log/mail.log'
alias tailmailerrlog='sudo tail -f /var/log/mail.err'
# MODSECURITY
alias catmodseclog='sudo cat /var/log/modsec_audit.log'
alias catmodseclog2='sudo cat /var/log/modsec_audit.log.1'
# PHP-FMP
alias catfpmlog='sudo cat /var/log/php7.4-fpm.log'
alias catfpmslowlog='sudo cat /var/log/php-fpm/slow.log'
# SYSLOG
alias catsyslog='sudo cat /var/log/syslog'
# WIREGUARD VPN
alias catvpnlog='sudo cat /var/log/vpn_checking.log'
# FAIL2BAN
alias f2bcatlog='sudo cat /var/log/fail2ban.log'
# AMPLIFY
alias catamplifylog='sudo cat /var/log/amplify-agent/agent.log'
# CLAMAV
alias catclamavlog='sudo cat /var/log/clamav/clamav.log'
# DOVECOT
alias catdovecotlog='sudo cat /var/log/dovecot/dovecot.debug'
alias catdovecoterrlog='sudo cat /var/log/dovecot/dovecot.err'
# LETSENCRYPT
alias catletsencryptlog='sudo cat /var/log/letsencrypt/letsencrypt.log'
# MYSQL
alias catmysqllog='sudo cat /var/log/mysql/error.log'
alias catmysqlslowlog='sudo cat /var/log/mysql/mariadb-slow.log'
# NETDATA
alias catnetdataaccesslog='sudo cat /var/log/netdata/access.log'
alias catnetdataerrlog='sudo cat /var/log/netdata/error.log'
alias catnetdatacollectorlog='sudo cat /var/log/netdata/collector.log'
alias catnetdatahealthlog='sudo cat /var/log/netdata/health.log'
# NGINX
alias catnginxaccesslog='sudo cat /var/log/nginx/access.log'
alias catnginxerrlog='sudo cat /var/log/nginx/error.log'
alias catnginxdanranlog='sudo cat /var/log/nginx/danran.rocks.error.log'
alias catnginxcakelog='sudo cat /var/log/nginx/oddcake.net.error.log'
alias catnginxmolog='sudo cat /var/log/nginx/mcmo.is.error.log'
alias catnginxmolog='sudo cat /var/log/nginx/mcmo.is.error.log'
alias catnginxpmalog='sudo cat /var/log/nginx/phpmyadmin.error.log'
alias catnginxwebminlog='sudo cat /var/log/nginx/webmin.error.log'
# REDIS
alias catredislog='sudo cat /var/log/redis/redis-server.log'
# WORDPRESS
alias catwpmo='sudo cat /var/log/wordpress/mcmo.is.error.log'
alias catwpcake='sudo cat /var/log/wordpress/oddcake.net.error.log'
alias catwpdanran='sudo cat /var/log/wordpress/danran.rocks.error.log'
###########################
# REAL-TIME LOG CHECKING ##
###########################
# AUTH
alias tailauthlog='sudo tail -f /var/log/auth.log'
alias tailkernlog='sudo tail -f /var/log/kern.log'
# MODSECURITY
alias tailmodseclog='sudo tail -f /var/log/modsec_audit.log'
alias tailmodseclog2='sudo tail -f /var/log/modsec_audit.log.1'
# PHP-FMP
alias tailfpmlog='sudo tail -f /var/log/php7.4-fpm.log'
alias tailfpmslowlog='sudo tail -f /var/log/php-fpm/slow.log'
# SYSLOG
alias tailsyslog='sudo tail -f /var/log/syslog'
# WIREGUARD VPN
alias tailvpnlog='sudo tail -f /var/log/vpn_checking.log'
# FAIL2BAN
alias f2btaillog='sudo tail -f /var/log/fail2ban.log'
# AMPLIFY
alias tailamplifylog='sudo tail -f /var/log/amplify-agent/agent.log'
# CLAMAV
alias tailclamavlog='sudo tail -f /var/log/clamav/clamav.log'
# DOVECOT
alias taildovecotlog='sudo tail -f /var/log/dovecot/dovecot.debug'
alias taildovecoterrlog='sudo tail -f /var/log/dovecot/dovecot.err'
# LETSENCRYPT
alias tailletsencryptlog='sudo tail -f /var/log/letsencrypt/letsencrypt.log'
# MYSQL
alias tailmysqllog='sudo tail -f /var/log/mysql/error.log'
alias tailmysqlslowlog='sudo tail -f /var/log/mysql/mariadb-slow.log'
# NETDATA
alias tailnetdataaccesslog='sudo tail -f /var/log/netdata/access.log'
alias tailnetdataerrlog='sudo tail -f /var/log/netdata/error.log'
alias tailnetdatacollectorlog='sudo tail -f /var/log/netdata/collector.log'
alias tailnetdatahealthlog='sudo tail -f /var/log/netdata/health.log'
# NGINX
alias tailnginxaccesslog='sudo tail -f /var/log/nginx/access.log'
alias tailnginxerrlog='sudo tail -f /var/log/nginx/error.log'
alias tailnginxdanranlog='sudo tail -f /var/log/nginx/danran.rocks.error.log'
alias tailnginxcakelog='sudo tail -f /var/log/nginx/oddcake.net.error.log'
alias tailnginxmolog='sudo tail -f /var/log/nginx/mcmo.is.error.log'
alias tailnginxmolog='sudo tail -f /var/log/nginx/mcmo.is.error.log'
alias tailnginxpmalog='sudo tail -f /var/log/nginx/phpmyadmin.error.log'
alias tailnginxwebminlog='sudo tail -f /var/log/nginx/webmin.error.log'
# REDIS
alias tailredislog='sudo tail -f /var/log/redis/redis-server.log'
# WORDPRESS
alias tailwpmo='sudo tail -f /var/log/wordpress/mcmo.is.error.log'
alias tailwpcake='sudo tail -f /var/log/wordpress/oddcake.net.error.log'
alias tailwpdanran='sudo tail -f /var/log/wordpress/danran.rocks.error.log'
###########################
####### LOG ROTATE ########
###########################
# Test the logrotate config file by doing a dry run. lrtest stands for log-rotate-test.
alias lrtest='sudo logrotate /etc/logrotate.conf --debug'
###########################
######### SYSTEMCTL #######
###########################
# List all currently running services
alias serviceslist='systemctl --type=service'
###########################
########### ROOT ##########
###########################
# Get lock status of root account
alias rootstat='sudo passwd -S root'
# Password LOCK ROOT account using usermod
alias rootlock='sudo usermod -L root && sudo passwd -S root'
# Password LOCK ROOT account using passwd
alias rootlock2='sudo passwd -l root && sudo passwd -S root'
# Password UNLOCK ROOT account using usermod
alias rootunlock='sudo usermod -U root && sudo passwd -S root'
# Password UNLOCK ROOT account using passwd
alias rootunlock2='sudo passwd -u root && sudo passwd -S root'
# DISABLE ROOT account using usermod
alias rootblock="sudo usermod -p '!' root && sudo passwd -S root"
# DISABLE ROOT account using passwd
alias rootdblock2='sudo passwd -dl root && sudo passwd -S root'
# ENABLE ROOT account using passwd
alias rootunblock='sudo passwd root && sudo passwd -S root'
###########################
######### UBUNTU ##########
###########################
# Get lock status of Ubuntu account
alias ubuntustat='sudo passwd -S ubuntu'
# Password LOCK UBUNTU account using usermod
alias ubuntulock='sudo usermod -L ubuntu && sudo passwd -S ubuntu'
# Password LOCK UBUNTU account using passwd
alias ubuntulock2='sudo passwd -l ubuntu && sudo passwd -S ubuntu'
# Password UNLOCK ROOT account using usermod
alias ubuntuunlock='sudo usermod -U ubuntu && sudo passwd -S ubuntu'
# Password UNLOCK ROOT account using passwd
alias ubuntuunlock2='sudo passwd -u ubuntu && sudo passwd -S ubuntu'
# DISABLE ROOT account using usermod
alias ubuntudisable="sudo usermod -p '!' ubuntu && sudo passwd -S ubuntu"
# DISABLE ROOT account using passwd
alias ubuntudisable2='sudo passwd -dl ubuntu && sudo passwd -S ubuntu'
# ENABLE ROOT account using passwd
alias ubuntuenable='sudo passwd ubuntu && sudo passwd -S ubuntu'
###########################
########### MAIL ##########
###########################
# Open "Mail Whitelists" files to add to whitelists (ignore postscreen whitelists and blacklists). Then rebuild the postmap override whitelist database.
#alias mwl='sudo nano /etc/postfix/rbl_override /etc/postfix/helo_access /etc/spamassassin/local.cf /etc/postgrey/whitelist_clients ; sudo postmap /etc/postfix/rbl_override ; sudo postmap /etc/postfix/helo_access'
alias mwl='sudo nano /etc/opendmarc/ignore.hosts /etc/postfix/rbl_override /etc/postfix/helo_access /etc/spamassassin/local.cf /etc/postgrey/whitelist_clients ; sudo postmap /etc/postfix/rbl_override ; sudo postmap /etc/postfix/helo_access ; sudo spamassassin --lint && sudo systemctl restart spamassassin ; sudo systemctl restart amavis ; sudo systemctl restart postgrey ; sudo systemctl restart opendmarc'
# Open "Mail IP Whitelists" files to add IP addresses to mail whitelists
alias mwlip='sudo nano /etc/postfix/postscreen_access.cidr'
# Mail test TLSv1
alias mttls1='openssl s_client -starttls smtp -crlf -connect localhost:587 -tls1'
# Mail test TLSv1.1
alias mttls1.1='openssl s_client -starttls smtp -crlf -connect localhost:587 -tls1_1'
# Mail test TLSv1.2
alias mttls1.2='openssl s_client -starttls smtp -crlf -connect localhost:587 -tls1_2'
# Mail test TLSv1.3
alias mttls1.3='openssl s_client -starttls smtp -crlf -connect localhost:587 -tls1_3'
###########################
######## SPF RECORDS ######
###########################
# Check if SPF record for mcmo.is is propagated to the internet
alias spftestmo='dig mcmo.is txt'
# Check if SPF record for oddcake.net is propagated to the internet
alias spftestcake='dig oddcake.net txt'
# Check if SPF record for danran.rocks is propagated to the internet
alias spftestdanran='dig danran.rocks txt'
# Check if SPF record for facl.xyz is propagated to the internet
alias spftestfacl='dig facl.xyz txt'
##################################
# SPAM ASSASSIN / SPAMASS-MILTER #
##################################
# Check status of spamassassin
alias sastat='sudo systemctl status spamassassin spamass-milter'
# Enable Spamassassin
alias saenable='sudo systemctl enable spamassassin spamass-milter'
# Disable spamassassin
alias sadisable='sudo systemctl disable spamassasin spamass-milter'
# Start spamassassin
alias sastart='sudo systemctl start spamassassin spamass-milter'
# Stop spamassassin
alias sastop='sudo systemctl stop spamassassin spamass-milter'
# Reload spamassassin
alias sarl='sudo systemctl restart spamassassin spamass-milter'
# Check syntax of spamassassin local.cf file.
alias satestroot='sudo spamassassin --lint'
alias satestroot2='sudo spamassassin --lint -D'
alias satest='spamassassin --lint'
alias satest2='spamassassin --lint -D'
# Change spamassassin reject score
# Note, you need to find the following line 'OPTIONS="${OPTIONS} -r 8"' and change the 8 to the desired reject score.
alias sascore='sudo nano /etc/default/spamass-milter'
# Adjust spamassassin whitelist and blacklist
alias sawl='sudo nano /etc/spamassassin/local.cf'
# After adding custom rules, close the file and run the following command to check syntax. Silent output means theres no syntax error.
alias sacheck='sudo spamassassin --lint'
###########################
########### PHP ###########
###########################
###########################
######### NEXTCLOUD #######
###########################
# Shorten nexcloud's cli "occ" command to just "occ"
alias occ='sudo -u www-data php occ'
###########################
######### OPENDKIM ########
###########################
# Quick acess to opendkim journal logs
alias dklog='sudo journalctl -eu opendkim'
# Restart OpenDKIM
alias dkrl='sudo systemctl restart opendkim && echo "OpenDKIM restarted! Success!" || echo "Syntax error, OpenDKIM did not restart"'
# Check status of OpenDKIM
alias dkstat='sudo systemctl status opendkim && echo "Just above is the status of OpenDKIM!" || echo "Syntax error, cannot get status of OpenDKIM"'
# Test DKIM key for www.mcmo.is
alias dktestmo='sudo opendkim-testkey -d mcmo.is -s default -vvv && echo "Here are the results of your DKIM Key test for mcmo.is" || echo "We could not test your DKIM key for mcmo.is"'
# Test DKIM key for oddcake.net
alias dktestcake='sudo opendkim-testkey -d oddcake.net -s default -vvv && echo "Here are the results of your DKIM Key test for oddcake.net" || echo "We could not test your DKIM key for oddcake.net"'
# Test DKIM key for danran.rocks
alias dktestdanran='sudo opendkim-testkey -d danran.rocks -s default -vvv && echo "Here are the results of your DKIM Key test for danran.rocks" || echo "We could not test your DKIM key for danran.rocks"'
# Test DKIM Key for facl.xyz
alias dktestfacl='sudo opendkim-testkey -d facl.xyz -s default -vvv && echo "Here are the results of your DMIM Key test for facl.xyz" || echo "We could not test your DKIM key for facl.xyz"'
###########################
######### NETDATA #########
###########################
# Netdata get status
alias ndstat='sudo service netdata status'
# Netdata restart
alias ndrl='sudo service netdata restart'
###########################
######### DOVECOT #########
###########################
# Dovecot Version
alias dcv='dovecot --version && echo "This is your version of Dovecot ^^^^" || echo "We could not get your Dovecot version number"'
# List available password schemes (dcpsl=dovecot,password,schemes,list)
alias dcpsl='sudo doveadm pw -l && echo "These are the available password shemes in dovecot." || echo "We could not get available password shemes in dovecot. Check your syntax and try again."'
# verify the current setting for dovecot dh (diffie hellman) parameters (i.e. show location of dovecot diffie-hellman file)
alias dcdh='doveconf -S | grep "^ssl_dh"'
# Check size of Dovecot diffie hellman file
alias dcdhs='openssl dhparam -in /usr/share/dovecot/dh.pem -text -noout'
# Check the dovecot config files for errors
alias dovechk='sudo doveconf >/dev/null && echo OK'
###########################
###### OCSP STAPLING ######
###########################
# Test OCSP Stapling on mcmo.is
alias ocsptestmo="echo QUIT | openssl s_client -connect www.mcmo.is:443 -status 2> /dev/null | grep -A 17 'OCSP response:' | grep -B 17 'Next Update'"
# Test OCSP Stapling on danran.rocks
alias ocsptestdanran="echo QUIT | openssl s_client -connect danran.rocks:443 -status 2> /dev/null | grep -A 17 'OCSP response:' | grep -B 17 'Next Update'"
# Test OCSP Stapling on oddcake.net
alias ocsptestcake="echo QUIT | openssl s_client -connect oddcake.net:443 -status 2> /dev/null | grep -A 17 'OCSP response:' | grep -B 17 'Next Update'"
###########################
########### DNS ###########
###########################
# Quickly determine DNS RESOLVER you are using.
alias dns='systemd-resolve --status | grep "DNS Servers" -A2'
alias dns2="systemd-resolve --status | grep 'DNS Servers' -A2"
alias dns3='sudo resolvectl dns $iface'
# View your current DNS Cache Size & Other info
alias dnscache='sudo systemd-resolve --statistics'
# Flush DNS Cache
alias dnsflush='sudo resolvectl flush-caches && echo "DNS Cache has been flushed" || echo "Oops! We Could NOT flush the DNS Cache"'
# Flush DNS Cache Using DNS-CLEAN
alias dnsclean='sudo /etc/init.d/dns-clean start && echo "DNS Cache has been cleaned" || echo "Oops! DNS Cache COULD NOT BE CLEANED!"'
###########################
########## DISKS ##########
###########################
# Check Free space
alias space='df -H /dev/sda2 && echo "Free space statistics are above" || echo "Cannot get free space statistics. Check your syntax."'
###########################
######## PHP-FPM ##########
###########################
### FPM-7.4
# Status php7.4-fpm
alias fpm7stat='sudo service php7.4-fpm status'
# Start php7.4-fpm
alias fpm7start='sudo systemctl start php7.4-fpm.service && echo "sudo systemctl start php7.4-fpm.service command worked, FPM started Correctly" || echo "Syntax Error, fpm7.4 did not start correctly"'
# Stop php7.4-fpm
alias fpm7stop='sudo systemctl stop php7.4-fpm.service && echo "sudo systemctl stop php7.4-fpm.service command worked, FPM stopped Correctly" || echo "Syntax Error, fpm7.4 did not stop correctly"'
# Restart php7.4-fpm
alias fpm7rl='sudo systemctl restart php7.4-fpm.service && echo "sudo systemctl restart php7.4-fpm.service command worked, FPM restarted Correctly" || echo "Syntax Error, fpm7.4 did not restart correctly"'
# Enable php7.4-fpm
alias fpm7enable='sudo systemctl enable php7.4-fpm.service && echo "sudo systemctl enable php7.4-fpm.service command worked, FPM enabled correctly" || echo "Syntax Error, fpm7.4 was not enabled correctly"'
# Disable php7.4-fpm
alias fpm7disable='sudo systemctl disable php7.4-fpm.service && echo "sudo systemctl disable php7.4-fpm.service command worked, FPM disabled correctly" || echo "Syntax Error, fpm7.4 was not disabled correctly"'
### FPM-8.1
# Status php8.1-fpm
alias fpm8stat='sudo service php8.1-fpm status'
# Start php8.1-fpm
alias fpm8start='sudo systemctl start php8.1-fpm.service && echo "sudo systemctl start php8.1-fpm.service command worked, FPM started Correctly" || echo "Syntax Error, php8.1-fpm did not start correctly"'
# Stop php8.1-fpm
alias fpm8stop='sudo systemctl stop php8.1-fpm.service && echo "sudo systemctl stop php8.1-fpm.service command worked, FPM stopped correctly" || echo "Syntax Error, php8.1-fpm did not stop correctly"'
# Restart php8.1-fpm
alias fpm8rl='sudo systemctl restart php8.1-fpm.service && echo "sudo systemctl restart php8.1-fpm.service command worked, FPM restarted Correctly" || echo "Syntax Error, php8.1-fpm did not restart correctly"'
# Enable php8.1-fpm
alias fpm8enable='sudo systemctl enable php8.1-fpm.service && echo "sudo systemctl enable php8.1-fpm.service command worked, FPM enabled correctly" || echo "Syntax Error, fpm8.1 was not enabled correctly"'
# Disable php8.1-fpm
alias fpm8disable='sudo systemctl disable php8.1-fpm.service && echo "sudo systemctl disable php8.1-fpm.service command worked, FPM disabled correctly" || echo "Syntax Error, fpm8.1 was not disabled correctly"'
###########################
##### SERVICE RESTART #####
###########################
# Restart sshd service
alias sshrl='sudo systemctl restart sshd.service && echo "sudo systemctl restart sshd.service command worked, SSHD reloaded Correctly" || echo "Syntax Error, sshd did not reload correctly"'
# Reload mysql
alias sqlrl='sudo service mysql reload && echo "mysql reloaded Correctly" || echo "Syntax Error, mysql did not reload correctly"'
# Reload Nginx
alias nrl='sudo service nginx reload && echo "Nginx reloaded correctly" || echo "Syntax Error, Nginx not reloaded correctly"'
# Reload mariadb-server
alias mrl='sudo systemctl restart mariadb && echo "Mariadb-server restarted correctly! YAY!" || echo "Mariadb-server didnt restart correctly FUCK!!!"'
# Reload mariadb-client
#alias mcrl='sudo systemctl restart mariadb && echo "Mariadb-client restarted correctly! YAY!" || echo "Mariadb-client didnt restart correctly FUCK!!!"'
###########################
###### SERVICE STOP #######
###########################
# Stop sshd service
alias sshstop='sudo systemctl stop sshd.service && echo "sudo systemctl stop sshd.service command worked, SSHD stopped Correctly" || echo "Syntax Error, sshd did not stop correctly"'
# Stop Mysql
alias sqlstop='sudo service mysql stop && echo "mysql stopped correctly" || echo "syntax Error, mysql did not stop correctly"'
# Stop Nginx
alias nstop='sudo service nginx stop && echo "nginx stopped correctly" || echo "syntax Error, Nginx not stop correctly"'
###########################
###### SERVICE START ######
###########################
# start sshd service
alias sshstart='sudo systemctl start sshd.service && echo "sudo systemctl start sshd.service command worked, SSHD startped Correctly" || echo "Syntax Error, sshd did not start correctly"'
# start Mysql
alias sqlstart='sudo service mysql start && echo "mysql startped correctly" || echo "syntax Error, mysql did not start correctly"'
# start Nginx
alias nstart='sudo service nginx start && echo "nginx started correctly" || echo "syntax Error, Nginx did not start correctly"'
###########################
##### SERVICE STATUS ######
###########################
# Show dovecot status
alias dcstat='sudo service dovecot status'
# show nginx status
alias nstat='sudo service nginx status'
# show mariadb status
alias sqlstat='sudo service mysql status'
###########################
###### AVAHI DAEMON #######
###########################
# Enable avahi-daemon on boot
alias adenable='sudo systemctl enable avahi-daemon && echo "sudo systemctl enable avahi-daemon command worked. Avahi-daemon will be ENABLED at boot" || echo "Syntax error. We couldnt enable avahi-daemon at boot. Please check your syntax for errors and try again."'
# Disable avahi-daemon on boot
alias addisable='sudo systemctl disable avahi-daemon && echo "Congrats! sudo systemctl disable avahi-daemon command worked. Avahi-daemon is now DISABLED at boot" || echo "Syntax error. We couldnt disable avahi-daemon at boot. Please check your syntax for errors and try again."'
# Start avahi-daemon
alias adstart='sudo service avahi-daemon start && echo "Congrats! Avahi-daemon STARTED successfully." || echo "Syntax error!!! We couldnt start the avahi-daemon. Please check your syntax for errors and try again."'
# Stop avahi-daemon
#alias adstop='sudo service avahi-daemon stop && echo "Congrats! Avahi-daemon STOPPED successfully." || echo "Syntax error!!! We couldnt start the avahi-daemon. Please check your syntax for errors and try again."'
# Restart avahi-daemon
alias adrl='sudo service avahi-daemon restart && echo "Congrats! Avahi-daemon RESTARTED successfully." || echo "Syntax error. We couldnt restart the avahi-daemon. Please check your syntax for errors and try again."'
# Check avahi-daemos status
alias adstat='sudo service avahi-daemon status && echo "Congrats! Avahi-daemon status checked successfully." || echo "Syntax error. We couldnt check the status of the avahi-daemon. Please check your syntax for errors and try again."'
# Edit avahi configuration file
alias adconf='sudo nano -c /etc/avahi/avahi-daemon.conf'
###########################
##### WIREGUARD CLIENT ####
###########################
# Check VultrWireguard client logs
alias wgclog='sudo journalctl -eu wg-quick@wg-client0 && echo "Your wireguard client logs are here ^^^^^^^^ " || echo "Syntax error. We could not get the logs of your wireguard client. Check your syntax and try again."'
# Check Wireguard client debug logs
#alias wgclog2-'eval "sudo journalctl -kf | grep wireguard"'
#alias wgclog3='eval "sudo dmesg -wH | grep wireguard"'
# Start VultrWireguard Tunnel
alias wgcstart='sudo systemctl start wg-quick@wg-client0.service && echo "sudo systemctl start wg-quick@wg-client0.service was successfully run. Wireguard Client Service is now running." || echo "Syntax error. We could not start the Wireguard client. Check your syntax and try again."'
# Stop VultrWireguard Tunnel
alias wgcstop='sudo systemctl stop wg-quick@wg-client0.service && echo "sudo systemctl stop wg-quick@wg-client0.service was successfully run. Wireguard Client Service has stopped running." || echo "Syntax error. We could not stop the Wireguard client. Check your syntax and try again."'
# Start VultrWireguard Tunnel
alias wgcrl='sudo systemctl restart wg-quick@wg-client0.service && echo "sudo systemctl restart wg-quick@wg-client0.service was successfully run. The Wireguard Client Service has been restarted." || echo "We could not restart the Wireguard client. Check your syntax and try again."'
# Enable VultrWireguard Tunnel on Boot
alias wgcenable='sudo systemctl enable wg-quick@wg-client0.service && echo "sudo systemctl enable wg-quick@wg-client0.service was successfully run. Wireguard Client Service is now enabled at boot." || echo "Syntax error. We could disable the wireguard client on boot. Check your syntax and try again."'
# Disable VultrWireguard Tunnel on Boot
alias wgcdisable='sudo systemctl disable wg-quick@wg-client0.service && echo "sudo systemctl disable wg-quick@wg-client0.service was successfully run. Wireguard Client Service is now disabled on boot." || echo "Syntax error. We could not disable the wireguard client on boot. Please check your synta and try again."'
# Get Status of VultrWireguard Tunnel
alias wgcstat='sudo systemctl status wg-quick@wg-client0.service && echo "Here is the status of your Wireguard Client" || echo "Could not get the status of your Wireguard Client. Check your syntax and try again."'
###########################
#### WIREGUARD SERVER #####
###########################
# Check VultrWireguard server logs
alias wgslog='sudo journalctl -eu wg-quick@wg0 && echo "Your wireguard server logs are here" || echo "Syntax error. We could not get the logs of your wireguard server. Check your syntax and try again."'
# Check VultrWireguard server debug logs
alias wgslog2="eval 'sudo journalctl -kf | grep wireguard'"
alias wgslog3='eval "sudo dmesg -wH | grep wireguard"'
# Start VultrWireguard Tunnel
alias wgsstart='sudo systemctl start wg-quick@wg0.service && echo "sudo systemctl start wg-quick@wg0.service was successfully run. Wireguard Server Service is now running." || echo "Syntax error. We could not start the Wireguard Server. Check your syntax and try again."'
# Stop VultrWireguard Tunnel
alias wgsstop='sudo systemctl stop wg-quick@wg0.service && echo "sudo systemctl stop wg-quick@wg0.service was successfully run. Wireguard Server Service has stopped running." || echo "Syntax error. We could not stop the Wireguard Server. Check your syntax and try again."'
# Reload VultrWireguard Server
alias wgsrl='sudo systemctl restart wg-quick@wg0.service && echo "sudo systemctl restart wg-quick@wg0.service was successfully run. Wireguard Server Service has been restarted." || echo "Syntax error. We could not restart the Wireguard Server. Check your syntax and try again."'
# Enable VultrWireguard Tunnel on Boot
alias wgsenable='sudo systemctl enable wg-quick@wg0.service && echo "sudo systemctl enable wg-quick@wg0.service was successfully run. Wireguard Server Service is now enabled at boot." || echo "Syntax error. We could disable the wireguard Server on boot. Check your syntax and try again."'
# Disable VultrWireguard Tunnel on Boot
alias wgsdisable='sudo systemctl disable wg-quick@wg0.service && echo "sudo systemctl disable wg-quick@wg0.service was successfully run. Wireguard Server Service is now disabled on boot." || echo "Syntax error. We could not disable the wireguard Server on boot. Please check your synta and try again."'
# Get Status of VultrWireguard Tunnel
alias wgsstat='sudo systemctl status wg-quick@wg0.service && echo "Here is the status of your Wireguard Server" || echo "Could not get the status of your Wireguard Server. Check your syntax and try again."'
###########################
########## DISKS ##########
###########################
# List all partitions by UUID
alias uuid='ls -l /dev/disk/by-uuid'
# List all partitions using blkid
alias blkid='sudo blkid'
##############################################
## WORDPRESS VULNERABILITY SCANNER (WPScan) ##
##############################################
# wpscan update
alias wpsupdate='sudo wpscan --update'
# Scan Installed Plugins
alias wpscakeplugins='sudo wpscan --url https://oddcake.net --enumerate p'
alias wpsmoplugins='sudo wpscan --url https://mcmo.is --enumerate p'
alias wpsdanranplugins='sudo wpscan --url https://danran.rocks --enumerate p'
# Scan vulnerable plugins
alias wpscakevvplugins='sudo wpscan --url https://oddcake.net --enumerate vp'
alias wpsmovplugins='sudo wpscan --url https://mcmo.is --enumerate vp'
alias wpsdanranvplugins='sudo wpscan --url https://danran.rocks --enumerate vp'
# Scan Installed Themes
alias wpscakethemes='sudo wpscan --url https://oddcake.net --enumerate t'
alias wpsmotthemes='sudo wpscan --url https://mcmo.is --enumerate t'
alias wpsdanranthemes='sudo wpscan --url https://danran.rocks --enumerate t'
# Scan vulnerable themes
alias wpscakevtthemes='sudo wpscan --url https://oddcake.net --enumerate vt'
alias wpsmovthemes='sudo wpscan --url https://mcmo.is --enumerate vt'
alias wpsdanranvthemes='sudo wpscan --url https://danran.rocks --enumerate vt'
# Scan user accounts
alias wpscakeusers='sudo wpscan --url https://oddcake.net --enumerate u'
alias wpsmousers='sudo wpscan --url https://mcmo.is --enumerate u'
alias wpsdanranusers='sudo wpscan --url https://danran.rocks --enumerate u'
# Scan vulnerable timthumb files
alias wpscakett='sudo wpscan --url https://oddcake.net --enumerate tt'
alias wpsmott='sudo wpscan --url https://mcmo.is --enumerate tt'
alias wpsdanrantt='sudo wpscan --url https://danran.rocks --enumerate tt'
###########################
###### WORDPRESS CLI ######
###########################
# make sure the "wp" command is run by the www-data user
alias wp='sudo -u www-data wp'
# Properly update worpress cli with the proper update user ($USER:$USER), run update, then change "wp" back to www-data user/group.
alias wpcliupdate='sudo chown $USER:$USER /usr/local/bin/wp && sudo wp cli update && sudo chown www-data:www-data /usr/local/bin/wp'
# Regenerate missing thumbnails using wordpress cli
alias wpcliregen='wp media regenerate --only-missing'
###########################
########### UFW ###########
###########################
# Get status of UFW
alias ustat='sudo service ufw status'
# Get list of rules from UFW.
alias urules='sudo ufw status'
# Get list of commands fro UFW
alias ulist='sudo ufw list'
###########################
######## DEBUGGING ########
###########################
# Test if modsecurity is working on all three websites (mcmo.is, Danran.rocks, oddcake.net)
alias modsectestmo="curl 'https://www.mcmo.is/?foo=/etc/passwd&bar=/bin/sh'"
alias modsectestdanran="curl 'https://danran.rocks/?foo=/etc/passwd&bar=/bin/sh'"
alias modsectestcake="curl 'https://oddcake.net/?foo=/etc/passwd&bar=/bin/sh'"
# List dovecot listening ports
alias dports='sudo ss -lnpt | grep dovecot && echo "Dovecot is listening on the above ports" || echo "Dovecot listening ports command failed. Check syntax and try again"'
# List dovecot users
alias dusers="sudo doveadm user '*'"
# Dovecot journal
alias dovjourn='sudo journalctl -eu dovecot'
# Check what is listening on which ports by running netstat
alias ns='netstat -tapn'
###########################
###### GENERAL LOGS #######
###########################
# Check the journal/logs of Nginx
alias nlog='sudo journalctl -eu nginx'
# Check the journal/logs of clamav-freshclam
alias clamlog='sudo journalctl -eu clamav-freshclam'
# Tail modsec log
alias tailmodsec='sudo tail -f /var/log/modsec_audit.log /var/log/modsec_audit.log.1'
# Cat modseclog
alias catmodsec='sudo cat /var/log/modsec_audit.log'
# View recent journal
alias journal='journalctl -xe'
# View recent journal with less
alias journalall='journalctl -xe | less'
# Show the date and time of most recent shutdown
alias shutdownlog='last -x shutdown'
alias shutdownlog2='last -5 shutdown $USER'
###########################
##### Nginx Pagespeed #####
###########################
# Test pagespeed
alias pscake='curl -I -p https://www.oddcake.net'
alias psmo='curl -I -p https://www.mcmo.is'
alias psdanran='curl -I -p https://www.danran.rocks'
# Flush/Purge pagespeed cache
alias psflushall='sudo touch /var/www/cache/pagespeed_cache/mcmo.is/cache.flush ; sudo touch /var/www/cache/pagespeed_cache/oddcake.net/cache.flush ;sudo touch /var/www/cache/pagespeed_cache/danran.rocks/cache.flush'
alias psflushmo='sudo touch /var/www/cache/pagespeed_cache/mcmo.is/cache.flush'
alias psflushcake='sudo touch /var/www/cache/pagespeed_cache/oddcake.net/cache.flush'
alias psflushdanran='sudo touch /var/www/cache/pagespeed_cache/danran.rocks/cache.flush'
###########################
###### Nginx Fastcgi ######
###########################
# Test fastcgi
alias fcgicake='curl -I https://www.oddcake.net'
alias fcgimo='curl -I https://www.mcmo.is'
alias fcgidanran='curl -I https://www.danran.rocks'
# Flush/Purge All Fastcgi Cache
alias fcgiflushall='sudo rm -Rf /var/www/cache/fastcgi_cache/danran.rocks/ ; sudo rm -Rf /var/www/cache/fastcgi_cache/oddcake.net/ ; sudo rm -Rf /var/cache/www/fastcgi_cache/mcmo.is/ && sudo service nginx restart && echo "FastCGI Cache has been flushed for all websites" || echo "FastCGI Cache Could not be flushed for all sites"'
# Flush/Purge danran.rocks Fastcgi Cache
alias fcgiflushdanran='sudo rm -Rf /var/www/cache/fastcgi_cache/danran.rocks/ && sudo service nginx restart && echo "FastCGI Cache has been flushed for danran.rocks" || echo "FastCGI Cache Could not be flushed for danran.rocks"'
# Flush/Purge oddcake.net Fastcgi Cache
alias fcgiflushcake='sudo rm -Rf /var/www/cache/fastcgi_cache/oddcake.net/ && sudo service nginx restart && echo "FastCGI Cache has been flushed for oddcake.net" || echo "FastCGI Cache Could not be flushed for oddcake.net"'
# Flush/Purge mcmo.is Fastcgi Cache
alias fcgiflushmo='sudo rm -Rf /var/www/cache/fastcgi_cache/mcmo.is/ && sudo service nginx restart && echo "FastCGI Cache has been flushed for mcmo.is" || echo "FastCGI Cache Could not be flushed for mcmo.is"'
### FASTCGI CACHING ON/OFF
# Turn FastCGI Caching on for McMo.is
alias fcgimoon='sudo sed -i "s|fastcgi_cache off;|#fastcgi_cache off;|g" /etc/nginx/sites-available/03-mcmo.is.conf && sudo sed -i "s|#fastcgi_cache mcmo.is;|fastcgi_cache mcmo.is;|g" /etc/nginx/sites-available/03-mcmo.is.conf && sudo service nginx restart && echo "FastCGI for McMo.is is now on and Nginx has been reloaded." || echo "Fastcgi was NOT turned on for McMo.is. Nginx probably was not reloaded. Maybe it is already on? Check your syntax and try again"'
# Turn FastCGI Caching off for McMo.is
alias fcgimooff='sudo sed -i "s|#fastcgi_cache off;|fastcgi_cache off;|g" /etc/nginx/sites-available/03-mcmo.is.conf && sudo sed -i "s|fastcgi_cache mcmo.is;|#fastcgi_cache mcmo.is;|g" /etc/nginx/sites-available/03-mcmo.is.conf && sudo service nginx restart && echo "FastCGI for McMo.is is now off and Nginx has been reloaded." || echo "Fastcgi was NOT turned off for McMo.is. Nginx probably was not reloaded. Maybe it is already off? Check your syntax and try again"'
# Turn FastCGI Caching on for oddcake.net
alias fcgicakeon='sudo sed -i "s|fastcgi_cache off;|#fastcgi_cache off;|g" /etc/nginx/sites-available/01-oddcake.net.conf && sudo sed -i "s|#fastcgi_cache oddcake.net;|fastcgi_cache oddcake.net;|g" /etc/nginx/sites-available/01-oddcake.net.conf && sudo service nginx restart && echo "FastCGI for oddcake.net is now on and Nginx has been reloaded." || echo "Fastcgi was NOT turned on for oddcake.net. Nginx probably was not reloaded. Maybe it is already on? Check your syntax and try again"'
# Turn FastCGI Caching off for oddcake.net
alias fcgicakeoff='sudo sed -i "s|#fastcgi_cache off;|fastcgi_cache off;|g" /etc/nginx/sites-available/01-oddcake.net.conf && sudo sed -i "s|fastcgi_cache oddcake.net;|#fastcgi_cache oddcake.net;|g" /etc/nginx/sites-available/01-oddcake.net.conf && sudo service nginx restart && echo "FastCGI for oddcake.net is now off and Nginx has been reloaded." || echo "Fastcgi was NOT turned off for oddcake.net. Nginx probably was not reloaded. Maybe it is already off? Check your syntax and try again"'
# Turn FastCGI Caching on for danran.rocks
alias fcgidanranon='sudo sed -i "s|fastcgi_cache off;|#fastcgi_cache off;|g" /etc/nginx/sites-available/02-danran.rocks.conf && sudo sed -i "s|#fastcgi_cache danran.rocks;|fastcgi_cache danran.rocks;|g" /etc/nginx/sites-available/02-danran.rocks.conf && sudo service nginx restart && echo "FastCGI for danran.rocks is now on and Nginx has been reloaded." || echo "Fastcgi was NOT turned on for danran.rocks. Nginx probably was not reloaded. Maybe it is already on? Check your syntax and try again"'
# Turn FastCGI Caching off for danran.rocks
alias fcgidanranoff='sudo sed -i "s|#fastcgi_cache off;|fastcgi_cache off;|g" /etc/nginx/sites-available/02-danran.rocks.conf && sudo sed -i "s|fastcgi_cache danran.rocks;|#fastcgi_cache danran.rocks;|g" /etc/nginx/sites-available/02-danran.rocks.conf && sudo service nginx restart && echo "FastCGI for danran.rocks is now off and Nginx has been reloaded." || echo "Fastcgi was NOT turned off for danran.rocks. Nginx probably was not reloaded. Maybe it is already off? Check your syntax and try again"'
### FASTCGI CACHING BYPASS ON/OFF
# Enable FastCGI Bypass on McMo.is
alias fcgibymo='sudo sed -i "s|fastcgi_cache_bypass $skip_cache;|#fastcgi_cache_bypass $skip_cache;|g" /etc/nginx/sites-available/03-mcmo.is.conf && sudo sed -i "s|fastcgi_no_cache $skip_cache;|#fastcgi_no_cache $skip_cache;|g" /etc/nginx/sites-available/03-mcmo.is.conf && sudo sed -i "s|#fastcgi_cache_bypass 1;|fastcgi_cache_bypass 1;|g" /etc/nginx/sites-available/03-mcmo.is.conf && sudo sed -i "s|#fastcgi_no_cache 1;|fastcgi_no_cache 1;|g" /etc/nginx/sites-available/03-mcmo.is.conf && sudo service nginx restart && echo "FastCGI for McMo.is is now being bypassed. Nginx has been reloaded.." || echo "Fastcgi bypass was NOT turned on for McMo.is. Nginx probably was not reloaded. Maybe it is already on? Check your syntax and try again"'
# Disable FastCGI Bypass on McMo.is
alias fcgiunbymo='sudo sed -i "s|#fastcgi_cache_bypass $skip_cache;|fastcgi_cache_bypass $skip_cache;|g" /etc/nginx/sites-available/03-mcmo.is.conf && sudo sed -i "s|#fastcgi_no_cache $skip_cache;|fastcgi_no_cache $skip_cache;|g" /etc/nginx/sites-available/03-mcmo.is.conf && sudo sed -i "s|fastcgi_cache_bypass 1;|#fastcgi_cache_bypass 1;|g" /etc/nginx/sites-available/03-mcmo.is.conf && sudo sed -i "s|fastcgi_no_cache 1;|#fastcgi_no_cache 1;|g" /etc/nginx/sites-available/03-mcmo.is.conf && sudo service nginx restart && echo "FastCGI for McMo.is is NOT being bypassed. Nginx has been reloaded.." || echo "Fastcgi bypass was not disabled for McMo.is. Nginx probably was not reloaded. Maybe it is already on? Check your syntax and try again"'
# Enable FastCGI Bypass on danran.rocks
alias fcgibydanran='sudo sed -i "s|fastcgi_cache_bypass $skip_cache;|#fastcgi_cache_bypass $skip_cache;|g" /etc/nginx/sites-available/02-danran.rocks.conf && sudo sed -i "s|fastcgi_no_cache $skip_cache;|#fastcgi_no_cache $skip_cache;|g" /etc/nginx/sites-available/02-danran.rocks.conf && sudo sed -i "s|#fastcgi_cache_bypass 1;|fastcgi_cache_bypass 1;|g" /etc/nginx/sites-available/02-danran.rocks.conf && sudo sed -i "s|#fastcgi_no_cache 1;|fastcgi_no_cache 1;|g" /etc/nginx/sites-available/02-danran.rocks.conf && sudo service nginx restart && echo "FastCGI for danran.rocks is now being bypassed. Nginx has been reloaded.." || echo "Fastcgi bypass was NOT turned on for danran.rocks. Nginx probably was not reloaded. Maybe it is already on? Check your syntax and try again"'
# Disable FastCGI Bypass on danran.rocks
alias fcgiunbydanran='sudo sed -i "s|#fastcgi_cache_bypass $skip_cache;|fastcgi_cache_bypass $skip_cache;|g" /etc/nginx/sites-available/02-danran.rocks.conf && sudo sed -i "s|#fastcgi_no_cache $skip_cache;|fastcgi_no_cache $skip_cache;|g" /etc/nginx/sites-available/02-danran.rocks.conf && sudo sed -i "s|fastcgi_cache_bypass 1;|#fastcgi_cache_bypass 1;|g" /etc/nginx/sites-available/02-danran.rocks.conf && sudo sed -i "s|fastcgi_no_cache 1;|#fastcgi_no_cache 1;|g" /etc/nginx/sites-available/02-danran.rocks.conf && sudo service nginx restart && echo "FastCGI for danran.rocks is NOT being bypassed. Nginx has been reloaded.." || echo "Fastcgi bypass was not disabled for danran.rocks. Nginx probably was not reloaded. Maybe it is already on? Check your syntax and try again"'
# Enable FastCGI Bypass on oddcake.net
alias fcgibycake='sudo sed -i "s|fastcgi_cache_bypass $skip_cache;|#fastcgi_cache_bypass $skip_cache;|g" /etc/nginx/sites-available/01-oddcake.net.conf && sudo sed -i "s|fastcgi_no_cache $skip_cache;|#fastcgi_no_cache $skip_cache;|g" /etc/nginx/sites-available/01-oddcake.net.conf && sudo sed -i "s|#fastcgi_cache_bypass 1;|fastcgi_cache_bypass 1;|g" /etc/nginx/sites-available/01-oddcake.net.conf && sudo sed -i "s|#fastcgi_no_cache 1;|fastcgi_no_cache 1;|g" /etc/nginx/sites-available/01-oddcake.net.conf && sudo service nginx restart && echo "FastCGI for oddcake.net is now being bypassed. Nginx has been reloaded.." || echo "Fastcgi bypass was NOT turned on for oddcake.net. Nginx probably was not reloaded. Maybe it is already on? Check your syntax and try again"'
# Disable FastCGI Bypass on oddcake.net
alias fcgiunbycake='sudo sed -i "s|#fastcgi_cache_bypass $skip_cache;|fastcgi_cache_bypass $skip_cache;|g" /etc/nginx/sites-available/01-oddcake.net.conf && sudo sed -i "s|#fastcgi_no_cache $skip_cache;|fastcgi_no_cache $skip_cache;|g" /etc/nginx/sites-available/01-oddcake.net.conf && sudo sed -i "s|fastcgi_cache_bypass 1;|#fastcgi_cache_bypass 1;|g" /etc/nginx/sites-available/01-oddcake.net.conf && sudo sed -i "s|fastcgi_no_cache 1;|#fastcgi_no_cache 1;|g" /etc/nginx/sites-available/01-oddcake.net.conf && sudo service nginx restart && echo "FastCGI for oddcake.net is is NOT being bypassed. Nginx has been reloaded.." || echo "Fastcgi bypass was not disabled for oddcake.net. Nginx probably was not reloaded. Maybe it is already on? Check your syntax and try again"'
###########################
###### Nginx Brotli #######
###########################