Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
ETHTOOL=/sbin/ethtool
NETWORK_INTERFACE=eth0
ERROR_STATS=$($ETHTOOL -S $NETWORK_INTERFACE | grep errors | tr -d " ")
for STAT in $ERROR_STATS
do
KEY=$(echo $STAT | awk -F ':' '{print $1}')
#!/bin/bash
MONIT_VERSION=5.25.3
cd /tmp
sudo groupadd monit
sudo useradd monit -g monit
wget https://mmonit.com/monit/dist/binary/${MONIT_VERSION}/monit-${MONIT_VERSION}-linux-x64.tar.gz -O monit.tar.gz
echo "Untarring the archive"
tar xzvf monit.tar.gz
sudo cp -R monit-${MONIT_VERSION}/bin/monit /usr/local/bin/monit
sudo mkdir /etc/monit/
#!/bin/sh
# Check and stop unallowed file names from being checked in
if git rev-parse --verify HEAD >/dev/null 2>&1
then
against=HEAD
else
# Initial commit: diff against an empty tree object
against=$(git hash-object -t tree /dev/null)
fi