Hello, Planeta Linux!

planetalinux-small.pngAnd now for something completely different: This site is now syndicated in Planeta Linux Mexico.
If you haven’t heard about Planets, they are sites that publish aggregated news feeds around certaint themes in the now all-too-familiar reverse chronologic order. Planets are a great way to feel the pulse and hear the buzz of a community without having to maintain individual subscriptions manually. Throught the years I’ve become reliant in several Planet feeds, most notably Planet Perl, Planet Python and Planet Debian.
A few weeks ago Beco introduced me to Planeta Linux -now I’m an avid reader- and kindly offered to talk to Damog and get this blog’s RSS feed into the site.
If you are one of my three regular readers, go visit Planeta Linux, I’m sure you’ll find it as enjoyable as I do. And if you are a Planeta Linux reader, well… Hello!
[tags]Planet,PlanetaLinux,RSS,syndication[/tags]

Moving from MyISAM to InnoDB: bulk table conversion

A couple of years ago Ludovico Magnocavallo tackled the issue of bulk conversion of MySQL tables from MyISAM to InnoDB with an elegant bash snippet.

for t in $(mysql --batch --column-names=false -e "show tables" mydbname); do
  mysql -e "alter table $t type=InnoDB" mydbname;
done

The original post also suggests using grep to limit the scope of the conversion to just a few tables.
(It seems that now Google *does* yield practical answers to this question ;-)
[tags]bash,mysql,innodb[/tags]

?HOWTO: Beryl on Debian

Last week Jordi Fernández gave me a quick hands-on tutorial for a working Beryl setup on Debian. He owns a Dell Latitude D620 running Debian GNU/Linux just like mine, so leeching his setup was even easier for me. What sold me immediately into Beryl is that you don’t need to install Xgl.
Basically I edited /etc/X11/xorg.conf and added these lines to the Device section:

Option "RenderAccel" "true"
Option  "backingstore" "true"
Option "XAANoOffsetScreenPixmaps" "true"
Option "AddRGBGLXVisuals" "On"

and added a new section to the very end:

Section "Extensions"
        Option "Composite" "Enable"
EndSection

My updated xorg.conf is available right here.
After restarting X (ctrl-alt-Backspace for lazy users like me) you can type this on a terminal:

$ beryl-manager &
$ beryl

I have the official nvidia drivers (1.0-8776) installed via module-assistant and a Beryl version that is kind of old (0.2.0+svn20070205-r3687+imudebian0, rather ancient in Internet Time). This worked immediately for me but Your Mileage May Vary.
There you have it. A working beryl setup in a few minutes. Thanks to Jordi for this tutorial and the rather impressive demo that followed, and to the Compiz and Beryl developers for their hard work.
[tags]uHOWTO, Dell, D620, debian, linux, X, Beryl[/tags]

?HOWTO: Convert and display Flash video

So you want to publish that nice family video in your page/blog/intranet without forcing your visitors to download, install and activate some obscure browser plugin and *then* wait for a 200MB download… Well.. That’s easy as cake!
First, let’s use ffmpeg to convert the video from avi, mpg or mov to something that we can stream to a nice Flash video player:

$ sudo aptitude install ffmpeg
$ ffmpeg -i video.mpg -ar 11025 -s 320x240 video.flv

Then we extract the first frame of the video to use it as a thumbnail:

$ ffmpeg -y -i video.mpg -f image2 -ss 5 -vframes 1 -s 320x240 -an video.jpg

Of course, real men brew their own Flash video players using Ming. The rest of us have to settle for one that has been pre-made, like Jeroen Wijering’s most excellent Flash Video Player. To insert the video in a web page you just have to write

You know, there’s even a neat wordpress plugin that allows a much simpler syntax:

[flv:/path/to/video.flv 320 240]

Cool, eh? Now you are ready to take over YouTube!
[tags]flash, video, flvplayer, ming, ffmpeg, wordpress[/tags]

?HOWTO: Recover an empty kcontrol tree

empty kcontrolLast night I opened KDE control center to change my desktop settings and I was shocked when I found that kcontrol was empty but for the OBEX Devices panel. Alll the modules that were supposed to be inside kcontrol where inside the KDE “Lost and Found” folder instead. A superficial search in the KDE mailing lists returned a few matches about this problem on KDE4 (did you know that kcontrol is currently unmaintained and that it’s gonna die real soon now?) but I’m currently in KDE 3.5.5 so that doesn’t apply to me.
Tonight Google came to the rescue: after digging a bit more I found this post in the debian forums which mentions that this might be a bug in a debian package and spells out the answer to my problem:

$ sudo ln -s /etc/xdg/menus/applications-merged/kde-essential.menu /etc/xdg/menus/kde-applications-merged/kde-essential.menu 

recovered kcontrolVoilá! Now my kcontrol is fully populated again.
[tags]kcontrol, kde, debian, linux[/tags]

Orpie: a RPN calculator

Orpie is a Reverse Polish Notation calculator for the console. If you’ve ever used an HP calculator you’ll feel right at home. if you haven’t… well, go back to your windows box and launch that buggy calculator desk accessory. In my case orpie let me stop worrying about writing “10 k” every time I ran dc(1).
Orpie was written in OCaml by Paul Pelzl and it there’s a Debian package maintained by Uwe Steinmann.
Go ahead and write:

$ sudo aptitude install orpie
$ echo "alias dc=orpie" >> $HOME/.bashrc
$ . $HOME/.bashrc

You won’t regret it.
[tags]orpie, debian, gnu, linux, ocaml, rpn, console, calculator[/tags]

PodsBlitz: the cure for your iPod backup woes

When my iPod died I complained -ranted, actually- about the lack of a decent backup program for it. Well, I finally found a program that does just what I need. PodsBlitz will display the songs in your iPod, and moreover, it will merrily dump them to your hard disk. For backup purposes, I repeat. This will backup all MP3 files with their corresponding tag information, but you’ll still have to backup ratings and all other metainformation the old, manual, XML-based way.
PodsBlitz is written in Java and is distributed as a single .jar file that will execute under Windows, MacOS X and most Linux desktops with a fairly recent Java Runtime Environment. The best part is that it doesn’t need to install drivers or do any kind of fancy USB magic to find your iPod. You just dump it into the root directory of your iPod and it just works! Kudos to Alexander Dietrich for this nice software utility!
[tags]PodsBlitz, iPod, backup, java, jar[/tags]

Dealing with a Demon-Haunted world

candle

“Science is more than a body of knowledge; it is a way of thinking. I have a foreboding of an America in my children’s or grandchildren’s time … when awesome technological powers are in the hands of a very few, and no one representing the public interest can even grasp the issues; when the people have lost the ability to set their own agendas or knowledgeably question those in authority; when clutching our crystals and nervously consulting our horoscopes, our critical faculties in decline, unable to distinguish between what feels good and what’s true, we slide, almost without noticing, back into superstitions and darkness.”

-Carl Sagan, “The Demon-Haunted World. Science as a candle in the dark.”

Carl Sagan died 10 years ago today. Blogathon or not, it is as good a time as any to remember the scientist that hrough his TV show, though his essays, through his novels (Contact is my favorite novel), and even through his bare scientific accomplishments has reinforced in me the desire to know and that childlike capacity for wonder and amazement that we humans lose so easily when we grow up.
To Carl’s life. Cheers!
[tags]CarlSagan, science[/tags]

Death to MSIE!

Death to MSIECarlos de la Guardia writes in his blog about his most recent misadventures with Internet Explorer and his post proves once again that confusion, frustration and anger are the emotions most commonly associated with MSIE.
I say let’s just put that damn browser to sleep.
No, seriously. What would happen if we developers just revolted and refused to support MSIE with all kinds of crude JS, CSS and pseudo-HTML hacks that will break anyway when Microsoft starts pushing a new MSIE flavor? Imagine a world in which digg, slashdot, Google, and even Amazon received people with broken browsers with a nice “optimized for Mozilla Firefox” button or -better yet- with a full-page “go get a real browser” error page listing 40 alternative browsers. Considering that Firefox already has some serious market share and is heading for more we may be able to pull it off. Heck, I bet that MSIE would be standards compliant within a week. Or they could just take Gecko and wrap a nice Vista skin around it and call it MSIE 7.1 for all I care. The point is that most of us could be back home in time for dinner for a change.
Hardly original, I know. But this may be worth the effort of fighting a war.
[tags]Mozilla,Firefox,MSIE,BrowserWars[/tags]