As an employee of Feedster, Inc. It's important, while reading anything that I happen to blog,
that my entries here are solely my own opinion. Nothing that I say here even remotely reflects
anything about my employer. I am an individual, I have a job just as most everyone has a job. You
are reading the depraved ramblings of the individual not the employee. If you
read something that I say here and then go ranting about how Feedster feels regarding a subject
you will only be showing off your own narrow-minded-ignorance. Thanks for understanding.


Wednesday, February 08, 2006

its gonna be one of those days...

as I ride on the bart, passing hayward, I see a pigeon sitting on a pole... and I think to myself that one wasn't enough; there should be hundreds. and as I imagine those pigeons fluttering around I realize that if there were that many pigeons I would have found myself parked under them....

its gonna be one of those days...

Wednesday, February 01, 2006

Oracle Clustering Filesystem V2 (OCFS2) on gentoo!

First I patched the kernel. I started with kernel linux-2.6.14-gentoo-r2. I found that this patch: ocfs2-configfs-all.patch applied flawlessly once I made a symlink from /usr/src/linux-2.6.14-gentoo-r2 to /usr/src/linux-2.6.14. Once patched all you have to enable is


--> File systems
--> <M> OCFS2 file system support (EXPERIMENTAL)


Build your kernel, and reboot. After that I populated my portage overlay (If you dont know what a portage overlay is, then you might want to consider learning a bit more about the more advanced features of gentoo and portage before trying something like this...) with these files, and build my ocfs2 tools.

FILE: sys-fs/ocfs2-tools/files/rc.ocfs2

#!/sbin/runscript

depend() {
need net
after *
}

start() {
ebegin "Loading OCFS2 Modules: configfs: "
modprobe configfs
eend $? "Error Loading Module"
ebegin "Loading OCFS2 Modules: ocfs2_nodemanager: "
modprobe ocfs2_nodemanager
eend $? "Error Loading Module"
ebegin "Loading OCFS2 Modules: ocfs2_dlm: "
modprobe ocfs2_dlm
eend $? "Error Loading Module"
ebegin "Loading OCFS2 Modules: ocfs2_dlmfs: "
modprobe ocfs2_dlmfs
eend $? "Error Loading Module"
ebegin "Loading OCFS2 Modules: ocfs2: "
modprobe ocfs2
eend $? "Error Loading Module"
ebegin "Mounting OCFS2 Special Filesystem: /dlm: "
mkdir -p /dlm
mount -t ocfs2_dlmfs ocfs2_dlmfs /dlm
eend $? "Error Mounting Filesystem"
ebegin "Mounting OCFS2 Special Filesystem: /config: "
mkdir -p /config
mount -t configfs configfs /config
eend $? "Error Mounting Filesystem"
ebegin "Starting OCFS2 Cluster Service: "
##
## Edit here (-n "ocfs2") to change the cluster name
##
o2cb_ctl -H -n "ocfs2" -t cluster -a online=yes
eend $? "Error Starting Service"
ebegin "Mounting ocfs2: "
##
## Edit here.. This is all pretty normal stuff
##
mkdir -p /mnt/ocfs2/
mount /dev/sda1 /mnt/ocfs2/ -t ocfs2
eend $? "Error mounting ocfs2"
}

stop() {

ebegin "Unmounting ocfs2"
##
## Edit here.. This is all pretty normal stuff
##
umount /mnt/ocfs2
sleep 2
eend $? "Error Unmounting ocfs2"
ebegin "Stopping OCFS2 Cluster Service:"
##
## Edit here (-n "ocfs2") to change the cluster name
##
o2cb_ctl -H -n "ocfs2" -t cluster -a online=no
sleep 2
eend $? "Error Stopping Service"
ebegin "Unmounting OCFS2 Special Filesystem: /dlm: "
umount /dlm
eend $? "Error Mounting Filesystem"
ebegin "Mounting OCFS2 Special Filesystem: /config: "
umount /config
eend $? "Error Mounting Filesystem"
}

restart() {
svc_stop
svc_start
}


FILE: sys-fs/ocfs2-tools/ocfs2-tools-1.1.5.ebuild

inherit flag-o-matic eutils

DESCRIPTION="[C] Support programs for the Oracle Cluster Filesystem v2"
HOMEPAGE="http://oss.oracle.com/projects/ocfs2-tools/"
SRC_URI="http://oss.oracle.com/projects/ocfs2-tools/dist/files/source/v1.1/${P}.tar.gz"
RESTRICT="nomirror"

LICENSE="GPL-2"

SLOT="0"
KEYWORDS="-* x86 amd64"
IUSE=""

DEPEND=""

RDEPEND=""

src_unpack() {
unpack ${P}.tar.gz
cd ${S}
}

src_compile() {
local myconf=""
econf --prefix=/ --enable-ocfs2console=no --enable-dynamic-fsck=yes --enable-dynamic-ctl=yes ${myconf} || die "Failed to configure"
emake -j1 || die "Failed to compile"
}

src_install() {
make DESTDIR=${D} install || die "Failed to install"

exeinto /etc/init.d
newexe ${FILESDIR}/rc.ocfs2 ocfs2
}


After building the sys-fs/ocfs2-tools package, and having recompiled the kernel with OCFS2 as a module, format your device with mkfs.ocfs2 (see the OCFS2 Users Guids for details on HOW to format the filesystem), then make sure to create a proper /etc/ocfs2/cluster.conf (see the OCFS2 Users Guids for details on HOW to make a cluster.conf), exit the /etc/init.d/ocfs2 file (especially the cluster name, device, and mount points)

finally... if all goes well... you simply start the ocfs2 service on your machines, and... it... ought... to work.

if it doesnt work, debug, if it does work, add to default runlevel.

Why, you ask, would abyone care? Well be very sure that enterprise level admins care quite a bit that this kind of thing be available on any platform that they're using. Also, at the low level, if you have a single firewire drive you wish to share amongst many servers, this will do the trick quite nicely, and without the need for all that pesky unmounting and remounting to see new files/content (the os disk cache is a very nice usually, but a real bitch when it gets in the way)

Cheers

Monday, January 30, 2006

doh!

Is it a bad thing when a server has a directory which houses only 226Gb of storage space thinks it's got 4000Gb worth of data

>eg<


serverx ~ $ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 226G 176G 39G 83% /
none 2.0G 0 2.0G 0% /dev/shm
serverx ~ $ du -hs /opt/builds/
4.1T /opt/builds/

Thursday, January 26, 2006

A locking cron job?! In bash?! You're joking right??

Because its one of those things that people often times need to do, and because usually people are at a complete loss as to HOW to accomplish this feat, here's a very simple template which you can use to add locking to a cron job (or any script, really).

It's got a decent feature set for the code-size: A) custom lock file, B) lock expiration, C) decent log type output, D) easily used to wrap another script, or set of scripts inside


#!/bin/bash

###
### Simple bash script locking illustration
###
### By: Demitrious S. Kelly
###
### FWIW: YMMV: Use at your own risk
###

LOCKFILE=/var/lib/locks/this_job.lock
LOCKEXPIRE=600
NOW=$(date +%s)
CONT=1

if [ -f $LOCKFILE ]
then
echo -e $(date)"\tLock Found"
CONT=0
LOCKTIME=$(cat $LOCKFILE)
let LOCKELAPSED=$NOW-$LOCKTIME
if [ $LOCKELAPSED -gt $LOCKEXPIRE ]
then
CONT=1
echo -e $(date)"\tLock Expired ($LOCKELAPSED), Contnuing"
else
echo -e $(date)"\tLock Not Yet Expired ($LOCKELAPSED), Aborting"
fi
else
echo -e $(date)"\tLock Not Found"
fi

if [ $CONT -eq 0 ]
then
exit 1
fi

echo -e $(date)"\tCreating Lockfile"
echo $NOW > $LOCKFILE

###
### Job goes below here, inside the lockfile wrapper
###

echo $(date +%s) > $LOCKFILE
## do stuff
## ...
echo $(date +%s) > $LOCKFILE
## do stuff
## ...
echo $(date +%s) > $LOCKFILE
## do stuff
## ...

###
### Job goes above here, inside the lockfile wrapper
###

echo -e $(date)"\tRemoving Lockfile\r\n\r\n"
rm $LOCKFILE

Tuesday, January 24, 2006

A firefox plugin to make ops/dev's happy (wish list)

Wouldnt it be nice to have a firefox plugin which generated webinject code (xml configuration) for a page/form submission including the data filled into form inputs?

I think it would probably make countless developers (regression testing) and ops persons (service monitoring) lives considerably easier...

DK

Friday, January 20, 2006

Last nights dinner

Last night partook in the geek version of the teddy bear picknick

http://fuzzyblog.com/archives/2006/01/20/who-came/

I had was quite an interesting time. Got to rub some elbows, and talk some shop. It's odd, though, how talking shop in a setting like this is completely different from doing so at work, or at home... We geek are a strange breed. I wish I were a little less of a wallflower at times like these... and I wish my hearing was better (I had to strain to hear anyone inside the noisy resturaunt.) Seeing as this was an amiable experience I may start going to similar events in the future... I ought to find a list of blogs to watch... Scott can probably help me with that.

Most of the people there were the kind of people who invent ideas, where I am the kind of person who sustains, houses, and supports. On one hand I was very out of my element with the charismatic inventive voices that the blogging community knows and loves... on the other hand people like them are dependant upon people like me, leaving me niether completely in, nor completely out, of the celebration of geekdom... It would be interesting to contrast this versus a similar event comprised of admins and ops personelle...

The people who's names you should hear often if they're doing their job right, versus the people who's names you rarely hear unless they're falling down on the job. :D

Anyhow...

DK

Friday, November 25, 2005

Testing

testing the blogger on the go sms to blog gateway service (free mind you)

Test