A Small “Patch” for Scuttle

Yesterday I realized, that our internal office installation of Scuttle (SF project page) suffered a minor bug: it kept on sorting all bookmarks by date, but in ascending order, i.e. the oldest bookmark was displayed first.

After doing some research, I quickly found out that this seems to be a “bug” (well the devs say it isn’t but one can argue…) of MySQL, caused by an optimization of a SELECT DISTINCT queries.

So I patched services/bookmarkservice.php and removed the DISTINCT keyword in the SQL-query of getBookmarks() (line 249, version 0.7.2).

Up to now, I did not experience any duplicate lines caused by this. I think, I’m going to report this minor issue upstream.

Update: hmm, ups, when searching, you will most certainly get duplicate results… I’ll check in the evening.

Update 2: Ok, so I wrote a litte more extensive patch, by wrapping the original SELECT DISTINCT statement as a subselect and ordering the result as such. This now really works. The patch for 0.7.2 can be downloaded here. You have to apply it to services/bookmarkservice.php.

Update 3: Ok, I somehow managed to delete the patch file. I am sorry. I will look if I can find it in any of the old backups, but I am not too convinced about this.

DWR – Easy AJAX for Java

DWR is a really fantastic library for Java: it allows to write JavaScript applications in web browsers that will directly and almost transparently call Java-methods of objects that live in the Java-Servlet-Container (e.g. Tomcat) as part of the web-application.

Continue reading “DWR – Easy AJAX for Java”

Scuttle: Your Own Server-Side Bookmarks the del.icio.us’ Way

I have been using del.icio.us since I first heard about it (by reading an announcement of its acquirement by Yahoo!) and I have to confess I was taken by the approach. The only thing I didn’t like was the fact that I didn’t have my bookmarks and the service under control.

Thanks to a note by Erik I found out about Scuttle, an open source clone of del.icio.us which everyone can host on his/her own server. (Please note: scuttle.org only offers their public bookmarking service, the software can only be located at their SourceForge page.) Scuttle is written in PHP and requires MySQL as database backend.

Scuttle offers most of the features of del.icio.us and can even import your bookmarks from there. Some minor usability-issues still arise, but I can live with them. Their API is compatible to del.icio.us so most external del.icio.us applications will work with Scuttle, as long as the tools allow you to specify the URL of the service. Additionally, Scuttle provides three levels of visibility for your bookmarks: public bookmarks, shared with your watchlist (= your friends/colleagues), and private bookmarks.

I installed Scuttle at my company and everyone is busy using it and is happy to now having a central place to store their bookmarks. Del.icio.us was no option for us because all bookmarks are public there.

I can strongly recommend using this software to everyone who wants to have a centralized way for storing their bookmarks without giving away all controls over their bookmarks.

NewsForge has published a nice review of the software.

Gentoo: MySQL and PHP Charset Problems

At the moment, Gentoo is experiencing several inconsistency and problems with character sets between MySQL and PHP. This is primarely based on MySQL-4.1 now updating from 4.0 without warning and user interaction which most of the times breaks existing extended characters as MySQL now stores every dump from former databases as UTF-8, which is still badly supported by PHP.

For many PHP web applications which experience problems with extended characters (like umlauts, accents, …), the following hack might help.

  1. Locate the file where the mysql database connection is opened.
  2. Add the following commands after opening the database connection:
    mysql_query('SET character_set_client=latin1');
    mysql_query('SET character_set_results=latin1');
    mysql_query('SET character_set_connection=latin1');

This will resume using latin1 instead of UTF-8 for the connection and the result set. For performance reasons, the data in the database should then be stored as latin1 as well.

According to messages in the Gentoo Forum, the developers have now released an ebuild for PHP (both 5.x and 4.4.2) that will regard character-set settings in my.cnf in a section especially for php (still in unstable). You should use the section [php-cli], [php-cgi] and/or [php-apache2handler]. Unfortunately I have not yet had time to test this out.

Apache: Force SSL for a Directory Using .htaccess and mod_rewrite

To force SSL on a given directory using .htaccess, use the following code. It requires mod_rewrite enabled in Apache. Adjust the path in the RewriteRule to match the full qualified URL of the HTTPS-domain.


RewriteEngine On
RewriteCond %{SERVER_PORT} !443
RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]

Bugzilla: Active Directory Integration

As you might have guessed from previous posts, I’m currently in the process of implementing a single-sign-on scenario within our network. Or, at least, I’m trying to have at least one single username/password combo for all internal services. Authentication is therefore realized against an Active Directory, based on a Microsoft Windows 2003 Server.

For integration of Bugzilla into the Active Directory, see this link (Update: Link is broken, for an archived version, use this link, thanks to the commenter!).

TikiWiki and Active Directory Integration

If you want to authenticate TikiWiki agaist Microsoft Active Directory, have a look at this article.

The most interesting part in this posting is that if you are using a Windows 2003 Server, you need to patch the LDAP.php in the PEAR authentication module, as Win2k3 by default does not allow any anonymous queries against the directory.

In <tikiroot>/lib/pear/Auth/Container/LDAP.php search for the following line in function _connect():

if ((@ldap_bind($this->conn_id)) == false) {

and replace it with

if ((@ldap_bind($this->conn_id,"someuser","somepassword")) == false) {

Note, that someuser is in the form of user@domain.tld.

I also recommend to choose to authenticate your admin user against the internal database and not the LDAP (AD) container, otherwise you will lock yourself out easily.

Opera for Free

Opera is now available for free, ads and registration have been removed.

Just gave it a quick try, and I have to say, I like it 😉 I think, Firefox is going to have to co-exist with Opera on my HDD.

Update: According to Heise.de (German), Opera has been downloaded over 1 million times within only two days, more than any previous (ad-enabled) version.

Server-Side Bookmarks: SiteBar

I currently work on several computers quite simultaniously and I am also browsing the net using these different machines. In past times this often caused that I had some bookmarks on computer A and others on computer B. According to Murphy’s Law, I always needed a link of a computer which was currently not available.

The solution to this problem is obvious: using a server based bookmark management. On my search for free solutions I found SiteBar which seems to be quite popular. It can be set up in different modes for shared bookmarks of many users and for individuals. I used the latter mode for my installation as it is to be used by me exclusively. Still, the installation features a public and private area for links so not all links can be seen by every visitor.

SiteBar integrates well with all browsers. I had no problems importing my bookmarks files from Firefox and I’ve now set up special shortcut links in my links list on all browser instances I use across the different computers to add the currently viewed site to my SiteBar. The “integrator page” lists several useful plugins for various browsers which allow (for some browsers) to sync local bookmarks and server bookmarks. This particularely solves the problem of bookmarks being only available if the server is online. The corresponding plugin for Firefox is in beta statdium at the moment and only supports syncing server to local bookmarks up to now.

At the moment, we are also evaluating to use SiteBar for the development team at our company to share important links to various resources.