Skip to content

Instantly share code, notes, and snippets.

@adriaaah
adriaaah / upgrade-cacti.sh
Created October 28, 2017 16:33
Automate Cacti (http://www.cacti.net) a bit
#!/bin/bash
### Adjust settings ###
BASE_DIR='/var/www/admin'
CACTI_DB='cacti'
CACTI_PATH="${BASE_DIR}"/cacti
CACTI_OLD="${BASE_DIR}"/cacti_old
CACTI_USER='www-data'
### Do not change below lines ###
@adriaaah
adriaaah / Vagrantfile
Created February 28, 2017 20:42
monit-dashboard/issue1
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@adriaaah
adriaaah / failtoban2iptables.sh
Last active August 8, 2019 07:17
Recently I found lots of attacks logged by Fail2ban in my private servers. Basically they are made mostly by script kiddies. This script fetches all the IP's found in Logwatch daily report (or any source file, at your choice), look for their range and generates chains you can add to your Iptables. Please be careful using it because you might blo…
#!/bin/bash
### Variables
# Binaries
GREP=`which grep`
SORT=`which sort`
MKDIR=`which mkdir`
WHOIS=`which whois`
AWK=`which awk`
SED=`which sed`