Error 

Archive for July 7th, 2006

AIM Pains

Posted July 7, 2006 at 10:07pm in Computers

Over the years I have aquired a variety of online accounts. My Keepass database says I have 282, but I have text files all over the place with probably another 50 accounts. Yeah so I went a little overboard…. Thankfully I have KeePass to help me keep track of all of them. One of the tasks I am working since my return to Virginia is keeping a record of what email addresses go with each account, which has quickly made me decide to have some of these accounts removed from company databases. Sure I could just delete them from Keepass, but then one day I would say to myself, “Man I wish I could remember the login for that account”.

Heading over to AIM seemed like a good start, well I fell right into the “F’n moron’ category on that one, scratch that, I JUMPED IN. I just spent the last 10 minutes looking for a way to contact someone for AIM. I can report errors and security problems, but I can’t even write them and say how pleased I am that they dont provide proper contact information on their website. I should write them and say that I found a huge error with AIM, I CAN’T EMAIL ANYONE!! So if anyone wants another AIM account, leave a comment. I’m done.

Filling in the gaps of Windows Task Scheduler

Posted July 7, 2006 at 08:07pm in Computers

Anyone who has ever needed to schedule a task in windows has either been restricted to once a day (unless you create multiples) or they have an application running in their system tray that has its own little features to help bloat the code and memory usage. If you have ever used Unix/Linux you know cron has all the features that Task Scheduler needs. There are a few applications out there, but most I have tried just don’t cut it. Well thanks to Gerhard Kalab, there is pyCron. When you install pyCron it will install the files in the directory of your choice and also install a system service, which you can then change to run manually or automatically. Before you can really start you need to rename crontab.txt.sample and pycron.cfg.sample, just remove .sample. The next step is to open the pyCronEditor.exe. In the image below you can see how easy it is to add, edit, and remove entries. I have removed entries from mine, your install will show a number of samples for you to use.

pyCron Editor

This image also shows that by pressing the Wizard button next to minute you can select how often you would like it to run. You can select only 2 so that it runs on the second minute of every hour or hit every 5 and it will have it run the cron every 5 minutes.

Now if you are not familiar with crontab files the next section is going to be a little confusing. Basically you have a plain text file with lines defining what actions cron should take and when to take them.

Example 1: This line tells cron to execute RUNIT.bat every hour with the command parameter ‘testme’

0 * * * * "C:\\cron\\RUNIT.bat" testme

Example 2: Lets say you would like to have RUNIT.bat execute every 20 minutes, but only on friday.

0/20 * * * Friday "C:\\cron\\RUNIT.bat" testme

Each space seperates the definitions of the action:

Column 1: Minute
Column 2: Hour
Column 3: Day
Column 4: Month
Column 5: Day of Week (you can change this to 0-6 in the .cfg)
Column 6: Command
Column 7: Command Parameters

I realize I am not going into great detail on all of the different ways you can configure an action, maybe I will write a little tutorial on crontab files.

Now combine this with some command line php, python, or even just a Windows batch and you have a very powerful tool at your finger tips. I will go over using PHP CLI at a later date, but it is the language I write a number of my command line apps in. I promise I will write an Web interface for pyCron just as soon as I get some free time.

I have used THOUSANDS of programs over the years, on a day to day basis I use a couple hundred, and this is one of my favorites, AND I JUST GOT IT.

Printing Pages with wp2pdf

Posted July 7, 2006 at 09:07am in Programming, Wordpress

When I installed wp2pdf I was only able to print posts, but since I am offering tutorials and articles on the site I wanted to make sure you guys could have a offline copy available. These are the changes I had to make to get it to work properly.

wp2pdf v0.4.2

Start by opening wp2pdf.php and add

$wp2pdf_bln = TRUE;

to line 26

Change directories to wp-includes and open classes.php

Open that file and add

global $wp2pdf_bln;

to line 594

Replace line

} elseif ($this->is_single) {

on line 599 with

} elseif (($this->is_single) && !$wp2pdf_bln) {

The last part is to go to line 601 and add

} elseif ($wp2pdf_bln == TRUE) {
$where .= ' AND (post_status = "static")';

What we have done is set a variable stating that we want to print pages and when it starts to build the SQL query it will check if it is a static page and that our variable is not TRUE. If it is true it will add

post_status = "static"

to our SQL query. It works and it hasnt screwed anything up.