Category Archives: Geeky

Technical stuff about Perl, Linux and computing & technology in general.

CPAN Testers FAQ

David Golden recently pointed out (based on an IRC discussion) that the CPAN Testers FAQ isn’t particularly easy to find and doesn’t show up well in search results, so I’m posting this just to do my bit to make it a little easier to find.

It covers such questions as:

  • “How can I indicate that my distribution only works on certain versions of Perl?”
  • “How can I indicate that my distribution only works on a particular operating system?”
  • “How can I stop getting FAIL reports for missing libraries or other non-Perl dependencies?”
  • “How do I contact a tester?”
  • “How do I stop getting these reports?”

So, if you need an answer to any of those questions, head on over to the CPAN Testers FAQ where you’ll find your answer.

It would be helpful if the FAQ contained named anchors so that I could link to the answer for each of those questions above, actually.

Disabling Facebook chat in browser

I wanted to turn off the Facebook chat “bar” at the bottom of each browser window when browsing Facebook, as I use Facebook Chat via Empathy (a real IM client), so I had no need for annoying chat windows popping up in the browser.

Quick easy fix – I use Adblock Plus in Firefox, so just filter out the following:

facebook.com#div(id*=presence)

And, job done – no more Facebook chat bar!

Dancer::Plugin::Database 1.00 released

I’ve just released Dancer::Plugin::Database 1.00 to CPAN. This includes Alan Haggai’s patch to supply runtime configuration info to the database keyword as a hashref (thanks, Alan!) which was already released as a developer release, 0.91_01.

I’ve bumped the version to 1.00 to indicate that I consider it stable and ready for use in production, for those users who mistrust any module with a 0.xx version number.

Debian Xen kernel won’t boot until you create initrd image

I recently installed Xen on a Debian Lenny amd64 box, and found that the Xen kernel would not boot, failing to mount the root filesystem:

No filesystem could mount root, tried:
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

I noticed in /boot/grub/menu.lst that the standard Debian kernel included an initrd image, whereas the Xen kernel didn’t:

# This is the Xen kernel that fails to boot:
title           Xen 3.2-1-amd64 / Debian GNU/Linux, kernel 2.6.26-2-xen-amd64
root            (hd0,0)
kernel          /boot/xen-3.2-1-amd64.gz
module          /boot/vmlinuz-2.6.26-2-xen-amd64 root=/dev/sda1 ro console=tty0

# This is the standard kernel that does boot:
title           Debian GNU/Linux, kernel 2.6.26-2-amd64
root            (hd0,0)
kernel          /boot/vmlinuz-2.6.26-2-amd64 root=/dev/sda1 ro quiet
initrd          /boot/initrd.img-2.6.26-2-amd64

To get the Xen kernel working, I needed to create an initrd image, with:

dave@devvps:/boot$ sudo update-initramfs -c -k 2.6.26-2-xen-amd64
update-initramfs: Generating /boot/initrd.img-2.6.26-2-xen-amd64

Then update the Xen kernel’s entry in /boot/grub/menu.lst appropriately:

title           Xen 3.2-1-amd64 / Debian GNU/Linux, kernel 2.6.26-2-xen-amd64
root            (hd0,0)
kernel          /boot/xen-3.2-1-amd64.gz
module          /boot/vmlinuz-2.6.26-2-xen-amd64 root=/dev/sda1 ro console=tty0
module          /boot/initrd.img-2.6.26-2-xen-amd64

Upon rebooting, the Xen kernel boots succesfully, and Xen appears to be working:

dave@devvps:~$ sudo xm list
Name                                        ID   Mem VCPUs      State   Time(s)
Domain-0                                     0 24106     8     r-----     22.4

So, if you’ve installed a Xen kernel on Debian, remember to create an initrd image. I’m fairly surprised that this doesn’t happen automatically when the kernel is installed, actually.

Perl advent calendars

It’s quite common in the Perl community to produce advent calendars, hosting an article per day in the run-up to Christmas – several projects do this, along with a few prolific authors.

This year, the Dancer Perl web micro-framework (a project I contribute to) joins the party, with the PerlDancer Advent Calendar 2010! We decided it would be wrong to not have the Dancer advent calendar powered by a Dancer app – dogfooding in action :)

Here’s other calendars I’m aware of (if you know of any I’m missing, feel free to let me know and I’ll update the post!)

And more that I’m not yet sure are going to run a calendar this year or not:

Dancer::Plugin::MPD released

I recently wrote Dancer::Plugin::MPD, a simple plugin to make it easy to talk to MPD (Music Player Daemon) from Dancer-powered webapps in Perl.

It uses Jerome Quelin’s excellent Audio::MPD – it simply provides an mpd keyword which returns a connected Audio::MPD object (connecting first, if we didn’t have a connection or it went away, otherwise keeping the connected object cached).

It makes for code as simple as this example from DancerJukebox:

get '/control/skip' => sub { mpd->next; redirect '/'; };

Dancer::Plugin::DebugDump released

I recently released a dead-simple plugin for Dancer – Dancer::Plugin::DebugDump.

During development, I fairly often find myself using Data::Dump to dump stuff to the debug log (which I usually have set to ‘console’, so it appears in the terminal I’m running the app from), with code like:

use Data::Dump qw(dump);
debug("Random hashref: " . dump($hashref) );

I got fed up with writing that, so I wrote Dancer::Plugin::DebugDump, which lets you say:

# give it a label and a reference/object:
debug_dump("Random hashref:" => $hashref);
# or just give it a reference/object:
debug_dump($someobject);

It’s not much of a saving, but it scratched an itch, and might possibly be useful to others.