Thursday, April 4, 2019

WordPress new post editor has encountered an unexpected error

I tried:

  • Disabled all plugins (included SEO) and browser addons.
  • Attempt recovery doesn't work. Error code.
  • Switch to other themes.

Error Code:

TypeError: Cannot read property 'show_ui' of undefined
    at i (
    at An.filter (
    at ph (
    at eg (
    at fg (
    at wc (
    at fa (
    at ng (

  • WordPress 5.1.1
  • Nginx 1.15
  • PHP-FPM 7.2
  • wp-supercache
Here is how I fix it:
#vi /etc/nginx/wp-supercache

location / {
    try_files $cachefile $uri $uri/ /index.php;
Changed to:
location / {
	try_files $cachefile $uri $uri/ /index.php$is_args$args;
Restart Nginx to apply the changes:
# sudo systemctl restart nginx
Related Bug:

Saturday, March 23, 2019


Launch Instance: latest Amazon Linux 2 AMI

# Update Linux and install essential packages
sudo yum -y update

# Install php72 using amazon-linux-extras
sudo amazon-linux-extras install php7.2

# Install Nginx 1.12 using amazon-linux-extras
sudo amazon-linux-extras install nginx1.12

# Install mariadb using amazon-linux-extras
sudo amazon-linux-extras install lamp-mariadb10.2-php7.2
## this will install apache/httpd as well, which we don't need.
### uninstall httpd
sudo yum earse httpd httpd-tools
# install mariadb-server should be version 10.2 or higher
sudo yum install mariadb-server
To enable nginx, php-fpm and mardb services on boot:
sudo systemctl enable nginx
sudo systemctl enable php-fpm
sudo systemctl enable mariadb
To start all 3 service:
sudo systemctl start php-fpm
sudo systemctl start nginx
sudo systemctl start mariadb
sudo mysql_secure_installation

Amazon Linux 2 add fail2ban from epel

Amazon Linux team did a great work to make it easy and clean at same time.

 The epel repo is no longer enable by default like the olden days.

This keep the rpm packages as slim as possible.

To enable epel, just one command:

# sudo amazon-linux-extras install epel
# sudo yum update
# sudo yum install fail2ban

Friday, March 22, 2019

Amazon Linux 2 Systemctl commands timeout - systemd issue

A long live AWS EC2 vm gave me this when I try to check the httpd running status:
systemctl status httpd
Failed to get properties: Connection timed out
According google search: I tried both:
kill -9 1
systemctl daemon-reexec
None of them works. The [reboot] only flack a bit and kick me out of system but did not really reboot. I have to run:
systemctl --force --force reboot
To force it reboot. Love systemd!

Sunday, March 10, 2019

How to reset check_mk admin password

My Windows 10 Laptop just crashed after latest Intel patch upgrade.

Forgot to save the admin password on one of the latest check_mk site I built.
su - mysite

cd etc

ls -l htpasswd

OMD[mysite]:~/etc$ ls -l htpasswd
Example: check_mk version 1.4:
check_mk version 1.5:
htpasswd htpasswd omdadmin          # set password for user *omdadmin*

New password: 

Re-type new password:
You should be good! Have a nice day!

Monday, February 25, 2019

recommend Script to remove Windows 10 bloatware

Recommend a great Script to remove Windows 10 bloatware.

You can find it here:

Just download the zip and run in PowerShell by right click: Windows10Debloater.ps1
If you like GUI: Windows10DebloaterGUI.ps1

  1. Appreciate Richard Newton's great work.
  2. I did not run white list, because I do not want anything except the 'Core Windows 10'.
  3. If you really really need keep some Windows 10 bloatware, please run Windows10SysPrepDebloater.ps1 before you start the main .PowerShell script.
  4. The only one I may keep is the Mail which crashed every time I check the Gmail folders.
  5. I sill using Windows 10 as my Main working OS and Outlook as my Main Email client. But not a fan of any bloatware.

Tuesday, December 11, 2018

git pull: Unable to create ORIG_HEAD.lock No space left on device

# git pull
fatal: Unable to create '/mds/mds/.git/ORIG_HEAD.lock': No space left on device

# df -h .
Filesystem                                              Size  Used Avail Use% Mounted on
/dev/disk/by-uuid/b1358fbb-dab1-482d-ab22-fa2523975c2e   16G   11G  3.9G  74% /

# df -i .
Filesystem                                              Inodes   IUsed  IFree IUse% Mounted on
/dev/disk/by-uuid/b1358fbb-dab1-482d-ab22-fa2523975c2e 1003680 1003680      0  100% /
It just to many small log files in the folder. To quick delete them:
cd yourdirectory
perl -e 'for(<*>){((stat)[9]<(unlink))}'
Reference & Thanks: