This is just a quick tip for you out there that use DRBD in simple Primary/Secondary mode and need to check whether a script is executed on the node which is currently Primary and has the Drbd Filesystem mounted. Let's just say you need to copy stuff onto your Drbd partition via a cron script. You can use the following one liner which is checking on the device '''/dev/drbd0''' which you probably need to adept to your needs and will print a message to standard output if this is the node which is holding the resources. Just replace that message output with the command you would like to execute and you are good to go.

if [ "`mount | grep /dev/drbd0 | wc -l`" == "1" ]; then echo "We are holding the resources"; fi

Weekly folder of your new files

Sat, 14 May 2011 by Frank Lazzarini

Do you know the problem, you have a massive directory with tons of media data, and after work you want to watch the latest episode of your favorite show, and you jump into that directory knowing that there is a new episode, but that directory is cramped up with so …

read more

Easter Eggs in gentoo

Sun, 24 Apr 2011 by Frank Lazzarini

As it is easter time, I though I would compile a list of funny easter eggs that you can find in Gentoo. Why gentoo, cause I simply love this distro, it's all about customization/optimization and knowing what's really going on on your system. I used to be a gentoo …

read more

Rename white spaces in folders to dots

Tue, 15 Mar 2011 by Frank Lazzarini

Don't you just hate when you get a copy of a scene release from somewhere and the guy that gave it to you "descened" the release folder, i.e out of Something.other.than.Potato.HDTV.XviD became Something other than Potato HDTV XviD. So how to fix this, in …

read more

Change zone files with sed

Thu, 17 Dec 2009 by Frank Lazzarini

As we had to move our server roma from root.lu to our home, and as roma serves as dns server, we had to change IPs and serials in all the zone files. Therefore we forged together some regular expressions to use with sed. sed is a stream editor for …

read more

Crontab fun Decipher the following

Sat, 14 Nov 2009 by Frank Lazzarini

I've been croning a lot lately, and this is one cool combination of cron which I haven't thought was possible. In this example you see how powerful cron can be. Defying a lot specific rules in just one line of syntax. So let's come to it ... try to decipher the …

read more