This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Future version might store stats in a flatfile DB and then show comparative values, eg +5%, -250% | |
TEMPFILE=/tmp/dc_temp.log | |
# Need to cat the last two logs to guarantee 24 hours of data: adjust according to your setup | |
# zcat -f will deal with uncompressed and gzipped alike | |
zcat -f /var/log/dovecot.log.1 /var/log/dovecot.log > $TEMPFILE | |
# Find start hour 24 hours ago. If no match, try 25 hours, 26 hours, etc up to 48 hours |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run these manually | |
# First install git and grab the imapsync code | |
apt install git | |
git clone https://github.com/imapsync/imapsync.git | |
# Install all dependencies | |
apt install automake build-essential libauthen-ntlm-perl libclass-load-perl libcrypt-openssl-rsa-perl libdata-uniqid-perl libdate-manip-perl libdigest-hmac-perl libdigest-md5-file-perl libdist-checkconflicts-perl libfile-copy-recursive-perl libio-tee-perl libjson-perl libmail-imapclient-perl libmodule-implementation-perl libmodule-runtime-perl libmodule-scandeps-perl libpackage-stash-perl libpackage-stash-xs-perl libpar-packer-perl libreadonly-perl libsys-meminfo-perl libterm-readkey-perl libtest-fatal-perl libtest-mock-guard-perl libtest-mockobject-perl libtest-pod-perl libtest-requires-perl libtry-tiny-perl libunicode-string-perl make makepasswd perl-doc rcs | |
# These ones didn't exist in my repos, so first try to install through apt | |
apt-get install libjson-webtoken-perl libjson-webtoken-crypt-rsa-perl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Copyright (c) 2003, 2005, 2006, 2009 Danilo Segan <[email protected]>. | |
This amended version uses function __construct to get rid of errors | |
# Install: | |
cd /usr/share/php/php-gettext/ | |
mv streams.php streams.orig.php | |
wget https://gist.githubusercontent.com/plutocrat/e6abc230924c17b1c2f54929de442882/raw/724d81bcdb8347ac4b12fff4f1674d9b096465ec/streams.php | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
OUTFILE=server-info.txt | |
NEWFILE=1 | |
# Clear existing if NEWFILE set to 1 | |
if [ "$NEWFILE" == "1" ]; then | |
echo "" > $OUTFILE | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# wget -O install_perftools.sh https://gist.github.com/plutocrat/31d43d125ed64954fa2f575ccac40448/raw/ && chmod 700 install_perftools.sh | |
# Get mysqltuner | |
wget -O mysqltuner.pl https://raw.githubusercontent.com/major/MySQLTuner-perl/master/mysqltuner.pl | |
wget -O basic_passwords.txt https://raw.githubusercontent.com/major/MySQLTuner-perl/master/basic_passwords.txt | |
wget -O vulnerabilities.csv https://raw.githubusercontent.com/major/MySQLTuner-perl/master/vulnerabilities.csv | |
chmod 700 mysqltuner.pl | |
sed -i 's/"skippassword" => 0,/"skippassword" => 1,/' mysqltuner.pl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# wget https://gist.githubusercontent.com/plutocrat/7636841e480f483a97c0d17568ac0ef1/raw/upload_clean.sh | |
# Dumps your database out, extracts image paths from it and compares it against a list of files from the filesystem | |
# Needs wp-cli to dump the database. | |
# Only works on Linuxy servers | |
# It will give you a chance to bail before it deletes anything. | |
# If it saves you a few hours, show your appreciation with bitcoin: 35Ws8qgKUCiVaca7vg5NWqkfQozPfzb4my | |
# Working Dir | |
WKDIR=zz_temp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Requires openssl, bc, grep, sed, date, mutt, sort | |
## Edit these ## | |
# Space separated list of domains to check | |
DOMAINLIST="hp.com github.com google.com" | |
# Where to send the report | |
[email protected] | |
# Additional alert warning prepended if domain has less than this number of days before expiry | |
EXPIRYALERTDAYS=15 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## Set Variables | |
# Pass input file as a commandline argument, or set it here, and your output file | |
INFILE=$1 | |
OUTFILE=./$1.squish | |
TMPFILE=./squish.tmp | |
# Lists of patterns to delete from logfiles. space separated. backslash before special characters | |
# LOCALTRAFFIC will be unique to your setup. |