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 | |
while [ 1 ] | |
do | |
gunicorn app:app --bind=$GUNICORN_BIND_ADDRESS --workers=$GUNICORN_WORKERS --log-level=$GUNICORN_LOG_LEVEL $GUNICORN_RELOAD --access-logfile=$GUNICORN_ACCESS_LOGFILE | |
echo '' | |
echo -e "\033[1;32m >>>>>> restart app, wait a moment... \033[0m" | |
sleep 3 | |
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
# coding: utf-8 | |
import time | |
from flask import Flask | |
from gevent.pywsgi import WSGIServer | |
from gevent import monkey | |
monkey.patch_all() | |
app = Flask(__name__) |
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
mongoexport --db anydata --host dds-bp1156dc1fedf0b41.mongodb.rds.aliyuncs.com --port 3717 -u anydata -p anydata123456 --collection merge_project --limit 1000 --out anydata.merge_project.json | |
mongoexport --db anydata --host dds-bp1156dc1fedf0b41.mongodb.rds.aliyuncs.com --port 3717 -u anydata -p anydata123456 --collection item_itjuzi_project --limit 1000 --out anydata.item_itjuzi_project.json | |
mongoexport --db anydata --host dds-bp1156dc1fedf0b41.mongodb.rds.aliyuncs.com --port 3717 -u anydata -p anydata123456 --collection item_itjuzi_investor --limit 1000 --out anydata.item_itjuzi_investor.json | |
mongoexport --db anydata --host dds-bp1156dc1fedf0b41.mongodb.rds.aliyuncs.com --port 3717 -u anydata -p anydata123456 --collection merge_vc --limit 1000 --out anydata.merge_vc.json | |
mongoexport --db anydata --host dds-bp1156dc1fedf0b41.mongodb.rds.aliyuncs.com --port 3717 -u anydata -p anydata123456 --collection item_itjuzi_vc --limit 1000 --out anydata.item_itjuzi_vc.json | |
mongoexport --db anydata --host dds-bp1156dc1f |
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
MongoDB 3.2 | |
cat xx.ar| mongorestore -h xxx --port xxx -u xxx -p xxx --drop --gzip --archive -vvvv --stopOnError |
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: utf-8 | |
from ec.models.order_sys.dao.goods_in_order import GoodsInOrderDAO | |
from ec.models.order_sys.dao.order import OrderDAO | |
from ec.models.const.order import OrderStatus | |
def get_orders(goods_id, start_time, end_time): | |
gids = GoodsInOrderDAO.where('goods_id = %s and create_time >= %s and create_time < %s', | |
goods_id, start_time, end_time) |
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
ll /tmp | grep www-data | grep -v grep | awk '{print $9}' |
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
yarn config set proxy http://127.0.0.1:1080 | |
yarn config set https-proxy http://127.0.0.1:1080 |
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 pandas as pd | |
li = [dict(id=1, url='baidu.com', c=1, d='a'), dict(id=1, url='sina.com', c=1, d='a'), dict(id=2, url='baidu.com', c=1, d='a'), dict(id=1, url='baidu.com', c=1, d='a'), dict(id=1, url='baidu.com', c=1, d='a')] | |
df = pd.DataFrame(li) | |
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
def convert(name): | |
s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', name) | |
return re.sub('([a-z0-9])([A-Z])', r'\1_\2', s1).lower() |
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
ln -s /tmp/.s.PGSQL.5432 /var/run/postgresql/.s.PGSQL.5432 |
NewerOlder