Archive for August, 2009

Un po’ di statistiche sul sistema…


2009
08.27

Finalmente mi è arrivata la batteria a 6 celle per l’MSI Wind. Voi direte: “Che c’entra?” -In realtà c’entra eccome, perchè per provare l’effettiva bontà di questa, dapprima ne ho visto i parametri corretti sotto /proc/acpi/battery/BAT1/ (e si, corrispondono…pare che possa durare fino a 5 ore…), poi ho installato powertop, software sviluppato in collaborazione con Intel che mira a far risparmiare quanta più energia possibile alle nostre amate piattaforme Intel.

La visualizzazione la potete vedere qui sotto, è molto simile ad un qualsiasi programma top-like, aggiungendo però alcune funzionalità simpatiche come dei consigli da attuare immediatamente tramite un solo tasto che, promette il programma, possono farci risparmiare Watt preziosi. Altre informazioni sul sito che ho segnalato prima.

powertop

Preso dalla mania di questi programmini per il monitoraggio in tempo reale mi sono permesso di effettuare una breve ricerca sui repository di Ubuntu e ho trovato alcuni software davvero interessanti:

  • iftop, per visualizzare statistiche sulle interfacce di rete e sulla banda utilizzata da ogni host. Utile per router/firewall, ecc…
  • htop: forse il più conosciuto, rimpiazza in tutto e per tutto il top classico aggiungendo colori e azioni avanzate
  • atop: simile al precedente
  • iotop: scritto in Python si concentra come dice il nome, sull’Input/Output delle risorse. Utile quando si vuole sapere chi o cosa sta scrivendo tutto quella roba sul disco
  • itop monitorizza gli interrupt di sistema
  • xrestop per vedere quale applicazione in X consuma più risorse
  • ntop: il più complesso di tutti, dato che integra al suo interno un piccolo server web. Genera su una pagina web delle statistiche sul traffico di rete e le rende disponibili su http://localhost:3000. Ovviamente fa anche molto altro, consultate il link…
  • Altri: mytop e mtop per monitorare database MySQL e ptop per PostgreSQL, dnstop per le query DNS, jnettop simile ad iftop come scopo

Come ho già detto sono tutti disponibili sui repository ufficiali Ubuntu…

Books I would buy…


2009
08.25

Here’s some titles I’d like to buy or to review in the near future…Is just a simple list I’ll update time to time…

Crittografia Pratica
Crittografia: Principi, algoritmi, applicazioni
A New Kind of Science
Information theory, inference and learning algorithms

I’d like also to read them in some digital format, to save paper and environment, but not my money: I’d like also this:

http://www.irextechnologies.com/products/bookedition

Maybe a day…

cat /proc/sys/kernel/random/entropy_avail


2009
08.24

The command that gives the title to this post represent my mind-project-actual-situation. Truely, my situation is better represented by:

watch -n 0.1 cat /proc/sys/kernel/random/entropy_avail

The entropy available in my mind increase and decrease according to various events, but now I’d like to talk about some cryptographic thoughts I’ve had in this period.

First of all I’ve installed the israndom package from the standard ubuntu repositories; the documentation for usage and for some internal mechanism is pretty good, even if online the resources about bugs or other uses is very very few.

However I believe that the standard behavior should not be responding “not random” to every input that the program receives: the man page suggest, to test the program, to run

israndom /dev/urandom

But as you can see from the output (pasted below) the result is always the same: not random.

alphabet size             : 134515568
compressor                : bzlib
sample   size             : 393216
filename                  : /dev/urandom

... read 393216 samples...

Emprical alphabet size : 256
bits per symbol        : 27.003198
total ideal length     : 10618089.469436
rounded ideal length   : 10618104.000000
compressed size        : 3163728.000000
randomness difference  : -7454376.000000

not random

The problem is obviously the wrong alphabet size, set to 134515568 even if the empyrical size is guessed correctly. Running again the program with the alphasize set manually return a correct answer:

$ israndom -a 256 /dev/urandom

alphabet size             : 256
compressor                : bzlib
sample   size             : 393216
filename                  : /dev/urandom

... read 393216 samples...

Emprical alphabet size : 256
bits per symbol        : 8.000000
total ideal length     : 3145728.000000
rounded ideal length   : 3145736.000000
compressed size        : 3163360.000000
randomness difference  : 17624.000000

random

I don’t know where the software gets the alphasize value, I didn’t find it in the source code or in other files. Maybe coud be an error in the Ubuntu 9.04 deb package, or maybe I’m very dumb and there is a good reason for which the alphasize should be set to that value.

However now seems thawith the correct -a option all works flawless.

The second (and much more serious) entropy related thought is a little study about the Linux Random Number Generator. A very nice paper downloadable here has been written by Z Gutterman and seems that is very appreciated on the Net (Google this morning spoke about 30 quotes).
It seems a very plain but quite-complete description of the Linux RNG work, how this is composed, the vulnerabilities and also some math needed to understand the main algorithms.

I’m still reading it (my Linear Algebra needs some revision) but I’m appreciating it a lot!