Wednesday, October 6, 2010

Know the different PATH_INFO

My rails application have root route to a store controller.
I need to know the user request sample.com or sample.com/store/local/12342 so I could show different text on the html title.
It could be done by using request.env["PATH_INFO"] to get the data.
If it is just plain sample.com it will return nil.

Clone Xen VM

I have been created an Xen VM. I want to clone it.
My enviroment is centos 5.4 with Dom0 installed.
And the original template vm is centos,too.
1. lvcreate -L 10G volGroup00 -n vm1
2. virt-clone --original vm_template --name vm1 --file /dev/VolGroup00/vm1 --force
3. edit /etc/sysconfig/network's hostname.
4. change ip if you don't want use dhcp.