Skip to content

Instantly share code, notes, and snippets.

@sorz
sorz / ah.plain.txt
Last active Mar 26, 2018
`curl sorz.org`
View ah.plain.txt
-oooooooooooo- -::::::::::::::::::::-
.---------. oMMMMMMMMMMMM+ dMMMMMMMMMMMMMMMMMMMMM.
.NMMMMMMMMMN` oMMN:...-yMMM: /+++++++++++++yMMMo+++`
.NMMhyyydMMN` oMMN. `mMMd /MMN`
.NMM/ oMMN` oMMN. +MMN: /MMN`
.NMM/ oMMN` oMMN. `dMMs /MMN`
.NMM/ oMMN` oMMN. /MMN. -hhhhhhhhhh/ /MMN`
.NMM/ oMMN` oMMN. dMMo :MMMNmmmNMMs /MMN`
.NMM/ oMMN` oMMN. +MMN. :MMN.```yMMs /MMN`
@sorz
sorz / matriahix.sh
Created Mar 10, 2018
Copy from http://bruxy.regnet.cz/web/linux/EN/matrix-sh/, just change random chars to 啊.
View matriahix.sh
#!/bin/bash
echo -e "\033[2J\033[?25l"; R=`tput lines` C=`tput cols`;: $[R--] ; while true
do ( e=echo\ -e s=sleep j=$[RANDOM%C] d=$[RANDOM%R];for i in `eval $e {1..$R}`;
do c=`printf ''` # fork from http://bruxy.regnet.cz/web/linux/EN/matrix-sh/ #
$e "\033[$[i-1];${j}H\033[32m$c\033[$i;${j}H\033[37m"$c; $s 0.1;if [ $i -ge $d ]
then $e "\033[$[i-d];${j}H ";fi;done;for i in `eval $e {$[i-d]..$R}`; #[mat!rix]
do echo -e "\033[$i;${j}f ";$s 0.1;done)& sleep 0.05;done #(c) 2011 -- [ BruXy ]
@sorz
sorz / sockshttp.py
Created Oct 27, 2017
Forward SOCKSv5 requests to HTTP proxy.
View sockshttp.py
#!/usr/bin/env python3
"""Forward SOCKSv5 requests to HTTP proxy.
Frontend: accept SOCKSv5 CONNECT request.
Backend: HTTP proxy with CONNECT support.
"""
import asyncio
import logging
from struct import pack, unpack
from ipaddress import IPv4Address, IPv6Address
@sorz
sorz / obfs4-client.py
Last active Jul 24, 2017
A simple SOCKSv5 wrapper for obfs4proxy.
View obfs4-client.py
#!/usr/bin/env python3
import asyncio
from struct import pack
from ipaddress import ip_address
TIMEOUT = 300
OBFS_BIN = '/usr/bin/obfs4proxy'
OBFS_EXEC_PARAMS = ['-enableLogging', '-logLevel', 'DEBUG']
@sorz
sorz / dnsrelay.py
Last active Jul 17, 2017
Forward DNS query (in UDP) to a set of servers in parallel, then send back the fastest reply and ignore others. TCP queries are directly forward to a fixed server.
View dnsrelay.py
#!/usr/bin/env python3
"""
Forward DNS query (in UDP) to a set of servers in parallel, then send back
the fastest reply and ignore others. TCP queries are directly forward to a
fixed server.
"""
import asyncio
import socket
@sorz
sorz / cdma_pdu.py
Created Jun 16, 2017
Decode SMS from CDMA PDU
View cdma_pdu.py
from datetime import datetime
import binascii
import logging
import io
def _parse_fields(raw):
"""Return a iterators of (id, value)."""
raw = io.BytesIO(raw)
while True:
View keybase.md
### Keybase proof
I hereby claim:
* I am sorz on github.
* I am sorz (https://keybase.io/sorz) on keybase.
* I have a public key ASAiBGBuAlnIQQZyMycLhfqfUdOoLsNj_hHy0MlBUZjfZQo
To claim this, I am signing this object:
@sorz
sorz / ipn-tib-mixed.user.js
Last active Apr 3, 2017
在 IPN 首页显示字谈字畅的节目列表。
View ipn-tib-mixed.user.js
// ==UserScript==
// @name IPN - Add Type is Beautiful episodes
// @namespace org.sorz.lab.ipn
// @include https://ipn.li/
// @include http://ipn.li/
// @version 5
// @grant GM_xmlhttpRequest
// @grant GM_getResourceURL
// @grant GM_addStyle
// @require http://code.jquery.com/jquery-3.2.0.min.js
@sorz
sorz / ipn-fix-show-list.user.js
Last active Mar 17, 2017
以固定顺序显示 ipn.li 首页的节目列表。
View ipn-fix-show-list.user.js
// ==UserScript==
// @name IPN - Fixed show list on homepage
// @namespace org.sorz.lab.ipn
// @include https://ipn.li/
// @version 1
// @grant none
// @require http://code.jquery.com/jquery-3.2.0.slim.min.js
// ==/UserScript==
let items = $('.showList > li').toArray();