Skip to content

Instantly share code, notes, and snippets.

View cloverstd's full-sized avatar
🀄
Working for living

cloverstd cloverstd

🀄
Working for living
View GitHub Profile
worker_processes 2;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
use epoll;
}
@cloverstd
cloverstd / cache.py
Created November 25, 2013 14:23
Tornado Cache
# coding: utf-8
import redis
import functools
try:
import cPickle as pickle
except ImportError:
import pickle
try:
import hashlib
# -*- coding: utf-8 -*-
# http://boxcar.io
# send message to mobile
__author__ = "Cloverstd"
import urllib
import urllib2
import json
@cloverstd
cloverstd / cache.py
Last active October 27, 2021 05:35
tornado cache
# coding: utf-8
try:
import cPickle as pickle
except ImportError:
import pickle
try:
import hashlib
sha1 = hashlib.sha1
@cloverstd
cloverstd / qiniu_download.sh
Created July 24, 2014 01:48
七牛批量下载
#!/bin/bash
key="infopush.debug.log.2014-07-"
suffix=".tar.gz"
for ((j=16; j<24; j++)); do
key_day=${key}${j}"-"
for ((i=0; i<24; i++)); do
if ((${i} < 10));then
key22="22/"${key_day}"0"${i}
@cloverstd
cloverstd / main.py
Last active August 29, 2015 14:06
IFTTT webhook by Python with Tornado
#!/usr/bin/env python
# encoding: utf-8
from tornadorpc.xml import XMLRPCHandler
import tornado.ioloop
import tornado.httpserver
import tornado.web
@cloverstd
cloverstd / app.py
Last active November 4, 2019 21:33
微信二维码扫描登录
#!/usr/bin/env python
# encoding: utf-8
import tornado.ioloop
import tornado.httpclient
import tornado.web
import tornado.gen
import json
import tornado.websocket
import Queue
@cloverstd
cloverstd / aliyun.sources.list
Last active August 31, 2016 05:03 — forked from taichunmin/aliyun.sources.list
阿里云 ubuntu 14.04 镜像
# deb http://mirrors.aliyun.com/ubuntu trusty main restricted
# deb http://mirrors.aliyuncs.com/ubuntu trusty main restricted
# deb http://mirrors.aliyun.com/ubuntu trusty-updates main restricted
# deb http://mirrors.aliyuncs.com/ubuntu trusty-updates main restricted
# deb http://security.ubuntu.com/ubuntu trusty-security main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://mirrors.aliyun.com/ubuntu trusty main restricted
@cloverstd
cloverstd / public_key
Last active August 29, 2015 14:20
gench key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDolyzLgc+keal0kSgpG24smd8pk0c7jgzcebRMrWiTqYpcu8ber6KjUf8nBLKVvx8t2K40c+xIUA7ptMryXiAz6tCckFC2rTmp7S7gqdjpEk0HgGU+m/WliZDyV1X0cYqiG2y/KlizDxgR40uAYXhRgT3dfrcQi5GO9qg+dUDip9lBsF2f/lnOOmYOVJMEHu77NklyWOMa3DJF1BiTxe+CtFd4sU0P7oidemik099HqWSf3lgxYqu/rgqCumLIHWF/CI8714xlfe64lcsTwMJsd7xL0qgTYvDmLmynFKwQEsDgvcZcRNEEI5pkC9kZ9/rQBDr8yaobArRo7QGXM3KD cloverstd@gmail.com
@cloverstd
cloverstd / jobs.py
Last active August 29, 2015 14:20
python-rq with tornado asynchronous
#!/usr/bin/env python
# encoding: utf-8
import time
def test(interval):
for i in xrange(int(interval)):
print i
time.sleep(1)