Embedding JavaScript in Python

Reading some posts about embedding languages/runtimes in applications on Planet GNOME reminded me I still had to announce some really quick and incomplete code blob I created some days after last GUADEC edition (which was insanely cool, thanks guys).

It takes WebKit’s JavaScriptCore and allows you to embed it in some Python program, so you, as a Python developer, can allow consumers to write plugins using JavaScript. Don’t ask me whether it’s useful, maybe it’s not, but anyway.

There’s one catch: currently there is no support to expose custom Python objects to the JavaScript runtime: you’re able to use JavaScript objects and functions etc. from within Python, but not the other way around. I started working on this, but the JSCore API lacked some stuff to be able to implement this cleanly (or I missed a part of it, that’s possible as well), maybe it has changed by now… There is transparent translation of JavaScript base types: unicode strings, booleans, null (which becomes None in Python), undefined (which becomes jscore.UNDEFINED) and floats.

I did not work on the code for quite a long time because of too much real-job-work, maybe it no longer compiles, sorry… Anyway, it’s available in git here, patches welcome etc. I guess this is the best sample code around. It’s using Cython for compilation (never tried with Pyrex, although this might work as well). If anyone can use it, great, if not, too bad, I did learn Cython doing this ;-)

VirtualBox launch script

I’ve been playing around with VirtualBox some more today (more on it, and other virtualization related stuff might follow later). I got a Windows XP instance running fine (and fast!) in it. Still got some issues (shared folders seem not to work when logged in as a non-administrator user in XP, although I tend to blame Windows for this issue, not VirtualBox), played around with a little Linux installation acting as an iSCSI target for its virtual block devices, accessing them from Windows using the Microsoft iSCSI initiator, etc. Here’s a screenshot of all this.

I added a launcher for my Windows VM to my panel, which was simply running ‘VBoxManage startvm <VM UUID>’. This was not an optimal solution though, as I wanted it to show a little error dialog when something went wrong when attempting to launch the VM (eg because I forgot it was already running), when the virtual disk files aren’t accessible (because I forgot to mount the volume they reside on), etc.

So I cooked a little script which runs some sanity checks before launching the virtual machine, and reports any errors. Here it is:

Continue reading »

Massive 70000 workstation Ubuntu deployment in France

After switching to OpenOffice in 2005 and introducing Mozilla Firefox and Thunderbird on their machines in 2006, the French paramilitary police (’Gendarmery’) will make the switch to 100% Free Software based desktops in the coming years. The migration should be completed in 2014.

All workstations will be converted to Ubuntu desktops, starting this year with 5000-8000 seats, growing to 12000-15000 over the next four years. By 2014, all 70000 (!!!) desktops should be running free software.

There are three major reasons for the full switch:

  1. Remove dependency on one single supplier
  2.  Gain full control over the whole operating system stack
  3. Reduce costs

Nowadays licensing costs sum up to 7000000€ (that’s seven million euros) every year.

I guess this must be one of the largest Linux desktops deployments ever?

Source: AFP

KDE4 reviewed

I’ve been able to download the KDE4 LiveCD by now, so I wanted to give it a test ride and write a basic KDE 4 review. These are my findings. I first and foremost want to stress I do not ever want to attack, offend or whatever anyone in this post (as reactions of vocal users on posts like these can be fierce sometimes ;-)). These are my findings, both positive and negative.

One reason to read this until the end (in case you wouldn’t ;-)):

KDE 4.0 Button Overflow

At first bootup the OpenSuSE bootsplash theme attracts your attention. I really like it, very smooth.

After a successful bootup (using VirtualBox virtualization) the KDE desktop starts. This takes a while, but this can be blamed on the use of a LiveCD, and a virtual machine. The splash screen is very clean, the use of black and rounded corners reminds me of Apple OS X a little, don’t ask me why. The icon animation is nice, although I think the transparency shouldn’t go all the way to completely transparent (at least, that’s what it looks like), an maybe it should change somewhat slower. Next to this, the last icon in row (the KDE icon) is much bigger than the others, which doens’t look nice. Anyway, minor details.

Once booted, the user is presented with his desktop and a ‘Useful Tips’ dialog:

KDE 4.0 First login

Continue reading »

Pages: 1 2 3 4 5 6

KDE4 released: more Free Desktop progress

KDE4 was released today. Most likely not a big surprise for most readers, but hey ;-) Congratulations to the KDE team!

I’d love to give KDE 4 a test-run asap, been trying to download the LiveCD ISO to boot it in my VirtualBox virtual machine, but the torrent is extremely slow here. Maybe my ISP also implemented BitTorrent bandwidth capping as iirc some others did in Belgium, which is completely unfair as this is, obviously, 100% legal content. Some of the screenshots I saw both during development phases and today do look pretty cool, especially taking into account I’m not a big fan of the KDE3.x look. I’m still a little afraid the bottom panel is very high (just like the KDE3.x one), which removes quite a lot of my precious display size… A 14.1 widescreen laptop isn’t thát big, using GNOME I only loose 2×21 pixels.

One thing made me wonder: Plasma, Solid, Phonon, Dolphin, Okular, Akonadi, Oxygen,… Where’s the K* guys? ;-)

I remember some really long and heated threads on GNOME 3 (Project Topaz, which I still consider to be a great name) some months ago, maybe those should be revamped too, to keep the vibe alive :-)

Last couple of years have been very interesting Free Desktop-wise: we got more integration of system components, very flashy UI stuff, great new iconsets and themes, more stabilization of desktop components, several great and innovative new applications,… PDE (Perfect Desktop Environment) doesn’t exist yet (most likely it never will… does such a thing exist, after all?) but current projects are progressing very nicely, each with their proper strengths, targeted user base and features, which can only be applauded and stimulated. Keep on rocking, all of you, so the years ahead of us will be even more surprising, creative, constructive and fun!

Nokia 6300 SyncML follow-up

Last couple of days I’ve been trying to get SyncML up and running on my new Nokia 6300 cellphone, as it wasn’t working before. I’ve been collaborating with the main libsyncml author to figure out what’s going wrong, but no success, although there is a report of someone who did get it working.

The phone firmware is broken though, that’s pretty sure. As you can read in the bug report, he had to sync the phone in Windows using the Nokia PC Suite, before it wanted to work using libsyncml. Next to this, authentication had to be enabled on the phone before it wanted to sync.

It looks like I’m not the only person who got issues though: even the official Nokia software under Windows refuses to work (”PC Sync has encountered a problem and has terminated the synchronisation“, “Data transfer not possible“) for several users. There are reports of SyncML working in iSync, although this needs an external “plugin”. Luckily I was able to make a complete phone backup using the PC suite. This, and all other suite features, except sync, seem to work fine.

Anyway, libsyncml traces, obex data dumps or logs of the data sent and received by the official client under Windows (by snooping USB data) didn’t provide any solution, yet.

The fact synchronization doesn’t work is a killer bug if you ask me: I bought this phone to be able to sync, otherwise I’d have settled with some basic model at half the price (like my old 3100).

One more issue: I configured the built-in email client to fetch mails from my IMAP server using an SSL connection. When trying to sync my mails, the client errors out though, as my (self-signed) server certificate can’t be validated. I checked the phone’s manual, but there’s nothing regarding CA keys in the phone’s trust list, nor could I find it myself…

It would be really nice if, in some new version of the firmware (next to fixing the SyncML issues) the contact list would be somewhat better integrated with other applications:

  1. Allow sending emails to contacts or browsing to the webpage of contacts from within the contacts application. Currently you can only view the addresses, if set, but there’s no way to launch the email client or browser application with the given address.
  2. Integrate calendar and contact birthday information: you can set the birthday of contacts, but these are not displayed in the calendar, whilst the latter one does allow you to add birthdays. I guess nobody wants to add all contacts manually in his calendar application too…

So, if you happen to know some people working on series40 firmware, please point them to these issues, thanks ;-)

Filesystem issues and django-couchdb work

Last night, when shutting down my laptop (which had been up for quite a long time because of suspend/resume niceness), it crashed. I don’t know what exactly happened: pressed the GNOME’s logout button, applications were closed, until only my background was visible, then the system locked up, so I suspect my X server (some part of it, GPU driver (fglrx) might be the bad guy). I was able to sysrq s u o, so I thought everything would be relatively fine.

This morning I powered on my system, and while booting, fsck of some partitions was taking a rather long time. It’s pretty normal fsck was taking somewhat longer, but not thát long… I’m using JFS on most logical volumes.

When the consistency check of my /home partition was done, a whole load of invalid files was displayed and later on moved to lost+found: 34068 files. Once booted, I scanned my filesystems again, rebooted, logged in, started X. Everything started fine, until I launched Evolution: it presented my the ‘initial run’ wizard. Other issues (on first sight): all Firefox cookies were gone, and Pidgin’s blist.xml was corrupted. When using my old computer (which had frequent lockups on heavy IO usage) these last 2 issues happened a lot too, which is highly annoying, especially the blist.xml thing as I can’t see any reason to keep this file opened for long periods?

Luckily I was able to get my Evolution up and running again by restoring it’s GConf settings and ~/.evolution using some old backup (15/10/07). I guess I should backup more regularly… Next to this I hope I won’t find any other corrupted files, so the ones in lost+found are just Evolution email files and Firefox caches.

Anyway, here’s a screenshot displaying some of the initial and hackish work I’ve done this evening on integrating Django and CouchDB as I wrote about yesterday:

Django and CouchDB first shot

As you can see, currently I’m able to edit fields of an object. There’s one major condition: an object with the given ID should already exist in the ‘database’ which makes the current code rather useless, but hey ;-) I’ll add object creation functionality later tonight or tomorrow.

Current code is very expensive too, doing way too many queries to CouchDB, mainly in client.py. This most certainly needs work.

Upgraded my WordPress installation to the latest release, 2.3.2, in about 5 seconds. Got to love svn switch (although maybe I should start using git-svn for this installation too and git-pull the release branch in my local copy).

First bug report ever

Yesterday I came across my (most likely, as far as I can remember) very first bug report ever, here, filed on the 16th of november 2002. A bug in Mandrake 8.2 (kernel 2.4.18, XFree86 4.2.0, KDE 3.0RC2) because of which I was unable to use my mouse in X. The machine was an Acer Pentium1 166MHz with 40MB of RAM inside and an S3Virge video adapter.

This was not my first Linux experience: my first installation ever, on the same machine, was using a SuSe sample CD my dad got at Cebit2000. This was an evaluation copy of SuSe 6.4, providing kernel 2.2.14, XFree86 3.3.6 and KDE 1.1.2 (well, I can’t remember, that’s what the web tells me now).

Compared to those days (although not that long ago) installing and (especially) using a Linux desktop nowadays could be called somewhat easier :-)

So, have you got any memories of your very first Linux install or a reference to your earliest bug report?