George Carlin

Posted by Matt on June 23, 2008


Farewell George.

Georgecarlin

Congratuations 10% of America! 1

Posted by Matt on June 16, 2008

Today gay couples have won the right to marry in California.

I’m very happy to see that an estimated 10% of our nation now has the opportunity to legally express their devotion and love to another. It’s long overdue.

The holy war surrounding this issue is ridiculous. We live in a free society; meaning that as consenting adults, we’re free to make our own decisions (well, as much as they allow us to).

If you are against gay marriage; great. Opinions are wonderful. However, why would someone legislate someone else’s happiness and fulfillment? The entire point of this existance is to find and connect with others, and marriage is the highest order.

Remember “Life, Liberty, and the Pursuit of Happiness”?
Remember the last time the nation tried “Separate But ‘Equal’”?

Congratuations to all the newlyweds tonight in California!


gay_rights

Complete Awesomeness

Posted by Matt on June 04, 2008

Congratulations on doing what they said couldn’t be done, and for making history in such an elegant and eloquent fashion.


obama

Iterating over all Models in Rails

Posted by Matt on May 16, 2008

Neat little snippet of code in those odd times you need to loop over every model in your application programmatically.

This exact snippet loops over every model, and converts each timestamp (created_at, updated_at) to UTC. It can be quite helpful if you’re adding Time Zone support to your Rails 2.1 application and you have existing non-UTC timestamps.


Object.constants.each do |o|
  klass = eval(o, TOPLEVEL_BINDING)
  if klass.is_a?(Class) && klass.superclass == ActiveRecord::Base
    puts "\n\nUpdating #{klass} timestamps to UTC"
    klass.all.each do |obj|
      offset_hours = (Time.zone.utc_offset / 1.hour) * -1
      obj.created_at = obj.created_at + (obj.created_at.dst? ? offset_hours - 1 : offset_hours).hours
      obj.updated_at = obj.updated_at + (obj.updated_at.dst? ? offset_hours - 1 : offset_hours).hours
      obj.save
      print '.'
    end
  end
end

*Please note: I haven’t tested this very thoroughly, but it does seem to do the trick. As we know, Dates and Times can be total PITAs!

AWS, EC2 and SSL 1

Posted by Matt on May 15, 2008

I spent a greater part of this day attempting to get nginx, SSL, and EC2 to play nice together. The funny thing was that nginx (which was hosting a mongrel_cluster) would serve standard HTTP requests just fine, but HTTPS requests just kind of hung there.

I could see that nginx was in fact listening to port 443 and could connect locally, but the whole shebang fizzled out anywhere outside the local box. No firewall either.

After pulling my hair out for a bit, I happened across this article that alluded to the ‘ec2-authorize’ command.

Seems as though you have to remotely manage the “firewall” of a running instance!

Anyhow; cutting to the chase: To enable HTTPS on your EC2 instance just run:


ec2-authorize default -p 443

Rails, Git, and Plugins

Posted by Matt on May 12, 2008

One of Rails’ greatest strengths lies with the plugin system. Git is the new source control kid on the block that all the girls are talking about, but Git breaks existing systems to manage plugins, such as Piston and the great ’./script/plugin install -x’ command.

Git giveth and Git taketh away.

Git has the supernatural ability to track submodules in your application. The below command adds RESTful_ACL as a submodule to your application inside the vendor/plugins directory, checks the project out for you, and commits changes in your application (added info in .gitmodules).


git submodule add git://github.com/mdarby/restful_acl.git vendor/plugins/restful_acl
	

git commit -a

When you go to clone to a different machine, just run the following two commands to checkout all of your submodules:


git submodule init
git submodule update

You’re off and running!

Forays into freelancing

Posted by Matt on March 28, 2008

I’ve suddenly realized that while I do really like my fulltime gig, I’m not getting paid for the insane amount of overtime I normally put in. I’m not asked to do this work, but I do as I get bored and hey, I really like to code.

So I logged onto workingwithrails.com and sent my resume out to a few prospective clients that allow telecommuting developers. Why the blog post? I don’t know, I guess I’m kind of excited about the process. I will be nice to use my craft on different problem domains for once.

I have been attending meetings with the Columbus Ruby Brigade for the last three months and this month’s meeting was about freelancing. One thing that member Joe O’Brien said stuck in my head. To paraphrase; “If you waited until you were sure you were the top expert in your field, you would never get started”.

I really respect Joe from afar as he’s a super bright guy with a solid history of experience. Wisdom is learning from others, so I’ve decided to throw my hat in the ring.

Wow, I’ve referenced myself 21 times in this post. My (22) high school English teacher is probably freaking out somewhere.

Time Machine and AirDisk 3

Posted by Matt on March 23, 2008

With the latest firmware release for Apple’s Airport Extreme Base Station router comes the ability to use a connected USB drive as a Time Machine backup disk. I (and many others) have waited for this feature since Leopard’s release six months ago.

The big question is if it would work as expected. In my case, my Macbook easily found the drive and Time Machine recognized it. The initial backup (50G) took all night even with a supposed 100MB throughput. Subsequent backups were slow to complete, if they even started at all. Most of the time (80% or so), Time Machine would hang with “Preparing Backup”.

One other thing that slightly annoyed me was that Time Machine creates a sparse bundle image on the AirDisk containing your backups. I assume this is done as many people can potentially use the AirDisk for backups. This causes two mounts on your system instead of one. Not a huge deal, but it’s just one more thing that can fail. I don’t like things that can fail in a backup process, especially one that is designed to be so behind the scenes.

Right now, Time Machine is doing its initial backup again as a USB connected drive to my trusty Macbook. The AirDisk seems to still have some quirks that need to be ironed out.

Also of note, I suffered a hard drive crash last week and luckily I did have Time Machine backups. I have to say that restoring Leopard from Time Machine was effortless and it was also the very first time I’ve had a full restore of an operating system actually work in over a decade of Windows, Linux, and Mac usage!

No Audio in Leopard Fix

Posted by Matt on March 21, 2008

Alright, this one is odd, but it works like a charm. I recently installed Safari 3.1 on my new MacBook and after a reboot I had no audio whatsoever (though the startup chime worked). When I messed with the sound via the keyboard buttons only a greyed out icon and a barred circle appeared. I also noticed a red LED inside my headphone jack (what the hell?)

Googling around I found a super weird fix here.

The fix is to get a toothpick and stick it all the way into your headphone jack roll it around the edge of the jack until the light goes off. Yeah. I know. It really works though. I swear.

My audio was working again immediately without a reboot!

Obama is majestic

Posted by Matt on March 20, 2008

Finally. A politician that doesn’t feed on ignorance nor treats the people as children. Thank you Obama for finally speaking the truth.



I read somewhere once that governments used to sell hope and safety to its people instead of nightmares. I’d like to see the country rally around hope instead of the monsters in the closet.