From time to time docker build cache becomes a problem which uses 100% of disk space. This script need to be added to cron, from where it will be see if there is a few space left. If disk have less space then 10% free - it will prune docker build cache. Every time it runs - it write log to /var/log/messages
Before you may use this script - make sure you have openvpn server and .ovpn config, you need login and password as well. Then you have to install openvpn app:
sudo apt update && sudo apt install openvpn
if you have not debian-like distro - you know what to do, if not - just search the web. After you have it all - place this script in some folder and pray. LoL Just joking. Place the file, edit three first variables (you can edit whole file, of course) and make the cron job to run this script once in a while, but not more often then its' inner workaround.
-
If you need to clean all samba database files (if you're experimenting with AD membership in samba)clean_all_bd script
-
to add your Samba server to AD first - save your own smb.conf, nsswitch.conf, krb5.conf
mkdir smb_backup sudo mv /etc/samba/smb.conf ./smb_backup/smb.conf.$(date +"%Y-%m%-%d").bak sudo mv /etc/nsswitch.conf ./smb_backup/nsswitch.conf.$(date +"%Y-%m%-%d").bak sudo mv /etc/krb5.conf ./smb_backup/krb5.conf.$(date +"%Y-%m%-%d").bak
use this smb.conf as a sample.
To make your bash looks awesome you don't need to use zsh with 10K stories (I know, it's powerfull and handy, but if the point only in good-looking then why?) open your .bashrc file with your favorite editor (I bet - it's vim!) and change the PS1 string to look like this:
PS1='${debian_chroot:+($debian_chroot)}\[\033[42m\033[02;30m\]\u\033[43m@\h\[\033[00m\]\[\033[01;44m\]:\w\[\033[00m\]$(__git_ps1)\n└─ $ 'then save it and run the command:
source ~/.bashrcIt will be represented like this:
yeah, it also shows a git branch if the directory is a git repository
- this script is running through directories and copy .bak files in directories of base, year and month. Backups should be on D: in Backups subfolders. .bak files in Backups directory will not be copied (my developers use them as temporary backups)
