Skip to content

Instantly share code, notes, and snippets.

View ayanamist's full-sized avatar

ayanamist ayanamist

View GitHub Profile
@ayanamist
ayanamist / app.yaml
Created June 30, 2011 14:05
Google App Engine Twitter API Proxy (T Mode)
application: gtap
version: 1
runtime: python
api_version: 1
handlers:
- url: /t/.*
script: main.py
@ayanamist
ayanamist / MyEncoder.bat
Created September 3, 2011 10:25
mp4convertor
@echo off
set CurPath=%0
IF NOT "%CurPath%"=="" set CurPath=%CurPath:~0,-15%"
set PATH=%CurPath%;%PATH%
set flock="%CurPath%\converting.txt"
:START
if exist %flock% goto WAIT
echo 文件正在转换中!请勿删除此文件! > %flock%
@ayanamist
ayanamist / openvpn-reconnect.sh
Created October 27, 2011 13:02
OpenVPN reconnect Bash script
#!/bin/bash
# configuration
DEVICE="tap0"
USERNAME="twitter"
PASSWORD="twitter"
# check configuration and environment
if [ -z $DEVICE ]; then
echo You must specific DEVICE first.
@ayanamist
ayanamist / proxy.pac
Created November 24, 2011 06:08
My Pac File for Auto Proxy
var PROXY = {
"direct":"DIRECT",
"gfw":"PROXY 127.0.0.1:8123"
};
var DEFAULT = "direct";
var SECTIONS = [
{
"name":"direct",
@ayanamist
ayanamist / TinyHTTPProxy.py
Created November 24, 2011 09:56
Tiny HTTP Proxy
#!/usr/bin/python
__doc__ = """Tiny HTTP Proxy.
This module implements GET, HEAD, POST, PUT and DELETE methods
on BaseHTTPServer, and behaves as an HTTP proxy. The CONNECT
method is also implemented experimentally, but has not been
tested yet.
Any help will be greatly appreciated. SUZUKI Hisao
@ayanamist
ayanamist / random.html
Created January 17, 2012 15:59
抽奖用页面
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>抽奖</title>
<style type="text/css">
body {
background: transparent url(data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/4QBuRXhpZgAASUkqAAgAAAABAGmHBAABAAAAGgAAAAAAAAABAIaSAgA6AAAALAAAAAAAAABDUkVBVE9SOiBnZC1qcGVnIHYxLjAgKHVzaW5nIElKRyBKUEVHIHY2MiksIHF1YWxpdHkgPSA5MAoA/9sAQwAIBgYHBgUIBwcHCQkICgwUDQwLCwwZEhMPFB0aHx4dGhwcICQuJyAiLCMcHCg3KSwwMTQ0NB8nOT04MjwuMzQy/9sAQwEJCQkMCwwYDQ0YMiEcITIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy/8AAEQgClgOPAwEiAAIRAQMRAf/EAB8AAAEFAQEBAQEBAAAAAAAAAAABAgMEBQYHCAkKC//EALUQAAIBAwMCBAMFBQQEAAABfQECAwAEEQUSITFBBhNRYQcicRQygZGhCCNCscEVUtHwJDNicoIJChYXGBkaJSYnKCkqNDU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6g4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2drh4uPk5ebn6Onq8fLz9PX29/j5+v/EAB8BAAMBAQEBAQEBAQEAAAAAAAABAgMEBQYHCAkKC//EALURAAIBAgQEAwQHBQQEAAECdwABAgMRBAUhMQYSQVEHYXETIjKBCBRCkaGxwQkjM1LwFWJy0QoWJDThJfEXGBkaJ
@ayanamist
ayanamist / shExpMatch.js
Created June 25, 2012 16:11
Better implementation of shExpMatch
function shExpMatch(url, pattern) {
var pCharCode;
var isAggressive = false;
var pIndex;
var urlIndex = 0;
var lastIndex;
var patternLength = pattern.length;
var urlLength = url.length;
for (pIndex = 0; pIndex < patternLength; pIndex += 1) {
pCharCode = pattern.charCodeAt(pIndex); // use charCodeAt for performance, see http://jsperf.com/charat-charcodeat-brackets
@ayanamist
ayanamist / readme.md
Created September 13, 2012 04:21
Opera Mini Android 改服
@ayanamist
ayanamist / vpncwatch
Last active December 9, 2015 16:28
vpncwatch (shell version)
#!/bin/sh
log() {
logger -t vpncwatch $@
}
SH_PID="/var/run/vpncwatch.pid"
VPNC="/usr/sbin/vpnc"
VPNC_OPTS=""
VPNC_PID="/var/run/vpnc/pid"
@ayanamist
ayanamist / dnscryptwatch
Last active December 10, 2015 01:34
OpenDNS DNSCrypt Watch
#!/bin/sh
PIDFILE=/var/run/dnscryptwatch.pid
BINPATH=/usr/sbin/dnscrypt-proxy -a 127.0.0.1:40
DNSCRYPT_PIDFILE=/var/run/dnscrypt.pid
# Check whether script is running, and if running, exit directly
if [ -s $PIDFILE ] && [ -s /proc/$(cat $PIDFILE)/exe ]; then
exit 0
fi
# Fork current script to background daemon
if [ -z "$_BACKGROUNDED" ]; then