Older blog entries for wtanaka (starting at number 17)

Serializing to JSON with Google App Engine

from django.utils import simplejson

Then: http://simplejson.googlecode.com/svn/trunk/docs/index.html

To create a Google app engine custom 404 page, add a handler that matches everything as the last handler:

(r'.*', DefaultHandler),

And somewhere in that handler, call self.error(404)

Google App Engine WSGIApplication for Drupal Users:

(r'/path(?:/(.*))?', HandlerClass),

registers HandlerClass for URLs of the form:


/path
/path/
/path/something
/path/something/else

But not:


/pathfoo

HandlerClass get method should then start with:


   def get(self, args):
      if args is None:
         args = ""

printf debugging in GreaseMonkey without the modal dialog box of alert():

  • You can use GM_log, which logs messages to the Error Console.
  • With the Firebug extension, you can do e.g. console.log("Link: %o", document.links[0]) to log messages and inspect elements. Don't forget to remove the Firebug code before distributing the script.
  • You can use dump() statements to print debugging info to the Firefox console.
  • You can set window.status = message_string, understanding that the status bar text is transient: many other processes within Firefox set it.
21 Mar 2008 (updated 21 Mar 2008 at 09:16 UTC) »

Firefox 2 font configuration in Fedora 8 Linux does not come from GNOME font settings. If you have, at some point turned on sub-pixel font rendering for your LCD in Firefox and want to turn it off because the colors around the edges of the letters are ugly (or if you want to turn it on because you think it looks better), the settings are located in ~/.fonts.conf

The default subpixel font setting is off, so to turn off subpixel rendering in firefox (and reset all the other settings to defaults), one can simply delete ~/.fonts.conf

This also works for seamonkey

12 Nov 2007 (updated 12 Nov 2007 at 14:39 UTC) »

Was getting a lot of

[Errno 12] Timeout: <urlopen error timed out>

with yum. Went into /etc/yum.conf and added a line:

timeout=120

documentation was in man page yum.conf(5).

That helped a bit, but fetching mirrorlists was still giving the Errno 12 timeout error almost instantly. Worked around that by just pointing the yum.repos.d entries at a particular mirror. Probably some bad interaction with going through tor/privoxy (necessary to work around some recent china telecom auto-blocking)

Turning on kernel support for packet forwarding to do IP Masquerading/NAT in Linux (Fedora 7) can be done with:

echo 1 > /proc/sys/net/ipv4/ip_forward

But it can also be done by putting the line

net.ipv4.ip_forward = 1

in /etc/sysctl.conf

16 Jun 2007 (updated 16 Jun 2007 at 03:44 UTC) »

Was looking for my note about the new mysql 5 join syntax just now, but couldn't find it because I was searching for "syntax", which wasn't in the post. =P I can never remember if the manual's suggested replacement syntax for the comma is JOIN or INNER JOIN

problem: gnucash-bin: error while loading shared libraries: libgtkhtml-3.8.so.15: cannot open shared object file: No such file or directory

solution: sudo yum -y install gtkhtml38

problem: gnucash-bin: error while loading shared libraries: libgsf-gnome-1.so.114: cannot open shared object file: No such file or directory

solution: sudo yum -y install libgsf-gnome

problem: ERROR: In procedure open-file: ERROR: No such file or directory: "/usr/share/guile/1.8/slib/require"

solution: sudo yum -y update slib

8 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!