rblog

Using Notepad++ and regex to search and append text

Needed to search an access.log file from Apache where each line started with an ip-address. Due to a limitation in AWstats, see bityard.org/…/apache_awstats_x-forwarded-for I did have to update the current log file (and later update httpd.conf to get rid of difference in # of fields)

Anyhow, in order to get a workaround I needed to add the missing hyphen ‘-‘ for all requests that does not use the load balancer. Pretty simple, many blog posts on how to do it, e.g stackoverflow.com/…/using-regex-to-prefix-and-append-in-notepad. To append, use \1 (and \2 etc if needed). My regex expression was

^(?:[0-9]{1,3}\.){3}[0-9]{1,3}\s-

Confirmed by using http://gskinner.com/RegExr/.
Problem was that the ‘\1’ did not work…until I RTFM. I needed to add a parenthesis to create a collection so that Notepad++ (Or more correct the Regex-engine knew what I refer to when using ‘\n’).

(^(?:[0-9]{1,3}\.){3}[0-9]{1,3}\s-)

Communal duty work on the rooftop ( shouting out )

Last Sunday – communal duty work together helping Kjetil out with his roof.

Nice weather, but weather forecast promised rain so we had to work hard to finish up. And in addition it was the fear of flood, see picture here http://www.rb.no/bilde/article6675265.ece Luckily we finished the root and no flood reached his house either.

…and standing on the rooftop reminded me of
[video:youtube:5yOCrXC8G3g]

First bike ride!

This year is not like the past ones, today I had my first bike ride, 5 months later than for instance last year. But, what is better is the weather when riding the bike in May than in January.

A quick stop overlooking Maridalsvatnet.

Things to do when in Rome

The naumachia (in Latin naumachia, from the Ancient Greek ναυμαχία/naumachía, literally “naval combat”) in the Ancient Roman world referred to both the staging of naval battles as mass entertainment and the basin (or more broadly, the complex) in which this took place….

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

Or what about diving horses? [video:youtube:r8vIjuIeQpM]

More to learn if you listen to Sirkus at Radio Nova

Hjem