Category: Technology

2008 has started… So does my PhD programme

Fortunately or unfortunately 2008 has come!

I had a pleasant time with family and friends during my vacations in Italy, despite the bad weather and a flu. Fabio has been a great host: he showed me Milano, Sondrio, Como, and the surroundings of the Como’s lake, in other words, a kind of “Lombardia in a Nutshell” trip. 🙂 I also enjoyed New Year’s Eve so much, thanks to the company of Andrea, Hilde and all their friends.

But at the end, as expected, I had to come back in the rainy Bergen… And here I am, without being homesick yet. Today is an important day in my life, as I finally started the PhD programme here at the University. The staff at the Department of Informatics was kind to me, and the working environment seems pleasant. First, they toured me around the building and introduced me to the various researchers and professors. Then, they gave me the key of my office, which is located on the fjord side of the building. And a note for my geek friends: the office has a powerful Dell PC with a 24” LCD monitor, running Fedora GNU/Linux 8. 🙂

All in all, I could not wish a better welcome. Looking at this result, it seems that some people kept their finger crossed for me. 🙂

How to install XenServer 4 on systems with Realtek RTL8111/8168B based network adapters

Disclaimer: These instructions are provided on as-is basis. The procedure has been tested on two different hardware configurations, but do not blame me if it does not work on yours.

The latest version of Citrix XenServer Express Edition misses support for Realtek RTL8111/8168B-based Gigabit network adapters, which are quite common. When trying to install XenServer on a system equipped with this card, the installation will stop reporting the error “No Network interfaces found on this host.”

Even though the issue was reported several months ago, no updates have been released for XenServer since the 17th of August 2007, date of the 4.0.1 release. The official procedure for installing additional drivers—also suggested by Citrix in the support forum—seems overcomplicated and at least with my systems, it did not work. So I decided to write this article about how to install the last version of XenServer on systems equipped with Realtek based Gigabit network adapters.

Just follow these steps:

  1. Download the r8168.ko kernel module
  2. Copy the r8168.ko file to a removable storage
  3. Boot the XenServer 4.0.1 Installation CD
  4. Select the Keymap
  5. Once in the “Welcome to XenServer” page press Alt+F2 (you should get a bash shell with root access)
  6. Issue the following commands:
    #> mkdir storage
    #> mount /dev/sdb1 storage (I assume that the removable storage is /dev/sdb1, change it accordingly to your configuration if this is not the case)
    #> cp ./storage/r8168.ko /lib/modules/2.6.18-8.1.8.el5.xs4.0.1.125.163xen/extra/
    #> depmod -a
    #> modprobe r8168
  7. Press Alt+F1;
  8. Complete the XenServer installation and reboot;
  9. Boot the system; (you can ignore the errors caused by missing network adapter)
  10. Login as root;
  11. Issue the following commands:
    #> mkdir /mnt/storage
    #> mount /dev/sdb1 /mnt/storage
    #> cp /mnt/storage/r8168.ko /lib/modules/2.6.18-8.1.8.el5.xs4.0.1.125.163xen/extra/
    #> cp /mnt/storage/r8168.ko /lib/modules/2.6.18-8.1.8.el5.xs4.0.1.125.163kdump/extra/
    #> depmod -a
    #> reboot

Now XenServer should finally boot with the network card up and running.

Cheers!

ZNF project closes—Why I abandoned it and PHP

ZNF was an open-source framework for building enterprise web applications in PHP5 based on the model-view-controller (MVC) design pattern.

After three years of development, the other project manager Graziano and I acknowledged that it was challenging to continue the development and maintenance of ZNF. Therefore, we decided to discontinue the project.

Several combined reasons lead to this difficult choice. First of all, I got a position as a software engineer in Norway, while Graziano started his own business in Italy. The design and implementation of ZNF were time-consuming activities, and they could not be carried out in the ever decreasing spare time. Moreover, the project did not have any external financing. Despite the handful of firms which based their business on ZNF, the project received only one donation in three years. However, the main reason why I decided to discontinue the project was another: I could not stand PHP anymore.

PHP 4 was a poorly designed scripting language suitable only for quick and dirty hacks with web pages. On the one hand, the language had an intuitive syntax, provided a lot of functions, and offered support for various database management systems. The weak typing system together with the flexible parsing engine (that most of the times revealed spurious code only with the E_ERRORS = ALL directive) made the language popular among unskilled developers. On the other hand, however, the language had limited support for object-oriented programming (i.e., lack of support for information hiding, encapsulation and abstraction). The coexistence of both procedural and object-oriented programming lead to substandard source code. The PHP Extension and Application Repository was also developed the wishy-washy way, with core packages not even compliant with the quality guidelines.

Despite all that, PHP 4 acquired popularity and almost every cheap hosting provider started to support it. Soon after, PHP 4 content management systems started to spread, such as PHP-Nuke and phpBB. I wrote my first PHP 4 code for an assignment of a Bachelor course of web development at the University. I liked the syntax of the language, but I hated the mixture of both procedural and object-oriented programming, and I thought it was probably a good idea to invest some time on other scripting languages… Until PHP 5 was announced.

PHP 5, and especially its brand new Zend Engine II, promised to introduce full-blown support for object-oriented programming. Being young and inexperienced, I thought that this would mean breaking with the past and creating a language and a set of packages providing all features in an object-oriented fashion. Because of that, I decided to give PHP 5 a chance and started working on ZNF when PHP 5 was still beta. With hindsight, I would not make the same choice again.

Firstly, PHP 4 ended up to be supported for three years after the first PHP 5 stable release. The majority of hosting providers then ignored PHP 5 for way too long. They should not be blamed after all: most of the customers were likely to run PHP 4 content management systems like Joomla, Drupal, or WordPress, so why upgrading to PHP 5 and risking compatibility issues as long as PHP 4 was supported? As a consequence, ZNF lost a big potential user base.

Secondly, the vision behind PHP 5 turned out to be different from the one I expected. PHP 5 kept as much as possible of the compatibility with PHP 4, including the mixture of both procedural and object-oriented programming. Key new features such as input filtering were added to the language as functions rather than classes. Not to mention that support for namespaces and Unicode is still missing and that errors can be handled in at least three different ways (i.e., trigger/handler, PEAR error stack, or exceptions).

Considering all these reasons, I guess it is not difficult to understand my disappointment. 🙂

The ZNF project is not searching for new maintainers. Feel free to fork the project, as long as you respect the LGPL 2 license. Special thanks for their contribution to the project goes to Tomasz Kuter, Denis A. Konovalyenko, Emad B., Christian Kassab, Markus Wigge, Valentin David, and J. Chalmers.

Update 15 February 2017

Just for fun, I migrated ZNF to PHP 7. Surprisingly, I only had to replace ereg() with preg_match() and upgrade all dependencies (PEAR and Smarty) to do so. It is remarkable that our 12-year old legacy code could be migrated to the latest version of PHP in just a couple of hours 🙂 If you are interested in these patches, feel free to contact me.