抽取所有英文单词的基本形式,小写,计数。
python to_word_list.py path_to_text.txt min_word_count
e.g.
Look at LSB init scripts for more information.
Copy to /etc/init.d
:
# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
#!/bin/bash | |
DIR=/data/logs/nginx/ | |
rotate_log() { | |
FILENAME=$1 | |
SRC=$DIR/$FILENAME | |
DEST=$DIR/${FILENAME}.$(date yesterday +%y%m%d) | |
mv $SRC $DEST | |
} |
sudo apt-get install texinfo | |
curl -L https://github.com/jech/polipo/archive/polipo-1.1.1.tar.gz -o polipo-1.1.1.tar.gz | |
tar xzf polipo-1.1.1.tar.gz | |
cd polipo-polipo-1.1.1 && make all | |
# TODO edit config.sample to /etc/polipo/config | |
# ssh -N -L 8123:localhost:8123 user@host | |
# export http_proxy http://localhost:8123 | |
# $ ssh -f -C -L 8124:localhost:8123 trurl polipo | |
# $ polipo parentProxy=localhost:8124 |
ver=2.7.0 | |
useradd -d /data/hadoop hadoop | |
wget http://apache.fayea.com/hadoop/common/hadoop-${ver}/hadoop-${ver}.tar.gz | |
tar xzvf hadoop-${ver}.tar.gz | |
sudo mv hadoop-${ver} /opt/hadoop |
#!/bin/sh | |
# pass args to stdin | |
for ((i=1;i<=100;i++)); do ssh 10.1.0.$i 'echo -e "linuxpassword\nlinuxpassword" | passwd linuxuser'; done; |
#!/bin/sh | |
# 截取 sql | |
cat sql_detail_log.log | grep Statement | cut -f 9- -d ' ' | sed 's/^ *//g' | tr -s ' ' > sql_clean.log | |
# 截取 sql | |
cat friend_sql_grep.log | cut -f 8- -d ' ' | tr -s ' ' >> sql_clean.log | |
# 去除 where 和 分表 \ | |
# 排序并统计 \ | |
# 规范统计结果 再次排序 | |
cat sql_clean.log | tr '[:upper:]' '[:lower:]' | sed 's/where.*//' | sed 's/_[0-9][0-9]/_XX/' \ | |
| sort | uniq -c \ |
/** | |
* 定制指南: | |
* getKeyInfoOfRequest : 获取缓存key的方法 | |
* setCache | |
* getCache | |
*/ | |
var crypto = require('crypto') | |
var redis = require('redis') | |
var parseUrl = require('url').parse |
var http = require('http'); | |
var sys = require('sys'); | |
var fs = require('fs'); | |
var blacklist = []; | |
var iplist = []; | |
fs.watchFile('./blacklist', function(c,p) { update_blacklist(); }); | |
fs.watchFile('./iplist', function(c,p) { update_iplist(); }); |
/** | |
* @param {Socket} socket auto handle 'data' event, and emit 'packet' event. | |
* @param {Object} options options params | |
* options.headSize the size of header | |
* options.getBodySize function(headBuffer) return bodySize | |
*/ | |
exports.autoParsePacket = function (socket, options) { | |
var headSize = options.headSize; | |
var getBodySize = options.getBodySize; | |
if(!headSize || headSize <= 0) { |