Skip to content

Instantly share code, notes, and snippets.

@tonicmuroq
tonicmuroq / gist:2852253
Created June 1, 2012 13:43 — forked from zythum/gist:2848881
google收录的敏感词
# -*- coding:utf-8 -*-
'写了一个简单的支持中文的正向最大匹配的机械分词,其它不用解释了,就几十行代码'
'搜狗词库下载地址:http://vdisk.weibo.com/s/7RlE5'
import string
__dict = {}
def load_dict(dict_file='words.dic'):
'加载词库,把词库加载成一个key为首字符,value为相关词的列表的字典'
@tonicmuroq
tonicmuroq / README.md
Created February 23, 2013 15:57 — forked from wong2/README.md

人人的登录改版后,采用RSA加密后传输密码,该项目用于解决这种情况下人人的模拟登录

使用前先 pip install requests

@tonicmuroq
tonicmuroq / vimrc
Created August 11, 2014 08:48
vimrc
syntax on
filetype off
" format and user interface
set nocompatible
set number
set softtabstop=4 tabstop=4 shiftwidth=4
set expandtab
set autoindent
set incsearch
@tonicmuroq
tonicmuroq / ipservice.conf
Last active August 29, 2015 14:12
nginx.conf
user nginx;
worker_processes 24;
error_log /mnt/mfs/logs/nbe/master/error-kili10.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 102400;
}
2014/12/25 15:17:08 [error] 21798#0: *1962274 connect() failed (110: Connection timed out) while connecting to upstream, client: 10.1.201.16, server: ipservice.intra.hunantv.com, request: "GET /exec?ip=116.186.128.2 HTTP/1.0", upstream: "http://10.1.201.46:80/exec?ip=116.186.128.2", host: "ipservice.intra.hunantv.com"
2014/12/25 15:17:08 [error] 21792#0: *1962290 connect() failed (110: Connection timed out) while connecting to upstream, client: 10.1.201.16, server: ipservice.intra.hunantv.com, request: "GET /exec?ip=116.186.128.2 HTTP/1.0", upstream: "http://10.1.201.46:80/exec?ip=116.186.128.2", host: "ipservice.intra.hunantv.com"
2014/12/25 15:17:08 [error] 21792#0: *1962289 connect() failed (110: Connection timed out) while connecting to upstream, client: 10.1.201.16, server: ipservice.intra.hunantv.com, request: "GET /exec?ip=116.186.128.2 HTTP/1.0", upstream: "http://10.1.201.46:80/exec?ip=116.186.128.2", host: "ipservice.intra.hunantv.com"
2014/12/25 15:17:08 [error] 21798#0: *1962275 connect() failed (
@tonicmuroq
tonicmuroq / sysctl
Created December 25, 2014 09:52
sysctl
net.ipv4.ip_forward = 1
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
@tonicmuroq
tonicmuroq / test_sentry.py
Created January 8, 2015 02:14
test_sentry.py
from flask import Flask
from raven.contrib.flask import Sentry
app = Flask(__name__)
sentry = Sentry(dsn='')
sentry.init_app(app)
@app.route('/')
package main
import (
"database/sql"
_ "github.com/go-sql-driver/mysql"
"io/ioutil"
"strings"
)
func main() {
@tonicmuroq
tonicmuroq / request.py
Created August 14, 2015 09:44
server simply get `value` from querystring and returns it, request simply pass `value` in querystring and tests if the return value equals `value`
# coding: utf-8
import random
import requests
import multiprocessing
def request_once():
randint = random.randint(1, 10000)
url = 'http://localhost:8000?value=%s' % randint
r = requests.get(url)