rblog

Moose close to the road

Out driving with my father-in-law when we spotted two young moose walking close to the road eating leafs. Drove past them, stopped and backed and stopped and watched them for 2-3 minutes, they did not bother at all. Photo taken with my iPhone, so bear with me

My latest book: Øyvind Strømmen – Det mørke nettet

Gjennom bruk av en rekke konkrete eksempler, tegner Strømme et sammensatt, men tydelig bilde av det anti-islamske Europa – fra konspirasjonsteoretikerne til demografipanikerne, fra forfatterne Oriana Fallaci til høyreskstreme partier som Vlaams Belang og Front National, i tillegg til en hær av islamkritiske bloggere, med norske Fjordmann som en av de mest markante stemmene. Forfatteren forteller også historien om høyreekstrem terror de siste tiårene, som bomben i Oslo i 1985, brannstiftelser mot asylmottak på 1980 og 1990-tallet, og om andre typer politisk vold fra ekstremhøyre, som de to lasermennene i Sverige.

Cappelen.no

Read more at http://www.nrk.no/nyheter/kultur/litteratur/1.7878474 (both in Norwegian)

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-)