rblog

Weekend milestones: Road biking, 1000 km and 500 workouts

Several milestones this weekend

  • Snow almost gone away, warm weather, got to use my road bike last Sunday
  • 1000 kilometers on bike so far this year, thanks to commuting
  • 500 workouts registered on my cell phone using Sports Tracker…had it for two years, so not that impressing, but fun to know at least

And thanks to the people at Renovasjonsetaten at Oslo Kommune who already have been out sweeping the bike (and walk) road out at Klemetsrud.

Removing Windows newline in bash scripts

Had an issue with the ‘^M’ characther in some files causing unwanted line breaks. Got some help from colleagues pointing out that it is a Windows line break. But – how to remove it in my bash script? Easy to do using TR told me, but no. Added

tmp="$(echo ${mLine} | tr -d '^M')"

but no luck…after some struggle it turned out that I could not just write ^M, I had to add it to the script using CTRL + V, then immediately followed by CTRL+V. Using VI as the editor that was what I needed to do to add the newline character to my script.

Discussing stairs

Discussing stairs at work, Youtube to the rescue when I tried to describe unnecessary use of stairs, no better example than Fawlty Towers , the extra stairs on first floor.

Basil and Manuel at their best…

[video:youtube:2AHIRC7RcDM]

Create a blog post in Confluence using Groovy

Needed a way to publish a file containing a list of application versions installed in our WebSphere environment. What better to use than Groovy and XML-RPC for Atlassian Confluence. Tested on version 3.5


import groovy.net.xmlrpc.*

// ************** Set according to your environment ********
def SERVER = "http://<YOUR_SERVER_NAME>/rpc/xmlrpc"
def UID = "<UID>"
def PWD = "<PWD>"
def SPACEKEY = "<SPACEKEY>"
def BLOGTITLE = "<BLOGTITLE>"
def CONTENTTXT = "<TEXT WITH MACROS AND SUCH>"
// *******************************************************

println "Connect to server"
def c = new XMLRPCServerProxy(SERVER)

println "Login to server"
def token = c.confluence1.login(UID,PWD)

// Example found at http://confluence.atlassian.com/display/DISC/XML-RPC+Page+Updater+Example
println "Create blog and then save it"
def newBlogdata = [space:SPACEKEY,title:BLOGTITLE,content:CONTENTTXT]
c.confluence1.storeBlogEntry(token, newBlogdata)

// Clean up by logging out
println "Logout"
c.confluence1.logout(token)

Update:
In additon you would off course need to download the needed jar file, get it at http://groovy.codehaus.org/XMLRPC

Oh joy!!! New bike: Everest Twenty9

After having considered for a while whether to buy a Scott Scale 29 Expert or the Everest Twenty9 I decided yesterday to go for less weight – so here it is in our living room, the brand new 2011 Everest Twenty9…even Elin accepted the fact that the bike is placed here for a while. Can’t take it outside just yet… So now it is truly all up to me when heading for Germany in June.

All the technical details can be found here www.oslosportslager.no/…/everest-twenty9-carbon-2011-terrengsykkel

Can’t wait to test the SRAM 2×10, I read the thread found here forums.mtbr.com/…/why-3×10-vs-2×10-662945.html and what some points out that the overlap is decreased a lot it just what I was hoping for…spring, come and get me!!

My latest book – Kai Eide “Høyt spill om Afghanistan”

Kai Aage Eide (born 28 February 1949 in Sarpsborg) is a Norwegian diplomat. He was appointed the United Nations Special Representative to Afghanistan and Head of the United Nations Assistance Mission in Afghanistan (UNAMA) on 7 March 2008,[1] a position he held until March 2010 when Staffan de Mistura took over….

http://en.wikipedia.org/wiki/Kai_Eide

Well worth reading!