Backup your Gmail

Like all hosted services, you should never depend on one provider to both manage your data and also back it up. I have 15 years of email in my Gmail account (that I migrated from previous providers) and I’d be pretty sad if I were to lose it.

As some users have discovered the hard way, if your Gmail account gets compromised and your email is deleted, you’ll likely never get it back unless you have an off-site (outside of Google) backup.

One great service that does this for you is Backupify and their free plan will backup mailboxes up to 1GB. I personally love cloud data but prefer local backups so I use Getmail Continue reading

Posted in Cloud Computing, Linux, OSX, Systems Administration, Technical | 1 Comment

Naming your business or product, forget the domain

Pick a name that is easy to spell, unique, and memorable! It’s a lesson I learned the hard way.

Don’t spend your time surfing for available domain names, you’ll tear your hair out and pick a worse name as a result. Focus on good names for your business or product. Then when you have the name focus on a domain name for it as a secondary concern. You will build your brand recognition Continue reading

Posted in General | Tagged , , | Leave a comment

Storing Git repositories in Amazon S3 for high availability

At VolunteerMatch we’re experimenting with using Chef Solo to manage Amazon EC2 servers. The catch is that if a server is going to rely on Chef to boot up, then the Chef Recipes (which we’re storing in a Git Repository) need to be highly available.

Here’s how we went about using a private S3 bucket to store our Git repository of Chef Recipes. Thanks to this post on using JGit to publish to S3 which got us started, the key difference is we wanted to use a private S3 bucket and it took us some experimenting to figure out how to update an existing Git repo (via fetch and merge) from S3.

Download jgit.sh, rename it to jgit and put it in your path (for example $HOME/bin). Continue reading

Posted in Cloud Computing, Java, Linux, Source Control, Systems Administration | 2 Comments

Acceptance Testing non Ruby web applications with Cucumber

If you’re looking for the sample Standalone Cucumber Test Suite to get you started testing non Ruby based applications with Cucumber, here’s the source: http://github.com/thuss/standalone-cucumber.

Sometimes you inherit a non Ruby based web app written in PHP, Perl, Java, C#, or Python and you want to create an automated functional/acceptance test suite to minimize the amount of manual QA you need to do. Continue reading

Posted in Continuous Integration, Java, Quality Assurance, Ruby, Ruby on Rails, Testing, Web | 1 Comment

Code readability through conciseness

One of the things I love about newer languages like Ruby and Scala (and to a degree Python and Groovy) are the language features that allow you to dial conciseness up or down for readability. Take for instance the typical one liner for summing numbers in languages that support anonymous functions (which can be a bit cryptic in terms of readability):

Ruby
sum = [1,2,3,4].inject(0) {|result, value| result + value}
Scala
val sum = Array(1,2,3,4).foldLeft(0) ((result, value) => result + value)
Groovy
sum = [1,2,3,4].inject(0) { result, value -> result + value }
Python
sum = reduce(lambda result, value: result + value, [1,2,3,4])

One of the jobs of a good programmer Continue reading

Posted in Java, Ruby, Scala, Software Engineering | 8 Comments

Mac OS X gem cleanup failing

Ruby GemsAfter upgrading to Snow Leopard I started noticing that whenever I would run sudo gem cleanup it would fail with many errors about being unable to uninstall various gems. I ignored it until the list grew unbearably long but the only solutions I could find on the web were to go through one gem at a time. The errors looked like this:

...
Attempting to uninstall rails-2.3.5
Unable to uninstall rails-2.3.5:
Gem::InstallError: cannot uninstall, check `gem list -d rails`
...

Following the instructions I then ran Continue reading

Posted in Uncategorized | 7 Comments

iPhone development the easy way

iphone Update 8/7/2010 PhoneGap apps are still being allowed in the app store! It’s not the right solution for every app (for example we went native with the Common Sense Media app), but I still think PhoneGap is really cool.

I’ve been doing some iPhone and iPod Touch development and if like me you’re used to web development in languages like Ruby, Java, and Python, the learning curve to build a native iPhone app in Objective C is quite steep. Since my applications are online (in that you need to be connected for them to be useful) I was pysched to find a much easier way using two great open-source tools:

iUI consists of Javascript/CSS/images that allow you to build a mobile version of your app that looks and feels just like a native iPhone app

PhoneGap lets you create an iPhone application (that can be submitted to the app store) that displays a framed mobile version of your site

To build your iPhone app: Continue reading

Posted in Ruby on Rails, Software Engineering, Web | Leave a comment

Production MySQL performance tuning

mysql For the past 9 years I’ve been working almost exclusively with MySQL (with a little PostgreSQL thrown in) and while I don’t do nearly as much DBA work these days, I still find myself troubleshooting a query or tuning my.cnf. While in general I find MySQL to be a lot more straightforward to work with, it’s still equally important to tune it for your applications needs.

To that end one of the tools I want to give a shout out to is the MySQL Performance Tuning Primer Script. You download and run it against a production system Continue reading

Posted in Database, FreeBSD, Linux, MySQL, Systems Administration | Leave a comment

Selenium Continuous Integration Runner

selenium At Common Sense Media I wanted to get some functional testing up and running that didn’t require a lot of user training for the QA folks. I also wanted those tests to run in our Rightscale/Amazon EC2 hosted Hudson continuous integration server. As a result I’ve published the:

Selenium Selenese Continuous Integration Runner

on GitHub in the hopes that it will save other people time when trying to get their Selenese tests running from a continuous integration server. It’s very simple but one thing I battled with was that I had to patch the selenium JAR to get it to work with Firefox 3.0. It should work fine in any continuous integration server regardless if it’s Hudson, Cruise, Cruise Control, Bamboo, etc.

The functional testing products I’ve used that drive a real browser include Test Complete (commercial), Selenium, and Watir. I think all 3 do a good job but one thing I like about Selenium is that it’s dirt simple to get a user productive with the Selenium IDE Firefox plugin. However, that benefit is also the most limiting factor of the Selenium IDE which is that to be able to re-open tests in Selenium IDE you have to save them as Selenese (which is the most limited of the testing languages that Selenium supports). Still, I think Selenese is a reasonable choice for a lot of organizations that need a moderately sophisticated functional test suite.

Posted in Agile Development, Continuous Integration, Java, Javascript, Quality Assurance, Software Engineering, Testing | 4 Comments

Standalone Migrations: Using Rails migrations in non Rails projects

Standalone MigrationsUpdate 8/7/2010: Standalone migrations is now a gem (sudo gem install standalone_migrations) so disregard the outdated installation instructions below

Update 7/8/2009: With the latest batch of contributed patches standalone migrations now works just like Rails migrations
Update 12/26/2008: I switched standalone migrations to use a Rakefile instead of a Ruby script.

In my work managing websites I end up working in Ruby, Java, and PHP. In everything but Rails managing the schema requires rolling your own solution. As a result I’ve started using Rails migrations in non-Rails projects to manage the schema. It’s not much code but I figured others might benefit from it so I created a little Github project called standalone migrations.

It’s based on Lincoln Stoll’s blog post titled Stand-alone ActiveRecord migrations and David Welton’s blog post titled Using Migrations Outside of Rails.

Assuming you have Ruby and Gem installed on your machine, here’s how to use it:

gem install -y activerecord rake mysql
wget http://github.com/thuss/standalone-migrations/zipball/master (or fetch it using git)
unzip it, and mv to something like my_non_rails_project/db
cd my_non_rails_project/db/ (or wherever you put it)
cp config/database_sample.yml config/database.yml
vi config/database.yml
./new_migration some_user_story
vi migrations/*_some_user_story.rb
rake db:migrate (this applies your newly created migration)
Posted in Database, Java, Linux, MySQL, Ruby, Ruby on Rails | 5 Comments