May 30 2010 morning

I feel like posting a couple of pictures today. My first two pictures were taken at Chambers Street near the World Trade Center and the red line Subway Station.

Chambers Mural

It is quite clear that 9/11 is still present. Next picture is of Chambers Street with the Municipal Building at the bottom.

Municipal Building
This is early Sunday morning, that explains why there is no people on the streets. After going home I decided to go to Central Park.

I decided to go out for a ride after the marvelous day. There were no clouds in the sky and temperature was around 25C. One full tour around Central Park going down through West Drive and up through East Drive is around ten kilometers.

Central Park

Using expect

Let’s give a brief intro to expect. Basically is a tool for automating interactive applications such as FTP, telnet, ssh and similar. Expect has regular expression pattern matching and general program capabilities.

Let’s start installing Expect. Type in your Debian based box:

sudo aptitude install expect

That’s it. You are done.

Now lets write a simple ssh expect script. Substitute user, password and hostname for the user, password and hostname to the machine you want to log into.

#!/usr/bin/expect
spawn ssh user@hostname
expect “user@hostname’s password:”
send “password\r”
expect “$\r”
send “who; pwd; last | head\r”
expect “$\r”
send “date; exit\r”
expect eof

The script is pretty simple. It basically logs into a box and executes date, pwd, who and last commands. But it clearly shows the power of expect for automating tasks.

More info at Wikipedia and Expect homepage.

Ten years after the Liga championship

We celebrate today the tenth aniversary of Deportivo Liga championship. It’s been ten years but I can still remember that night in Corunha and the Cuatro Caminos fountain. Around 200000 persons celabrating. It was revenge after Djukic missed penalty in the last minute six years before.

Now we live in a completely different reality. We have a huge debt and we no longer have world class players in our team. Anyway I celebrate Depor past victories and toast to the future ones that will surely come. Forza Depor, oe!

Apache mod ReWrite in Debian

Installing apache on a Debian server is quite easy. Just type:

sudo aptitude install apache2

But the previous command misses an important Apache module. The ModRewrite module. How do we install this module? There are two ways, the easy and the hard way. Lets explain the easy way first. Type:

sudo a2enmod rewrite && sudo /etc/init.d/apache2 restart

That’s it. Module installed and ready to go. Lets explain the hard way now.

sudo find /usr/lib -type f -name “mod_rewrite.so”

sudo vim /etc/apache2/mods-enabled/rewrite.load

Write the where the rewrite module is located, probably:

LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so

And finally:

sudo /etc/init.d/apache2 restart

Here is a small intro on how to use this module.

Enjoy.