Sunday, February 28, 2010

[SW] Podcast in Quod Libet

Several moths ago, I installed Quod Libet for the first time. When I could not figure out how to add the podcast feeds in the Quod Libet, and posted my question on Ubuntu Forums. But I totally forget it after my posting... O__O"

I saw the thread when I was searching something else. Then I followed what lazka suggested:
$ sudo apt-get install python-feedparser
After installing the python-feedparser, just restart Quod Libet and find the Audio Feeds entry in the menu. Use the New button to add podcast feeds.

[Py] Random data generation -- a trial

I am studying the usage of LIBSVM recently. What I want is to test the library with some simple data to enhance my understanding for using the library. Therefore, I thought about generating some random data sets for my own learning purpose, and of course, the first choice came into me was Python.

The following are my code and the resulting data plot.
from pylab import *
from numpy import *

data =[]
#generate random data sets
data.append( 1.2*random.randn(2,30) )
data.append( 2.0*random.randn(2,30) )
data.append( random.randn(2,30) )

#shift the data sets
x0 = data[0][0]; y0 = data[0][1]
x1 = data[1][0]+3.5; y1 = data[1][1]+2.5
x2 = data[2][0]-1.5; y2 = data[2][1]+4.5

f = open('randData','w')
for i in range(len(x0)):
print >> f, '%f %f %f %f %f %f'\
% (x0[i], y0[i], x1[i], y1[i], x2[i], y2[i])


plot(x0, y0, 'ro', x1, y1, 'go', x2, y2, 'bo')

Saturday, February 27, 2010

[SW] Two CLI screensavers

Actually, I do not use screensavers. I always turn off the monitor when I have to leave my PC for a while. As a CLI fan, however, I am willing to see a CLI screensaver running on my monitor, especially when the screensaver is cool.

Cmatrix is a cool screensaver and it's easy for Ubuntu users to install. Just use the command
$ sudo apt-get install cmatrix
to get it, and you can have a really Matrix-like screensaver. Looks really cool, doesn't it?

The second one I installed is ASCIIQuarium. I found it on the Mostly CLI blog (Is that a Fish in Your CLI? The asciiquarium Screensaver.), which is worth visiting if you are also a CLI fan. Followed the steps, I download the Term::Animation module but got a warning when I runned the ``perl Makefile.PL'' command. The warning message was
Warning: prerequisite Curses 1.06 not found.
Then I tried to find out how to installed the so called ``curses'' in my Ubuntu 8.04, even install the libncurses5-dev (it's not the right one), but got no luky. Then, I noticed that all the packages are related to Perl! I am not familiar with Perl so I had no clear idea what searching strategy was right. Finally I knew that the libcurses-perl is the key. So if you encounter the same problem I had, please use the following command to install the libcurses-perl package.
$ sudo apt-get install libcurses-perl
Then here comes the ASCII fishes (as well as other things...).

Sunday, February 21, 2010

[SW] Mutt usage and setting -- with Gmail

Thank Andrew! I followed his blog article and finally make Mutt work with Gmail!

Here is the excellent instruction for newbies who want to try Mutt but have no idea how to to:
Using Mutt with Gmail

I have changed some settings for the inbox folder from

Although there are more things I need to learn, Andrew's guidance has given a good start. Hope you can benefit from this.

Friday, February 19, 2010

[SW] Rhythmbox and Quod Libet don't play music

I have used Rhythombox and Quod Libet for listening to music, podcast, and internet radio. But I didn't listen to music on my PC for a while, and these days I encountered a problem when I used Rhythombox and Quod Libet to open my music files. Both of them cannot play the ogg files. I tried to remove and reinstall them, but it didn't work.

Finally, I found a post from ``rhythmbox : does not play the songs at times. When I click play song, no response''.

So the solution is to change the sound setting to ALSA. The problem for me now is that I don't remember why I changed the sound setting to PulseAudio...

[SW] Invert the documents colors in Okular

[NOTE] Here is a newer version of this post:
Invert the document colors in Okular with toggle shortcut

I prefer viewing documents in black background with white text, just as what is usual in the command line environment. It seems no color inverting function in Evince, so I have to use Okular to satisfied my own requirement.

Open your PDF file with Okular, and follow Settings --> Configure okular to open the following dialog.
Check the ``Change Colors'' box and choose ``Invert colors'' of the color mode. Looks great!

[SW] Invoke Okular from the command line -- use soft symbolic link

I have installed Okular in my Ubuntu for several months and appreciated its annotation functions which allow me more freedom with my own documents. When I want to invoke Okular from the command line, however, it cannot be found by the system. After some investigations, the symbolic link seems to be the handiest solution.

Go to /usr/bin and use ln to make a symbolic link:
$ sudo ln -s /usr/lib/kde4/bin/okular okular

This is my first time to use ln, and it works as expectation. :-)

Friday, February 12, 2010

[SW] How to import html tables into the OO Calc?

I am working on patent search these days (and it's really a terrible task, at least for me). With some assistant tools I got a downloaded list of the patents I've found, and this list has been given with a xls filename extension. The xls file works fine with MS Excel but not OO Calc. When I tried to open the xls file in my Ubuntu, it showed as a text file with gedit with some html tags in the content. So the xls file was essentially a html table file, and OO Calc just cannot open the file directly.

The unoconv was the first possible solution I found. It can convert between formats that supported by OpenOffice. The command line usage is simple, just define the ouput format as the following
$ unoconv -f ods originalfile.html

and the unoconv gives the output file with assigned format (originalfile.ods in this example). However, when I tried to open the converted ods file with OO Calc, nothing happened, the OO Calc didn't open anything and showed only empty content.

Luckily, another simpler solution has been there. Just utilize the import function provided by OO Calc itself to import the html table, then everything goes smoothly. You can find the function in ``Insert/Link to External Data'' and it comes up a dialog for choosing your file.

OpenOffice Calc Tips: Webquery : Importing HTML tables

Tuesday, February 09, 2010

[QnA] Convert MOD to AVI using transcode -- without audio ouput

Sometimes we might take videos with some environmental noise or conversations which are not suitable to be heard by others. Also, we don't need or want to add other audio into the original video, so just export the video without audio is fine enough.

I had some MOD files to be converted by using transcode before, and this time I want to export my MOD files into avi files with no sound. It's can be done by apply the ``null'' option as the following

transcode -i input.MOD -y xvid,null -o output.avi

That's all.