This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print 'test' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
#-*- coding: utf-8 -*- | |
import os | |
import sys | |
import datetime | |
import subprocess | |
import time | |
import gevent.pool | |
import gevent.monkey |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
#-*- coding: utf-8 -*- | |
import sys | |
def file_to_list(file): | |
with open(file) as f: | |
content = f.readlines() | |
return content | |
if __name__ == '__main__': |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import redis | |
import time | |
pool=redis.ConnectionPool(host='redis_hostname', port=6379, db=0) | |
r = redis.StrictRedis(connection_pool=pool) | |
start_time = time.time() | |
SUCCESS_DELETED = 0 | |
with open("/data/rediskeys") as kf: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import redis | |
pool=redis.ConnectionPool(host='redis_hostname', port=6379, max_connections=100) | |
r = redis.StrictRedis(connection_pool=pool) | |
cursor_number, keys = r.execute_command('scan', 0, "count", 200000) | |
while True: | |
if cursor_number == 0: | |
# 结束一次完整的比遍历 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#coding:utf8 | |
import random | |
import math | |
WIN = 1 | |
LOSE = 0 | |
def gambling_50_percent(pocket, pay): | |
result = random.randint(0, 1) | |
if result == WIN: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hashlib | |
import json | |
from time import time | |
from urllib.parse import urlparse | |
from uuid import uuid4 | |
import requests | |
from flask import Flask, jsonify, request | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package proxy | |
import ( | |
"io" | |
"net" | |
"sync" | |
log "github.com/Sirupsen/logrus" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: mit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# You need install jenkins go plugin first -> https://wiki.jenkins.io/display/JENKINS/Go+Plugin | |
#!/usr/bin/bash | |
export GOPATH=$WORKSPACE | |
mkdir -p $GOPATH/src | |
project_name=$(echo $GIT_URL | awk -F/ '{print $NF}' | sed 's/.git//g') | |
echo ${project_name} | |
ln -f -s $WORKSPACE $GOPATH/src/$project_name | |
go get $project_name |
OlderNewer