Run a Shell Command in a Makefile

I had a directory of BMP image files that I wanted to convert to EPS (Encapsulated PostScript). Since I was planning on adding files to the directory, I did not want to hard code the names of the files into the makefile that would do the conversion. Therefore, the trick was to run a shell command inside of the makefile. The first line lists all of the BMP files and assigns it to “BMP_FILES”. The next line replaces the “bmp” extension with “eps”. The complete makefile is below.

BMP_FILES = $(shell ls *.bmp)
EPS_FILES = ${BMP_FILES:%.bmp=%.eps}

all: ${EPS_FILES}

%.eps : %.bmp
	convert $*.bmp $*.eps

All that is left is to type “make” in the directory, and all of the BMP files will be converted to EPS.

ZigVersion

I prefer to do all of my Subversion work from the command line, but I realize that not all people are like me. Clarissa and I have been using a wiki to keep track of most of our shared information (including our wedding preparations), but our wiki does not work well for content like spreadsheets. Therefore, I decided to try out a Subversion repository. After some initial searching for graphical clients, I found ZigVersion. It is a simple graphical Subversion client for Mac OS X. It took a little bit to explain how it worked and how to use it to Clarissa, but now we have been sharing and editing non-wiki-friendly files for a few weeks.

Extract Email Attachments With Procmail and Munpack

I regularly use the Marquette University PrintWise Canon copiers to scan paper documents into PDF files. These files are delivered to me via email where I manually save each PDF attachment, rename it, and move it to the appropriate directory. Using Procmail and Munpack, I was able to eliminate some of the tedium of this problem.

I inserted the following block of code into my .procmailrc file. It looks for emails that were sent from me and to me by a Canon copier. When it finds one, it copes the email and pipes it to Munpack which extracts the attachments into my attachments directory.

ATTACH=`echo $HOME/attachments`
:0 c
* ^To:.*me@email.com
* ^From:.*me@email.com
* ^X-Mailer: Canon imageRUNNER
| munpack -q -C $ATTACH

After the attachment has been extracted, I can rename it and move it to the appropriate directory, and I still receive the email in my inbox so I know I have attachments to deal with.

iTunes Web Application Search Results

My iTunes Web Application project shows up on the first page of results for most relevant search. More than 60 people clicked on search results for it on Google in September 2009. I would say this is a good thing. However, I doubt it is what most people are actually looking for. I really do recommend Subsonic or even Sockso over my own project. Unless someone is looking to continue work on my project. I would recommend that, too.

PDF to PNG Conversion on Mac OS X

I had a several page scanned document stored in PDF format that I needed to convert to PNG so I could upload it to a PayPal account to resolve a limited access problem. I found several solutions for Linux that produced inadequate image files. When I switched to my Mac OS X laptop, I opened the PDF in Preview. I selected “Save As…” from the File menu, selected “PNG” from the drop down menu and set the resolution to 300 pixels per inch. I hit the Save button, and the newly created PNG opened up. The quality was adequate, and the problem was solved.

Time Warner Internet in my Studio Apartment

I moved into my apartment just over a week ago. Time Warner came out and set up my Internet in my studio apartment this morning. The process was pretty smooth. However, it would appear that my unit had the only unmarked line in the box in the basement. The cable disaster made finding the line quite the challenge.

Time Warner Cable Box

Once the technician found the correct line, the rest was easy, and the speeds are what I expected.

Time Warner Speakeasy Speet Test

Time Warner Speedtest.net

Since I just need Internet for one more semester, hopefully, I won’t have any problems.

eBooks on BlackBerry

Up until recently, I have read most of my novels and books on a Palm TX handheld using TextDrive. I used PorDiBle to convert text files into PDB files that TextDrive could read.

This method worked much better when I always carried my Palm handheld with me and used it as my primary calendar and contact management device. The appeal of electronic books is that I always have it with me. Once I started using my BlackBerry to maintain everything, my Palm fell into disuse, and I no longer carried it with me. I started reading less. I needed a new solution.

I have started using Mobipocket on my BlackBerry and Stanza to convert texts. Mobipocket has a whole online store for purchasing texts, but the reader itself is free and can read non-purchased texts that I already have. Stanza can convert between plain text and the Mobipocket format. Unfortunately, Stanza is only available for Mac OS X and Windows. There are other options, but Stanza worked best.

Now I once again always carry the device with my current novel, and I can spend my free time reading instead of playing games on my BlackBerry.

Bayes Filtering in SpamAssassin

The Bayesian classifier in SpamAssassin began tagging emails a few days ago. I found this out because while messages were not marked as spam, my procmail rule started diverting all messages to my spam folder. The old rule was not particular about where the yes was and since BAYES contains yes, all emails looked like spam. The new rule only looks for the yes at the beginning.

# Old Rule
:H
* ^X-Spam-Status:.*Yes
$MAIL/spam
# New Rule
:H
* ^X-Spam-Status: Yes
$MAIL/spam

Now incoming spam messages contain an additional score in the spam report.

X-Spam-Report:
        *  3.5 BAYES_99 BODY: Bayesian spam probability is 99 to 100%
        *      [score: 1.0000]

I was surprised that it took the Bayes filter three months to gather enough email to begin scoring incoming email. It is a nice addition because it bumps up the spam scores enough to ensure that more messages that are spam get marked as such.

AT&T contracts are meaningless

I had a great experience on the phone with an AT&T representative when I called to transfer my number from an existing corporate plan to my own personal plan. I selected my options, and the representative explained to me that because it was a transfer, I would get a standard zero-month contract. He explained to me that I was free to change my service or transfer my number to another provider whenever I wanted to. This all went through successfully, and I was set.

Two weeks later, I noticed that my account had been slapped with an 18 month contract. When I called, AT&T had no idea why I would have had no contract, and they said that a standard transfer of service contract is 11 months. They told me that the first representative I spoke with was mistaken and that there is no record of my zero-month contract. Luckily I got my contract bumped down to 11 months; however, it doesn’t explain what happened to the zero-month contract.

Edit: 11 months is the standard length for a transfer of service. However, I did not agree to that over the phone. If they can slap me with a contract without any change in service or without my acceptance, their word and their contract are meaningless.

Pandora Alternatives

When Pandora announced a 40 hour cap on free listening, I decided to investigate some alternatives to Pandora. (I probably had been listening to 40 hours of music on Pandora in a week!) I quickly found Slacker. Slacker provides web-based music streaming in a similar manner to Pandora. I have found that they provide a tighter selection of music and that their music discovery has not been quite as good. This is probably because it is not based on the Music Genome Project. However, much like Pandora, after listening for a while, the selection has improved. Slacker’s commercials are a bit more radio-like and therefore more intrusive; however, they don’t have a cap so it’s hard to complain. Since I don’t always have my music on the machine I am on, I have also been taking advantage of my installation of Subsonic to listen to music.

Both Pandora and Slacker have mobile clients available for the BlackBerry. I have both installed, and both work well on 3G and WiFi. I don’t use the mobile clients very often, but when I want some music, and I am not at my computer, it’s convenient to have the option to play music right from my BlackBerry. Subsonic is supposed to stream to mobile devices, but I have yet to get that working.

Another benefit is that the LastFM Firefox Extension supports both Pandora and Slacker so I can continue “scrobbling” my tracks to Last.fm. Subsonic has built in support for Last.fm “scrobbling.”

Edit: Recently, I have started listening to my “library” on Last.fm. This feature plays songs that I have already listened to. I am not sure how Last.fm select songs, but I would assume it is based on what I have listened to most often. Since I have “scrobbled” a large number of songs, Last.fm does a decent job of playing songs for me. It’s still not as good as Pandora, and I imagine it would do much worse on smaller sets of “scrobbled” songs.