Python Crontab 1.0

Mission Accomplished! As a programmer, if you want to write crontabs, system and user tabs and want to access them in a less hairy way; then this is the module for you!

This 1.0 release includes lots of new unit tests, fixes for SunOS and other things and clean up of examples. You can get your source code from PyPi here: Awesome Source Code Link

And here’s a taste of a script using python-crontab:


from crontab import CronTab

system_cron = CronTab()
user_cron = CronTab(user='username')
fake_cron = CronTab(fake_tab='')

Creating a new job:

job = cron.new(command='/usr/bin/echo')

job.minute.during(5,50).every(5)
job.hour.every(4)

New job for reboot:

job2 = cron.new(command='/foo/bar',comment='SomeID')
job2.every_reboot()

Finding jobs with certain commands:

list = cron.find_command('bar')

Iterating over all cronjobs:

for job5 in cron:
print job5

Launchpad project page, GPLv3

Reporting a Network Driver Bug: Bash Scripting

Heya,

Today I needed to report a whole bunch of information about my ethernet device to the nice people who develop the driver. They have a whole (long) list of information they’d like to have, but no script to help you collect it up.

So, to aid this, I built one using some super bash-fu:

http://paste.ubuntu.com/628120/

If you’re interested in bash, you should get a kick out of some of the hoops it has to go through to collect various bits of info. Especially useful is the grabbing of the end of the dmesg log file after running modprobe.

Thoughts?

Generating Calendars

I wrote this nifty script in python to take the output from the cal command and parse it, using an svg template it outputs an entire calendar in your own style, with your own pictures and everything.

It was a bit rushed because I was making a personal calendar for my wife with birthdays, anniversaries and our family pictures on it. And it came out really well too, she’s very happy with it! Here is a page from the calendar:

A big shout out to Inkscape, which again was flexible enough to allow me to create my calendar template without complaining about missing images or custom svg xml. If you want to have a go yourself at making a calendar then just download the following package:

calendar-creator.tar.bz2

Populate the flips directory with your own png files 01.png – 12.png and a title.png file for the front page, add any extra dates you want to the dates.lst, then run `./create-cal.py 2010` on the command line this will make a whole set of svg files for each page. You can then run `./make-book.sh` which will use inkscape (make sure it’s installed) to generate png files of each page.

Once you have your images, you can print them out in order or create a pdf of them using imagemagik’s convert command: `convert pngs/*.png full-calendar.pdf` but be aware this file might get big and generating these things takes time.

I will post a complete calendar tomorrow.