Re: [Zope] Zope database file grows when no one is modifying it

2007-10-19 Thread Thomas Bennett
On Friday 19 October 2007 11:12, Jonathan wrote:
> - Original Message -
> From: "Jamie O'Keefe" <[EMAIL PROTECTED]>
> To: 
> Sent: Friday, October 19, 2007 11:05 AM
> Subject: Re: [Zope] Zope database file grows when no one is modifying it
>
> > Any suggestions as to how to thwart such attempts besides requiring
> > user accounts for even the most minor edit and then remaining vigilant
> > about who get accounts?
>
> Not a zope-based solution, but how about using 'captcha' images if spambots
> are your problem?
>
> Jonathan
>
> ___
> Zope maillist  -  Zope@zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )

or for a Zope based solution (and if you have PIL and PIL fonts installed) 
use the following as an external method and stick the call to the method
inside your form.  Of course instead of putting the random number in a 
hidden field you could also write it to the current directory as a document 
and then get the value from the document when you process it, by the way
you have to create your code to verify the image number where ever you
process the form.  In the example below I compare cost to picnum.

There are also features in PIL to add effects to the image if you want
slant, swirl or anything.

Thomas

***

from PIL import Image,ImageDraw,ImageFont
import random
import os
from StringIO import StringIO
from OFS.Image import manage_addImage

# CREATED AUGUST 8, 2007 - Thomas Bennett
# REQUIREMENTS
#   PIL FONTS FROM http://effbot.org/pil/pilfonts.zip
#   PIL FROM http://www.pythonware.com/products/pil/

def random_number_image(self):

  #GENERATE A RANDOM NUMBER OF 5 DIGITS
  mynumtext = str(random.randrange(1,9,1))
  my_image_id = "number.jpg"

  #DEFINE FONT PATH AND NAME
  fontpath="/usr/lib/python2.4/site-packages/pilfonts"
  fontname="ncenB14.pil"

  # CREATE A TEXT IMAGE USING MYNUMTEXT
  textImg = Image.new('RGB',(75,25),(56,56,50))   # INSTANTIATE A 
NEW IMAGE (a dark gray box)
  tmpDraw = ImageDraw.Draw(textImg)   # DRAW THE IMAGE 
INTO TEMP
  textFont = ImageFont.load(os.path.join(fontpath,fontname))  # LOAD A FONT FOR 
THE IMAGE
  tmpDraw.text((15,1), mynumtext, font = textFont)# PLACE TEXT IN 
NEW IMAGE

  # PUT THE IMAGE INTO MEMORY AND SAVE IMAGE TO MEMORY
  imageFile = StringIO()
  textImg.save(imageFile,"JPEG")

  # IF THERE IS A NUMBER.JPG IN THE CURRETN DIRECTORY, DELETE IT SO UNDO WON'T 
BUILD UP
  if my_image_id in self.objectIds():
self.manage_delObjects([my_image_id])
  manage_addImage(self,"number.jpg",imageFile)

  # WRITE THE IMAGE AND FORM CODE TO THE PAGE
  text = '\n' %mynumtext
  text = text+'\n\nPlease enter the number pictured below.'
  text = text+'\n\n' %(my_image_id,mynumtext)
  return text

*



-- 

Thomas McMillan Grant Bennett   Appalachian State University
Operations & Systems AnalystP O Box 32026
University Library  Boone, North Carolina 28608
(828) 262 6587

They say a picture is worth a thousand words.  As videos could be 25 pictures 
per second and might last several minutes, how many words is that? 
- Linux Journal, July 2007

Library Systems Help Desk: http://www.library.appstate.edu/help/

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Zope database file grows when no one is modifying it

2007-10-19 Thread Jonathan


- Original Message - 
From: "Jamie O'Keefe" <[EMAIL PROTECTED]>

To: 
Sent: Friday, October 19, 2007 11:05 AM
Subject: Re: [Zope] Zope database file grows when no one is modifying it


Any suggestions as to how to thwart such attempts besides requiring
user accounts for even the most minor edit and then remaining vigilant
about who get accounts?


Not a zope-based solution, but how about using 'captcha' images if spambots 
are your problem?


Jonathan

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Zope database file grows when no one is modifying it

2007-10-19 Thread Jamie O'Keefe
Thank you Andreas and Martijn,

I checked the root undo log and that pointed me to to the problem.  It
proved to be spammers on one of our under used public boards.  Problem
solved for now.

Any suggestions as to how to thwart such attempts besides requiring
user accounts for even the most minor edit and then remaining vigilant
about who get accounts?

Thanks!

Jamie
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Zope database file grows when no one is modifying it

2007-10-19 Thread Thomas Bennett
Well first, is it actually Data.fs that you see growing or are you just seeing 
less disk space from a reporting tool, you just said the "Zope site has 
filled up".  If it is not Data.fs then look at the size of your logs, often, 
and which one is growing fastest and how big is it.  Also, do you have an 
external service that connects to your Zope site to upload any kind of data?  
I've had this happen with a video camera that I had ftp-ing a jpeg every 10 
seconds to the server, it didn't take long to fill up the undo list so fast 
that Zope stopped serving because Zope couldn't add to the log file, thank 
goodness for datafspack.py (I think that was the name of it).

Thomas


On Friday 19 October 2007 01:32, Jamie O'Keefe wrote:
> I am administering a Zope/CMF site running Zope 2.6.4 with python
> 2.2.3.  We have been running low on space and have not been able to
> clean out the database of old edits.
>
> We are moving other sites over to a new server and were able to free
> up about 3GB.  Unfortunately, our main Zope site has filled up most of
> that space quite rapidly.  We haven't edited it much so it is unclear
> why it is growing so quickly.
>
> What might be amiss?
>
> Thanks!
>
> Jamie
> ___
> Zope maillist  -  Zope@zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )

-- 

Thomas McMillan Grant Bennett   Appalachian State University
Operations & Systems AnalystP O Box 32026
University Library  Boone, North Carolina 28608
(828) 262 6587

They say a picture is worth a thousand words.  As videos could be 25 pictures 
per second and might last several minutes, how many words is that? 
- Linux Journal, July 2007

Library Systems Help Desk: http://www.library.appstate.edu/help/

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Zope database file grows when no one is modifying it

2007-10-19 Thread Martijn Pieters
On 10/19/07, Jamie O'Keefe <[EMAIL PROTECTED]> wrote:
> We are moving other sites over to a new server and were able to free
> up about 3GB.  Unfortunately, our main Zope site has filled up most of
> that space quite rapidly.  We haven't edited it much so it is unclear
> why it is growing so quickly.

You may have code that writes to the ZODB on access, not just when
someone edits content explicitly. Check the undo log in the ZMI and/or
enable trace logging to trace such code.

-- 
Martijn Pieters
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Zope database file grows when no one is modifying it

2007-10-18 Thread Andreas Jung



--On 19. Oktober 2007 01:32:11 -0400 Jamie O'Keefe 
<[EMAIL PROTECTED]> wrote:



I am administering a Zope/CMF site running Zope 2.6.4 with python
2.2.3.  We have been running low on space and have not been able to
clean out the database of old edits.

We are moving other sites over to a new server and were able to free
up about 3GB.  Unfortunately, our main Zope site has filled up most of
that space quite rapidly.  We haven't edited it much so it is unclear
why it is growing so quickly.


The ZODB does not fill up by itself. Check your undo logs for recent
transactions.

-aj

pgpoVDXS72938.pgp
Description: PGP signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Zope database file grows when no one is modifying it

2007-10-18 Thread Jamie O'Keefe
I am administering a Zope/CMF site running Zope 2.6.4 with python
2.2.3.  We have been running low on space and have not been able to
clean out the database of old edits.

We are moving other sites over to a new server and were able to free
up about 3GB.  Unfortunately, our main Zope site has filled up most of
that space quite rapidly.  We haven't edited it much so it is unclear
why it is growing so quickly.

What might be amiss?

Thanks!

Jamie
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )