Blog
Pool-party, Auto-scaling with EC2 1

Photo by hrlndspnks
Ari Lerner has created a ruby gem called pool-party. It auto-scales your ec2 cluster based on criteria you set in the config file like average requests per second. Set your minimum requests per second and if the average of all the servers on your cluster goes over the maximum, pool-party will launch another instance for you. It scales down in the same way. It doesn't care what you're using your cluster for and a its going to support plugins soon so you can add in your own hook like functionality. Pool-party is using s3fuse to mount an s3 bucket on the instance at startup. Specify a bucket in pool-party and it gets mounted at /data on each instance. This solves the data persistence issue with ec2. You're not required to use it though, just don't specify a bucket in pool-party and nothing gets mounted.
Ari open-sourced Pool Party as of 2 days ago. Check it out at poolpartyrb.com. If you want to contribute, its on github at http://github.com/auser/pool-party.
Does Microsoft hate Gmail?
This is an automatically generated Delivery Status Notification
Delivery to the following recipient failed permanently:
xxxxxxxxxxx@msn.com
Technical details of permanent failure:
PERM_FAILURE: Gmail tried to deliver your message, but it was rejected by the recipient domain. We recommend contacting the other email provider for further information about the cause of this error. The error that the other server returned was: 550 550 SC-004 Mail rejected by Windows Live Hotmail for policy reasons. A block has been placed against your IP address because we have received complaints concerning mail coming from that IP address. If you are not an email/network admin please contact your E-mail/Internet Service Provider for help. Email/network admins, we recommend enrolling in our Junk E-Mail Reporting Program (JMRP), a free program intended to help senders remove unwanted recipients from their e-mail list: http://postmaster.live.com (state 13).
The first time this happened it was to an msn address. The next time to a Hotmail address. Do you think someone is using their Gmail account to send spam or is it more likely Microsoft is just blocking mail from Gmail users?
I sent the same email again but used my custom domain on my Gmail account instead of my normal Gmail address. The mail went through fine. Both emails should have come from the same ip address, they were sent less than a minute apart but the one with the source address @gmail.com got rejected. Post a comment if you've experienced this also or if you have an opinion.
Installing git on linux
Trying to install git from source on our linux server (we're running RHEL4 at work) and I was getting an error running make.
undefined reference to `libiconv'
Running make like this worked.
make install CFLAGS="-liconv"
But after the install was finished, running git barfed at me about loading a shared library libiconv.so.2.
I had to edit /etc/ld.so.conf and add /usr/local/lib and run ldconfig.
Credit Mark Turner for the ldconfig tip. Thanks man.
Making the jump to full time freelancing

Photo by Jack Spellingbacon
This week its all about changes. I've moved most of the site over to Radiant, except for the blog. I've also done some design changes and added a hire me page. This is in anticipation of May 15th when I'm planning to start full time freelancing. I've been doing development for 10 years now. I have experience running my own business and working closely with clients and end users so although its a new season for me, its not something I'm unfamiliar with.
Something that I am completely new to is teaching children. I'm planning to begin home schooling my kids in the coming months and I'll be writing about that in the blog as well. If you're interested in home schooling or freelancing or you just want to follow along to see how things go, subscribe to the blog.
Fixed Length Random numbers in Ruby 2
My latest project is almost complete and we're setting up a demo site with lots of fake data already included so I used the faker gem to generate most of it.
One issue I had that I couldn't do with the faker gem out of the box is get a fixed length random number. I need this for license numbers, credit card numbers, phone numbers and others. The faker gem does offer a random phone number but the ones in my project don't support extensions or punctuation so rather than generating the number then using string functions to strip out the stuff I didn't want, I decided to find an easier way.
I started by Googling for it assuming that someone else had already figured it out and while I'm sure its been done a hundred times before, I couldn't find it anywhere. So after much thought and digging through the ruby docs, this is what I came up with.
rand(9999999999).to_s.center(10, rand(9).to_s)
rand(9999999999) will give me a number between 0 and 9999999999. Convert it to a string and use the center method to make sure its at least 10 digits long and pad the rest with a random number from 0-9. rand(9)
If you need a number of say 7 digits in length, just change the first rand to rand(9999999) and change the center method length to 7 so it looks like this.
rand(9999999).to_s.center(7, rand(9).to_s)
Hope this is helpful to someone.
Subversion script for Rails developers 3
I read somewhere that good developers use version control. There's a good article on HowtoUseRailsWithSubversion.
So why should I repeat those steps for every new project I work on.
Rapt error during peepcodes test first development tutorial 4
OK, let me start off by saying, I love the tutorials from peepcode, you guys are doing a great job so keep doing it.
Alas, I got stuck while watching the Test-first-development tutorial. They were using Rapt as an alternative to script/plugin and when I tried to run it I kept getting an error.
Error: RaPT currently does not work outside of a Rails application directory. Please change to the top level of a Rails application and try again.
This error is misleading but at least it was obviously misleading, after all I know I'm in my Rails application directory.
Mysql Backup Script
Need a way to backup all your mysql databases in seperate files without eating up your hard drive, then this is the script you need.
Its a bash shell script that will export all your databases with mysqldump into seperate files named like 'database-date.sql'. It will also delete your old backups so you don't fill up your hard drive.
Redundant Failover firewall with pf, pfsync and CARP on FreeBSD
This is a step by step tutorial that should take most of a day. I'm posting this here mostly as a reminder so that I can come back and read it when I need to build another firewall but hopefully it will be helpful to someone else also. If you find this tutorial useful or if you find anything wrong with it, send me an email hammockintahiti@gmail.com.
First Post
I’m a pretty well rounded guy. I love coding in Ruby on Rails and Flash, I’ve done extensive work in php and mysql and I’m an experienced Unix server administrator.
I’m currently working for a small company and I’m the only IT person/developer so I get a lot of experience setting up and maintaining infrastructure as well as designing websites and applications.
You can see some of my work on the projects page.
I’m starting this blog so I can post some stuff I’ve learned along the way. God knows I’ve learned a lot from others taking the time to post what they know.
Stay tuned for articles that may or may not be useful, intriguing, or funny. Probably some photos of my kids too.


