LAMP How To – Open Source At Work

Only Passion Matters

Entries for the ‘Blog’ Category

Getting or reverting back to an old version in svn

people might think svn revert is the answer but it is actually not. To check out an old version of svn,
svn co -r xxx url
where -r is whatever version to checkout. To update the existing version to an old version
svn update -r xxx url

Installing phpunit

this is very simple, firstly install pear
http://www.azhowto.com/2009/08/14/php-manual-install-of-pear/
then from the pear manual, ie http://www.phpunit.de/manual/3.4/en/installation.html

pear channel-discover pear.phpunit.de
pear channel-discover pear.symfony-project.com
pear install –alldeps phpunit/PHPUnit

getting the latest phpunit will need php 5.2 and above. To get php 5.2,
see http://www.azhowto.com/2009/08/07/getting-new-packages-from-centos-dev-repo/

Starting and stopping vmware in linux command line

One advantage of using command line is that you can start and stop the VM without logging into the web console. I am using vmware server 2.0. I believe it should work the same for future versions.
To start and stop certain instance, say ares,

vmrun -T server -h ‘https://10.2.115.21:8333/sdk’ -u root -p ‘yourpass’ start “[standard] [...]

using variables in cron

unlike normal bash scripts, you can’t really use the back ticks to execute a certain command like so

DATE=`date +%F`

In crontab, you have to use the $(), eg

$(date +\%F)

fsck on lvm partition

fsck on lvm can be a bit tricky. Like a the normal process, the partition needs to be umounted and we can boot up using the rescue cd or in emergency mode. Normally, you

fsck /dev/sda1

if the partition is lvm, you need to activate the lvm first like so

vgchange –ignorelockingfailure -ay
lvscan –ignorelockingfailure (this command should now [...]