handyfloss

Because FLOSS is handy, isn’t it?

Posts Tagged ‘floss/linux’

App of the week: digiKam

Posted by isilanes on February 6, 2008

As digital cameras get more and more common, and personal photo collections grow bigger, solutions for managing all these images are more and more needed.

I bought my first digital camera (a Nikon CoolPix 2500) almost 4 years ago (now I see the model was 1 year old when I bought my unit), and now I own a Panasonic Lumix DMC FX10 I’m so happy with. I obviously have the need outlined above, plus the desire to sometimes share some pictures over the web. I didn’t want to go for something like Picasa, and made a lengthy Perl/Tk script to generate HTML albums from some info I would introduce.

When I later discovered digiKam, I realized it had all the features I wanted. It is incredibly useful to tag your pictures, so that you can later on retrieve, say, “all the pictures in which my father appears”. It also has many other features, like easy access to image manipulation (of which I only use the rotation for photos requiring it), or ordering of the pictures by date, so you can see how many pictures were taken each month. The humble, but for me killer, features is that you can automatically generate HTML albums from a list of pictures, which can be selected e.g. by their tags.

Give it a try, and you’ll love it.

Posted in Application of the Week | Tagged: , , , , , | Leave a Comment »

Igalia en Telecinco

Posted by isilanes on January 31, 2008

Esta mañana en La Mirada Crítica de Telecinco han hablado sobre conciliación de la vida laboral y personal, y sobre el “teletrabajo” (trabajar desde casa).

Como ejemplo han mencionado Igalia, y han entrevistado in situ a un par de trabajadores de dicha empresa. ¿Por qué lo menciono? Pues porque Igalia es una empresa dedicada al software libre (hecho que los entrevistados han mencionado dos veces en la breve entrevista), y porque T5 ha dicho que Igalia factura un millón de euros al año (o sea, que funciona bien).

Al describir las facilidades (horario flexible, ayudas para guarderías, etc.) que daba Igalia a sus trabajadores, me ha recordado, salvando las distancias, a Google, que repite como mejor empresa estadounidense donde trabajar, según Fortune.

Cerraba el presentador diciendo: “[...] claro, no todas las empresas trabajan en un sector que esto pueda hacerse”. Se refería a IT, obviamente, pero se hace extensivo a, concretamente, el software libre. ¡Trabajad con SL, que se vive mejor!

Posted in Free software and related beasts | Tagged: , , , , , , , | Leave a Comment »

El Gobierno Vasco dice NO al software libre

Posted by isilanes on January 19, 2008

Quería hacerme eco de la noticia, aunque no es nueva (creo que es una decisión de principios del pasado diciembre). Tal y como se puede leer, y bien comentado, en softwarelibre.deusto.es y en cybereuskadi.com, el Gobierno Vasco se ha sacado de la manga un informe (por ahora, secreto) por el que han concluido que el software libre no es una alternativa viable al actual sistema de software privativo (básicamente, Windows con Office) para los ordenadores oficiales.

La declaración oficial (PDF) de la Vicepresidenta del GV, Idoia Zenarruzabeitia, es una respuesta a una petición realizada por la diputada del grupo socialista Idoia Mendia.

El detonante de este post es otro en la página de ELSE (Asociación de Empresas de Software Libre de Euskadi), donde comentan una reunión mantenida hace 4 días con el GV, de la que ESLE salió (aparentemente) con bastante buena impresión. Yo no comparto tal impresión. Más bien creo que el supuesto informe es una excusa barata. Dice ESLE en su blog:

También hemos solicitado acceso al informe realizado a lo que Gobierno nos ha trasladado la imposibilidad de sacarlo al exterior, ya que se trata de un documento de uso interno [...]

Y yo me pregunto: ¿es que un informe así no debería hacerse público? ¿No tiene la ciudadanía el derecho a saber? ¿No debe el gobierno dar explicaciones a sus ciudadanos?

Ocultar el informe convierte lo dicho por el gobierno en un simple argumento de autoridad. Como lo dice Zenarruzabeitia, o cierta consultora, o cierto informe, o el gobierno, o _____ (introduzca la autoridad que desee), debe de ser verdad.

A mí a lo que me suena es a que tienen otras razones, más inconfesables que las dadas, para rechazar el SL, y se escudan tras el informe para justificarse. En otro foro propuse que quizá (¡qué mal pensado soy!) en caso de dejar de malgastar dinero público comprando software de mala calidad a una empresa privada extranjera, quizá ciertas personas (las que decidían si hacer dicha compra o no) dejarían de recibir misteriosos maletines por Navidad (negros por fuera, y llenos de verde por dentro, creo que se me entiende).

Pues bien, parece que hay más gente defendiendo estas “conspiranoias”. Por ejemplo, hay gente que dice que difícilmente el GV se pasará al SL después de saber que MS lleva un tiempo “negociando” con el GV instalar una sede en Arrasate. Dicha sede, supongo, traería mucho dinero para el gobierno Euskadi, con lo cual pasarse al SL y enfadar a tito Gates podría ser muuuuy malito para los políticos la ciudadanía.

Posted in This evil world | Tagged: , , , , , , | 2 Comments »

Graphical = good and command line = bad?

Posted by isilanes on January 15, 2008

It is not uncommon to hear (mostly from Windows users berating Linux and its “useless console”) that one of the benefits of Windows is that everything can be done through a GUI. After all, clicking on icons and finding stuff in menus is more intuitive, and everything is easier that way. In contrast, with Linux you have to “type an awful lot of things, which is boring, slow, and difficult. And ugly”.

Now, don’t get me wrong, GUIs are great. I quite like them. What annoys me is the lack of command-line interface for some tasks. Both GUIs and CLIs have their place in computer use, and the wise should use each when appropriate. In this post I will try to illustrate a case where the automation allowed by using the CLI and some scripting is largely missed. The user (me) is forced to use an “intuitive” GUI, with the result that my patience takes a direct hit below the flotation line.

The first task I faced was to plot some orbitals of a molecule. The data for each orbital is saved in one file, and I am running a program that can read them and plot the given orbital (Molekel).

The following YouTube video, made by myself, shows the process of plotting 2 orbitals (I had to plot 17). Notice that, due to the program running so slow, the process takes around 1 minute per orbital!

Notice also that all the previous work has been done: choosing the colors of the background, atoms and orbitals, choosing the orientation, opening the atomic geometry… The comprehensive list of what to do for each orbital follows, with each line preceded by the point in time (seconds) when it happens:

  1. 00.00 – Click on “Delete surface” to remove previous orbital
  2. 07.80 – Click on “Load” to load a new orbital
  3. 12.67 – Choose a file from the dialog window, and click on “Accept” to load it
  4. 30.27 – Click on “Both signs”, because we want both positive and negative part of the orbital
  5. 31.33 – Introduce a value for the isosurface (0.05) in the “cutoff” box
  6. 33.13 – Click on “Create surface” to have Molekel render the isosurface
  7. 37.33 – Isosurface appears
  8. 37.93 – From a drop-down menu (called with right-click of the mouse), choose Snapshot -> RGB
  9. 52.66 – “Save as” dialog box appears
  10. 62.73 – Introduce filename for snapshot, and click “Accept”
  11. 65.00 – We’re done, and can repeat the process for the next orbital

One can’t help but notice that 65 seconds are needed to make eight clicks and introduce a short text in two boxes! The issue is that human attention is necessary during the whole 65 seconds, because the time between actions is too short to do something else in between (although long enough to get on your nerves, like the full 15 seconds to have the “Save as” dialog appear).

Another obvious point is that from the two short texts introduced by the user, one (the value of the isosurface) is always the same, and only the other (the name of the file to save the snapshot as) varies. Also, only one click of the 8 we do is ever different (the choice of orbital file to read). It would be nice to have a robot do this task, the only data we would have to feed it being a list of orbitals (to read, and then to save a snapshot). But we can’t. We are stuck with this sluggish process!

In contrast, I will next show a case where some automation was made. The process is that of cropping the snapshots taken in the previous step (the Molekel thing). Sure, we could use GIMP, or some other GUI tool, but applying exactly the same process to a list of 17 images (and this is a short list, it could have been 1000) is the kind of thing that cringes for automation.

The following video shows the process:

Recall that it takes 4 minutes to process ALL the images. This may not sound like a huge improvement over the 18:25 that it (in principle) took the process above (17 x 65 sec). However, the time spent with Molekel scales linearly with the number of orbitals. 100 orbitals would need almost 2h. The automated cropping process would have taken more than 4 minutes, but only slightly more: maybe 5 or 6.

Also notice that the 4 minutes are full of decisions, and there is no repetitive, unnecessary task (except the fact of committing errors). Let’s take a look at the actions taken during the 4 minutes:

  1. 00:11.00 – Open a Perl script I had half-done (another benefit of automation: you can reuse old stuff)
  2. 00:17.87 – Shade window to take a look at the number and name of files to process
  3. 00:21.33 – Change script accordingly
  4. 00:47.93 – Save changes
  5. 00:51.60 – Back to the CLI, and run the script
  6. 00:55.00 – Ups, nothing happened!
  7. 00:58.27 – Reopen the script, and look for the error
  8. 01:05.53 – Found it. Fix it.
  9. 01:07.33 – Save and execute
  10. 01:06.87 – It works!
  11. 01:13.00 – Finished running (0.36 sec per picture)
  12. 01:21.73 – Open a cropped image in viewer
  13. 01:22.93 – Realized the crop is wrong!
  14. 01:30.73 – Alt-Tab to script file, to modify it
  15. 01:55.67 – Save and execute again
  16. 02:11.73 – Open the cropped images. The first one seems to be OK!
  17. 02:29.80 – We reach one that is wrong
  18. 02:34.20 – Back to the script, and fix it
  19. 02:45.07 – Save, and back to CLI to re-run
  20. 02:53.00 – Reopen in image viewer
  21. 02:56.00 – Cropped part is not centered!
  22. 03:02.00 – Back to the script, and fix it
  23. 03:12.33 – Save and re-run
  24. 03:19.73 – Reopen in image viewer
  25. 03:27.87 – Yet another error: an image could have been cropped more, to hide an unwanted part
  26. 03:32.40 – Back to the script
  27. 03:40.80 – Rerun
  28. 03:47.13 – Reopen images
  29. 03:59.93 – See that all of them are correct. Stop and rest

Recall also that if I were to repeat both processes tomorrow, the image cropping would simply require to run the script again (0.36 seconds per image, and you can do something else in between, if you have 1000 images and don’t want to waste time waiting). The creation of the orbitals, on the other hand, would require to repeat the whole process again!! (65 seconds per orbital, plus you have to spend that time paying attention to the process. You can not run something and go away). And the whole problem with the creation of the orbitals is that there is no command-line way of doing it, to be able to automate it.

Posted in Free software and related beasts | Tagged: , , , , , , , | Leave a Comment »

Re-partitioning a disk infected with Vista to dual-boot with Linux

Posted by isilanes on January 9, 2008

Some time ago I helped a friend to install Linux into a Vista laptop (incidentally, another friend asked me about the subject today). The only aspect I’m covering in this post is the re-partitioning of the disk, which is a wee bit trickier than with XP and previous Windows versions.

With my laptop (one with XP preinstalled), I just inserted my favorite Linux CD, rebooted, and used the built-in partition utility that all Linux installation CDs have to downsize the Windows partition, and then make the Linux partitions in the remaining disk space. With Vista this is not the case. You have to be very careful, because Linux can not resize the Vista partitions (at least at the time of writing these lines). The problem is that Vista uses a modified NTFS format, and Linux can not cope with it yet (read more at my source for this info: pronetworks.org).

You can also find at pronetworks.org a detailed HowTo for making the resizing of a partition. In summary (e.g., for shrinking a partition to make room for Linux):

  1. Go to Control Panel -> Administrative Tools -> Computer Management
  2. Click on Disk Management (under Storage in left hand panel)
  3. Locate partition to shrink, right click on it, and from the context menu choose Shrink Volume
  4. Fill in the self-explanatory dialog box. Basically, enter amount of MB you want the partition to be reduced by.

You will thus end up with a smaller Vista partition, and some empty space. Now, you can insert the Linux CD, reboot, and install Linux in that empty space, without touching the Vista partition.

Posted in howto | Tagged: , , , , , | Leave a Comment »

Extracting audio from a YouTube video

Posted by isilanes on January 7, 2008

This HowTo really has two parts:

1 – How to download a video from YouTube
2 – How to extract audio from any video

The second step is not limited to videos obtained in the first step, and the first step can obviously be made for the sake of it.

How to download a video from YouTube

When you play a video on YouTube, the contents of a FLV file are streamed to your screen. Downloading this FLV file is a bit more tricky than it should be, because there is no direct indication of the URL of this file in the code of the page of the video.

Apparently some guys got over it, and they made the software I use to do the job: a Firefox extension called DownloadHelper. Using it is so easy: a three-sphere icon appears to the right of the URL bar of Firefox. When a page contains material that can be downloaded with DownloadHelper (such as a YouTube video), the spheres in the icon are colorful and move (otherwise they are grayed-out, and still). You can then click on the icon to see a list of items to download, and choose the one you want (usually the .flv file).

How to extract audio from any video

It is so easy to do from the command line. First we use MPlayer to extract the audio in PCM/WAV format:


% mplayer filename.flv -vo null -ao pcm:fast:file=filename.wav

Then, we make use of oggenc to encode the WAV into Ogg Vorbis. For example, to encode with quality level 7 (a reasonable tradeoff between quality and size):


% oggenc filename.wav -q 7 -o filename.ogg

And that’s all to it!

Posted in howto | Tagged: , , , , , , | 2 Comments »

Flash: better without Flash

Posted by isilanes on January 6, 2008

Remember my previous post about a problem with Flash in Firefox/Iceweasel? Now the second part.

After following my own instructions, I ended up with a Flash instalation that could play YouTube videos correctly, but some other Flash animations would not work. By chance, my computer at work would reproduce any Flash animation just fine, so… why would that be?

To find out the reason, I have compared what Flash-related packages I have installed in Homer (my computer at work) and Heracles (the one at home). The result is quite surprising:


Homer[~]: aptitude search flash
p   flashplayer-mozilla       - Macromedia Flash Player
p   flashrom                  - Universal flash programming utility
p   flashybrid                - automates use of a flash disk as the root filesystem
p   libflash-dev              - GPL Flash (SWF) Library - development files
p   libflash-mozplugin        - GPL Flash (SWF) Library - Mozilla-compatible plugin
p   libflash-swfplayer        - GPL Flash (SWF) Library - stand-alone player
p   libflash0c2               - GPL Flash (SWF) Library - shared library
p   libroxen-flash2           - Flash2 module for the Roxen Challenger web server
p   m16c-flash                - Flash programmer for Renesas M16C and R8C microcontrollers
p   vrflash                   - tool to flash kernels and romdisks to Agenda VR
Homer[~]: aptitude search swf
p   libflash-swfplayer        - GPL Flash (SWF) Library - stand-alone player
p   libswf-perl               - Ming (SWF) module for Perl
p   libswfdec-0.5-4           - SWF (Macromedia Flash) decoder library
p   libswfdec-0.5-4-dbg       - SWF (Macromedia Flash) decoder library
p   libswfdec-0.5-dev         - SWF (Macromedia Flash) decoder library
v   libswfdec-dev             -
p   pyvnc2swf                 - screen recording tool to SWF movie
v   swf-player                -
p   swfdec-mozilla            - Mozilla plugin for SWF files (Macromedia Flash)
p   swfmill                   - xml2swf and swf2xml processor

Yes, Flash works perfectly at Homer because it has no package installed with swf or flash in their name! And I don’t have any Gnash package installed, either. I removed all swf/flash-related packages on Heracles, and now Flash works perfectly in my home computer too.

Posted in howto | Tagged: , , , , , , , | 7 Comments »

Ignoring some file in a Subversion working copy

Posted by isilanes on January 3, 2008

Blog moved to: handyfloss.net

Entry available at: http://handyfloss.net/2008.01/ignoring-some-file-in-a-subversion-working-copy/

Sometimes you have files littering a svn working copy, but you don’t want to put them under version management. Often times it is impossible, or plain painful, to delete them, and having them appear in all svn status calls is uncomfortable. This can happen, for example, if you keep a repository of Python files. When a Python script is called from another script (a module, for example), a .pyc file is generated (a “compiled” version of the called .py module, that is just faster to load next time).

Clearly, you don’t want to put the .pyc files in the repository, but deleting them everytime you manage the working copy is painful. For that, you can make svn ignore some files, like e.g. .pyc files. You can do that in at least two ways: specifically for a directory, or as a general preference.

Setting ignore property on a single directory

You can set a property on any directory of a working copy, so that the chosen files in that directory will be ignored by svn. For example:


% svn propset 'svn:ignore' '*.pyc' pythonfiles/

will make svn ignore all .pyc files in the directory “pythonfiles”, but not those in other directories.

Setting ignore patterns globally

You can edit the ~/.subversion/config file, and add “*.pyc” in the line starting with "global-ignores =". For example, my such line is:


global-ignores = *.o *.lo *.la #*# .*.rej *.rej .*~ *~ .#* .DS_Store *.pyc *.swp

It works immediately, and for all the calls to svn status you do in any working copy on that machine.

Posted in howto | Tagged: , , , | 2 Comments »

Flash player problem in Debian Lenny: “This SWF file is known to trigger bugs in the swfdec decoder.”

Posted by isilanes on December 27, 2007

Blog moved to: handyfloss.net

Entry available at: http://handyfloss.net/2007.12/flash-player-problem-in-debian-lenny-this-swf-file-is-known-to-trigger-bugs-in-the-swfdec-decoder/

[Update: read a more recent post]

I have recently come accross this problem, and I am posting the solution I just found. The problem is the following: when trying to watch any online flash animation with Iceweasel on my Debian Lenny (e.g. in YouTube), instead of the video, I got a grey window, with the following black letters on it:

This SWF file is known to trigger bugs in the swfdec decoder. Playback is cancelled.

This bug can be followed in this August 2007 thread at donarmstrong.com. I am amazed why it didn’t affect me sooner than this week, but oh well…

The steps that fixed the issue for me where to install two packages. I am not 100% sure the first one was needed, though. I first installed the package flashplayer-mozilla, which uninstalled flashplugin-nonfree as a side effect. This step alone fixed nothing.

The second step was to actually read the donarmstrong.com bug report, and see that it says that “This is fixed in swfdec-0.4.2 [...]“. Great! I did a aptitude search swf, and found out that Lenny has libswfdec-0.5-4, and a swfdec-mozilla that depends on it. I installed the latter, which obviously also installed the former, plus it removed swf-player and libswfdec0.3.

After that, I opened Iceweasel again, and now flash works!

Posted in howto | Tagged: , , , , , , , | 1 Comment »

rip2ogg released

Posted by isilanes on December 19, 2007

I have released (how pretentious!) rip2ogg.py, the wonderful CD ripper everyone was waiting for. You can check its “home page” at www.ehu.es/isilanes.

Why did I do it? Well, one of the wonderful tools GNU/Linux provides to rip CDs is KAudioCreator, which is very neat. However, it has some shortcomings I wanted to overcome (again, how pretentious!):

  1. It’s slow. It rips the CD to WAV and encodes the ripped WAVs to Ogg in parallel, while rip2ogg.py does both things sequentially. Yet rip2ogg.py is 40% faster! I have ripped a whole CD in 14 minutes with KAC, and in 10 minutes with r2o.
  2. You can not have arbitrary character substitution, just one, and the interface for that is horrible. For example, with KAC it’s very simple to substitute every blank in the track name with an underscore. BUT I have found no way to provide KAC with two lists, so that it substitutes every character in the first list with the corresponding character(s) in the second list.
  3. You can change the track title to get a “nice” filename for the Ogg, but the change is also reflected in the “track tile” tag. You can not tell KAC to substitute a “ñ” in the title for a “n” in the filename, but to keep the “ñ” in the “tag title” tag.
  4. KAC is not able to rip all CDs. It sometimes chokes on DRM‘d CDs, and copes horribly with scratched surfaces. In contrast, the programs rip2ogg.py uses to rip have never failed for me. More than once command-line was my only way of ripping some rogue CDs. KAC simply couldn’t.

In the end, it all boils down to be able to control what the ripper is doing. To do so, I decided to make this simple script.

Obviously it is FLOSS (GPLv2), so use, modify and redistribute to your heart’s content!

Posted in Free software and related beasts | Tagged: , , , | Leave a Comment »

 
Follow

Get every new post delivered to your Inbox.