Posts – Page 6

ImportError: No module named BeautifulSoup

Had this issue when you’ve been trying to run something like Funnelweb, and you hit an ImportError for BeautifulSoup?  You’re definitely not alone, because I just hit the same issue.  The answer is simple — just ensure that you don’t use BeautifulSoup 4 or above (this is still beta) — it uses a different namespace, specifically bs4. Thus, whilst you might have the BeautifulSoup egg satisfying your dependencies, any imports of this package are going to fail.

For me, I’m using buildout, so I just pinned my version of BeautifulSoup thusly:

[buildout]
...
versions = versions

[versions]
BeautifulSoup = 3.2 …

Watch out: Python 2.4 ZEO client and Python 2.6 ZEO Server

Today was interesting when an issue with saving content on a Plone 3.3.5 site got reported to me. The system was producing undecipherable error messages about ZEO disconnections and database conflicts whenever someone would try and create some content within Plone (folders, particularly). Errors looked like:

Module ZEO.zrpc.connection, line 796, in wait. DisconnectedError" and "raise ReadConflictError().
ReadConflictError: database read conflict error"

and also:

ERROR ZEO.zrpc (2515) can't decode message: '(K\x11K\x01U\tserialnos(]((U\x08\x00\x00\x00\x00\x00X\x...'

— essentially the issue described here. My ZEO server was running ZODB3 3.9.5 …

Extracting a Buildout versions.cfg from a Zope instance script

Today, I needed to migrate some legacy Plone installs set up using Buildout. If I were to simply move the buildout files and re-run buildout, I’d end up with the latest versions of add-on products - and since I’m using legacy versions of Plone 3, that’d almost certainly break the system.  I do know about the Buildout extension buildout.dumppickedversions (which does what its name suggests and exports picked versions of eggs) but I can’t re-run buildout to get this extension for risk of updating existing products (what I’m trying to avoid!).

The good news is …

Building Cherokee RPMs on RHEL 6 (x86_64)

Cherokee is a fast web server and something I’m looking at using instead of my current Apache installs in order to squeeze a bit (lot) more juice out of my web services.

You can easily install Cherokee via its automated scripting and that’s really useful.  Unfortunately, since I’m within a RedHat environment, init scripts and other useful aspects that come packaged with Apache don’t get installed when installing from source. Now, there’s a lot of activity regarding installing the latest packages for Ubuntu, but not much of anything recent for RHEL (current Cherokee is 1 …

How to: Updating OCZ Vertex 3 SSD Firmware (on a Dell M1530 laptop)

Note

Update 3: This guide is effectively now entirely outdated with regards to the available tools. I’ve gone back to simply using a Windows boot disk to handle the firmware upgrades, although they’ve gotten less frequent as of late.

I’ve just shelled out a good chunk of money in buying an OCZ Vertex 3 240GB solid state drive (SSD) and it’s amazingly quick. So amazingly quick that I thought I may just have fallen into a coma when I had to temporarily switch back to my old mechanical hard drive and boot from it again. And …

Putting a NASA Human Space Flight Sightings RSS feed into your calendar program

I stumbled upon NASA’s space sightings page a little while ago. For those of you that don’t know, it’s a great site that lists opportunities to view satellites that will be visible in your location and when/where to look to see them. Amongst the fact this service exists and is free, I was amazed (and thankful!) that it actually lists lots of different locations, one of which is where I like in regional Australia.

It’s a great setup and they offer an RSS feed for each location which keeps you updated. That’s great, but …

Can’t run Plone/Zope buildout on Ubuntu 11.04 after upgrade from 10.10

After upgrading from Ubuntu 10.10 (Maverick Meerkat) to Ubuntu 11.04 (Natty Narwhal), you’ll probably find that if you’re running a Plone 4 buildout where you need to upgrade the Plone version, that compilation of Zope will fail. The output will look something like this:

Getting distribution for 'Zope2==2.12.17'.
In file included from src/AccessControl/cAccessControl.c:51:0:
include/ExtensionClass/ExtensionClass.h:83:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: Setup script exited with error: command 'gcc' failed with exit status 1
An error occured when trying …

Ubuntu 11.04 boot freezes with 2.6.38-8-generic-pae kernel

So you’ve just installed 32-bit Ubuntu 11.04 (Natty Narwhal), and in my case, upgraded from Ubuntu 10.04 (Maverick Meerkat).  The upgrade process seemingly went fine and then you were asked to restart your computer.  You diligently do so, only to come back to find that your computer has frozen at GRUB2 upon trying to boot the 2.6.38-8-generic-pae kernel from the GRUB list.  Now what?  How do you fix this?

The issue appears to stem from some form of installation issue where this new kernel isn’t set up right.  Note: I don’t actually know …

Disabling caching for sensitive web pages (aka how to prevent logged out users going ‘back’)

We all see web pages like Internet banking, HR systems, email, and more that allow you to log in, do something and load pages, log out, and then prevent you from using your browser’s history to see that sensitive information.  I’m amazed that in my searches I couldn’t quickly find a definitive source of information on how to achieve this.  Pages across the web in a search for ‘stop caching’ range from blog posts, to forum posts, to other pages, and people asking the question (try it: here, or maybe here).

Maybe I got unlucky, but finding …

Increasing Plone’s session timeout

What you may notice if you’re developing with Plone/Zope, is that if you’re storing small pieces of data within Plone’s session variable (the session_data_manager tool), data expires after a few minutes.  By default, this timeout is 20 minutes, but is far too short if you’re expecting the information stored to last for say the whole time a user is logged in.  In this situation, you’ll need to increase the timeout.

Documentation on changing the session timeout is potentially a little sketchy (Google “session-timeout-minutes zope”), but it’s clear that you need to change the …