Liboping install

I use Florian octo Forster’s fantastic parrallel ping library liboping, and over the last 9 months or so have contributed a few minor bug fixes (mostly build related stuff, so not exactly core to the library’s code). I use this for doing parallel pings of hosts and gathering stats, as part of a wider heuristic for site web speed. Of course not all hosts respond to ping, but thats fine; some do.

I went to build vresion 1.6.1, and found that it installed into /opt. This was from source as I was on a platform that is not Debian (otherwise I’d just use the package and be done with it). I found that by default, everything had been put into /opt. I prefer using /usr/local, so I built it with:

./configure --prefix=/usr/local && make && make install && make install-data

The reason for the last one is that I want the headers installed. I then want to make the Perl library; and for that I need the linker to be able to find the library. I found that I need a file in /etc/ld.so.conf.d/ that lists this location, so along came “echo /usr/local/lib > /etc/ld.so.conf.d/usrlocal.conf“, followed by a quick ldconfig run to update the paths. I could then cpan -i Net::Oping.

Why blog this? Because every few months I have to try and remember it. Now I just need to remember that I blogged it.

With thanks for Florian octo Forster for the library, of course.

MySQL UTF8 and Perl

It’s been quite annoying; DBI and DBD::MySQL seems to default to Latin 1, and it appears that the client side way of “updating” to UTF8 is to issue “USE NAMES utf8” as ytour first query when you connect to MySQl (in my case, 5.5.x). The alternate is to tell the server that it should automatically do this query each time a client connects, or alternatively, disable encoding negotiation and use everything as UTF8. Here’s a few links I found useful:

And a quote from the second:

[mysqld]
default-character-set=utf8
default-collation=utf8_general_ci
character-set-server=utf8
collation-server=utf8_general_ci
init-connect=’SET NAMES utf8′

[client]
default-character-set=utf8

As you’ll see in the first link above (Stackoverflow), adding params with spaces to Amazon RDS is a little tricky from Win platform – and you have no choice but to use the CLI tools for RDS to do this.