Yet another letsencrypt (ACME) client

2016.07.01 19:35 by Leo Antunes - 2 Comments

Well, I apparently joined the hordes of people writing ACME (the Protocol behind Let’s Encrypt) clients.

Like the fairy tale Goldilocks, I couldn’t find a client in the right spot between minimalistic and full-featured for my needs: acme-tiny was too bare-bones; the official letsencrypt client (now called certbot) too huge; and simp_le came very close, but it’s support for pluggable certificate formats made it just a bit too big for me.

So, wile (named after another famous user of ACME products) was born. Maybe it will fill someone else’s very subjective needs.

Go linear programming library

2015.03.28 21:55 by Leo Antunes - 1 Comment

[UPDATE: renamed project to golpa to avoid conflict with slightly older project and rewrote to use lp_solve as a backend, so it can be used in multiple goroutines]

After a way too long hiatus, I finally got back to working on some side-projects and wrote a small go library for solving linear programming problems. Say hi to golp!

Since I’m no LP expert, golp makes use of GLPK to do the actual weight-lifting. Unfortunately, GLPK currently isn’t reentrant, so it can’t really be used with go’s great goroutines. Still, works well enough to be used for a next little project.

Now, if only I could get back to working on Debian…

Deprecation of $(ARCH)

2013.04.30 21:04 by Leo Antunes - 8 Comments

[UPDATE 2013-05-18: with Raphael Geissert’s help, all users should be now – or as soon as DNS entries propagate – be using without need for any change]

After the announcement of some months back I imagined the few people using my older $(ARCH) DNS redirector would relatively quickly jump ship to the newer solution, it being superior in basically every aspect. However it seems I had highly underrated the usage of my little hack. According to the server logs there still are a sensible number of genuine-looking queries being made (around 600 unique IPs in the last 3 days), and even if a sizable fraction of them are being generated by bots, this still leaves a pretty big number of potential users out there.

So I guess it’s only common courtesy to let these potential users know in a slightly more public place that I plan on pulling the plug till the end of the year. If you’re one of the people making use of the service, please migrate to

Note however that this has nothing to do with, besides being based on a similar idea.

Silly Wal(l Cloc)k – 2.0

2012.12.06 16:49 by Leo Antunes - 5 Comments

So I finally got the first laser-cut version of the Silly Wal(l Cloc)k done:

The back plate was cut from a 1mm plexiglass sheet using this SVG. The black parts were spray painted with matte black and inserted back into the hollowed out sections (I should have made pictures of the pieces before assembling; too lazy to do it now). This proved out to be somewhat problematic, since keeping the small pieces (the chin and the white part of the suitcase handle) in place isn’t really easy without gluing everything together, which I wanted to avoid because I’m not sure what effect the glue might have on plexiglass in the long term.

Another problem was the fact that the plexiglass sheet is white, but slightly translucent. Since the back piece of the clock is black, this caused the white parts to look “dirty”. As a workaround for both problems I ended up using a thin white cardboard sheet as additional background, where the small hollowed out pieces could be affixed and the translucency of the plexiglass could be hidden.

On the other hand, the 1mm thickness for the plexiglass turned out to be perfect for the clock hands (or feet). I think it would still have worked with 2mm, but that might be too heavy for the puny clock torque and they might start snagging on each other.

Careful eyes will also note that I made a stupid mistake when writing down the dimensions for the back plate and it ended up being slightly smaller than the available space. Not my brightest moment, but it worked out alright with the additional cardboard background.

The next iteration will probably be made with a different two-color plexiglass sheet that can be engraved. Let’s see how that works out.


Related: Silly Wal(l Cloc)k

Silly Wal(l Cloc)k

2012.10.28 18:47 by Leo Antunes - 9 Comments

[UPDATE: I finally got around to doing a second version, with proper materials]

Inspired by this clock (UPDATE: now it earned a full-fledged blog), which made the rounds a few weeks back, and fueled by a bet to see who could make it first (hi Fabs!), ladies and gentleman, I’m honored to introduce to you, the Silly Wal(l Cloc)k:

The finished clock

This is a prototype version, done without any fancy precision tools and whatnot, so you can easily see that it’s not the most high quality product you’ll ever get your hands on. If anyone wants to reproduce this at home, here’s how it was done:

First get a hold of some cheap wall clock like this one:

The original cheap clock

Some things to think about when buying this beauty *cough*:

  • Cheap clocks seem to usually be built in a disassemble-friendly way, but just to be sure, check you won’t have to break anything to get to the clock face and the hands.
  • If possible, get a clock with the numbers printed to the glass. This isn’t that important, but saves you a bit of work.
  • Depending on how the hands are attached to the clock mechanism, it may be a good idea to get a clock with black hands. This is  important because of the little “tack” used in some models to cover the axis on which the hands are attached. Otherwise John Cleese will have to perform his silly walk with some randomly colored dot on his ass.

Disassembling this specific cheap model was pretty straightforward and didn’t take more than a minute to get to juicy parts:

Clock parts: actual clock, cover tack and hands

As a base image I used this and traced it to produce this SVG with the legs in different layers and a marker for the holes. For this prototype, it would probably have been ok to use the original photo directly, but having the vector version ready means it’s easy to use a 3d printer and laser-cutter to make the next version of the hands and face, which will definitely look and behave a lot better.

Next step is printing the three layers – body and two legs. Since this specific clock is wider than an A4 sheet, I had to use some white cardboard as background (the clock’s own box  – hurray for resourcefulness) and painstakingly cut the printed body’s outline, to avoid the slight tone difference between cardboard and paper. If you use the provided SVG and a laser-cutter, you’d hopefully avoid this sort of issue.

I didn’t have any black cardboard lying around, so I had to print the legs, cut the outline again and strengthen them with some thin cardboard from tea boxes (taken directly from the trash – hurray for resourcefulness again). Again something that 3d printing will hopefully side-step. It’s important to use light materials for the legs, since most clock mechanisms don’t have enough force to move heavy hands, which would cause the clock to quickly loose precision.

Depending on the width of the clock’s axis, a paper hole puncher might be the ideal tool to make holes in the legs. Since the prototype was largely made with paper, there was no point in going for precision when making the holes, as there’s no way to fit the legs tightly to the clock’s axis. For this, the original hands were cut in length and used as a base on which to super-glue the legs, so the original holes could be used.

After these few easy steps, it’s only a matter of reassembling the clock and voilà!

Silly Wal(l Clock)k


Importing an Outlook PST into IMAP

2011.06.19 17:16 by Leo Antunes - 9 Comments

Well, every once in a while we’re forced to do something that isn’t particularly interesting or pleasant. Last week it happened again: I had to import a few pretty big PSTs (most 2Gig, one 10Gig, with about 100.000 emails) into our dovecot IMAP.

Doing this with Outlook itself was out of the question: it took way too long, even on the local network (many hours for a 1G file) and was prone to hanging and crashes, which were obviously a pain to debug and start over.
Thunderbird was unfortunately not much better, since – at least in our tests – it didn’t import the read status of the emails (they were all marked as unread) and also wasn’t particularly good at handling folders with strange names, containing “.”, “/” or some more obscure characters. We had used it before for smaller files, where manually dealing with the problems was acceptable, but this time it required something a bit more elaborate, if we were to keep our sanity.

Enter libpst. It includes the handy readpst utility which dumps all emails in usable formats in a directory tree, one directory per folder. Unfortunately the Debian version is somewhat outdated and doesn’t support the newer Outlook formats, so I did some packaging and even a little bit of patching. It seems Thunderbird also uses this library, which would explain why it didn’t handle the Read-Status (haven’t confirmed this though; just read it somewhere).

The last step was this not-so-little script, which uses the dumped directories from readpst and imports them in IMAP. It would have probably been a bit more elegant to use libpst directly, but I unfortunately didn’t have the time to mess around with that. I did have to mess around a lot with encodings though, ergo the unholy chaos with unicode()s and str.encode()s thrown around like rice at a wedding (I could never really wrap my head around charset problems; the subject boggles my mind to this very day).

code after the jump
Read the rest of this entry »

The Imperial March as it should ALWAYS be played.

2011.04.13 17:07 by Leo Antunes - 0 Comment

I may not be the biggest Star Wars geek out there (by far), but I do enjoy almost all soundtracks by John Williams. Specially when it’s being conducted by none other than Darth Vader himself!
This is the Brazilian Symphonic Orchestra (Osquestra Sinfônica Brasileira – OSB) in one of the many songs in a tribute to John Williams (link in Portuguese) last year.
Also see this one for a better introduction, but worse view.

Oh, I so wish I’d been there! Huge kudos to the many who had the presence of mind to record this.

I really shouldn’t, but…

2011.01.20 23:31 by Leo Antunes - 2 Comments

I'm going to FOSDEM, the Free and Open Source Software Developers' European Meeting

See you there!

2011 é o ano de alguma coisa…

2011.01.01 18:59 by Leo Antunes - 0 Comment

Caralho, esse ano foi rápido.
Parece que foi mês passado que eu fiz esse post idiota de ano novo pra 2010. E já acabou. Puff!

Esse ano pra variar um pouco vou tentar fazer algumas resoluções:

  • aprender uma língua nova
  • fazer pelo menos uma viagem pra algum lugar novo (ou um cross-country por algum lugar conhecido)
  • praticar um pouco mais de esporte
  • procrastinar menos e produzir mais
  • ser menos idiota

Ok, esse último é só pra garantir que a lista é completamente irreal.

Screenshots on unrooted Android

2010.12.01 23:26 by Leo Antunes - 12 Comments

A few weeks ago I noticed an image on my Froyo phone which appeared to be a screenshot. This came as a surprise, since I don’t have any screenshot applications installed and am generally economic when it comes to the amount of fluff on my phone. I did a few searches and there doesn’t seem to be any visible mention of this feature out there, only mentions of how to do it with the SDK or with specific apps.

Since today I finally managed to discover how to actually do it again (holding the Back button and pressing Home), I took these screenshots using different launchers to be sure it wasn’t some feature of ADW.Laucher.

I still haven’t beat my laziness to actually reset to factory settings and make sure it’s not some other random app (which would be a bit unsettling, actually) and it could also be a Samsung specific feature, implemented as one of those pesky unremovable apps.

Can anybody out there confirm this (not particularly useful) feature? Did I miss it being published somewhere?

[UPDATE]: I found a couple of “hidden” apps that probably have something to do with this (through Settings→Applications→Manage applications→All).

The first one is an obvious suspect, but since it isn’t named after Samsung (which admittedly doesn’t mean much) I figured it might be activated by the second one, which in my overly-creative and not-really-investigative mind could be a sort of hotkey-daemon. [UPDATE 2: well, that’s ignoring the obvious fact that SEC stands for “Samsung Electronics Corporation”. D’oh!]
I don’t think the feature is important or interesting enough for me to investigate much further, but still I thought I might leave some pointers if people want to get this on their ROMs.