Evolución yonkil

29 February 2008 – 15:15

Desde hace algún tiempo vengo creyendo que la hipertrofiación del neocortex vino dada por el uso de enteógenos. Las primeras dietas humanas fueron, por subsitencia, básicamente frutos secos y setas. Lo que se podía encontrar; sin más. El riesgo de intoxicación por ingestión era alto y aquellos que psicologicamente no estaban preparados para aquello con lo que se enfrentaban fueron disociandose del grupo. ¿Un teoría extraña; verdad?

Al parecer hay quien la comparte :

El manjar de los dioses, por Terence McKenna

Y, de regalo, una librería psiquedelica.

Using bash as a calc

29 February 2008 – 14:55

I was wondering how to do a little calc within a bash script and therefore i requested google help :)

There are the results:

calc () { echo $* | bc -l; }
calc () { awk “BEGIN { print $* ; }”; }

And my own ones:

calc () { perl -e”print $*,\”\n\”;”; }
calc () { python -c”print $*”; }

You can call them by

calc 5+2

Explaining a QUINE program

29 February 2008 – 12:04

Above all, define what a quine program is . It’s simple: it’s a self reproducing program. A piece of code who writes itself back. Today in the work we’ve been discusing about a tiny one:

 main(a){printf(a,34,a=”main(a){printf(a,34,a=%c%s%c,34);}”,34);}

The a var is declared like char**; then we call print using a contents; what translates %c into the 34 arguments () and %s into the string literal that is being evaluated to call printf.

Ah! Here is the first google page on my search query; with a collection of quine codes .

Have a nice day!

I’m in love with regex :)

29 February 2008 – 11:30

I’ve messed up my rrdtool graph file by typing something like this:

DEF:mem-used=/isec/rrd/data/mem.rrd:mem-used:MAX DEF:mem-free=/isec/rrd/data/mem.rrd:mem-used:MAX DEF:buf-used=/isec/rrd/data/mem.rrd:mem-used:MAX DEF:buf-free=/isec/rrd/data/mem.rrd:mem-used:MAX DEF:swp-used=/isec/rrd/data/mem.rrd:mem-used:MAX DEF:swp-free=/isec/rrd/data/mem.rrd:mem-used:MAX

Well; stand back:

:%s/DEF:\([a-z\-]*\)\(=[^:]*\):[^:]*/DEF:\1\2:\1/

Solved :D

different sound volumes between mplayer instances

23 February 2008 – 0:22

mplayer -ao alsa -mixer swmixer FILE

I love linux :)