Got my cycling federation Card/ID
one more step in the cycling world!
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!
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"
Second chance for a cargo donkey
... or ... I have a new bike (III)
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
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"
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"
Un año mas, la comunidad española de python se reunió, esta vez en 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
Continue reading "PyConES 2015"
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"
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:
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
Continue reading "Django, SQLite, GLOB, CAST and sorting"