Archive for 18 marzo 2013

Tips for Brussels South Charleroi airport

marzo 18, 2013

I am now based in Brussels and due to the fact that I have a direct connection from here to my city (Zaragoza) with Ryanair, I thought it would be nice to share some tips regarding to that far-way-from-Brussels airport that I have discovered during these trips and that might help people saving some time and euros.

Although companies like Ryanair claim that it is a Brussels airport, the first thing to know is that the airport is located almost 50 kms away from Brussels itself, and thus it is not so easy and cheap to arrive as it is to the proper Brussels Airport (located only 11kms away).

In order to go from/to Brussels to/from the Charleroi airport, there are a couple of cheap options, both connecting Midi Station (where you can take several metros or trams) and the airport.

  • Shuttle-Bus: there is a shuttle bus every 30 minutes which will take around 1 hour and will cost 13 euros (22 return).b
  • Taxi: this option is much better as for the same price you will arrive earlier. People use to mistrust taxi drivers that offer them a ride to the airport but there is nothing to worry about! Those taxis, usually vans, are completely legit and the only issue is that you will have to wait until is full to leave. Not usually a problem as there are lot of people going from one place to another during common hour flights. The taxi stop is located in front of the shuttle station.
Where to take Taxis from Midi to Charleroi

Where to take Taxis from Midi to Charleroi

So, you have to buy some presents (usually chocolate) before leaving Belgium and you completely forgot? No worries! If you couldn’t buy anything in Midi Station (there is a Carrefour Express open every day) where you could buy chocolates, I suggest that you wait until the airport. There is a common tax-free shop where you could buy chocolates for a decent price. Be aware that although it is claimed that you can take a shopping bag with you apart from the hand luggage, Ryanair actually will not allow you! So whatever you buy you will have to put it into your hand luggage (I have seen people throwing away drinks and food on the boarding gate).

If you are planning to expend some hours in the airport or have a long flight and you don’t want to expend money on really expensive sandwiches or food my suggestion is that you try to buy something in Midi Station. Try to avoid airport food shops/restaurants as they are really expensive. Nevertheless, if you couldn’t make it, at the very end left corner of the airport (previous to the control) there is a supermarket called Louis Delhaize where you can buy some sandwiches for a fair price, remember that you will not be able to pass the control with liquids. What I usually do is carry with me an empty bottle and fill it in the toilet or in the fountains after the control.

Last but not least tip. Horror! You forgot to print your Ryanair check-in ticket and you know that you are going to be charged 70 euros! Do not panic! Never use Ryanair automatic machines to do that or you will end up paying the 70 euros. The airport has several internet stations with printers where you could use to reprint your boarding pass for a cheaper price (around 2 euros for 15 mins. of Internet. Completely worth it to avoid paying 70 euros!). This is only valid if you have already done the check-in online (available up to 4 hours before the flight).

I hope this information can help you saving some euros while travelling from/to the capital of Europe!

Checking automatically your server status from Android device

marzo 6, 2013

After a while without writing anything related to computer/scripting stuff I am back presenting a script for Android devices that will help you notifying when your personal server is down.

I have a personal server running in a virtual machine that during some weeks was a bit buggy, as my personal webpage is hosted there and I needed it to be up 24/7 when system failed the host was no longer available but it took me some days to realize as I wasn’t checking it everyday. As I wanted to apply some Python knowledge under Android I came out with the idea: I have a phone that is always connected so let’s create a script that periodically (using already-available tools) check the status of the server and in case of problem notifies it, thus, I don ‘t have to worry about checking the availability of my server.

The concept is quite simple and will work as follows:

  • Small script in Python that will run under SL4A.
  • A tool (TaskBomb) that will run the script periodically.
  • A server to be checked, http://hoyhabloyo.com in this case.

So, according to that steps, the process for creating the automatic check was:
First I installed TaskBomb (the scheduler), SL4A (scripting layer), the Python interpreter and SL4A Script Launcher which allows TaskBomb to run scripts as it can’t handle them directly. All these tools can be downloaded for free in the Android Market.

Second, I created the following script in Python:

import android
import urllib2

# Web page to check
web_page = 'http://hoyhabloyo.com'

try:
	urllib2.urlopen(web_page)
	# print 'Page was found!'
	# Ok, nothing to do
except (urllib2.HTTPError,urllib2.URLError) as e:
	# Error? Notifiy!
	droid = android.Android()
	droid.notify("Server seems down!", web_page)

Third, and finally, I configured the TaskBomb to run the script (through ScriptLauncher) everyday at 6.15:

And that is it! Now, every morning your phone will try to connect to the server, if everything is ok nothing will happen but if anything fails, it will display a small notification on the status bar (I established the rule on IPTABLES to make it fail).

Notification when failure

Notification when failure

In SL4A page you can find examples and a book to start developing some powerful scripts. Enjoy!