Sneak peak of the redesign of slim-lang.com. :)

Sneak peak of the redesign of slim-lang.com. :)

[Ruby] Releasing Ssync - An Optimised S3 Sync Tool Using the Power of Unix!

At Envato we have a few dozen sites residing on multiple servers. The data on a portion of the servers need to be regularly backed up to Amazon S3.

The Envato Mad Scientist Ryan Allen has worked on a script called Sir Sync-A-Lot which syncs the data to S3. This was done after evaluating a bunch of scripts including s3sync.

Today I turned Ryan’s original script into a little Rubygem and added a bit more features.

Go check out the source code!

A Speedier Rails App using Rails 3.1 + Arel 2.0

Before (Rails 3.0.1pre stable branch + Arel 1.0.1):

After (Rails 3.1.0 master branch + Arel 2.0.0dev master branch:

Thanks to the awesome work done by Aaron Patterson (@tenderlove) and others. :-)

UPDATE:

After Aaron Patteron’s tweet, I ran the tests again on Rails 3.0.1pre stable branch + Arel 2.0.0dev master branch, and the result blew my mind:

`bundle: command not found` or `Could not find RubyGem bundler (>= 0)` During Capistrano Deployment? No Problems!

Don’t you just hate it when you get the following errors during a Capistrano deployment?

bundle: command not found
Could not find RubyGem bundler (>= 0) (Gem::LoadError)

In fact, even if you don’t use bundler, you might still get errors like this:

rake: command not found
Could not find RubyGem rake (>= 0) (Gem::LoadError)

It turns out this has something to do with the $PATH and $GEM_HOME variables.

So here’s the quick fix.

Log in to your deployment server, as a root user, add the following line to /etc/ssh/sshd_config:

PermitUserEnvironment yes

Don’t forget to restart ssh:

/etc/init.d/ssh restart

Now, log in as the deployment user, and create ‘~/.ssh/environment’ with the following content:

PATH=/usr/local/rvm/gems/ruby-1.9.2-p0/bin:/bin:/usr/local/rvm/rubies/ruby-1.9.2-p0/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
GEM_HOME=/usr/local/rvm/gems/ruby-1.9.2-p0

* The above paths are for your reference only, obviously you need to work them out for your server environment. The only thing you need to make sure is that the GEM_HOME’s path matches one from the PATH.

Now, to verify this all work, you may use cap shell to start a new shell session and try out your commands.

Wuit trademarked in Australia now! :-)

The trademark application in the US is being progressed as well.

If you don’t already know, Wuit is my soon to be launched studio identity.

Wuit trademarked in Australia now! :-)

The trademark application in the US is being progressed as well.

If you don’t already know, Wuit is my soon to be launched studio identity.