Morphex's blogologue (Life, technology, music, politics, business, mental health and more)

This is the blog of Morten W. Petersen, aka. morphex in various places. I blog about my life, and what I find interesting and/or important. This is a personal blog without any editor or a lot of oversight so treat it as such. :)

My email is morphex@gmail.com.

An OGG/Vorbis player, implemented in Javascript.

My Kiva bragging page
My shared (open source) code on GitHub

Morphex's Blogodex

News
Slashdot

Zope hosting by Nidelven IT

Morten Petersen on Linkedin

Morten Petersen on Facebook

Morten Petersen on SoundCloud

Morten Petersen on MixCloud

Blogologue on Twitter



Older entries



Atom - Subscribe - Categories

Facebook icon Share on Facebook Google+ icon Share on Google+ Twitter icon Share on Twitter LinkedIn icon Share on LinkedIn

Two quick hits

Recently I ran into a couple of .. issues where customers had either made mistakes or couldn't figure out things.

These were issues that I had run into earlier so being slightly annoyed (itch) I decided it was time to do something about it (scratch).

The first was a customer who managed to run a link-checker on their Plone site, and having the link-checker be logged in, which wrecked havoc as a lot of things in Plone can be done by clicking links. So they had well over a thousand transactions done in the course of 4-5 hours. Restoring from backup would've been simple enough but some important changes had been made prior to this "bot attack" so I didn't see reverting to backup as an option.

This is something that has been a problem earlier as well, so I decided to dig a bit into the undo machinery of Zope to see if it could be fixed. And there, after reading a little bit of code I could see that it would be possible to undo things based on a date. So I wrote up a tool in a couple of hours to test this theory and to my pleasurable surprise it worked.

The product-ified version of this fix can be found here

  http://products.nidelven-it.no/undoer

it should probably be a part of the Zope core distribution (it's an obvious, useful feature) but I'm too lazy to get it submitted. If someone wants to do it, feel free to do so - I'll slip it under the ZPL or something similar.

Another thing that bugged me was a customer that was using up a lot of diskspace (itch) (which we would have to charge for) but they claimed they weren't adding large objects to the database. So, fair enough - this is something I've dealt with before and I got another idea: use the database export feature to get a readout on which objects in the database were using the space (scratch); the result is here:

  http://products.nidelven-it.no/spaceman

a rather cool hack in my opinion, which uses a dummy file to get a count on which objects are taking up space. Turns out something in the customer's system was writing transactions (and often) so a database pack discarding *all* old transactions was all that was needed.

Now, it would be interesting (and fairly easy) to see what's writing all those transactions as well, but that's one for later.

[Permalink] [By morphex] [Zope (Atom feed)] [13 Mar 19:31 Europe/Oslo]