« December 2006 | Main | February 2007 »

January 31, 2007

Good stuff coming to a Kernel near you.

Yesterday, Zack Brown (of kernel-traffic fame) posted a patch to run any Linux syscall asynchronously. One of the problems with people doing high-performance event-driven network programming like Lighttpd, Perlbal, or DJabberd was that some syscalls block, and there wasn't a good clean way to do it. One of them mentioned regularly is stat. For kicks, Lighttpd has a patch to move stat to a fcgi app...

Good news is that Linus liked it.

Happy, happy, joy, joy!

(via Brad)

RedHat and the RHN Satellite Server

Just saw that RedHat will release RHN Satellite Server source code.

Well, too late.

I was a more or less happy customer of RHEL for 2 years, with 4 licenses of RHES3. The distribution was rock solid, but the RHN was a mess, rarely worked the way it was supposed to, updating only some of my servers, and the performance was painfully slow.

I dropped RHEL and moved over to CentOS, not because of price (I believe they should be payed by their services), but because the software update service was better, '''way''' better than RHN. I've dropped CentOS paypal account some cash, also. Good things should be encouraged.

January 25, 2007

Top 3 tools for MySQL

At the moment, my top 3 tools to tune MySQL are:

  • mysqlreport: a friendly report about the status of your MySQL server (or SHOW STATUS for real persons);
  • innotop: a top-like program to see what's going on with your MySQL server (works with multiple servers);
  • mysqlsla: analyses MySQL statement logs (including slow queries).

Other tools are also useful sometimes:

  • Duplicate Index Checker: checks your indexes to see if you have multiple indexes covering the same information, in the same order;
  • MySQL Query Profiler: reports on what work MySQL will have to do for a given batch of queries.

I discover most of this tools reading the Xaprb blog, recommended.

January 24, 2007

Twitter

Twitter.com is becoming a world wide chat-room or IRC channel, where two or three people have a conversation twitting their messages.

Crazy. Get a room already!

January 22, 2007

JQuery Love

I'm not a Javascript guru, I just dabble a bit, and most of the time I would only reuse stuff from other persons. Until I spent a weekend with JQuery.

I needed a small JS lib to do some stuff in a application I'm working on. Basic stuff, like edit in place, building HTML live and adding more options to forms.

After looking at the tutorials and "how it works"-kind of pages, I started to try it out.

One of the things I wanted was a dismiss specific paragraphs that we use for success or error messages.

I found an example on the JQuery blog that looked promissing. It would hide the message after 5 seconds. The code is simple:

$(document).ready(function(){
    /* add class timed_fadeout to fadeOut after 5 seconds */
    $('p.timed_fade_out').animate({ opacity: 1.0}, 5000, 'linear', function () {
      $(this).fadeOut("slow");
    });
});

You just need to add a class named timed_fade_out to any <p>.

But this was perfect. I didn't want it to just fade way automagically. I wanted the user to click on a dismiss link. So I wrote this:

$(document).ready(function(){
    /* Add dismiss class to append link that closes box */
    $(' <a class="dismiss" href="#">(dismiss)</a>').appendTo('p.dismiss');
    $('a.dismiss').click( function () {
      $(this).parent('.dismiss').fadeOut('slow');
      return false;
    });
});
/* CSS: a.dismiss { color:#999; font-size: 80%; } */

And it worked! First try!

The thing about JQuery, is that it fits my brain, and I don't have to think the way the library works. Very cool.

January 17, 2007

JSF renamed

Yay! The Jabber Software Foundation is now the XMPP Standards Foundation.

I think this is great news.

Of interest: recently in a mailing list I subscribe to, there was an impromptu exchange of instant messaging addresses. I was very very happy to see that the majority had a Jabber address, mainly using GTalk service. This was not a geek list, by the way.

January 11, 2007

MacFUSE, by Google

Awesome news:

Today Google is releasing MacFUSE, an open-source Mac port of the FUSE mechanism for Linux. Like FUSE, it enables developers to implement a fully functional file system in a user-space program. And since it aims to be API-compliant with the original FUSE (Filesystem in USErspace) for Linux, it makes many existing FUSE file systems readily usable on Mac OS X. The core of MacFUSE consists of a dynamically loadable kernel extension.

Get MacFUSE.

Jobs keynote: $60M per minute

With the 100 minute Apple keynote where the iPhone was introduce, Apple market capitalization raise $6B. Thats sixty-million dollars per minute right there.

This and much more info on this post.

January 10, 2007

Apple TV

When I first saw the presentation of this last year, I was not terrible impressed.

But I've been looking for a device that would connect to the TV and allow me to play XVid and DivX files. I would upload the files via ethernet or wifi and I would have a small interface on the TV to play them.

Right now, the Apple TV does most of what I want. I don't expect support for DivX or XVid anytime soon, so we will need to do some transcoding, but as long as we can do it, I think I found my box.

We'll see. Should be available next month in the US, must check availability in Europe. Not a lot of market in Europe without the TV series in iTunes EU... ;)

Update: Wills commented about the DP-558 of Kiss Technology. Excellent feature set, it really has. But it's €499, so I'll wait a bit before commiting. The TV as a target price of $299, with less features, but better integration with my current hardware. We'll see.

iPhone

It's here, everybody has an opinion:

I like:

  • the weight is the same as an iPod 5G. It's a tiny bit shorter, and a tiny bit thicker;
  • 160 dpi screen.

I don't like, but I hope they change it in time:

  • the lack of support for third party applications;
  • the lack of 3G: I don't believe they will launch in Europe without this.

Overall, very very good. I want one.

Update: there is a good iPhone video demo online at YouTube. Check the second video, hilarious: "The Zune zucks!".

In case you where wondering...

This site will be on-and-off during the day. The 4th result in the Google search results for iPhone is hosted in the same server as this site...

We are dealing with it :).

Tip: MySQL is not that helpful sometimes

Stupid problem today.

In a listing I had, I had a percent column. The problem was that the database definition for that column was wrong, it used DECIMAL(2,4). Yes, 100% will not fit in there. Also: this syntax was valid in 3.x but with 5.x you need DECIMAL(6,4). I'm using now DECIMAL(7,4) to fit the edge case.

My peeve with MySQL is that if I give him 100 to put in that column he will not complain nor store NULL. He will help you and store 99.9999.

But the problem was the lack of a test for the edge case. Added, committed, happy happy joy joy.

January 06, 2007

Recipe for true geeks.

Grab one of these. Add several of these for flavor. Choose your toping from these choices (some can even be combined).

Stir (gently).

No need to add water. You are probably drooling just about now, thinking about this.

January 05, 2007

ZFS

The ZFS filesystem seems to be too good to be true. A good presentation about ZFS major features is available.

Having instantaneous snapshots is something that I grew accustomed to with NetApp OnTap filesystem. I love the idea of having them in my servers. And if you believe the rumors flying around about Leopard, soon in a laptop near you.

Regarding the Mac, using ZFS as the basic filesytem for Mac OS X would be a superb move, and would give them for free all the technology to implement Time Machine. It would be only a pretty face on top of ZFS snapshots.

Next topics for R&D: OpenSolaris and OpenSolaris as a Xen client. The outlook looks good.

Update: as commented by Carlos Rodrigues, LVM also has snapshots. Yes, I knew that, but they are not as simple as NetApp or ZFS in terms of usage. I believe you have to specifically mount them, as can be seen in this example. I did find a couple of disturbing posts though. Also, I've read somewhere that snapshots are not resiliant to reboots, but haven't found a reference for that.

January 03, 2007

Programming Jabber

Some people I know are starting programming with Jabber/XMPP.

The classical book on the subject, "Programming Jabber (Programming)" (D.J. Adams), is a out-of-date, but is still good to browse for basic protocol notions, some of those are still the same. The entire book is also available online now.

The best book right now is probably "Jabber Developers Handbook (Developer's Library)" (William Wright, Dana Moore), but that is also a bit out-of-date.

So bottom line, there isn't a up-to-date book on the subject, so join the mailing lists at jabber.org and ask away...

For those in Perl-land, my suggestion would be to use the POE::Component::Jabber module, it's simple to use. I don't use the others in CPAN.

If you need help with Jabber programming, my Jabber ID is at the top of this page, left-hand side. Feel free to poke me.

January 02, 2007

Land of the free...

Some states keep getting better and better.

I wonder if the USA is still a safe place to visit...

Tip: deleting all objects in a many-to-many relation with DBIx::Class

This might be obvious to many of you, but it wasn't for me, so here it is.

If you have a many-to-many relation in DBIx::Class, you can remove all the relations with:

$self->set_RELATION_NAME([]);

The set_RELATION_NAME method is created automatically for each many-to-many relation you setup. It can receive a list of objects that will become related to $self.

The obvious

$self->set_RELATION_NAME();

will croak on you.

GraphViz under Mac OS X

In case you are trying to install the Perl module GraphViz under Mac OS X 10.4.x, you might need this script.

First, install a decent version of GraphViz. I use this snapshots of Graphviz by Ryan Schmidt. Be careful not to use this version on MacIntel's, the package is PPC-only.

After this is done, add /usr/local/graphviz-2.12/bin to your PATH.

Second, while installing the GraphViz module via CPAN, one of the dependencies is IPC::Run, which might fail on your system. It's a know issue with FreeBSD that seems to also be present on Mac OS X. It hangs while testing t/pty.t.

To skip those tests, do this:

  1. inside cpan shell, type look IPC::Run;
  2. edit t/pty.t, go to line 97 (looks something like this: my $platform_skip = $^O =~ /(?:aix|freebsd|openbsd)/? ...;
  3. add |darwin after opendbsd, save and exit;
  4. type the usual perl Makefile.PL && make && make test;
  5. if all goes well, type sudo make install or the version that works for you.

After that, you should be able to install GraphViz without any problems.

Harry Potter and the Deathly Hallows

The Harry Potter and the Deathly Hallows is now on pre-order on Amazon.co.uk. Yes, I've already ordered mine.

The Amazon.co.uk sales rank lists both versions of the book taking the two top spots. Amazing.

Some time later...

There is something wrong with some people...

From the Wikipedia article about book seven:

In September 2006, Rowling was nearly barred by US Transportation Security Administration officials from carrying a working manuscript for the seventh Harry Potter novel onto an airplane, due to security restrictions, but eventually she prevailed. She said at the time she would rather have sailed home in a boat than be separated from the manuscript.