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
#!/bin/bash | |
set -e | |
if [ $# != 2 ]; then | |
echo "please input ip and port, example: sh redis.sh 127.0.0.1 6379" | |
exit 1 | |
fi | |
redis-cli -h $1 -p $2 --scan --pattern "*:[0-9]*[0-9]" | grep -v '^chouti:links:[0-9]\+$' | tee error.txt |
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
#!/bin/bash | |
set -e | |
for i in $(find . -name .git); do | |
echo "Git pull: ${i:2:$((${#i}-7))}" | |
(cd $PWD${i:1:$((${#i}-6))} && git pull) | |
echo | |
done |
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
python3 -O -m compileall -b . | |
find . -name "*.py" | xargs rm -rf | |
find . -name "__pycache__" | xargs rm -rf |
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
""" | |
(venv) $ python process_thread_coroutine.py | |
[2019-08-22 08:17:24,661Z - INFO - kipp] - main running... | |
[2019-08-22 08:17:24,661Z - INFO - kipp] - coroutine_main running... | |
[2019-08-22 08:17:24,662Z - INFO - kipp] - io_blocking_task running... | |
[2019-08-22 08:17:24,675Z - INFO - kipp] - coroutine_task running... | |
[2019-08-22 08:17:24,676Z - INFO - kipp] - coroutine_error running... | |
[2019-08-22 08:17:24,677Z - INFO - kipp] - coroutine_error end, cost 0.00s | |
[2019-08-22 08:17:24,678Z - INFO - kipp] - cpu_blocking_task running... |
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
db.getCollection('xxx').find({"type": "xxx", "from": {$ne: "xxx"}}).sort({"Time": -1}).count() |
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 time | |
import json | |
import hashlib | |
from random import randint | |
import requests | |
APP_ID = '' | |
APP_KEY = '' |
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
class Cursor(object): | |
""" | |
只是翻页的结构, 原始值有三种: 0, None, 其他 | |
若是 0, 其实是上次返回时指示已没有结果的意思, 应返回空 | |
若是 None, 表示是第一次请求, 应使用默认参数对请求做出响应 | |
若是其他值, 正数表示像后翻, 负数表示向前翻 | |
""" | |
DIRECTION_NEXT = 'next' | |
DIRECTION_PREVIOUS = 'previous' | |
DIRECTION_NONE = None |
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
for i in 1 2 3 4 | |
do | |
pmset displaysleepnow | |
sleep 1 | |
caffeinate -u -t 1 | |
sleep 2 | |
done |
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
Q: abandon | |
A: 【考法 1】 n. 放纵: carefree, freedom from constraint | |
A: 【考法 2】 v. 放纵: to give (oneself) over unrestrainedly | |
A: 【考法 3】 v. 放弃: to withdraw from often in the face of danger or encroachment | |
A: 【考法 4】 v. 停止做某事: to put an end to (something planned or previously agreed to) | |
Q: awning | |
A: 【考法 1】 n. 雨篷,遮阳篷: a piece of material attached to a caravan or building which provides shelter from the rain or sun | |
Q: mercenary |