Skip to content

Instantly share code, notes, and snippets.

dne / smokeping.psgi
Created Feb 12, 2014
Smokeping PSGI app
View smokeping.psgi
use strict;
use warnings;
use CGI::Emulate::PSGI;
my $app = CGI::Emulate::PSGI->handler(sub {
use CGI;
use Smokeping;
fdb713 / twitter.mute.js
Last active Dec 17, 2015
mute tweets containing specific keyword.
View twitter.mute.js
// origin: @ayanamist
// ==UserScript==
// @name Twitter Timeline URL Expand
// @namespace Twitter-Timeline-URL-Expand
// @description Replace href of A tag with real url.
// @match*
// @match*
// @version 1.1
// ==/UserScript==
(function (window) {
scturtle /
Last active Dec 22, 2015
dns proxy server using and ip
import SocketServer
from gevent import monkey
import requests
from dnslib import *
cache = {'': [''], '': ['']}
def redirect_ip(data, ip=''):
bsodmike /
Last active Aug 30, 2017
HOWTO: Setup mail forwarding with Sendmail in Ubuntu 10.04 LTS

Copyright (c) 2011, Michael de Silva ( Blog: ~ Twitter: @bsodmike

Fix: 'config error: mail loops back to me (MX problem?)'

To prevent receiving config error: mail loops back to me (MX problem?) errors, you need to add each virtualdomain.tld to the /etc/mail/local-host-names file and re-compile your sendmail config via make.

You have asked mail to a domain (e.g., to be forwarded to a specific host (in this case, by using an MX record, but the relay machine doesn't recognise itself as Add to /etc/mail/local-host-names [known as /etc/ prior to version 8.10] (if you are using FEATURE(`use_cw_file')) or add "Cw" to your configuration file.


madeye / sysctl.conf
Last active Jun 5, 2018
Optimized sysctl.conf for shadowsocks
View sysctl.conf
net.core.wmem_max = 12582912
net.core.rmem_max = 12582912
net.ipv4.tcp_rmem = 10240 87380 12582912
net.ipv4.tcp_wmem = 10240 87380 12582912
net.ipv4.ip_local_port_range = 18000 65535
net.ipv4.netfilter.ip_conntrack_tcp_timeout_time_wait = 1
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_max_syn_backlog = 3240000
net.core.somaxconn = 3240000
net.ipv4.tcp_max_tw_buckets = 1440000
sycx /
Created Feb 28, 2016
Import Alipay ACCLOG file to beancount
#!/usr/bin/env python3
import sys
import csv
import argparse
import datetime
def _amount_match(a1,a2):
d1 = float(a1) if a1 else 0
View dns_pollution_iplist.txt
msmuenchen / gist:9318327
Last active Apr 8, 2022
KeePass v2.x (KDBX v3.x) file format
View gist:9318327
Convention: Byte array notation as it would appear in a hexeditor.
= Layout=
KDBX files, the keepass database files, are layout as follows:
1) Bytes 0-3: Primary identifier, common across all kdbx versions:
private static $sigByte1=[0x03,0xD9,0xA2,0x9A];
2) Bytes 4-7: Secondary identifier. Byte 4 can be used to identify the file version (0x67 is latest, 0x66 is the KeePass 2 pre-release format and 0x55 is KeePass 1)
koto /
Created Sep 11, 2012
It's not a crime to build a CRIME
# This is supposedly what CRIME by Juliano Rizzo and Thai Duong will do
# Algorithm by Thomas Pornin, coding by xorninja, improved by @kkotowicz
import string
import zlib
import sys
import random
charset = string.letters + string.digits + "%/+="
glacjay /
Created Sep 19, 2010
Reading/Writing OpenVPN's TUN/TAP Device under Windows using Python.
import _winreg as reg
import win32file
adapter_key = r'SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}'
def get_device_guid():
with reg.OpenKey(reg.HKEY_LOCAL_MACHINE, adapter_key) as adapters: