To You. From custsvc and noreply.

It drives me out of my mind I get e-mails that say things like “custsvc” or “orders” as the sender name.

A lot of studies have been done, and have shown that e-mail sent from a “trusted” name has greater deliverability and a higher open rate. If you’re e-mailing me about my Verizon FiOS order, you might e-mail me as “Verizon FiOS” or “FiOS Customer Service,” for example. “Customer Service” is lame because I have no idea whose Customer Service department is e-mailing me. It’s a moot point, though, because the name shown on the e-mail sent to me by Verizon FiOS is actually from “volconsumer”

I don’t even understand how this happens to anyone but people just learning how to hook a web application up to e-mail, though. If you just sent an e-mail, it will default to whatever Linux/UNIX user you’re logged in as, and I’m pretty sure that’s why I get e-mails from fantastically vague senders.

But the thing is, it’s not the least bit professional, and it’s really not even acceptable by any industry standards. Here are a few things ways you might get around it:

  • Set up a real name for your Linux/UNIX account. I might log in as “mwagner” but my name is “Matthew Wagner.” Most any mailer will use the real name if it’s available. Piping something through the “mail” command will use your real name, so I’d imagine that anything from the past two decades will use that information if it’s there. Don’t be lazy when setting up users that are going to send mail.
  • Better yet, specify who the mail is from, rather than letting your mailer default to the UNIX account it’s running at. Why would you ever send mail as webuser@www101.production anyway? You can run as webuser, but you set mail to come from “Acme Corp Support” with an e-mail of support@example.com. This isn’t a clever trick I have up my sleeve. It’s called SMTP.

The thing that bugs me is that this isn’t some profound insight I have. It’s common sense that anyone who has a basic understanding of, well, anything remotely relevant to what I’m talking about knows all about. Why Adidas, Verizon, Gamehouse, FDC Servers, Google Wave, Newegg, GoDaddy, and Kohl’s (from a random sampling of my Inbox) can’t figure it out boggles my mind. You hurt your deliverability and open rate, lose customer’s confidence, and confuse people… All because you couldn’t spent five minutes of an entry-level engineer’s time to actually set a “From” address on your outgoing mail?

access_log flowchart?

Apache, probably just like every other webserver, defaults to keeping very detailed logs. Every single HTTP request, the IP, the exact time, the hostname they accessed, the exact path, the HTTP version, the returned status code, the returned file size, the referring page, the client’s browser….

grep makes it trivial to find all access_log entries. (And grep + ssh + NFS makes it easy to find all access_log entries across a load-balanced cluster without centralized logging set up.) But it’s kind of like asking someone, “What route did you take to get this party,” and getting an answer that involves every single turn taklen, the precise distances, and every landmark encountered. I don’t care about every HTTP request made. What I want is a flowchart. They first arrived on the site from such-and-such a referrer, accessing a certain URL on our site. They accessed a handful of files as a result — CSS, static images, and, ultimately, another page.

If you view the request and the referrer as a parent-child relationship, it seems like it should be pretty easy to graph. Something like graphviz is probably perfectly suited for that type of data. It shouldn’t be so hard. So why hasn’t someone much smarter than me written a slick little application that would do this ten times better? Is there not that much of a demand? I find that hard to believe.

Nifty Link Roundup

Over the past week or so I’ve ended up bookmarking a lot of links that I thought would make good blog posts. (All are technical in nature.) I haven’t had the time, so I’ll just post them here as bullet points with brief comments:

  • I discovered the Prowl API today. It’s meant as a simple API for sending push notifications to iPhones. They call it Growl for the iPhone. And they have a lot of pre-written plugins, too. (Maybe Nagios can start sending Growl notifications instead of text messages!)
  • If you’re doing much with MySQL, you really owe it to yourself to check out Maatkit. It’s a set of tools written by people who say “I really wish I could…” even more often than I do. Some highlights:
    • Delayed replication. Set up a MySQL slave that runs an hour behind, and when you accidentally DROP DATABASE mission_critical, you’ve got an hour to STOP SLAVE and start recovery. (Sure, sure, you have backups. But having a live version in MySQL somewhere is extraordinarily handy, especially if you can just promote it to master for a while.)
    • There’s really no easy way to show all grants in MySQL, and I know that I’m far from the only person peeved by this. mk-show-grants does exactly that.
    • Some neat profilers on query stats and such.
    • An equivalent to UNIX “find” exists, allowing you to search tables by various criteria. Doing it by disk usage (data and index, split as you wish) is something any DBA should do often. Why in the world do we have an archive table with indexes turned out?
    • Xapbr builds on Maatkit a bit with this post on watching traffic via tcpdump instead of MySQL Proxy and showing errors; showing the queries with errors is just one idea.
    • The one tool that doesn’t exist and I’ve always wanted is a “tail -f”, both on a table’s data (to see new rows of data as they’re added), and just on binlogs. There are a lot of situations where this would be an unmanageable amount of traffic
  • Percona is probably a well-known name to anyone who does anything interesting with MySQL, but I have to admit that I hadn’t seen their Percona builds page before. They’ve added some nifty patches, and, because they’re totally awesome, released them under the GPL. (And I’m still eager to toy with XtraDB somewhere.)
  • VeriSign (whose name is really too confusingly similar with Verizon) has announced that DNSSEC for the root zones and .com and .net is coming proceeding. (The ability to spoof DNS is kind of scary, largely because it’s so easy to go unnoticed. Your browser will legitimately show that it’s connected to “paypal.com” because it is, it’s just that the DNS server was tricked into giving some phisher’s IP instead of PayPal’s IP.)

Building a Better Washer

I’m one of those people who tends to see technology as the fix to a lot of things. Sometimes technology is used to fix things that don’t need fixing, and we end up with overarchitected solutions that are just a waste of money. I’m pretty confident, though, that washing machines are a case where technology can make the process a lot better. With washers and dryers, the problem isn’t so much washing clothes, but the awkward dance that goes on when multiple people are vying for washers and dryers.

For one, it drives me crazy that I have to get quarters. Yesterday, I was all set to go, but realized I didn’t have enough quarters. I had cash, several credit cards, a checkbook, and a PayPal account, but not the $6 in quarters that it’d cost me to wash and dry two loads of wash. Today I had to buy a roll of quarters. When I used to work in a bowling alley, we had a lot of coin-operated video games, and the quarters were a huge hassle. Coins moved between a giant cash-to-quarter machine and the games, and we’d periodically have the person leasing us the games come and count all the quarters, and then move them right back into the quarter machine. Besides a colossal waste of time, it was also a frequent headache, because the games or the quarter machine were constantly getting jammed. So quarters are inconvenient for both users and operators.

I think both parties would win if I could get a card and swipe that directly on the washer or dryer. I’d prepay, perhaps in $20 increments, online, and the money would come out of my account when I used it. This would be great for me, but it would also double as a money-maker for the wash operators, because they would be collecting money upfront and holding onto it for a while, earning interest on the float. It’s the same thing that happens with gift certificates. Less likely than with gift certificates, but still possible, is that some people will never redeem the full amount. (Although really, this money is eventually forfeited to the state, apparently, not taken as profit.)

But then another possibility opens up. Since I’m swiping a card that uniquely identifies me, you know who’s using the machine. You can send me an IM / e-mail / text message reminding me when the wash is almost over. (You can also display my name on the washer when I’m using it / before I’ve emptied it, to shame me into actually coming to get my clothes.) I’ve waited an hour for someone to get their clothes out of the dryer. And that always happens when doing wash on shared washers and dryers.

Another nice advantage is that I could hit a web GUI and see if there were any washers or dryers open, rather than trudging downstairs. There could even be a ten-minute reservation feature whereby I could lock a washer or dryer before leaving to go there, to avoid the problem of me getting downstairs and someone having walked in before me, although I’m not sure if that’s actually a good idea.

This isn’t really a very wild idea, either. Things like this have been done for a long time. It’s just that no one has bothered to implement them. It really shouldn’t be that hard.

My Near Death Panel Experience

Earl Blumenauer has a great piece in the New York Times right now, entitled My Near Death Panel Experience. He’s a Democrat representing Oregon in the House of Representatives, and helped to push for a provision to ensure that Medicare would cover the cost of one voluntary visit to discuss end-of-life issues, like living wills and such. Medicare currently does not cover this, but doctors on both sides of the aisle have said it’s really important.

If this sounds vaguely familiar, it’s because this provision would turn into a giant controversy about death panels and forced euthanasia of the elderly, neither of which are even tangentially related to the text’s actual purpose. The article is a neat perspective into what also happened, but also leaves me worried about where things will go from here.

Eset NOD32 Review

I’m a Linux user and Mac snob. I have a Windows laptop, but it’s sitting in a box somewhere. But I used to run Windows, and I play occasional tech support for lots of Windows users, so I spent a while researching anti-virus software.

I’ve used a few over the years, and I’ve hated a lot of them. When I was in college, we had an enterprise Symantec subscription. I hated Symantec, and it periodically freaked out and wrote multi-gig logfiles for no good reason. We used to run Norton on all our home computers. And I discovered something amazing: removing Norton made the computers much quicker. Also, removing Norton is extremely hard to do. I’d be remiss if I didn’t drop a vague reference to the fact that “slows down your computer a lot” and “difficult to remove” being the two main descriptions of viruses, not anti-virus software.

Another interesting thing about some of the popular antivirus solutions is that I read a lot of people who got horrible virus infections when using them.

Enter NOD32. A lot of people swear by it. It’s made by Eset, a company no one has ever heard of, with headquarters in Slovakia. That didn’t inspire a lot of confidence, but I reluctantly tried it on peoples’ recommendations.

I don’t really have problems with viruses, so I can’t tell you any exciting stories about how I used to have some terrible virus and NOD32 fixed it. I’ve read lots of people saying it does. And a lot of professional reviewers have given it top marks. The one thing I can say with certainty is that it’s considerably faster. Removing Norton and putting NOD32 on an old computer breathed new life into it. Formerly too slow to even use, it now runs just fine. And for what it’s worth, it didn’t have any viruses. It just had Norton. (I hope it doesn’t seem like I have something against Norton. I think it’s a fine piece of software if you enjoy masochism.)

It downloads daily updates. It does it in the background, without popping up annoying windows. There is no giant toolbar you have to add to IE. You install it, and it runs in the background, keeping viruses at bay. You can also do on-demand scans. You can even, apparently, do virus scans of network drives, something most anti-virus solutions don’t allow. (Caveat: I never actually tried that.)

NewEgg sells a single-computer license for $30. If you go through Eset’s site, you can get bulk licenses (starting at a two-seat license) for pretty good discounts. Oh, and there’s a fully-functioning 30-day trial. Just be warned: you can’t have two anti-virus programs installed or they’ll fight to the death and take your computer down in their feud.

If you’re happy with your current antivirus software, there’s probably no reason to switch. But I swear by NOD32, and it has some remarkably good ratings. It just works.

The Weather

Two quick bits of advice for people giving out the weather:

  • If the day’s low temperature is 48 and it’s 39 degrees when you’re saying that in the morning, then the low temperature is 39. Why? Because it is 39 degrees.
  • If it is raining — nay, if it has been pouring all day — then the chance of precipitation is 100%, not 90%.

Såd

I went to Ikea last weekend with some friends, and we came across this terribly depressing scene. The text is obviously my own doing, but otherwise, this is what we saw when looking at the Lack coffee tables:

Sad Panda

We found another one of these depressed pandas lying with its face in the corner of a couch. I turned it around so it didn’t look quite as much like it wanted to die.

Really, though, nowhere between the obviously-emotionally-distraught designer at Ikea drawing this thing, through the asleep-at-the-wheel-or-equally-demoralized management, and all the way onto the factory floor where these things are made, did a single person say, “You know, these pandas we’re churning out look like they’re going to slit their wrists if we leave them alone?” And then, unpacking them at my local Ikea, no one said, “Hey, you know, these things corporate keeps sending us are unbelievably depressing? Do we have to put them out on the floor to bring shoppers down, too?”

Keeping Originals after a Delete in Paperclip

This is almost certainly not of interest to the non-technical regulars here, but I’m hoping it’ll save someone down the road some time.

At work I was having a hard time with what should have been a simple problem: we use paperclip for image uploads, and create a corresponding Photo object in the database. It is not necessary to have a database backing paperclip uploads in general, but in our case, it was. (In fact, with some polymorphism, too. Many things have Photos.)

The problem is that paperclip has a feature that’s useful in 99% of cases: if you delete a Photo record (or whatever object has_attached_file), it will delete the object off of disk. This makes a lot of sense: if you tell the database to delete the reference to a photo, you probably want to get rid of the disk. The problem is that I did not. We wanted to preserve (“orphan,” a purist might argue) the image / “attached” file on disk even when you called Object.destroy.

After a while of trying to figure out how to do this in paperclip, I finally found this discussion. The answer, it turns out, is that you hack in. In the object that has the attachment (Photo for me), you override paperclip’s destroy_attached_files and just have it return true. Your neutered version takes precedence of paperclip’s, and the photos sit on disk with no reference in the database.

Incidentally, I’ve found that I’m a grumpy curmudgeon who hates tools that “just work,” largely because when they don’t “just work” in some obscure situation, it’s a real pain to try to figure out why. People always say not to fight Rails. The thing I didn’t realize is that they don’t mean, “It will create a little extra work for you.” They mean, “You will want to change careers.”