Samstag, 8. Dezember 2007

Imperfect NAS

After hacking our REAL nas system last time, we now built one by our own. Sixteen hard disks in one case is big enough. We will have more or less 6Tb inside. Of course mr.Guru will fill it up again immediately. What we installed inside is simply LVM. Since we use hardware raid 16 disks sata controller, no need to setup MD device. It is great and easy. Ups... first test there was an accident. The panel cable was burning!! In that cable there was 3 vcc, and 3 ground lines. These lines are too small for power line. We should have been plugging additional power line. But anyway, this is one thing that makes our new nas imperfect. See how this device fits to my baby cluster!! Instead of stacking around with LVM documentation, this is the sequence of command we need to run in order to set it up:

#!/bin/bash INCHD="/dev/sd?? and so on" VOLNAME=scratch-vol LNAME=scr MNTDIR=/scr DEV=/dev/$VOLNAME/$LNAME apt-get install lvm-common lvm2 pvcreate $INCHD vgcreate $VOLNAME $INCHD vgchange -a y $VOLNAME TSIZ=`vgdisplay $VOLNAME | grep "Total PE" | awk '{print $3}'` lvcreate -l $TSIZ $VOLNAME -n $LNAME mkfs.ext3 $DEV mkdir -p $MNTDIR echo "$DEV $MNTDIR ext3 defaults 0 1" >> /etc/fstab mount $MNTDIR df -h $MNTDIR

Samstag, 1. Dezember 2007

Awkfull slider

My awkfull slide creator is now more or less usable. I am thinking of publicly sharing this tool. But as I said, this tool is awkfull. I wrote almost everything using awk. This language is pretty simple, and rarely used as a serious programming language. One can see a lot of awk one-liners inside a shell script, but complete program... Slider uses awk as a tool to translate plain text to an swfc script. This plain text is straight forward, containing tags and contents of slides. Here is the example:

$slide
This is my first slide
~First item
~~and first sub item
Pretty simple, right? At least it is very readable to me. Wait how about figures? Not only figures, you can also put directly movies inside it. Of course, swf format is more preferable. Look at this:
$slide
How to put figure...
$figure myfigure.jpg x=100 y=100 scale=50% alpha=50%
$figure movie.swf y=100 y=250 scale=50%
thats it. I will comeback to this post to tell the repository where I put slider program. I need to make also some examples for user. This is really an Awkfull program.