Archive for May, 2006
Envelope Maker, a Gtk2 frontend to “envelope.pl”



So, I decided that now that I have a proper laser printer I want to be able to print professional envelopes again in Linux. I define a professional envelope as having three parts: return address, to address and the delivery point postnet (that barcode-like thing in the bottom right corner). In reality, printing the delivery point postnet speeds up postal processing by a day since it guarantees no human being has to look at the envelope until it reaches the destination street, and I always am a fan of efficiency.
So, what’s a delivery point postnet? It’s 12 numbers, the 5-digit zip code, the 4 digit +4, the 2 digit delivery point code and one check digit, printed in a height-varying barcode-like symbol on the bottom right corner of an envelope. Those numbers, taken together, indicate a specific mailbox in the United States. Theoretically all you would need to get a letter from A to B would be a delivery point postnet and a return address. I might try that sometime…
Back on track, I decided I wanted to print these things in Linux so I went tracking down free software to do it for me. I found Gregory Spath’s useful perl script called “envelope”, available on his website. It works like a charm - I expended 10 envelopes getting the margin values set right in my ~/.enveloperc file, but from then on it worked like a charm. It even prints postnets in the bottom right corner of the envelope! The only problem with this is that in order to print a full delivery point postnet it requires that I provide said delivery point value, in addition to the zip+4. Well, that’s a pain!
So, armed with the determination of being lazy in the future, I sought out something to locate that delivery point value for me. After several non-starts I realized that the USPS had several tools on their website to provide this value. One of them is even made to be used by programs (it has its web-based API)! Oh, that’s too good to be true, I thought! Indeed it was, the USPS requires a lengthy registration procedure to be permitted to use this API. Luckily, there still is another tool: a web-based query intended to be used by human beings. Unfortunately, programming something to use a web page intended to be used by human beings is generally another serious pain. Fortunately for me I found that Gregor Purdy wrote a perl module called Scrape::USPS::ZipLookup to do just that for just this script. Unfortunately again, it was slightly out of date. Fortunately, I fixed it and have emailed the changes to Mr. Purdy for release.
So that leaves me with a tool that can take a provided address, ask the USPS to correct it and return the full zip+4+delivery point code. What could I do next? Oh, it’s obvious, I wrote a GUI.
So now I have a small Gtk2 frontend to “envelope.pl” which you can see to the right here. It’s fairly simple: the address fields and four buttons. In brief, here’s what they do:
- Fix: Lookup the address with the USPS and fill in / correct fields
- Cancel: Close
- Print Preview: Show a preview of the envelope in GGV, GV or whatever you’ve configured to show postscript
- Print: Print the envelope using LPR
If you notice in the first screenshot I’ve put in a somewhat incomplete address. After pressing the “fix” button the USPS filled in the rest of the information for me, and that’s visible in the second screenshot.
Once that’s done I clicked the Print Preview button and the Gtk GhostScript viewer (GGV) opened to show me vaguely what the envelope would look like once printed. That’s the third screenshot.
Finally, the last screenshot shows the envelope I printed by clicking the Print button.
Not bad for a lazy Sunday morning, eh?
Source is available here: http://downloads.pugsplace.net/tree/envelope-maker-0.1.tar.gz. It contains the updated Scrape::USPS::ZipLookup module and Gregory Spath’s envelope.pl. You’ll have to install Perl-gtk2 and the dependencies for Scrape::USPS::ZipLookup via CPAN, but that’s described in the included INSTALL file.
9 commentsSeasoning a Carbon Steel Wok - Instructions

So I got a high-carbon steel 14″ wok for my birthday last week. It’s glorious, I’ve stir fried two nights in a row this week. It’s great fun to cook with! However, before you can cook with a carbon steel wok you have to season it, a process of burning oil into its cooking surface to prevent rust and to keep food from sticking. A properly seasoned wok works as if it has Teflon on it, but the seasoning won’t melt off at high heat like Teflon will. Seasoning a wok, however, is a long process. Luckily you should only have to do it once.
The card that came with my wok contained seasoning instructions that were mostly ineffective. They said to spread oil in the wok on medium heat, then tilt the wok over the heating element to heat all sides of the wok evenly. As should be obvious to anyone who’s played around in the kitchen, this won’t work. Their seasoning instructions, no matter how much care I took doing them, only managed to season the bottom of the wok. E.g., the obvious and easy place. The sides were still bare steel. So I used some directions provided by “fast_matt” on the Amazon page for this wok and took photographs along the way. I’m reprinting those here without permission but I doubt “fast_matt” will mind. So, without further ado…
How To Oven Season A Carbon-Steel Wok
- First, stove-season the wok per the instructions, concentrating on the bottom. Trying to heat the sides over an electric range is ineffective; that’s what the next step is for.
I found it works best to pre-heat the wok on medium to medium-high heat, THEN wipe oil onto the inside surfaces with a repeatedly-folded paper towel. Take care that your hand does not contact the pan or the hot oil in the towel; use the paper towel in such a way that your fingers are several inches from the hot surface. BE CAREFUL! This will require wiping more oil onto the pan fairly frequently, but has the added advantage (over pouring, then spreading) of limiting the amount of oil in the pan, so if you over-heat it the flames will be inches rather than feet high and quickly go out. - After stove-seasoning, let cool and remove the long handle by unscrewing the hanging eye.
- Wrap the small handle in a wet dishcloth or wet paper towels, then wrap the wet cloth completely in aluminum foil. This will keep the handle below 250 degrees F or so as long as there’s water left due to the thermodynamics of phase changes.
- Pre-heat the oven to 450 degrees.
- Heat the wok on a burner at medium heat to heat the bottom
- Wipe the entire inner surface with oil, then (USING TWO OVEN MITTS!) put the wok in the oven for 20 minutes.
- Remove from oven (REMEMBER THE OVEN MITTS!), let the wok cool, rinse the oil out with hot water, and lightly scour the inside with a fine nylon mesh to smooth the rough spots (I used the scrubber on a sponge, but an onion bag works well too).
- Re-wet and re-wrap the cloth keeping the handle cool — be careful, the cloth will be at water’s boiling temperature!
- Dry with a paper towel and heat briefly over medium to medium-high heat to remove any remaining moisture.
- Repeat the oven-seasoning procedure at least 2 or 3 times.
After all of this you should have a wok with a black bottom and rich brown sides, ready to cook!
6 commentsUF in the summer looks like Furman in the spring
So… I’m back from spending ~10 days in Greenville, South Carolina having a mighty good time with Katie, Jen and Cort. I had a wonderful time and did plenty of fun things with highlights like:
- Seeing the Furman Symphony Orchestra and Oratorio perform Mozart’s Symphony No 38, Prague, Great Mass in C Minor and Beethoven’s Choral Fantasy. Katie was in this Oratorio making it extra special.
- General fun hanging-out-with Jen and Cort (at whose apartment I was so generously allowed to stay)
- Attending Furman’s Honors Night to see Katie get an award for her poetry.
- Eating a lot of really good food prepared by Cort, who is a very competent chef (Thank you Cort! Thank you Jen!)
- Attending Katie’s induction into Phi Beta Kappa (WOOHOO, KATIE!).
- Lazing around Furman and Furman’s library reading good books like ones starring Lord Peter.
- Watching the Furman Theatre’s rendition of Shakespeare’s The Tempest (which was very well performed and wholly enjoyable).
All in all it was a wonderful vacation. And while this isn’t the proper medium for expressing gratitude to my hosts, I’m going to do it anyway for they were of exceptional kindness: Thank you again, Cort and Jen!
I was greatly amused at just how sparse Furman’s campus is, even during peak times during a primary part of their school year (their Spring term isn’t complete until the end of May). The density of students walking around is very, very low compared to UF. Of course UF has 10 times the student body but Furman’s campus is tiny compared to that of the whole of UF. I mention this because now I am for the first time taking summer courses here in Gainesville and, amusingly, the student density here is very similar to Furman’s right now. The campus is practically deserted. Thus the title of this blog post: UF in the summer does look like Furman in the spring.
Both my classwork and my office-work are looking to be greatly interesting and worthwhile. I’ll blog about the former and perhaps some general notes on Asterisk (the open source PBX) at a later date.
3 commentsReplacing the batteries in a Belkin F6C800-UNV UPS
Here are some notes on replacing the batteries in a Belkin Universal Series 800VA 6 Outlet Uninterruptable Power Supply:
- The UPS clearly states that there are no user-serviceable parts inside and that opening the case is Bad. Since the batteries last ~3 years and the warranty is only 3 years long this is rather moot.
- It takes TWO (2) 12V 8AH batteries. I purchased my replacements from Apex Battery.
- The batteries are mounted securely inside the case. They are not simple to get to, but neither are they impossible.
Other than being sure to order 2 replacement batteries the hardest part about doing the replacement is getting to the batteries. Before you start make sure that you have the following:
- A long-handled 3/16″ Phillips screwdriver (or similar). The shaft should be about 4 inches long.
- A 9/32″ hex socket wrench with a long shaft (8″ or longer). You can also use an extender to get that length, but it needs to be taller than the case.
- A flat-head screwdriver or a molex connector remover of some sort.
- The replacement batteries.
The basic procedure then is…
- Open the case, there are 5 screws: 4 on the bottom and one on the back.
- Disconnect the batteries from the transformer. Disconnect the ground (black) that runs between the batteries, then the ground that runs to the transformer and finally the hot (red) that runs to the transformer.
- Unscrew the circuit board from the top. The board has 4 screws.
- Unscrew the back-plate from the base-plate. There are two screws on the bottom corners of the backplate.
- Gently pull the back-plate away from the circuit board. It will still be connected via wires, but you don’t need to disconnect these.
- Now that the circuit board has cleared the back-plate, lift it up slightly and unplug the molex connector from the front (towards the buttons). This connector is the connector from the front panel lights and buttons. You can remove it with a proper molex connector tool, two flat-head screwdrivers or one flat-head screwdriver and patience. Be careful when prying to pry it out evenly on each side so as not to bend the pins.
- With the molex connector unplugged you can lift and move the circuit board enough to unscrew the remaining two screws and two nuts.
- Unscrew the two screws holding the battery retention bracket to the front-plate. These are at the top of the battery retention bracket. You will need the long-handled Phillips to reach these screws — there are holes cut in the bracket to allow for access with a normal, straight screwdriver.
- Using the hex wrench unbolt the two forward-most hex nuts holding the other side of the battery retention bracket to the bottom-plate.
- Gently lift up on the freed battery retention bracket and slide out both dead batteries, noting their orientation and carefully setting them aside so as to not mix up the new batteries with the old.
- Slide the new batteries into place in the same orientation as the old batteries were.
- Reattach the battery bracket, the front panel molex connector, the back-plate, the circuit board and finally the case.
- Make sure it works, let the batteries charge up and enjoy!
Hopefully this will help someone out there…
29 commentsYou’ve just wasted time on this post
Stephen, were you magically on UF’s campus today? I saw someone who looked like who you once were.
Oh, and I have a campus job now. I’ve been hired by a man who reads this blog, the man who runs the local Linux Users Group. I start after my vacation to South Carolina, once summer classes begin.
Oh yes, Summer Schedule:
- Tuesday: Programming Language Principles, 2pm - 5pm
- Thursday: Programming Language Principles, 3:30pm - 5pm
- Someother-times: Work with the Bureau of Economic and Business Research
- Otherother-times: Individual Research with Dr. Fishwick
In current events: One final down, two to go. Vacation starts Friday. Go, time, go!
2 comments

