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
# Load csv data by mapreduce | |
HADOOP_CLASSPATH=/opt/hbase-0.98.19-hadoop2/lib/hbase-protocol-0.98.19-hadoop2.jar:/opt/hbase-0.98.19-hadoop2/conf hadoop jar /opt/phoenix-4.7.0-HBase-0.98-bin/phoenix-4.7.0-HBase-0.98-client.jar org.apache.phoenix.mapreduce.CsvBulkLoadTool --table WEB_STAT --input /tmp/WEB_STAT.csv | |
# Create table in Phoenix | |
/opt/phoenix-4.7.0-HBase-0.98-bin/bin/psql.py hadoop-offline012.dx.momo.com,hadoop-offline013.dx.momo.com,hadoop-offline014.dx.momo.com,hadoop-offline015.dx.momo.com,hadoop-offline016.dx.momo.com,hadoop-offline017.dx.momo.com,hadoop-offline018.dx.momo.com:2181 /opt/phoenix-4.7.0-HBase-0.98-bin/examples/WEB_STAT.sql | |
# Display complete columns | |
!outputformat vertical |
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
#用户名 | |
#rpc-user=user | |
#密码 | |
#rpc-passwd=passwd | |
#上面的认证方式不建议使用,建议使用下面的token方式 | |
#设置加密的密钥 | |
#rpc-secret=token | |
#允许rpc | |
enable-rpc=true | |
#允许所有来源, web界面跨域权限需要 |
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
MONGO_PATH='/home/dm/mongo_dev/mongodb-linux-x86_64-rhel62-3.2.1' | |
echo "Add mongo to env..." | |
export PATH=$MONGO_PATH/bin/:$PATH |
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
requests==2.4.3 | |
rsa==3.1.4 |
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
#!/usr/bin/env python | |
#-*- coding: utf-8 -*- | |
#下載以下兩個文件 | |
#zh_wiki.py:https://github.com/skydark/nstools/blob/master/zhtools/zh_wiki.py | |
#langconv.py:https://github.com/skydark/nstools/blob/master/zhtools/langconv.py | |
from langconv import Converter | |
line = u"籃球" |
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
#!/usr/bin/env python | |
#-*- coding:utf-8 -*- | |
import re | |
regexp = ur"[\u2E80-\u9FFFa-zA-Z0-9]+" | |
assert re.match(regexp, u"愛美國愛臺灣") != None | |
assert re.match(regexp, u"打倒土共") != None | |
assert re.match(regexp, u"fuck GFW 打倒方校长!") != None |
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
#!/usr/bin/env python | |
#-*-coding: utf-8 -*- | |
import urllib2 | |
import sys | |
def load_url(f): | |
return [line.strip() for line in open(f)] | |
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
#http://rubular.com/r/F2OqmFF150 | |
import re | |
r = """\/\*.*[^*]{0,}\*\/|\/\/.*""" | |
test_string = """ | |
// my program in C++ | |
#include <iostream> | |
/** playing around in |
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
#!/bin/bash | |
unset LANG # deal with "illegal byte sequence" error | |
for filename in *txt; do | |
echo $filename | |
ex $filename "+set ff=unix fileencoding=utf-8" "+x" | |
done |
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 schedule | |
import time | |
def scheduled(t): | |
def wrapper(func): | |
schedule.every(7).days.at(t).do(func) | |
while True: | |
schedule.run_pending() | |
time.sleep(1) |