Posts

Showing posts from November, 2006

Development: Empty strings in Oracle and MySQL

Today I was testing some code I've written, on a client's QA environment. These tests revealed, that if your tests succeed locally on a MySQL server environment this doesn't necessarily mean the tests will succeed on an Oracle server. I was having problems with Oracle's interpretation of an empty string. It seems that if you're executing the following statement: insert into MyTable (c1,c2) values ('val1',''); this is the same as executing: insert into MyTable (c1,c2) values ('val1',null); IMHO this is plain wrong. '' does not equal NULL from a programmer's point of view. Inserting an empty string (or '' ) can be convenient to make your prepared statements easier. Suppose, in the above example, c2 is an optional parameter. When c2 is not available you insert '' . In this case a prepared statement to select records from MyTable could be: select * from MyTable where c1 = ? and c2 = ? After substitution the resulting

Linux: Fixing authentication in Apache 2, after doing an upgrade

This is the second post on upgrading my Debian box to testing. Obviously everything was b0rken, even authentication mechanisms put in place for Apache2. Apache2 is using the local LDAP server for authenticating users on a subversion repository. Apparently, the people of Apache did some "refactoring" on the naming of their authentication modules. They renamed auth_ldap to authnz_ldap . Enabling this module instead of the outdated on, did not do the trick. I got the following error instead: [Thu Nov 02 19:07:26 2006] [crit] [client] configuration error: couldn't check user. No user file?: /svn/configs/!svn/act/ed8028d3-8254-bd4c-bc94-c3b93f8b97bb [Thu Nov 02 19:07:44 2006] [crit] [client] configuration error: couldn't check user. No user file?: /svn/configs/!svn/act/b2296e68-a114-8e49-aea6-bebfe78947bf [Thu Nov 02 19:14:57 2006] [notice] caught SIGTERM, shutting down I did some more reading and found this presentation very useful: TH21 - Using LDAP Authentication i

Development: Convert your code to html

If you want to cut and paste code into an html page, you will find the following tools very handy: For Visual Studio (2003/2005): Copy Source As Html For Eclipse: Java 2 Html Makes blogging and publishing code easier ;)

Linux: Upgrading Debian woes (1)

So I decided to give my server, running Debian testing, an upgrade. Normally this works like a breeze. I have never encountered any problems during an upgrade, even though I am following testing. This time was different and things were very b0rken. This is about fixing my first issue: LDAP + libnss + udev. LDAP During the upgrade, the script didn't manage to create a decent backup of the running LDAP server. This LDAP is serving users for my home network and is also the backend for my Samba domain controller. So the LDAP was very b0rken. The only fix I could see was repopulating the entire tree, starting from a fresh, empty LDAP. To help me with this, I found this a very interesting and thorough guide. Since the LDAP is also my Samba backend I am using smbldap-tools to maintain users and such. So repopulating the LDAP wasn't such a big task. Lucky. udev What is udev? udev works entirely in userspace, using hotplug events the kernel sends whenever a device is added or removed f