Skip to content

Instantly share code, notes, and snippets.

View sorz's full-sized avatar
😱
AAHHH

Shell Chen sorz

😱
AAHHH
View GitHub Profile
@chenshaoju
chenshaoju / script running adb shell
Last active March 25, 2024 04:58
Android 8.x Captive Portal Server for Mainland China
settings put global captive_portal_mode 1
settings put global captive_portal_use_https 1
settings put global captive_portal_http_url http://connect.rom.miui.com/generate_204
settings put global captive_portal_https_url https://connect.rom.miui.com/generate_204
settings put global captive_portal_fallback_url http://captive.v2ex.co/generate_204
settings put global captive_portal_other_fallback_urls http://www.google.cn/generate_204
@sycx
sycx / alipay_acclog.py
Created February 28, 2016 19:14
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
0.0.0.0
1.1.80.147
1.1.127.45
1.33.190.70
1.33.191.58
1.209.208.200
1.234.1.235
1.234.2.155
1.234.4.97
1.234.17.34
@msmuenchen
msmuenchen / gist:9318327
Last active September 18, 2022 21:53
KeePass v2.x (KDBX v3.x) file format
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)
@dne
dne / smokeping.psgi
Created February 12, 2014 08:49
Smokeping PSGI app
#!/usr/bin/perl
use strict;
use warnings;
use CGI::Emulate::PSGI;
my $app = CGI::Emulate::PSGI->handler(sub {
use CGI;
use Smokeping;
CGI::initialize_globals();
@madeye
madeye / sysctl.conf
Last active June 5, 2018 11:05
Optimized sysctl.conf for shadowsocks
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
@scturtle
scturtle / dns.py
Last active December 22, 2015 12:29
dns proxy server using 0bad.com and ip
import SocketServer
from gevent import monkey
monkey.patch_socket(dns=False)
import requests
from dnslib import *
cache = {'0bad.com': ['69.163.160.212'], 'bitstress.com': ['127.0.0.1']}
def redirect_ip(data, ip='144.214.121.220'):
@fdb713
fdb713 / twitter.mute.js
Last active December 17, 2015 03:09
mute tweets containing specific keyword.
// origin: @ayanamist
// ==UserScript==
// @name Twitter Timeline URL Expand
// @namespace Twitter-Timeline-URL-Expand
// @description Replace t.co href of A tag with real url.
// @match http://twitter.com/*
// @match https://twitter.com/*
// @version 1.1
// ==/UserScript==
(function (window) {
@koto
koto / crime.py
Created September 11, 2012 08:32
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
# http://security.blogoverflow.com/2012/09/how-can-you-protect-yourself-from-crime-beasts-successor/
import string
import zlib
import sys
import random
charset = string.letters + string.digits + "%/+="
@bsodmike
bsodmike / howto.md
Last active August 30, 2017 04:15
HOWTO: Setup mail forwarding with Sendmail in Ubuntu 10.04 LTS

Copyright (c) 2011, Michael de Silva (michael@mwdesilva.com) Blog: http://www.bsodmike.com ~ 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., domain.net) to be forwarded to a specific host (in this case, relay.domain.net) by using an MX record, but the relay machine doesn't recognise itself as domain.net. Add domain.net to /etc/mail/local-host-names [known as /etc/sendmail.cw prior to version 8.10] (if you are using FEATURE(`use_cw_file')) or add "Cw domain.net" to your configuration file.

Source: http://www.sendmail.com/sm/open_source/support/support_faq/general_issues_faq/#4.5