Ever wondered how to do proper error handling in bash scripts? Check out http://fvue.nl/wiki/Bash:_Error_handling – it made my day!
rblog
My code is open source
Ages ago I created my own project in Java that enables me to export my entire blog (or parts of it) to PDF. Not very useful for my personal blog off course, but for the two blogs I have created for my kids it is my master plan to sometime have a book created. Who knows, in 50 years if they are able to view the content of the B2Evolution blog, but paper will for sure last that long.
My project is hosted by Google Code, http://code.google.com/p/b2evolution-to-pdf/ – free for everyone to use with the limitations that the third party libraries have.
Main purpose of publishing it to Google Code is to have a backup of the code, not just store it on my Lenovo T60 laptop which is…7 years old now? Second, it might be that someone out there might have the same need as me, and maybe my effort could save them time.
What ports are open on my system?
Had an issue today trying to figure out which port to use in order to access a test installation of Atlassian JIRA installed by someone else ages ago. The command was simple:
nmap -sS -O 127.0.0.1
Thanks to http://www.linux-noob.com and the frequent member xDamox who created the post back in 2005.
Dødsdømt og fri – Arvid Møller
Have had a few days of vacation at Sjusjøen, where I found the book “Dødsdømt og fri”, the book about Arnulf Birger Lund, who was part of Milorg during WW2, and was captured by the local Nazis and tortured. The book tells the story about his life before and after the war. Most of all I’m impressed of his ability to make peace after the war with the people who had tortured him.
No picture of the book or Arnuld Lund himself available, but if intersted find out more by reading about Arvid Møller
“Elitesoldat…” – Thomas Rathsack and Dennis Drejer
Thomas Rathsack is a former member of the Danish special forces unit, Jægerkorpset. The book “Elitesoldat, i krig på fremmed jord” (Hunter – fighting with the elite) is about his experiences from the armed forces, but also about why he choosed such a life, and as important, why he decided to quit, before joining again after several years as a civilian. Easy to read and exiting.
Cold engine making dirty snow
Today we finished our winter vacation, Elin and the kids have been one week at Sjusjøen, I have been there from Wednesday. Last night it snowed about 10cm of the finest powder so everything was all white and shiny when I backed the car to where I could turn around. I revved up the engine and spun it around. Since the engine was cold that caused quite much exhaust, nothing abnormal, but I must admit that I was a bit surprised to see that a thin layer of exhaust, almost like ash, had covered the snow.
Nordic World Ski Championship and True Grit
Me and Espen agreed to go and watch True Grit today just after work. Took the bus to the National Theater and when walking towards the subway I noticed some loud music playing. They where rehearsing for the opening of the Nordic World Ski Championship in front of the University.
Then off to Majorstua, had to find something to eat and since it is the World Cup in Oslo now, I tried the World Cup menu at Burger King…tasted shit still…why can’t I learn, better to stay hungry.
Then I I meet Espen and we went to Colosseum and watched True Grit…good one.
Keith Richards – Life
My latest book, the Keith Richards’ autobiography Life. A long life as a rock and roller equals a very thick book. Enjoyed parts of it, other parts…not my cup of tea – to much talk about playing the guitar and such stuff which went way above my head. But it has a food recipe, if that does matter…in fact, I did not bother to finish up the last 30-40 pages…not to often I give up on a book.
Lovely winter’s day in Oslo yesterday
While my skis where miles away from me I needed some other excuse to get out and enjoy the nice weather yesterday. Decided to take the bus out to Fornebu to pick up my bike there. This picture is taken close to Lysaker
Took a stop on the bridge crossing the road in Bjørvika, using the panorama function of my cell phone.
Took a stop and noticed that my rear tyre is pretty much covered with salt. Need some warm weather pretty soon so I can clean my bike.
I’m a nerd and I’m proud!!
Had a folder with about 350 property files, but with only 150 of them having a valid file name. No problem finding the files with a valid file name using find in combination with regex
find . -regex '.*__.*properties'
Problem is that I do not want to find the files with valid file names, I needed the ones with invalid names, but all the time regex is powerfull doing almost anything except excluding phrases and such (as I have read in various sources found by Google) I had to find a workaround.
So here goes, all from the directory where the files are located
- ls > allfiles.txt create a file with all filenames
- perl -pi -e ‘s#.*__.*properties##g’ allfiles.txt Remove all valid filenames
- perl -pi -e ‘s#^\n##g’ allfiles.txt Turned out that I did not remove the newlines, so to get rid of all the blank lines I needed to issue this command as well.
- for i in `cat allfiles.txt`; do svn delete $i; done This oneliner loops through the file, for each line delete the file from subversion (which deletes the file for me)
Voila! Pleased with myself 🙂








