This is insane... cyclist gets lucky escape after car recklessly pulls across his path:
NeoRaffle 2014 has entered the item registration phase! Go check out what's on offer this year and add some cool stuff! http://neo.ly/1qYotBG
NeoRaffle 2014: User registration for this year's raffle is now live! http://neo.ly/1tJMF0e
Things UK does right - power plugs:
NeoRaffle 2014 is coming... http://neo.ly/1lODNML
Some great quotes here. :)

Post your favorite programming quotes here. They can be funny, inspirational, or anything as long as they are programming quo

It costs less than 50 cents a week for a year's Neo+ membership - not even a third of a bottle of coke! Support Neo! http://neo.ly/1xiM5ox

Hey so like most of you guys, I absolutely love web programming. I just wanted to let you all know, you can indeed turn this...

World's worst cracker -> http://bit.ly/HC0suf

Background

Time to put my SysAdmin hat on for a moment to explain how to run the popular Windows IRC log parsing application: mIRCStats on a headless Linux box without an X Server. I found no resources online how to do this despite this being, in my view, a very likely use case. Of course, there are alternative open-source IRC stat generation projects that can accomplish this with ease such as pisg, IRCStats and Denora. I personally prefer the features and layout that mIRCStats generates though having tried the others, therefore I was determined to get this running. :)

This was tested with:
  • mIRCStats 1.24
  • Debian 7 (Wheezy)
  • WINE 1.4.1
  • xvfb (X Virtual Frame Buffer) 1.12.4-6
This should work into the future with later versions, but YMMV of course.

Problems and Fixes

No X Server - No Display

The first problem that you will encounter is the fact that the mIRCStats application attempts to spawn its GUI window whenever you try to launch it via WINE, even if it has all the information necessary to process stats via its settings file or command line options. (It is more than a little annoying that it insists on spawning a window just to tell you it's updating the stats, but I guess when borrowing Window software I should expect it to follow typical Windows user conventions.) This will obviously fail as no X Server is running on your box and thus there's no display to draw to:
quote
dynamite@debian:~/mircstats$ wine mircstats
Application tried to create a window, but no driver could be loaded.
Make sure that your X server is running and that $DISPLAY is set correctly.
Obviously installing the entire X Server purely for this on the box is highly undesirable. Luckily, it it possible to fool the application into thinking a real display exists by using Xvfb (X Virtual Frame Buffer) to spawn a "display" that performs all graphical operations in memory. This is very handy when we don't care about the actual graphical output and just want the utility to get on with its job and close, which is precisely what mIRCStats does. Go ahead and install that using your preferred method for your distribution. On Debian, Xvfb resides in the stable repository so it's as simple as: apt-get install xvfb

Unhandled Page Fault

Now you have Xvfb installed, you should be able to use the xvfb-run wrapper script to quickly spawn a mIRCStats session and make it process the logs:
quote
dynamite@debian:~$ xvfb-run wine /home/dynamite/mircstats/mircstats.exe -l "/home/dynamite/mircstats/*.log" -html "/var/www/services.pwnsu.com/neoseeker.html"
At least that was the theory. In practice, I encountered the following crash at this point from WINE itself:
quote
wine: Unhandled page fault on read access to 0xfffffffe at address 0x0000:0x7bc4a744 (thread 0009), starting debugger...
It seemed to still be having problems spawning the window. It was at this point that I delved into the default mIRCStats Config/settings.cfg file and switched the default starting mode of the application to spawn a tray icon instead of trying to launch a window:
Minimized = Tray

For good measure I switched on Automode by default and removed the Countdown to speed the process up a little:
Automode = Yes 
Countdown = No

With those changes made, the command executed previously should work and your stats should get generated. From there on, a simple crontab entry to generate our stats on an hourly cycle was in order to complete the job:
quote
0 * * * * xvfb-run wine /home/dynamite/mircstats/mircstats.exe -l "/home/dynamite/irclogs/pwnsu/*neoseeker*" -html "/var/www/services.pwnsu.com/neoseeker.html" > /dev/null 2>&1
Note: It is important to enclose the cmdline variables passed to mIRCStats within quotation marks otherwise you may see behavior like the wildcard * not be interpreted correctly.

I hope this proves useful for someone looking to do the same. :)

Read more
All golds for Tiffy! Time for Mirror Mode and/or multiplayer I think!

Tiffany di Vita

  • ICQ 174984862
  • AIM NeoDyno
  • Microsoft account neodynamite@hot-shot.com
  • Google Talk neodynamite@gmail.com
Site Positions
  • Supermod
  • Moderator
  • Beta Tester
Forums Moderated

Statistics

  • Profile views 59,773
  • Number of logins 18,647
  • Forum Posts 10,402
  • Neopoints 1,218
  • GameGrep Points 2

Game Identities

  • Nintendo Network ID TiffyU
  • SteamID Tiffany
(0.2613/d/web3)