Skip to main content

Siempre que pasa un tren.

Escuchando "Mi Gin Tonic" de Calamaro con mi señora, escuchamos "Hay un deseo que pido siempre que pasa un tren". Me río, digo "Ese verso es una pancheza", y ella me aclara que cuando estás en un puente y pasa el tren, hay que pedir un deseo.

Jamás había oído hablar de esa superstición, y entonces caigo: es porque en Santa Fe nunca pasa el tren. Esto me abre la puerta a inventar supersticiones hiperlocales, como "cuando te mea una catanga indica futuro infortunio en el amor", o "el paso del camalote predice el clima". O, como decía mi vieja, "si cruzan los sirirís, viene tormenta".

Los dejo con Calamaro:

Lunch-hour feature in Nikola: Blogger import

Today at lunch, I added support for importing blogger (maybe also blogspot? They seem to be the same nowadays) blogs into Nikola my static blog/site engine.

What works?

Well, the only site I tried works, mostly.

  • Posts

  • Pages

  • Tags

  • Drafts

  • Blog Metadata (except language)

  • Redirects to keep URLs stable (at least it tries really hard!)

  • URL rewriting in the posts (it tries!)

What's not there?
  • Comments import (it makes more sense to import them via Disqus' import tool)

  • Attachments (images and such)

  • Much testing

It's basically on par with the Wordpress import, except noone has used it for real. So, feel free to try!

(It's nikola import_blogger name_of_the_dump.xml)

The Rest Of San Francisco

I wrote about the trip and the segway tour a while ago. But that's not all that happened in San Francisco, of course.

I forgot to mention that on one of the airports there was a display of antique boardgames:


Alejandro Cura would have broken that glass, and tried to play while the police chased him.

I didn't know San Francisco had a sign-in-the-hill like Hollywood


Not quite as glamorous.

The Segway trip ended in a ... rather scenic place:


Old ship... check.


Skyline... check.


Alcatraz... check.


Bridge view... check.

So there I said goodbye to my steel pony, good old seggcrates, and went out for a walk.


Argentines-only joke:


La foto con la estatua del lobo marino!


The sea lion colony at the piers.

We had a grilled cheese sandwich, went to the hotel, yadda yadda yadda. The next day was our last day off. We had a car. So we went to ... Fry's! We got a metric crapload of gadgets, including a tiny USB battery, a powered 7 port USB hub, beef jerky, usb flash drives, SD cards, cables, a sim card, a camera, a Nexus 7, a backpack, and other stuff.

Some of the aforementioned gadgetry.

After fighting for two hours to get a phone with a data plan, we sailed off, guided by google maps and EDGE. Yes EDGE. It worked, though!

We had a very vague notion about heading north, into San Francisco, across the Golden Gate into who knows where (ended up being Napa Valley).

So, we started, and found ourselves into (I think) the Presidio Park, which is lovely but the pictures are in Lucio's camera, so it's up to him to post a link to them in the comments. emade And of course, the Golden Gate. Which is a very photogenic piece of iron. So we got off the car, at the parking lot, and saw this:


Saved! Ka-ching!

A little walk through a fort...


And there it was.


Of course I took a ton of pictures. The rest is in the gallery if you want to take a look.

So, we got a cup of ghastly coffee, got back in the car and set across the bridge.


Yes, I should straighten it.

Then there are some hills, and this cute tunnel:


Nice landscapes, in a surprisingly rural area 15 minutes off the city.


Really rural.

Then the infamous homemade jerky incident happened.

So, homemade-jerky-less we continued into the Sonoma Valley, and got to the Viansa Winery where we stopped for a taste (Lucio, I don't drink. Also, I don't drive so just a taste).


In your face, instagram!

It's a really nice place. Lovely handrails, too.


I mean, lovely handrails.


This part was closed, boo!


Lovely views.

We got some souvenirs, some picnic supplies (salami, cheese, olives, Pellegrino lemonade, crostini), and started off again. We forgot to reset the GPS so instead of going back, we kept forward into Napa Valley. And we got to some vintner's monument which closes at sunset. Right on time.


The images don't capture the scale of the thing. Or the cold.

We got back via Oakland, at night which means there's no more pictures. I was shocked to find out that not only does still exist, but that they pay for billboards with inane questions in them.

The rest of the trip was basically work, with dinner excursions. We had american (Cheesecake Factory), lebanese (at tannourine ok, sort of boring), and .... mongolian at Little Sheep Hot Pot.

At the mongolian restaurant none thought of bringing a camera, so the only picture that exists is taken with a Nexus 7's front-facing camera. Since the Nexus has no camera app, I had to take it using twitter. I am ashamed.

Yes, worst picture ever.

So, what is that? You get a pot of soup which is about 40% garlic, 40% pepper, 20% unknown things, and you check boxes in a menu for things to dip and cook in them. Since we are adventurous nerds, we included:

  • Rice and pig blood cakes (tastes exactly like a rice and morcilla sandwich)

  • Goose intestines (taste like intestines)

  • Assorted mushrooms

  • Assorted meatballs (including beef tendon meatballs (taste like nothing))

  • Assorted seafood

  • Assorted beef slices (looks creepy, taste as beef)

and a ton of other stuff. The bad side of it is that after a while it all has exactly the same taste: hot, spicy soup. The good side: it's fun to eat, and filling.

We had a last shopping spree a few days later, (I got shirts, 24 pairs of socks, a suitcase to put all the things I could not fit in the old one), and I started back alone to Argentina (Lucio stayed).

The return trip was complicated.

  • I forgot the carryon suitcase in the airline's desk, so I had to do the security check twice.

  • I didn't know the checked-in suitcase was headed to Buenos Aires directly, so I tried to check it out and back in, and thought I had lost it. Of course, not lost, but I paid 5 dollars for a cart I used for 5 meters.

  • Dallas->Ezeiza plane got delayed because it was "too full" (WAT?)

  • Forgot my passport in the backseat pocket, so I had to run across Ezeiza twice to get it back, got so flustered and nervous my blood pressure spiked. Not fun.

  • Got stopped at customs because I had not declared my laptop on the way out. Luckily, I talked my way out of it.

But got back, was fun, and very useful in the work-related bits.

Refreshed rst-cheatsheet

A while ago, I created a 2-page PDF version of the restructured text quickstart meant to be printed, folded in half and kept handy until you finally remember how to do footnotes (10 years and still waiting, in my case).

It was brought to my attention that the github project did not mention how to build it. Then I noticed that not only it didn't explain that, it was also missing critical files.

So, I added the files, fixed a couple of things that were not working perfectly with the latest rst2pdf and there is now a fresh PDF ready for you!

Nikola Can Parse That

Just for completeness' sake I have gone over Wikipedia's list of lightweight markup languages and added support in Nikola (a static site and blog generator) for a couple of them: BBCode and txt2tags, which brings the number of supported markup formats to 7 (the others are reStructured text, markdown, HTML, textile and Wiki).

Of the list of markup languages, the only missing ones with a Python implementation are AsciiDoc and Markdown Extra.

Why bother with this? It's not as if there was someone asking for BBCode support. However, one of the uses I want to support is archiving sites. Suppose you have a forum you want to shut down? I want you to be able to archive it (even if it's some work) and keep the data out there. A wiki? Same thing.

This is a first step in that direction.

Make Me Talk

One of the things that have helped me be less shy and thus have helped me move forward in life is speaking in public. However, I have been speaking in public very little these last couple of years.

So, make me do it more. I am looking forward to speaking in places I haven't been. If it's not horribly far from Buenos Aires, I may not even ask you to pay for my trip and/or hotel, I will pay for it myself if the event is interesting or the place looks like a fun place to travel to.

I can speak about python, free software in general or other things you may suggest, and I can do it in spanish or in english.

Mardel->Retiro->San Isidro->Ezeiza->Dallas->San Francisco

I am at a Canonical thing in San Mateo (right next to San Francisco). Arrived yesterday, and have my last free day today, so I need to get some sightseeing done.

For starters, here's the trip gallery, not very full yet but going to post the as I get them.

But the trip...

I was in Mar del Plata visiting family on thursday, and had tickets for Buenos Aires at midnight. At 9 PM... long distance drivers strike. All buses suspended. Ran to the train station to see if there was a chance of getting one: no tickets for a week. Seriously considering a 500KM taxi ride.

At 11PM... strike suspended! So, get the family, get the bags, get on the bus... no, sorry, you can't get on the bus because you are an idiot and you bought them for the wrong day. Really, I bought tickets for thursday 00:05 not friday 00:05.

In a busy vacation town, at midnight, without tickets... ok, so we bought new tickets for 15 minutes later. If it's a problem you can fix with a given amount of oney, at least that puts a certain value on how uch of a moron yours truly is. I am about 120 dollars worth of moron.

So, new tickets. but they are not (of course) tickets to where I live, they are tickets for BUenos Aires Retiro bus station, which is about 25KM away from home.

So, at 00:30 we get on the bus, at 5:45 we are at retiro, at 6:00 we are on a car, at 6:45 we are at home. At 7:00 I am asleep. At 9:00 I am awake and ready for work!

I work intermittently while packing bags and such, at 5:30PM am on a car to Ezeiza (35km ride). When we are entering the airport, smoke starts coming out of the AC (did I mention that the AC was broken and it's roughly 1.5 hours in bad traffic in 30C, under the sun, to get to the airport? I should have!).

So, apparently the car is on fire, but just a little bit, the smoke goes away, I get off the car, meet Lucio, we do our checkin, I have a cup of coffee, at 10:00 PM I am on the plane.

But we have to wait 30 minutes in the runway because of traffic. Also, the captain mentions that this is the plane's last flight because it's too old and is being sold for scrap. So we are flying in scrap. Also, half the screens don't work, it has a whooping 6 movies you can watch, and ... they have specific starting times. Yes, you say "hey, I feel like atching Taken 2!" and you are presented with a nice sign giving you the option of "want to start watching it even though it started 45 minutes ago, or would you rather wtch it in 63 minutes?".

This was my first trip in American Airlines, is it always like this?

We arrive in Dallas, go through what it feels like twelve security checks, customs checks, dental checks, and we get to the actual USofA. Then Lucio says "OMFG we don't have the same plane to SF!", but it's just that he's looking at the wrong boarding pass.

So, to get to our plane, we get on the monorail, and go to the exact opposite end of the airport, and we get in the plane with 5 minutes to spare. Since I missed dinner in the previous flight being asleep, and breakfast was absolutely pathetic, and the new flight (a 3:50 hours one) includes no meals, I get an apple fritter from Dunkin Donuts.

Oh, apple fritter. I don't know if you really are this delicious, or I am just so hungry, but I loved you. You were so sweet and smooth, so sugary and apple-y, your texture so nice and your size so huge. I did love you, apple fritter. Even if I suspect you gave me food poisoning, it was all worth it. I'll always remember you.

So, we get on a 757 which is completely filthy. I suspect the reason it doesn't fall apart is the willpower of the bazillion dust mites that make a living in the ratty seats. It has 14" CRT screens every few rows, and the view out the window is amazing, so I decide to look out instead.

We get to the airport and we took the monorail, and got to pick our rental car. Given the choice, of course I picked a Blue Nissan Versa! Good Car!

I know noone remembers, but Heroes 1st season was kinda cool.

We have to get to our Segway tour in 2.5 hours. So we skip the hotel, put the suitcases in the trunk, and head to Fisherman's Wharf. We park, have a meal, walk there, are early, get a cup of coffee, get on the segways, and had a ton of fun.


That's Alcatraz in the back, that's two nerds having un in the front.

After we were done, we saw the sea lions at Pier 39, got a cup of coffee and a cheese sandwich, and got back on the car, with the idea of going back. Of course we didn't actually have GPS, or a phone that worked in the US, but we had cached maps! And a vague idea of where the hotel was! So we eventually got there, got into the room, got into the internet, called the family, and I passed out of exhaustion at rough;y midnight Argentine time, two days after I got on the bus in Mar del Plata.

And then I woke up, and wrote this.

Adding Support for a Markup to Nikola

One of the goals for Nikola, my static site/blog generator is that it should be easy to extend. For example, today I added support for two markups: textile and CreoleWiki.

Since Nikola already supported HTML, reStructuredText and Markdown, adding a couple more is not very difficult. Here's how:

  1. Create a .plugin file like this one:

Name = textile
Module = compile_textile

Author = Roberto Alsina
Version = 0.1
Website =
Description = Compile Textile into HTML

Then you need to create a python module called (in this case)

That file is boilerplate plus two methods, compile_html and create_post

The compile_html method takes two arguments, one file from which it reads the markup, and one to write HTML. Example:

def compile_html(self, source, dest):
    if textile is None:
        raise Exception('To build this site, you need to install the "textile" package.')
    with, "w+", "utf8") as out_file:
        with, "r", "utf8") as in_file:
            data =
        output = textile(data, head_offset=1)

Make sure to use utf8 everyhere.

The create_post function is used to create a new, empty, post with some metadata in it. Example:

def create_post(self, path, onefile=False, title="", slug="", date="", tags=""):
    with, "wb+", "utf8") as fd:
        if onefile:
            fd.write('<notextile>  <!--\n')
            fd.write('.. title: %s\n' % title)
            fd.write('.. slug: %s\n' % slug)
            fd.write('.. date: %s\n' % date)
            fd.write('.. tags: %s\n' % tags)
            fd.write('.. link: \n')
            fd.write('.. description: \n')
        fd.write("\nWrite your post here.")

The metadata has to be in the form ".. fieldname: fieldvalue" and usually needs to be wrapped in a comment so that it's not shown in the output.

The onefile parameter means you have to write that metadata in the post. If it's False, you don't.

In some rare cases (Creole, I am looking at you) comments are not supported and you should raise an exception if onefile is True.

And that's it, markup support is fairly easy to add as long as there is a python implementation of a function to convert markup into html.

Mama Don't Let Your Baby Grow Up To Be a Cowboy^W Lisper

Forget about it, cowboys are fine. Let them grow up to be cowboys, I don't care. But Lispers... nah. Ok, no, there isn't anything wrong about Lisp, or about using Lisp, or about people that use Lisp.

There is, however, something wrong about being a Lisper, the kind of person that takes advantage of any moment to look down on any code and say "oh, this in Lisp would be cleaner/easier/shorter/faster/trivial/whatever".

And I must confess I have become that person, but with Python instead of Lisp. So I will be doing some non-python coding projects this year. Because closeness means bad perspective, and because I don't want to be that person.

So, C++ here I come (back). I see you've changed. So have I. Let's give us a chance.