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
| OUT := binariy-name | |
| PKG := gitlab.com/group/project | |
| VERSION := $(shell git describe --always --long --dirty) | |
| PKG_LIST := $(shell go list ${PKG}/... | grep -v /vendor/) | |
| GO_FILES := $(shell find . -name '*.go' | grep -v /vendor/) | |
| all: run | |
| server: | |
| go build -i -v -o ${OUT} -ldflags="-X main.version=${VERSION}" ${PKG} |
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
| [General] | |
| loglevel = notify | |
| all-tcp-mode = false | |
| [Proxy] | |
| Proxy = custom | |
| [Rule] | |
| // iOS Maps | |
| DOMAIN-SUFFIX,ls.apple.com,DIRECT |
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
| # This config file was created for myself (@janlay). You may want to add or remove some rules to make efficient use of the Internet. | |
| [General] | |
| # warning, notify, info, verbose | |
| loglevel = notify | |
| [Proxy] | |
| # http, https, socks5 | |
| Proxy = custom, 1.2.3.4, 443, rc4-md5, password, http://server/custom.module |
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
| good, 你已经有了一个自己的shadowsocks代理了,现在想要把这个代理公布出去给所有人分享。 | |
| 但是没有两个小时,代理就没法使用了,为什么?因为你需要额外注意以下事项(以下步骤需要比较高的linux技能) | |
| 本文只关注于确保shadowsocks服务还“活着”,如果你希望让其跑得更快,请参考 | |
| https://github.com/clowwindy/shadowsocks/wiki/Optimizing-Shadowsocks | |
| 1、 shadowsocks的timeout设置 | |
| 超时时间越长,连接被保持得也就越长,导致并发的tcp的连接数也就越多。对于公共代理,这个值应该调整得小一些。推荐60秒。 | |
| 2、 检查操作系统的各种限制 | |
| 对于openvz的vps,特别需要检查一下 |
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 -*- | |
| '写了一个简单的支持中文的正向最大匹配的机械分词,其它不用解释了,就几十行代码' | |
| '搜狗词库下载地址:http://vdisk.weibo.com/s/7RlE5' | |
| import string | |
| __dict = {} | |
| def load_dict(dict_file='words.dic'): | |
| '加载词库,把词库加载成一个key为首字符,value为相关词的列表的字典' |
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
| L1 cache reference 0.5 ns | |
| Branch mispredict 5 ns | |
| L2 cache reference 7 ns | |
| Mutex lock/unlock 25 ns | |
| Main memory reference 100 ns | |
| Compress 1K bytes with Zippy 3,000 ns | |
| Send 2K bytes over 1 Gbps network 20,000 ns | |
| Read 1 MB sequentially from memory 250,000 ns | |
| Round trip within same datacenter 500,000 ns | |
| Disk seek 10,000,000 ns |