Fubaredness Is Contagious

Dmitriy Samovskiy’s Blog

Entries Tagged as 'ruby'

Capistrano Auth Trick

October 7th, 2009 · 2 Comments

This past summer, we needed to automate testing of several failure scenarios for VPN-Cubed. Having asked the LazyWeb about any frameworks that could help us and having gotten no response, our dev team had a short chat in the office. We decided that ultimately we were going to have to roll out our own system [...]

[Read more →]

Tags: infrastructure development · ruby

Why I Sometimes Prefer Shell To Ruby or Python

June 11th, 2009 · Comments Off

Shell was among the first things I got familiar with when I was introduced to Linux. It’s not a typical programming language, primarily due to lack of easy-to-use high-level data structures such as hashes and arrays (anticipating your objection to this – note I said “easy-to-use”). This may explain why I often get funny looks [...]

[Read more →]

Tags: python · ruby · software engineering

Adjustable Per-URI Backend Capacity in Rabbitbal

March 11th, 2009 · Comments Off

I recently pushed a Rabbitbal update to Github – http://github.com/somic/rabbitbal.
The biggest enhancement (IMHO) is ability to increase or decrease the number of backend consumers based on any HTTP request headers. In “table” routing mode (see rabbitbal.yml), you can now specify array of tests against which incoming request headers will be matched. This will cause your [...]

[Read more →]

Tags: rabbitmq · ruby · web

RabbitMQ and Rails

January 29th, 2009 · Comments Off

A quick note. This blog is getting a lot of google referrals for people looking for “rabbitmq rails”. I just wanted to say that I do not have good up-to-date material on the subject. Instead, check out this thread on ruby-amqp mailing list and consider tmm1-amqp gem for your project.

[Read more →]

Tags: rabbitmq · ruby

Introducing Rabbitbal

December 18th, 2008 · 2 Comments

Inspired by Nanite, a very interesting project by Ezra Zygmuntowicz of EngineYard that uses RabbitMQ and eventmachine-based ruby amqp library by Aman Gupta, I sat down and wrote Rabbitbal, a reverse proxy for Rails (as well as other web frameworks, not necessarily limited to Ruby) on top of RabbitMQ. It’s now available on github at [...]

[Read more →]

Tags: rabbitmq · ruby · web

Forking Supervisor Daemon in Ruby

December 3rd, 2008 · Comments Off

Here is my implementation of a forking supervisor daemon in ruby.

pre { font-size:10px; }

[Read more →]

Tags: ruby

Rails update_attribute vs update_attributes

September 22nd, 2008 · Comments Off

In Rails, update_attribute method bypasses model validations, while update_attributes and update_attributes! will fail (return false or raise an exception, respectively) if a record you are trying to save is not valid.
This means that if at certain point during the project you adjust validations such that some records that used to be valid are now invalid, [...]

[Read more →]

Tags: ruby

Selecting “FIELD AS NAME” in ActiveRecord Always Returns String

July 17th, 2008 · Comments Off

If I select “field as alt_field_name”, the value will always come out as String, not what the field actually is.

 
>> User.find(:first, :select => :created_at).created_at
=> Wed Jan 24 00:04:59 UTC 2007
>> User.find(:first, :select => "created_at").created_at
=> Wed Jan 24 00:04:59 UTC 2007
>> User.find(:first, :select => "created_at as created__at").created__at
=> "2007-01-24 00:04:59"

[Read more →]

Tags: ruby

Ruby + AMQP + RabbitMQ Example

June 24th, 2008 · 5 Comments

In this post I would like to show how one can exchange messages using AMQP protocol from Ruby, using RabbitMQ as a broker. I posted the original version of this script to rabbitmq-discuss mailing list back in September 2007.
Prerequesites:

RabbitMQ broker configured, up and running on 127.0.0.1 (localhost) on port 5672 (standard AMQP port).
Apache QPid Ruby [...]

[Read more →]

Tags: rabbitmq · ruby

Now Boarding: Elastic Passengers

April 23rd, 2008 · Comments Off

Starting today, Elastic Server On Demand allows you to select Phusion Passenger (mod_rails for Apache) as a web container for your Rails 2 application. This allows you to deploy a Rails app on Apache, the world’s most popular web server. Check it out at http://es.cohesiveft.com/site/rails2.

[Read more →]

Tags: ruby · work