Curse Pentax!

I have a Pentax Optio S5i digital camera that I think is great. However, the one huge flaw in it; it uses some wacky USB cable that isn’t the standard mini USB. Today my wife wanted to transfer pictures and it took me over 2 hours to find the stupid cable. I have tons of mini USB cables, but only one that fits the Pentax. My wife was able to transfer the images using a card reader, but the OCD part of me needed to find the cable. If it was just a mini USB cable, any old cable would have done and I wouldn’t have cared. What is wrong with standards? I’m happy that Motorola is moving to mini USB on their cell phones for both charging and data…if I lose the cable, no big deal.

Bulk Email Program in a flash

I decided to put my ReceiptWallet program on MacZOT! to give it some extra marketing and see how things go. While (obviously) I won’t make as much as if I sold it directly, I’m expanding my customer base. As part of this, I had to implement some new systems in order to handle the orders as MacZOT! gives me a CSV file of orders that I download, insert the serial numbers, re-upload, and then have to send out the orders. I have a MySQL database and php frontend that I use for my normal orders and that works quite well. So I had to figure out the MySQL syntax (I’m still learning it) to import the CSV file into my database as a first step. That wasn’t too difficult, but required a bunch of trial and error. The next part was, “how am I going to send out the registration codes?”. The normal answer would be to write a script to do this. For some reason, I really hate scripting because I’m not familiar with the syntax (AppleScript, perl, php, etc.), so it takes a lot of time to get a working script. So, I decided to write my own “bulk email” program. No, this is not a spamming program. It’s a program that takes the CSV file and a message and customizes each message with info from the CSV file. So, using the Message Framework built into OS X, I was able to whip up the program in about an hour. I even made it so that the fields can be customized and the program can be re-used for when I send out update information or the like. I really should learn some of the scripting languages, but sometimes the quick and dirty way is the way to go.

The flip side of spam

The other day my wife asked me what the following meant in an email:

----- The following addresses had permanent fatal errors -----
<xxxxxxx@aol.com>
    (reason: 554-:  (RLY:CH)  http://postmaster.info.aol.com/errors/554rlych.html)

Hmmm…I started looking and it appears that AOL had decided to block all email originating from my server’s IP address. After a bit of research, it appears that instead of unsubscribing from mailing lists, users have been hitting the “This is spam” button in AOL. After a number of these, AOL automatically blocks email. So, I turned off all email lists that I run (except for 1) and won’t turn on more in the future. I then called AOL (you have to actually call them and request to be unblocked). As my wife sends email to AOL all the time and the one mailing list I’m keeping has AOL email addresses, I had to find a workaround. I have 5 static IP addresses, so I thought that if I could rewrite the headers for all outbound traffic going to AOL to use a different IP address, I could get around the block until AOL lifted it. I series of iptables rules did the trick:

-A POSTROUTING -p tcp --dport 25 -o eth0 -d 64.12.137.184 -j SNAT --to x.x.x.x

Where the first address is one of AOL’s email servers (I did this for all their servers listed as MX hosts) and the second is my alternate IP address.

Excellent, problem diverted. Well, AOL said that the block would be lifted in 48 hours; that was Monday evening. It’s now Friday and the block finally got lifted, so I was able to remove my workaround.

Lessons learned: 1) avoid running mailing lists for people that don’t have a clue and 2) sign up with AOL’s Feedback Loop so that you get notified each time a user reports your email as spam so you can head this off before it becomes a problem.

Sometimes running my own server is a lot more trouble than it is worth.

CPU Cooling…it actually does something!

My saga this week has been that my server has been quite unstable and would lock up at seemingly random times. My first attempt to fix it was replacing the power supply; Monday morning, I noticed my server was completely off and it wouldn’t power up, so I yank 2 of the 3 hard drives from it and it started. The conclusion (which I now believe was wrong) was that the power supply couldn’t handle the 3 drives. So, I replaced it with a high efficiency one that is supposed to be quiet. Tuesday I still had problems and they seemed related to when I used one of my backup hard drives. So, I replaced the drive (which wasn’t a bad thing as it was left over from my old server). I also figured out how to finally get lm-sensors to work with my motherboard. I spent time over the last year trying to get it to work, but to no avail. One of the things I was curious about was the temperature of the CPU and case. Now that lm-sensors was working, I had this information. When I looked at the CPU temperature, it ranged from 50-80 degrees Celsius. This indicated to me that there was a problem as I read that the Pentium 4 chip I have should usually be below 40 degrees Celsius. Things started clicking…the times when the system froze were when I was backing up to my secondary drive; my backups use rsync and tar/gzip, both mechanisms are very processor intensive. So it was looking like when the processor got hit hard, the temperature on it rose and the system froze. Ah ha! I may have found the cause. So another trip to Fry’s to pick up a new CPU Cooler, new case fan and new hard drive cable (for good measure). I put everything in and almost fell over when I saw the temperature. It was ranging from 15 to 25 degrees Celsius! Under maximum CPU load (during my backup), it wasn’t getting above 25 degrees Celsius and hasn’t locked up, yet (knock on wood). I ended up getting a Cooler Master Hyper L3 as it looked like it would fit (my case has an airflow vent on top of the CPU and some of the coolers are way too big) and the heat pipe technology seems to make sense.

Hopefully all this work will actually solve this issue.

Chair design flaw

The other day I bought a kneeling chair to help my posture. I went to the Healthy Back store and bought an inexpensive one; I liked it better than the others ones. I ended up getting the Healthy Back Kneeling Chair. It wasn’t until today that I discovered a huge design flaw in the chair. I was noticing that the chair wasn’t rolling properly and after some detective work (and luck), I found that if I lowered the chair, the problem went away. The chair is in two pieces in an x pattern with a height adjustment (and a pivot bolt) connecting them. The problem is that all 4 casters are perpendicular only at the lowest seat position. As you raise the seat, the front part pivots causing the casters to no longer be rest flat on the floor. This is fine on carpet as the carpet and pad take up the slack, but I have hardwood and the chair doesn’t roll. I went back to the store and after a brief explanation and demonstration, they let me exchange it. I got the chair I was originally going to get and because of their special sale, it only cost me $1.08 more; I still like the other chair I got because of the angle adjustment, but I’d rather not scratch my floor when it doesn’t roll. I was very pleased that the store made things right.

Excellent Fry’s customer service!

I’m usually the first one to bash Fry’s as their customer service and shopping experience is quite poor. However, this morning, I discovered that the power supply on my server died (I unplugged 2 of the drives and it booted, so it was quite apparent that this was the plug), so where else do I get a power supply that is close? My choices are CompUSA or Fry’s. Fry’s is slightly closer and is open at 8 am. I got there about 8:15 am, found one power supply in the area where I saw them before, but knew there were more so I asked a guy, who happened to be the assistant store manager where they were and he took the time to walk me over there. Not only that, he asked me about what I was using it for and recommended the brand I was going to get anyway (Antec). Then he explained some of the differences in the Antec power supplies. I was quite impressed and it may have changed my attitude towards Fry’s.

Why is currency programming so hard?

One of the most requested ReceiptWallet features was to be able to handle receipts in multiple currencies. OK, simple enough I thought as I could just treat all values as strings so that they have a currency symbol in them. The problem was that I had to verify that the currency symbol was valid and format the value so it is appropriate to that currency, for example, the Japanese Yen doesn’t have decimals in the number. My first pass that this was pretty decent, handled dollars, Euros, Yen and a bunch of other currencies. Turns out this wasn’t a complete implementation. In order to build my list of currencies, I used what are called locales on Mac OS X to get the currency associated with a locale. Problem is that some currencies aren’t associated with a locale, such as Swiss Francs (I have no idea why). So I had to find a way to get a list of currencies and do some formatting magic. I think that I managed to do this, but I just don’t understand why it was so hard. Is it inconceivable that people would want to use multiple currencies on one machine? If it was easy, everyone would have this type of code in their programs!

Support didn’t treat me like an idiot

I noticed that my internet connection was slow, so I rebooted my cable modem and the modem didn’t come back online, so I called Time Warner Cable Business Class (I have a business account). The guy I spoke with didn’t have me do all the stupid stuff like reboot my computer, turn around 3 times, blame the computer, etc. He tested the cable modem and found (after it came back online) that there was high packet loss ( > 60%). While the problem hasn’t been resolved, I’m confident that it will be soon. Time Warner has always been pretty responsive, especially on a business account; one time they wanted to come out a few hours after I called to replace the cable modem (I was actually out of town), but then called me back a few times to give me status and the problem ended up being something they could solve on the headend.

UPDATE: I got a call back and the earliest appointment they had was tomorrow morning, but they are putting in an emergency work order for this afternoon which means someone will be here between about 12 pm and sometime this evening. Uggh. Hard to work without the internet. What did we do before the internet?

The joys of syncing

For over 4 years now, I’ve actively been doing development in the sync arena trying to get devices to talk together (I actually did some synchronization stuff in college so my history with sync goes back a bit). This is an area that is under appreciated and people seem to only say things when it doesn’t work. Syncing is hard; there are no right ways to sync, just wrong ways. No 2 devices or machines match up there data exactly, so choices have to be made to get things to sync. We do our best, but don’t always succeed. My recent experience with syncing has nothing to do with the software I write as I don’t use it; I don’t use it because I don’t like it, I don’t use it because I don’t use the devices we sync. 2 weeks ago, I bought a Motorola RAZR to replace my Samsung A900 with the idea that I could sync it, or at least sync the contacts. Without much difficulty, I was able to sync the contacts. The calendar was another story, it seemed to die depending on what I was syncing; I suspect it had to do with detached events or some kind of repeating events. So I gave up on the calendars, but was still pleased with the contacts. That was until last week when I started noticing that I was missing email addresses for people. It appears that one of my syncs eat secondary email addresses for people. I think I’ve rebuilt most of my contacts and it doesn’t appear to be happening more. While I was a little annoyed at the iSync team/Sync Services team initially, having worked on sync, I know how hard it is to prevent problems. Probably some minor bug that caused the first sync to nuke the entries. Oh well, at least it wasn’t the stuff I wrote that ate my data.

Charging a Motorola RAZR over USB

The Motorola RAZR has a mini USB plug on it for charging and hooking to a computer which is great as I have lots of those cables lying around. Unfortunately it won’t charge over USB from a Mac out of the box. Luckily, I know some tricks and someone told me the magic to get it to charge. I whipped up a little program that tells the RAZR (or any other Motorola cell phone) to charge over USB. My app is free to download. If you like it, please take a look at my ReceiptWallet program and consider purchasing it. The app is pretty simple; place it in your applications folder, launch it and set it as a login item. Whenever you plug in your phone, it should start charging. If your machine goes to sleep, it will stop charging. (For those curious, all the program does is open and close the USB interface on the phone.)

If you can’t get the program to work, unfortunately there is nothing I can do about it other that to suggest to Motorola to fix their phone so that it charges automatically when plugged in via USB.

Update, there are “sync only” USB cables that allow you to charge Motorola phones without MotoCharger; I have one and it works quite well. I’ve also decided to post the source code. You can grab it here. There are no restrictions on the source, just please don’t claim it for your own. If you like it or use it, please use my Amazon link to buy something.