Redis Persistent and performant key/value memcache db

Redis is an advanced key-value store. It is similar to memcached but the dataset is not volatile, and values can be strings, exactly like in memcached, but also lists, sets, and ordered sets. All this data types can be manipulated with atomic operations to push/pop elements, add/remove elements, perform server side union, intersection, difference between sets, and so forth. Redis supports different kind of sorting abilities.

[…]

Redis supports trivial to setup master-slave replication, with very fast non-blocking first synchronization, auto reconnection on net split, and so forth.

Redis is written in ANSI C and works in most POSIX systems like Linux, *BSD, Mac OS X, Solaris, and so on. Redis is free software released under the very liberal BSD license.

Try it out here

You are nobody without an API Key generator

API KEYs are sexy: if you have a web based business (like Google, Twitter, Facebook or WordPress’Automattic) you should have a way to generate an API Key for web service integration.

Like Session keys, API keys should be sufficiently unpredictable to be psuedo-random. To be unpredictable, no user variables (or timestamps) are encoded into the key.

A small pythonic way to do the trick is this piece of code:

import hashlib, random
hashlib.sha224( str(random.getrandbits(256)) ).hexdigest();

you can also shell-ize it :

python -c 'import hashlib, random ; print hashlib.sha224( str(random.getrandbits(128)) ).hexdigest()'

 

Finally, for a longer  explanation take a look to this blog entry

Vim sanitize better then Emacs?

Disclaimer: Hi guys, I will not start a Religion wars between Emacs and Vim. For a copule of reason:

  • I have been an Emacs fan for about ten years, then I get a depression because of emacs-lisp complicated interface and slow emacs evolution
  • I have worked on pymacs a bit, so I am somewhat a Emacs contributor
  • I am still searching a good general purpose editor. On my day by day job, eclispe is my food.

So I was accustomed to emacs from the University. Now I decided to give a try to vim, mostly because I need

  • a editor working on slow connection
  • a fast startup editor
  • some time to be masochistic. Some guys smoke, others use vim. It perfectlys fit in your auto-destruction instinct.

In Software world changing editor is the same to change your religion  :)

I was happy with vim for this reason:

  • The documentation is a little better then emacs: it is simpler to read and has a bit more example. Generally speaking, documentation is quite compact and very accurate.
  • It is quite simple to program vim: the scripting language is functional oriented, strictly typed and easy. EmacsLisp is cool but too complex for casual user.
  • Plugin mechanics is clean and fair.
  • Languages like Perl, Python and Ruby are supported in a simpler way then Emacs. Emacs has emacs-lisp and no simple backend.
  • GVim server activation is a bit simpler them the emacs server.

Anyway the disavantages are:

  • Symbol convention is a good thing but criptic. ! * and so on are nice character, but makes no sense if you actually do not understand the cryptic “Vim symbolic religion”.
  • vi seems written by a piano-programmer who failed to get into a good Music School. The Command and Visual Mode are a bad thing if usability is a concern. Try to open a document inside vim and write your name: you will likely destroy your document if your name do not start with an “i” letter.
  • Even if Gvim exists, the Gui mode is poor, like the XEmacs one

 

 

Is Diaspora a Failure? Tech Review

Abut Diasopra, we read from Ars Technica (underline is our):

Diaspora emerged as a response to the privacy concerns raised by mainstream social networking services. The aim of Diaspora is to create an open source social network alternative with decentralized architecture, giving end users more control over their private information and how it is shared with other people. […]

When the first Diaspora code was first published in September, independent reviewers found some serious technical defects, including a number of security weaknesses. […]

  • Diaspora Team is trying to fuel a startup, the domain is a dot-com, so it is unclear what is the true project goal.
  • Diaspora seems slow, and it is difficult to get an access to it.  Who has used it, said the server is “a bit sluggish due to the increase in traffic”; and it is only opened to a small subset of users!
  • https://joindiaspora.com/ does not support IE8, which is the worst thing you can do. I hate IE8, but it is too widely used to avoid implementing a web interface into it.
  • The code is based on Ruby: technically facebook is written in PHP and compiled in a strong optimized version. And neverless, FaceBook has performance issues. So using the slowest dynamic language out of there (Ruby) is not a good idea. I like Ruby, but using it (or Python / PHP) for a such massive project is a bit risky.

Some of my throughts are shared also by Slashdot guys. and someone also said:

Linux got popular initially because Torvalds is an excellent programmer and his project spread through word-of-mouth. Diaspora got discovered because there was a Times article about vaporware.

 

Anyway the idea of giving more power to the user about their privacy data is an important step. The implementation at the time of writing seems quite bad. If we could get an access in the next few weeks, we will review it again.

So think twice before pointing your interest to Diaspora: it is still too beta in its objectives…and in its philosophy. Sluggish code is the least problem, ever!