Skip to content

Instantly share code, notes, and snippets.

View messense's full-sized avatar
🐢
I may be slow to respond on workdays.

messense messense

🐢
I may be slow to respond on workdays.
View GitHub Profile

Keybase proof

I hereby claim:

  • I am messense on github.
  • I am messense (https://keybase.io/messense) on keybase.
  • I have a public key whose fingerprint is 1961 A032 8346 7E2B 2FA2 BD15 BB41 A8A2 C716 CCA9

To claim this, I am signing this object:

@messense
messense / npm-debug-2016-11-14.log
Created November 14, 2016 07:51
npm-debug-2016-11-14.log
This file has been truncated, but you can view the full file.
npm ERR! registry error parsing json
npm ERR! Linux 3.14.32-xxxx-grs-ipv6-64
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "--loglevel=warn"
npm ERR! node v6.9.1
npm ERR! npm v3.10.8
npm ERR! Unexpected token < in JSON at position 0
npm ERR! <html>
npm ERR! <head><title>400 Bad Request</title></head>
@messense
messense / sim_taobao.py
Created October 10, 2015 06:46
模拟登录淘宝
# -*- coding: utf-8 -*-
import os
import re
import json
import pickle
import logging
import logging.config
import requests
@messense
messense / rk.py
Created October 10, 2015 06:41
若快验证码
#!/usr/bin/env python
# coding:utf-8
import requests
from hashlib import md5
class RClient(object):
def __init__(self, username, password, soft_id, soft_key):
self.username = username
@messense
messense / jsonserializer.py
Created May 7, 2014 12:32
Patch django.core.signing.JSONSerializer to support mongodb ObjectId serialization.
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from bson import json_util as json
class JSONSerializer(object):
"""
Simple wrapper around json to be used in signing.dumps and
signing.loads.
"""
@messense
messense / objectdict.py
Created April 12, 2014 03:37
Python ObjectDict
class ObjectDict(dict):
def __getattr__(self, key):
if key in self:
return self[key]
return None
def __setattr__(self, key, value):
self[key] = value
@messense
messense / proxy.pac
Last active December 17, 2015 09:39
pac file
/**
* GenPAC 0.2.1 http://jeeker.net/projects/genpac/
* Generated: Fri, 17 May 2013 14:15:55 GMT
* GFWList Last-Modified: Fri, 17 May 2013 12:41:31 GMT
*/
// proxy
var P = "PROXY 192.168.1.1:8118; DIRECT";
// user rules
@messense
messense / shadowsocks-on-openwrt.md
Last active June 8, 2023 07:49
shadowsocks on openwrt

配置 shadowsocks

架设好 shadowsocks 服务端,在路由器上安装 shadowsocks 客户端,并配置 /etc/config/shadowsocks.json ,假设本地监听端口为 1080 。启动 shadowsocks

/etc/init.d/shadowsocks start

配置 privoxy

安装 privoxy openwrt 版。

@messense
messense / cmccedu.py
Last active December 17, 2015 05:59
CMCC-EDU WLAN login tool for weak password accounts
#!/bin/env python
from __future__ import with_statement
import sys
import logging
import requests
import urllib
import getopt
if sys.version_info < (2, 6):
import simplejson as json
else:
@messense
messense / service.sh
Last active December 10, 2015 06:48
gentoo service shell script, provide service NAME start/stop/restart function
. /etc/init.d/functions.sh
VERSION="`basename $0` ver. 0.91"
USAGE="Usage: `basename $0` < option > | --status-all | \
[ service_name [ command | --full-restart ] ]"
SERVICE=
SERVICEDIR="/etc/init.d"
OPTIONS=
if [ $# -eq 0 ]; then