Clicktale is a service that allows you to record and later playback behavior of your users while they are using your site. And Rails is Rails, you know. And those two are getting along just fine, until the user logs in. After that clicktale service is cut out of the html pages this user gets and can’t record the session. But it just started to get interesting…

This plugin brings back the connection between Clicktale and Rails even for those closed pages. You’re going to get your better usability after all.

Read the rest of this entry

I just pushed new version 0.1.9 of astrails-safe to github.

The main difference is a fix to an embarrassing bug in the S3 backup rotation code. Thanks to Thuvarakan Tharmalingam for reporting.

Again, the reason it escaped was the fact that we don't yet have full test coverage. We are getting there though....

It looks like our astrails-safe gem is quite popular :). People started to contribute new features:

I just released new version 0.1.8 on the github.

In addition to postgre/svn support this release also includes a long overdue test suite.

Read the rest of this entry

Mephisto commenting system is… how do i put it … outdated :)

And we wanted something more engaging for our blog. Looking around the web we found that Disqus was used all over the place, so we decided to integrate it into our blog instead of the native comments system.

Read the rest of this entry

Wouldn’t it be cool if you could just require “http://my-host/my-lib.rb” in ruby?

Now You Can! Using our “http_require” gem! :-)

test.rb:

require "http_require"
# this will download bar.rb and eval it
require "http://example.com/foo/bar.rb"

If a remote file (or one of its local dependencies) requires something that can’t be found locally, it will try to find it remotely from the same location as the parent.

Example

http://example.com/test/foo.rb:

# this will load "http://example.com/test/foo/bar.rb"
# if "foo/bar" is not available locally
require "foo/bar"

Stacktrace

http_require properly sets filename on eval so that the file’s URI appears in the stacktrace:

http://example.com/foo/foo.rb:

puts :foo
require 'bar'
def foo
  bar
end

http://example.com/foo/bar.rb

puts :bar
def bar
  raise
end
$ irb
>> require 'http_require'
=> true
>> require 'http://example.com/foo/bar.rb'
foo
bar
=> nil
>> foo
RuntimeError:
    from http://localhost:2000/bar.rb:3:in `bar'
    from http://localhost:2000/foo.rb:5:in `foo'
    from (irb):3
>>

Installation

sudo gem install astrails-http_require --source http://gems.github.com/

Sources

You can find sources on github

UPDATE:

There seems to be lots of similar comments that I’d like to answer here:

  • Q: This is a HUGE security hole
  • A: No it isn’t. running it directly from the web is no less secure then downloading it and then running locally. you can use same security protections, for example SSH tunnel, or SSL like you would for any other kind of ‘code delivery’ e.g. rsync, scp etc. If you control the source and the ‘tunnel’ then this is no less secure, and if you don’t, then no other method is secure unless you start encrypting/signing files.

  • Q: Why on earth would you do something crazy like this?

  • A: It is kind of cool :) Seriously though I do have a real usage in mind for this (more on that later), meanwhile consider rails app templates (rails -m app_template.rb) which do support running templates form the web, and no one seems to be crying out laud about a huge security hole :) Unfortunately though rails templates do not support (not out of the box) breaking down such remote templates into subfiles. you will need to do manual path mangeling (see app_lego for example). I guess http_require can be used to do it cleaner.

Everyone needs a backup, right? Unfortunately almost no one does though. Why?!

We needed something for ourselves and our customers. Something simple, free, configure-and-forget. Most of the time there is no need for something fancy, a simple tar + mysqldump can do the job for many small/medium sites.

Read the rest of this entry

RRDtool is the OpenSource industry standard, high performance data logging and graphing system for time series data. Use it to write your custom monitoring shell scripts or create whole applications using its Perl, Python, Ruby, TCL or PHP bindings.

Let’s run it with Ruby on Leopard.

Read the rest of this entry

Thanks a lot to Amit Hurvitz for providing a file of Virtual Disk Image (VDI) of VirtualBox, containing an up and running JRuby on Rails on Glassfish with Mysql. Image also contains some examples (actually solutions to the code camp exercises), all running on top of an OpenSolaris guest OS (can be run on many host systems).

Grab the image ~1.5GB archive.

Grab the exercises ~9.7MB archive.

flushing OS X DNS cache

March 3rd, 2009

We recently moved our DNS to dnsmadeeasy.com from godaddy.com name servers.

After the transfer some internal CNAME records had a problem. So after fixing the problem and checking in the terminal that the changes propagated to the DNS server (host xxx.astrails.com) I tried to type the address in the browser, but it kept giving me the “can’t find host” error.

The solution was to flush OSX built in DNS cache (apparently the ‘host’ utility bypasses it, and browsers do not).

Fortunately it is very easy to do:

  • On Leopard: dscacheutil -flushcache
  • On Tiger (didn’t check it, no tigers here :): lookupd -flushcache

Non relational MySQL

February 27th, 2009

Nice idea and implementation of a schema-less data store on top of MySQL .

We participated in JRuby on Rails with GlassFish Code Camp hosted by Sun Microsystems Inc. I was speaking about the framework in general trying to infect Java developers with Ruby On Rails. Slides are available.

Amit Hurvitz gave exciting presentation about GlassFish and short introduction into DTrace. Find out more details about the Code Camp.

Rediscovering HAML

February 11th, 2009

I was the last person in our company working with ERB to render templates. While all the rest switched to HAML. At the beginning it was quite hard for me to read HAML comparing to ERB. HAML looked for me like some completely alien thing with weird percent marks all over the place and the significant whitespace never did it for me. On the other hand ERB felt like warm home after years we spent together.

Until I did the switch.

Read the rest of this entry

Another year in consulting

February 4th, 2009

2008 was the year when we finally switched to full time consulting. And like all consulters we faced the problem of correct pricing. There are two well-known ways to charge a customer: per-hour rate and fixed bid quote, and several combinations of them.

Read the rest of this entry

Recently we looked for video transcoding/hosting solution to use in one of our client’s projects.

The best thing we’ve found is Panda. It runs on Amazon stack of services including ec2, s3, and simpledb.

Using amazon has many advantages. no contracts, pay as you go, easy and fast scaling in case your site explodes :)

Unfortunately the image that is refered in the Getting Started (ami-05d7336c) is not safe for production – it has openssh version with a serious security bug, but don’t worry, we will explain how to fix it.

Read the rest of this entry

Deployment process requirements

December 17th, 2008

This blog-post is mostly targeted at non-Rails developers. Rails devs should know all this by heart :) Many times we need to explain to our customers what is ‘proper deployment’ and why their current one sucks :) Now we’ll be able to just point them to this post…

Proper deployment is almost not found anywhere. At least anywhere we looked. Very few places really ‘get’ it and assign enough importance to it. Some project owners just don’t know how it is supposed to be, so they accept their developer’s practice of ftp sync to production server :)

If you are a developer, make sure you implement it all.

If you have a project developed for you, then this is a checklist that you can bring to your developers/consultants and require ‘yes’ to every single one.

If your deployment procedure misses any of the qualities listed below, you are asking for trouble.

Production deployment must be:

Read the rest of this entry