Generating Faults in Pylons XMLRPCController

This might seem easy enough, but it took me a while to get it right since the Pylons documentation is a bit misleading here, really. It says you should use xmlrpc_fault from pylons.controllers.xmlrpc but that’s actually not working if you’re doing something like:

Python
1
2
3
from pylons.controllers.xmlrpc import xmlrpc_fault
...
return xmlrpc_fault( 101, "My Error" )

This will wrap an xmlrpclib.Fault into a pylons.controllers.util.Reponse object which will fail to marshal with something like:

Python
1
2
TypeError: cannot marshal <class 'pylons.controllers.util.Response'> objects
</class>

The correct way to do it is:

Python
1
2
3
import xmlrpclib
...
return xmlrpclib.Fault( 101, "My Error" )

Django on Windows

To more easily use Django on Windows, create a dos .bat file in Django’s bin directory named django-admin.bat with the following content:

1
@%~dp0\..\..\..\..\python.exe %~dp0\django-admin.py %*

and add Django’s bin directory to your PATH:

1
2
set DJANGO_HOME=C:\Development\tools\Python25\Lib\site-packages\django
set PATH=%DJANGO_HOME%\bin;%PATH%

You can now use django-admin from anywhere without specifying the full path.

(I kept getting ImportError: No module named django.core when trying to invoke django-admin.py from the commandline)

Multiple Many-to-Many in Grails

Creating many-to-many relationships in Grails is quite simple. It is also possible to have multiple many-to-many relationships in a single class, but for some reason I found little documentation on how to do this. It is actually quite simple once you know how to and pretty much comes down to syntactic sugar, so to speak. Read more after the break.

Continue reading

Making Bugzilla run on Windows with XAMPP

I was struggling a bit with making Bugzilla 2.2 work on my Windows XAMPP. I kept getting error about child processes not being able to start. The logs said this:

[Mon Jul 05 09:04:38 2010] [error] [client 127.0.0.1] (OS 3)The system cannot find the path specified. : couldn’t create child process: 720003: index.cgi
[Mon Jul 05 09:04:38 2010] [error] [client 127.0.0.1] (OS 3)The system cannot find the path specified. : couldn’t spawn child process: C:/xampp/htdocs/bugzilla/index.cgi

Continue reading

Installing Ubuntu 10.04 Server 64bit via USB Pendrive

After struggling with installing Ubuntu Server 10.04 from a bootable usb stick, here are some hints in case anyone else ever wants to do this. My problem was that the Server Installer kept trying to load files from the CD and could not find them, which made the installation fail. I actually wonder why it could not find anything because it was apparently looking in the right places (i.e. the USB stick mounted under /cdrom). Feel free to enlighten me.
Continue reading

Flashing PR 1.2 to the N900 from Ubuntu 10.04 64bit

To install flasher, do

Shell
1
sudo dpkg -i --force-architecture maemo_flasher-3.5_2.5.2.2_i386.deb

afterwards, install ia32-libs from multiverse:

Shell
1
sudo apt-get install ia32-libs

Before installing ia32-libs flasher kept telling me this:

Shell
1
2
ubuntu@ubuntu:~/Desktop$ flasher-3.5
bash: /usr/bin/flasher-3.5: No such file or directory

Now, to flash PR1.2 and the vanilla eMMC content, issue the following two commands:

Shell
1
2
sudo flasher-3.5 -F RX-51_2009SE_10.2010.19-1_PR_COMBINED_MR0_ARM.bin -f
sudo flasher-3.5 -F RX-51_2009SE_10.2010.13-2.VANILLA_PR_EMMC_MR0_ARM.bin -f -R

This will flash and reboot after flashing the eMMC contents.