Pages

Saturday, January 30, 2010

Surprises

Once in the while I do something I haven't done for a while and get surprised by how much fun it is.

Today I wanted to get the ITV (Spanish motorcycle inspection), which has been overdue for a while. I didn't do it because I haven't used it for a while and can't used it because I didn't have the ITV.

Turns out that I needed an appointment, so I run some errands. I got a new zoo membership card and cancelled my old gym. This took me with the motorbike down and along the beach. The weather was beautiful and it was reasonable warm. I saw the beach, smelled the sea and felt the Barcelona air in my face.

Whenever I use the motorcycle I get a smile on my face. I really should use it more often. And it makes me appreciate Barcelona more.

Now - most people would say that it shouldn't come as a surprise that living in Barcelona, enjoying the sun and taking a beautiful bike for a spin along the beach is a nice thing. In fact it is probably a dream for most people - including me.

Sometimes you have to take a step back and take a look at your life and realize that you pretty much got everything you need instead of chasing the next dream. You tend to forget that if you are stuck in your daily routine.

By the way: the picture is from today, but not from the motorcycle trip but a mountain bike ride I did in the afternoon.

And now I am going to make Thai green curry and hack some code.

Nice!

Saturday, January 23, 2010

Fedora and PHP QA

After hearing again about many QA tools at the 2009 PHP Barcelona conference I decided that it would be nice if these would be available through packages on Fedora (and through EPEL on RHEL).

Turns out that the most important ones were already packaged, some needed a new packager, some were waiting for review and a few still need to be packaged.

Here are the once already available, with the packager name:
  • php-phpunit-bytekit (llaumgui)
  • php-phpunit-phpcpd (llaumgui)
  • php-phpunit-phploc (llaumgui)
  • php-pear-PHP-CodeSniffer (cdamian)
  • php-pear-PhpDocumentor (cdamian)
  • php-pear-PHPUnit (xulchris) (this will soon be renamed to php-phpunit-PHPUnit)
These are waiting for review:
  • php-pdepend-PHP-Depend (cdamian)
  • php-phpmd-PHP-PMD (cdamian)
These don't seem to have packages at all:
  • php-phpunit-phpdcd
  • php-phpunit-phpUnderControl
  • php-phpunit-PHP_CodeBrowser
  • phpanalysis
  • padawan
  • arbit
Because EPEL is limited to the rather ancient PHP version of RHEL it sometimes contains older versions of the packages available in Fedora. It might be time for a community supported repository for PHP 5.3, for people who don't want to live on the bleeding edge with Remi.

Another thing missing is a package for a continuous integration software like Hudson, arbit or CruiseControl. The reason for this is that they are either really difficult to install or package or are still very much in a alpha version. We are using hudson at work and they do provide a RPM, but it is less than perfect. Arbit looks promising, but probably needs a few more months to be at least in a beta stage.

Give me a shout if there is a package I missed.

Sources:

Wednesday, January 13, 2010

2010 New Year's resolutions

A new year means new resolutions. But first a quick look back at the ones from last year.

On the fail side: I didn't loose weight, neither did I use my motorcycle more or took a lot more advantage of Barcelona. Success on: sorting out my music collection, travelling somewhere new, doing more programming and blogging a bit more.

Now to the next year. I read a bit about these kind of resolutions and how to be better in succeeding. I probably took too much on in the last year and it is better to have some way of quantifying success or failure. So this year I am just taking on three resolutions. I still keep the failed ones from last year in the back of my mind though.

1. Loose weight (again), but this time with a plan. I will try to loose 0.5 kg a month. On the one hand it doesn't seem a lot on the other hand loosing 6 kg in a year seems too much. I will keep track of this and also keep track about my sport activities. To achieve the goal I will have to reduce my lunches with the opus5 guys and increase my sport activities. I will swap my gym for one nearer to my flat. I also will stop eating sweets and snacks.

2. Reduce time spend watching TV, reading e-mails, blogs, facebook and twitter. I will unsubscribe from as many services as possible. Instead I will spend the time programming, cooking, reading, socializing and doing sports. Not sure how I will put that in numbers, as I don't have them for the past, but I will make something up.

3. Do something about my so called "career". This could mean doing something more fun, working less and/or earning more money. Either at opus5, new projects in my free time or something completely new. I will have to see what comes up, but I have twelve months to decide.

Wednesday, December 30, 2009

2000 to 2009

Now that another decade comes to an end, it is time for me to see if the ten years really were worth the effort. Overall it seems to have been more pain than was strictly necessary.

2000 - it all started quite nice. I just turned 30 and was living in London, just got together with my girlfriend and working for guideguide a very nice start-up which was going quite well at the time. One highlight of the year was a trip to OSCON in California, where I witnessed the beginning of Perl6, which seemed brilliant at the time and now appears a bit pointless.

2001 - will always be remembered for 9/11, someone in the guideguide office heard about it over IRC and we quickly confirmed it on TV. It was also the year where I bought my first iPod, maybe the only trend I ever spotted early. Nobody at the time imagined how either 9/11 or the iPod would shape the future.

2002 - I split up from my girlfriend for a while and decided that this would be the right moment to start drinking alcohol again after ten years.

2003 - guideguide was scaling down a lot now and I had to fire lots of people, which was probably one of the most stressful episodes of my business life so far.

2004 - with not much left of the company I decided I could as well move to Barcelona and work from there. It turned out to be a lot of fun and a lot more relaxed than London. It was also the year where I got ill and fixed up again.

2005 - a bit of work, a bit of travel, a lot of recovery

2006 - I quit guideguide after lots of years. It was a difficult decision, but nobody of the old gang was still around, so I didn't feel too bad. I was also looking for a local job and just being employed for a change. I used the rest of the year to chill and enjoy Barcelona.

2007 - Found a new job at opus5, learned lots of new stuff. For some reason the founder left after I just started, is it me ?

2008 - whatever happened to 2008?

2009 - I decided to stop drinking again, turned out to not be my thing after all. The economy made this year really interesting and I hope it will turn up some new opportunities in the future. Oh, and I turned 40 and I am looking forward to my mid-life-crisis, but that is the topic of another post.

And finally thanks to everyone who made these years more fun then they sound:
  • my girlfriend Cat, who makes everything more lovely
  • my family: Kathrin, Thomas, Klaus and Ulla, who helped me through some rubbish
  • Mikel, who brought me to London
  • the guideguide guys: Andy, Adam, Alex, Marc, Rob, Jasper, Ben, Luke, ..., who made me learn a lot and fast
  • The Londoners: Anita, Justin and Graham who made it more fun
  • Opus5: Dennis & Pablo, where I learned a lot of stuff I didn't wanted to know
So lets see what the next decade brings, maybe a new start and the opportunity to do completely new mistakes!

Here are some random pictures from the past ten years

Saturday, December 19, 2009

Fedora 12

Fedora now has been out for a few weeks and I can summarize my experience with it a bit.

I have installed it on four machines:
- netbook (Eee PC 901) new install with a 32bit live USB stick
- media centre (ancient custom AMD Duron) upgrade with the 32bit DVD
- home PC (AMD Phenom 9350e) upgrade with the 64bit DVD
- work PC (Dell Intel) with 64bit preupgrade

I would have preferred the preupgrade on all machines, but I am using RAID on some of the machines and preupgrade doesn't like /root being on RAID. But the upgrade went smooth in all cases, so I don't really mind.

I also changed the graphic card in my work PC to an ATI HD3450, so I can finally use the desktop effects with an open source driver.

What works out of the box


Desktop effects on the netbook, home and work PC, with either the ATI card or Intel on-board graphic chips.

Pulseaudio with USB or bluetooth headset. I use it mainly with Skype, which is the only non open source software left on my computers (I blame peer pressure).

PHP 5.3.1 and MySQL 5.1.40, which meant I have stopped using the Remi repository for now.

Automatic bug reporting for program crashes and kerneloopses. This should make the quality of future releases even better, even though bugzilla is pretty much swamped with bug reports now. But I think it is always better to have more information than less.

CPU speed scaling finally works. I had to fiddle with the BIOS settings a bit to enable Cool and Quite and some other power management settings.

What doesn't (or didn't work)

I had some problems with pulseaudio crashing after installing the ATI card, but putting a "blacklist snd-hda-codec-atihdmi" into /etc/modprobe.d/blacklist.conf fixed it. I found the fix on bugzilla.

I am still not able to play my Homeworld 2 CD with either Wine or VirtualBox, I think the drivers are still not good enough to support the OpenGL needed for the game. It also crashes after a while in VirtualBox. Radeon bugs currently hold the top spot at kerneloops, which makes a fix more likely.

If you use an Eclipse (or Azureus), which didn't come with Fedora some of the GUI buttons don't work. This is caused by a change in GTK and a workaround is to set GDK_NATIVE_WINDOWS=true before you start eclipse. This is also mentioned in bug 540956.

I bought a D-Link DWA-547 Wireless N PCI Card for the media centre in my effort to upgrade the flat to 802.11n, which I just can't get to work. It is either slow or crashes the whole machine without any way to get to the kerneloops. I probably have to find a different card to get it working. But wireless cards always have been a problem.

My Bit


I am also trying to contribute more to fedora by building packages and doing package reviews. After the Barcelona PHP Conference I decided to build RPMs for the PHP QA packages by Sebastian Bergmann and others. Turns out that most of them are already available or up for review, so I applied as co-maintainer and did a package review. Remi has a good overview of PEAR packages in Fedora.

The other big project which will probably take a few more years is the odyssey of packaging symfony, this turns out to be difficult because symfony bundles a lot of libraries and they need to be separated into their own packages. The good thing is that this will bring these libraries into Fedora (and eventually EPEL) too. So far I managed to get Doctrine in and the Swift Mailer is up for review. Symfony itself won't get into EPEL, because it requires a newer PHP, but it will work with the Remi bits.

You can find a list of my packages in the Fedora package DB and also of the ones I co-maintain. Still rather short list at the moment :-)

Summary

Probably the best Fedora upgrade and usage experience I had so far. The main problem is still the hardware, the software itself works perfectly and for my usage I don't really need anything more at the moment.

Finally a rather boring screen shot of my desktop:

Saturday, October 31, 2009

Barcelona PHP Conference Day 2 #phpbcn2009

Even shorter summary of the second day of the Barcelona PHP conference. (see here for day 1)

Zend_Cache... by Enrico Zimuel

This was a introduction to the cache component of the Zend framework. It pretty much does what you expect: it wraps the common types of caching ( file, apc, memcached, ...) into a common API to make them easy to swap and use. It also has helper objects to support caching of PHP output with output buffering.

The State of Quality Assurance Tools for PHP by Sebastian Bergmann

Mr. PHPUnit gave a short introduction to testing and the PHPUnit framework. He then introduced some of the other tools that can help you with quality metrics of your software, these were:
  • phploc - counting lines and more
  • phpcpd - finding duplicate code
  • pdepend / phpmd - static code analysis
  • phpcs - code style and static code analysis
  • bytkit-clu - more analysis
He then continued to show how you would automate running these and include them in a continuous integration tool like CruiseControl with phpUnderControl or Hudson.

It was a good talk and gave an introduction to the whole process of quality assurance for projects.

Slides

Continuous Integration by Davide Mendola

Another talk about CI, which gave a bit more insight into the tools but because of the previous talk a lot of stuff was repeated and not a lot new information introduced.

One thing was obvious though: nobody is completely happy with the current tools, because they are all Java based and don't fit 100%. There seems to be a market now for new PHP CI tools and I am sure we will see some showing up in the near future. I would also see some of these using a MVC framework instead of being developed from scratch.

And for the hecklers in the back shouting "Xinc" : no release or commit since one year ? Maybe someone should pick that up again. :-)

Symfony 2.0 a sneak peak by Fabien Potencier

Fabien gave a very fast run through some of the new components and designs for Symfony 2.0. A lot of things will change and it will be difficult to port older projects, especially if you have business logic outside your models.

He spent a lot of time explaining the dependency container component and how and why it will be used in Symfony 2.0. I am a bit afraid that this will make things more complicated and difficult to debug or work with in an IDE. I usually don't like to see logic into configuration files, but now I at least understand why he is doing it and what advantages it will have in Symfony 2.0. I just hope I won't see these in every object and sometimes just simple injection is used.

I am looking forward to Symfony 2.0 though, I just got one suggestion to reduce Fabiens work a bit: throw away the Lime testing framework and use PHPUnit. Lime will never match the PHPUnit features and everything you need which isn't provided by PHPUnit yet is probably easy to integrate.

Open Classifieds by Chema Garrido

This was a refreshing different talk by the lone developer of Open Classifieds, which is an open-source classified web application. He developed it from scratch without using any framework (Rasmus would love this), it is very much in the spirit of the KISS talks of this weekend.

If I find time I will certainly have a look at it. And before the security concious object orientated dependency injecting agile caching crowd complains: give the guy a hand with a bit of code review if you find the time.

Open Classifieds Website

Friday, October 30, 2009

Barcelona PHP Conference Day 1 #phpbcn2009

First day of phpconference.es is finished and it was very enjoyable. The location was the same as last year, so was the quality of the organization. I saw six talks, here are small summaries:

KISS by Derick Rethans:

Pretty much a beginners, introduction and common sense talk. Most of it not even directly relevant to PHP. A bit of a disappointment, might have been more interesting for customers than developers.

No slides up yet, but they were very similar to these: Kiss Phpnw08

Trees in the database by Lorenzo Alberton:


A very interesting talk about ways to store trees in a database, which is something everyone has to deal with at some point. He started with the simple "parent-child" method and showed some of the problems with it. Then went through some better versions like the "nested set model", which is for example used in Doctrine. He finished with the "nested interval model", where I think I saw some smoke coming out of some heads around me (and probably mine).

Finally he showed how trees are supported directly in some of the databases and the SQL99 standard.

It would be nice if the "nested interval method" would end up in Doctrine too. And maybe support for the database extensions too, though at the moment I just care for mysql and here is a link with some information how to do the stuff there.

The slides are here: Trees in The Database

Talk by Rasmus Lerdorf

Rasmus did a two part talk. The first part was about performance and ranged from suggestions to replace lots of expensive library calls with simple echos to introductions into strace, valgrind and xdebug. He likes to complain about frameworks and abstraction, for which he got some angry looks out of the framework corners.

Second part was about security, where he showed some problems through examples in live sites. Because someone twittered about it before he wasn't able to show the ".svn" files on elpais, but he managed to show an interesting XSS exploit on another newspaper page. Then he went on about the "filter" extension, which I don't like much because I see it as just another Swiss army knife function for something which should belong into PEAR libraries or frameworks. One good thing about it is that you can switch it on globally so that you can block most attacks automatically and skip it for special cases, this reminds me a bit of magic quotes though and how much I hate those.

It was very interesting and he is a very charismatic talker, which helps obviously. The questions after the talk came mostly from the framework guys who pointed out that the security part is easier to fix with one of those, because you have centralized points where you can put your security hooks.

And the PHP filter extension is a bit like a "security framework" only that most PHP programmers won't be able to see or change the source.

Most of the people in the audience have different problems to solve than Rasmus, because we need to build websites quick and we don't have the amount of hits that Yahoo gets. But he gave some good pointers and I certainly get my Xdebug profiler out more often.

Ajax for scalability by Erik Schultink

Erik works for Tuenti, which is a facebook clone for the Spanish market. They have millions of hits and more or less the same scalability problems as the original. They use ajax to build the complete page and basically just retrieve json from their servers. He described everything they do to increase their performance, from the server farm set-up, CDN usage and monitoring to the distribution of the image sizes on the website.

This was a very good talk and I wish I had their problems or they would have an office with an opening in Barcelona :-) These are your guys if you want to work for facebook, but live in Madrid.

I wish I had a link to slides, but I don't

Integrating Zend Framework and Symfony by Stefan Koopmanschap

Stefan is the community manager for Symfony and gave some examples of integrating Zend components in Symfony and Symfony components into the Zend framework. He gave some small examples of both ways and introduction to some of the nice components of both worlds.

I definitely have to look more into the Zend framework and see if I can pick some nice things up. The twitter component would have made my life a lot easier while developing krass sets

And there are slides up for the talk.

PHundamental Security by Hans ZaunereDamien Seguy

As the title said: basic security stuff about the typical injection. The slides were a bit confusing at times. Good stuff I picked up: some more evil PHP functions to circumvent register_globals=off, using the tokeniser to find problematic code and using statistic analysis to find problems.

He also mentioned some black-box tools to help find problems in websites, but I forgot them and I can't find slides either.

Tomorrow is day 2, which looks promising again with talks by Herrn PHPUnit and Monsieur Symfony and some other goodies.