- Error 2003 while connecting the remote server
- Give the user privileges to login from %(or your IP), instead of just localhost
- Comment out bind-address( or bind your IP) and skip-networking in /etc/mysql/mariadb.conf.d/50–server.cnf
- Python2 and python3 can exist at the same time
- Use python or python3 to execute the file
- apt-get install python3-pip to install pip for python3, and pip3 install to use it
- Use crontab to set timed task
- crontab -e to edit the configure file
- can use .sh script if command is too long
- Use tzselect to change timezone( MySQL’s timestamp is still UTC)
- 229. Majority Element II
Moore Voting: delete a pair of different numbers at one time.
Need to validate if they are larger than n/3.
- 18. 4Sum
4Sum and 3Sum is similar. Both of them use 2Sum’s method. Fast and slow pointer from sides to center.
Throw bad case as many as you can to reduce loop time.
server: Debian 9 on Linode
- Install Apache
At first, my server has a reverse proxy using nginx. So nginx is listening to port 80, while apache is listening to 127.0.0.1:8080. Nginx will pass .php requests to 8080. However, after logging in this blog, it will redirected to 127.0.0.1:8080. It seems to that wordpress reads my apache configure file. I can’t find other solution except for remove nginx. But remember to clear cache of this site, or the browser will keep redirecting it to 8080 because it had received a 301 Moved Permanently.
- Install MySQL
Install and create new database as shown on wordpress.org
- Install PHP7.2
Download and install php7.2 from website. There are two extensions needed – mysqli and zlib. Unfortunately, I install neither of them while installing php. So I learnt to install it with phpize.
Because I use –prefix while installing, I can find phpize and php-config in /bin/ directory under php7 directory I specified.
In your installation directory, you can cd in specific extension’s directory, for exmample – /ext/mysqli/. Then, run phpize using absolute path.
If some library missed, install it. If config.m4 not found,
cp config0.m4 config.m4
After running phpize, you will get a configure file in current directory. Then
./configure –with-php-config=/usr/local/php7/bin/php-config –with-zlib=/usr
php-config’s path may change.