Author: Tor Håkon Haugen

  • Me and my Canon 5D

    I was here first

    A self portrait taken with my new (second hand) Canon 5D.

    What can I say other than ‘Wow’. This is an amazing piece of equipment, and definitely a step up from my four year old Canon 350D. Although the previous owner had it for almost 2 years (1 year and 10 months), it’s in mint condition.

    One of the ‘rules’ in photography is to invest in good optics. But now that the marked is packed with people upgrading to Canon 5D MkII, it’s the perfect time to get the hand on a used MkI for a reasonable price. In fact, for the price I paid for the 5D, I couldn’t even get a new 500D. Sure, the 500D has more mega pixel and full 1080p video. But I’m not interested in video, and the camera is to small for my hands. And that is also my biggest regret on buying the 350D in the first place, but it’s also the only one. Always buy a camera that fits your hand.

  • NimBUS and Regular Expressions

    I recently had to configure NimBUS to send alarm upon detecting a specific log entry in /var/log/messages on a Linux system. Because this alarm was supposed to be sent by SMS , I didn’t want it to send more than one message. But since our log file has a timestamp, each entry were we found a match would be handled as a unique alarm, thus sending one message for each log entry where the mach was found.

    If the string we were looking for first would appear, it would most likely show up somewhere between 5 to 50 times within an hour.It’s hard to guess, really. But we are looking for a problem that won’t solve itself, and the program checking for this problem will continue to write to the log file upon each encounter with the problem.

    The way to solve this kind of problem, where we want to ignore the timestamp, is to understand how NimBUS handle incoming alarms. If it receives the same message two or more times, it would just upper the count, instead of creating a new entry in the alarm window.

    Lets say our log file looks like this:

    Mar 14 14:55:35 ErrorCheck: Oh noes, error detected in A51
    Mar 14 14:57:32 ErrorCheck: Oh noes, error detected in A51

    We only want to get one alarm, but with a count of two (actually one), not two alarms which is identical except for the timestamp. First, set up logmon to detect the correct line in the log file using regular expressions. The logmon probe supports both pattern recognition and regular expressions, so make sure to use the right one. Regex starts and end with a forward slash, otherwise it assumes pattern is used.

    In this case we can use the following simple regex:

    /.*ErrorCheck.*/

    Of course my regex where more advanced since I had to detect other parameters as well, since the output of our program also had to be checked.

    Now, with this regex in place, we are at the point where every entry will be treated uniquely. But logmon also give you the possibility to construct your own message, and to define variables. And that is what we have to do.

    We can construct variables both by row or column number. Since this is a single line, we will use the column offset. So, let us create the variables:

    prog = column number 4
    error = column number 10

    This is only a simplified view. The logmon probe has a user interface for this. Right click, add new variable (or something like that).

    When this is done, add your own message text in the field saying so:

    $prog: Error detected in $error

    When this is set as the outbound message, NimBUS will count it instead of creating a new entry in the alarm view each time, since the message now is identical. If the error code changes, a new alarm will be sent.

    Short version:

    Create your own output message when using NimBUS logmon probe on a log file which has a timestamp.

    (This short version was a lot better and could have saved me some time)

  • Når skal bransjen våkne?

    This is in Norwegian, sorry….

    Dagbladet.no publiserte i dag artikkelen “Annenhver så filmen i opptak“, og handler om hvordan PVR-dekodere, Personal Video Recorder, griper om seg. Som eksempel viser dem til nyinnspillingen av filmen “Planet of The Apes”, hvor 47 prosent av seerne så den i opptak.

    Jeg skal ikke gjengi alt her, ettersom det naturligvis er best å lese artikkelen i sin fulle helhet på Dagbladet.no, men jeg ønsker å sitere min egen kommentar på artikkelen her:

    Ut fra disse tallene bør jo bransjen snart innse at folk ønsker å se hva det vil, når det vil.

    Ren spekulasjon; Men jeg vil tippe at flesteparten av TV-seriene som blir lastet ned her i Norge er serier som ikke sendes på norsk TV når den slippes i orginallandet, og når den først dukker opp så er det på et klokkeslett som ikke passer folk flest.

    RiksTV er ikke et digitalt fremskritt. Jeg venter fremdeles på dagen når man kan sette sammen TV-tilbudet selv. Kanal for kanal, eller enda bedre, program for program.

    Med PVR-dekoder er man et lite stykke på vei, men man må fremdeles betale for alt man ikke er interessert i å se.

  • 12 months in the Apple garden

    About a year ago, a friend of mine bought his first Mac and set of to explore the world as an Apple maniac. Now, 10 months later, he has finally begun to write about his experience.

    From his blog:

    Macify me is an attempt to document my first year as a Mac user. The idea is to try out some of the many myths and (mis?)conceptions around Apple, Mac and iEverything. I’ve decided to put myself in the role of the guinea pig and let all the good, the bad and the ugly of Apple Mac get into my life.

    In short – macify me !

  • Top 5 Spiders Visiting

    I guess you all know how search engines index the web. They send robots, or spiders, to surf the web and collect information about different pages. About a week ago I installed StatPress on my WordPress installation to collect some statistics about my visitors. 

    StatPress is a plug-in for WordPress which allows for real-time statistics about visitors. It reports most popular posts, browsers, search terms used to find your blog and also which search company visits your site most frequently.

    In these 7  days I’ve had StatPress installed it has collected the following information about the search companies indexing my site. The results are in percentage of visitors recognized by StatPress as spiders:

    • Baidu – 34.2% (344 visits)
    • Google – 14.7% (148 visits)
    • Yahoo! – 11.4% (115 visits)
    • MSN – 7.7% (77 visits)
    • Radian6 – 7.5% (75 visits)

    The latter one I haven’t even heard about, but apparently they’re working on social media. Or in their own words:

    “Radian6 created tools to help remove the barriers to effective social media monitoring and analysis.”

    This list may not be 100% accurate since StatPress only lists spiders which is know to it. At least I think that’s what it does, because I have yet to see a single entry from any Norwegian search engine. But then again, maybe they’re not aggressive enough to get onto the list?