Li-Zhao's HomePage


I (LI Zhao) am from School of Computer Engineering, Nanyang Technological University, working in Sybase.
This is a memory book for me, so, miscellaneous topics can be found here.
Have fun!



Loading Blog Search...

Saturday, February 15, 2025

Development with Linux Terminal on Pixel Tablet



Android is transforming to a cross tablet and desktop OS. Google is officially supporting Linux installation on Android 15/16 beta versions!  This Linux distribution uses Android's AVF framework, making it feel like native Linux on your device.  While there were still some bugs as of February 2025, it's become quite usable, especially on Google Pixel Tablets.  For me, it's perfect for light development work and trying out new code while traveling.  Here's how I set up my development environment on my 11-inch tablet.

Wednesday, May 18, 2022

Is Wayland matured on Ubuntu

On Ubuntu 22.04, for the sake of Waydroid, I gave Wayland a try. Without knowledge of the root causes of the following issues, I'd just hold on for a while before switching. 


  1. Chrome/VS Code fonts are blurry, once display scaling is enabled. 
  2. Chrome and Prospect Mail blink often during rendering. 
  3. Laggy mouse/windows dragging sometimes.
Is it caused by Nvidia GPU compatibility? 

Sunday, May 01, 2022

Ubuntu tools to use outlook

1. Evolution needs ews plugin installed to use outlook.com emails for enterprises 2. https://github.com/abraunegg/onedrive, deb installed from Suse build repo works great.

Monday, April 25, 2022

Ubuntu and Bluetooth Call

Here is a note for Ubuntu install. Bluetooth A2DP and HDP modes were always messed up by default, i.e., I can't really use Bluetooth microphone to make teams/zoom call. Seems replacing PulseAudio with Pipewire/wireplumber solve the problem smoothly. Refer to here.

Sunday, March 27, 2022

Ludashi scores

Didn't know Huawei Mate30 is so powerful, almost same with Lenovo AMD 5600G Desktop.

Sunday, March 13, 2022

Slow Ubuntu Bootup Troubleshooting

To analyze the reasons slowing down Ubuntu bootup, please use systemd-analyze cmd. 

systemd-analyze time
Startup finished in 5.027s (kernel) + 11.220s (userspace) = 16.247s
graphical.target reached after 11.194s in userspace
To sort modules by time taken during boot, use
systemd-analyze blame
We can see snap modules took quite long to load. But snap are loading in parallel and doesn't block others. We can see critical path:
systemd-analyze critical-chain
graphical.target @11.194s
For me, removing a USB card reader helps, due to BIOS/UEFI?

Wednesday, January 13, 2021

docker compose to remote host

# setup
ssh -nNT -L /tmp/socket.remote:/var/run/docker.sock user@remote.example.com &
export TUNNEL_PID=$!
export DOCKER_HOST=unix:///tmp/socket.remote

# use docker, docker-compose here
docker-compose…


# shutdown and cleanup of the socket
kill $TUNNEL_PID
rm -f /tmp/socket.remote

CLI tool to manage Ubuntu network

Seems Ubuntu@WSL2 has problem on DNS. I need to use nmtui to manual configure DNS server time to time.

Wednesday, October 28, 2020

Run snap in WSL2

To use snap in WSL2, we need systemd enabled, following instruction at https://github.com/diddledan/ubuntu-wsl2-systemd-script/. However after enabling systemd using the script, visual studio code can't open terminal anymore. There will be a fix. Before you receive the fix, there is a workaround, to change the last several lines of to:
else
exec /usr/bin/nsenter -t "$SYSTEMD_PID" -a /bin/login -p -f "$SUDO_USER"
fi
My MobaXterm also can't open WSL session. Not sure whether it is caused by above scripts. A workaround is to change default shell to cmd/powershell and run bash from there. To run GUI apps from WSL, we could use vcxsrv/x410 or MobaXterm. vcxsrv is more bugful though. Due to WSL is using different network interfaces, we can set DISPLAY by adding the line to ~/.bashrc: export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2; exit;}'):0.0

Wednesday, September 02, 2020

New Xiaomi Moann Inkpad X

Inkpad X was released it's new e-ink reader Inkpad X at July, 2020. The specs listed is:

It costs me RMB 1699 (340 SGD) to buy from Taobao on 7, Aug. Due to Covid-19, air shipment is unavailable to ship to Singapore and sea shipment took three weeks with higher costs (due to GST tax). Inkpad X features a large 10 inch e-ink screen with 1600x1200, which is not unpar with Kindle technically. But be honest, I can't differentiate it much from 50cm away, my usual reading distance. Quite satisfied with the overall building quality and its powerhouse rendering books, especially its PDF handling much better than Kindle Oasis. For Android 8.1 under-hood, it theoretically supports almost all apps. But after two days use, I resisted attractions to use them and here you go some tips to make it a better tool for you, who just want to indulge yourself in reading.
  • Use Calibre
  • Install Koreader
  • Solve Problems
For whom would read a lot of PDF, there are obvious reasons to follow these tips for you. Before showing the evidences, let's have a look at Inkpad X default UI. After unboxing it, you could see the default calendar ScreenSaver, and Inkpad X provides a very convenient scheduler app. Unfortunately, the events added in scheduler won't appear in ScreenSaver. Good news is Inkpad X allows to change ScreenSaver.
Pressing the beautiful red button on top of Inkpad X would bring you to its default UI, with four items in left menu:
  • Reading (this is to use DuoKan, the default reading app for Inkpad X)
  • Scheduler
  • Applications, listing all apps installed. I loaded Wechat Reader, Kindle, Overdrive to borrow NLB library books, KOReader. Please be noted the floating ball app I enabled to make navigation handy.
  • Settings
The floating ball was used to take all screenshots here. All the screenshots are colorful, including DuoKan's reading interface, except for Koreader's. This is the first reason I recommend not using DuoKan when reading PDF. I guess Koreader pre-processed the PDF to greyscale and rendered better graphic effects comparing with DuoKan, side by side. Second reason is Koreader's PDF rendering is much faster.
DuoKan seems able to scan at backend to pickup books copied to Books directory when you connect Inkpad X to Windows PC. However, it didn't list all the books copied, while Koreader recoganized all of them except for AZW3 format. So I converted all AZW3 to Mobi so make Koreader to list all. This is the 3rd reason I don't like DuoKan for its weaker format support or whatever reason not listing copied books. A very different between Koreader and DuoKan/Kindle is the organization of books. Koreader does not reorganize books according to metadata in categories, instead, it just displays the books as how they are saved in file system structure. This sounds a bad thing especially when the books are not well organized before hand. Calibre saved my day and make it even better with its customizable file system structure when copying books into devices based on embedded metadata. I tend to use Inkpad as pure reader and not use other apps or take notes on it, which could be killer app for many though. For my kids, dictionary is the key to learn. But Koreader v2020.08.1 dictionary does not work out of box. After asking Koreader's developers, it's a bug causing downloaded dictionary uncompressed. The solution working for me is to uncompress the dictionary downloaded at koreader/data/dict. Now my kids are happy.

Tuesday, May 07, 2019

AMD emulator on Hyper-V

AMD CPU based Android emulator is working according to the blog. However, when I tried it with Android Studio 3.4, it kept crashing with error messages like:

Android\android-sdk\emulator\qemu\windows-x86_64\qemu-system-x86_64.exe: WHPX: Failed to exec a virtual processor

Luckily, after my Windows was upgraded to insider preview version 18890.1000, the emulator is working now. And it's a surprise to be much faster than emulator on my old i7 CPU.




Saturday, March 30, 2019

Visual Studio Xaramin debug with Bluestacks

Got a AMD Lenovo A485 with Windows 10 Home, which does not have Hyper-V.  To use it for Visual Studio Xamarin experiments, I want a native Android emulator. Although it can install AMD native Android emulator, with hypervisor windows platform enabled, it does not allow other VMs to be installed, e.g., using Virtualbox. Luckily, Android VMs on Virtualbox or VMWare with TCP/IP based remote ADB support are able to act as Emulator. Bluestacks is another choice.


  • Install bluestacks
  • Enable ADB in bluestacks, this will open 5555 port to connect from Visual Studio

  • Goto Android install directory/android-sdk/platform-tools, run
adb connect localhost:5555
  • For Visual Studio Xamarin Android project, you then could find a new Android device to deploy to.




Monday, January 09, 2017

BPMN and Activiti

A quick guide: http://www.nurkiewicz.com/2011/01/activiti-processes-and-executions.html

BPMN is easy to be transformed to petri net for formal analysis.

Saturday, April 23, 2016

Fix HDMI audio for ubuntu/NUC

My NUC is hooked to Philips 221E via HDMI cable. The audio is fine if the monitor is never turned off. Once the monitor reboots, the distorted audio really make it unusable.

To solve the problem at ubuntu, append 'tsched=0' to 'load-module module-udev-detect' at /etc/pulse/default.pa

Wednesday, August 27, 2014

How to add extra dir to CLASSPATH at spring-boot

Spring-boot has three built-in launchers as real main classes, JarLauncher, WarLauncher and PropertiesLauncher, which could be used to call executable. These launchers set the path to load resources and classes.
Only PropertiesLauncher could be use dir outside the jar file. To add an extra dir 'EXTRA' to classpath:
1. for maven, add the following fragment
                        <plugin>
                                <groupId>org.springframework.boot</groupId>
                                <artifactId>spring-boot-maven-plugin</artifactId>
                                <configuration>
                                        <layout>ZIP</layout>
                                </configuration>
                        </plugin>
2. Use loader.path when execute the jar
java -Dloader.path="lib/,config/,EXTRA/" -jar the.jar

Then, for example, ClassPathResource("1.properties") could get 1.properties from EXTRA dir.

Thursday, April 03, 2014

Lost 3 years

I forgot to migrate my wordpress DB from an expired hosting plan, and the posts from 2001-2004 are lost.

But, well, one word could cover most of the life: babysitter.

Tuesday, February 01, 2011

Lens dropped

Visited universal studio yesterday, a wonderful place.
But, unlucky, my wife lost the lens cap; 1 hour later, the 17-55 lens got dropped, and UV glass is broken, the UV ring is dented. By quicky googling, I found guys spent hours to DIY remove the dented UV.
So, I gave up the chance to do it myself, instead, it's sent to canon service centre today. They helped me to remove the dented UV in 15mins, even gave me a free lens cap.
Huh, the service is great, thanks.

Friday, June 25, 2010

update from redhat RHEL4 to CentOS5.5

I have a virtual machine running RHEL4 on our cluster server. But IT does not support it anymore. So, I tried to update it to CentOS to enjoy update.
The problem is I have no physical access to the VM, so need to update online.
Neither Redhat nor CentOS suggest to do online update between major releases, but no choice. I did in 2 steps:

  1. migrate from RHEL4 to CentOS4
  2. update from CentOS4 to CentOS5

Step1 works like charm, but the 2nd step is nightmare. I followed this article: http://planet.admon.org/howto/update-centos-4-to-centos-5-remotely/ because it is the longest one I found. :D I guess it is more comprehensive.
all the steps before 'yum upgrade' is OK, but yum upgrade tried to dump mega error messages (e.g., matchpathcon /.../... failed invalid argument) to my remote terminal, and lasted for more than 10mins, util I pressed ctl+c. Then it left a messy system to me.
What I tried to fix the issue:
  1. package-cleanup --leaves (then manually yum remove the packages)
  2. package-cleanup --cleandupes
  3. yum upgrade (run several times with removing of conflict reported)
Now, the system seems normal.

Saturday, June 12, 2010

Thursday, June 03, 2010

Drunk son

Huh, he just finished a whole bottle of milk.