Accurev blogs about Orbitz technology

Posted on April 18th, 2008 in Tech Industry | 2 Comments »

Dzone just picked up on a post to the Accurev blog about some of the cool things our Development Technologies team has been doing at Orbitz. I’m proud to say that we have some really bright, talented people working on that team, and I’m glad that they are starting to get some attention outside of the company (those inside already know how great they are). This team innovates like crazy, constantly coming up with ways to make our lives as developers easier. They do it all, from writing scripts to automate complicated repetitive tasks, managing our continuous integration environment, keeping core infrastructure components like our wiki and bug reporting tool up and running to their full potential, and creating custom applications to improve upon all areas of our development process.

Go Doug, Jill, and crew!

A cougar…in Chicago!?!?

Posted on April 15th, 2008 in Uncategorized | No Comments »

Wow…this definitely falls into the “story of the day” category.

http://www.nbc5.com/news/15882607/detail.html

Over the past few years, there have been several cougar sightings in Northern Illinois. So many that websites have popped up to track them. However, although some of the sightings were reported by very reputable individuals (police, etc), the lack of photos/videos have made many equate cougar sightings to bigfoot sightings (I was a believer). But today, the skepticism ends.

It’s a shame the police had to shoot the animal, but I completely understand. They had the cougar cornered, and it either lunged at the officers, or tried to escape. Roscoe Village is a city neighborhood, full of families with small children. The police couldn’t risk letting the cat escape.

Bugzilla and SMTP Authentication

Posted on April 1st, 2008 in Scripts | No Comments »

The last few months I’ve been helping out in an effort to upgrade Shotokan Karate of America’s membership management system. They’re rewriting the system from scratch, as the old system has grown to be unmaintainable. The code for the new system was about 85% complete when I signed up, so I offered to start testing the system while the sole developer working on the project finished up the code. There were no unit tests, so I figured that would be a good place to start. This naturally brought up the issue of how we would communicate problems and fixes, so I offered to install Bugzilla on my Linux box and suggested we use that.

It wasn’t until later that I found out that Bugzilla and SMTP Authentication do not get along (although I see that there is a fix in the pipeline). Bugzilla supports SMTP, but without authentication. It also supports sendmail, but my ISP isn’t too keen on people running their own mail servers, making the use of sendmail difficult. Since my ISP has a SMTP server for me to use, I figured I would use that. But, authentication is required on that server.

I toyed around with some ideas in an attempt to keep me from hacking the Bugzilla code. One involved parsing the data/mailer.testfile file (where mail is sent when the “testfile” mail option is set) for the To address and the email body, and sending the email via a custom script. But, that brought up some interesting race conditions if multiple users made a change that triggered an email at approximately the same time. We would need to periodically read that file to send the email, wiping out the contents afterward to avoid resending the same messages. If the timing was right, we could potentially wipe out a message that was never sent.

I took a look at the Bugzilla code, and found the module that was responsible for sending the email. The code was clean, and pretty easy to follow, even though I know very little perl. I found the point in the module where it calls out to the Mail Transport Agent to deliver the mail. I figured I could easily insert a call to a script to deliver the mail, using SMTP Authentication. That is exactly what I did. I modified BugMail.pm to include the “system” call below.

sub MessageToMTA {
    ....

    # --- Begin New Lines ---
    system('send-bugzilla-email.rb', $msg);
    # --- End New Lines ---

    $mailer->open($headers->header_hashref);
    print $mailer $body;
    $mailer->close;
}

$msg is a variable that contains the SMTP message to send. That message includes the To address, the subject of the email, and the body of the email. In other words, everything we would need to send the mail ourselves. I then wrote a ruby script to parse the message, and send the email. Here’s the script.

#!/usr/bin/ruby

require 'net/smtp'

from_address = 'username@my_isp.com'

# Break the message up into an array of strings
message_array = ARGV.first.split("\n")

# Pull out the To address and the subject
message_array[1] =~ /^To: (.*)$/
to_address = $1

message_array[2] =~ /^Subject: (.*)$/
subject = $1

# Delete some crap that we do not care about
4.times { |i| message_array.delete_at(0) }

# Combine what remains back into the body
body = message_array.join("\n")

message =  "From: Bugzilla <#{from_address}>\n"
message << "To: #{to_address}\n"
message << "Subject: #{subject}\n"
message << body

# Send the email
Net::SMTP.start('smtp.my_isp.com', 25, 'my_isp.com', 'username', 'password', :login) do |smtp|
  smtp.send_message message, from_address, to_address
end

File.open('/var/log/bugzilla_email.log', 'a+') do |file|
  file.puts("\n-----------------------------------------\n")
  file.puts(message)
end

Although not ideal, it does the job. And, if I do say so myself, it works quite well. I’ll be looking forward to upgrading to the new version of Bugzilla once it supports SMTP authentication. In the meantime, this will keep things rolling.

Release your code!

Posted on March 26th, 2008 in Software | No Comments »

You know that piece of code that you wrote a while back? That webapp that you wrote to help organize some aspect of your life? That library you wrote to abstract away some details of a specific task? Release it! That’s right. Set it free!

One of the reasons I set up this website was to give me a way to “showcase” and release some of the code I had written over the last couple of years. I guess some part of me thought it would be as simple as tarring up the code and throwing it on the site. Well, it turns out it’s not that simple (at least for me), and that’s a good thing.

I’ve found that releasing code forces you to make it better! Over the last couple of days, I’ve found myself adding more test cases, fixing bugs, removing assumptions, bulking up the documentation, and cleaning up the code. In general, now that the code will be out there in the public eye, I want to make sure it represents my best effort. When I write code for my own use, I generally focus on keeping it clean, and making it work. I don’t usually write doc outside of the code. I sometimes make assumptions in the code based on the box that I know will be running the code. I put up with small bugs that don’t really cause that big of a problem. But at the same time, when I use somebody else’s code, I expect more. I expect good doc. I expect that the code doesn’t assume to be running in any specific environment or on any specific setup. I expect those small bugs to be fixed. So, I’ve found myself cleaning up the code to meet my own standards. And, this is great for the code.

Releasing code also engages the community. You never know who may be out there looking for something like what you have created. You could be helping your fellow man by providing a solution to a problem they could be experiencing, perhaps the same problem that prompted you to write the code in the first place. Engaging the community has several other benefits. In true open source fashion, if users feel that your code is missing something, they will often add it. If there are bugs in the code that you missed, sometimes they will get fixed. An increased user base will sometimes serve as a source of innovation. All of these end up making your code better.

So, in short, I’ve found that releasing your code makes it better! So, release that code!

Welcome

Posted on March 23rd, 2008 in Uncategorized | No Comments »

Welcome to my blog. Here you'll find out a little bit about me, my ideas, and my interests.