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
from ConfigParser import SafeConfigParser | |
parser = SafeConfigParser() | |
parser.read('etc/unifi.cfg') | |
username = parser.get('unifi', 'username') | |
password = parser.get('unifi', 'password') |
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 | |
function usage () | |
{ | |
echo "Usage:" | |
echo " $0 <IP>" | |
echo "OR" | |
echo " $0 <IP> | tee mylog.txt" | |
} |
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 | |
function usage () | |
{ | |
echo "Usage:" | |
echo " $0 <IP6>" | |
echo "OR" | |
echo " $0 <IP6> | tee mylog.txt" | |
} | |
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 | |
function usage () | |
{ | |
echo "Usage:" | |
echo " $0 <IP6 | hostname>" | |
echo "OR" | |
echo " $0 <IP6 | hostname> | tee mylog.txt" | |
} |
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
mysqladmin -uroot -p create DBNAME | |
mysql -uroot -p -e "GRANT ALL PRIVILEGES ON DBNAME.* To 'USER'@'localhost' IDENTIFIED BY 'PASSWORD';" |
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
16 54.214.242.0/24 | |
15 54.197.251.0/24 | |
15 46.229.169.0/24 | |
15 162.243.226.0/24 | |
14 162.243.142.0/24 | |
13 37.187.9.0/24 | |
12 146.185.179.0/24 | |
10 95.85.61.0/24 | |
10 54.84.236.0/24 | |
10 54.213.177.0/24 |
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 | |
function usage () | |
{ | |
echo "Usage:";echo " $0 <url>" | |
} | |
if [ $# -ne 1 ]; then | |
usage;exit 127 | |
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
fail2ban: | |
pkg: | |
- installed | |
service: | |
- running | |
- require: | |
- pkg: fail2ban | |
- watch: | |
- file: /etc/fail2ban/jail.local |
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 | |
TODAY=`date "+%Y-%m-%d"` | |
case $OSTYPE in | |
darwin*) YESTERDAY=`date -v -1d "+%Y-%m-%d"` ;; | |
linux*) YESTERDAY=`date --date="yesterday" "+%Y-%m-%d"` ;; | |
*bsd*) YESTERDAY=`date -v -1d "+%Y-%m-%d"` ;; | |
*) echo "unknown: $OSTYPE" ;; | |
esac |
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
#!/usr/bin/env python | |
from netaddr import * | |
cidr = IPSet(['192.168.0.0/24']) | |
used = IPSet(['192.168.0.1','192.168.0.8/29','192.168.0.64/26']) | |
cidr ^ used | |
#IPSet(['192.168.0.0/32', '192.168.0.2/31', '192.168.0.4/30', '192.168.0.16/28', '192.168.0.32/27', '192.168.0.128/25']) | |
OlderNewer