关于减轻功夫墙(GFW)造成的不便的一些探讨

使用gooreplacer重定向对Google的访问

众所周知,天朝无法访问任何Google的服务。但不幸很多外国网站,如码农必备的Stackoverflow等都会调用Google的API,这就导致了这些网站访问速度巨慢,功能不全等问题。在网上发现了有人开发的关于可以重定向Google API到国内镜像的插件,可以用于Firefox和Google Chrome上。特记录于此:
插件地址:https://github.com/jiacai2050/gooreplacer
如果只需要重定向Google的访问,可以复制如下Rules,保存为.gson格式后导入。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{
"createBy": "http://liujiacai.net/gooreplacer/",
"createAt": "Tue Jan 10 2017 17:45:39 GMT+0000",
"rules": {
"ajax.googleapis.com": {
"dstURL": "ajax.proxy.ustclug.org",
"kind": "wildcard",
"enable": true
},
"storage.googleapis.com": {
"dstURL": "storage-googleapis.proxy.ustclug.org",
"kind": "wildcard",
"enable": true
},
"gerrit.googlesource.com": {
"dstURL": "gerrit-googlesource.proxy.ustclug.org",
"kind": "wildcard",
"enable": true
},
"themes.googleusercontent.com": {
"dstURL": "google-themes.proxy.ustclug.org",
"kind": "wildcard",
"enable": true
},
"platform.twitter.com/widgets.js": {
"dstURL": "cdn.rawgit.com/jiacai2050/gooreplacer/gh-pages/proxy/widgets.js",
"kind": "wildcard",
"enable": true
},
"apis.google.com/js/api.js": {
"dstURL": "cdn.rawgit.com/jiacai2050/gooreplacer/gh-pages/proxy/api.js",
"kind": "wildcard",
"enable": true
},
"apis.google.com/js/plusone.js": {
"dstURL": "cdn.rawgit.com/jiacai2050/gooreplacer/gh-pages/proxy/plusone.js",
"kind": "wildcard",
"enable": true
}
}
}

Read More

Tesseract

Install

1. Required package

1
2
3
apt install autoconf-archive automake g++ libtool make pkg-config # for main recognization
apt install asciidoc # for document
apt-get install libicu-dev libpango1.0-dev libcairo2-dev # for training tool
1.1 Build libleptonica-dev from source
1
2
3
4
5
6
7
sudo -i # build as root
wget http://www.leptonica.org/source/leptonica-1.76.0.tar.gz # check http://www.leptonica.org/download.html for latest version
tar -xzf leptonica-1.76.0.tar.gz
cd leptonica-1.76.0/
./configure
make
make install

Read More

Git tricks

Caching GitHub password in Git

In Terminal, enter the following:

1
2
git config --global credential.helper cache
# Set git to use the credential memory cache

To change the default password cache timeout, enter the following:

1
2
git config --global credential.helper 'cache --timeout=3600'
# Set the cache to timeout after 1 hour (setting is in seconds)

Read More