Ruby On Rails

Scaling up with Rails and EC2

A challenge I faced recently was "scaling up on demand" (without manual intervention). EC2 was the my platform of choice because I could write a small script to manage all my machines. EC2 being Xen based also allowed me to create custom images of my application servers.

  1. Hook into the load balancer's health monitor
  2. If the load goes over 70% launch a new ec2 instance
  3. If the load goes under 50% remove an instance

Example:

  • @ 7am - 2 servers
  • @ 1pm - 4 servers
  • @ 6 pm - 3 servers
  • @ 9 pm - 2 servers

I have a base of 2 machines, and no real limit set to the maximum number of ec2 machines that can launched. The script is set to send me a mail every time a new machine is launched or terminated.

Now I am trying to automate creation of MySQL Slaves

Change.org goes 2.0!

After months of hard work and sleepless nights, we finally launched the second version of change.org. I generally try to talk about cool things I am working on; but this was not possible with change.org because there was no time to waste. Every minute counted.

Today we launched the second release of the site, which not only helps you support changes you would like to see in the world. But also find politicians that are willing to support your cause. We spent hours discussing if change politics should be a site of its own, because some of us did not support the idea diverting focus away from the non profits ( at some point I belonged to this camp ) but after careful evaluation we managed to find our own middle path.

Good list of Ruby on Rails Resources

Ruby on Rails is quickly becoming one of the most popular modern programming language framework combinations. Specifically, Ruby is a programming language that has been around for a few years and Rails is a framework for Ruby that is a bit newer and is just about the hottest thing in application and web development right now. Rails' seamless integration into web servers and databases and its elegant framework make it the ideal candidate for every programmer wishing to develop the latest and greatest web application.

Prototype Windows and Ajax Scaffold Dreams

I started writing a blog article on how to integrate the cool prototype windows and ajax_scaffold, half way through I got bored of writing it and just decided to upload my mutated version of it.

You need to manually install the prototype window javascript. Any one with basic rails knowledge should be able to do this.

Its just a quick hack by the way..

ajax_scaffold_generator-3.1.5+prototype_windows.zip

How to use Rails with Monotone

h3. What is monotone?

Monotone is a free distributed version control system. it provides a simple, single-file transactional version store, with fully disconnected operation and an efficient peer-to-peer synchronization protocol. it understands history-sensitive merging, lightweight branches, integrated code review and 3rd party testing. it uses cryptographic version naming and client-side RSA certificates. it has good internationalization support, has no external dependencies, runs on linux, solaris, OSX, windows, and other unixes, and is licensed under the GNU GPL.

_Taken from the monotone website_

Emacs support for Ruby and Rails

This is a update to my previous blog post. All credits to the authors and contributors. I just host these files.

Installation for ruby support and ruby electric. Add the following lines to your .emacs file


(require 'ruby-mode)
(require 'ruby-electric)

Installation for ruby on rails support. Add the following lines to your .emacs file


(defun try-complete-abbrev (old)
(if (expand-abbrev) t nil))
(setq hippie-expand-try-functions-list
'(try-complete-abbrev
try-complete-file-name
try-expand-dabbrev))

(require 'rails)

Rodney asking me if I want to go for a smoke?

class Smokers <  ActiveRecord:: Base
 belongs_to      :heart_failure_statistics
 has_many        :cigarettes
 attr_accessor   :mins_since_last_puff

 before_validation :check_cigarettes

 def smoke?
   if mins_since_last_puff  >= 60
     write_warren("Smoke?") 
   end  
 end
end

Ruby on Rails 1.0 has finally arrived!

Finally after a long wait its finally here! There have been soo many changes since the early 0.5 days. I still remember the good ol' days where you had to do so many things manually. Thanks to the rapid development of the framework, most of this is taken care of now. I remember times where I had to spend time on apache to get things right and now every thing seems to work out of the box.

The community has grown from 10 to over 400 users (on IRC we lost a good few though). Hope to see Rails establish it self as the next industrial standard.

Since Rails .5 I have launched over 5 applications and 3 more are in the pipe line, one of them being the rewrite of Global Drum and Bass and the other being OurProject.org

Syndicate content