I hereby claim:
- I am tmpbook on github.
- I am tmpbook (https://keybase.io/tmpbook) on keybase.
- I have a public key ASC9HobDwyVVRTVVuiR7Yo0vdrXxiz_fmNI82Zasrs8_3Qo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| #!/bin/bash | |
| set -ex | |
| mkdir -p /data0/xxxx-access-api/data | |
| chown -R go:go /data0/xxxx-access-api/data | |
| rm -f /etc/supervisord.d/xxxx-access.ini | |
| cat << EOF > /etc/supervisord.d/xxxx-access-api.ini |
| # 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 |
| license: mit |
| package proxy | |
| import ( | |
| "io" | |
| "net" | |
| "sync" | |
| log "github.com/Sirupsen/logrus" | |
| ) |
| 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 | |
| #coding:utf8 | |
| import random | |
| import math | |
| WIN = 1 | |
| LOSE = 0 | |
| def gambling_50_percent(pocket, pay): | |
| result = random.randint(0, 1) | |
| if result == WIN: |
| 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: | |
| # 结束一次完整的比遍历 |
| 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: |
| #!/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__': |