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
package main | |
import ( | |
"bytes" | |
"encoding/hex" | |
"flag" | |
"fmt" | |
"io" | |
"log" | |
"net" |
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 querystring = require('querystring'); | |
var original = 'http://example.com/product/abcde.html'; | |
var escaped = querystring.escape(original); | |
console.log(escaped); | |
// http%3A%2F%2Fexample.com%2Fproduct%2Fabcde.html | |
var unescaped = querystring.unescape(escaped); | |
console.log(unescaped); |
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
# -*- Encoding: utf-8 -*- | |
import base64 | |
import binascii | |
import cgi | |
import hashlib | |
import hmac | |
import logging | |
import time | |
import urllib | |
import urlparse |
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
class StreamHandler(tornado.web.RequestHandler): | |
@tornado.web.asynchronous | |
def get(self): | |
self.post() | |
@tornado.web.asynchronous | |
def post(self): | |
self.ioloop = tornado.ioloop.IOLoop.instance() | |
self.pipe = self.get_pipe() | |
self.ioloop.add_handler( |
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 | |
# -*-mode: python; coding: iso-8859-1 -*- | |
# | |
# Copyright (c) Liu taihua <[email protected]> | |
""" | |
Usage: | |
[-h|--help] [-t interval=60] [-c cluster=Nanhui] [-H prefer=hostname|IP] [-v|--verbose True|False] | |
Example: |
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
#-*- coding:utf8 -*- | |
#!/usr/bin/env python | |
import socket | |
import sys | |
import math | |
import urllib | |
import string | |
import time | |
import urlparse |