This is me, Wu!
February 2016
Sun Mon Tue Wed Thu Fri Sat
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29          
This site is an effort to share some of the base knowledge I have gathered through all this years working with Linux, FreeBSD, OpenBSD, Python or Zope, among others. So, take a look around and I hope you will find the contents useful.
Recent Entries
Recent Comments
Recent Trackbacks
OpenBSD (9 items)
BSD (0 items)
FreeBSD (19 items)
Linux (3 items)
Security (3 items)
Python (20 items)
Zope (13 items)
Daily (141 items)
e-shell (9 items)
Hacks (14 items)
PostgreSQL (3 items)
OSX (8 items)
Nintendo DS (0 items)
enlightenment (0 items)
Apache (3 items)
Nintendo Wii (1 items)
Django (24 items)
Music (12 items)
Plone (7 items)
Varnish (0 items)
Lugo (2 items)
Sendmail (0 items)
europython (7 items)
Cherokee (1 items)
self (1 items)
Nature (1 items)
Hiking (0 items)
uwsgi (0 items)
nginx (0 items)
cycling (4 items)
Networking (1 items)
DNS (0 items)

Syndicate this site (XML)

RSS/RDF 0.91

11 febrero

Got my cycling federation Card/ID

one more step in the cycling world!

My cycling federation card/ID!!

Last year I decided that I really wanted to get more into cycling. I totally love it. The cycling bug bit me for good and now I can't (don't want to) think of a live without it.

And so I started to ride more, increasing the number of rides per week and the duration of those rides. I did it gradually, too slow maybe, and let me tell you that finding time to go out is really hard some times (specially having a 4 years old daughter :-P).

I also got some proper cycling clothes, cheap stuff from Decathlon at first, some more cheap stuff from Lidl afterwards, and some better stuff from brands like sportful too (also, some good stuff made in Italy should arrive soon...).

Then I decided to join a cycling club. I had some conversations with my friend Xurxo about it. He had been in the cycling world for much longer than me and he knows a lot of cyclists, teams and clubs in Lugo, so I asked him for a recommendation on which club I should join. He recommended me the Club Ciclista Ribeiras do Miño, where he has some good friends. He thought I'd be comfortable among them, and he was right!

And finally, earlier this year, I decided to join a Cycling Federation. Being federated has multiple benefits, you get insurance in case of accident, legal counsel, access to races and events... and, best of all, your wallet gets a bit lighter every year!

Some days ago I finally got the card/ID you saw at the beginning of this post. There it says that I'm now a member of the Galician Cycling Federation, the Spanish Cycling Federation and, in the end, a member of the Union Cycliste Internationale.

Wow, who would have guessed this 5 years ago... o_O!

Posted by wu at 23:52 | Comments (1) | Trackbacks (0)
07 diciembre

OpenSSH based VPNs

The poor man VPN setup

VPN (Virtual Private Network) is probably something most of you already know about. I guess most of you are familiar with terms like ipsec, pptp or OpenVPN and probably some of you know how setting up any of those feels like... yeah, a PITA.

So, this is a post for those who would like to be able to set up a VPN quickly, without having to install additional dependencies or having to mess up with complicated certificates/CAs or configuration files.

What if you could set up a fully functional VPN using just OpenSSH?

Continue reading "OpenSSH based VPNs"
Posted by wu at 07:53 | Comments (0) | Trackbacks (0)
05 diciembre

Second chance for a cargo donkey

... or ... I have a new bike (III)

The Hack-2, the day it got a new bar tape

Yes... I've got another bike. Yes, yes, I've 2 road (CX actually) bikes now. No, I cannot ride them all at the same time... I'm perfectly aware of that.

I'm not going to explain here the N+1 rule. If the cycling bug bite you already, either you already know the theory, or you soon will know about it.

I'm going to talk about my (not so) new bicycle, a Saracen Hack 2 (2015 model, which is not currently available on Saracen's website, but here you have a review of that model: )

Continue reading "Second chance for a cargo donkey"
Posted by wu at 11:53 | Comments (0) | Trackbacks (0)
03 diciembre

Una tarde cualquiera que te lleva a darle a la cabeza

Con todo el respeto a la gente que opine/piense distinto a mi, de verdad

Ayer, después de que Lara terminase su clase semanal de Judo, nos acercamos a una cafetería a merendar y charlar un rato. Es uno de esos buenos momentos del día, la verdad.

Durante ese rato, en una mesa situada a mi espalda, un grupo de adultos charlaba sobre distintos temas (nada inusual en una cafetería, vamos) cuando un par de personas más se unieron a dicho grupo. Una de esas personas era una niña pequeña. No sabría decir exactamente qué edad tenía, pero no creo que fuesen mas de 5 o 6 años (como mucho).

Y entonces la conversación derivó a algo que me dejó totalmente sorprendido.

Continue reading "Una tarde cualquiera que te lleva a darle a la cabeza"
Posted by wu at 10:28 | Comments (0) | Trackbacks (0)
29 noviembre

PyConES 2015

Un año mas, la comunidad española de python se reunió, esta vez en valencia

PyConES 2015 - Valencia

El pasado fin de semana tuvo lugar una nueva edición de la reunión anual de la comunidad española de python. Esta vez, la tercera, nos reunimos en Valencia durante tres días (viernes-domingo) durante los cuales disfrutamos de talleres, charlas, lightning talks y muchisimos buenos momentos.

Personalmente he asistido a las tres ediciones (aunque reconozco que no he escrito nada sobre las anteriores, en Madrid y Zaragoza respectivamente) y tengo que reconocer que, para mi, esta ha sido la mejor PyConES hasta la fecha.

Continue reading "PyConES 2015"
Posted by wu at 09:20 | Comments (0) | Trackbacks (0)
29 octubre

File locking in python

... or how to prevent (periodic) processes overlap

So, let's keep up with the practical techie posts.

If you do software development, almost any kind of it, at one point you will find this scenario where you are running some code in a process in a cron job (or any kind of periodic scheduler). Now, the crontab entry sets that this process has to be run, for example, each 5 minutes. One day 5 minutes is not enough for that process (that usually takes less than a minute) to finish... and there it goes the next call to run that code.

"What could go wrong?" (TM)

Well, depending on the code, maybe nothing happens, maybe an ugly mess will turn a nice day into a nightmare or maybe you will get a call in the middle of the night urging you to fix it ASAP.

Continue reading "File locking in python"
Posted by wu at 09:35 | Comments (1) | Trackbacks (0)
26 octubre

Django, SQLite, GLOB, CAST and sorting

... or how to sort (properly) by a char field containing number values

Some days ago I found an interesting dilemma while working on a django based application. The application has a model similar to this one:

class Customer(models.Model):
    code = models.CharField(_('Customer code'), max_length=10)
    joined = models.DateField(_('Joined date'), auto_now_add=True)
    first_name = models.CharField(_('First name'), max_length=255)
    last_name = models.CharField(_('First name'), max_length=255)
    email = models.EmailField(_('Email address'))


That code attribute is a CharField where alphanumeric customer codes are stored. Those codes are mostly numbers (1,2,3...N) but then there are also codes like 2a, 3-groupB, etc.

At one point, it became useful to sort such users based on that code. If that would be an IntegerField, it would be as easy as using order_by:

from .models import Customer
customers = Customer.objects.all().order_by('code')

Or, if you want the results sorted in descending order:

customers = Customer.objects.all().order_by('-code')

But then, this was not an IntegerField, but a CharField, which means that using order_by would return something like:


And so on. Not exactly what was needed.

The following is the write-up covering the little adventure that was the work to fix it.

Continue reading "Django, SQLite, GLOB, CAST and sorting"
Posted by wu at 10:07 | Comments (2) | Trackbacks (0)