This file contains hidden or 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 sys | |
def main(): | |
if len(sys.argv) < 2: | |
print 'please enter file path' | |
file_path = sys.argv[1] | |
with open(file_path, 'r') as f: | |
s = f.read() | |
try: |
This file contains hidden or 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 commands | |
import time | |
def get_current_ssh_user(): | |
output = commands.getoutput('users') | |
return output.split(' ') if output else None | |
def get_current_ssh_user_set(): |
This file contains hidden or 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 zhprint(obj): | |
import re | |
print re.sub(r"\\u([a-f0-9]{4})", lambda mg: unichr(int(mg.group(1), 16)), obj.__repr__()) | |
This file contains hidden or 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
#### ####################################################### | |
# | |
# MAKEFILE FOR C/C++ PROJECT | |
# Author: swm8023 <[email protected]> | |
# Date: 2014/01/30 | |
# | |
#### ####################################################### | |
.PHONY: all clean | |
all: |
This file contains hidden or 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
```shell | |
pt-online-schema-change \ | |
--execute \ | |
--no-check-alter \ | |
--ask-pass \ | |
--recursion-method none \ | |
--set-vars lock_wait_timeout=3 \ | |
--alter "change serial_code warehouse_code varchar(100) not null default ''" \ | |
u=xcf,h=xcfapp-mysql,D=xcf_mfarm,t=fresh_warehouse |
This file contains hidden or 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
d = create_delivery('哎呀,又要测试啦', 'homepage_banner_ad1', 'ad_team',419, 9999,'2017-08-07 10:00:00', '2017-09-15 00:00:00','gzx', {"mobile_website":"1","pc_website":"1","iphone":"4.0.0","android":"100"}, [], [], {"android":{"expose_tracking_url":[],"click_tracking_url":[]},"iphone":{"expose_tracking_url":[],"click_tracking_url":[]},"mobile_website":{"expose_tracking_url":[],"click_tracking_url":[]},"pc_website":{"expose_tracking_url":[],"click_tracking_url":[]}}, {'market_newbie': {'data': [3], 'operator': '>='}}) |
This file contains hidden or 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
```conf | |
server { | |
listen 80; | |
server_name | |
venice-d2.xiachufang.com; | |
location / { | |
proxy_pass http://hazelnut:10080; | |
include proxy_params; | |
} |
This file contains hidden or 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
```sql | |
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password'; | |
GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost'; | |
FLUSH PRIVILEGES; | |
GRANT ALL PRIVILEGES ON DB_NAME.* TO user_name@'%'; | |
``` |
This file contains hidden or 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
```python | |
from ec.broker.user_persona import update_user_persona | |
from mysite.model.user import User | |
from mysite.model.const.user import STATE_ACTIVE | |
from mysite.util.orm import ormiter | |
from progress.bar import Bar | |
if __name__ == '__main__': |
This file contains hidden or 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 requests | |
import re | |
import hashlib | |
import simplejson | |
from bs4 import BeautifulSoup | |
requests.adapters.DEFAULT_RETRIES = 10 | |
session = requests.session() |
OlderNewer