rui lopes notebook

Testing the Elasticsearch cluster behavior under network failure

Elasticsearch is a distributed system that depends heavily on the network, as such, you need to known how it behaves under different failures scenarios. This post shows a way of mounting these scenarios with Linux containers.

You can simulate a couple of failure scenarios:

  • Node network loss
  • Packet delay and/or loss

This setup should also be generally useful when you want to known how Elasticsearch behaves. For example:

  • Expand or shrink the cluster
  • Node maintenance
  • Backup/Restore
  • Shard re-allocation
  • Near disk full behavior

The setup will be created with the help of: VirtualBox, Vagrant, CoreOS and Docker.

continue reading »

From Iso To Vagrant Box

This is my recipe on how to automatically create an up-to-date Ubuntu Vagrant box file from an iso.

You need the following ingredients:

I use the minimal ISO because the regular ISO does not always contains the latest package versions, so you’ll not end up having to update your system just right after you install it. This is because the mini ISO installs the latest packages right of the internet; it is also much smaller than the regular ISO.

Packer is used to install Ubuntu into a Vagrant box file. Packer uses a template file to describe that process. The template uses a preseed file to drive the Debian installer (aka d-i) to automatically install Ubuntu in a VirtualBox Virtual Machine, which will be later exported into a Vagrant box file.

Vagrant is used to automatically create and setup (or provision) a development environment inside a Virtual Machine. Vagrant uses a Vagrantfile script to describe that process.

VirtualBox is used to actually run the Virtual Machine.

You can find the sources at rgl/ubuntu-vagrant, but read along to known more details.

continue reading »

From zero to a blank world map

When you need to show a web map you normally end up using something like:

var map ='map').setView([38.736946, -9.142685], 3);

But what does it take to show that map? What software stack lays behind the curtains? And how can you customize the map? Lets find out!

We start from a vanilla Linux Virtual Machine and end up showing a humble web map – a blank world – the hello world of maps.

continue reading »

Taking web application screenshots with CasperJS

When you need to take screenshots of a web application, the normal route is to navigate to a page, fill in the forms with sample data, use the Print screen (or Alt+Print screen) key to take the screenshot, then crop and export it with a normal application like GIMP… which is quite time consuming… and god forbid if you need to do it again, with a slightly different data or page design…

A better route would be to automate the whole process. Let me show you how to do it with CasperJS!

continue reading »

Fix magnet link openning in Xfce / Arch Linux

The current Xfce (4.10) that ships with Arch Linux has an annoying bug of not correctly opening Magnet URIs (e.g. when you click a magnet link from within Chromium). So I had to have that fixed, but doing it took longer that I expected… so I’m creating this recipe for helping you solving the problem more easily.

continue reading »

Hello World

Hello World! How’s that for a start? Its one of those (rare) things I like about developers tradition, in this case, the English language version. This should give you an hint about one of my facets.

Oh, this is my first blog ever, so please bear with me while I push my inner self to write. In the mean time, you can follow me on twitter.


continue reading »