Wednesday, May 15, 2013

Your Jabber ID as your Persona identity

(This is NOT an official Mozilla project and does not in any way reflect the views of my employer.)

Mozilla Persona is a way for users to use their e-mail ID as their identity on the web. While cool, it will only really take off when existing services that people use become Identity Providers. XMPP (Jabber) is a widely deployed IM protocol whose IDs look like e-mail and it is a secure, federated system in alignment with Persona’s goals. I thought it would be really cool if I could log in to Persona enabled sites using Jabber IDs. I’d like to announce browserid-xmpp which does just that.

It should work with any XMPP server that supports components and BOSH. That said I have only tested it on my VPS (with Prosody, ejabberd and Openfire), so any issues and pull requests are welcome, as is a quick comment if you deploy it on your server. You’ll also need a relatively sophisticated web server like Apache or nginx to serve the browserid file with the right Content-Type. CheckMyIdP is a great way to check if everything is setup properly.

browserid-xmpp is two things. The first is a XMPP component that can plug into any XMPP server and answer a certificate signing query. This is a fork of the “official” browserid-certifier with an Jabber-RPC front-end rather than a web service.

The second is the set of provisioning and sign in pages that can be re-used by any domain. The authentication is handled as a two stage process using BOSH. This was my first experience with BOSH and it is ridiculously cool how it works and supports session hand-off to another page, without which this would not be possible. On the sign in page, an XMPP stream is established and authentication is done using standard XMPP authentication. The established BOSH stream has a session ID and every message sent has an incrementing request ID. On successful sign in, the sign in page sticks these two, along with the JID into sessionStorage. The provisioning page reads these out and ‘attaches’ to the existing BOSH stream. Due to the unpredictable nature of the SID and RID, there is a reasonable guarantee that someone who attached to the stream successfully knew about the stream before. The provisioning page then makes a Jabber-RPC call over the same stream to the XMPP component. This call is performed on behalf of the JID and a certificate is sent back to the browser. You are now signed in!

P.S. I’d like to thank Cory Benfield for an excellent guide to writing an IdP.

P.P.S. This post was published right before a 12-hour plane ride, so I’ll be back for tech support in a while.

Friday, April 26, 2013

Push notifications for the Open Web

I’m excited to announce a new WebAPI that Mozilla has been working on for the past few months – Push Notifications for Web applications. Push Notifications let web applications be notified that something has changed on the server and that the application should refresh its data. For example, a calendar application can use Push Notifications such that whenever a new event is added on the server, the calendar application gets started in the background. The calendar app would then add the event to its local agenda and shut down, all without the user’s intervention. When the (pleasantly surprised) user looks at his phone, it has a current copy of his agenda.
Thanks to Push Notifications, Web applications are freed from repeatedly polling for updates, leading to a better experience for everybody. Users get better battery life and more responsive applications. Developers don’t have to re-implement polling logic in every application they write. Mobile devices benefit from intelligent scheduling of notifications to reduce network usage and further improve battery life.
There were several challenges involved in making a push notification system for the open Web:
  1. Developers shouldn’t have to pre-register their applications with a push notification provider. Native app ecosystems require this; for example, you have to get a token from Google to use Cloud Messaging for Android. But for Web apps, which can be self-hosted instead of being distributed by an app store, such restrictions would only limit the audience. In addition, anybody should be free to run their own push server for their devices. Mozilla can run a server for Firefox users. Carriers can run their own servers, on which they can use cellular infrastructure to wake up Firefox OS devices. In fact, an individual user can even run their own push server if they choose.
  2. Users shouldn’t have to log in to a third party to use push capabilities. Note: Users may still need to log in to the app so the app knows what information to push to the device. For example an email app isn’t very useful without logging in.
  3. Protect the user’s privacy. This means that the push server should not receive any private or user-identifying information that is specific to the application. In keeping with this, the push server does not receive any application-specific data. It can only act as a “shoulder tap” or carry a number specifying a “version” or similar identifier.
  4. Make Push Notifications an application wakeup API and not a “user notification” API. The act of displaying a badge or popup notification is not covered by Push Notifications. This decoupling means that applications can use push for all types of tasks, from dealing with IM updates to syncing information across devices without interrupting the user. Applications that do need to notify the user can do so by using the Notifications API with Push.
We believe we now have a system that can satisfy the goals while still being secure and scalable.

How do I make my Web application push enabled?

It is very simple for web applications to use Push Notifications. In fact, in only about 100 lines of code, I modified Gaia to support “Push To Install”. Once you’ve logged in using Persona on your phone, you can install an application to your phone from any browser on any device, just by pushing it to the phone.
The basic flow for Web application developers is:
  1. Your application calls navigator.push.register() to acquire a unique URL, called a push endpoint. This endpoint usually refers to a push server. Your app can call register() multiple times for different uses. For example, an email application could have one push endpoint for every account it tracks.
  2. Your application uses something like XMLHttpRequest to notify your application server of this push endpoint. The application server is maintained by the application developer. For example, if you write a microblogging application, you will have a server where posts are aggregated. You would then associate the push endpoint with the particular user of your application.
  3. When your application server believes something interesting has happened that your application should be notified about, it makes an HTTP PUT request to the push endpoint.
  4. The push server and the user agent (Web browser/Web runtime/Firefox OS device) communicate and deliver a notification to your application. If your application is not running, it will be started in the background and receive the notification. The notification is delivered using System Messages.
  5. When it receives a notification, your application should connect to the application server and download the newest data. Since Push Notifications is a signaling system, it does not carry data in the notification.
I’ll do a blog post with a detailed Push Notifications tutorial soon.

Status

On March 28, 2013 the first pieces of code to enable Push Notifications landed on mozilla-central and are enabled for Firefox OS builds. Set the pref services.push.serverURL to wss://www.simple-push.com:9999 and the APIs should be available. You can also run your own server.
The protocol is unlikely to change, but client bugs are still being fixed. As such, this is an experimental API. Push Notifications also obsoletes the older Push Notifications API.
Push Notifications is only available to Web applications at this point. There is agreement that web pages loaded in tabs should also be able to use the API, but various technical issues need to be resolved before this can work properly. This is the next major issue the team will address.

Thursday, November 15, 2012

A new adventure

(This is a long overdue post).

I remember when I used to have homework, then for a few years in college I had no work. Last month, after a 4 month vacation, I began ‘grown-up life’. Unlike other giant leaps, mine didn’t start with a small step. It started with a 13000km trip to Silicon Valley.

I am very happy to have started a new (and first!) job at Mozilla. After last year’s incredible internship, it feels just like home. I have joined the Platform team and begun working on some upcoming APIs which I’ll blog about as they shape up. Being able to work with extremely talented people and to work on a class of problems that very few engineers in the world get to toy with is very satisfying. It does come with its share of problems, like having to get to grips with a decade old, sparsely documented code-base, but damn, when that code executes correctly after hundreds of iterations, there are so many snacks to celebrate with :) But seriously, joining Mozilla at a time when Web architecture and APIs are undergoing massive upgrades, and we get ready to launch a mobile operating system, is very exciting. Oh and employees get to be guinea pigs test it.

Couple this with managing your whole life for the first time. No longer do parents or the dorm automatically pay electricity bills or ensure your Internet connection is working. House hunting, paying rents, moving, buying furniture, managing finances, cooking, everything has been a first. Smooth for the most part, but far too salty sometimes.

Couple this with the constant technical, cultural and recreational melange that is the Bay Area and the regret about not having enough hours in the day and it’s overwhelming. In a month I’ve discovered rock climbing, seen a trapeze act, won second prize in a hackathon and gone to various meetups. Every day when I snuggle into my comforter-sleeping bag combo (you see, I still haven’t bought a mattress) get into bed, I’m exhausted, but every day is also a very satisfying adventure. I can’t wait to have more of them.

P. S. The libuv book has suffered due to this, but I’ll get back to it soon.

Friday, November 09, 2012

A poor man's Notational Velocity on Linux

I use Notational Velocity on my Mac all the time. It holds all my notes, lists and any other snippet of text. I love the interface and simplicity, and most of all I love the simple use of text files in Dropbox as a store. This way I can access my notes anywhere, without needing NV to be installed. I also love the global key binding feature so that I can quickly raise it with Cmd+Shift+N.

At work (more on this soon) I started using a Thinkpad x230 running Archlinux. But I sorely missed NV. I experimented with nvpy, but it didn't cut it for me at all. The tkinter UI looks bad in a Qt/GTK desktop, notes are saved in JSON by default, and the text file option is a sort of hack which stores the title in the first line, messing up the notes in NV. So rather than write my own version, I got an almost as nice, and definitely more powerful NV equivalent in Linux.

I am going to assume you use a standard desktop environment like KDE or that your window manager is EWMH compatible. You'll need:

  • To know how to define custom global shortcuts to run a command. For KDE this is System Settings -> Shortcuts and Gestures -> Edit -> New -> Global Shortcut -> Command/URL
  • gvim
  • wmctrl (available in Arch community repo).

Create a new shortcut which should launch the following command string

gvim --remote-silent +':lcd %:p:h | :au FocusLost * :wa' \
'/home/nikhil/Dropbox/Notational Data' && wmctrl -a 'GVIM'

You should edit the path to point to your Dropbox/NV directory. Now whenever you press the global shortcut combination you should see gvim with a list of all files (notes). Press Enter on a file to open it.

We use remote-silent to make sure that gvim uses an existing window if it is already open. The :lcd %:p:h option sets vim's current working directory to the NV directory. This will be useful later. We use the autocommand FocusLost to save the file whenever the gvim window loses focus (simulating NV's autosave feature). Finally wmctrl raises the window to the top by matching the string to the title. If you use gvim on a regular basis (I use terminal vim) and have other windows open, you'll have to tweak this.

So this setup is completely like NV, except for one divergence. Whereas NV searchs the note title and content together, our system will treat it as two flows. To search note titles/file names use / when in the main view. As part of my standard vim plugin set I have ctrlp and ack.vim* which will serve us well here. To always have access to note titles use ctrlp. I map it to sf so that I get quick fuzzy find. Similarly to search note contents I map sd to trigger ack.vim. This is where setting vim's current directory is important. Both plugins will use it as the base search directory.

This NV approximation is fast and works almost as well as the original, although without a slick interface. But nice fonts and a good vim colour scheme come pretty close.


* You'll need ack installed to use ack.vim. ack does not include text files by default. Put --text in ~/.ackrc to do so.

Saturday, August 25, 2012

Automatic Github Pages generation from Sphinx documentation

Sphinx is a very common documentation tool which gobbles up ReStructuredText and other free-form markup formats and outputs great HTML, PDF and other formats. It is meant for reference manuals and API documentation due to its good integration with source code (especially Python). The libuv book is written using Sphinx so that it looks so good with minimum effort.

Sphinx uses make to generate the HTML, which is great. The only problem is that deploying this to Github Pages requires multiple commands to switch branches to gh-pages, pull in the source text, then cleanup the working copy and switch back to master. This is boring after about one time, so I automated it, and I think other projects can benefit from it as well. Once you follow the instructions, running:

make gh-pages

will take the latest commit, switch to the gh-pages branch, generate HTML, push it to Github, then clean everything up and switch back to master.

NOTE: You need to commit or revert any working copy modifications before running this.

One-time commands

These steps only need to be run the first time when you want to generate Github Pages. First setup the branch to have no parents. Let me stress again the importance of making sure all changes are committed! Otherwise they’ll be lost.

$ cd repo
$ git checkout --orphan gh-pages
$ git rm -rf .
$ echo "First commit" > index.html
$ git add .
$ git commit -m "Just to create the branch."
$ git push origin gh-pages

Now the gh-pages branch is setup. We can start generating the actual pages instead of the current index.html.

Set the source files

Edit the Sphinx Makefile. Add a variable GH_PAGES_SOURCES. This should be a list of the files/directories that contain the documentation sources. This will usually be only source which contains the Sphinx reST docs, but if you are embedding external code or images, those directories have to be listed as well. In addition the Makefile has to be in the list. For the libuv book it is:

GH_PAGES_SOURCES = source code libuv Makefile

Add the target

Create a target gh-pages with the following commands (remember to use TABs in Makefiles):

gh-pages:
    git checkout gh-pages
    rm -rf build _sources _static
    git checkout master $(GH_PAGES_SOURCES)
    git reset HEAD
    make html
    mv -fv build/html/* ./
    rm -rf $(GH_PAGES_SOURCES) build
    git add -A
    git ci -m "Generated gh-pages for `git log master -1 --pretty=short --abbrev-commit`" && git push origin gh-pages ; git checkout master

Here is how it goes. The checkout simply switches branches. Then we remove all the old data to prevent any rebuilding artifacts. Since the gh-pages branch won’t have any of your original data, but only the HTML output, we need to pull the sources from the master branch. Then we generate the HTML. We move these from the build folder to the top level. Then we remove all the sources and the now empty build folder. We stage all the changes. Finally the last line generates a commit message for the gh-pages changes which is the first line of the latest commit on master and pushes to Github. The reason the git checkout master command is on the same line and semi-colon separated; if the push were to fail for some reason (network error, DAG inconsistency), I want to be returned to master in my working copy. If you don’t want this to happen, feel free to move it to a new line on its own.

Done!

You can now get back to your main task - writing great documentation. Whenever you have an urge to show it to the world, simply run make gh-pages and your latest documentation is served fresh!

Friday, August 17, 2012

Installing node.js on the Raspberry Pi Archlinux

My Raspberry Pi arrived a few weeks ago and I had some problems with getting node.js to build on it. This post is specifically about building node.js from source on Archlinux.

All activity and commands in this tutorial are run on the Raspberry Pi, either via SSH or physical keyboard. It is possible to cross-compile on your laptop/desktop for ARM, but I preferred not to in this case.

Prerequisites

Have the base-devel group installed, you should have a working gcc and friends, along with openssl and zlib. Also install python2-virtualenv and git-core.

Get the source

I usually stay on node bleeding edge so:

$ git clone git://github.com/joyent/node

Use Python2

Since Archlinux uses python3 by default, the configure and build scripts screw up. You can edit the individual files, but I find it easier to just use virtualenv, which will setup the shell environment to use python2 and its libraries.

$ virtualenv2 env
$ source env/bin/activate

Here env is the name of the directory virtualenv will use to store scripts. You can use some other name. Sourcing the activate script will set up the environment so that python will actually be python2.

Patch the source

Geoff Flarity has created a patch to tweak the build parameters a bit. You can either follow the instructions to apply the patch, or just comment the 12 vfp3:on... lines yourself, which is what I did. Also set the environment variables to build for ARM as in the README.

export GYP_DEFINES="armv7=0"
export CCFLAGS='-march=armv6'
export CXXFLAGS='-march=armv6'`

NOTE: All commands should be run in the same shell that has the virtualenv environment and the above variables set.

Use system zlib and openssl

Attempting to compile the included openssl failed on my Archlinux setup with some ARM assembly errors. Using the installed libs will also reduce the compilation time. So

$ ./configure --shared-openssl\
--shared-openssl-includes=/usr/include/openssl\
--shared-openssl-libpath=/usr/lib\
--shared-zlib\
--shared-zlib-includes=/usr/include\
--shared-zlib-libpath=/usr/lib

Build

$ make
$ su -c 'make install'

The build will take some time (30 minutes to an hour), so be patient. Once it is done you will have a fully working node runtime on your Raspberry Pi. Use it to power your home automation control server or whatever else. I use it to experiment with my DHT implementation.

The use of node.js to write low-level systems services or networking code over traditional languages like C/C++ is very interesting, because it provides a safer, garbage-collected runtime, with efficient I/O and a less verbose language. Inexpensive devices like the Raspberry Pi allow experimenting with multiple devices or peer-to-peer configurations rather than being bound to only localhost testing for those on a tight budget. So get a Pi and have fun.

Friday, July 13, 2012

Europe2012: Helsinki

I landed in Helsinki on the 26th of June from a connecting flight via Frankfurt. As you’ll see in the rest of the journey, food is a very integral part of my life, and I can’t resist describing airplane food either. So in Lufthansa, on the BOM-FRA flight, they served this decent croissant and omelette with spinach and chicken for ‘breakfast’. Fruits in planes are always shit, and this was no exception.

This was my first time at Frankfurt as a transit point. They make you wander a lot to get to passport control. For a second I thought passport control wasn’t going to happen at port of entry. Then the immigration officer gave me another scare by being very scrutinizing, checking all my credit/debit cards and my dad’s permission letter. Yay! for having all my documents in order.

Finally being let through, the FRA-HEL flight was again Lufthansa. I love day flights for their take-offs and landings where you get amazing views of the land. This was no different with the plane descending as it left the shores of the north sea near Germany and then approached Helsinki-Vantaa International Airport.

DSC02709

In flight meal was a delicious ‘American club sandwich’ which was bacon and chicken with mayo in rye bread. I’ve had rye bread every time I’ve been to Europe since 2010, and I love that stuff. It has great texture, a sweetness that develops in the mouth and complements meat very well.

HEL is located quite some distance from the main city as it serves the greater Helsinki region. The first thing I do when I land in a European city is to buy a pass for public transport for the number of days I am going to be staying. A citizen of Mumbai, I love public transport and passes turn out to be very cheap all over Europe. So just blindly buy one if you plan to explore cities. In this case the machine didn’t have change so I bought a one day pass then bought another one the next day. Passes printed by a machine are on paper. You can buy travel cards or seasonal passes from major terminals, tourist points and most conveniently from R-kioski general stores. These green cards are very useful and easy to use. They are available in single region (Helsinki only), or 2 and 3 region varieties, although the price difference isn’t much. Overall, I ended up paying EUR 36 for 4 days of unlimited travel in 3 regions. If you think that is a lot, consider this. The pass allows travel on the entire HRT network, bus, tram, metro and rail. In addition, the Suomenlinna ferry operated by HRT is included. In EUR 36 I roamed about the city, visited a major tourist attraction and went all the way to Nuuksio national park in Espoo! But I’m getting ahead of myself. Back to the airport. The regional bus 615 leaves every 15 minutes and will take you to Helsinki Central Station from where transport lines go all over the city.

Bicycles are common in Helsinki and bike lanes exist but aren’t sharply delineated, so make sure you don’t treat a bike path as the pavement. While riding bikes on the pavement is frowned upon in San Francisco, it is fairly common in Europe to ride on the pavement when a bike path does not exist. It also isn’t so much of a hindrance with the super-wide pavements that are so common in Europe.

I stayed in Hostel Erottajanpuisto, which is on Uudenmankatu (katu is Finnish for street). Take the 3B tram from Helsinki Central Station and get down at Frederikinkatu or Iso Roobertinkatu and walk to the hostel. It is a nice, clean place. There are 4 toilets and 4 showers on the hostel floor. My room was a 6-bed dorm. Everything was clean and the staff were very helpful. Prices were EUR 27 + 30 + 30 due to the European Athletics Championships which began from June 27th.

DSC02716

That evening I was pretty tired and just wandered the city. First I went to Verkkokauppa, which is one of Europe’s largest electronics store. I didn’t find much there that I could afford :P, so I just went upstairs to the viewing gallery on the 7th storey which gives great views of Helsinki, especially the West harbour. It also has a real MIG-21 plane on display.

DSC02725DSC02726DSC02728

From there I came back to the city centre, and wandered down Esplanadi, which is the cities main promenade. Halfway down Esplanadi is a cafe and the area across it has a stage for performances. A seniors band was performing that day though I only stopped for one song. At the end of Esplanadi is Kauppatori, an open air market which would be the source of culinary delights. Sadly I arrived late (it closes at 18:00) and missed it the first day. Slightly disappointed, I wandered around Keskuskatu which is the central square. The area around Helsinki Central Station is full of high-end shops and departmental stores and is fun to walk about. I ended up eating at some place called Chilly’s (salmon and fries with salad) near the station (I can’t find it on Google Maps now) when I got really hungry and couldn’t find something nice. Tired from the flying and walking, I came back to the room and crashed. Well after the daily routine of backing up the photos.

DSC02732

On day 2, I was all eager, it was time to go to Suomenlinna! But before that I needed breakfast and a 3-day pass. R-kioski sells both. I had a nice chicken and bacon sandwich and mint-flavoured coffee sitting on a bench at South Harbour.

DSC02735

It isn’t everyday that you get to have such a beautiful view in the morning. Now the day pass (You can get multiple days too). The HRT has a green colour card for tickets. The card is coded with information, and gray readers on all modes of transport do their job. Each reader has a quadrant, with 0/L, 1, 2, 3 marking each quadrant. Now, the numbers represent how many regions you want a ticket to be valid in. If you are a resident who has a balance on the card you have to do some button pressing for zone selection. But with a day pass we don’t need to bother with that. If you bought a 3-day, 3-region pass, then you can go anywhere in 3 days. All you’ve to do is hold the card to the reader when you get in. If everything is fine, the green light will switch on, accompanied by a beep. If things are not right, well I guess you’ll have to find out. Its very simple, so don’t get confused by the numbers. But make sure you aren’t travelling in a zone where the ticket is invalid. If you just want to see Helsinki, a 1-region pass is enough, it covers Suomenlinna too. But it does not cover the airport, so you should buy a separate ticket for that. I bought a 3-region pass as I would be visiting Nuuksio.

Suomenlinna, literally the ‘Castle of Finland’, is a island to 2km to the south of Helsinki, part of the large Finnish archipelago. The Suomenlinna ferry leaves from South Harbour every 20 minutes. On the way there are several smaller islands on which lucky people have houses.

DSC02746

You can see the attractive but short skyline of Helsinki as you leave the mainland and be amazed by Scandinavian cleanliness and efficiency. On Suomenlinna there are a few cafes, a few points of interest and the fort at the end. On the way to the visitor centre at the middle of the island you’ll already pass the church and its gardens. The blue path on the map (get one from the Visitor’s centre, or follow the blue sign boards) is the ‘suggested path’, but I wandered of in 2 directions not suggested. If you take a right as soon as you cross the bridge near the visitor’s centre you’ll reach a building in which they are building a wooden gunboat using traditional tools and techniques. It’s not open yet but you can go in through the door, just don’t creep out the workers by taking too many pictures. Continue on and you’ll reach the marina, which has a very nice collection of small boats, and the church in the background. On a sunny day it is a very nice sight. Which is why the Finns have put a cafe there as well, because in the summer you can enjoy that sight all day. Return to the blue path, but stick to the right after leaving the tomb, and take the route between points 6 and 22 on the map (the little gate in the wide building) and go towards 4. Here you’ll see the cannon emplacements, ducks swimming in the pools and a small (about the size of a big truck) artificial beach tucked away. I was lucky to also spot a lone paraglider riding the nice updrafts generated by the sea breeze.

DSC02787DSC02838

By this time you’ll have walked a lot and must be pretty hungry. But, with a budget of EUR 20 for a day we aren’t going to be dining at any of these sit down cafes. So I just went to the restroom (probably shouldn’t be going into this much detail), then sat for a while at the King’s gate.

DSC02876

There is some very nice fort design at work near the Gate to ambush ships. On the way back you can explore the little park, or not. All the good planning of Suomenlinna was due to its architect, Augustin Ehrensv√§rd, who cared about his soldiers. You’ll learn this if you watch the short movie screened in the visitor centre (English at 12:30). That and the museum together will set you back EUR 6.50. There is also Wi-Fi in the visitors centre and some nice souvenirs though I don’t buy any. This is because most souvenirs are just Made in China these days.

So… keeping the idealogy aside, I’ve managed to give a run down of the place in one paragraph! What do I do now!? Well, the bid to save money does not stop me from being able to pass up lemon-liquorice icecream. So I had one at the shop near the church and got a huge scoop for 2.80. Now I could hold on till I made it to the mainland.

DSC02915

A note about liquorice. Liquorice is like, well, something. You either love it or hate it. I first had it in 2001 and I’ve loved it. In 2010 I was unfortunate to try salmiakki, since then I stick to the less salty variants :) The Finns (call it Lakritsi) and the Dutch (call it Drop) love liquorice and you can find it in every decent general store. Buy some, try some. My favourite is the plain black unflavoured, slightly sweetened cylinders. I got mine in some yellow packet (400g for EUR 3 or so), but there are a lot of brands and flavours.

While you were thinking of liquorice, I finished my icecream and the ferry was back to South Harbour. Behold the wonderland that is Kauppatori.

DSC02737

Kauppatori is an open market similar to most European cities, with local food stalls. In Finland that means Salmon, Vendaces, Calamari, Reindeer sausages and Moose sausages. Kauppatori was to become my lunch spot all three days. On the first day I had salmon with blue cheese, with a side of vendaces, calamari and veggies (EUR 15).

DSC02923

I thought that was expensive, but it was so huge that I kept half of it and had it for dinner. I also got half a litre of cherries for EUR 3. They were the best cherries I’ve ever eaten, much bigger than the cherries in India. They were also extremely sweet and I had great fun munching on them while walking the streets.

After lunch I went to Linnanmaki amusement park. Going to a amusement park is not something you may do in a foreign country, except perhaps Disneyland. But, India has no decent amusement parks, and this one looked good. To reach there take the 3B tram to Alppila stop and walk about 500m in the direction the tram will go. A day pass is EUR 37 and gets you on all the rides as many times as you want. I just went to the 6-7 most extreme rides. Rain prevented me from going on the best one - Ukko - so I paid EUR 5 to extend my pass to the next day. Completely bushed by now, it was time to take the 3B back to my room.

On day 3 it was time for something completely off the tourist map. On the outskirts of Espoo is Nuuksio National Park. It has some nice trails through the wilderness of conifer forests and Finnish lakes. With a 3 region pass, you can go all the way to Nuuksio for ‘free’. You can take the S, U, L or E trains to Espoo then take bus number 85. Get down at Nuuksionpaa or Kattila (last stop). Once in the countryside the stops don’t have their names written on them, so it’s best to just get down at Kattila. From there you can see the trail marked. There are two, red and blue. Red is about 4km and goes to the main park entrance at Haukkalammentie. The blue one is 8km and I don’t know where it ends up because I didn’t take it. I had fun traipsing through the park for about 2 hours.

DSC02978DSC02948

Finland is a pretty flat country so there aren’t any hikes, just walking. There’s silver birch, spruce, alder, aspen and lime trees and two lakes on the trail. Three-fourth of the way through, you’ll come to a fork, one going left and the other right over a wooden bridge. The signs here have fallen into the lake and the trail is unmarked for a while. So take a left to stay on the red trail. At Haukkalamppi there is a info cabin with details about the indigenous wildlife and vegetation if you are so inclined. There is also drinking water and, surprisingly, a gift shop. Walk 2 km along the paved road to reach Nuuksionpaa from where you can catch the 85 back.

From Helsinki Central Station it was back to Kauppatori. This time I tried the sausage mix (EUR 8).

2012-06-28-010

I particularly loved the reindeer, which is dense and similar to beef. This was topped off by fresh blueberries (EUR 5). From there I went to Linnanmaki to ride the best roller coaster and try the other rides again. The Ukko takes you up five storeys, then sends you straight down vertically, to go all the way up the opposite face, then go back down in reverse and up five storeys again (in reverse!) then down again and up again where the hydraulics kick in and slowly lower you to ground level. It is super and there are correspondingly large lines, but it is well worth the wait and the rain.

The final day was a bit tempered. I had seen everything I wanted to see (or so I thought) so I just wandered around Kauppatori, Kauppahalle (the gourmet product hall south of Kauppatori), Stockmann and co. Picked up some gooseberry jam, some Fazer chocolate and a pack of plain liqourice. I accidentally wandered onto Sofiakatu and Helsinki’s main square.

DSC03026

Just before that is the museum which had a Finnish films exhibition. It was free so I saw some of it then took some photos of the main square. It was surprising that I forgot about this, of course there is nothing very interesting, they are just nice buildings. Then I went into Asematunneli complex but there wasn’t much there and I left soon. After this I was really but had a while to go for my ferry, so I just spent some time sitting on a bench at Esplanadi, nibbling on chocolate, had reindeer meatball lunch and then went back to the hostel, took the bags and walked to Makasiiniterminaali where the Linda Line runs to Tallinn in 1.5 hours. Ferries run regularly, with fares being in the range of EUR 25-45 depending on season, day and time. My ferry on a Friday at 14:00 was EUR 44. Book online since on the spot booking has a EUR 5 surcharge.

2012-06-29-019

Helsinki had been amazing, it was the first stop on my tour and Scandinavia was well worth it! Next stop Tallinn, Estonia to attend two days of Akademy 2012…