LAMP How To – Open Source At Work

Only Passion Matters

Entries for February, 2009

How to resize LVM running Xen part 1 – increase disk size

Resizing a lvm partition is straight forward if it doesn’t contain a partition table. Simply do a:
lvresize -L disksize /dev/vg/lv
resize2fs /dev/vg/lv
If it is running a virtual machine like xen with a partition table, how to resize the domU, whether to shutdown domU or not depends largely on the partiton structure. In centos, if you do [...]

Linux: changing hostname on the fly

To change hostname on a machine quickly

echo ‘hostname’ > /proc/sys/kernel/hostname

logout and log to see the changes.
The proc dir is a pseudo file system. To do it permanently, you need to change /etc/sysconfig/network and /etc/hosts

Do you know where your kid is? Check Google’s maps (AP)

AP – With an upgrade to its mobile maps, Google Inc. hopes to prove it can track people on the go as effectively as it searches for information on the Internet.

PHP Quick Calendar V2.4 Updates

* Thanks kirk for suggesting a bunch of changes. I have implemented quite a few – too wordy to describe them here. If you are interested, see the evolt comments that kirk837 has written.
* Added category to events. This impacted the code and query quite abit.
* Added sms and emailing capability. Email alert is straight [...]

Windows file in Unix. Careful of ^M and how to replace them

I thought many people know this but sometimes, it is taken for granted and can cause hours of misery.
If you save a text file in windows, you get ^M as new line. In unix, this can cause problems. I was running a script to dump a query into csv and couldn’t quite work out why [...]