domingo, septiembre 27, 2009

Hazte industrial

Se agradecen estos esfuerzos...



Recuerdo con cariño aquella versión del porrompompero que hicimos en casa de Israel en vez de estudiar... o el eupla-pla... qué lejos quedó. La EUPLA, cuna de talentos.

martes, septiembre 22, 2009

PRNG is not seeded | ssh

After a long time using certain machines, I found the other day that I could not connect from one to another, even if they were in the same intranet.

When ssh-ing, I was seeing the message:
"PRNG is not seeded".
Never had seen this. What is PRNG is not obvious. You may think it stands for "Programming Rights for Nasty Gurus", but it actually is a Pseudo-Random Number Generator.

As openssl FAQ page says:

"Cryptographic software needs a source of unpredictable data to work correctly. Many open source operating systems provide a "randomness device" (/dev/urandom or /dev/random) that serves this purpose. All OpenSSL versions try to use /dev/urandom by default; starting with version 0.9.7, OpenSSL also tries /dev/random if /dev/urandom is not available."

So then you need to create that devices. With /dev/random should be enough at least in ubuntu.

#mknod /dev/random c 1 8

Feature 'http://apache.org/xml/features/xinclude' is not recognized.

Coming across this configuration error in Solr14 configuration in a Cloudera Hadoop 0.18.3 distributed environment, I still have seen it in other areas too.

It seems to happen quite usually that there are several XML parsing libraries on a certain java application's classpath, and not all of that support the same sets of tags/attributes. Furthermore, sometimes there are even different versions of the same library that clash! An example of this is an application using a library also used by tomcat and an application.

In our case, it's true that this solved the problem:

-Djavax.xml.parsers.DocumentBuilderFactory=com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl

This forces the JVM to use that class as a DocumentVuilderFactory. We had several parsers in the classpath and Java had to choose one! And this is done quite in a random, although determistic way. (Randomness is what one says when doesn't know how something happens).

but well, it's different if you need the library on the job, in the datanode, rather than in the master where you can play more. The namenode (jobtracker) dispatches and creates the jvm instances on the datanodes - so it's difficult (which means I haven't seen a nice way to do it yet) to pass jvmarg to the job tasks.

So, we've just... included it in the code.

System.setProperty(
"javax.xml.parsers.DocumentBuilderFactory",
"com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl" );


There was a JIRA issue that documented that.


2009-10-21 11:39:05,606 ERROR org.apache.solr.core.Config: Exception during parsing file: solrconfig.xml:javax.xml.parsers.ParserConfigurationException: Feature 'http://apache.org/xml/features/xinclude' is not recognized.
at org.apache.xerces.jaxp.DocumentBuilderFactoryImpl.newDocumentBuilder(Unknown Source)
at org.apache.solr.core.Config.(Config.java:110)
at org.apache.solr.core.SolrConfig.(SolrConfig.java:130)
at org.apache.solr.core.SolrConfig.(SolrConfig.java:87)
at org.apache.solr.core.SolrCore.(SolrCore.java:494)
at com.enormo.supernova.mapred.IndexerJob$OutputFormat.getRecordWriter(IndexerJob.java:101)
at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:293)
at org.apache.hadoop.mapred.TaskTracker$Child.main(TaskTracker.java:2210)

2009-10-21 11:39:05,646 ERROR com.enormo.supernova.mapred.IndexerJob: Can't create SOLR Embedded server
javax.xml.parsers.ParserConfigurationException: Feature 'http://apache.org/xml/features/xinclude' is not recognized.
at org.apache.xerces.jaxp.DocumentBuilderFactoryImpl.newDocumentBuilder(Unknown Source)
at org.apache.solr.core.Config.(Config.java:110)
at org.apache.solr.core.SolrConfig.(SolrConfig.java:130)
at org.apache.solr.core.SolrConfig.(SolrConfig.java:87)
at org.apache.solr.core.SolrCore.(SolrCore.java:494)
at com.enormo.supernova.mapred.IndexerJob$OutputFormat.getRecordWriter(IndexerJob.java:101)
at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:293)
at org.apache.hadoop.mapred.TaskTracker$Child.main(TaskTracker.java:2210)
2009-10-21 11:39:05,656 WARN org.apache.hadoop.mapred.TaskTracker: Error running child
java.lang.NullPointerException
at org.apache.hadoop.mapred.ReduceTask$3.collect(ReduceTask.java:300)
at com.enormo.supernova.mapred.IndexerJob$IndexerJobReduce.reduce(IndexerJob.java:213)
at com.enormo.supernova.mapred.IndexerJob$IndexerJobReduce.reduce(IndexerJob.java:206)
at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:318)
at org.apache.hadoop.mapred.TaskTracker$Child.main(TaskTracker.java:2210)

martes, septiembre 15, 2009

Spot de Estudiantes - Amanece que no es poco

Los del Club Estudiantes de baloncesto de Madrid se han sacado de la manga un homenaje a Amanece que no es poco en forma de vídeo promocional de la temporada que viene:



Se nota que tienen estudios.

viernes, septiembre 11, 2009

Letra - Serrat - La tieta

"La tieta", probablement la cançó més trist que, en el fons, porta el inmortal, positiu i hedònic messatge del Carpe Diem. Serrat, qui amb un fil de veu li dona bé de dur. És un especialista en cançons contradictòries, que tenen un tema però et deixen pensant, amb un sentiment que evoluciona amb el temps - com ara "Fiesta", que a mi em sembla una de las cançons més tristes que s'han fet mai.

Es recomana escoltar-la al mateix temps de llegir-la. En qualsevol cas, aquí està la lletra.

Serrat - La tieta.

La despertarà el vent d'un cop als finestrons.
És tan llarg i ample el llit... I són freds els llençols...
Amb els ulls mig tancats, buscarà una altra mà
sense trobar ningú, com ahir, com demà.

La seva soledat és el fidel amant
que coneix el seu cos plec a plec, pam a pam...
Escoltarà el miol d'un gat castrat i vell
que en els seus genolls dorm els llargs vespres d'hivern.

Hi ha un missal adormit damunt la tauleta
i un got d'aigua mig buit quan es lleva la tieta.

Un mirall esquerdat li dirà: "Ja et fas gran.
Com ha passat el temps! Com han volat els anys!
Com somnis de jovent pels carrers s'han perdut!
Com s'arruga la pell, com s'ensorren ells ulls!..."

La portera, al seu pas, dibuixarà un somrís:
És l'orgull de qui té algú per escalfar-li el llit.
Cada dia el mateix: agafar l'autobús
per treballar al despatx d'un advocat gandul,

amb qui en altre temps ella es feia l'estreta.
D'això fa tant de temps... Ni ho recorda la tieta.

La que sempre té un plat quan arriba Nadal.
La que no vol ningú si un bon dia pren mal.
La que no té més fills que els fills dels seus germans.
La que diu: "Tot va bé". La que diu: "Tant se val".

I el Diumenge de Rams comprarà al seu fillol
un palmó llarg i blanc i un parell de mitjons
i a l'església tots dos faran com fa el mossèn
i lloaran Jesús que entra a Jerusalem...

Li darà vint durets per obrir una llibreta:
cal estalviar els diners com sempre ha fet la tieta.

I un dia s'ha de morir, més o menys com tothom.
Se l'endurà una grip cap al forat profund.
Llavors ja haurà pagat el nínxol i el taüt,
els salms dels capellans, les misses de difunts

i les flors que seguiran el seu enterrament;
són coses que sovint les oblida (oblidem) la gent,
i fan bonic les flors amb negres draps penjant
i al darrera uns amics, descoberts fa un instant

i una esquela que diu: "Ha mort la senyoreta.
Descansi en pau. Amén".
I oblidarem la tieta.



Malgrat que hi posat el youtube, recomano escoltar la versió de "Serrat en directe", al piano i amb una veu més madura, menys teatral.

miércoles, septiembre 09, 2009

Fucking Åmål

Lo siento por los pajilleros: en esta película no hay sexo a pesar del título. De verdad, que no se ven teticas ni nada. Hala, ya podéis dejar de leer.

Es una historia de amor lésbico en la juventud sueca (creo que el escenario se puede extender a la escandinava - y a todo el mundo de cultura postindustrial).

Åmål me recuerda a Luleå, ciudad situada en el quinto cojón, donde Héctor estuvo erasmuseando un añico... en especial a las crónicas de Sara, acerca del grado de degeneración de la juventud, en cuanto a valores, identidad, motivaciones, búsquedas, etc... ese deseo de terminar con todo, huir... infelicidad, vaya. Como los quinquis de los 80 de que hablaba hace unos meses, pero con Playstation e ipone.

Se ve por un lado el peso que tiene el ser popular, la apariencia social en Suecia, y también lo oscuro y triste que es todo por debajo si uno tiene buen corazón, o al menos, corazón. Como decía Sara, los suecos son expertos en esconder la mierda y hacer como si nada. Toda la música que viene de allí es luminosa(ABBA, Roxette, y otros tantos grupos de pop comercial), todo el cine que viene de allí es oscuro - acordalse de Bergman, entre otros. Y parece que lo consiguen: son envidiados por medio mundo. Pero, quizá, con eso se quedan. Con eso y muchos árbolicos, y madera para hacer muebles del aiquia.

Precisamente, y como sincronicidad, esta tarde estaba leyendo unos apuntes de Gestalt sobre dinámicas de grupo, y mientras leía sobre la presión ejercida por el grupo (que buscando la libertad de los individuos, el grupo se convierte a su vez en celda, en reglas necesarias para la pervivencia del grupo como tal - y esto amenaza de nuevo a los individuos), me acordé de este pensamiento y que los paises escandinavos(y Japón) son el ejemplo que suelo usar normalmente.

Bueno, pues otra película recomendada.



Si queréis saber lo que dicen, os chupáis la peli. Paso de poner el horrendo trailer en inglés con la voz en off diciendo, como siempre, lo que dicen los críticos de tal o cual periódico. Odio esa costumbre. "Que es buena co, que no te lo digo yo que te la estoy vendiendo, que lo dice Pablo Ruisánchez de La Hoja Parroquial de Almudévar".

PD: Post dedicado a Héctor y Magnus.
PPD: ¡Fenti Fira!

martes, septiembre 08, 2009

KItano vs Hisaishi: El verano de Kikujiro

Hace un tiempo hablaba de cine chino o similares. Acabo de volver a ver, y ya van unas cuantas, El verano de Kikujiro, de Takeshi Kitano con música de Joe Hisaishi. Lo de la música de Hisaishi lo recalco, porque la banda sonora ella sola ya debería ser un superventas de por sí en un mundo perfecto. Bueno, no: en un mundo perfecto no habría superventas porque no habría ventas: sólo descargas gratis. Y a mí me parece de puta madre (Copyright Trainspotting)

Al lío. Que hay que ver esta película, cojones. Siempre que la veo hay unos cuantos momentos en los que me sale la carcajada, no lo puedo evitar. Me encanta todo de esta película, no le cambiaría nada. Nada. Es como es y así está perfecta.

Una maravilla que reconcilia al espectador no sólo con el ser humano, sino también con los realizadores de cine. Estudios recientes demuestran que también son personas.

sábado, septiembre 05, 2009

On a Crossroads, a Change may lead to a New Beginning

All you folks think you own my life
But you never made any sacrifice
Demons they are on my trail
I'm standing at the crossroads of the hell
I look to the left I look to the right
There're hands that grab me on every side

All you folks think I got my price
At which I'll sell all that is mine
You think money rules when all else fails
Go sell your soul and keep your shell
I'm trying to protect what I keep inside
All the reasons why I live my life

Some say the devil be a mystical thing
I say the devil he a walking man
He a fool he a liar conjurer and a thief
He try to tell you what you want
Try to tell you what you need

Standing at the point
The road it cross you down
What is at your back
Which way do you turn
Who will come to find you first
Your devils or your gods

All you folks think you run my life
Say I should be willing to compromise
I say all you demons go back to hell
I'll save my soul, save myself



If you knew that you would die today,
If you saw the face of God and Love,
Would you change?

If you knew that love can break your heart,
If you're down so low you cannot fall,
Would you change?

How bad, how good does it need to get?
How many losses, how much regret?
What chain reaction would cause an effect?
Makes you turn around, makes you try to explain,
Makes you forgive and forget, makes you change?

If you knew that you would be alone,
Knowing right and being wrong,
Would you change?

If you knew that you had found a truth,
That brings up pain that can't be soothed,
Would you change?

How bad, how good does it need to get?
How many losses, how much regret?
What chain reaction would cause an effect?
Makes you turn around, makes you try to explain,
Makes you forgive and forget, makes you change?

Are you so upright you can't be bent?
If it comes to blows are you sure you won't be crawling?
If it's not for the good, why risk falling?

If everything you think you know,
Makes your life unbearable,
Would you change? Would you change?

If you've broken every rule and vow
And hard times come to bring you down,
Would you change? Would you change?

If you knew that you would die today,
If you saw the face of God and Love,
Would you change?



The whole world's broke and it ain't worth fixing
It's time to start all over, make a new beginning
There's too much pain, too much suffering
Let's resolve to start all over make a new beginning

Now don't get me wrong I love life and living
But when you wake up and look around at everything that's going down
All wrong
You see we need to change it now, this world with too few happy endings
We can resolve to start all over make a new beginning

Start all over

The world is broken into fragments and pieces
That once were joined together in a unified whole
But now too many stand alone There's too much separation
We can resolve to come together in the new beginning

Start all over

We can break the cycle - We can break the chain
We can start all over - In the new beginning
We can learn, we can teach
We can share the myths the dream the prayer
The notion that we can do better
Change our lives and paths
Create a new world

And Start all over

jueves, septiembre 03, 2009

MySQL schema diff compare - mysqldiff

I've had recently the problem of having to compare schemas between databases.
During summer, some releases to production branch that involve db modification went accumulating.

Since it's not possible to recreate the database due to the critical data stored on the db deployment, it was good to double-check that the databases shared the same schema.
Using JPA as I'm doing on that project, schema is defined on the java code itself, so you may go happily coding and it's possible that on rapid development, some schemas

As well, usage of different JPA implementations may involve some difference on decisions depending on the implementation. As of a shared project, that needs to be handled with care.

Been trying this tool to compare two mysql schemas: mysqldiff. It is a perl-based tool to run over some (remote) databases.

It has a nice feature which is the --table-re=REGEX where you can specify a regex that the table names have to satisfy to enter the comparison. In this case this suits perfectly: only want to compare less than 20 tables from a database with around 100.

Installing it is very easy. You'll need to install first the Class-MakeMethods prerequisite. Following the information in the INSTALL file is enough - supersimple.
Then do the same downloading mysqldiff.

Once you got it started, it goes (in my case, ubuntu hardy) to /usr/local/share/perl/5.8.8/MySQL/mysqldiff.pl. I have created a ln in /usr/bin/mysqldiff entry for niceness :)

An usage example. The options are self-explanatory, but would be nice to show how to use the --table-re option and how easy it is. By the way, I've also find that depending on the characters you use in your password, you better enclose it in single commas!


mysqldiff
-h1=localhost
-h2=localhost
--user1=user1
--user2=user2
--password2=mypass2
--password2=mypass2
--table-re="User|Product"
db:databasename1
db:databasename2
> output.log


The file output.log may show something like:



## mysqldiff 0.30
##
## run on Thu Sep 3 18:24:38 2009
##
## --- db: databasename1 (host=localhost user=user1)
## +++ db: databasename2 (host=localhost user=user2)

DROP TABLE `USER`;
ALTER TABLE `PRODUCT` ENGINE=MyISAM AUTO_INCREMENT=18 DEFAULT CHARSET=latin1; # was ENGINE=MyISAM AUTO_INCREMENT=562 DEFAULT CHARSET=latin1



You can also --apply changes, which will patch database1 no match database2. It's NOT the default of course, and well, I like to check the output first to make sure.

PS. Long time with no tech posts...