Skip to content

Instantly share code, notes, and snippets.

View binux's full-sized avatar

Roy Binux binux

View GitHub Profile
@binux
binux / TODO.md
Created December 11, 2014 14:14
pyspider TODO

v0.3.0

[x] as a package [x] run.py parameters [x] sortable projects list #12 [x] Postgresql Supported via SQLAlchemy (with the power of SQLAlchemy, pyspider also support Oracle, SQL Server, etc) [x] benchmarking [ ] pypi release version

v0.4.0

#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Binux<roy@binux.me>
# http://binux.me
# Created on 2014-12-04 00:56:49
def get_py(word):
word = word.encode('gbk')
@binux
binux / pyspider_bench.py
Last active December 6, 2016 10:33
benchmarking for pyspider. using scrpy==0.24.4 mockserver
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Binux<i@binux.me>
# http://binux.me
# Created on 2014-11-17 23:29:30
import os
import sys
import time
@binux
binux / douban.py
Last active August 29, 2015 14:08
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Created on 2014-09-10 12:05:42
import os
import re
import json
import datetime
from libs.pprint import pprint
@binux
binux / tools.sh
Last active August 29, 2015 14:08
#!/bin/bash
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Binux<i@binux.me>
# http://binux.me
# Created on 2014-10-23 23:26:46
PROCESSOR=`uname -p`
# make tools dir
mkdir -p $HOME/tools
#!/bin/bash
#
# The Bash shell script executes a command with a time-out.
# Upon time-out expiration SIGTERM (15) is sent to the process. If the signal
# is blocked, then the subsequent SIGKILL (9) terminates it.
#
# Based on the Bash documentation example.
# Hello Chet,
# please find attached a "little easier" :-) to comprehend
@binux
binux / demo.py
Created March 8, 2014 03:15
demo script for douban.com
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Created on 2014-02-28 00:15:53
from libs.pprint import pprint
from libs.base_handler import *
class Handler(BaseHandler):
'''
@binux
binux / script.js
Last active August 29, 2015 13:56
// vim: set et sw=2 ts=2 sts=2 ff=unix fenc=utf8:
// Author: Binux<i@binux.me>
// http://binux.me
// Created on 2013-11-11 18:50:58
(function(){
function getOffset(elem) {
var top = 0;
var left = 0;
do {
@binux
binux / auto_vpn.sh
Created January 16, 2014 14:48
自动添加gfwlist域名的对应ip到路由表,实现动态自动翻墙
#!/bin/sh
while :
do
dev=$(ip link | grep state | awk '{ sub(":", "", $2); print $2 }' | grep vpn)
if [ $? -ne 0 ]; then
sleep 5
continue
fi
break
// vim: set et sw=2 ts=2 sts=2 ff=unix fenc=utf8:
// Author: Binux<i@binux.me>
// http://binux.me
// Created on 2013-09-17 10:53:19
(function() {
window.console = window.console || {};
window.console.log = window.console.log || function() {};
var _ = {};