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 sfvpn-ddos filter | |
# | |
[INCLUDES] | |
before = common.conf | |
[Definition] | |
failregex = A DoS attack on the TCP Listener \(port \d+\) has been detected\. The connecting source IP address is <HOST>, port number is \d+\. This connection will be forcefully disconnected now\. | |
ignoreregex = |
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 python3 | |
# | |
# install required packeges: | |
# sudo apt-get install python3-geoip geoip-database libgeoip1 | |
# | |
# download script: | |
# sudo curl -sS -o /usr/local/bin/check_geoip.py https://gist.githubusercontent.com/kacchan822/f9240646cfd78a5290a2ec95d844b1a0/raw/check_geoip.py | |
# sudo chmod +x /usr/local/bin/check_geoip.py | |
# | |
# setting up hosts.allow and hosts.deny: |
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
import csv | |
import email.utils | |
from django.http import HttpResponse | |
class CsvResponseMixin(object): | |
filename = 'csvfile.csv' | |
content_type = 'text/csv; charset=UTF-8' |
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/perl | |
use strict; | |
use Cache::Memcached; | |
my $memcached = Cache::Memcached->new({ | |
servers => ["127.0.0.1:11211"] | |
}); | |
print "Set (key, hoge) exptime:12sec\n"; | |
$memcached->add('key', 'hoge', 12); |
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 python3 | |
# This software is released under the MIT License. | |
# http://opensource.org/licenses/mit-license.php | |
import datetime | |
import re | |
import socket | |
import ssl | |
import sys |
OlderNewer