Thursday, August 16, 2007

remove file extensions

for file in *.txt; do mv $file `basename $file .txt`; done

Thursday, August 9, 2007

Finding Broken Symlinks

find . -type l | (while read FN ; do test -e "$FN" || ls -ld "$FN"; done)

Wednesday, August 8, 2007

Ghost your LVM to new drive

1.) Using fisk setup "partitions" on new drive to match the old drive, make sure id and bootablle flags are set as before.
2.) Use dd to copy the data across, make sure the drives are in the correct order or you'll loose everything
prompt>: dd if=/dev/oldhda of=/dev/newhdc bs=446 count=1
prompt>: dd if=/dev/oldhda1 of=/dev/newhdc1
prompt>: dd if=/dev/oldhda... of=/dev/newhdc...
prompt>: dd if=/dev/oldhdaN of=/dev/newhdcN

Shutdown and put the new drive in the old drives place.
New drive should now boot

Wednesday, August 1, 2007

Must have pine???

rpm -ivh http://rpm.livna.org/livna-release-4.rpm
su -c 'yum install pine'