Some Memo

Easy Access Memo

RC.local under Ubuntu 18.04 Bionic Beaver

ln -fs /lib/systemd/system/rc.local.service /etc/systemd/system/rc.local.service
touch /etc/rc.local
chmod /etc/rc.local


#!/bin/sh -e
# rc.local
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
# In order to enable or disable this script just change the execution
# bits.
# By default this script does nothing.
exit 0

WordPress redirect loop

In wp-config.php

if (strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false)

Error while loading shared libraries:

which openssl | xargs ldd
# If missing
ln -s /usr/local/lib/ /usr/lib/
ln -s /usr/local/lib/ /usr/lib/

Chang file permission (server)

find /path -type f -exec chmod 644 {} \;
find /path -type d -exec chmod 755 {} \;

MySQL password reset

service mysql stop
/usr/local/mysql/bin/mysqld_safe --skip-grant-tables &
mysql -u root -p
# MySQL 5.7+
mysql(none)>update mysql.user set authentication_string=password('123456') where user='root';
pkill mysql
service mysql start


电子邮件地址不会被公开。 必填项已用*标注