Skip to content

Instantly share code, notes, and snippets.

View jas8522's full-sized avatar

Jordan S jas8522

View GitHub Profile
@jas8522
jas8522 / ws-wp-xmlrpc-jail.local
Last active September 3, 2018 15:05 — forked from gbot/wp-xmlrpc-jail.local
Fail2Ban WordPress XMLRPC Jail and Filter. Notes: log path is set for Plesk v12+. Adjusted to work with a 'normal' xmlrpc request hit rate and only ban when beyond normal.
[ws-wp-xmlrpc]
enabled = true
filter = ws-wp-xmlrpc
action = iptables-multiport[name=wp-xmlrpc, port="http,https"]
logpath = /var/www/vhosts/system/*/logs/*access*log tail
/var/log/httpd/*access_log tail
# If there are 50 hits in 30 seconds (1.66/s), ban the IP for 30 minutes
bantime = 1800
maxretry = 50
findtime = 30
@jas8522
jas8522 / dovecot-maildir-compress.sh
Last active December 15, 2020 21:41 — forked from cviebrock/dovecot-maildir-compress.sh
Compresses email in maildir format
#!/bin/bash
# Enable zlib in Dovecot alongside automatic writing of new emails in gzipped format
echo '# Enable zlib plugin for reading/writing:
protocol imap {
mail_plugins = $mail_plugins zlib
}
protocol pop3 {
mail_plugins = $mail_plugins zlib