open life blog

hingo's picture

One liner to find a shard in a MongoDB cluster

I occasionally post so called "one liners", shell commands that can be used to filter out some data I need. The main reason I do this is that I can later find this when I try to google for it. This will be my first one liner for MongoDB. Ok, so it is actually 3 related one liners.

If you need to find out if a shard is already part of your MongoDB cluster, try this:

echo "db.shards.find()" | mongo $MONGOS/config | grep Shard4 | wc -l

The result will be either 1 or 0.

Now, if the shard exists, you might want to know a hostname and port number of one of the members of that replicaset:

hingo's picture

Mapping preferential voting into approval voting, take two

Yesterday I described my first ideas at mapping the preferential voting method used in Liquid Feedback, to an approval voting method as supported by Helios Voting.

After writing it I had a Heureka moment and went back to check some details on how Liquid Feedback, and in particular the Schulze method actually works. It turns out it is not necessary at all to keep a record of the +N ... 0 ... -N scores given to each vote, this is merely an implementation approach used in Liquid Feedback. The only thing that is really needed is just the pairwise comparisons of all alternatives. This is stored in Liquid Feedback in the battle table. In fact, that is precisely what Solon delivers back to Liquid Feedback as results of the voting.

hingo's picture

Reverse Engineering Helios Voting Server and encoding preferential voting as approval voting

It's been a while since I last did any hacking on Solon Voting. Solon is my project to implement secure e-voting for delegated democracy platforms. You can read previous blogs here.

When I started Solon, I was first focused on just tweaking Liquid Feedback in order to enable use of cryptographically secure e-voting algorithms. I wasn't aware that an open source implementation of a homomorphic e-voting algorithm actually exists. But then a couple of people introduced me to Helios Voting. This has been great news. What remains now is basically to glue together Helios with the already existing Solon-LiquidFeedback combination, and we will have a first ever cryptographically secure voting solution for delegated democracy. Of course, this is a very rough prototype, but it will properly encrypt the votes and will produce verifiably correct results.

Last week I had some vacation, so I finally had time to play with Helios a bit more. The results of this week's hacking are now committed on Github.

hingo's picture

Helsinki MySQL User Group: Lari Pulkkinen shares experiences with adopting SSD

The next Helsinki MySQL User Group is set for Tuesday, February 19. Lari Pulkkinen from Arbitron Mobile will talk about their project adopting SSD disks for better MySQL performance. Yes, there are benchmarks included.

Note the changed location: Oracle office in Gräsantörmä 2, Espoo. We are glad to have Oracle Finland sponsoring the user group by taking turns as meetup host. Food and sauna will be available after the talk as is customary.

More details and signup at

hingo's picture

On cryptographic e-voting algorithms in general

It's been a few months ago that I wrote a series of blog posts about Solon Voting. Solon is a project I started in July to implement cryptographically secure e-voting for direct democracy platforms, in particular Liquid Feedback which is used by the Pirate Party and other organizations in Central Europe. In the previous posts I already covered how delegated voting works, and how to divert the data flow of Liquid Feedback so that the voting phase could be handled by a cryptographically secure e-voting module. In the last post I then went on to look at requirements for secure e-voting. Those requirements are frequently referenced in this post.

Having laid out the requirements, I want to spend this post on briefly talking about the algorithms that exist for cryptographically secure e-voting. This is very superficial of course, it's intended to be layman understandable for those that don't really want to read the highly mathematical academic papers on the topic. If you do want to read academic papers, you can find lots of them on Google Scholar, just search for "e-voting" and you're all set for months to come! (No, I'm not qualified to recommend you any good papers. Just go and Google for something just like I did and if you find something interesting, let me know!)

hingo's picture

MySQL Hall of Fame


This page has moved to:


hingo's picture

Call for Nominations: MySQL Community Awards 2013

It is a new year and it's time again to start thinking of all the great people and companies that make the MySQL ecosystem so great. It is time to start thinking of this year's MySQL Community Awards.

Last year we had a record number of winners, eleven goblets were handed out! But behind the scenes things were even more exciting, there were several ties that forced the panel to do extra tie-breaking voting rounds. In one category we even had a 6-way tie! All of this just testifies to how much is happening in the MySQL world nowadays.

hingo's picture

Explaining Freedom (and Leningrad Cowboys) to a 5 year old

As we were driving the 9 hour trip to visit our parents, the childrens grandparents, for New Years, my wife at some point decided we had enough of childrens songs and inserted daddy's favorite CD: the live recording of Leningrad Cowboys Total Balaika Show in Helsinki, 1993. This historical and amazingly weird outdoor concert is perhaps best explained by you simply watching a few Youtube videos from the concert, but it brought together a Finnish punk band turned Soviet Union parody and the actual, very much official Red Army choir aka Alexandrov Ensemble. Wikipedia has more details, but just to underscore the historical backdrop: in 1994 they also performed in Berlin, while the last Russian troups were leaving Eastern Germany.

Syndicate content