====== Administration Tips ====== ===== Restarting All Courier Services in one shot ===== root@mail:~# find /etc/init.d/|grep courier|while read line; do $line restart; done ===== Restarting all 3CX services in one shot ===== root@3cxserver:~# systemctl |grep 3CX|cut -f1 -d" "|while read line; do systemctl restart $line; done ===== Generate a random MAC Address ===== openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//' ===== How to flush tinydns/dnscache ===== Some people say using svc -du dnscache will flush the dns cache. However, I have never had any such luck and must use the following svc -t dnscache ===== Rsync complete filesystem ===== Sometimes I find myself in need of migrating a complete system into a VM or Container. Here is a pretty easy way to minimize downtime later. rsync -aAHXv /* root@host.domain.tld:/var/lib/vz/private/115 --exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/lost+found} As you can see above I am syncing to an OpenVZ container. ===== Move a running process to the background ===== This method cleanly moves a running process to the background and ensures you don't lose it when you log out of the session. CTRL+z bg disown -h Enjoy