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=utf8 | |
import urllib2 | |
import json | |
import argparse | |
def authenticate(url, username, password): | |
values = {'jsonrpc': '2.0', | |
'method': 'user.login', | |
'params': { | |
'user': username, |
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 base64 | |
from Crypto.Cipher import AES | |
BS = AES.block_size | |
pad = lambda s: s + (BS - len(s) % BS) * chr(BS - len(s) % BS) | |
unpad = lambda s: s[0:-ord(s[-1])] | |
key = '80e36e39f34e678c' | |
cipher = AES.new(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
# coding=utf-8 | |
from Crypto.Cipher import AES | |
import base64 | |
import os | |
# via http://sentdex.com/sentiment-analysisbig-data-and-python-tutorials-algorithmic-trading/encryption-and-decryption-in-python-code-example-with-explanation/ | |
# key从p2p StringHelper来 | |
key = '80e36e39f34e678c' |
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
/** | |
* 连接ldap服务器验证用户 | |
* | |
* @author wangfei | |
* @created 2012-2-22 | |
* | |
* @version 1.0 | |
*/ | |
public class LDAPManager { |
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
-- 查看mysql 二进制日志天数 | |
show variables like '%expire%'; | |
-- 将二进制日志天数设置为10天 | |
set global expire_logs_days=10; |
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 | |
function __help(){ | |
echo "usage: exportcsv.sh <mysql用户名> <mysql密码>" | |
} | |
function __export(){ | |
mysql -u$USERNAME -p$PASSWD --default-character-set=utf8 -Dmeituanwage -B -e "$SQL" > ${OUTFILE}.origin | |
sed -e 's/"/\"/g;s/ /","/g;s/^/"/g;s/$/"/g;' ${OUTFILE}.origin > utf8.${OUTFILE}.csv | |
iconv -f "UTF-8" -t "gbk" utf8.${OUTFILE}.csv > gbk.${OUTFILE}.csv |