Archive for September, 2009

Solito…

Este jueves por primera vez me tocó estar solo en el programa de radio (no exactamente porque Marcos y José me dieron una gran mano a distancia). No fué del todo mala la experiencia, al principio estuve un poquitín nervioso pero luego me solté. Por suerte Antonio [antoniosacco.net] me ayudó muchísimo y hablamos sobre Software Libre orientado a personas con Necesidades Especiales.

El resumen del programa se encuentra en http://ovejafm.com/programa48

En el estudio de Futura con Antonio

En el estudio de Futura con Antonio

(ahora que veo como tenía el pelo solo faltaba que aparezca Disco Stu)

Published in: amig@s, psico, software libre | on September 6th, 2009 by Adrian | No Comments »

Fixing Amarok’s support for Wikipedia without recompiling

Some time ago Wikipedia changed its markup and because of that one of my favorites players, Amarok stopped showing the artist information. This wasn't something that bugged me that much to take the approach suggested in tons of places:

edit contextbrowser.cpp and change:

from: m_wiki = m_wiki.mid( m_wiki.find( "<h1 class=\"firstHeading\">" ) );
to: m_wiki = m_wiki.mid( m_wiki.find( "<h1 id=\"firstHeading\" class=\"firstHeading\">" ));

... save, compile and you are done. Nice as pie. Isn't the free software world wonderful? Not that this is something hard, but I didn't feel like doing it that way.

Sooo, today I came back home a bit tired after college and work and instead of having some sleep I chose to tackle this little problem. From the code above, we see that there's a function that takes a static string (in this context by "static" I mean something not generated at runtime), this means that we can [generally] replace the string in the binary and it should work.

Hands on!

#cd /usr/bin
#grep firstHeading amarokapp

Yuck. Nothing!

#ldd amarokapp
(...some output ommited)
libamarok.so.0 => /usr/lib/libamarok.so.0 (0xb79a1000)
#grep firstHeading /usr/lib/libamarok.so.0
Binary file libamarok.so.0 matches

There! so we have to modify libamarok.so.0
In my system libamarok.so.0 is a symlink to libamarok.so.0.0.0
This is nothing spectacular, first backup then edit

#cd /usr/lib
#cp libamarok.so.0.0.0 libamarok.so.0.0.0.orig
#hexedit libamarok.so.0.0.0

Here I used hexedit because it was at hand, any decent hex editor should do fine. Even vim works. In this case we can do this easily because the target string is shorter than the original, so we can pad the rest with zeroes (or add a single one at the end of the new string). Obligatory? screenshots:

hexedit of libamarok.so, before

hexedit of libamarok.so, before

hexedit of libamarok.so, after (bold: changed text)

hexedit of libamarok.so, after (bold: changed text)

Note: Close Amarok before saving!!

Mine quite certainly didn't like having its library changed while running and died as if  I killed it with a -9. After running it again everything works as expected:

Amarok showing the Garbage page's

Amarok showing the Garbage page's

Regina Spektor's bio

Regina Spektor's bio

I really like what the compression artifacts did to the background, should change that later.

Whoaa, enough for tonight,  gotta sleep a bit.

Published in: psico, software, software libre | on September 1st, 2009 by Adrian | No Comments »