I had a bit of trouble figuring how this should look like. Ended up finding it here. Basically, it should look something like:
—
starling:
queue_path: spool/starling
pid_file: pids/starling.pid
log_file: logs/starling.log
daemonize: true
INCLUDE_DATA
April 21st, 2009 — Uncategorized
I had a bit of trouble figuring how this should look like. Ended up finding it here. Basically, it should look something like:
—
starling:
queue_path: spool/starling
pid_file: pids/starling.pid
log_file: logs/starling.log
daemonize: true
April 21st, 2009 — Uncategorized
I use Enterprise Ruby for anything ruby. Here is the no none-sense process:
Done! Enjoy
April 19th, 2009 — Uncategorized
It’s documented, but I’ve somehow missed it. I was running this migration:
This kept failing with: undefined method `original_name=’ for #<Unit:0x3b61aa4>
After some poking around, comes reset_column_information to the rescue. After adding the columns and before looping, just add Unit.reset_column_information. This will reload the Unit model with the new columns, and all will go well.
March 3rd, 2009 — Rails
Installing metric-fu is a really manual process. Copy the following and paste it in your shell:
sudo gem install flay
sudo gem install flog
sudo gem install rcov
sudo gem install railroad
sudo gem install reek
sudo gem install roodi
sudo gem install jscruggs-metric_fu -s http://gems.github.com/
February 23rd, 2009 — Apache, Ubuntu
Want to stop users from known blacklisted IP’s from accessing your site? Well, mod_definsible is the apache module for you. Here’s how to install it on Ubuntu:
sudo apt-get install libapache2-mod-defensible
then to enable the module do:
a2enmod defensible
Now create a file in /etc/apache2/mods-available/defensible.conf and put the following couple of lines in it:
DnsblUse On
DnsblServers xbl-bl.spamhaus.org. mydnbl.server.org.
Now restart apache and you’re all set. Now whenever a user that’s on spamhaus’s blocklist tries to access your site, they get a 403 Forbidden page.
February 4th, 2009 — AWS, Rails
I’ve been spending the better part of a year working on MoreDating, a dating site with a twist. It was and still is a joy to work on. I was asked to write my experience in deploying to EC2.
Let me start by saying that I am really impressed with EC2. It is super quick, and so far has been very stable. Let’s start with the technicalities.
In this installment I will be talking about how I got EC2 up and running, and the preliminary configuration of the environment.
I started out by getting an Amazon account, of course. You sign up by visiting: Amazon AWS. I then headed on to http://alestic.com/ to get the AMI that I need. Note that to use the 64-bit versions, you will need to setup a large EC2 instance. Now when I set it up, there wasn’t a pretty shiny interface for AWS, so I used elastic fox, the EC2 plugin for firefox (ElasticFox).
To spin up a new instance with all the necessary permissions, follow the Amazon EC2 Getting Started Guide . When it comes to the part about running an AMI, put in the ami path from the image you would like to use from alestic.
Once it’s up an running and you’re all connected, you can now start to configure it to your needs. Once we’re done with the configuration, we’ll go through taking an image of your instance so that you can spin other identical instances and to have a backup in case your instance goes haywire.
In my next post, I’ll be talking about capistrano setup, my deploy.rb script, and the costs of running EC2 full time + our use of S3 so far + our use of EBS.
Here’s a sample of the passenger and worker-specific of my apache2.conf and my bash_profile
December 5th, 2008 — jQuery
Getting a “Expected identifier, string or number” error in IE using jQuery? Yeah I know, it takes forever to debug. In my case it was because I had one of those in my code:
$(element_id).attr({class: ‘signup_label_err’});
Apparently, class is a reserved keyword and this is what causes the error. Solution? Easy, just replace it with:
$(element_id).addClass(‘signup_label_err’);
Enjoy IE worry-free days.
October 30th, 2008 — Rails
Got that one? Ha! Me too
Well apparently, Rails 2.1 doesn’t have TimeZone.adjust anymore, which is being called by vendor/plugins/exception_notification/views/exception_notifier/_timestamp.rhtml. All you have to do is replace those two lines:
time_zone = TimeZone.new(“Eastern Time (US & Canada)”)
timestamp = time_zone.adjust(Time.now)
and replace them with:
time_zone = ActiveSupport::TimeZone.new(“Eastern Time (US & Canada)”)
timestamp = Time.now.in_time_zone(time_zone)
A diff file is attached. Happy updating!
June 17th, 2008 — Uncategorized
Just installed firefox 3? Missing firebug highlighting? I guess you probably went to http://getfirebug.com and only saw the link for 1.0?
Fret not, the solution is here: https://addons.mozilla.org/en-US/firefox/addon/1843. Firebug 1.2 beta. The release version should be coming out in a couple of days.
June 7th, 2008 — Rails
Am I the only person in the world with this problem? I searched all over the web for a fix, but no one was even talking about it. The error I get is:
ArgumentError in My/profiles#show
wrong number of arguments (2 for 1)
I am running Rails 2.1, and putting a run-of-the-mill date_select crashes with the error shown in the title. I scratched my head at first, then banged it against the wall. I don’t know how this could be broken, but here is how I monkey-patched it.
Create a file in config/initializers and call it anythingyouwant.rb, and paste this in:
module ActionView module Helpers class InstanceTag #:nodoc: def to_date_select_tag(options = {}, html_options = {}) date_or_time_select(options.merge(:discard_hour => true)) end end end end |
That should fix it.