I have been looking for ways to replace a Sharepoint driven intranet with something else. The driving force behind this has mainly been one of platform compatibility. Sharepoint is great if you use Office and Internet Explorer on Windows. For all other users it is a usability nightmare.
There are lots of hosted or shrink-wrapped solutions for sale but the market of intranet solutions is now so mature that I felt there had to be open source solutions.
I found Alfresco, LifeRay and a few others and installed most of them. I was perplexed, however, by the sheer amount of features that were enabled out of the box. I really prefer something that starts off light and can then expand according to my needs. KnowledgeTree felt lighter but didn’t do much more than document management and I knew I also wanted a wiki as well as forums.
For a while I tried to integrate KnowledgeTree with MediaWiki and phpBB for a best-of-breeds solution. I couldn’t get all of the them to play nicely together and allow users to authenticate using accounts from a Windows Active Directory.

In the end I settled on Drupal. Why? It starts off light but has a truck-load of modules that can be added. I like the structure of the code. And it feels fresh – perhaps almost too light. I would have liked to see some professional free themes targeted for intranets, they would have helped to sell in the concept internally in competition with professional offerings.
The question of the authentication integration with Active Directory was solved very nicely by the module “Webserver authentication” and adding HTTP authentication to the web site in Apache where the web server is configured to use the bindings provided by Samba‘s WinBind. The only thing to remember is to set the Drupal administrator to the the same login name as the administrator in the Windows domain. After that you should disable the log out menu option in Drupal. The only thing remaining is to add some Javascript code to be able to provide a link to make the browser forget the cookie in order to force a relogin.
In the previous post I described how to install the Oracle Database 10g Express Edition on Ubuntu and to add some data. In this article I will show how to access that data from a Perl script.
I assume you already have Perl installed, together with the DBI framework for generic database support. We will need to add DBD::Oracle which is available from CPAN. To install this module, run this as root:
# perl -MCPAN -e shell
cpan> install DBD::Oracle
Two things are worth noting. First, the root user must have the same Oracle environment set as described in the previous article. Just issue ‘source /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/oracle_env.sh’ to fix that. The second thing to note is that you will most likely get errors during testing of the newly built module which will prevent it from being installed. To override that you will need to add ‘force’ before the command, i.e.:
cpan> force install DBD::Oracle
Now, the groundwork is done and we just need to write the script. Save this in oracle_read.pl and make it executable.
#!/usr/bin/perl -w
use strict;
use DBI;
my $dbh = DBI->connect( 'dbi:Oracle:xe',
'scott',
'tiger',
) || die "Database connection not made: $DBI::errstr";
my $sql = qq{ SELECT id,name,age FROM persons };
my $sth = $dbh->prepare($sql);
$sth->execute();
my($id, $name, $age);
$sth->bind_columns(\$id, \$name, \$age);
print "List of persons:\n";
while( $sth->fetch() ) {
print "$name [$age]\n";
}
$sth->finish();
$dbh->disconnect;
I am a rather proficient user of MySQL but I recently needed to set up an Oracle database to test against. Since I haven’t worked with Oracle databases in more than ten years it took literally hours to get something up and running. What follows is a description on how to install Oracle XE on Ubuntu 8.10, add a user, create a table and then drop the created schema. Everything will be done from the command line.
Note that this installs the Oracle Database 10g Express Edition. Although free it comes with similar constraints as the Microsoft SQL Server 2008 Express server – maximum 4 GB data, use maximum 1 GB of RAM and run on maximum 1 CPU.
First, add the Oracle repositories by appending the following two lines to /etc/apt/sources.lst
# Oracle Repository
deb http://oss.oracle.com/debian unstable main non-free
Then, we must add the Oracle key to avoid warnings:
wget http://oss.oracle.com/el4/RPM-GPG-KEY-oracle -O- | sudo apt-key add -
Now we are ready to install by using apt-get (either run the following as root or prepend every line with sudo)
# apt-get update
# apt-get install oracle-xe oracle-xe-client
# /etc/init.d/oracle-xe configure
The last command will present options to change some default settings. you can probably use most of the defaults. I just changed the HTTP port from 8080 since I already had another service running on that port. Note that the configuration script takes a very long time to finish.
When the script is finished it is possible to access the Oracle web interface at http://127.0.0.1:8080/apex (or some other port if you changed the default). However, it will only be accessible on the local host. If you are installing on a headless remote server like me you can port-forward using SSH:
$ ssh -L 8080:127.0.0.1:8080 user@host
Or, you can remove this limitation as described further below.
Next step will be to add the Oracle environment to your shell. The installation will have added scripts to set up the environment under /usr/lib/oracle/xe/app/oracle/product/10.2.0/. There are actually two scripts: server/bin/oracle_env.sh and client/bin/oracle_env.sh. I don’t think it matters which one but it makes more sense to use the one under ‘server’.
Append this to your .bash_profile file:
. /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/oracle_env.sh
Then log out and back in – or run ‘source .bash_profile’.
Now it is time to log onto the system:
$ sqlplus system@localhost
If you would have logged on remotely you would have written ‘sqlplus system@host’ – but we haven’t enabled remote access yet.
Type the password you selected during installation. At the SQL prompt, enter:
> EXEC DBMS_XDB.SETLISTENERLOCALACCESS(FALSE);
> EXIT;
Now it is time to add the first user. Save the following to a file (oracle_create.sql).
-- oracle_create.sql
CREATE USER scott IDENTIFIED BY tiger
DEFAULT TABLESPACE users TEMPORARY TABLESPACE temp
QUOTA UNLIMITED ON users;
CREATE ROLE myrole;
GRANT CREATE session, CREATE table, CREATE view,
CREATE procedure, CREATE synonym TO myrole;
GRANT myrole TO scott;
-- Switch user
CONNECT scott@localhost/tiger;
--
CREATE TABLE persons (
id int,
name varchar2(32),
age number
);
--
INSERT INTO persons
(id, name, age)
VALUES (1, 'Joe', 35);
INSERT INTO persons
(id, name, age)
VALUES (2, 'Mary', 32);
You can then create the user and populate the table by running:
$ sqlplus system@localhost
> @oracle_create
> SELECT * FROM persons;
> EXIT
The ampersand indicates that SQL statements should be read from a file. Since the file ends with .sql the extension does not have to be stated. Please note the connect statement in the SQL file. This means that after that point we will be running as the user scott.
To drop everything we have created run the following:
$ sqlplus system@localhost
> drop user scott cascade;
> drop role myrole;
My ISP filters outgoing SMTP traffic so to be able to run a mail server running at home I need to use the ISPs SMTP server to relay outgoing email. If they would have allowed open relaying from their customers I could just have set their SMTP server as ‘relayhost’ in /etc/postfix/main.cf and be done with it.
However, they require that I authenticate to their SMTP server which complicates matter slightly. This is how I did it:
- Create a password file, assigning username and password to SMTP relay hosts. Create the file /etc/postfix/relay_password and edit it to have the following content (replace the hostname with whatever relay host your ISP is providing and use your password and login)
smtp.bredband.net :
- Change permissions for the credentials file and create a map file
# chown root:root /etc/postfix/relay_password
# chmod 600 /etc/postfix/relay_password
# postmap /etc/postfix/relay_password
- Update postfix configuration
relayhost = [smtp.bredband.net]
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/relay_password
- Restart postfix
# /etc/init.d/postfix restart
Debian and Ubuntu place startup files for all deamons in /etc/init.d. Symbolic links are then placed in /etc/rc.X to control when deamons are to be started and stopped. While it would certainly be possible to manage it manually, there are a few tools that makes life easier whenever you want to control which daemons are started by default.
Using rcconf

Using sysv-rc-conf

Using update-rc.d
usage: update-rc.d [-n] [-f] remove
update-rc.d [-n] defaults|multiuser [NN | sNN kNN]
update-rc.d [-n] start|stop NN runlvl [runlvl] [...] .
-n: not really
-f: force
In a previous post I wrote about how easy it was to upgrade the BIOS on Asus Eee Box. It turns out that the Acer Aspire One is just as simple.
- Go to Acer’s support pages and download the BIOS you want to use.
- Format a USB stick with FAT32
- Put the BIOS image file and FLASHIT.EXE (also from Acer) in the root directory. Rename the BIOS image file to ZG5IA32.FD
- Turn off the computer, then turn it back on while pressing Fn+ESC. Release Fn+ESC after a few seconds. The power button should now be blinking. Press the power button once. This will start the BIOS flashing process.
N.B. Keep the computer connected to AC and do not interrupt the process once it has started. Also, while the above worked very well for me I can offer no guarantees.
On Friday the Unix time used by many of the computers throughout the world will tick up to 1234567890. As I have learned, most non-techies don’t understand the beauty of this. Strange.
Anyway, I thought I should have a Unix epoch time counter on the web page but was surprised that I couldn’t find a widget to do it. Not to be let down, I realised that this was the perfect opportunity to learn how to write a WordPress plugin.
The result is in the sidebar and the code can be downloaded below. Now all I have to do is wait up on Friday night (0.30 am here in Sweden) and watch the counter step up towards the magic number.
Download epoch-counter.php
Over the years I have used many small applications to extract metadata from images but none of them were as versatile as Image-ExifTool by Phil Harvey. It support just about any image or video file format your can imaging. And a nice thing is that it is implemented in Perl so that one can easily use it to build a script. And it works cross-platform which is important for me who move between three operating systems on a daily basis.
This is all it takes to extract all metadata from a file:

On a newly installed system with Ubuntu 8.10 you will see these kind of lines in /var/log/syslog:
Nov 24 01:12:31 sirius console-kit-daemon[9837]: CRITICAL: cannot initialize libpolkit
The error will repeat every ten minute or so and the fix to this issue is to install policy-kit, i.e.:
sudo apt-get install policykit
This is described in more detail on Launchpad: https://bugs.launchpad.net/ubuntu/+source/policykit/+bug/275432
When installing a Ubuntu 8.04.1 virtual guest under VirtualBox 2.06 running on a Mac you will probably be faced with the following error:
Starting up ...
This kernel requires the following features not present on the CPU:
0:6
Unable to boot - please use a kernel appropriate for your CPU.
This problem is due to the fact that the last couple of versions of Ubuntu have been compiled with PAE enabled – but the default guest setting of VirtualBox is that PAE is disabled. So to solve the issue, just stop the virtual guest and enable support in the CPU for PAE/NX, it’s under the advanced general settings. Another solution would be to reinstall the guest using the alternate CD image of Ubuntu (which, last time I checked, didn’t require PAE).