Tuesday, October 31, 2006

Getting an external timer working for cerberus was a lot harder then it should be, especially since the procedures in the install instructions just plain don't work :-)

This is for version 3.2.1 Release (Build 324)

I tried the wget approach, no luck :(

I tried the php approach (btw typo for C:\php\php.exe C:\wwwroot\inetpub\cerberus-gui\cron.php ) the path should be c:\inetpub\wwwroot\) but I would always get, this IP is not authorized to run the schedule, even though I had added 127.0.0.1, tried other masks etc..) :(

So.. the way I finally did get it to work is using the windows port of lynx from here http://www.pervalidus.net/cygwin/lynx/ (at the bottom)

I set up a windows task using "C:\Program Files\lynx\lynx.exe" --dump http://localhost/cerberus-gui/cron.php?verbose=1

with a start in: "c:\program files\lynx\"

You also of course need to set it to external timer in configuration -> scheduled tasks and you also need to add the getmail scheduled task and make sure it is enabled.

Hope this helps someone else out there!

Saturday, October 21, 2006


This is a picture of the caulk monster, this beast is to keep the shower from leaking as much....

scary, i know

Tuesday, October 17, 2006

You need google desktop search! and really for only one reason, its opens up a quick search window that you can launch any app from!

Friday, October 13, 2006

I wanted to create a program that would take a whole bunch of files and then create folders based off of the created date in year/ month/ day format. Here it is. Most is based off of
http://www.daniweb.com/code/snippet451.html

# retrieve the file information from a selected folder
# sort the files by last modified date/time and display in order newest file first
# tested with Python24 vegaseat 21jan2006

import os, glob, time

# use a folder you have ...
root = 'c:\\test\\' # one specific folder
#root = 'D:\\Zz1\\*' # all the subfolders too

print '-'*60 # just vanity

date_file_list = []
for folder in glob.glob(root):
print "folder =", folder
# select the type of file, for instance *.jpg or all files *.*
for file in glob.glob(folder + '/*.*'):
# retrieves the stats for the current file as a tuple
# (mode, ino, dev, nlink, uid, gid, size, atime, mtime, ctime)
# the tuple element mtime at index 8 is the last-modified-date
stats = os.stat(file)
# create tuple (year yyyy, month(1-12), day(1-31), hour(0-23), minute(0-59), second(0-59),
# weekday(0-6, 0 is monday), Julian day(1-366), daylight flag(-1,0 or 1)) from seconds since epoch
# note: this tuple can be sorted properly by date and time
creation_date = time.localtime(stats[9])
#print image_file, lastmod_date # test
# create list of tuples ready for sorting by date
date_file_tuple = creation_date, file
date_file_list.append(date_file_tuple)

#print date_file_list # test

date_file_list.sort()
date_file_list.reverse() # newest mod date now first

print "%-40s %s" % ("filename:", "Creation Date:")
for file in date_file_list:
# extract just the filename
folder, file_name = os.path.split(file[1])
# convert date tuple to MM/DD/YYYY HH:MM:SS format
file_date = time.strftime("%m_%d_%y", file[0])
year_date = time.strftime("%Y", file[0])
month_date = time.strftime("%m", file[0])
day_date = time.strftime("%d", file[0])

print "%-40s %s" % (file[1], file_date)
print year_date
print month_date
print day_date

DateDir = 'c:\\DateTest\\'+ year_date + '\\' + month_date + '\\' + day_date
if not os.path.isdir(DateDir): #check whether the dir exists, if not create it
os.makedirs(DateDir)

print "xcopy /Y /F " + '"' + file[1] + '" ' + DateDir

os.popen("move /Y " + '"' + file[1] + '" ' + DateDir).read()
Went looking around for how to get the date of yesterday in python. Here are two ways...

from time import gmtime, strftime

#Get yesterdays date and time (from http://www.thejackol.com/2005/07/01/yesterdays-date-in-python/)

now = time.time()
today = time.localtime(now)
yesterday = strftime('"%a-%m/%d/%Y"',time.localtime(now - 60*60*24))

or

import datetime
now = datetime.datetime.now()
one_day = datetime.timedelta(hours=24)
yesterday = now - one_day
print strftime('"%a-%m/%d/%Y"',yesterday.timetuple())