header

Torsten Curdt’s weblog

Logitech headset freezes OSX

It’s somewhat “encouraging” that Martijn seems to have the exact same problem that I have. At least it’s not just me. Whenever I plugin in my Logitech USB headset it’s very(!!) likely that I have to restart my machine right after. It just freezes OSX. I could not reproduce this on my a Powerbook G4 and it seems also be OK on newer machines with Leopard. But with my current machine running Tiger it’s a PITA.

I’ve opened a support case for this with Logitech. But their final call was “Sorry, no idea. We’ll forward your information to our developers.” Well, I suppose I can live with it a few more weeks until I upgrade to Leopard. Fingers crossed that it will work as expected then.

Update: I’ve also got some feedback via email. Seems like this problem is far more common than one might have thought. Bah!

Not enough entropy?

While for Andrew this happened with httpd I’ve already run into this a couple of times with exim for my SMTPS relay. Exim just gets stuck during the TLS/SSL authentication and does not even say a thing at all. You want to send a mail – but nothing happens. You can’t even see anything from the logs. If you experience similar problems first thing to do (under Linux) is to check there is enough entropy available.


cat /proc/sys/kernel/random/entropy_avail

If the number is below 1000 that might be the problem. Essentially it means that your system does not generate enough randomness for cryptographically secure communications – and waits until there is. Indeed an easy (but bad) work around is to only use the pseudo random generator.


mv /dev/random /dev/random.old ; ln -s /dev/urandom /dev/random

But by definition those (pseudo) random numbers cannot be really random. Several sources provide suggestions and scripts to work around this by generating disk activity and have the disk interrupts generate the badly needed entropy. Unfortunately for me this never was really enough. (Maybe because it’s VServer?) Since I don’t have anything insanely sensitive to protect I just went with the hack as well. If someone has some wise words how to fix this in a better way – let me know. So far I found two daemons that are responsible for generating entropy. The EGD and the PRNGD. Feels a bit crazy to install a daemon just for that though.

Maybe finally a reason to have a mouse connected to a server. (generates a lot of entropy) …it only needs to become part of the hoster’s SLA to move them around from time to time. :-p

Recursive file listing in java

It turns out that when you search on the web for “recursive file java” you only find horrible examples on how to implement directory traversal. It’s such a simple algorithm but I feel obliged to provide a better example to the world. In fact directory traversal can be very elegantly be hidden by using anonymous classes. You just need to extend the following class


public class FileTraversal {
        public final void traverse( final File f ) throws IOException {
                if (f.isDirectory()) {
                        onDirectory(f);
                        final File[] childs = f.listFiles();
                        for( File child : childs ) {
                                traverse(child);
                        }
                        return;
                }
                onFile(f);
        }

        public void onDirectory( final File d ) {
        }

        public void onFile( final File f ) {
        }
}

and then you can locally override and implement the methods you need.


new FileTraversal() {
    public void onFile( final File f ) {
        System.out.println(f);
    }
}.traverse(new File("somedir"));

This cleanly separates out the actual traversal. So simple!

Upgrading Wordpress 2.0.x to 2.3.x

You might (or might not) have noticed. Just recently I’ve upgraded my wordpress installation from the 2.0 to the 2.3 branch. Branch? Well, using subversion is much easier to keep you installation up-to-date. Usually you do a “svn up” and you have all the new fixes applied to your installation. Well, of course the move from 2.0 to 2.3 wasn’t as easy as a “svn switch”. Especially when you have a couple of plugins and even your own theme. So I did the backup. Disabled the plugins. Did the subversion checkout. Then copied my theme, my plugins and the configuration over and fired up the admin page. Database upgrade – done. At least for the core system. But now comes the fiddling.

So I’ve turned on one plugin at a time. When you hit this error

WordPress database error: [Table 'wordpress23.wp_post2cat' doesn't exist]

it means that you need to upgrade your sitemap plugin. Now the biggest change surely was the new native tagging system. I have been a big fan of UltimateTagWarrior but now 2.3 has native tag integration. (Yay! Took how long?) The import was straight forward to do from the management interface. But of course I had to adjust my theme that depended on the UTW functions. The good new is Christine Davis (the author of UTW) provided a plugin that serves as a compatibility layer. So you can keep using the UTW syntax and the plugin calls are mapped to the native tagging system. (Also grab the tag management plugin!) Unfortunately it’s still beta and I had to change the _getRelatedTags() function to return an empty array if no tags were given.


  function _getRelatedTags($tags) {
    if (!$tags) return array();
    // get posts that match all tags.

After that the posts and the cloud was showing up fine but the associated tags were still missing below the blog entries. After some research I found that I had to change the main loop in the theme from


  if ($posts) : foreach ($posts as $post) : start_wp();

to


  if (have_posts()) : while (have_posts()) : the_post();

In general I am still a bit skeptical about the upgrade. Once all plugins where turned on I’ve hit an out of memory failure and had to increase the memory size in the php.ini

memory_limit = 16M

So what’s new? At the downside wordpress 2.3 seems to need more memory. On the upside it finally comes with proper Atom 1.0 support now. But after that the upgrade was not very exciting in terms of new features. Was more to keep up-to-date with the latest fixes and security improvements. *shrug*

Web 2.0 Expo in Berlin

web 2.0 expoI can’t really give a full review as I just attended the barcamp and some keynotes. But this conference had quite a different vibe compared to ones I’ve been so far. Makes me want to try a greater variety of events in the future. What I found a bit annoying though was the suite wearing crowd at the web 2.0 expo. Not sure that’s a German phenomena or related to the conference itself. Compared to many keynotes I’ve seen on other conferences the web 2.0 ones were actually quite good. Not the usual “we are a sponsor” keynotes. The one with Tim O’Reilly interviewing Neil Holloway from Microsoft was interesting and quite funny. Kathy Sierra on “Creating Passionate Users” was also really good. But I also enjoyed the news from Blaise Aguera y Arcas from Photosynth. Although I have to admit his presentation at TED was much more exciting.

In general the conference felt a bit too buzz word compliant and the excitement about open social always had a little “gold rush” feeling attached to it. I am sure open social will contribute to a consolidation of the social networks. And that’s a good thing! Because frankly speaking I am getting tired of signing up for the next completely disconnected social network. The vision of the one open social graph is compelling and the possibilities are exciting.

Most (all?) conference slides can be found on slideshare. My pictures are on flickr.