Garbage

What kind of trash is usually found in the backyards of industrial areas?
Construction debris, rusty car frames, empty liquid containers.
Now we can meet this too:

 

Fix ubuntu apt-get and release upgrade errors

Fix fetching updates:

When you get “Unable to fetch some archives, maybe run apt-get update or try with –fix-missing?” error do this:

cd /etc/apt
mv sources.list sources.list.old
lsb_release -a
sudo cat sources.list.old |grep RELEASECODENAME |grep -v "#" |sed 's|us.archive.|old-releases.|g' >> sources.list

(del and retype >> in console if error occures)

 

https://www.tech-notes.net/issues-wit-apt-ubuntu-12-04/

https://stackoverflow.com/questions/38743951/unable-to-fetch-some-archives-maybe-run-apt-get-update-or-try-with-fix-missin

https://askubuntu.com/questions/91815/how-to-install-software-or-upgrade-from-an-old-unsupported-release/91821#91821

 

Resume a release upgrade:
https://askubuntu.com/questions/346678/how-do-i-resume-a-release-upgrade

Mount SMB share in Ubuntu

apt-get install cifs-utils
mkdir /var/tmp/sharetest
One time until reboot, read only:
mount -t cifs -o sec=ntlm,noperm,nounix,vers=3.0,username=USERNAME,password=PASSWORD //XXX.XXX.XXX.XXX/test /var/tmp/sharetest -r
Permanently, read only:
nano /etc/fstab
//XXX.XXX.XXX.XXX/test      /var/tmp/sharetest              cifs    ro,sec=ntlm,noperm,nounix,vers=3.0,username=USERNAME,password=PASSWORD 0 0

crontab -e
* * * * * mount -a #Reconnect mounted shares after they disconnect for some reason (network failure for example)

https://askubuntu.com/questions/940132/windows-shares-not-reconnecting

Fail2ban Info

Some useful info:

https://www.digitalocean.com/community/tutorials/how-to-protect-an-nginx-server-with-fail2ban-on-ubuntu-22-04
https://linux-notes.org/ustanovka-fail2ban/
https://github.com/Bebef/fail2ban-filter.d
https://stackoverflow.com/questions/19794107/fail2ban-error-can´t-ban-with-lighttpssd-auth
https://easyengine.io/tutorials/nginx/fail2ban/

Check who’s banned:

fail2ban-client status JAILNAME

fail2ban alerts sent to a Rocket.Chat channel:

https://forums.rocket.chat/t/fail2ban-and-rocket-chat-integration/2544

Incremental bantime:

https://habr.com/ru/post/238303/

Check how filter works:

fail2ban-regex /var/log/somelog.log /etc/fail2ban/filter.d/somefilter.conf
Add –print-all-missed or –print-all-matched to see missed and matched lines.