Write your own Accesslog parser in Perl

Writing an apache access log parser isn’t that hard. Below is a parser that does just that. It creates Data::Dumper output of all the lines. No warranty. use Data::Dumper; use Parse::RecDescent; $Parse::RecDescent::skip = ''; my $grammar = q{ line: ip ws '-' ws user ws datetime ws request ws status ws responsesize ws referrer ws useragent "\n" { $return = { ip => $item[1], user => $item[5], datetime => $item[7], method => $item[9]->{method}, url => $item[9]->{url}, protocol => $item[9]->{protocol}, status => $item[11], size => $item[13], referrer => $item[15], useragent => $item[17], } } user: '-' | /\w+/ request: '"' method ws url ws protocol '"' { $return = { method => $item[2], url => $item[4], protocol => $item[6] } } datetime: '[' date ':' time ws timezone ']' { $return = $item[2] ....

April 12, 2011

Apache accesslog reporting tools

Today I tried to create a report of some basic statistics about Abacus downloads. Normally I would use grep, awk and a few other commandline tools to find a rough estimate of these numbers. However this time I needed a bit more information than these tools could give me. A problem in need of a solution. My first question was: how many people have downloaded Abacus? The answer is grep '/abacus/files/Abacus' | grep -v '<localip>' \ | grep -v 'somebots' | awk '{print $1}' | sort | uniq | wc -l The pattern here is the following....

April 12, 2011

Creating thumbnails with Windowpipe

Yesterday I created a small program called Windowpipe. IT allows you to drop files in a window and it will a script on that file. To give you a better idea of how this works, I created a small screencast. So what’s happening? First I drag the shoes.jpg file to the windowpipe window, which I started before with createthumb.pl. After the drag a new file is created called thumb_shoes.jpg. Then I show the two files....

April 6, 2011

Drop files on a window and run a script

The premise is simple: create a window the runs a script on the items that were dropped on the window. Simple idea, simple program. I took a first crack at it and uploaded the code. The first release just runs a script and passes the dropped thing.

April 5, 2011

Fiddle - a music player

All music players suck, all in different ways. The music player that I created sucks too. A lot actually, but that’s to be expected. The work of three days is now available to the public in some kind of alpha release. The player is called Fiddle and is available in my Git repository. But please take a look at the website that I created for it. It contains a lot of good information about downloading and running Fiddle....

September 15, 2008

Programs that I use in 2008

In 2005 I wrote a small post about the programs that I use on a regular basis. I will try and find out what has changed and what stayed the same. I still use: vim - an editor rxvt-unicode - an X terminal ion3 - a window manager xmonad - another window manager (written in Haskell) firefox - a web browser mutt - a email client vim outliner - a todo list/outliner tool Programs that I don’t use anymore:...

August 8, 2008

Graphical Disk Representation

This weekend I tried Gnome on Debian unstable to see how the compiz window manager and other new stuff was working. I’m currently use pekwm. After a few hours of usage, I reverted back to my current desktop. On the way I found out a two things: You should remove the package files that are downloaded by aptitude. I collected about 7 GB of .deb packages. You can clean this up by using the command: apt-get autoclean....

January 21, 2008

I want Sandy

I want Sandy is a personal assistant, who will remind and remember all things you send to here via email. Write paragraphs like: remind me to take out the garbage this evening and Sandy will send you an email or SMS when the time comes. There’s is much more possible using Sandy. I think you should take a look.

November 15, 2007

Hit-a-Hint extension for Firefox 1.5

I just noticed that the Hit-a-Hint extension is upgraded for Firefox 1.5. This is great because it will let click links and buttons without using the mouse. When I installed it there was one problem though, it didn’t work. The solution was found quickly. Goto about:config and search the key extensions.hah.hints.tags and change that to: //a|//input|//textarea|//select|//button|//isindex|//frame|//iframe and it will work. I’m not sure what the problem was, but this will at least make it work....

January 18, 2006

Music Player Daemon

I thought about how a daemon program could be easy to use for playing music. So I started with some research by googling for ‘music player daemon’. And the first result was a link to a program called ‘Music Player Daemon’. This program runs in the background and can be controlled with php based websites or a command line tool. This is nice separation of concerns. So I installed the package and tried it....

December 10, 2005