sabato 29 ottobre 2011

A highly integrated GMail notifier in Ubuntu 11.10

Thanks to Alexander Hungenberg we can have a simple and highly integrated GMail Notifier in Ubuntu 11.10. The picture above is self-explaining. This little tool is written in Python and uses the OSD notifications system.  
The installation is simple as usual in Ubuntu:

sudo apt-get install gm-notify

or search for gm-notify in the Ubuntu software center. After the installation use gm-notify-config to configure your account.

lunedì 17 ottobre 2011

Nautilus crashes in Ubuntu 11.10

When opening a folder, the file manager Nautilus crashes in Ubuntu 11.10. This is due to the package "nautilus-open-terminal".
To remove this annoying problem type the following command in a terminal:

sudo apt-get --purge remove nautilus-open-terminal

this removes the "nautilus-open-terminal" package.

giovedì 29 settembre 2011

Wget all the links in a file

I find very useful to download SDO-HMI data from  Virtual Solar Observatory  retrieving all the links I need in a csv file for convenience. This is more easy than studying manuals on how to retrieve file using IDL SolarSoft (after installing that!!!) after making queries on the database and things like that.
Now that all the links are exported in a csv file, to easily download all the images required with a single command just run:

wget -i SDO_images_list.csv

the "-i" flag recursively download all the links inside the csv file.

Ubuntu 11.04 reversed colors in movies

In Ubuntu 10.04 when playing a movie, colors appear to be reversed. To fix this problem in Movie Player (Totem) go to Edit --> Preferences --> Display  and slide the cursor "Hue" to the centre or click on "Reset to Defaults" button.


giovedì 8 settembre 2011

How to remove a large number of files in a directory

If you want to remove a large number of files with the "rm" command you probably will encounter this error:

"too long argument list"


We can solve this problem by using the find command instead as follows:

find . -name '*' | xargs rm



martedì 31 maggio 2011

How to make MPEG movies from single images

Generally it is not straightforward to make an MPEG movie inside Python or IDL from a sequence of plots.
To overcome this problem we can save all the images we need in the movie in a separate folder and then run the following command:

mencoder 'mf://*.png' -mf type=png:fps=7 -ovc lavc -lavcopts vcodec=wmv2 -oac copy -o movie.mpg

All the images *.png will be added in the MPEG movie.mpg

This is an IDL example to write jpeg images in a loop:

for t=0,Tot do begin
  tvframe, matrix(*,*,t), /bar, brange=[-200,200], /asp,btitle='v [m/s]', yr=[0.,200*0.17]
  image=tvrd(TRUE=3)
  WRITE_JPEG, '~/temp/'+'im'+strtrim(t)+'.jpg', image , true=3
endfor 

How to keep a process running after SSH logout

After SSH logout all the processes running are terminated.
To keep a process running you can use the "screen" command as follows (command sequence in a linux terminal):

  1. ssh user@server (SSH login as usual)
  2. screen
  3. Now we can launch the command we want to keep alive
  4. Ctrl+a D (this command detach the current terminal and logout)
Now we can close the SSH connection and the process will keep running.

To resume the detached shell we can simply login using SSH and then run the command:
  • screen -r