Skip to content

Instantly share code, notes, and snippets.

View kacchan822's full-sized avatar

kacchan822 kacchan822

View GitHub Profile
@kacchan822
kacchan822 / sfvpn-ddos.conf
Created January 20, 2017 04:57
Fail2ban filter for SoftEther VPN server
# 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 =
@kacchan822
kacchan822 / check_geoip.py
Last active October 25, 2017 02:53
check_geoip.py
#!/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:
@kacchan822
kacchan822 / CsvResponseMixin.py
Created May 22, 2017 12:16
CSV Response Mixin for Django -- python3.5 , Django 1.11
import csv
import email.utils
from django.http import HttpResponse
class CsvResponseMixin(object):
filename = 'csvfile.csv'
content_type = 'text/csv; charset=UTF-8'
#!/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);
@kacchan822
kacchan822 / check_cert_chrome.py
Last active February 1, 2018 14:11
checker for Chrome distrusting Symantec certificates.
#!/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