Drbd partition mount check bash one liner
Tue, 10 Jan 2012 by Frank LazzariniThis 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
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 moreEaster Eggs in gentoo
Rename white spaces in folders to dots
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 moreChange zone files with sed
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 moreCrontab fun Decipher the following
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