A Comprehensive Note about Proxy Settings

Git > cat ~/.gitconfig [http] proxy = socks5://[host]:[port] [https] proxy = socks5://[host]:[port] Curl (Homebrew) > cat ~/.curlrc socks5 = "[host]:[port]" Docker pull env HTTP_PROXY=http://xxx docker pull yyy GAE Set proxy export HTTP_PROXY http://[host]:[port] export HTTPS_PROXY http://[host]:[port] Delete cacerts.txt under GAE SDK installation to disable SSL verification ( make sure the proxy is safe before this step). Deploy. appcfg.py . --email=[address] --passin

July 8, 2015

A Brief Note on Scientific Web Surfing

Knowledge is power. Information is liberating. — by Kofi Annan. VPS CloudsVM Vultr DigitalOcean BandwagonHOST Client Area -> Services -> Order New Services 64MB RAM is enough for running both ShadowSocks and pdnsd Install Ubuntu LTS 32bit (x86, i686) or CentOS 7. CentOS Install CentOS 7 (64bit) Shadowsocks cd /etc/yum.repos.d/ wget https://copr.fedorainfracloud.org/coprs/librehat/shadowsocks/repo/epel-7/librehat-shadowsocks-epel-7.repo yum update yum install shadowsocks-libev cd /etc/shadowsocks-libev/ vim config.json # server should be 0.0.0.0 vi /usr/lib/systemd/system/shadowsocks-libev.service # replace all $variables to constant values to fix the bug systemctl enable shadowsocks-libev systemctl start shadowsocks-libev pdnsd wget http://members.home.nl/p.a.rombouts/pdnsd/releases/pdnsd-1.2.9a-par_sl6.x86_64.rpm yum localinstall pdnsd-1.2.9a-par_sl6.x86_64.rpm vim /etc/pdnsd.conf pdnsd.conf (replace the port) ...

February 14, 2015

A Shorter Domain Name

This year, I decided not to renewal the previous domain name (hailiang.ws) last year, but to register a shorter one. There are two reasons: Both the site URL and the email address will be cleaner. A more friendly Go import path will be possible for my repositories on Github. After comparing various choices on major domain providers, I chose h12.io as the new domain. It is the shortest but still meaningful domain that I can afford. H is the initial letter of my given name, 12 is simply the number of letters of my full name, and .me is a top level domain quite suitable for a personal website. ...

December 16, 2014

Resources on Offline Hyphenation

CSS hyphenation is supported by latest version of Firefox, Safari & IE. However, Chrome does not support it. Though Hyphenator.js can solve this problem, it runs in the browser and affects the rendering speed of above-the-fold content. So there is only one option left: soft hyphen (U+00AD, ­). Here is a list of resources that leads to its implementation: An article about CSS3 hyphenation by Hyphenator.js Hunspell: the spell checker & hyphenator used by LibreOffice English Dictionary of LibreOffice Pyphen: A Python hyphenator using Hunspell dictionary file A test page for soft hyphen

July 30, 2014

About 301 Moved Permanently

When building a website, there is one inevitable thing: 301 permanent redirection. The cases that have to involve 301 includes: Redirection from www subdomain to naked domain or vise versa. Redirection from slashed pretty URL to unslashed URL or vise versa. 301 is easy to implement with Go: func redirect301(w http.ResponseWriter, url string) { w.Header().Set("Location", url) w.WriteHeader(http.StatusMovedPermanently) } There is one more thing that needs attention: The root path of a domain always contains a slash (GET / in HTTP request), regardless the user enters the slash or not, so the root path needs no redirection. ...

July 25, 2014

How to Achieve a Perfect PageSpeed Insights Score

Indtroduction PageSpeed Insights is an online tool by Google to measure the performance of an web page for mobile and desktop devices. It has a set of heuristic rules considering the network-independent aspects of page performance. Each rule has a weight and the total score ranges from 0 to 100 points. The desktop and mobile tests have the same set of rules for performance and mobile test has some extra rules about user experience. ...

July 24, 2014

Installing Susy

The script: sudo apt-get install ruby sudo apt-get install ruby-dev sudo gem install susy -V sudo gem install compass --pre -V sudo gem lnstall breakpoint -V Notes: The current version of Susy uses a higher version of Sass than Compass, so the corresponding Compass version has to be a prerelease (–pre). The installing process is slow and it feels better to print it out (-V). You may have to run “compass watch” with sudo (issue 1497). An alternative RubyGems source that is close to your location might help.

July 17, 2014

A List of URLs about Web Design

The Elements of Typographic Style Applied to the Web Smashing Magazine Trentwalton Inkwell

July 10, 2014

Why My Web Font Looks Ugly on IE?

Windows needs hand-tuned hinting which is missing in many web fonts. To solve this problem, there is a tool called ttfautohint which can automatically add hinting to font files. There is a tutorial, and an online tool called Fontie.

July 9, 2014

Serving Static Pages on App Engine with Go

It is straightforward to serve static pages with Go or config file on App Engine, but how to serve static pages on App Engine with Go? I got the following error when I tried to customize the 404 page with Go: No such file or directory The solution turns out to be simple: do not do both. The file will not be accessible to Go if there is already a rule for it in config.yaml. Remove the rule from config.yaml and the file will be available to Go again (source: google-appengine-go). ...

July 6, 2014