Installing SQL-ledger on Fedora Core 3

If you get a No Database Drivers available! error when trying to install SQL-ledger, it is most likely because you haven’t installed the perl/postgresql drivers. With FC3 you can install them through:

yum install perl-DBD-Pg

These weren’t the only difficulties I encountered with the sql-ledger installation process, so I have detailed the steps I took here:

yum install postgresql postgresql-server php-pgsql postgresql-pl perl-DBD-Pg

Then download and run the sql-ledger setup script

mkdir /usr/local/sql-ledger
cd /usr/local/sql-ledger
wget http://www.sql-ledger.org/source/setup.perl
chmod +x setup.perl
./setup.perl

Follow the on-screen prompts, and then once that has completed you will have to setup the database user etc..

su postgres
createuser sql-ledger
createdb sql-ledger
createlang plpgsql template1

You will then probably need to change the security settings of postgresql to trust local users, I did this by editing pg_hba.conf and changing the authentication to

   local           all        all           trust

Finally you should visit the http://localhost/sql-ledger/admin.pl script in your webbrowser to complete the setup.

PHP Classes / Objects vs Functions

We’ve been having a big debate in our office recently on whether we should be using Classes and Objects as a method of best practice in our PHP coding standards, or whether instead we should stick to using functions and avoid objects like the plague. I have been searching the web for other peoples views on the issue, and I eventually found this great article over on zend.com. You should read it if only for the comical but accurate descriptions of the procedural fanatic and the object fanatic.

Zend Technologies – Articles – The Best Tool For The Job: OO versus Procedural Programming in PHP

The general conclusion is that there is a time and a place for both programming methods, with procedural techniques better suited for building low overhead, tight and fast code, whereas object orientated techniques are better for making code that is re-useable and more flexible.

Ubuntu Dapper Drake and WPA Encrypted Wifi

I tried to get WPA wifi working on Breezy Badger with a Amilo M7400 laptop a while back and although it worked in the end, it was a bit of a nightmare getting there. However, it seems that with the new Dapper Drake release they have made the process a little easier with the network-manager-gnome package. Read this article on Ubuntu Dapper Drake and WPA-Encrypted Wireless at fredericiana for further information.

How to Embed YouTube into WordPress

I have been struggling for the last half an hour trying to embedd a youtube video into my girlfriend’s wordpress blog. In the end I found the easiest way was to simply turn off the default WYSIWYG editor (Options > Writing > Formatting > untick “use visual rich editor by default”), and then you can just paste the object code straight from youtube. If you don’t want to turn this off then take a look at Embed How to get YouTube working with the WP2 WYSIWYG Editor.