Latest posts

Tamaño y distancia en el Sistema Solar

Working with isolated environments: vagrant, lxc and puppet

In my daily work I have to switch between projects and databases a lot, forcing me to install lots of services: mongo, postgre, mysql, memcached, elasticsearch, and a lot more. This turned out to be a mess, difficult to maintain and reproduce.

I had tried Vagrant for virtualization, but I was not happy with the virtualbox performance: I don’t like wasting memory and CPU time. I was going to try KVM, but a friend suggest “LXC” (Linux Containers).

LXC is often considered as something in the middle between a chroot on steroids and a full fledged virtual machine

The combination with Vagrant is just amazing: superfast and stable. I love it. I can start and stop projects along all their services in a breeze. And the best part: Vagrant supports very nice puppet integration, so I have written some simple recipes to install everything a project needs. I can run “vagrant destroy” and “vagrant up” and have a new working environment in minutes. This is how the VagrantFile and recipe looks like:

By the way, using Vagrant I got tired of using SSH to start thin. I foung a nice old tutorial (written for hardy!) that still works wonders to set up thin as a system service: http://articles.slicehost.com/2008/5/6/ubuntu-hardy-thin-web-server-for-ruby.

I have also heard about Docker with also uses LXC in the background, but it looked too complex for my needs :).

Making your life easier with Git

git config --global push.default current
git config --global color.ui true

http://stackoverflow.com/questions/948354/git-push-default-behavior

Capturando partículas cósmicas … con una pecera!

¿Quién se anima a reproducir el experimento? / Anyone willing to reproduce this?

Validando DNIs en Rails 3

Estaba buscando una solución fácil para validar el formato de los DNIs en Rails 3 y finalmente he añadido esto a mi aplicación: