Monday 21 December 2009

3D animation creation service

Through something completely unrelated I found the xtranormal webpage, which lets you create simple 3D animations in a very easy way. In a minute you can create something really simple (for example: a greetings message). Creating a personalized cartoon for the kids goes now into the TO DO list...

Saturday 19 December 2009

Backing up with rdiff-backup remotely

For some time I wanted to make a decent setting to create daily backups of my different computers, but somehow kept delaying it... Not any more...

In the end, it is actually pretty easy to set up (though I still need to verify that doing it automatically instead of manually does not give me any trouble).

I basically mount a remote directory in my local tree with sshfs

sshfs remote_machine:/net/angelv/BACKUPS /BACKUPS/NAS/ -o workaround=rename

The -o workaround=rename is important, as previously I was having trouble doing this sort of backup through sshfs (see this).

Once this is in place, having daily incremental backups is as easy as putting in my cron:

0 2 * * * rdiff-backup /home/angelv /BACKUPS/NAS/VASO.HOME.BACKUP
0 3 * * * rdiff-backup --remove-older-than 4W /BACKUPS/NAS/VASO.HOME.BACKUP

See more examples.

Friday 18 December 2009

Missing libraries libstdc++5 in Ubuntu 9.10 when installing Intel Compiler

The installation script (for 64 bits) complains about libstdc++5 not being present, and it cannot be found in the default repositories. Installing the one for the previous Ubuntu version works fine. The details can be found, for example, in here.

After that, if you want to run the debugger, you also need to install the 64 bits version of libstdc++5, which can be installed automatically (all dependencies should be met) with GDebi, after downloading the package from here.

Thursday 17 December 2009

Photo Mosaic creation tips

Related to my previous post, I spent some time figuring out how to get a good photo mosaic. Basically I wanted to create a Mosaic of a family picture, where the "metapixels" (i.e. the small images) would be pictures of the members of the family. The resulting image (about 75cmx100cm) was to be framed and put up at our home, in a corridor with maximum viewing distance of around 5.5 metres. And basically I wanted to make sure that the family picture could be properly appreciated when viewed from a distance, but also that the "metapixels" could be seen when looking at it close-up. So, I had to follow these steps:

1. Select all possible metapixel images (this is trivial but it takes some time: I wanted to make sure that all metapixels were related to the bigger images).

2. I found that many of my images had spaces in their names, which the metapixel software didn't like, so I substituted the spaces with underscores:

rename -v 's/\ /\_/g' *

3. I don't want the metapixels to be streched (metapixel will only work with one metapixels size) so I find for my set of images which sizes they have and how many I have of each size:

angelv@palas:~/Mosaic$ for img in `ls Mosaic-Original/` ; do identify -format "%wx%h" Mosaic-Original/$img ; done > sizes.txt

4. I find how many of them have a 3x4 ratio, and how many a 4x3 ratio. In my case, these numbers are very similar: 1089 (4x3) vs. 1051 (3x4)

5. Despite the number of landscape images being a little bit larger, I decide to build the mosaic out of the portrait ones, since portrait images are usually close-ups, and will be appreciated better when very small. To copy all the 3x4 images I use:

#!bin/bash

find Mosaic-Original/ -exec identify "{}" \; |awk '{
split($3,arr,"x")
split($1,name,"/")
if ( arr[1] < arr[2] ) { cmd = "cp " $1 " Mosaic-Original-3x4/"name[2] system(cmd) } }'


6. So now I can create the thumbnails with the correct ratio:

angelv@palas:~/Mosaic$ metapixel-prepare -r Mosaic-Original-3x4 Mosaic-Thumbs --width=96 --height=128

7. And now I can prepare the final mosaic image, but with the right ratio for the thumbnails:

metapixel --metapixel mosaico_in.jpg mosaico_out_cheat40.png --library Mosaic-Thumbs/ --scale=5 --distance=5 --width=48 --height=64 --cheat=40

The numbers are important...

* As I mentioned, the final picture has to be 75x100. My original image was 1857x2476 pixels. When asking metapixel to scale it by 5, the resulting mosaic has 12384x9280 pixels, so for 100cm (or 39.37 inches), this image can be printed at 314 dpi (300 dpi is considered a very good quality for printing).

* At the same time, each row of the mosaic will have 258 metapixels (12384/48), so each metapixel will be 3.87mm wide, which is small, but definitely viewable when you get close enough.

* A 40% cheating is quite large, but my set of images was not very large, and the distribution of colours was not very good, so when no cheating was used, the resulting image was very poor in colours, so I modified the original image to make its colours brighter, and I used a 40% cheat percentage, so the resulting image can be easily viewed from a distance, and it has plenty of colours. The artifact can be appreciated when getting close to the picture, but I think this is better than having a resulting mosaic with very poor colours.

The resulting image looks very nice, and I sent it yesterday to develop it (which is cheaper than I thought, just about 30 Euros).

Thursday 10 December 2009

Photo Mosaic Software

I needed to create a Photo Mosaic today, and I just found the Metapixel software. I'm not sure how this rates quality-wise against other tools, but in a matter of minutes I had created a test Mosaic with whatever pictures I had on my hard disk following this post. Really nice! Now we have to spend tweaking the different options to get the desired result...

Train simulators in Linux

My son is a train fanatic, so I decided to check train games in Linux for him. For our Ubuntu computer at home there were two packages readily available: Ri-li, but better still openBVE.

Ri-li is a simple game, but for a 4-years-old perhaps still a bit difficult.

openBVE is a proper train simulator (definitely too difficult for my son to control, but probably fun as a vicarious driver), and it was installed properly on Ubuntu 9.04 through the Synaptic Package Manager, but not in 9.10, so I had to install it through Wine. All is clearly explained in Rail Sim Routes. This YouTube Video shows it off!

Tuesday 8 December 2009

Ripping a DVD with many tracks into a single AVI file

Since I'm likely to forget... Starting a few months ago, I now make a copy of every CD or DVD that I buy. This is normally a no-brainer, but today I had to copy a DVD that has many content tracks (usually the "interesting" content is in just one of the big tracks, while the "auxiliary" tracks can be discarded). I normally use dvd::rip, but for this I realized that AcidRip was a better option, since it lets me queue the ripping of all the tracks and then I can go away until they are finished (with dvd::rip I didn't find a way to do that). Once all the tracks are ripped into individual AVI files, I tried to put them all together with the aptly named avimerge, but I found (and apparently this happens to other people as well) that the audio gets broken, so I did it with menconder (got the thip from here):

mencoder -oac copy -ovc copy part1.avi part2.avi part3.avi -o WHOLE-THING.avi

Thursday 3 December 2009

Manifiesto “En defensa de los derechos fundamentales en internet”

Ante la inclusión en el Anteproyecto de Ley de Economía sostenible de modificaciones legislativas que afectan al libre ejercicio de las libertades de expresión, información y el derecho de acceso a la cultura a través de Internet, los periodistas, bloggers, usuarios, profesionales y creadores de internet manifestamos nuestra firme oposición al proyecto, y declaramos que…

1.- Los derechos de autor no pueden situarse por encima de los derechos fundamentales de los ciudadanos, como el derecho a la privacidad, a la seguridad, a la presunción de inocencia, a la tutela judicial efectiva y a la libertad de expresión.

2.- La suspensión de derechos fundamentales es y debe seguir siendo competencia exclusiva del poder judicial. Ni un cierre sin sentencia. Este anteproyecto, en contra de lo establecido en el artículo 20.5 de la Constitución, pone en manos de un órgano no judicial – un organismo dependiente del ministerio de Cultura -, la potestad de impedir a los ciudadanos españoles el acceso a cualquier página web.

3.- La nueva legislación creará inseguridad jurídica en todo el sector tecnológico español, perjudicando uno de los pocos campos de desarrollo y futuro de nuestra economía, entorpeciendo la creación de empresas, introduciendo trabas a la libre competencia y ralentizando su proyección internacional.

4.- La nueva legislación propuesta amenaza a los nuevos creadores y entorpece la creación cultural. Con Internet y los sucesivos avances tecnológicos se ha democratizado extraordinariamente la creación y emisión de contenidos de todo tipo, que ya no provienen prevalentemente de las industrias culturales tradicionales, sino de multitud de fuentes diferentes.

5.- Los autores, como todos los trabajadores, tienen derecho a vivir de su trabajo con nuevas ideas creativas, modelos de negocio y actividades asociadas a sus creaciones. Intentar sostener con cambios legislativos a una industria obsoleta que no sabe adaptarse a este nuevo entorno no es ni justo ni realista. Si su modelo de negocio se basaba en el control de las copias de las obras y en Internet no es posible sin vulnerar derechos fundamentales, deberían buscar otro modelo.

6.- Consideramos que las industrias culturales necesitan para sobrevivir alternativas modernas, eficaces, creíbles y asequibles y que se adecuen a los nuevos usos sociales, en lugar de limitaciones tan desproporcionadas como ineficaces para el fin que dicen perseguir.

7.- Internet debe funcionar de forma libre y sin interferencias políticas auspiciadas por sectores que pretenden perpetuar obsoletos modelos de negocio e imposibilitar que el saber humano siga siendo libre.

8.- Exigimos que el Gobierno garantice por ley la neutralidad de la Red en España, ante cualquier presión que pueda producirse, como marco para el desarrollo de una economía sostenible y realista de cara al futuro.

9.- Proponemos una verdadera reforma del derecho de propiedad intelectual orientada a su fin: devolver a la sociedad el conocimiento, promover el dominio público y limitar los abusos de las entidades gestoras.

10.- En democracia las leyes y sus modificaciones deben aprobarse tras el oportuno debate público y habiendo consultado previamente a todas las partes implicadas. No es de recibo que se realicen cambios legislativos que afectan a derechos fundamentales en una ley no orgánica y que versa sobre otra materia.

Este manifiesto, elaborado de forma conjunta por varios autores, es de todos y de ninguno. Si quieres sumarte a él, difúndelo por Internet.

Wednesday 25 November 2009

Got around 4000 guitar pieces in MIDI... should be busy for a few months!

Today I just received the MIDI Classics Catalog Package Deal, which according to their web-page it has "Over 1500 pieces in all! [...] music to keep you busy for years!". Together with the ~2400 pieces gotten from Classical Guitar Midi Archive page this should certainly keep me busy for many years. My intention is to concentrate only on the duets and ensembles, so the number of "useful" pieces will be much smaller for me, but hopefully still a decent number to keep me entertained for quite a while.

Switched to Opera Mail and Gmail...

Until now I managed all my e-mail with Thunderbird and our corporate e-mail server, but the searches were too slow, it was tedious to access the server from outside the company and the space in the server was a bit limited, so today I decided to switch...

And I went for Opera (with its integrated Opera Mail client) and Gmail. So all my mails are stored (after transferring about 8000 mails) in Gmail servers (although keeping my corporate e-mail address), and I use Opera Mail to access them (though I could use the Gmail web interface if I ever need to). The main reason to switch to Opera Mail is that it does away with folders, and it has the concept of views (searches in the Inbox, so mails can end up in different views, which is very convenient: similar to storing bookmarks with folders vs. storing them in something like del.icio.us where you assign tags to each bookmark). This way I find that I save a lot of time since I don't have to be careful about filing messages, and the searching capabilities of Opera Mail are very good. So far I have been using the new setting only a few hours, but I'm pretty convinced that I'm not going back...

Saturday 21 November 2009

Basic flying and guitar...

A week ago or so I spent some time learning how to record a "game" with the flying simulator (FlightGear), and how to use the Video Editing Software "Pitivi" so that I could put together a basic landing with a guitar studio played by myself. The result is not great in any way, but here it is.

Thursday 19 November 2009

Turning my netbook into a music partner...

Recently I bought an Acer AS1810T netbook, and I have decided to tune it so that it can become a music partner (artificial accompaniments for when no human partner is around :-)). I just started toying with Ubuntu Studio, but some things didn't quite work. I will persevere and will post here about my progress...

...

and the whole thing was a lot easier than I thought. Basically I went first for a Ubuntu 9.10 (x86_64) install. Almost everything worked out-of-the-box (sound, wifi, webcam...). And after that I just consulted this guide, which just involves downloading loads of stuff, adding myself to the audio group and modifying the file limits.conf

Then, I installed Rosegarden and then I changed a line in the file /etc/default/grub (and then run update-grub as root):
GRUB_HIDDEN_TIMEOUT=0 becomes # GRUB_HIDDEN_TIMEOUT=0 (so that I have the option of selecting the Real Time kernel, otherwise it goes into normal kernel and Rosegarden and friends will not work OK).

Then configure QSynth to include the soundfonts available at /usr/share/sounds/sf2

And at last I run Jack, QSynth, and Rosegarden, and I can get to play beatifully (and with no Xruns) a basic MIDI file. Good stuff....

(By the way, I also get GNU Solfege, a great aid in training my ear for the quickly approaching music exams...)

Step by step guide for the installation and configuration of a cluster (with Rocks) to run ParaView

We have recently installed a small test cluster to run ParaView visualization software in parallel. The configuration was not trivial, and I put a detailed step-by-step guide in SIEpedia, in case it can be of interest to someone else. Any comments or suggestions are welcome.

Monday 26 October 2009

IDL (Virtual Machine) and Condor

At our place we have a nice Condor environment set up, and many people use IDL. Until now, our use of IDL with Condor was limited by the number of available licenses at any given time, until...

Until we discovered the IDL Virtual Machine which lets you run an IDL "executable" file without the need for licenses (see here for an example of how to create such a file).

The problem was that the IDL Virtual Machine is meant to be run interactively in a server with X running and Condor is not particularly well suited for this. But with a little ingenuity, we wrote a script (still in beta :-)) that uses Xvfb and Xautomation to submit condor jobs that will create a virtual X server, then automatically click the "Click to continue" button of the IDL virtual machine, and then do whatever the code is supposed to do. We have tested this, and so far it works quite well. There are some glitches with multicore machines and slow machines, but overall it works without any problems, and now we can submit hundreds of IDL jobs simultaneously to our Condor pool!

More info at SIEpedia

Tuesday 5 May 2009

Real World Haskell, what a joy!

I just started reading "Real World Haskell" (http://book.realworldhaskell.org/). I'm quite new to Haskell (though not to functional programming), and I must say that it is a joy to read... I hope that in a few days I can start writing "real" programs with it (Project Euler is probably going to provide the content for my programs...)

Wednesday 29 April 2009

Static IPs in Ubuntu 8.10....

Just configure a new machine with Ubuntu 8.10 (intrepid ibex). Everything went fine, except that one cannot configure static IPs properly. When the machine is booted, then something gets overwritten and it goes into DHCP mode again. Since we leave the machines on all day, this is not a problem (I just created a new network connection with the static IP address, and when the PC boots I just change manually to that configuration), but this would be annoying if we switched off the computers every day... Let's hope that 9.04 has solved this.

Accessing remote files with Tramp and Emacs

In recent versions of Emacs, tramp is already installed by default, and it is a very easy and convenient way of accessing files in a remote machine. All the documentation is at http://www.gnu.org/software/tramp/

Wednesday 8 April 2009



Progress on this has been definitely slow, but I'm now in position 6 in Spain and in Fortran, nice coincidence...