Motorcycle Adventures and Free Software

Weblog: Archive

2004-09-01 - 2004-09-30

Hunting a PHP segfault

Posted on 2004-09-01 10:22:12 UTC to . 0 comments.

The segfault seems to be triggered on pages that have multiple mgd_auth_midgard() or mgd_unsetuid() calls. In most cases the crash happens only after Midgard request has completed, but before output has been sent to the browser, as reported by Torben.

In OpenPSA Personnel this happens when administrator modifies a user record. There we have worked around this by simply exiting the output with a flush() call. In the net.nemein.registrations component a workaround is still pending.

Piotras is looking at the issue, and has decided to delay the Midgard 1.6.0 release until a solution has been found.

He writes on the Midgard developer list:

The source of last reported segfaults (and more not reported yet) is zend_register_list_destructors_ex called in PHP_MINIT_FUNCTION.
static void _midgard_list_fetch_dtor(zend_rsrc_list_entry * rsrc)
{
midgard_res * res = (midgard_res*)rsrc->ptr;
// here we get random garbage from Zend (perk...e!)
if (res != NULL) mgd_release(res);
}
Looks like rscr struct passess some garbage which is not NULL so there is no easy way to check it in mgd_release or even earlier.

According to some Google findings, the same segfault is in both PHP4 and PHP5. Chat log about the issue from #midgard is also available.

Updated 2004-09-17: Piotras found a solution to the problem and committed the fix to Midgard CVS on September 6th.

Sponsored links

Microsoft Certification Exams save money using, phone card

Che Guevara's Motorcycle Diaries

Posted on 2004-09-06 10:43:25 UTC to . 0 comments.

First part of the movie tells a very appealing and realistic tale of a motorcycle road trip in the third world. Many of the scenes and situations feel very familiar with my own road trips.

After the sad demise of their '39 Norton the movie gets more serious, and describes the Che's Siddhartha-like enlightment through views into the poverty and plight of the Indians and rural workers. The stories of despair and unemployment in the fifties are very similar to the descriptions in Ted Simon's mid-seventies Jupiter's travels.

The movie was based on the Che's and Alberto's personal travel journals and photos. Che Guevara's The Motorcycle Diaries is available via Amazon.

Disclaimer: the links to Amazon include my associate ID, so possible generated sales may give me gift certificates there.

Wagner's Ring of the Nibelung

Posted on 2004-09-08 08:47:15 UTC to . 0 comments.

Kerttu and Bergie in the opera. Photo taken with the crappy Nokia 6820 cameraThe Nibelung's Ring series is based on a combination of Nordic mythologies and medieval German stories. A central part is played by the ring of power forged by dwarf Alberich from the stolen Rhine gold. The struggle for the ring eventually brings about Ragnarøk, the end of the Norse gods. Wagner composed the series in mid-19th century.

While we did not appreciate the modernized, angular settings of the plays, lots of the performances were very pleasant. I especially liked Sieglinde in Die Walküre and Hagen in Götterdämmerung. Wotan was also very good in the first two operas.

Watching the whole 16 hour series in one week was quite an excercise, but we still were able to enjoy it and go for some after-opera beverages in Ateljé.

Endorsing MidCOM's Migration to File System

Posted on 2004-09-08 12:12:28 UTC to . 0 comments.

Current situation

To those unfamiliar with Midgard development, Midgard Framework itself has been written as a C system library and a PHP extension. The Framework provides services like authentication, templating and content storage. The actual Midgard applications are written on that foundation in PHP and stored in the Midgard database as pages and "snippet" objects.

MidCOM functions as a component system written on the application layer. With MidCOM, the actual point applications, or components are written following a strict set of coding standards and stored in the Midgard snippet tree. The components must provide a standardized set of interfaces, and all input and output with them is controlled by the MidCOM framework.

The fact that all application code is stored in the database causes several problems, the topmost being lack of good development tools and difficulty of version control. Torben explains these points well in the "Current problems" section of the mRFC.

Additional issue is performance. A component framework is a big thing, and its services and interfaces require many code libraries to be loaded. It has been calculated that an average MidCOM page request causes 2000 database queries. With careful optimization we could probably get the number down to about 1300, but that is still a lot. If we move the libraries to file system, only database I/O will be actual content and template queries. Also, if the code is stored in the file system, it can be compiled into faster byte code using tools like Zend Optimizer.

Reasoning for the old way

With all these issues, why did we do the illogical thing of putting our code into the database in the first place? The code snippet system was added to Midgard in the 1.4.0 cycle, and there were several reasons:
  • At that time most Midgard applications were much smaller
  • Storage in Midgard database provides metadata support. Licensing information, documentation and icons can be stored into the code objects themselves
  • Code can be replicated together with the site data
  • Editing code does not require filesystem access
  • Permissions come from Midgard's group system
An important consideration is also that the lack of file system access makes Midgard much more secure, as noted by Alexander Bokovoy in his Midgard 5th anniversary presentation. When the whole system accesses only the database, and even that only through the Midgard libraries, this cuts down the risk of security holes through bad coding. In its 5 years of history, there hasn't been a since publicized security hole in Midgard. And this even though many high-profile hacking targets like large organizations, military, financial institutions and governments run Midgard.

Changing deployment models

Back with Midgard 1.4.0 almost all Midgard applications were built in-house and were not distributed. This way version control of the code was more closely connected with the general staging/live routines of the developers. For this the fact that code could be replicated with content was advantageous.

Now most applications like MidCOM and its components are being developed in centralized fashion by the Midgard Community. In this setup code is developed and tested on separate systems, and then release versions are deployed widely across production servers. This way version control of the code between a content staging and live is not so important, as both will share the same component versions, and will differ only in versions of templates, configuration and local code.

Separated concepts

Moving MidCOM to file system not only makes development easier, but will also make the separation of centralized "system" code and local scripts clearer. MidCOM and its components are a part of the Midgard Framework, and are installed by the system administrator and not modified by a site developer. The things that a site developer will modify will be local and specific to a website, organization or a server environment, and so are stored into the Midgard database. This includes local configurations, output templates and local scripts.

The new way

If mRFC 0006 gets implemented, all MidCOM core code and components will be developed just like any PHP application, using the file system and include() statements. This means that version control and development will become substantially simpler.

However, what we lose there is the ability to install a whole MidCOM component or the framework from a single repligard .xml.gz file. I have proposed using the PEAR installer for this, and Torben has promised to include it to the mRFC.

The PEAR installer uses an XML configuration file for defining the files shipping with a package, and enables server administrators to install new software with a single, Debian APT-like command regardless of the operating system. The PEAR installer is available by default on PHP 4.3.0 and newer releases.

Using the common PHP installation methods of the PEAR community would make The Midgard Project far better connected with the PHP community in general and promote code sharing.

To promote this even further, the Midgard Community should fully embrace the PEAR Coding Standards, and use the same code documentation tools.

Theoretically MidCOM could even move to the PEAR repository, but it would probably be seen as too Midgard-specific by the PEAR community. It provides a quite generic component architecture, but all components and its methods like the URL parser depend heavily on the midgard-php extension.

mRFC status

Torben has still left the proposal to Draft state, and some things will have to be polished before it can be voted on.

If the mRFC passes the actual transition should be relatively simple. We can just use the Aegir FileSync AddOn to copy all code snippets of the MidCOM core and component directories to the file system, and then programmatically change all mgd_include_snippet() calls in the system to use MidCOM's internal $midcom->include() method.

The PEAR package description files should be easy to generate automatically. In addition, we should create a "MidCOM uninstaller" Repligard file that would include delete calls for all objects in the MidCOM 1.4.0 release.

The actual MidCOM sites will be easy to migrate, as most of them contain only a single mgd_include_snippet("/midcom/midcom") call. This could be either changed to a filesystem require() call, or the MidCOM system could ship a stub snippet for this.

Updated 13:20: There is some discussion about this on the midgard-dev mailing list.

Updated 2004-10-28: The vote on mRFC 0006 passed today, so we can finally start implementation.

Getting used to the new office

Posted on 2004-09-09 10:01:32 UTC to . 0 comments.

Rambo in the office, photo taken with Nokia 6820

We had been "practicing" cohabitation with the two companies since early June, with the Innopoli2 office mostly serving as a mailbox, and so the move was quite painless. Some of the office infrastructure was changed, like installing our network printers and adding more desks.

The office has much less capacity than the combined number of employees in the three companies, but that is not a problem since most people are always at a client.

The business synergies are quite good. We build web solutions and business applications on Open Source software, TMV provides network solutions and Linux support, and FTC hosts sites with Midgard CMS.

Sepetlahdentie 9 D entrance

The office is located in Matinkylä, Espoo quite near the Iso Omena shopping center.

Introducing Suicide Surfers

Posted on 2004-09-09 16:06:49 UTC to . 0 comments.

Joe and Jay have never surfed, but nevertheless left their regular life and will head soon to Australia to learn surfing. Why? Joe explains in a recent diary entry:

Most of the people I've talked about my plans for the coming year have had these strange ideas about leaving to somewhere. They've been saying things like "I'd like to do that too, but I have all these commitments to handle." Facts are:

1. (Geography) We have maybe the worst climate in the world. No real summer and last decent winter was -98.

2. (Technical knowledge) Only thing to be proud of is a company, that technically isn't finnish and abandoned its corecompetencies by selling the branch which manufactured rubber boots. Result: finnish are proud of mediocre cellphones, which are made in china and generally thought to be japanese.

3. (Culture) Our best placement in Eurovision song contest is 6th place from 70's. Luckily other europeans have decided, that there is no point to come to the contest every year, if you lose. So finnish singers have to embarrass themselves only once in two years.

4. (Food) Most of the recipes we have inherited from our grandparents are practically uneatable. Take mämmi, traditional easter dish, for example. What kind of pervert would like to eat something that resembles shit of carnivorus animal after it has been laying on freezen walkway for two nights?

5. (People) Peaople just suck.

You may enjoy doing same things 9to5 every day with same people, at same places in same shitty climate. But I'm off.

The site's IA is also interesting; in addition to posting photos, videos and diary entries, the site also collects data on when they got lucky last time. And it is all nicely in XHTML and CSS. All frequently updated areas provide handy RSS 2.0 feeds for subscription.

Currently they provide a guestbook for commenting, and are planning a discussion forum.

This project will be amusing to follow.

I'm Moblogging Now

Posted on 2004-09-10 14:54:09 UTC to . 0 comments.

The "messaging device" has a crappy CIF camera, but I think that still the ease of taking photos helps to make my site more live.

The procedure for posting a photo is the following:
  • Take a photo with the camera
  • Select "sent" from the options -> "send as MMS"
  • Type the photo caption to the MMS
  • Select "send as email"
Then the photo gets sent via GPRS to an IMAP box reserved for this purpose. My server has a fetchmail script polling the inbox that will forward the messages to Midgard using the supportmda.pl script from OpenPSA.

Midgard reads the messages in and converts them to MidCOM de.linkm.newsticker compatible articles with the photo stored as an "image" type attachment that has a generated thumbnail.

This weekend will be the acid test for this concept, as I will spend it in a combat exercise arranged by MPKRy.

In the other news, I turned 25 today. Quarter of a Century is the release name for today's midcom-template ;-)

New Thunderbird and Firefox

Posted on 2004-09-14 11:07:00 UTC to . 0 comments.

In addition, there is now a new promotional website, spreadfirefox.com in beta release. Spread the word.

Firefox - The browser you can trust

Upgrading both Firefox and Thunderbird from earlier releases went quite painlessly on my Mac OS X box. And now Thunderbird has a cool RSS reader so following my blog will be easier than ever ;-)

Updated 2004-09-15 18:48: The Firefox upgrade actually had some issues. It refused to open a browser window after the installation. Only deleting my profile using the Firefox Profile Manager helped.

Why Web Standards Matter

Posted on 2004-09-14 15:14:39 UTC to . 0 comments.

In addition, Jakob Nielsen has posted an interesting piece on standard elements in web design. His recommendations include several conventions, like always placing a logo link to top-left corner and the search box to top-right corner.

Reviving the Old Psion Series 5

Posted on 2004-09-15 01:21:44 UTC to . 0 comments.

psion-series5.jpg

The Series 5 has two major advantages when compared to laptops: it is small and has a very long battery life. In addition, I happen to have a spare one lying around.

We've used this palmtop previously for keeping the travel journals of two motorcycle trips, the 2002 European tour and the 2003 Russian tour. The journals were written using Psion Word and transferred via FTP to the web server where Midgard imported them as HTML files using the psiconv utility.

Similar system could be used here for importing the study notes into a MidCOM-driven website for easier browsing and searching.

The only question is connectivity. I can see several options here:

  • We're using a CompactFlash memory card for storing the data on the Psion. This card could be read on my iBook using a USB CompactFlash reader. Then the files could be uploaded via a web form
  • I could get a USB IrDA adapter for a Linux box and copy the files over using the plBeam application to provide IrOBEX support on the Psion. The Linux end should be easy to script to publish the materials into Midgard
  • Or we could transfer the files via FTP or something similar and a GSM modem connection
  • The ease of use with these has to be investigated. As she will be making several notes each day the transfers must be easy and semi-automated.

Since she also intends to keep her study calendar on the Psion the vCal Psion Calendar to vCalendar converter might be useful. Rambo is working on vCalendar import to OpenPSA Calendar so the events could also be synchronized to the web.

Updated 09:34: After playing a bit with psiconv settings it seems to create quite good XHTML of the Psion Word files. However, it totally loses the possible Sketch images attached to the documents. Any ideas on how to get them included? For biology studies it would be very useful to be able to attach simple drawings to the notes.

Updated 2004-09-24: Kerttu has now been using the S5 on several lectures and seems happy with it. It has been dubbed "Ancestor", as it is the ancestor of a Nokia Communicator, and because it resembles the "Ancestor" in the Moomin series. Next task will be to start using the web integration stuff, but she will need a website for that.

OpenPSA demo available

Posted on 2004-09-16 10:02:13 UTC to . 0 comments.

OpenPSA is an Open Source Professional Services Automation system built on top of Midgard and PHP. The system provides management tools for software companies and consultancies. The modules include project management, CRM, help desk and group calendaring.

Using Weblog Editors with Midgard CMS

Posted on 2004-09-23 12:53:13 UTC to . 0 comments.

Inspired by the public betas of MarsEdit and NetNewsWire, I looked up an old MetaWebLog API support patch I had made for the blogging and news ticker tool of Midgard CMS, de.linkm.newsticker. I modernized the patch a bit and committed it to MidCOM CVS.

This means that all Midgard CMS installations using the new version will provide support for desktop and mobile weblog editors for updating the news items. The "Remote editing tools" support can be switched off in configuration but I've left it on as default.

I've now tested the system with two desktop blogging tools for Mac OS X, ecto and MarsEdit, and it works quite well. I can prepare my blog posts offline, and publish them whenever I have access. In addition, the cool "Post to Weblog" feature in NetNewsWire works with both.

Setting up the desktop blog editors is very simple, simply go to their "New account" or "New weblog" dialogue and give the URL to your newsticker-powered topic. The weblog editor will get all required settings by autoprobing the RSD file provided in the HTML headers. You will be polled only for your username and password and the editing environment should be ready.

If the RSD auto-probing fails for some reason, the XML-RPC interfaces are available in "rpc/metaweblog/" under the newsticker topic. So for example the RPC URL for this blog would be "http://bergie.iki.fi/blog/rpc/metaweblog/".

The MetaWebLog API patch requires the PEAR XML-RPC package to be installed. It is available by default in all PHP 4.3.x installations.

Here are screenshots of the setup and blogging procedure in ecto:

ecto-new-blog.jpg

ecto-new-blog-settings.jpg

ecto-new-blog-username.jpg

ecto-new-blog-name.jpg

ecto-blog-entries.jpg

ecto-new-post.jpg

There are some features missing from the remote editing support that I miss:

  • For some reason MetaWebLog API doesn't let me edit the article abstracts separately
  • Categorization support is still missing from the implementation
  • MetaWebLog API supports only storing images with the topic, not with the article

Anyway, this is a big step forward in making Midgard a good blogging tool. I will try to make all posts in the near future using these desktop tools to get possible details and glitches tracked down.

Here are some screenshots of MarsEdit editing the same blog:

marsedit-new-blog-username.jpg

marsedit-edit-post.jpg

Updated 13:20: I would be more than happy to receive testing reports of using this feature with other desktop blogging tools. Please send them to the midgard-user list. You can also blog your results and just send the URL.

Almost too perilous

Posted on 2004-09-23 15:35:16 UTC to . 0 comments.

My friend and colleague Kaukola got hitched last weekend. We had a good time in the bachelor party last August, involving military exercises, zorb balls, sauna and aerobatics.

However, the actual wedding celebrations provided me with the scariest experience so far during the year. I've hiked in the arctic, fallen under a train in Russia, faced angry elephants and climbed mountains in Africa, participated in a car race and visited several war zones during my summer holidays. However, none of these were as scary as having to dance waltz. But I did it :-)

Wedding dance

Good luck and all the best for the newlywed!

Rambo took some rather nice pictures:

Kerttu and Bergie at the weddingHeli and Henri in rice showerPromises

This is now Unicode

Posted on 2004-09-27 10:44:15 UTC to . 0 comments.

This blog has now been successfully converted to the UTF-8 character encoding. This enables using non-western characters in any part of this site.

НЕ РЛОХО!

This was all made possible using Torben's handy MidCOM UTF-8 HOWTO. Please report if you note any issues.

Note: Newsticker's MetaWebLog API support doesn't seem to work 100% reliably on UTF-8. ecto seems to support it fine, but MarsEdit reports XML parsing problems when fetching the latest entries.
I've now posted a bug to the MarsEdit issue tracker, but frankly I suspect this is an issue with either the PEAR XML-RPC library or my MetaWebLog implementation.

Updated 2004-09-29: The issue with blogging tools was resolved by commenting out the following lines in Apache configuration:

#   php_value default_charset UTF-8
#   php_value mbstring.func_overload 7
#   php_value mbstring.internal_encoding UTF-8
#   php_value mbstring.detect_order UTF-8

Torben has told me to use these lines in his HOWTO, but as suggested by Piotras, they are not necessary for correct usage of Midgard with UTF-8. In addition, not using them resolves the MetaWebLog API problem.

Urban Combat Basics

Posted on 2004-09-27 14:02:51 UTC to . 0 comments.

Entry stack during training (photo by Tero Pennanen)

Some quick notes:

  • Outside old city centers the buildings made after beginning of 60s have so thin walls that they provide essentially no cover
  • There are aerosol weapons which shoot a gas-filled projectile into a room. The projectile then fills the room with an explosive gas
    Chechens have learned to combat this by moving their positions inwards in the buildings and lighting a bonfire in the room next to the window. This makes the aerosol gas burn safely before reaching explosive stage
  • Upper floors of buildings are not a good place for defensive positions as they are easily collapsed. Fire spreads very quickly upwards
  • Safest place for supply and deployment routes is underground using cellars, sewage pipes etc.

Updated 14:40: Here are some photos moblogged live from my phone camera. Quality is abysmal, as always

unnamedunnamedunnamedunnamed

Off to OSCOM4

Posted on 2004-09-28 03:17:20 UTC to . 0 comments.

Today will be filled with arrangement practicalities, and the actual conference starts tomorrow at 9:15 am.

All the previous OSCOM events I've attended have been fun, and I'm expecting an interesting three days filled with discussion, new CMS ideas, and quite a few presentations.

OSCOM 4 with Apache Track

Despite the early departure the flights went without incident, and I had time to read some new RFPs and get started on the time-based release plan mRFC for Midgard. I was online in the Wyona office already before 11am.

Today was spent mostly by writing a new Wiki component, net.nemein.wiki for MidCOM. It will be used as a collective notepad by both OSCOM 4 and Linux Greenhouse people in upcoming events. So far the Wiki is very simplistic but should still fit the requirements. OSCOM's Wiki is already online.

I will be staying during the conference in Michi's place. This place is becoming a geek camp with more than five more people staying here after tomorrow. Now I'm trying to follow a Spanish conversation about Apache Lenya and CSS naming conventions.

First day of OSCOM 4

Posted on 2004-09-30 08:42:18 UTC to . 0 comments.

OSCOM4_ApacheTrack_Audience.jpg

This conference is smaller than OSCOM 3 held in Harvard university and in about the same range as OSCOM 2 in Berkeley. However, this just means that this time most people attending are developers instead of end-users, and discussion ranges from interoperability topics to cultural issues.

I'm chairing the Apache Track of the event. The first day was mostly Jakarta topics, and so not that interesting to me personally. Day two will be focused on PHP and so closer to my interests. However, day one brought forward several interesting projects:

  • HttpUnit - Web application unit testing framework
  • Lucene search engine and its Perl port, inspiring to post MidCOM bug #107
  • FlowScript, Cocoon's JavaScript-based session control system
  • OS Web Design provides free web templates. We have to think about how to include them when planning the CSS naming conventions
  • We're planning to try integrating BXE WYSIWYG XML editor to MidCOM as widget_xml, with an XSLT transforming datatype_xml
  • Pubcookie, a single sign-on system for Apache and IIS

In addition,

After the event and some beers we had a nice Italian dinner outside in slight rain in the old city of Zürich, and continued to caipirinhas and cigars in a Brazilian bar.

Second day of OSCOM 4

Posted on 2004-09-30 16:48:06 UTC to . 0 comments.

OSCOM4_Innovation_Panel.jpg

After bit of thinking I decided that a session on MidCOM - Midgard's Component Framework for PHP would be a good match for the technical crowd here.Because of this most of my has been spent on setting up latest MidCOM on my iBook, tweaking my South AfricanMidgard training slides in SlideML to fit this conference, and marveling how slow the iBook is for running a full-blown CMS.
My session will be tomorrow at 9:15 in room E1.2 in the ETH main building.

In addition I gave a 20 minute interview for the Open Source community related movie Michael Wechner is working on. Quote from there:

[Finnish culture promotes collaboration and Open Source because] Finland is a cold country. If we didn't work together we would all freeze to death and get eaten by polar bears.

Some stuff from today's discussions:

  • JSR-170 is an API for Java that aims to standardize how CMSs store their content into a repository. There is also a PHP port under construction
  • I installed Webalizer to OSCOM's web server today, and the access statistics are abysmal. How could we get CMS projects to link to OSCOM?
  • Chregu has promised to upgrade Planet OSCOM from net.nemein.rss to the same software that drives Planet PHP
  • OpenOffice.org has an active community of thousands of people who are not programmers but instead market OOo actively. For them being involved is the reward. Spread Firefox also is a good example of that
  • There is now first draft of mRFC 0008, the time-based releases proposal for Midgard

The planned Town Hall on Open Source and Ethical Capitalism with Kit Blake and Michael Wechner got rasmussed by the very interesting panel on open innovation.

In the evening there will be the conference dinner in Les Halles. We also planned a meeting about CSS namespacing with Thorsten, but this didn't happen because of all other discussion going on.

OSCOM4_Dinner.jpg

Amusing note: Everybody starts their first conversation with me by saying "I've read about your motorcycle adventures in your blog". :-)

Back