Ben Chuanlong Du's Blog

And let it direct your passion with reason.

Fonts for Linux

  1. ttf-arphic-uming, ttf-wqy-microhei, ttf-wqy-zenhei, xfonts-wqy and ttf-opensymbol are some packages related to Chinese fonts.

  2. If you have Adobe Reader installed on your computer, you can use Adobe Chinese fonts for free.

  3. To check Chinese fonts installed on your computer, you can use the command fc-list :lang=zh-cn | sort.

  4. To install extra …

Synchronize Files Using Dropbox

  1. Dropbox won't sync files that you don't have read permissions.

  2. You'd better not merge an old Dropbox folder while installing/configuring Dropbox.

  3. You'd better not store symbolic links in the Dropbox folder, because the symbolic links will be replaced by the real files/folders when synchronized to other computers.

  4. It …

Comparision of Linux Emulation Solutions on Windows

  1. Virtual machine based on Virtualbox, etc. is an overkill, generally speaking. It provides complete functionalities but is more CPU and memory hangry.

  2. WSL 2 is the currently the best solution comes with Windows 10+. It is essentially a virtual machine but based on Hyper-V.

  3. Cygwin, MobaXterm, etc. are outdated as …

Count Number of Fields in Each Line

Sometimes, a structured text file might be malformatted. A simple way to verify it is to count the number of fields in each line.

Using awk

You can count the number of fields in each line using the following awk command. Unfortunately, awk does not take escaped characters into consideration …

Resolve the DNS Contamination Issue in Firefox

The local DNS you use in China is probably contaminated and popular sites like Google, Facebook, etc. are not interpreted correctly. So if you are in China and use Firefox with Proxy, make sure to set network.proxy.socks_remote_dns to be true (follow steps below).

  1. Open an empty tab in …