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...

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.

Thursday, December 10, 2009

HOWTO: when you lost DPP CD

I cannot find my canon DPP install CD, and Canon website provides DPP updater only.
DPP updater runs only on PC with DPP installed. If you have the following contents at registry table, then it thinks you have DPP installed.

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Canon\DPP]
[HKEY_LOCAL_MACHINE\SOFTWARE\Canon\ZoomBrowser EX\]
[HKEY_LOCAL_MACHINE\SOFTWARE\Canon\EOS Capture]
[HKEY_LOCAL_MACHINE\SOFTWARE\Canon\EOSViewerUtility]
[HKEY_LOCAL_MACHINE\SOFTWARE\Canon\PhotoStitch]


Some lines are for other updater.

For ZoomBrowser 6.3+, please change "ZoomBrowser EX" to "ZoomBrowser EX\Install".