Max Tsai's Blog (http://www.maxtsai.com/)

Sunday, September 14, 2008

Max at Move ..

I decided to move my blog to my own site! Google is great and free, but, since I am a developer, I am kind like to be able to tweak around the application that I am using, too. So, I can have things the way exactly what I like! Please visit my new site at http://www.maxtsai.com/

p.s. I will have more technical stuff at my new site! It is really my logs on the Web now....

Sunday, April 27, 2008

RSYNC via SSH in CRON jobs

This is my new favor thing to do .. rsync (http://samba.anu.edu.au/rsync/) through ssh!

1. Set up SSH key pair between the same login at two hosts:
  1. At the Source Host (copy from):
    1. Do a ssh-keygen -t rsa to generate the private/public key pair
    2. It is commonly to save it under ~/.ssh as id_rsa and id_rsa.pub
    3. I would now do a sftp the public key file (id_rsa.pub) to my Target Host and save it under .ssh as authorized_keys2. At the same time, you can add the host key.
  2. Test it at the Source Host
    ssh TargetHost (no User ID required assuming the same account is used on both hosts).
  3. Working? Good!
2. Samples for RSYNC
  1. #rsync -ave ssh TargetHost:/export/test/ /export/test/
    sync'ing from Tager Host to Local Disk
  2. #rsync -ave ssh /export/test/ TargetHost:/export/test/
    sync'ing from Tager Host to Local Disk
  3. with Delete option to remove old deleted files
    #rsync -ave ssh --delete TargetHost:/export/test/ /export/test/

Sunday, March 30, 2008

Java - PHP

http://quercus.caucho.com/

I enjoy developing JEE, but am kind of tired of JSP and other Template Engines. Why can there be just something that my designers can just do it without coming to me all the time? I am hoping Quercus (A Java based PHP engine) comes to rescue!

and: http://fabien.duminy.ifrance.com/blog/archives/2007/08/entry_14.html

I had to copy three jar files:
resin-util.jar. quercus.jar, and javamail.jar; so, Tomcat does not compliant about javax/mail/MessagingException

Also, I copied the php/quercus-war to webapps (since I am lazy). Works!

----
On Windows, this seems to be another solution. Never tried yet!
http://nexus.zteo.com/2008/02/15/how-to-setup-php5-with-tomcat-5/

Sunday, March 16, 2008

Organizational Conflict .. Interests and Trust?

I have involved in quiet a few of projects in my career. I have success within quiet a few of projects and, from time to time, I am pretty confortable of taking the role of my area of resiponsibilities. However, it is much bigger challenge among the intra-organizational projects.

Time to think!

Sunday, March 09, 2008

UNIX date -- it is easier than you think!

So, if you need a past or future date from today, UNIX date command makes it a piece of cake. I was asked by a friend on this:

28 days ago

Linux:
date --date='28 days ago' +%Y%m%d

OS X:
date -r $((`date +%s` - 2419200)) +%Y%m%d

I have not tried it, but it should work on FreeBSD:
date -v -28d +%Y%m%d