Script to see if NFS is mounted
#!/usr/bin/env bash MP=’/mnt/remote’HOSTNAME=hostname -sFILE=/tmp/is_it_mounted.txt if grep -qs $MP /proc/mounts; thenecho “OK $MP mounted on $HOSTNAME” > /dev/nullelseecho “NOK $MP not mounted on $HOSTNAME” > $FILEfi if then/usr/sbin/sendmail -t << EOFFrom:…
Find whats using swap
If you need to find which process is using swap, as root on your command line run. for file in /proc/*/status ; do awk ‘/VmSwap|Name/{printf $2 ” ” $3}END{ print…
SYN Flood attack
If you are being hit by a SYN FLOOD attack you can mitigate it by doing the following. 1. Disable conntrack for SYN packets (note: example below is untested, general…
Cpanel – AutoBackup before terminate
You need to install this – so that when you terminate an account it will back it up first. https://github.com/bennyvasquez/prekillacct