"Amigos y nadie más. El resto, la selva"
-- Jorge Guillén

Programming: Beginners Ruby: How to inquire about your network speed

So you are totally new to programming on a computer and you want to see how programs are done. The usual recommendation is "find a problem that you like and attempt to solve it using a programming language of your choice". In other words, if you already have the hang on how to write computer programs and you want to learn a new language, say Ruby, then you just need to try to solve known problems.

Here is a simple problem and its solution written in very simple Ruby. We will be writing a program that tests the speed of our network connection to the Google DNS You will need Ruby 1.9 to get this to work properly, as well as the net-ping gem. On an Ubuntu (11.10) system you can get these by doing:


Nifty parsing trick level 101

Say you have a file with lines like the following that need to be parsed into a data structure:

my_line has="values" and="also values" finally="values,"
my_2nd_line has="other values" and="also values with more" finally="values,and,valuables"

And you need a data structure like:

$obj->{my_line}->[{has=>"values",and=>"also values",finally="values,"},...]

In other words, you need a hash (key,value) that contains arrays which are hashes themselves. That would make it easier to navigate them and print anything you would like. (This is very common when parsing formatted text like XML files and so on).


Ubuntu Oneiric 11.10 Gnome 3 support

Be aware "Geek Level" for this post is 10/10!

Although is in the "universe", the upcoming release of Ubuntu 11.10 will include Gnome 3! That would mean that we no longer need to include PPAs from third parties or go through different bug tracking systems when something needs fixing.

I'd probably enjoy more if Ubuntu's team drop Unity altogether and ported whatever functionality to Gnome 3 so this would be the "official" display manager once again. However, I'm content to use this from Universe for now.

sudo do-release-upgrade -d # if you want to start using it today!

Be sure to read the Beta release notes before proceeding as this will break your system for sure!


Rails v3.1.0 released

Apparently without much fanfare, Rails v3.1.0 was released to the wild.

Rails v3.1.0 ready

To download it just do:

sudo gem install rails -v 3.1.0


How to share your internet connection over Bluetooth

As you already know, MacOS X allows you to quickly share your internet connection with others with a few clicks. However, what if you want to share your connection using your bluetooth device in the same way that the iPhone personal hotspot works?
Say you are in a strange place or your computer does not have the wifi drivers and you need to connect to the internet quickly. You can share your Macbook connection by following these simple steps.

1 Go to the Bluetooth Preferences

Bluetooth preferences