If you haven't already, install fail2ban and ufw:
sudo apt-get install fail2ban ufw
Now make a copy of the fail2ban configuration, and name it jail.local
:
#!/usr/bin/env bash | |
# Make sure we are root | |
if [[ $EUID -ne 0 ]]; then | |
echo "This script must be run as root" 1>&2 | |
exit 1 | |
fi | |
if [ -z "$1" ]; then | |
echo "Provide the user name as the first argument." 1>&2 |
#!/usr/bin/env bash | |
# exit on error | |
set -e | |
# unset vars | |
unset configs | |
unset letsencrypt_path | |
# Arguments parsing |
@property | |
def by_year_month(self): | |
""" Sorts the list, and returns it sorted by year and month. | |
""" | |
self.webalizer_months.sort( | |
key=lambda x: (int(x.split(' ', 1)[0]), int(x.split(' ', 2)[1])) | |
) | |
return self.webalizer_months |
# Bitlbee | |
description "Bitlbee startup script" | |
# When to start the service | |
start on runlevel [2345] | |
# When to stop the service | |
stop on runlevel [016] |
# Count how many pages approximately in PDF (1 page = 2400 chars) | |
pagecount() { | |
echo $(( $(pdftotext "$*" - | tr -d '.' | wc -m) / 2400.00 )) | |
} | |
# Count characters in PDF | |
charcount() { pdftotext "$*" - | tr -d '.' | wc -m } | |
# Count words in PDF | |
wordcount() { pdftotext "$*" - | tr -d '.' | wc -w } |
""" twinfo will show you which of the channels you follow are currently live, | |
and allow you to input a number to open it with livestreamer[0]. | |
[0]: https://github.com/chrippa/livestreamer | |
""" | |
import grequests | |
import requests | |
import argparse | |
import os |
#!/bin/bash | |
hosts=( | |
ftp.dk.debian.org | |
ftp.cn.debian.org | |
) | |
for host in ${hosts[@]}; do | |
IP=`nslookup $host | sed 's/Address: //' | tail -n 2 | head -n 1` | |
echo ==== TESTING $IP \($host\) ==== | |
echo Ping: `ping -c 64 $IP | grep rtt` |
#!/usr/bin/env python | |
""" .ics parser | |
Usage: | |
ics_parser.py [start_date] [end_date] <file> | |
""" | |
from icalendar import Calendar | |
from docopt import docopt |