架设好 shadowsocks 服务端,在路由器上安装 shadowsocks 客户端,并配置 /etc/config/shadowsocks.json ,假设本地监听端口为 1080 。启动 shadowsocks
/etc/init.d/shadowsocks start
安装 privoxy openwrt 版。
// | |
// CLLocation+Sino.h | |
// | |
// Created by [email protected] on 13-4-26. | |
// 火星坐标系转换扩展 | |
// | |
// earth(国外 WGS84), mars(国内 GCJ-02), bearPaw(百度 BD-09) 坐标系间相互转换 | |
// 未包含 mars2earth. 需要这个可参考 http://xcodev.com/131.html | |
#import <CoreLocation/CoreLocation.h> |
This Gist has been moved to https://github.com/lbgists/audio-spectrum-matplotlib.
If you are interested, see also my previous setup.
I use a Mid 2013 11-inch MacBook Air at home.
I use Logitech Performance MX mice with all three of them, though for the last one is usually just the trackpad. I have recently started using a Logitech MX Master and decided to only buy that from now on.
''' | |
Short URL Generator | |
=================== | |
Python implementation for generating Tiny URL- and bit.ly-like URLs. | |
A bit-shuffling approach is used to avoid generating consecutive, predictable | |
URLs. However, the algorithm is deterministic and will guarantee that no |
// oldj:设 A = $("#id a"),B = $("#id .c a"),求 A - B。要求: | |
// 1、不能用 jQuery 等框架; | |
// 2、兼容 IE6 在内的各大浏览器; | |
// 3、尽可能高效; | |
// 4、尽可能简短。 | |
function getWanted() { | |
var root = document.getElementById('id') | |
var all = root.getElementsByTagName('*') |
document.body.innerHTML = "<canvas id='cvs' width='1200px' height='600px'></canvas>"; | |
cvs = document.getElementById('cvs'); | |
ctx = cvs.getContext('2d'); | |
cvs.onmousedown = function(){ | |
cvs.onmousemove = function(e){ctx.fillRect(e.offsetX,e.offsetY,2,2);console.log(e.clientX);} | |
}; | |
cvs.onmouseup = function(){ cvs.onmousemove =function(e){}}; |
CELERY=`ps -A -o pid,rss,command | grep celeryd | grep -v grep | awk '{total+=$2}END{printf("%d", total/1024)}'` | |
GUNICORN=`ps -A -o pid,rss,command | grep gunicorn | grep -v grep | awk '{total+=$2}END{printf("%d", total/1024)}'` | |
REDIS=`ps -A -o pid,rss,command | grep redis | grep -v grep | awk '{total+=$2}END{printf("%d", total)}'` | |
NGINX=`ps -A -o pid,rss,command | grep nginx | grep -v grep | awk '{total+=$2}END{printf("%d", total/1024)}'` | |
OTHER=`ps -A -o pid,rss,command | grep -v nginx | grep -v celeryd | grep -v gunicorn | grep -v redis | grep -v grep | awk '{total+=$2}END{printf("%d", total/1024)}'` | |
websites=`ps -A -o user,pid,rss,command | grep gunicorn | egrep -o "[a-z_]+\.py$" | sort | uniq | perl -wpe 's|\.py$||;' | xargs` | |
printf "%-10s %3s MB\n" "Celery:" $CELERY | |
printf "%-10s %3s MB\n" "Gunicorn:" $GUNICORN | |
printf "%-10s %3s MB\n" "Nginx:" $NGINX | |
printf "%-10s %3s KB\n" "Redis:" $REDIS |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# | |
# zipdb.py | |
# Use a zipfile store a dict like k-v database. | |
# Known bug: duplicate key(filenames) allowed | |
# | |
# Copyright 2012 mayli <[email protected]> | |
# |
upstream rrbackend { | |
server 127.0.0.1:8080 weight=3; | |
server 127.0.0.1:8888; | |
} | |
map $cookie_backend $backend { | |
default rrbackend; | |
experimental 127.0.0.1:8888; | |
} |