Archive for the ‘software libre’ Category

When one friend asked to me for install for her a copy of Indexhibit on my server I was wasting a bunch of mails trying to understand why she wanted this creepy and unusable portfolio manager. One of her arguments was: because one friend told me that it is a ‘transparent portofolio manager’, at this moment I thought: ‘alright so it has to be something that runs on your computer and synchs your portfolio contents from your local hard drive to the online application’.

That was awsome, but this wasn’t what Indexhibit is.

Since this moment I was looking for the moment to develop by my self the kind of ‘transparent portfolio manager’ I was thinking on.

The result is still inside of my fingers but for the moment I have an experimental version ready to work: Vitreous.

Vitreous is a simple Ruby + Sinatra + Dropbox API application that looks on your Dropbox online folder and builds a simple web site with collections and items.

Using simple tricks you can: short the collections and the items, add a description text for each item, configuring home image and description.You can manage your portfolio just creating folders on your local hard disk and adding images to them. Dropbox and Vitreous will do the rest.

The next step is to build a multi user application so you will be able to open a Vitreous Portfolio just introducing your Dropbox Api Credentials on an online form. Multiple portfolios for unique user, template system, auto cache refresh,

…(I am still a few angry with the Dropbox API… I hope they will move forward soon).

Playing with the Dropbox API for an another experimental pet-project I needed to test how my mini-application was responding to different Dropbox contents. On the beginning I was configuring a real Dropbox account for testing but this was not agile and flexible. So this is because I decided to mock the dropbox ruby gem and this is because DummyDropbox has been born.

The working is simple: you point the gem to a local folder, all the dropbox API calls will think that this local folder is a real Dropbox account.

Lately I’m involved on projects that do a very intensive use of email accounts as input of information.

The use of mail in an automatic process is always a pain in the ass because of the huge casuistic and also for the difficulty to test it.

Nothing we can do with the first problem but for the second one here is my propose of a very simple Ruby Gem to mock the Net::POP3.start petition so you can simulate the emails that a real POP3 petition could find:

On a recent conversation with Raúl Murciano about the new improvements on the Twitter API I was defending the need of Twitter becoming an open protocol.

The first response could be “Why is this needed?, why don’t just use the Twitter platform?“, the answer is not easy to do with the mind it is more a feeling on the heart.

Twitter has been become on an incredible simple and useful service, twitter is everywhere and it is used for anything. It has become in the chat of our age, also in an alert system, in a marketing place, there where you want to put an small piece of information there is Twitter.

So now Twitter has proved what wonderful it is, what kind of a powerful tool it is, and all this power is always better to be shared and to open it to the people.

Of course there is something wrong on my approach: Twitter has built Twitter so it deserves to keep it, to open it is not a profitable idea and all of us know what is what moves the world. But at the moment Twitter keeps distrustful the control of Twitter it has not anymore the right of keep it.

The natural way of Twitter is being an open protocol where there is not anymore only one service provider but a bunch of them, communicating with each other, and anyone can buildup its own Twitter server, and we can choose our favorite one. I don’t see the difference between Twitter and email, or IRC, or HTTP it self. How would you feel if the email service was offered only by one company?, doesn’t matter how fashion and nice guys they were.

The decisions are not anymore taken on an unilateral way, the power is not anymore owned by anyone, the tool is already uncontrollable (in the good sense of the word), the service is distributed and scalable, the privacy has a possibility, the competition helps to the user, this is the kind of sons Internet is proud of.

Technically it has not to be the most complicated of the protocols, the most important thing Twitter is offering to us right now is just us, the users. Despite the incredible server balancing technology is has to support, but this is just a consequence of being the Only One.

Twitter is awesome and Twitter can be proud of itself, it deserves all our ovations but is time to move on, Twitter has the right to keep what it has built and we have the right to do it better, if Twitter doesn’t do it someone must to.

The real question is: are we willing to change our fashion ‘@nick‘ by a one more standard and scalable ‘nick@server.com‘?

PhixterVisits is a way to convert an user visit on your web site into a blinking led on your desktop.

I have received for my birthday present one of the most awesome presents a geek can received: an Arduino Workshop Kit.

The first experiment I did was, of course, a Hello World, and after that I build something I was feeling like doing for long time: blink a led when someone visits my website.

This is very useless thing, I know and I don’t care, I just think that when something happens on the web and it become in something real on my table this is kind of magic.

On the beginning was a very simple experiment and withing an afternoon I build an small Sinatra project that received requests with a numerical parameter, the Sinatra webapp sent a signal to an script on my computer through a socket, and my computer finally sent this numerical value to the Arduino that knew with led to blink on depending the value.

This was awesome, I could to hidden an ‘img’ html element on my website asking for an image that in fact was a request to the Sinatra webapp and then the rest worked by it self.

Finally I wanted to play a competition with my girlfriend, she has a very most popular website than mine is, and then I was thinking to do all this stuff much easier to configure so this is because PhixterVisits born.

PhixterVisits is composed for three layers:

Arduino Sketch and Circuit

This is the most simple layer. It is a simple Arduino sketch that opens a Serial connection with your computer waiting for numerical values from 1 to 11, on depending the value received the Arduino will send a signal to one of its digital output connections.

The circuit is also very simple as you can see on the ‘How to Install It’ section.

Local Server

The local server is also very simple but I’ve complicated it becoming what was a simple console script on a wxRuby desktop application so you can configure it and test it visually.

Web Service

Is a Rails application where you can register your self and configure what I call ‘Phixters’. The Phixters are composed by an ‘URL:Port’ address what is your local computer public ip and the port where the Local Server is listening. You configure a value for each Phixter. And finally you can copy a very small piece of html code that you have to paste on whatever place of your website you want.

This piece of html code is the one that hides the Web Service request on an image so when your user visitors are watching an image a signal was sent to the Web Service.

The Arduino Layer

On this draw and on all my tests there are only 6 leds but you can fill all the digital outputs with leds and they suppose to work. Put atention that the digital outputs 0 and 1 are not being used, that is because on the circuit there is printed ‘RX’ and ‘TX’ on this out puts and I didn’t want any serial communication interference (I really don’t know if this interference was going to happened).

For test it you can open the ‘Serial Monitor’ of your Arduino app and send numerical values like ‘1′ or ‘2′ or ‘6′, the corresponding leds should blink for while.

Local Server

You must to have Ruby installed on your computer and also the ‘wxruby’ gem:

$ sudo gem install wxruby

Go to the directory you have uncompressed the ‘Phixter Visits Local Server’ app and run on console:

$ ruby wx_tcp_server.rb

Yo should see something like on this picture:

You have to know the name of the USB port of your Arduino and replace the text box named ‘Arduino Serial Port’ with yours one.

Select a port where you want the Local Server listens, for example ‘20000′.

Push ‘listen’.

You should see something like this bellow:

If you want to test it you can push ’stop’ and play with the ‘Send test value’ buttons. If you click on these buttons a corresponding led should blink.

Press ‘listen’ again and let the Local Server listening.

The Web Service

Go to PhixterVisits, register your self and create a Phixter for your web site like this:

On URL:Port you have to put the public IP of your computer (or whatever computer your Local Server is listing), the Port is the port you have said to Local Server to listen.

Look that I’m using the ‘no-ip.com’ service so I don’t have to take care of my non-static public IP.

You can create any number of Phixters you want, one of them could be for a different website, just take care you are using the correct ‘code’ of each one.

Very important also is that I’m not going to talk about how to configure the NAT of my home router. This is diferent on each router and is the same theory of ‘opening the ports’ for your emule. Although I’m not talking of this step, this step is very important and the Web Service won’t can talk with your Local Server if this is not well configured.

You can check the communication from your Phixter on the Web Server to your Local Server on your desktop computer by pushing the button ‘check’ as you see bellow:

This will send a signal to the URL:Port configured on this Phixter sending the value indicated, if everything is connected and working a led will blink on your Arduino circuit and a Ok message will appear on the Web Server page.

The HTML code on your Web Site

Still on the Phixter Visits Web Site, go to the ‘code’ of your Phixter:

Copy the code on the textarea:

And paste it on some place on your web site, be intelligent here and don’t put it on a place that an image is not going to be loaded.

From now on each time your website is loaded this image will want to be loaded and a request will arrive to the Web Service which will send a signal to your Local Server which will send a signal to your Arduino which will make the corresponding led to blink.

What is next

The game now is to connect to the Arduino not leds but DC motors so when a signal arrive the motor will work for a while and then stop until the next signal arrive. The motor will move some kind of figure like a horse or something then the race can start.

Also will be great not to depend on a computer to communicate with the Web Service, using a ethernet interface directly connected to Arduino could be great.

Another year, another conference, the conference that opened my eyes to the amazing word of Ruby, there on 2007, is just tuning the last details.

Conferencia Rails 2009, this year bigger, more impressive, with new venue, bigger organization team, more energy, and asking to the english spoken community to meet us with talks.

This year I am not being to much helpful on the organization team, I know they are not missing me: a big and strong bunch of people is helping this year with new energy and ideas. I am on the register application support one more year. You can check the code and help sending patches here on the ConfRor2009 github repository.

As more news arrive to me about the Conferencia Rails 2009 more sad I feel, this is because this year I will not can assists to the event, I will be on New York on an weird adventure.