The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 4,226 other subscribers

Archive for December 6th, 2016

Consensus systems (Zookepper, etcd, consul) – what are they?

Posted by jpluimers on 2016/12/06

A while ago,  wrote these very nice G+ posts

The English text is about a year older, but the German text Google Translates pretty well.

The most important points in ot for me were these:

  • Consensus systems are distribute systems, so take at least the P (partitioned) from the CAP theorem.
  • In addidtion, Consensus systems also chose the C (consistent) from the CAP theorem.
  • Since in CAP you can only pick 2 out of 3, the A (available) isn’t guaranteed on Consensus systems.
  • Only three systems get this right: Zookeeper, etcd, Consul. All others shred data eventually.
  • Leader election algorithms Paxos and Raft.
  • Cluster a.k.a. Ensemble provide a consistent view of the data no matter to what member of the Cluster/Ensemble you talk to
  • The (set of) connection(s) from a client to the Cluster/Ensemble is called session
  • Cluster/Ensemble operations are on a tree with nodes that can have atomic operations on them
  • Nodes can be persistent or ephemeral (temporal)
  • All nodes can have data (keep it small enough ~4kilobyte max)
  • Directories in the tree are usually persistent; leaf nodes often ephemeral
  • Useful operations: load balancing, queueing, data availability
  • There are transactions so you can make atomic operations larger. Don’t make them too long.
  • Consistency takes time; expect at max ~1000s of write operations per second
  • Not being available is a feature (it means it still is P and C, just not reachable right now)
  • Clients must cope with the Cluster/Ensemble being temporarily being read-only or unavailable
  • Applications should always re-create any persistent nodes they create (just in case – during non availability – from one consistent phase to another consistent phase) a persistent node is no more.

Some more keywords and links from the article:


Posted in Development, Distributed Computing, Software Development | 2 Comments »

How do I embed multiple sizes in an .ico file? – Super User

Posted by jpluimers on 2016/12/06

Scripts are soooo coool.

I remember doing similar things in Windows, but couldn’t find the batch files any more. There is an example (thanks Rob W for answering, thanks Suchipi for asking) that works in Mac/Linux:

ImageMagick (Windows/Mac/Linux) contains a command-line tool called convert that can be used for many things, including packing multiple images in one icon:

convert 16.png 32.png 48.png 128.png 256.png -colors 256 icon.ico

The previous command takes 5 PNG images, and combines them into a single .ico file.

Unlike the other answers, this method can easily be used in batch scripts to automatically generate several icon files. In one of my projects, I have a single vector image (SVG), and use Inkscape to generate png’s of various sizes, followed by convert to create a icon container. This is a reduced example (in a bash script):

for size in 16 32 48 128 256; do
    inkscape -z -e $size.png -w $size -h $size icon.svg >/dev/null 2>/dev/null
convert 16.png 32.png 48.png 128.png 256.png -colors 256 icon.ico



Posted in bash, Development, Scripting, Software Development | Leave a Comment »

%d bloggers like this: