Posts – Page 13

Buildout: Best Thing Ever?

Taking a little bit of a time-out, I just have to ask the question: is Buildout not the best thing ever? (and the people who are so very kind to make the recipes?)

It’s made my work of managing our Plone infrastructure about 1000 times simpler since moving from Instancemanager (ughhh) and having to manually manage everything. I remember being a bit sceptical and very confused the first time I saw a buildout configuration file and thought that I’d never understand the thing.

Far, far from it of course! Whilst a little daunting at first, buildout has (in …

Plone: Google Calendar Integration

Wouldn’t it be great if you could somehow add your Event content item within the Plone CMS onto your Google Calendar with just a click? (it’d be better with fewer, but 1 click is pretty good - give me a break!)

Try this placed inside the event_view page template (customise it in the ZMI) after the vCal and iCal links:

<a href="#"
tal:attributes="href python:'http://www.google.com/calendar/event?action=TEMPLATE'
+'&text='+here.title
+'&dates='+here.start().toZone('UTC').ISO8601().replace('-','').replace(':','').split('+')[0]+'Z/'
+here.end().toZone('UTC').ISO8601().replace('-','').replace(':','').split('+')[0]+'Z'
+'&location …

Buildout: Trying to create a Plone/Zope instance

Eeek…what’s this mean?

install() got an unexpected keyword argument 'allow_hosts'

after trying to build zope2zeoserver from my buildout configuration.

After some searching, I found that it was due to my bootstrap.py script (the one the gets buildout in the first place and creates the relevant scripts) was actually pulling down an outdated version of zc.buildout. So, the problem results because this old version of buildout doesn’t have a clue how to handle the given argument.

Solution: update the buildout. For me, that meant correcting the bootstrap script, but for you, it could be a matter …

Buildout: Trying to build Pound

So, trying to build pound through a Buildout recipe was failing part of the way through.

Two problems and their solutions (not necessarily in that order):

  • Needed to install libssl-dev because lcrypto was missing (ambiguity anyone?) - Synaptic says that the package provides “libssl and libcrypto development libraries, header files and manpages” (but never mind a search for `libcrypto`…)
  • Had to correct the relevant user that the recipe was telling pound to build as.

The first point was pretty silly and the second one was just clearly my copy-and-paste mistake.

Ubuntu: Dual Monitors & Separating Tasks

Today’s puzzle: how to get Ubuntu (specifically GNOME Panels as it turns out) to use my new dual-monitor setup and show only the tasks from one monitor on that monitor’s panel. Sure, people had mentioned that it was possible (everywhere) but noone actually seemed to take the time to mention how. That’s when I found this: http://www.lloydleung.com/2006/10/14/gnome-multiple-monitor-taskbar-window-listing/ so cheers go to Lloyd there. Still works (and should be fine on any version from at least now on):

  1. Right click on anywhere on the launchbar, click “New Panel”
  2. Drag that to …

Plone: URL Encoding In A Script

So, for today’s problem, how can we get a URL (specifically the GET request arguments) suitably encoded? Easy, if we’re talking about a Python script that lives on the file system and can be used within Zope/Plone that way. But what about some sort of Python script that has to exist on the Plone site (specifically, creating a PloneFormGen (PFG) Custom Adapter)?

First thing I jumped to is urllib and urlecode: but no luck because you’re unauthorised to import the library in your script. Boo!

After much poking, and Googling for something that I thought should …

Linux: Graphics Card Woes & BIOS Issues

…and I had thought that installing a graphics card in a computer was as easy as opening the case, inserting the card, and booting the machine (then Xorg config etc). Well, to tell the truth, I just moved my HDD, peripherals (gfx card included) to a new box - now a Dell OptiPlex 755. But, it’s not that easy if you can’t boot your Ubuntu 8.10 OS!

The computer kept spitting this message out, even though it just worked a few days ago:

15.848000 NVRM: This PCI I/O region assigned to your NVIDIA device is invalid …

Plone: Correcting Page Template Errors Easily

Here’s how to correct pesky problems in your code/XHTML since the line number and column references are slightly useless in the ZMI.

Paste contents from a page or page template from the ZMI into a program like gedit and then the line and column reference numbers will be correct (once you remove the comment about the error from the top of the page).

Editing in the ZMI is a bit painful, but we persevere.

Plone: Varnish Configuration (Cache Hits, Purge Fails)

What a painful, painful day. It’s taken about the entire day, but I’ve finally figured out why our Varnish configuration around here for Plone/Zope hasn’t been accepting PURGE requests. Thus, without accepting purge requests correctly, any content that gets changed in Plone doesn’t get updated in the cache until it times out (or we restart it). Ouch - especially because it affects all sites under virtual hosting, and a lot of these sites have publicly visible content that needs to be available immediately.

So, the problem manifested itself as thus:

  • Cache hits happen
  • Performance was good …

Plone: Re-ordering Folder Contents

Ahhh, a new work week.

The first perplexing puzzle for the week was a seemingly silly idea (it still is) in Plone where it allows you to view the contents of a given folder in batches of 20. Now, combine this concept (which is good) with a concept of being able to re-order items within the folder (which is good too), you end up with not being able to move items between ‘batches’.

Troublesome. There’s nothing obvious that you can do aside from disabling your browser’s JavaScript and using the manual buttons. Nope: not feasible.

Try making your …