Tuesday, April 28, 2009

[SW] View images in text mode (CLI)

I was just wondering how to view images in command line interface (CLI). So, I typed keywords to Google and find there is a package named ``fbi'' for this kind of purpose.

After installation, however, the fbi did not work in my Ubuntu. I removed it, and reinstalled again when I found the solution.
sudo vim /boot/grub/menu.lst
Search for ``defoptions=''
add the ``vga=791'' under the line of ``# defoptions=quiet splash''
Then
search for ``/boot/vmlinuz''
add ``vga=791'' to the end of the line

That's funny, and that lets me do more works under text mode console. :-)

Monday, April 27, 2009

[SW] Change filenames, using: ls sed xargs, and mv

I found the instruction (in Chinese) and made some modification to meet my own needs.

For example, I have several png files named in the form of dataCounts_*_g.png, and I want to mv them into the form of *_g_f.png. All I have to do is to delete the ``dataCounts_'' part and insert ``_f'' into ``_g.png.''

Because I don't need to change all the filenames under the working directory, it is not necessary to use find. Using ls is enough.

Furthermore, I need to change more than one part of the original files, so I apply the substituting function of sed twice. Finally I have the commands as the follows.
ls *.png | sed -e p -e 's/dataCounts_//' -e 's/_g/_g_f/' | xargs -n2 mv

Friday, April 24, 2009

[SW] Grace -- a WYSIWYG 2D plotting tool

I tried to write a shell script to cooperate with the gnuplot, and encountered some problem when I wanted to modify my script to be more ``useful.'' After try and try, I decided to post my question on Google Groups for help (here is the thread). Then although I didn't get direct reply yet, the kind user gave some useful information, that is, the plotting tool Grace.

From the Grace's homepage, it looks really good at plotting and also analyzing data. I have not start to try and use it, but I will, later.

Thursday, April 23, 2009

[Chat] Security and open source software

Here is an article written by Robert Dewar, titled as ``Open Source Software for High Reliability Applications: Is it safe?.''

The author argued the benefit of making the software open sourced. He believed that, by doing so, the software could be safer and we could avoid using software containing bugs which no one can discover because the source code is kept privately.

Besides, the comment left by the reader jogafe also gave me some new opinions.