Skip to content

Instantly share code, notes, and snippets.

@rhybroy
rhybroy / dnsmasq-gfwlist.py
Created August 31, 2018 16:54 — forked from lanceliao/dnsmasq-gfwlist.py
将gfwlist转换成带ipset的dnsmasq规则,适用于OpenWrt智能上网
#!/usr/bin/env python
#coding=utf-8
#
# Generate a list of dnsmasq rules with ipset for gfwlist
#
# Copyright (C) 2014 http://www.shuyz.com
# Ref https://code.google.com/p/autoproxy-gfwlist/wiki/Rules
import urllib2
import re
@rhybroy
rhybroy / dns-setter.sh
Last active August 29, 2015 14:22 — forked from finscn/dns-setter.sh
#!/bin/bash
# Please run this shell with "sudo ..."
SERVICE=Wi-Fi
# You could change the service. List all network services via:
# networksetup -listallnetworkservices
echo ""
echo "Current DNS on ${SERVICE}:"
#!/bin/sh
#
# /etc/rc.d/init.d/supervisord
#
# Supervisor is a client/server system that
# allows its users to monitor and control a
# number of processes on UNIX-like operating
# systems.
#
# chkconfig: - 64 36
@rhybroy
rhybroy / fetchsub.sh
Created October 28, 2012 06:43 — forked from ravageralpha/fetchsub.sh
shell script get subtitle from shooter.cn
#!/bin/sh
# Author: RA <ravageralpha@gmail.com>
USAGE(){
echo "Usage:fetchsub [eng] file"
}
[ $# -eq 0 -o "$1" = '--help' ] && USAGE && exit 0
ERROR(){
@rhybroy
rhybroy / tornado_temp_file_put.py
Created April 17, 2012 09:52 — forked from joshmarshall/tornado_temp_file_put.py
Temporary File PUT Transfer Handler for Tornado
import tornado.ioloop
import tornado.web
import tornado.httpserver
import tornado.httputil
import tempfile
class MainHandler(tornado.web.RequestHandler):
def put(self):
filename = self.request.body.name
# do stuff with the image
@rhybroy
rhybroy / ses.py
Created February 4, 2012 14:45 — forked from fanzeyi/ses.py
session for tornado
import os
import uuid
import marshal
import binascii
import tornado.web
def Session(func):
def warpper(self, *args, **kwargs):