rblog

Spring tide in Oslofjorden yesterday

Pictures are kinda bad, taken with the Nokia N81 I borrow while my phone is being fixed (they have spent almost three weeks now), but still you get the point. The first picture is taken at Skøyen, or to be more accurate along Bestumkilen. As you see people had to walk and cycle on the lawn due to sea water flooding the walkway.

Alongside Frognerstranda, care for some Coca Cola?

Stomperudrittet 2011

Last Sunday I attended in Stomperudrittet. 37 kilometers with plenty of mud, mud and more mud. Due to heavy rain the last month in fact it was really heavy conditions, tires where sucked down into the mud in a way I had never experienced before. Even going downhill on the fields were really heavy and I was not able to gain any speed at all, in fact running was almost as easy. But – very much fun also.

My plan was to film before start and afterwards, since my friends Anders and Lars also attended, but I did not bother. Only thing I had in my mind when I had passed the finish line was to clean my bike and then myself. And when at home I even had to flush them using the garden hose.

Hoping for better conditions next year.

Oh what a beautiful morning

OBS-varsel for Vestfold, Østfold og Buskerud, Oslo og Akershus:I natt og fram til søndag formiddag lokalt kraftige byger med store nedbørverdier.

Google translate translates this into:

OBS alert for Vestfold, Østfold and Buskerud, Oslo and Akershus: Last night until Sunday morning locally heavy showers with heavy rain values.

And I’m about to participate in Stomperudrittet…looking forward to it…not really sure

Lunch at Fjord og Fjell

Following the internal Metro class at work for two days, enjoying good lunch at the restaurant Fjord og Fjell at the Telenor Expo Center here at Fornebu. The food is good, but the best part is off course the 180 degree view towards Oslo. Since I do not have a fisheye lens on my cell phone you most manage with this simple picture.

Another limitation when using my cell phone camera, back light. So here you have a picture of Thomas ready to enjoy his lamb knob (?), edited pretty much using Picasa.

WebGroup / virtual host not defined on WebSphere

Every once in a while I get the error
SRVE0255E: A WebGroup/Virtual Host to handle /KillerApp has not been defined
This is most often caused by me typing either the wrong port number (if no web server is configured) or a type in the context root of the web application. Currently following an internal course where I was supposed to deploy an app and find the url to it. According to what I know it should be http://localhost:9080/KillerApp since the WC_defaulthost of server1 was 9080. But after many minutes of struggle I kept getting the error again and again…so then Google…

IBM Redbook to the rescue, “WebSphere Application Server V6.1: Web Container Problem Determination“. It turned out to be a very simple, and also stupid solution on the problem. Stupid, since I had caused the problem myself. Some time ago I must have altered the default_host virtual host settings, so I had changed the host alias from 9080 to 9089.

This post at coderanch.com helped me find the info, see the last comment to the issue. It references the redpiece, not the redbook, so use my link instead.

How to format your Nokia

Use the code *#7370# to format your phone, resetting it to the fabric settings. Tried it on my Nokia E72 when the email application that comes along with the phone, and which my employee demands me to use in order to sync with Exchange, screwed up. Formatted and reconfigured, now it works as it should again. Nokia Support Forums to the rescue

Did also try out the Emoze messaging client http://www.emoze.com/. Works as a charm, but since the Exchange integration is based on Outlook Web Access (OWA) and not a directly Exchange-server integration, it is a violation of my employers email rules – and therefore not an option for me (it is blocked).

Shell script looping files in a directory, search and replace text in each file

Had to create a shell script that is looping through a set of XML files in a given directory. For each file it checks if the file has the attribute “CCSID“. It it does not have the attribute, it inserts the attribute just after the opening tag MQQueueConnectionFactory using Perl, and if it is there already it will update the value using a SED-command with a simple REGEX-pattern. Ok, I know that I could have used either SED or Perl for both, but I just borrowed from some other scripts I had, so that is the reason.

The REGEX-pattern ain’t no rocket science, but since I use REGEX only once in a while I find it quite hard to crate patterns, could not have done it without http://www.gskinner.com/RegExr/

  FILES=/path_to_directory/my-files*.xml
  for file in $FILES
  do
    # CCSID attribute present or not
    grep CCSID $file  >> /dev/null
    if [ $? -eq 1 ]
    then
      # Not present, insert
      perl -pi -e "s#<MQQueueConnectionFactory\s#<MQQueueConnectionFactory CCSID=\"1208\" #g" ${file}
    else
      # Present, update
      sed -i 's/CCSID="[0-9]*"/CCSID="1208"/' ${file}
    fi
  done 

Splitting text using Python

Created a script just to test how to split text using Python. First I have to split on the delimiter ‘__’, then on the ‘.’.

#!/usr/bin/python
propertyFilename="commons-ear__R01_INC_002.properties"
print propertyFilename
versionWithFileExt = propertyFilename.split('__')
print versionWithFileExt
version = versionWithFileExt[1].split('.')
print version
#And to get the final string
print version[0]

Not that hard, but what confused me when reading the Python documentation was that str.split() is deprecated. But as it turned out, that is in version 2.7, currently we are using 2.4, find out by issuing the command
ls -l /usr/bin/python*

From version 2.7 you should instead use stringObject.rpartition(sep), see more at about.com

Hjem