Skip to content

Monthly Archives: December 2007

Why opinionated software sucks… Not!


The best software has a vision. The best software takes sides.

Make Opinionated Software

There’s been a lot of discussion around David Heinemeier Hanssons principle of “opinionated software”. Some people say that “to David, a piece of opinionated software is written in such a way that makes it easy to do things one way and ugly and difficult to do things another way”.

Maybe this approach “with a carrot and a stick” seams odd and old-fashioned, but i think its actually working and because of that, many people don’t like it.

Imagine, you’re using a product you like, you value its creator and especially his opinion and then, something you wanna do, doesn’t work because of obvious arbitrary restriction, you will be pissed for sure.

Certainly not all decisions made with a strong opinion are good, but i think, many of them made boldly had a reason to be done in a definite way and not another, often arising from the same reason you valued the creator of them before.

I’m writing this because i was really pissed when Rails 2.0 came out. It may be sound picky, but in Agile Web Development with Rails” DHH stated: “This fom of attribute accessor looks at the coluumn’s value. It is interpreted as false only if it is the number zero; one of the strings “0”, “f”, “false” or “” (the empty string); a nil; or the constant false. Otherwise it is interpreted as true.”, which means: A convenient method to add a question mark to attribute accessors to query them if they are true or false.

This due to the fact that there is an SQL standard that defines a datatype BOOLEAN but most of the RDBMS do implement them in their own way, most of the time as tinyint constrained to 0 and 1 (Oracle favours “y” and “n” for whatever reason) and so on.

I myself went with “t” or “f” as i can easily memorize it (true and false, obviously, sure, we can argue if i shouldn’t know about 0 being false and all other being true, i do know but the less i need to think about the obvious the more i can concentrate on actually doing something).

So with Rails 2.0 stuff breaks: DHH and the Rails team went with the MySQL approach: 0 and 1 only, 0 is false, 1 is true. This is fine as for example MySQL defines constants like TRUE and FALSE, that although being 1 and 0, conforms to the standard.

As i saw pieces of app failing with the new release (important parts like things being public or not, blocked users and so on), i was angry… “The bad guys destroy my toy” boohoo and i filed this ticket.

After thinking about (and actually changing my enums(‘t’,’f’) to the pseudotype boolean), i think it’s the right decision. As the model existed before i started working with Rails, i didn’t use migrations to generate tables, which is pity as with this decision, i would get the right datatypes in all supported databases. But even though, i like things being conform to a standard most vendors seem to listen to.

Without the Railsteam willingly breaking compatibility and being opinionated, i would have sweared less on the one side but i would have missed the opportunity to do some justified rewriting.

For me it’s ok to be opinionated and a little bit rockstar like, if you got the right reasons. I myself tend to be opinionated enough on my own work but i can defend my decisions most of the time.

It’s not always nice to be corrected and the corrector maybe doesn’t seem like a teamplayer, but i can life with the concept of the “Benevolent Dictator” when the product does the things its expected to do good and isn’t a “creative” mess.

Just in case you haven’t seen the great movie Borat or are totally unaware to irony, i don’t think that software with an opinion and attitude suck.

Copy and paste within cmd (command interpreter under Windows)


Under Windows 2k and XP exists no keyboard shortcut in cmd.exe to copy and past text. You need not only use your mouse but hit the proximity icon in the top left and choose edit|mark, edit|copy and so on.

cmd has a special mode named QuickEdit which can be enabled via the following command

REG.EXE add HKCU\Console /v QuickEdit /t REG_DWORD /d 1 /

all new cmd windows will now be in QuickEdit mode. Text can be selected with the left mouse button, copied via right mouse button and pasted via right mouse button.

Found on a msdn blog. Thanks!

Installing Oracle 11g Database on OEL5


As a last post in the series (1, 2, 3, 4): Installing the latest and greatest incarnation of the Oracle Database named “Oracle 11g” on Oracle Enterprise Linux 5 running as a paravirtualized machine on Oracle VM Server.

Honestly, i was afraid of installing Oracle the first time under a linux environment but i must say, the installation was pleasantly easy, following the steps described here. No surprises at all. My host has a fixed IP adress, no problem with DHCP (although a don’t quite get why this should be any problem at all).

Fun started after stopping the database.

First: SELINUX is enabled per default under OEL5. I found the following tutorial which recommends turning SELINUX off. I disagree with that.

After installation complets, the following commands are necessary to enable Oracle to load its shared objects and to some text relocation with it:

chcon -t textrel_shlib_t /opt/app/oracle/product/11.1.0/db_1/lib/
chcon -t textrel_shlib_t /opt/app/oracle/product/11.1.0/db_1/lib/
chcon -t textrel_shlib_t /opt/app/oracle/product/11.1.0/db_1/lib/
chcon -t textrel_shlib_t /opt/app/oracle/product/11.1.0/db_1/lib/

otherwise you’ll some errors like

/opt/app/oracle/product/11.1.0/db_1/bin/ocrconfig.bin: error while loading shared libraries: /opt/app/oracle/product/11.1.0/db_1/lib/ cannot restore segment prot after reloc: Permission denied

(Paths may vary) when starting the database.

Speaking of starting, Oracle comes with no batteries included, i.e. a startup script is missing.

I started with the one described here and added some lines to start the enterprise manager controll, see resources below.

In the meantime, the first import should be finished. The performance of 11g seems ok, on a virtual machine with a minimum of 1GB Ram. Maybe i’ll post some more impressions in a few weeks.


Installing Oracle Enterprise Linux 5 as a VM in Oracle VM Server


Installing the latest incarnation of Oracle Enterprise Linux 5 as a paravirtualized machine in Oracle VM Server is a bit tricky.

The OEL5 is delivered as 5 iso files, cd images they are. The Oracle VM Manager is only able to install the patched paravirtualized guest system from one installation medium. Damn it, they praise their system as blazing fast under their own VM and didn’t manage to deliver the stuff as one dvd image?

After a lot of googling i found the following script. Its a CentOS script to combine their installation mediums into on, big iso file. I thought, give it a try as CentOS is based on RedHat as well is OEL5. It ate a lot of diskspace but in the end, i got a working DVD that i mounted via the loop device.

mount -o rw,loop /OVS/tmp/oel5dvd.iso /tmp/oel5/

The next step requires the installation medium available either via http, ftp or nfs. Starting nfsd and exporting the fs is done easily via:

/etc /init.d/nfs start
exportfs *:/tmp/oel5/

I had all the iso and the resulting dvd on my Oracle VM Server. The default installation is rather strict with the iptable rules.

Although Oracle VM Manager will except an nfs://… path and also do the initial patching, the installation will fail afterwards.

To get NFS working, i followed these instructions to pin all needed ports and open them in iptables.

Installation itself was after that straigt forward. I deselected all prepackaged environments since the server was destined to be a database server.

I didn’t realize that this was going to be a problem.

There is no centralized repository in the RHEL or OEL world like the one in Debian or Ubuntu. Either hunt the rpms down or subscribe to the services both manufactures offers, in my case the Oracle Unbreakable Linux Network. Hello? I just wanted to install a gcc, for example.

Their is no possibility in the gui to reuse your installation medium as a repository for “YUM” or “Pirut”.

Bummer! After a lot of searching i found this, but this method didn’t work for me. Nevertheless, i’ve learnd how to configure repositories for yum. Pirut did find the installation medium but wasn’t able to install a package due to an “uropen error unknown url type: media”.

My solution was to copy all rpms from the /Server directories of the original installation disk along with “comps-rhel5-server-core.xml” from the first disc found in /Server/repodata/ to disk, running

createrepo -g comps-rhel5-server-core.xml .

and finally exporting this directory as a nfs share, configuring it to yum with the following:

name=Oracle Enterprise Linux 5

After a “yum clean all”, pirut can add and remove packages from the “original” medium without any hassle.

I installed the following packages:

yum install binutils
yum install compat-libstdc++
yum install elfutils-libelf
yum install elfutils-libelf-devel
yum install gcc
yum install gcc-c++
yum install glibc
yum install glibc-common
yum install glibc-devel
yum install glibc-headers
yum install libaio
yum install libaio-devel
yum install libgcc
yum install libstdc++
yum install libstdc++-devel
yum install make
yum install sysstat
yum install unixODBC
yum install unixODBC-devel

preparing the next post which is about installing Oracle 11g on Oracle Enterprise Linux 5.


Installing Oracle VM Server


As promised, i’d like to share some experience with installing the new “Oracle VM Server”.

The product isn’t as new as Oracle wants you to believe, it’s based on Xen 3.1.1 “with many, many performance enhancements done by our engineers”. We’ll see.

After unpacking our shiny new Dell (The rabat action was entitled “My First Server”, sweet… kind of), i booted of CD, left most settings on default and made my way to the non-graphical Installer. No surprises here, Oracles Xen Version runs on their own Linux distribution (“Oracle Unbreakable Linux / Enterprise Linux”) which itself is based on Red Hat Enterprise Linux (ok, tante isn’t wrong about re branding stuff and so…). It’s quickly said that the stuff is available without re branding in it’s original form but to many people it is important that these products are certified by Oracle.

Oracle VM comes in two packages, a server and a manager component, which needs to be installed on separate machines.

Oracle VM Manager runs on both Oracle Enterprise Linux 4 and 5. I set up a VMWare Server machine on my workstation for that as i didn’t want to ruin a near perfect desktop. Installation of the manager is simple with one little caveat: The script prompts for the oc4j admin password which is “oracle”. It doesn’t want to know a new one but the default.

VM Manager installs an OC4J, an Oracle XE Database and the manager app itself which is a J2EE app.

Within this thingy you define server pools and servers.

For the later you have to install one. Put in the disc, but the machine, accept a view defaults and you’re ready to go. I put two ethernet cards in our dell for accessing the server itself and the other for the virtual machines.

I had some weird problems configuring the ntp daemon, that was all.

My first experiment was to install a fully hardware virtualized Windows XP. Creating the vm, adding diskspace and so on with Oracle VM Manager is as easy as with any other tool like the ones from VMWare. One noteworthiness is that you need to import your iso files from any install media to the server. This was easily done via ftp. I loaded the machine with XP and for later, all 5 disks of Oracle Enterprise Linux 5.

I spend nearly a day to get the bridged networking with xp up and running. I learned a lot about networking under Xen (especially this page was useful) but in the end, the on and only reason why i couldn’t reach the Windows XP domU was the bastard firewall build into XP. Bummer!

XP runs reasonable fast within the hvm environment. The only thing that felt like ages was creating the virtual disk.

From within the manager application one is able to reach a VNC server running on the Oracle VM Server entitled console. You even see the bootscreens and so on from this VNC. I first saw this on the DOAG last month, it certainly didn’t work out of the box. The Oracle VM Manager application was missing the jar files with the Tight VNC applet.

Although the VNC server is reachable with any VNC client, it’s nice to start right from within the browser. To install the applet properly on the manager machine, do the following:

  1. Download the TightVNC rpm at the Oracle OVM RPM repository (also, there’s a plugin for linux clients)
  2. Install it with
    rpm -ivh tightvnc-java-1.3.9-1.noarch.rpm
  3. Go to the OVS homedirectory which is

    Make sure there is a file “VncViewer.jar”. Mine was there after installing the rpm.

  4. Sign the “VncViewer.jar” file with the following commands:
    /opt/oc4j/java/jdk1.5.0_11/bin/keytool -genkey -alias vncviewer -validity 365
    /opt/oc4j/java/jdk1.5.0_11/bin/jarsigner VncViewer.jar vncviewer
  5. Clean your browser cache and you’re ready to go.

The next step on the list was installing a paravirtualized Oracle Enterprise Linux. I hoped the templates at were paravirtualized but no, they all are hvm templates. Why the heck? So this is where the fun starts and the next post takes place…

So far, i like the concept of Oracle VM Server. The software makes it easy to start with one server which acts as a virtualisation server, a server pool master and an utility server. If your needs grow, you throw some hardware in, define a new server in the manager application, add it to the pool and you’re done. From within the manager app, you can move the virtual machines around as you like. You certainly need to have for that to work some sort of shared storage available, but i don’t think that moving the /OVS tree of the first server to some kind of iSCSI or any other SAN is a big problem.

I know that Oracle builds their product upon Open Source but in this case, i think the package works great. Buying some relatively cheap server hardware, installing and configuring two products (Oracle VM Server and VM Manager) was far less expensive than a VMWare ESX3 test installation. Where Oracle fails is their Oracle Enterprise Linux, at least in some points. But as i said, in another post.

At one point a had a problem with the Manager App. Somehow my server pools went missing, i clicked around and finally found “Restore from Manager”. Hm, well… *click* and my virtual machines were gone. After searching awhile i found out that some configuration files for VMS exists under /etc /xen on the server but i guess they aren’t use. Any changes to them were ignored. All the vm starting, stopping and restarting is done from the manager app. So be careful when fiddling around with the config files on the server!