Fix errors for MySQL


MySQL 5.7.8 remote access with TCP, you may get error like this:

Add following into MySQL config file


Use git subtree to modularization

Here is my situation, I’ve been developing several projects at the same time. There are some libraries are shared with these projects. After googling I found some really good articles:

How We Modularized Medium’s iOS codebase

git subtrees: a tutorial

Git Subtree Tracking Made Easy

Continue reading

vim tips: arg & buf



Operate command over multiple files


Vim search and replace in multiple files

1. Open vim

2. Add files into argument list

3. Search and Replace


:argdo: Apply following commands to all the files

%s:  Search and replace all lines in the file

g: Change all occurences in each line

e: No error if the pattern is not found

c: need confirm to save changes

|: Separator between commands

update: Save (write file only if changes were made)

Understanding Nginx Location Directive

Here are Location Block syntax:

  • (none): The location_match is interpreted as a prefix match.
  • =: The location_match is interpreted as a exactly match.
  • ~: This location_match will be interpreted as a case-sensitive regular expression match.
  • ~*: The location_match block will be interpreted as a case-insensitive regular expression match.
  • ^~: The location_match is interpreted as the best non-regular expression match, regular expression matching will not take place.

Continue reading

WPKG redirect virus

Recently a lot websites keep automatically redirecting to “”. It turns out caused by GFW. For more info you check the following page.

Use Adblock plus block the links:

And edit hosts file to map these two sites to