memcached.pl – An (incomplete) implementation in Perl with persistence

From the memcached FAQ:

How can you list all keys?

With memcached, you can’t list all keys. There is a debug interface, but that is not an advisable usage.

I was working on some stuff with MIMEDefang, Cache::Memcached and memcached at $work and stumbled upon just that. I wanted to check what exactly was going on while developing. About two hours after reading the informal text protocol specification for memcached, I had a crude working implementation of set and get in Perl and keys stored in a BerkeleyDB hash so that they could be inspected by external tools like makemap and postmap.

I’ve cut a lot of corners in this implementation, like:

  • the delete queues are not implemented (yet)
  • no check is done whether the inserted value is of the declared length in bytes
  • an inserted value cannot contain a \n
  • It is not demonizing yet

Give it few nights and enough interest and I think that I may fix those too. So anyway here is the project page and code:

https://github.com/a-yiorgos/memcached.pl/

I hope it is useful to at least one more person.

While writing these lines I came up with: Sysadmins do it in Perl, Devops in Python. I do not know how true people may consider this, but indeed Python would have been a much better choice. Oh well, next time.

The tension that is not going away …

Stewart Brand of the famous “Information wants to be free” statement has actually commented in more detail:

Information wants to be free because it has become so cheap to distribute, copy, and recombine—too cheap to meter. It wants to be expensive because it can be immeasurably valuable to the recipient. That tension will not go away.

I revisited the above because of the recent Stratfor 2012 email leak. It represents the tension clearly: Stratfor sells expensive intelligence services (information), while in fact information once generated and stored (electronically) is bound to break free.

Information wants to be free in 1791.

Wiener on who and what we are

This was posted on CYBCOM by Bernard Scott:

We are but whirlpools in a river of ever-flowing water. We are not stuff that abides, but patterns that perpetuate themselves.…We are swimming upstream against a great torrent of disorganization….In this, our main obligation is to establish arbitrary enclaves of order and system….It is the greatest possible victory to be, to continue to be, and to have been. No defeat can deprive us of the success of having existed for some moment of time in a universe that seems indifferent to us.

This is no defeatism….The declaration of our own nature and the attempt to build up an enclave of organization in the face of nature’s overwhelming tendency to disorder is an insolence against the gods and the iron necessity that they impose. Here lies tragedy, but here lies glory too.

Norbert Wiener

lost input channel to mta after rcpt

A couple of days ago the enet.gr domain went missing. I observed this because of a call I got from our press office where a user complained that sending mail to journalists was not possible: “I can email all the world, except journalists”. The mail logs showed that:

Feb 17 13:08:26 ns sm-mta[1215]: q1HB5o4Y001215: 
lost input channel from host.name [x.x.x.x] to mta after rcpt

So what was wrong? Because of delays in DNS server responses regarding enet.gr, Thunderbird timed out and dropped the connection (the problem appeared to be Thunderbird specific). My quick hack of the moment because I was on the road was to point enet.gr to 127.0.0.1 in the SMTP server’s /etc/hosts (I was on the road with limited connectivity). A far better solution is to increase the value of mailnews.tcptimeout preference.

The Cybernetic State

“The Cybernetic State” is a book written by Javier Livas and is available as PDF on request from the author. From the preface:

The emergence of a cybernetic State is now a real possibility, and most likely inevitable in the near future. This book sketches this information age organization and the cybernetic management principles on which it is based. As we shall see, many of its features are already present in embrionary form in the modern democratic State.

The description of the cybernetic State relies on the Viable System Model (VSM) developed by professor Stafford Beer and explained in several of his books. This model originates from control theory and the cybernetics of the human nervous system, and has been adopted and validated by management science. In this book the VSM is used to show the nature of the State.

The enormous explanatory power of this cybernetic map will show that Economics, Law, and Political Science, which have mostly been studied separately, actually refer to three different aspects of the same phenomena, namely the State. In this sense, the book attempts a synthesis of ideas that were born disconnected and remained so for a long time. Helpful insights about the evolution of economic, legal and political theory are a byproduct.

[via CYBCOM]