2010/06/27

Cross browser CSS and selectors - improving Hudson's viewList

After visiting the JBOSS Hudson instance with Firefox I really liked the way how the tabs were shown in the viewList. However revisiting the same page with Chrome was a disappointment. Neither was the active view emphasized nor were the inactive views flowing like they did with Firefox.

After some trials I detected that the attribute selectors in the CSS were not triggered. Digging into element view showed that Chrome did not render a whitespace between the height attribute, so Firefox rendered tr[style='height: 3px;'] while Chrome was rendering tr[style='height:3px;']. After duplicating the selectors and changing some attributes for Chrome I got at least the active view rendered in the right way, see jboss-style.css.

2010/06/18

Storing your OpenOffice, Xmind, ... zippy documents more efficiently in a SCM

I really like having my sourcecode and documents in a SCM since I first discovered CVS about 14 years back and introduced it in two companies thereafter, one of which had tried to use VSS (not really usable at the time, you had to lock files for editing which made you call for the VSS admin when your colleague was not available and did not allow to work on the same document at all), while in the other developers only had been using timestamped ZIP files before, which made team work really hard. In my current company I (maybe) made a mistake by pushing the switch from CVS to SVN about five years ago.
Back then I took a look at one of the first DVCS systems (arch) but found it to be to confusing (at least for me, YMMV). About three years ago I discovered Mercurial and really have liked it since, especially as I really like Python. I tried Bazaar as well because it promised better integration with Subversion but it used several different, incompatible repository formats so I had problems even checking out a remote repository more than once and the speed was not at all convincing as well. Nowadays I use Git sometimes which I like as well and I am especially impressed by the simple underlaying concept of storing things. However I still feel more comfortable with Mercurial right now and use Bitbucket a lot.
After having used DVCS you feel almost crippled by SVNs bad merging support and the idea of having no distinction between branches and tags seems not so clever anymore, we have had some hard times using standard SVN tools after a decision to put release tags in a directory called releases and are sometimes still struggling to find a common point of view on the correct position of trunk and what to store beneath release tags in repositories used by more than one project, so they are unambiguous both for our tooling chain and understandable for humans.
Well, back to the topic: nowadays a lot of software uses ZIP containers to store their information, which will bloat your SCMs because every new zip is so different from it's ancestor, even if you did only include a single new word, because the compression and a preview picture will make the new version very different from the old one. So I wrote a little Python script which will uncompress, delete the included preview and put the remaining files back into an uncompressed ZIP again using the stored method.

Triggering Hudson builds with Mercurial hooks - a variation

Ashlux writes about triggering Hudson builds with Mercurial hooks on his blog. The basic hook described is:

[hooks]
changegroup.hudson = curl http://hudson_url/job/project_name/build?delay=0sec

I use this technique as well a lot with two refinements:

  1. I use polling instead of build. So the url is http://hudson_url/job/project_name/polling. This will poll your Mercurial repository and only if something really changed, the build will be triggered.
  2. Instead of setting up authentication I always use the TOKEN approach described on Remote access API, so the url gets http://hudson_url/job/project_name/polling?token=TOKEN

Using tokens you do not need to submit any authentication information. Bitbucket offers a POST service which you may use instead of the aforementioned hook. Github offers a similar service.

2010/05/29

Fun with Javascript for Hudson

Right now, I do not have a lot of experience with Javascript but after having seen some funny stuff done to our internal Bugzilla with a userscript (templates for bugreports patched into the comment field), I decided to give it a try. Sometimes jobs in our internal internal build servers (Hudson) will break over night because of full hard drives e.g. So we created a special view with all failed builds and a Hudson extension to build all jobs in a view.

Now I thought this could be easily accomplished with Javascript as well, so I read a little bit about YUI2, which is included in Hudson already and came out with my first Javascript extension, which I host on Bitbucket.
The source code:

  • I just save the script in the userContent folder of Hudson and source it in the description of the view like this:
    <script src="/hudson/userContent/hudson_extensions/he-all.js" type="text/javascript"></script>.
  • First, I attach the initialization with the help of the YAHOO.util.Event.onDOMReady to the point in time when the whole page is rendered, on my first tries I only collected the links already rendered up to the point where the script was included.
  • If any job build links are found (isBuildHref), I render a Build All link.
  • When hitting the link, I just iterate over the links (buildAll) and send an asyncRequest discarding the result by not specifying a callback function at all to trigger the actual builds.
Now I already can think of other useful stuff to do with this :-).

2010/05/22

Command-Tab - Blog Archive - How to Test RAM Under Mac OS X

After updating my Macbook from 2GBG to 4GB I ran Command-Tab - Blog Archive - How to Test RAM Under Mac OS X five times, as the the two blocks I have got first showed artifacts on the screen, now everything is running happily :-),

2010/05/08

Upgrading a 1&1 Dynamic Cloud Server from Ubuntu 8.04 LTS to 10.04 LTS

My first try following the instructions for Lucid was not successful, after shutdown -r now the Dynamic Cloud Server did not start up again. It is a pity that there is no serial console nor a Rescue or Repair-mode, so I gave it another try...

After loads of retries (new initialisation, waiting and another execution of do-release-upgrade --devel-release) I found the solution in the end:

  • While do-release-upgrade --devel-release updated dhclient I took the old configuration with static-route, see dhclient: classless static route, bug? as well.
  • As I had no second chance to boot without security, I removed apparmor (apt-get remove apparmor), maybe I will install this again after some research.
  • Most important: New Linux-Kernels include a new IDE-driver, which adresses former hda devices as sda, so I changed three things after the package update but before reboot:
    • In /boot/grub/menu.lst I replaced # kopt=root=/dev/hda1 ro console=tty0 console=ttyS0,57600 with # kopt=root=/dev/sda1 ro console=tty0 console=ttyS0,57600.
    • After that I called update-grub to update the configuration of grub.
    • In /etc/fstab I replaced all occurrences of hda with sda.

Now the server is up and running again :-)

What's this all about?

After having a german blog for some time I now decided to allow myself a second blog, where I will post about technical matters.