UMD Dissertation LaTeX Macros
Python Plotting
Python HDF Routines
Mail Check
Advisor/Student List
APJ/arXiv Submit Script
LaTeX Business Card Macro
LaTeX Poster Macros
Gmail backup script
Blogger Backup
LaTeX Makefile
Thumbnail Webpages
Fix for PGPlot eps files
HTML include

Here are a bunch of perl and python scripts (and LaTeX stuff) that I wrote. In the case of the perl and python scripts, they may be downloaded, made executable (chmod u+x, and then run. For anything else, follow the individual directions. The most recent versions are linked to in the proper section. Some things have their own webpage, so get a section here. All version are kept in this directory. With a few exceptions (such as zeus-mp), most code offered here is covered by the GPL v2.0. A copy of the GPL is available in the download directory.

iCal python library

I depend on my todo lists pretty heavily. At one point I used the palm todo list (and jpilot for syncing on my computer). Eventually I switched to Apple's iCal (I could never get Mozilla Sunbird to work reliably enough). This was kind of annoying since I'm not really a fully time Mac user (I still prefer GNU/Linux or at least UNIX cmd line stuff). For some things (grad school and work) I used some perl/LaTeX thing which is a bit cumbersome. So I was pretty excited by Emacs org-mode. I wrote some python to convert my ical files to emacs org-mode. I tried to make it general enough that the todo class would be a good start for a python-ical interface. If I feel motivated, it should be fairly easy to expand this into something more. For now, it is just to get iCal todo items into a python data structure and can write it to orgmode todo items.

UMD Ph.D. Dissertation LaTeX files

This is a modified version of the LaTeX files for producing a dissertation following the University of Maryland's format. It produces a nice pdf with all sorts of clickable links and can also make a nice version for printing including a cover. All the hard work was done by other people, but I made some changes and simplified some things that I wanted to share as well.

I tried to get the UMD gradschool to update their ancient copy with my more updated one, but unfortunately, they were extremely unfriendly to an alumni trying to help and share code with them so nothing came of that.

There is a minor update to this (May 25, 2009) to give it the updated Makefile that I also put up.


Python Plotting

This is mostly an early attempt at a python wrapper for gnuplot which keeps syntax very similar to IDL. Nothing great, but I use it for most of my plotting needs.

Python HDF Routines

Similar to the plotting routines above, this is an early attempt at routines written in python to work with HDF4 files of the type produced by ZEUS. Also, not great, but they worked for me.

Mail Check

For reasons that are too long to get into, I had trouble checking email on my Motorola Q. I could however ssh to my desktop. Unfortunately, pine and mutt really don't get along with the minimal terminal app and keyboard on the phone. So I wrote this python script to do some really half-assed reading on my INBOX which was stored as an mbox file. It was sort of fun to write, but not terribly useful.

Advisor/Student List

Partway through grad. school I inhereted a list of the previous and current students, their advisors, first position after leaving, and other misc. information. I decided to try and fill in the missing info, automate the formatting of the list, and generally make it more usefull. The end result was an xml file for the data and a perl script (using the XML: Twig library to parse the data) and generate pdf and html lists. The Astronomy Dept. eventually took over my list, but the perl script and the xml dtd are here in case someone wants them.

APJ/arXiv Submit Script

Now I'm still not sure if this one is a good idea or not, but I used it a few times. Journals tend to have funny naming requirements for figures, or strict formats for the tarballs they accepts, or other things like that. I used this script a few times to prepare tarballs of my LaTeX files for APJ and for the preprint arXiv.

LaTeX Business Card Macro (updated 2012)

When I was in grad school, I was asked for a business card maybe three or four times. Not enough to get them printed in any professional way, but enough that it would be nice to have some. Staples sells sheets of perforated card stock, so I went looking for a way to do it in LaTeX. I found CardTex, originally by Brian Moses of the University of Kentucky Math Department which had been updated by Charles Danforth (an Astronomer who kept the previous version up and was nice enough to let me put my new version up). This macro was very nice, but rather old, so I modified it for more modern LaTeX distributions and made it easier to line up the cards with the perforations. As is, you just need to fill in your info in the top, get a copy of your university or company logo in eps or png (if you are using pdflatex which you most likely are) format (this is setup to work with UMD's primary mark eps from the UMD Trademarks page, but it should be easy to get the sizing correct by reading the comments in the file. Hopefully the file is clear enough to use without any further instructions, but if that proves not to be the case I will try to put clearer directions up.

I recently made some modifications to allow one to make cards for a site or blog since that seems to need different design requirements than a card for a person. Still the same relatively simple LaTeX and the quality still seems better than what a word processor can do.

I recommend that you print out some practice cards on plain paper with the border showing to help line it up before using the card stock (where you should not have the border). The end result is 10 cards on an 8.5x11 sheet of paper. Even on a cheap (actually free after rebates) canon printer, the results were very nice.


To make things a little easier, it is possible to put all your personal info into a file included from the main LaTeX file. The following file is a blank example of such an include file. You can just fill your info into this file (see the comments in card.tex for more info).


There are now options for single column cards without a logo (for personal stuff mainly) and for sites like a blog or a business.

LaTeX Poster Macros

My LaTeX Poster Macro are on their own page.

Gmail Backups

This python script allows you to download all the email in your gmail account (while maintaining the labels as folders) and saves it as standard UNIX mbox files. I've only used them with pine, mutt, and the standard BSD mail command, but nearly mail programs should be able to handle them. This is made possible by the very cool libgmail library.

At the moment, all messages are marked as new, but I hope to fix that next time. I would also like to avoid duplicate downloads since each message has a unique id number, but that might be a pain with mbox.

Obviously, I take NO RESPONSIBILITY for how this works for you or how Google responds to you downloading so much from their servers. This seems to me to be less dangerous than some other things people have done (gmailfs comes to mind), but you never know. The script does wait 10 seconds between each folder to be on the safe side.

Blogger Backup

This python script allows you to backup both posts and comments from a blog that uses Google's blogger beta (the google accounts version of blogger). It only requires that you set your feeds to full in bloggers dashboard and have python installed. Just run it followed by the name of your blog. It does not back up pictures stored in picasa and it can only get up to 100 posts and 100 comments (hopefully there is some way around this number limit). The end result is an xml file for easy parsing on importing into other things.

I hope to change this around to use the Google APIs instead of just copying a feed in the near future, but at the moment, this works for me.

LaTeX Makefile

As usual, other people have written similar things, but this seemed to fit what I needed better. Basically, I got tired of having to look up how to make nice pdfs from LaTeX, and wrote this makefile. Just put it in the directory with your latex files (you may want to rename it to Makefile) and type make all. If will run latex the required number of times, and then make a postscript file and a pdf. See the readme file for more details. If you use bibtex (and you should), it will also run bibtex at the appropriate time. If you do not use bibtex, it will still run it, but it won't do anything. It is also capable of using pdflatex to directly make a pdf.

This has been updated on May 25, 2009 so make clean actually cleans all generated files.

LaTeX Makefile
LaTeX Makefile Readme

Thumbnail Webpages

Here is a small Perl script I wrote to generate a webpage of thumbnails with links to the original files from a directory full of pictures. It is capable of working recursively on directories where some contain pictures and some do not. It may be downloaded, used, modified, etc. under the terms of the GNU GPL (see the readme for details). I'm sure there are tons of similar scripts available, but I needed one for the YTP pictures on my site. And I'm sure not all of them produce valid XHTML-1.0 Strict (now HTML 5). Besides, more GPLed software out there cannot hurt. And most of the others I have seen can only work on a single directory at a time.

Actually, now it does HTML5!

The current version (1.7) puts medium sized pictures in the individual pages since those 5 or 6 megapixel images are kind of big to download all the time. Just click on those images to get to the full sized ones. Also, you can use the "-c" option to have the script reproduce everything (normally, it checks to make sure there are no existing thumbnails before making new ones).

The current versions (since 1.5) have some major improvements to the navigation and is used on RMS' website for his large collection of photos.

As of v1.6.3, you can make add captions by making a file with the same name as the file you want to caption but with .txt added to the end and just put the caption text you want in that file.

Thumbnail page Perl script
Thumbnail page Perl script Readme

Kayhan Gultekin modified it so it make medium sized pictures versions of the pictures on the individual pages and changed the directory structure around. His version is available here. My version now contains similar features.

PGPlot eps fix

This script is meant to fix postscript output produced by PGPLOT. All postscript output from PGPLOT is encapsulated postscript. This is so that single page files (the most common) should be labeled as EPS for inclusion in things like Latex documents. Unfortunately, some recent versions of CUPS (Common Unix Printing System) have a problem with this for multipage files. Strictly speaking, CUPS is correct (although there seems to be some problem in it as well), as an EPS cannot be more than one page long, but if you have ever programmed in FORTRAN, you can understand why it would not be easy to fix this in PGPLOT. But in Perl, it is very easy.

This script takes the name of a postscript file, and if necessary, strips the eps tag out, leaving a valid, CUPS safe, postscript file. And it leaves a backup of the old file.

This is especially useful in conjunction with PGPERL, where it may be called as a subroutine in the same script that make the postscript file in the first place.

Perl script to fix multiple page postscript files from PGPLOT
Fix Eps Perl script Readme

html include

Here is a script to include a common piece of text in multiple html documents. It was meant to do something similar to server side includes, but without causing extra work for the server, and to allow easier validation. This script was used to produce the navigation bar on this site (that way I can update it just once, run the script, and have it show up on every page).

Perl script to include common text in multiple html files
html include Perl script Readme

ZEUS-MP v1.5

ZEUS-MP is on its own page. ZEUS-MP is a three dimensional, parallel, MHD code written in FORTRAN 77. I currently maintain this version of ZEUS. It is freely available to the numerical community in the spirit the original authors released previous versions of ZEUS.