Claus Beerta

Stuff i do, don't and other babble.

Picasa to Flickr


Since i use Picasa to Upload my Photo's these days, i needed something to keep Flickr updated as well. Being the lazy ass i am, i built this little tool to do it automatically.

Put it on Github, as other people might find it useful too.

CBeerta/Picasa-To-Flickr - GitHub

Picasa-To-Flickr - Copy Public Photos from Picasa to Flickr



Testing Ntp and tzdata with Behat

This is a followup of my previous Post about Behavior Driven Infrastructure.

Using Behat to Test a Server

Here's an example for a Test for tzdata

Feature: tzdata Configuration
    As a Server
    I want to have a tzdata installation
    So that my calculations for various timezones are always correct

Scenario: The tzdata data Installation and Configuration

    Given i have the "tzdata" Package installed
    Then the directory "/usr/share/zoneinfo" should exist
    And the "tzdata" Package Version should match "2011(d|e)"
    And the file "/usr/share/zoneinfo/localtime" should exist
    And the file "/etc/localtime" should exist

Scenario: The tzdata checks for correct times

    When i execute "date"
    Then the output should match "CEST|CET"

    When i execute "date  --utc -d '2006-08-07 12:34:56-06:00'"
    Then the output should match "UTC"
    And the output should match "18:34:56"

    When i execute "TZ=Europe/London date -d '2006-08-07 12:34:56-06:00'"
    Then the output should match "BST|GMT"
    And the output should match "19:34:56"

Writing the Unit Tests

I've put up 2 examples, one for ntp and one for tzdata, on my Github here. The Code is very Quick'n'Dirty, just as a "see what is possible" quality.

Advantages

Now when a random Dictator somewhere decides that his Country should change the timezones again, you can setup a quick test, rollout the tests, then rollout a new tzdata and be assured that the Timezone changes reliably hit every Server.

This is a very Simple Test, but it is just here as an example and to explore the viability. For an Apache installation for example you could proceed to check Various configuration settings, check for helper services that need to be there, check your logfile collection is setup properly, check your logrotation, check if all PHP packages are installed and correctly configured.



Behavior driven Infrastructure and Monitoring

While I'm busy getting acquainted with Chef I'm starting to wonder why the topic of "Behavior driven Infrastructure" hasn't picked up more momentum than what appears to be the case right now. (Or I've just been living under a Rock, and missed all of it).

Behavior driven Infrastructure

BDD Has been around in Software Development for a while now, but coverage for it's use in a Systems Administrators life has been pretty vague from what i can tell.

I've found a few interesting posts, but not much beyond this.

I've read Test-Driven Infrastructure with Chef which touched a bit on the subject.

Behavior Driven Monitoring?

With growing Infrastructure, Monitoring becomes a major Pain. Especially if you do it the "classic" way, that focuses on monitoring Components rather then Services. If your system checks thousands of hosts, chances are on some of them something is broken. Broken disk maybe? MySQL Slave that is causing high loads because a batch Job is running some statistics? Apache that is running low on Childs?

But really, does it matter? As long as the Service is up and running and performing? Do we need to monitor every little cog in our infrastructure if there is a way to do "Top Down" Monitoring?

I certainly don't enjoy being woken in the middle of the night by Monitoring that tells me that a Database is chocking somewhere.

And now?

cucumber-nagios seems like the only project touching on that Subject.

As PHP is my language of choice, and I'm not quite convinced that learning Ruby is going to make me a happier person, I'll stick to that.

Behat is Cucumber for PHP, installation is done quickly:

pear channel-discover pear.behat.org
pear channel-discover pear.symfony.com

pear install behat/gherkin
pear install behat/behat

(Remind me to build a Chef Cookbook for this.)

Time to explore...



Bliss Demo

I've setup a little Bliss Demo Installation for you to look at here

It Only pulls my own feed, and added feeds will get wiped on each update.



rssReader is now Bliss

What?

Time to revive an ancient project: rssReader

It's been a while since i last worked on my own little Feed Reader project (7 Years).

Why?

I've recently started using Google Reader as i got myself a fancy Android Phone with a data flat rate, and i didn't get TT-RSS running properly on it (probably totally my fault).

The only thing i didn't want on Google Reader were all my authenticated and NSFW feeds, i needed something different for those.

I remembered that i had this little project way back when, and decided to have a look at it. Unfortunetly it has grown quite old. Still based on PHP4, not very web2.0'ish, and generally not really pretty to look at.

So i just rebuilt the thing from Scratch.

The only thing it has in common with the old version is that it uses Smarty as Template engine. I commited the old thing, if you want to have a good laugh.

Where?

First: May I suggest you try TT-RSS. Or if you don't care much about privacy: Google Reader is quite awesome. It's even more Awesome with this extension installed.

If you still want to have a look, you can get it on Github. Installation should be very straight forward.

The only advantage it has over TT-RSS, is that it doesn't need a database whatsoever (It's also somewhat easier to configure, but with the difference in features that's not much of a surprise)

It has plenty of disadvantages though.