Thursday, October 27, 2011

rocks 5.4 cluster - installing subversion

sometimes the most trivial things turn out to be rather interessting.

For example my latest drama with rocks was that I just needed subversion, to convert one of my BinBase images to a development image for BinBase.

Little did I know, that in the rocks 5.4 version, the installer fails to provide you with the base repository. Quality control anyone?

Anyway, to get your yum to work, as exspected. Just open your


/etc/yum.conf


file and add the following section



[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os



at the end of the file and than you can install subversion like always using:



yum -y install subversion

Wednesday, October 26, 2011

google is weird...

ok I love the autocomplete function in google, but sometimes it just results in to odd of search recommendations...

example:


The fun part is that robin and I were actually researching for smurf costumes (it's bring your smurf to school day on monday...), but that the first suggestion on 'do sm...'

do smurfs have tails

I really did not see that comming

Friday, October 21, 2011

grouping dates in postgres using date_trunc

well recently I started to write some statistics functions for my miniX application and so I was woundering, how can you easily execute queries like:

give me the count of object for the last 24h grouped by hour

which should be rather simple, if you know about the functions 'date_trunc' in postgres.

So 5 minutes later some sql appeared...


"select max(object_count) as object,date_trunc('hour',created_at) as date from bbstatistic_snapshot where object_name = ? and created_at between ? and ? group by date_trunc('hour',created_at) order by date_trunc('hour',created_at)"


which works rather well and get's the job done, but the speed is a touch slow.

Results should look like:


object | date
--------+---------------------
1742 | 2011-10-13 15:00:00
1742 | 2011-10-13 16:00:00
1742 | 2011-10-13 17:00:00
1742 | 2011-10-13 18:00:00
2102 | 2011-10-13 19:00:00
2102 | 2011-10-13 20:00:00
2057 | 2011-10-13 21:00:00
1899 | 2011-10-13 22:00:00
1803 | 2011-10-13 23:00:00
1742 | 2011-10-14 00:00:00
1742 | 2011-10-14 01:00:00
1742 | 2011-10-14 02:00:00
1742 | 2011-10-14 03:00:00
1742 | 2011-10-14 04:00:00
1742 | 2011-10-14 05:00:00
1742 | 2011-10-14 06:00:00

Wednesday, October 19, 2011

reinstalling a compute node in rocks

this is actually a no brainer, but since I barely ever have todo it, here is the procedure:


  1. log onto compute node
  2. execute 
    /boot/kickstart/cluster-kickstart-pxe
  3. wait for the install to finish
that's it

Tuesday, October 11, 2011

cron - useful triggers

just a nice list of commonly used cron triggers I keep forgetting.

Cron Expression to fire the trigger every five minutes:
0 0/5 * * * ?
(e.g. 3:00:00, 3:05:00, 3:10:00

Cron Expression to fire the trigger every hour:
0 0 * * * ?

Cron Expression to fire the trigger every two Hours:
0 0 0/2 * * ?

Cron expression to fire the trigger every Four Hours:
0 0 0/4 * * ?

Cron Expression to fire the trigger every 10 Minutes 20 Seconds:
20 0/10 * * * ?
(e.g. 10:00:20, 10:10:20, 10:20:20)

Every half an hour between 1 AM to 7 AM on 20th of Every Month
0 0/30 1-7 5, 20 * ?
(e.g. 2010-07-20 1:00:00, 2010-07-20 1:30:00m 2010-07-20 2:00:00)

Cron Expression to fire the trigger on the 25th Minute from 1 AM to 5 PM on every Monday and Wednesday
0 25 1-5 ? * MON,WED

Cron Expression to fire the trigger at Noon every day
0 0 12 * * ?

Cron Expression to fire the trigger at Noon every day only in 2010
0 0 12 * * 2010

Cron Expression to fire the trigger Every 10 minutes between 9 AM to 5 PM (until 5:50) Every Day
0 0/10 9, 17 * * ?

Cron Expression to fire the trigger at 2:30 PM on the last Saturday of every month.
0 30 14 ? * 7L

Cron Expression to fire the trigger at 7:10 AM every Monday, Tuesday, Wednesday, Thursday and Friday
0 10 7 ? * MON-FRI

Cron Expression to fire the trigger at 2:10 PM and at 2:40 PM every Sunday in the month of July.
0 10,40 14 ? 7 SUN


source: cron-expression-to-fire-the-trigger-every-hour