<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Prashanth Ellina &#187; linux</title>
	<atom:link href="http://blog.prashanthellina.com/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.prashanthellina.com</link>
	<description>( to ) ? be : ! be;</description>
	<lastBuildDate>Fri, 02 Apr 2010 21:06:24 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>All your aliases are belong to you</title>
		<link>http://blog.prashanthellina.com/2009/08/28/all-your-aliases-are-belong-to-you/</link>
		<comments>http://blog.prashanthellina.com/2009/08/28/all-your-aliases-are-belong-to-you/#comments</comments>
		<pubDate>Fri, 28 Aug 2009 02:47:06 +0000</pubDate>
		<dc:creator>prashanthellina</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[text processing]]></category>
		<category><![CDATA[veveo]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[productivity]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://blog.prashanthellina.com/?p=129</guid>
		<description><![CDATA[I like setting up shortcuts to frequently used commands whether I used Windows or Linux. I use the terminal often and create shortcuts to frequently used    commands using &#8220;alias&#8221; feature of BASH. This has saved me considerable time in the past. However, I recently felt that if I could have a helper [...]]]></description>
			<content:encoded><![CDATA[<p>I like setting up shortcuts to frequently used commands whether I used Windows or Linux. I use the terminal often and create shortcuts to frequently used    commands using &#8220;alias&#8221; feature of BASH. This has saved me considerable time in the past. However, I recently felt that if I could have a helper tool to       monitor my usage of commands and automatically suggest candidates for aliasing, that would be useful. The output of that is Aliaser.</p>
<p>Aliaser works by monitoring your bash history. It analyses command frequency and suggests candidates for aliasing. It manages aliases so created. The feature I like most in Aliaser is that it reminds you to use the aliases you created by showing tips on opening a new terminal session.</p>
<p>Download Aliaser from <a href="http://aliaser.googlecode.com">http://aliaser.googlecode.com</a>.</p>
<p><a href="http://aliaser.googlecode.com"><br />
<img align="center" src="http://aliaser.googlecode.com/files/aliaser_tips.png"/><br />
</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.prashanthellina.com/2009/08/28/all-your-aliases-are-belong-to-you/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Query Wikipedia from your terminal</title>
		<link>http://blog.prashanthellina.com/2009/08/23/query-wikipedia-from-your-terminal/</link>
		<comments>http://blog.prashanthellina.com/2009/08/23/query-wikipedia-from-your-terminal/#comments</comments>
		<pubDate>Sun, 23 Aug 2009 05:34:23 +0000</pubDate>
		<dc:creator>prashanthellina</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[wikipedia]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[productivity]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://blog.prashanthellina.com/?p=122</guid>
		<description><![CDATA[I refer Wikipedia frequently. I use this BASH function to help me do that from the terminal. For explanation of how this works head over here.
 BASH function 

# wiki

# eg: wiki India
#     wiki Apple_Inc
#     wiki Anglo_Saxon
wiki()
{
    dig +short txt $1.wp.dg.cx
}


 Example usage 

prashanth@prashanth-desktop:~$ [...]]]></description>
			<content:encoded><![CDATA[<p>I refer Wikipedia frequently. I use this BASH function to help me do that from the terminal. For explanation of how this works head over <a href="http://www.commandlinefu.com/commands/view/2829/query-wikipedia-via-console-over-dns">here</a>.</p>
<p><strong> BASH function </strong></p>
<pre lang="bash">
# wiki
<page>
# eg: wiki India
#     wiki Apple_Inc
#     wiki Anglo_Saxon
wiki()
{
    dig +short txt $1.wp.dg.cx
}
</pre>
<p><br/></p>
<p><strong> Example usage </strong></p>
<pre lang="bash">
prashanth@prashanth-desktop:~$ wiki India
"India, officially the Republic of India ( '\; see also other Indian languages), is a country in South Asia.
It is the seventh-largest country by geographical area, the second-most populous country, and the most
populous democracy in the world. Bounded by t" "he Indian Ocean on the south, the Arabian Sea on
the west, and the Bay of Bengal on the east, India has a coastline of ... http://a.vu/w:India"

prashanth@prashanth-desktop:~$ wiki Anglo_Saxon
"Anglo-Saxons (or Anglo-Saxon) is the term usually used to describe the invading tribes in the south
and east of Great Britain starting from the early 5th century AD, and their creation of the English
nation, lasting until the Norman conquest of 1066. The " "Benedictine monk, Bede, identified
them as the descendants of three Germanic tribes: http://a.vu/w:Anglo-Saxons"
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.prashanthellina.com/2009/08/23/query-wikipedia-from-your-terminal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>On setting up USB RAID</title>
		<link>http://blog.prashanthellina.com/2009/08/07/on-setting-up-usb-raid/</link>
		<comments>http://blog.prashanthellina.com/2009/08/07/on-setting-up-usb-raid/#comments</comments>
		<pubDate>Fri, 07 Aug 2009 12:09:16 +0000</pubDate>
		<dc:creator>prashanthellina</dc:creator>
				<category><![CDATA[computer hardware]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://blog.prashanthellina.com/?p=102</guid>
		<description><![CDATA[I bought two Dane-Elec 8GB USB drives recently. Flash memory (as opposed to Hard disk storage) has faster &#8220;seek&#8221; capability. This is inherent in the design as flash memory is solid state whereas hard disks are electro-mechanical with a &#8220;head&#8221; that needs to be moved around using a &#8220;drive&#8221; mechanism. Since seek times are better [...]]]></description>
			<content:encoded><![CDATA[<p>I bought two Dane-Elec 8GB USB drives recently. Flash memory (as opposed to Hard disk storage) has faster &#8220;seek&#8221; capability. This is inherent in the design as flash memory is solid state whereas hard disks are electro-mechanical with a &#8220;head&#8221; that needs to be moved around using a &#8220;drive&#8221; mechanism. Since seek times are better on flash drives, they are faster when you are reading or writing a lot of small files.</p>
<p>However flash drives do not have sustained data transfer rates that hard disks have (i.e throughput). My thought process what that the throughput can be made up by slapping together two or more USB drives and applying software RAID 0 over them. Below are some performance results and they look encouraging.</p>
<p>Note that the timings are in seconds.</p>
<p><strong>Single 8GB Dane-Elec USB drive</strong><br />
131.11 for 683MB (write)<br />
44.62 for 683MB (read)</p>
<p><strong>Single 2GB Transcend USB drive</strong><br />
204.50 for 683MB (write)<br />
63.26 for 683MB (read)</p>
<p><strong>Single 8GB Sandisk drive</strong><br />
197.61 for 683MB (write)<br />
29.73 for 683MB (read)</p>
<p><strong>RAID0 (two Dane-Elec 8GB USB drives)</strong><br />
61.177 for 683MB (write)<br />
17.9 for 683MB (read)</p>
<p>I created a test file with 683 MB of data by funnelling /dev/urandom into it and then copied it to the USB drive(s) to measure write performance. Then I unmounted the USB drive(s) to make sure the buffer cache is emptied. On remounting I measured read performance by copying the test file back to the harddisk. The hard disk used was a Seagate Barracuda 320GB (7200rpm).</p>
<p>If four USB drives (say Sandisk 8GB) can be RAID&#8217;ed together on level 0 we would have a cheap SSD. One thing that prevents me from trying this out is the question of reliability. I have not used this setup long enough or stressed it hard enough to be comfortable using this for normal use.</p>
<p>To rig something like this yourself, read this <a href="http://linuxgazette.net/151/weiner.html">article</>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.prashanthellina.com/2009/08/07/on-setting-up-usb-raid/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XMonad: A Window Manager for &#8220;real&#8221; people :)</title>
		<link>http://blog.prashanthellina.com/2009/04/26/xmonad/</link>
		<comments>http://blog.prashanthellina.com/2009/04/26/xmonad/#comments</comments>
		<pubDate>Sun, 26 Apr 2009 16:16:27 +0000</pubDate>
		<dc:creator>prashanthellina</dc:creator>
				<category><![CDATA[gnome]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[gui]]></category>
		<category><![CDATA[tiling window manager]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[xmonad]]></category>

		<guid isPermaLink="false">http://blog.prashanthellina.com/?p=79</guid>
		<description><![CDATA[ I have been a happy Gnome user for many years now and only recently started thinking about switching to KDE 4.2 when Ubuntu 9.04 (Jaunty Jackalope) comes out. However, it so happened that I bought two new widescreen monitors and setup a dual-monitor environment. This is when I started realizing the Gnome was clumsy [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.prashanthellina.com/images/xmonad_1.png" alt="XMonad in Gnome" align="left"/> I have been a happy Gnome user for many years now and only recently started thinking about switching to KDE 4.2 when Ubuntu 9.04 (Jaunty Jackalope) comes out. However, it so happened that I bought two new widescreen monitors and setup a dual-monitor environment. This is when I started realizing the Gnome was clumsy at best when it comes to managing windows across monitors.</p>
<p>The reason I bought multiple monitors is to maximize my work area so I do not have to keep switching between overlapping windows. Gnome it seems is ill-suited to effectively and effortlessly managing space.</p>
<p>When I maximize a window on a widescreen monitor, the window takes up the entire space on the screen. Although this is the expected behavior, I could not rest looking at the huge amount of space being wasted. What I would like better is having two windows occupying the height of the screen but sitting right next to each other (i.e. tiled). This way less space is wasted and you get to see both windows at the same time. I could do this in gnome, but with considerable effort, as closing a window and re-opening another requires another round of frantic window arrangement.</p>
<p>In comes a tiling window manager &#8230; Tiling window managers do not allow overlapping windows (except for dialogs). They are a good solution when you need to tile windows to occupy all available screen space. Also, most tiling window managers emphasize keyboard control over mouse control. If you are productivity freak you will love the keyboard shortcuts that do away with a painful context switch required in navigating with the mouse.</p>
<p>There are many Tiling Window Managers out there. Rat Poison, Stump WM, Ion, dwm, wmii and XMonad are a few. I chose XMonad because I was able to figure how to integrate XMonad into the Gnome desktop environment. Most of these window managers don&#8217;t play well with Gnome. I use a number of Gnome apps and I would hate to not be able to use them.</p>
<p>Okay, here is how you <strong>Install XMonad on Ubuntu to work within Gnome</strong> &#8230;</p>
<pre lang="bash">
mkdir ~/.xmonad
cd ~/.xmonad
vim xmonad.hs
</pre>
<p><br/></p>
<p>Then paste the following into the xmonad.hs file and save it.</p>
<pre lang="haskell">
import XMonad
import XMonad.Config.Gnome
import XMonad.ManageHook

myManageHook :: [ManageHook]
myManageHook =
    [ resource  =? "Do"   --> doIgnore ]

main = xmonad gnomeConfig
    { manageHook = manageHook gnomeConfig <+> composeAll myManageHook}
</pre>
<p><br/></p>
<pre lang="bash">
sudo apt-get install xmonad libghc6-xmonad-dev
</pre>
<p><br/><br />
Note that libghc6-xmonad-dev is a 200MB dependency!</p>
<pre lang="bash">
vim ~/.gnomerc
</pre>
<p><br/></p>
<p>Add this line .gnomerc file and save.</p>
<pre lang="bash">
export WINDOW_MANAGER=xmonad
</pre>
<p>The installation is done. Now to experience your new Window Manager, log out and then log back in. You will see your usual desktop with Gnome panels.</p>
<p>To learn more about XMonad and how to use it, follow these links:</p>
<p><a href="http://ubuntu-snippets.blogspot.com/2008/08/xmonad-tiling-window-manager.html">http://ubuntu-snippets.blogspot.com/2008/08/xmonad-tiling-window-manager.html</a><br />
<a href="http://tombuntu.com/index.php/2009/03/17/introduction-to-the-xmonad-tiling-window-manager/">http://tombuntu.com/index.php/2009/03/17/introduction-to-the-xmonad-tiling-window-manager/</a><br />
<a href="https://www.haskell.org/haskellwiki/Xmonad/Using_xmonad_in_Gnome/0.5">https://www.haskell.org/haskellwiki/Xmonad/Using_xmonad_in_Gnome/0.5</a></p>
<p><img src="http://www.prashanthellina.com/images/xmonad_2.jpg" alt="XMonad in Gnome" align="left"/></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.prashanthellina.com/2009/04/26/xmonad/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Nose &#8211; TDD &#8211; Python</title>
		<link>http://blog.prashanthellina.com/2008/05/22/nose-tdd-python/</link>
		<comments>http://blog.prashanthellina.com/2008/05/22/nose-tdd-python/#comments</comments>
		<pubDate>Thu, 22 May 2008 15:02:08 +0000</pubDate>
		<dc:creator>prashanthellina</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[nose]]></category>
		<category><![CDATA[tdd]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://blog.prashanthellina.com/?p=65</guid>
		<description><![CDATA[What, why
I&#8217;ve been reading up on TDD and it has struck me as particularly useful methodology to achieve &#8220;clean code that works&#8221;. TDD encourages writing unit tests to cover all the code (because by definition, you write a test before a line of code is written). Because all your code is covered you are freed [...]]]></description>
			<content:encoded><![CDATA[<h3>What, why</h3>
<p>I&#8217;ve been reading up on <a href="http://en.wikipedia.org/wiki/Test-driven_development">TDD</a> and it has struck me as particularly useful methodology to achieve &#8220;clean code that works&#8221;. TDD encourages writing unit tests to cover all the code (because by definition, you write a test before a line of code is written). Because all your code is covered you are freed from the fear of breakage due to change and can instantly be more confident and productive. Also, the test cases act as a specification in code &#8211; very useful.</p>
<p>Python has standard modules, <a href="http://docs.python.org/lib/module-unittest.html">unittest</a> and <a href="http://docs.python.org/lib/module-doctest.html">doctest</a> to help you write test cases. I simply love doctest. It alleviates much of the pain of writing a test case (setup and all) besides acting as &#8220;executable documentation&#8221;. The unittest module has a Java legacy and is not to my taste. Also, I wanted to find a solution that would help in automated test enumeration (discovery) in my source directories without having to write any &#8220;infrastructure&#8221; code. One more thing I was looking for was a way to run both unit tests and doc tests together.</p>
<p>After a bit of searching, I found &#8220;<a href="http://somethingaboutorange.com/mrl/projects/nose/">Nose</a>&#8220;. Nose is a clone of &#8220;<a href="http://codespeak.net/py/dist/test.html">py.test</a>&#8221; which I liked better than the original (subjectively). To get a feel of &#8220;Nose&#8221;, I set up some python test files.</p>
<p>The following is the directory structure and the contents of the files. I&#8217;ve put in both unit tests and doc tests in the files to see how &#8220;Nose&#8221; handles them. Also, the tests are spread across directories. Note that I had to put an &#8220;__init__.py&#8221; to allow &#8220;Nose&#8221; to import tests in a subdirectory.</p>
<h3>The setup</h3>
<p><strong>The directory structure</strong></p>
<pre lang="bash">
prashanth@prashanth-desktop:~/tmp$ tree
.
|-- bingo.py
|-- somedir
|   |-- __init__.py
|   `-- test_another.py
`-- test_prashanth.py

1 directory, 4 files
</pre>
<p><br/></p>
<p><strong>bingo.py</strong></p>
<pre lang="python">
def boing(a, b):
    '''
    >>> boing(10, 20)
    30
    '''
    return a+b

def boing1(a, b):
    '''
    >>> boing1(10, 20)
    40
    '''
    return a+b
</pre>
<p><br/></p>
<p><strong>test_prashanth.py</strong></p>
<pre lang="python">
def test_a():
    assert 1

def test_b():
    print "hello"
    assert 0
</pre>
<p><br/></p>
<p><strong>somedir/test_another.py</strong></p>
<pre lang="python">
def test_bingo():
    raise Exception('hgello')
</pre>
<p><br/></p>
<h3>Installing &#8220;Nose&#8221;</h3>
<pre lang="bash">
sudo easy_install nose
</pre>
<p><br/></p>
<p>If you don&#8217;t have easy_install, head over <a href="http://somethingaboutorange.com/mrl/projects/nose/">here</a> to get information on installation.</p>
<h3>Running the tests</h3>
<p>Now that &#8220;Nose&#8221; is installed, let us run the tests,</p>
<pre lang="bash">
nosetests --with-doctest
</pre>
<p><br/></p>
<p>The output is</p>
<pre lang="bash">
..E.F
======================================================================
ERROR: somedir.test_another.test_bingo
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/nose-0.10.2-py2.5.egg/nose/case.py", line 182, in runTest
    self.test(*self.arg)
  File "/home/prashanth/tmp/somedir/test_another.py", line 2, in test_bingo
    raise Exception('hgello')
Exception: hgello

======================================================================
FAIL: test_prashanth.test_b
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/nose-0.10.2-py2.5.egg/nose/case.py", line 182, in runTest
    self.test(*self.arg)
  File "/home/prashanth/tmp/test_prashanth.py", line 7, in test_b
    assert 0
AssertionError:
-------------------- >> begin captured stdout << ---------------------
hello

--------------------- >> end captured stdout << ----------------------

----------------------------------------------------------------------
Ran 5 tests in 0.057s

FAILED (errors=1, failures=1)
</pre>
<p><br/></p>
<p>The first line in the output is the "test progress" indication (..E.F) . When a test succeeds, a '.' is written. When a test fails, an 'F' is written. When a test throws an Exception, an 'E' is written. Very useful to get a sense of progress as a huge test suite being executed.</p>
<p>"Nose" captures the stdout and stderr when a test case fails to help you debug the issue. To <a href="http://ivory.idyll.org/articles/nose-intro.html">learn more about using "Nose" go here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.prashanthellina.com/2008/05/22/nose-tdd-python/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Project Gutenberg Ngram data: English only</title>
		<link>http://blog.prashanthellina.com/2008/05/13/project-gutenberg-ngram-data-english-only/</link>
		<comments>http://blog.prashanthellina.com/2008/05/13/project-gutenberg-ngram-data-english-only/#comments</comments>
		<pubDate>Tue, 13 May 2008 16:36:05 +0000</pubDate>
		<dc:creator>prashanthellina</dc:creator>
				<category><![CDATA[data mining]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[text processing]]></category>
		<category><![CDATA[ngram]]></category>
		<category><![CDATA[project gutenberg]]></category>

		<guid isPermaLink="false">http://blog.prashanthellina.com/?p=64</guid>
		<description><![CDATA[In my earlier post, I&#8217;d posted links to the Project Gutenberg Ngram data I had computed for e-books of all languages. If you are interested in only the English data, get these files instead.


These two files are splits of a compressed file which contains all of the Project Gutenberg English e-books downloaded about a week [...]]]></description>
			<content:encoded><![CDATA[<p>
In my <a href="/2008/05/04/n-gram-data-from-project-gutenberg/">earlier post</a>, I&#8217;d posted links to the <a href="http://www.gutenberg.org">Project Gutenberg</a> Ngram data I had computed for e-books of all languages. If you are interested in only the English data, get these files instead.
</p>
<p>
These two files are splits of a compressed file which contains all of the Project Gutenberg English e-books downloaded about a week before the date of this post.<br/><br />
<a href="http://www.prashanthellina.com/docs/gutenberg_data/gutenberg_en_files.tar.bz2.0">gutenberg_en_files.tar.bz2.0</a> (<strong>2.0GB</strong>) <br/></p>
<p><a href="http://www.prashanthellina.com/docs/gutenberg_data/gutenberg_en_files.tar.bz2.1">gutenberg_en_files.tar.bz2.1</a> (<strong>1.4GB</strong>) <br/></p>
<p>Unigrams along with frequency count from the text data above<br/><br />
<a href="http://www.prashanthellina.com/docs/gutenberg_data/gutenberg_en_unigrams.tar.gz">gutenberg_en_unigrams.tar.gz</a> (<strong>7.4MB</strong>) <br/></p>
<p>Bi-grams and Tri-grams along with frequency count from the text data above<br/><br />
<a href="http://www.prashanthellina.com/docs/gutenberg_data/gutenberg_en_bi_tri_grams.tar.gz">gutenberg_en_bi_tri_grams.tar.gz</a> (<strong>493MB</strong>) <br/>
</p>
<p>I had to split the files because my webserver has a limitation in serving out files larger than 2GB. After downloading the files, do this</p>
<pre lang="BASH">
mv gutenberg_en_files.tar.bz2.0 gutenberg_en_files.tar.bz2
cat gutenberg_en_files.tar.bz2.1 >> gutenberg_en_files.tar.bz2
rm gutenberg_en_files.tar.bz2.1
</pre>
<p><br/></p>
<p>If you find the data useful, I&#8217;d be delighted to hear the context in which you made use of it.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.prashanthellina.com/2008/05/13/project-gutenberg-ngram-data-english-only/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>N-gram data from Project Gutenberg</title>
		<link>http://blog.prashanthellina.com/2008/05/04/n-gram-data-from-project-gutenberg/</link>
		<comments>http://blog.prashanthellina.com/2008/05/04/n-gram-data-from-project-gutenberg/#comments</comments>
		<pubDate>Sun, 04 May 2008 16:40:14 +0000</pubDate>
		<dc:creator>prashanthellina</dc:creator>
				<category><![CDATA[data mining]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[text processing]]></category>
		<category><![CDATA[gutenberg]]></category>
		<category><![CDATA[ngrams]]></category>
		<category><![CDATA[project gutenberg]]></category>
		<category><![CDATA[text parsing]]></category>

		<guid isPermaLink="false">http://blog.prashanthellina.com/?p=63</guid>
		<description><![CDATA[  I&#8217;ve been working on Wordza.com for which I needed Ngram data from a sufficiently large corpus. Initially,  I thought of using Wikipedia data which I already have on my disk, but decided on using Project Gutenberg data as it is more representative of the general usage of English language.

Get Project Gutenberg Ngram [...]]]></description>
			<content:encoded><![CDATA[<p>
  I&#8217;ve been working on <A href="http://www.wordza.com" name="Wordza">Wordza.com</A> for which I needed Ngram data from a sufficiently large corpus. Initially,  I thought of using Wikipedia data which I already <A href="/2007/12/21/topic-extraction-using-wikipedia-data/">have on my disk</A>, but decided on using <A href="http://www.gutenberg.org">Project Gutenberg</A> data as it is more representative of the general usage of English language.
</p>
<h2>Get Project Gutenberg Ngram data</h2>
<p>
The Ngram data contains bi-grams and tri-grams for now. I plan to generate uni-grams soon. I&#8217;ve made the data available here so you can download and use it! This data contains all of the e-books hosted by Project Gutenberg (which means the data contains English, French, German and other languages). If you want an English only dataset, check back in a week or two. I am in the process of generating the same.
</p>
<p>
  The Ngram data containing bi-grams and tri-grams. Each line is prepended with the occurence count.<br/><br />
<A href="http://www.prashanthellina.com/docs/gutenberg_data/gutenberg_ngrams.tar.bz2">gutenberg_ngrams.tar.bz2</A> (<strong>624 MB</strong>)<br/></p>
<p><br/></p>
<p>This is the compressed tarball of all the txt files in Project Gutenberg (as of a week before this blog post). Note that you don&#8217;t need this file unless you want to generate the Ngrams yourself using the scripts provided below.<br/><br />
<A href="http://www.prashanthellina.com/docs/gutenberg_data/gutenberg_files.tar.bz2.0">gutenberg_files.tar.bz2.0</A>,<br />
<A href="http://www.prashanthellina.com/docs/gutenberg_data/gutenberg_files.tar.bz2.1">gutenberg_files.tar.bz2.1</A>,<br />
<A href="http://www.prashanthellina.com/docs/gutenberg_data/gutenberg_files.tar.bz2.2">gutenberg_files.tar.bz2.2</A> (<strong>5.3 GB</strong>)<br/></p>
<p>My webserver (Apache) has a problem serving out files bigger than 2GB, so I had to split the file up. After you download the splits, you have to join them like this.</p>
<pre lang="BASH">
mv gutenberg_files.tar.bz2.0 gutenberg_files.tar.bz2
cat gutenberg_files.tar.bz2.1 >> gutenberg_files.tar.bz2
cat gutenberg_files.tar.bz2.2 >> gutenberg_files.tar.bz2
</pre>
<p><br/></p>
<p>To decompress the files, you will need bunzip2 on *nix/Cygwin. On Windows, use 7zip.
</p>
<h2>Generate the data yourself</h2>
<p>
In case you want to generate the Ngrams yourself by processing the Project Gutenberg data files, follow these instructions. You will have to get the Project gutenberg data files. Use the following command to get all the English language files in txt format.</p>
<pre lang="bash">
mkdir gutenberg
cd gutenberg
wget -w 2 -m "http://www.gutenberg.org/robot/harvest?filetypes[]=txt&#038;langs[]=en"
</pre>
<p><br/></p>
<p>The txt files are compressed and stored in files ending with .zip extension. These zip files are spread across multiple directories. The following command will move the zip files into the &#8220;gutenberg&#8221; directory you created in the above step.</p>
<pre lang="BASH">
for i in `find . -name "*.zip"`; do mv $i . ; done;
</pre>
<p><br/></p>
<p>Now that all the zip files are in the same directory, unzip the zip files.Some zip files may contain files other than .txt&#8217;s. The following command extracts only .txt&#8217;s in the zip files.</p>
<pre lang="BASH">
cd ..
mkdir gutenberg_txt
for i in `find gutenberg -name "*.zip"`; do unzip $i \*.txt -d gutenberg_txt/ ; done;
cd gutenberg_txt
for i in `find . -name "*.txt"`; do mv $i . ; done;
cd ..
</pre>
<p><br/></p>
<p>The gutenberg txt files have gutenberg headers and footers which should be removed lest they skew the frequency of Ngrams. The script &#8220;remove_gutenberg_text.py&#8221; does exactly this. The &#8220;generate_ngrams.py&#8221; script creates uni, bi and tri-grams of whatever text is piped into it. The following command pipes all the txt files through both the scripts to create the ngrams file.</p>
<pre lang="BASH">
for i in `find gutenberg_txt/ -name "*.txt"`; \
do cat $i | python remove_gutenberg_text.py | \
grep -i -v "project gutenberg" |\
 python generate_ngrams.py >> gutenberg_ngrams; done;
</pre>
<p><br/></p>
<p>Now you have to count the number of times an ngram occurs. The following sequence of commands process the ngrams file generated above and produce a file with the frequency counts of the ngrams. Note that the &#8220;512K&#8221; option to sort is because I had to run these scripts on my host which kills processes that take too much memory. If you have a machine with a lot of memory, sorting can be significantly faster if you use a higher value, say &#8220;1G&#8221;.</p>
<pre lang="BASH">
sort -S 512K -T tmp_sort/ gutenberg_ngrams > gutenberg_ngrams.sorted
uniq -c gutenberg_ngrams.sorted > gutenberg_ngrams.counted
sort -S 512K -T tmp_sort/ gutenberg_ngrams.counted > gutenberg_ngrams.counted.sorted
</pre>
<p><br/>
</p>
<h3>Gutenberg data processing scripts</h3>
<ul>
<li><A href="http://code.prashanthellina.com/code/remove_gutenberg_text.py">remove_gutenberg_text.py</A> &#8212; removes Project Gutenberg header and footer from txt files</li>
<li><A href="http://code.prashanthellina.com/code/generate_ngrams.py">generate_ngrams.py</A> &#8212; generate uni, bi and tri-grams for any text</li>
</ul>
<h2>Do get back</h2>
<p>If you use this data, I would really appreciate if you get back with details about how you used it in the context of your project</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.prashanthellina.com/2008/05/04/n-gram-data-from-project-gutenberg/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Selecting a random row from a table in mysql</title>
		<link>http://blog.prashanthellina.com/2008/04/08/selecting-a-random-row-from-a-table-in-mysql/</link>
		<comments>http://blog.prashanthellina.com/2008/04/08/selecting-a-random-row-from-a-table-in-mysql/#comments</comments>
		<pubDate>Tue, 08 Apr 2008 16:12:42 +0000</pubDate>
		<dc:creator>prashanthellina</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[query]]></category>
		<category><![CDATA[random record]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://blog.prashanthellina.com/?p=60</guid>
		<description><![CDATA[I have come across more than one instance when I had to select a random record from a table in a MySQL database. Here is how to do it.
The simple but slow method


SELECT * FROM mytable ORDER BY RAND() LIMIT 1;


Although simple, the above query can be very slow on tables which have a large [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.prashanthellina.com/images/database_symbol.png" alt="database" align="right" style="border:0px"/><br />
<blockquote><strong>I have come across more than one instance when I had to select a random record from a table in a MySQL database. Here is how to do it.</strong></p></blockquote>
<h2>The simple but slow method</h2>
<p><br/></p>
<pre lang="post">
SELECT * FROM mytable ORDER BY RAND() LIMIT 1;
</pre>
<p><br/></p>
<p>Although simple, the above query can be very slow on tables which have a large number of records. This happens because MySQL makes a temporary table with a random number assigned to each row. It then sorts the table and returns the one record from the sorted list.</p>
<h2>Random record selection by id generation : A better and faster method</h2>
<p>The table will need to have an &#8216;id&#8217; field which is an auto-incrementing integer. The approach is to generate a random number which falls in the range of the values of the &#8216;id&#8217; field. MySQL MAX() and MIN() grouping functions allow you to choose the maximum and minimum values of a field.</p>
<h3> The python approach </h3>
<p>Sample python code to do the random record selection</p>
<pre lang="python">
import random
...
cursor.execute('SELECT MIN(id) FROM mytable')
min_value = cursor.fetchone()
cursor.execute('SELECT MAX(id) FROM mytable')
max_value = cursor.fetchone()

random_id = random.randint(min_value, max_value)

cursor.execute('SELECT * FROM mytable WHERE id = %s', (random_id,))
random_record = cursor.fetchone()
</pre>
<p><br/></p>
<h3> Pure SQL approach </h3>
<p>MySQL offers a RAND() function which generates a random floating point number between 0.0 and 1.0. We will use this value and scale it to fit into the max &#8211; min value range of the id field.<br />
<br/></p>
<pre lang="sql">
SELECT * FROM mytable WHERE id = (SELECT MIN(id) + FLOOR((MAX(id)+1) * RAND()) FROM mytable ) LIMIT 1;
</pre>
<p><br/></p>
<p>So next time you have to select a random record, you know what to do <img src='http://blog.prashanthellina.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>Additional information</strong></p>
<ul>
<li><a href="http://www.phptoys.com/e107_plugins/content/content.php?content.28">http://www.phptoys.com/e107_plugins/content/content.php?content.28</a>
<li><a href="http://www.carlj.ca/2007/12/16/selecting-random-records-with-sql/">http://www.carlj.ca/2007/12/16/selecting-random-records-with-sql/</a>
<li><a href="http://akinas.com/pages/en/blog/mysql_random_row/">http://akinas.com/pages/en/blog/mysql_random_row/</a>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.prashanthellina.com/2008/04/08/selecting-a-random-row-from-a-table-in-mysql/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Visualizing mpeg4 motion compensation vectors using mplayer</title>
		<link>http://blog.prashanthellina.com/2008/03/30/visualizing-mpeg4-motion-compensation-vectors-using-mplayer/</link>
		<comments>http://blog.prashanthellina.com/2008/03/30/visualizing-mpeg4-motion-compensation-vectors-using-mplayer/#comments</comments>
		<pubDate>Sat, 29 Mar 2008 18:59:30 +0000</pubDate>
		<dc:creator>prashanthellina</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[motion compensation]]></category>
		<category><![CDATA[mpeg4]]></category>
		<category><![CDATA[mplayer]]></category>
		<category><![CDATA[video compression]]></category>
		<category><![CDATA[visualization]]></category>

		<guid isPermaLink="false">http://blog.prashanthellina.com/2008/03/30/visualizing-mpeg4-motion-compensation-vectors-using-mplayer/</guid>
		<description><![CDATA[The MPEG4 video encoding process makes use of block motion compensation to achieve compression. The motion compensation process serves to produce the intra frames which are the frames between keyframes. I&#8217;ve always been fascinated by this process and was delighted to find out that my favorite video player, mplayer, allows one to visualize this process. [...]]]></description>
			<content:encoded><![CDATA[<p>The MPEG4 video encoding process makes use of <strong>block motion compensation</strong> to achieve compression. The motion compensation process serves to produce the intra frames which are the frames between keyframes. I&#8217;ve always been fascinated by this process and was delighted to find out that my favorite video player, <strong>mplayer</strong>, allows one to visualize this process. I tried it and it is wonderful!</p>
<p>This is the video I tried the process on: <a href="http://www.prashanthellina.com/images/motion_vector_video.avi"><strong>download</strong></a></p>
<hr/>
<p><img src="http://www.prashanthellina.com/images/motion_vector_a_0.jpg" alt="motion compensation vector visualization"/><br />
<img src="http://www.prashanthellina.com/images/motion_vector_a_1.jpg" alt="motion compensation vector visualization"/></p>
<hr/>
<p><img src="http://www.prashanthellina.com/images/motion_vector_b_0.jpg" alt="motion compensation vector visualization"/><br />
<img src="http://www.prashanthellina.com/images/motion_vector_b_1.jpg" alt="motion compensation vector visualization"/></p>
<hr/>
<p><img src="http://www.prashanthellina.com/images/motion_vector_c_0.jpg" alt="motion compensation vector visualization"/><br />
<img src="http://www.prashanthellina.com/images/motion_vector_c_1.jpg" alt="motion compensation vector visualization"/></p>
<hr/>
<p><img src="http://www.prashanthellina.com/images/motion_vector_d_0.jpg" alt="motion compensation vector visualization"/></p>
<hr/>
<p>To try this out yourself, you will first need to have <a href="http://www.mplayerhq.hu/design7/news.html">mplayer</a> installed. If you are running Debian/Ubuntu, do this,</p>
<pre lang="bash">
sudo apt-get install mplayer
</pre>
<p><br/><br/></p>
<p>After this, download the video using the link provided above. Run this command,</p>
<pre lang="bash">
mplayer -lavdopts vismv=1 -vo x11 motion_vector_video.avi
</pre>
<p><br/><br/></p>
<p>To learn more about <strong>motion compensation</strong>, go <a href="http://en.wikipedia.org/wiki/Motion_compensation"><strong>here</strong>.</a><br />
<strong><big>Enjoy!</big></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.prashanthellina.com/2008/03/30/visualizing-mpeg4-motion-compensation-vectors-using-mplayer/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
<enclosure url="http://www.prashanthellina.com/images/motion_vector_video.avi" length="1780148" type="video/x-msvideo" />
		</item>
		<item>
		<title>Creating video thumbnails using ffmpeg</title>
		<link>http://blog.prashanthellina.com/2008/03/29/creating-video-thumbnails-using-ffmpeg/</link>
		<comments>http://blog.prashanthellina.com/2008/03/29/creating-video-thumbnails-using-ffmpeg/#comments</comments>
		<pubDate>Fri, 28 Mar 2008 19:10:13 +0000</pubDate>
		<dc:creator>prashanthellina</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[ffmpeg]]></category>
		<category><![CDATA[thumbnail]]></category>

		<guid isPermaLink="false">http://blog.prashanthellina.com/2008/03/29/creating-video-thumbnails-using-ffmpeg/</guid>
		<description><![CDATA[Generating thumbnails/screenshots of a video is useful in many ways. Youtube and many other video sites use this to show a preview of the video as a small thumbnail. Google video captures a series of thumbnails from a video at various time intervals to show a better video preview.
There is a simple way to generate [...]]]></description>
			<content:encoded><![CDATA[<p>Generating thumbnails/screenshots of a video is useful in many ways. Youtube and many other video sites use this to show a preview of the video as a small thumbnail. Google video captures a series of thumbnails from a video at various time intervals to show a better video preview.</p>
<p>There is a simple way to generate thumbnails in Linux using ffmpeg, a very very useful tool for processing videos. Let us generate a thumbnail for this <a href="http://www.prashanthellina.com/images/motion_vector_video.avi">video</a>. Download the video and rename it to test.avi.</p>
<p>Then, run this command,</p>
<pre lang="bash">
ffmpeg  -itsoffset -4  -i test.avi -vcodec mjpeg -vframes 1 -an -f rawvideo -s 320x240 test.jpg
</pre>
<p><br/><br/></p>
<p>This command generates a 320&#215;240 sized PNG thumbnail at the 4th second in the video. The output looks like this.<br />
<img src="http://www.prashanthellina.com/images/vid_thumb.jpg" alt="video thumbnail"/></p>
<p>If you do not have ffmpeg installed and are using Debian/Ubuntu, do,</p>
<pre lang="bash">
sudo apt-get install ffmpeg
</pre>
<p><br/><br/></p>
<p>A series of thumbnails, at 4, 8, 12 and 16 seconds.<br />
<img src="http://www.prashanthellina.com/images/vid_thumb.jpg" alt="video thumbnail"/><br />
<img src="http://www.prashanthellina.com/images/vid_thumb_8.jpg" alt="video thumbnail"/><br />
<img src="http://www.prashanthellina.com/images/vid_thumb_12.jpg" alt="video thumbnail"/><br />
<img src="http://www.prashanthellina.com/images/vid_thumb_16.jpg" alt="video thumbnail"/></p>
<pre lang="bash">
ffmpeg  -itsoffset -4  -i test.avi -vcodec mjpeg -vframes 1 -an -f rawvideo -s 320x240 test.jpg
ffmpeg  -itsoffset -8  -i test.avi -vcodec mjpeg -vframes 1 -an -f rawvideo -s 320x240 test.jpg
ffmpeg  -itsoffset -12  -i test.avi -vcodec mjpeg -vframes 1 -an -f rawvideo -s 320x240 test.jpg
ffmpeg  -itsoffset -16  -i test.avi -vcodec mjpeg -vframes 1 -an -f rawvideo -s 320x240 test.jpg
</pre>
<p><br/><br/></p>
<h3>useful links</h3>
<ul>
<li> <a href="http://blog.amnuts.com/2007/06/22/create-a-random-thumbnail-of-a-video-file/">Create a random thumbnail of a video file</a>
<li> <a href="http://www.danielfischer.com/2007/06/27/how-to-use-ffmpeg-to-convert-video-via-ruby-on-rails/">http://www.danielfischer.com/2007/06/27/how-to-use-ffmpeg-to-convert-video-via-ruby-on-rails/</a>
</ul>
<p>Happy thumbnailing!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.prashanthellina.com/2008/03/29/creating-video-thumbnails-using-ffmpeg/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
<enclosure url="http://www.prashanthellina.com/images/motion_vector_video.avi" length="1780148" type="video/x-msvideo" />
		</item>
		<item>
		<title>Watching Television on Linux: setting up a TV Tuner card</title>
		<link>http://blog.prashanthellina.com/2008/03/23/watching-television-on-linux-setting-up-a-tv-tuner-card/</link>
		<comments>http://blog.prashanthellina.com/2008/03/23/watching-television-on-linux-setting-up-a-tv-tuner-card/#comments</comments>
		<pubDate>Sun, 23 Mar 2008 13:19:57 +0000</pubDate>
		<dc:creator>prashanthellina</dc:creator>
				<category><![CDATA[gutsy gibbon]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[home theatre pc]]></category>
		<category><![CDATA[HTPC]]></category>
		<category><![CDATA[mencoder]]></category>
		<category><![CDATA[pinnacle pctv 50i]]></category>
		<category><![CDATA[television]]></category>
		<category><![CDATA[tv tuner card]]></category>
		<category><![CDATA[tvtime]]></category>

		<guid isPermaLink="false">http://blog.prashanthellina.com/2008/03/23/watching-television-on-linux-setting-up-a-tv-tuner-card/</guid>
		<description><![CDATA[A couple of weeks back, I went shopping looking for a TV tuner card that is compatible with Linux. Googling had told me that &#8220;Hauppauge&#8221; card was known to be compatible. However, I could not find it anywhere in the market (SP Road, Bangalore, India). On going to one of the shops, I found a [...]]]></description>
			<content:encoded><![CDATA[<p>A couple of weeks back, I went shopping looking for a TV tuner card that is compatible with Linux. Googling had told me that &#8220;Hauppauge&#8221; card was known to be compatible. However, I could not find it anywhere in the market (SP Road, Bangalore, India). On going to one of the shops, I found a &#8220;<strong><a href="http://www.pinnaclesys.com/PublicSite/uk/Products/Consumer+Products/PCTV+Tuners/PCTV+Analog+PVR+(cable_antenna)/PCTV+50i.htm">Pinnacle PCTV 50i</a></strong>&#8221; card. I had heard from many people before that Pinnacle was a good card for Windows both in terms of quality of decoding and software provided. I checked in google to ensure that Pinnacle card would work on Linux. I found that the card uses Philips&#8217; SAA7134 chipset for which drivers are available in Linux. I went on and bought the card for Rs 2000 ($50).</p>
<p><center><img src="http://www.pinnaclesys.com/images/screenshots/40_50i_large.jpg" alt="Pinnacle PCTV 50i" height="25%" width="25%"/></center></p>
<p>The card is available through Amazon.com.<br />
<a href="http://www.amazon.com/gp/product/B000FKP2TY?ie=UTF8&#038;tag=prashellin-20&#038;linkCode=as2&#038;camp=1789&#038;creative=9325&#038;creativeASIN=B000FKP2TY">Pinnacle PCTV Analog PCI 50i &#8211; TV / radio tuner / video input adapter &#8211; PCI &#8211; SECAM, PAL</a><img src="http://www.assoc-amazon.com/e/ir?t=prashellin-20&#038;l=as2&#038;o=1&#038;a=B000FKP2TY" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></p>
<h3>Setting up the card in Linux</h3>
<p>I have Ubuntu Gutsy installed (7.10) and followed this <a href="http://www.cyberciti.biz/tips/debian-ubuntu-linux-configure-pinnacle-pctv-tuner.html">guide</a> to setup the card and the instructions worked like a charm. A gist of the procedure.</p>
<p>Ubuntu Gutsy recognizes the card automatically, the following commands help to check if the recognition happened or not. Both commands should give atleast one line of output each.</p>
<pre lang="bash">
sudo update-pciids
lspci | grep -i saa713
dmesg | grep saa713
</pre>
<p><br/><br/></p>
<h3>Watching TV &#8211; tvtime</h3>
<p><a href="http://www.google.co.in/url?sa=t&#038;ct=res&#038;cd=1&#038;url=http%3A%2F%2Ftvtime.sourceforge.net%2F&#038;ei=klfmR6P-B4KS6gOAlPG7CA&#038;usg=AFQjCNGRL5Fj7JAjfXMzgie-hp7wt7zDrA&#038;sig2=RCYG_ORJgTwlDYRmxgXc2A"><strong>tvtime</strong></a> is a simple to use application for watching TV on Linux. Here is how you configure it.</p>
<blockquote>
<pre lang="bash">
sudo apt-get install tvtime
tvtime &#038;
</pre>
<p><br/></p>
<p>Right click to open a setup menu. You can also hit [F1] or [tab] key to show configuration menu:<br />
Linux Tvtime configuration hit [F1] or [tab] key to show configuration menu<br />
(Fig. 01: Linux tvtime application configuration menu)<br />
First, you need to setup video source, frequencies and channels etc.</p>
<h5>Setup video source</h5>
<p>Visit Input Configuration > Change Video Source > Setup source as per your setup.</p>
<h5>Setup frequencies table</h5>
<p>You need to setup the channels you are receiving with the tuner. Here we use europe frequencies table. Visit Channel management > Change Frequency table > Select new table<br />
Scan Channel</p>
<p>Finally, you need to scan for channels by visiting Channel management > Change Frequency table > Scan channels for signal > Back > Exit</p>
<h5>Sound configuration</h5>
<p>You need to attach internal cables to get sound out of TV tuner card. Use driver saa7134-oss or saa7134-alsa to get sound out of card. This driver get loaded automatically. Open terminal and type the following command to hear the audio through ALSA using tvtime (or other programs that don’t support it directly):</p>
<pre lang="bash">
$ sox -c 2 -s -w -r 32000 -t ossdsp /dev/dsp1 -t ossdsp -w -r 32000 /dev/dsp
</pre>
</blockquote>
<h3>Recording TV using mencoder</h3>
<p>if you do not already have mencoder, you can install it (on Debian/Ubuntu) by doing</p>
<pre lang="bash"
sudo apt-get install mencoder mplayer
</pre>
<p>Note that the above command will also install mplayer which is useful for viewing video files and tv channels. If you are the command line kind of person, you can do away with tvtime and use mplayer!</p>
<p>To record a TV channel, you will first need to figure out the frequency of the channel. For this I found scantv useful. This command will scan channels in the specified range and print out the found channels. After figuring out the frequency of the channel to record, use this mencoder command to record the video in a compressed format.</p>
<pre lang="bash">
mencoder tv:// -tv driver=v4l2:input=0:norm=pal:width=640:height=480:device=/dev/video0:\
freq=775.25:adevice=/dev/dsp1:forceaudio:audiorate=32000 buffersize=64\
 -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=400:keyint=30 -oac mp3lame\
-lameopts br=32:cbr:mode=3 -ffourcc divx -o "test.avi"
</pre>
<p><br/></p>
<p>To use <strong>mplayer to view TV</strong> directly (without using tvtime),do this.</p>
<pre lang="bash">
mplayer tv:// -tv driver=v4l2:input=0:norm=pal:width=640:height=480:device=/dev/video0:\
freq=775.25:adevice=/dev/dsp1:forceaudio:audiorate=32000
</pre>
<p><br/></p>
<p>I've been using this card without a glitch and recommend for HTPC attempts on Linux.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.prashanthellina.com/2008/03/23/watching-television-on-linux-setting-up-a-tv-tuner-card/feed/</wfw:commentRss>
		<slash:comments>31</slash:comments>
		</item>
		<item>
		<title>KDE4 on Kubuntu &#8211; Impressions and Screenshots</title>
		<link>http://blog.prashanthellina.com/2008/01/13/kde4-on-kubuntu-impressions-and-screenshots/</link>
		<comments>http://blog.prashanthellina.com/2008/01/13/kde4-on-kubuntu-impressions-and-screenshots/#comments</comments>
		<pubDate>Sun, 13 Jan 2008 00:01:22 +0000</pubDate>
		<dc:creator>prashanthellina</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[gnome]]></category>
		<category><![CDATA[kde]]></category>
		<category><![CDATA[window manager]]></category>

		<guid isPermaLink="false">http://blog.prashanthellina.com/2008/01/13/kde4-on-kubuntu-impressions-and-screenshots/</guid>
		<description><![CDATA[I love Gnome and its simplicity and use it regularly. I loathe KDE and its complexity. Although I used KDE about 5 years back, ever since Ubuntu was released, I&#8217;ve been using Gnome. However, when KDE4 was announced, I decided to check it out with an open-mind and re-evaluate.



Click to see gallery



Visually looks a little [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.prashanthellina.com/images/kde4_logo.png" alt="kde4 logo" align="left"/>I love Gnome and its simplicity and use it regularly. I loathe KDE and its complexity. Although I used KDE about 5 years back, ever since Ubuntu was released, I&#8217;ve been using Gnome. However, when KDE4 was announced, I decided to check it out with an open-mind and re-evaluate.</p>
<p><center><br />
<a href="http://www.prashanthellina.com/images/kde4_screenshots/"><br />
<img src="http://www.prashanthellina.com/images/kde4_screenshot_thumbs.gif" alt="KDE4 screenshots thumbs"/><br />
<small>Click to see gallery</small><br />
</a><br />
</center></p>
<ul>
<li>Visually looks a little better than KDE3
<li>KDE4 is still quite rough.
<li>The UI needs more polish.
<li>Usability has increased and still needs work.
<li>Complexity has reduced but more work required.
<li>The widgets in Oxygen theme are more bearable.
</ul>
<p>Loading &#8230;<br />
<img src="http://www.prashanthellina.com/images/kde4_loading.png" alt="kde4 loading"/></p>
<p>One corner of the screen is reserved for adding widgets, really required?<br />
<img src="http://www.prashanthellina.com/images/kde4_add_widgets.png" alt="KDE4 add widgets"/></p>
<p>I like the menu because I can search but consider the menu less functional than the one before. I do not use the search much because I use the &#8220;Run&#8221; command (Alt + F2) instead. I tend to loose orientation while navigating applications in the new menu,<br />
<img src="http://www.prashanthellina.com/images/kde4_menu.gif" alt="KDE4 menu"/></p>
<p>Black is good. The time display looks great. The gradient requires work as it does throughout the theme. The white border on the upper half of windows is annoying.<br />
<img src="http://www.prashanthellina.com/images/kde4_taskbar.png" alt="KDE4 taskbar"/></p>
<p>Overall, this feels unfinished but is a step in the right direction. It won&#8217;t be replacing Gnome for me yet. Will have to wait for 4.1 too see if it can.</p>
<h3>Links</h3>
<ul>
<li><a href="http://arstechnica.com/news.ars/post/20071213-afirst-look-at-kde-4-0-release-candidate-2.html">review at Ars Technica</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.prashanthellina.com/2008/01/13/kde4-on-kubuntu-impressions-and-screenshots/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Building a low-cost bad-ass &#8220;server&#8221; machine</title>
		<link>http://blog.prashanthellina.com/2007/11/27/building-a-low-cost-bad-ass-server-machine/</link>
		<comments>http://blog.prashanthellina.com/2007/11/27/building-a-low-cost-bad-ass-server-machine/#comments</comments>
		<pubDate>Tue, 27 Nov 2007 17:16:16 +0000</pubDate>
		<dc:creator>prashanthellina</dc:creator>
				<category><![CDATA[computer hardware]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[benchmark]]></category>
		<category><![CDATA[core duo]]></category>
		<category><![CDATA[motherboard]]></category>
		<category><![CDATA[ram]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://blog.prashanthellina.com/2007/11/27/building-a-low-cost-bad-ass-server-machine/</guid>
		<description><![CDATA[I have been playing around with Wikipedia data and tried doing some byte pushing on my Dreamhost web space. Since this is shared web space, the processing power and memory available are limited. I was able to create database tables in mysql by parsing the wiki xml dump and some extra processing as well to [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.prashanthellina.com/images/server.png" alt="server" align="right"/>I have been playing around with <a href="http://www.wikipedia.org">Wikipedia</a> data and tried doing some byte pushing on my <a href="/2007/10/13/dreamhost-my-wonderful-web-host/">Dreamhost</a> web space. Since this is shared web space, the processing power and memory available are limited. I was able to create database tables in mysql by <a href="/2007/10/17/ways-to-process-and-use-wikipedia-dumps/">parsing the wiki xml dump</a> and some extra processing as well to construct some custom derived tables but I had to constantly write code keeping in mind the resource constraints. Although it is fun doing this, it detracts from my actual goal (wikipedia data). I decided to build my own &#8220;server&#8221; for doing stuff like this, which would double as a &#8220;home theatre&#8221;.</p>
<h2>Requirements</h2>
<p><strong>Tons of memory</strong><br />
I will need a lot of memory to keep data in memory for doing various things. This is my primary need. Also, Linux loves extra memory as it tries to use every last bit to cache programs and data from disk &#8211; potentially a great way to boost performance.</p>
<p><strong>Reasonable processing capability</strong><br />
Top of the line processors cost a ton and I am not after the best in processors. I want a decent processor that has a good amount of L2 cache and is overclockable.</p>
<p><strong>Good value</strong><br />
I will be trying to keep the cost down and pick components that are at the sweet spot on the price-performance plot.</p>
<p><strong>High memory bandwidth and low latency</strong><br />
Since my requirement is to move GB&#8217;s of data into the processor and back to the hard disk, I need the memory bandwidth to me good between the processor &#8211; RAM &#8211; HDD.</p>
<p><strong>Good on-board graphics and audio support</strong><br />
A graphics chipset that is well supported by Linux so I can turn on the eye-candy in Ubuntu.</p>
<p><strong>Support for over-clocking</strong><br />
The processor, RAM and motherboard should be amenable to overclocking so I can crank up the heat!</p>
<p><strong>Less power consumption (because I plan to run this machine 24X7)</strong><br />
Since I will be running this machine all the time, I want minimal power to be consumed. Very few people realize that expense for electricity is a significant part of operational cost.</p>
<p><strong>Virtualization support</strong><br />
I plan to expose this machine on the internet. To make it more secure, I plan to host the webserver in a DMZ. I want to run a virtual machine (Ubuntu) as DMZ. Virtualization support can be handy here.</p>
<p><strong>Ports (Firewire, HDMI, USB, E-SATA)</strong><br />
USB2.0 ports are pretty standard now-a-days. I want to have a couple of SATA&#8217;s available for adding more HDD at a later date. HDMI will be useful if a buy a flat-panel TV some time.</p>
<h2>Processor</h2>
<p><img src="http://www.prashanthellina.com/images/intelcoreduo.jpg" alt="intel core 2 duo" align="left"/>When I bought a computer a couple of years back, the value choice was obviously AMD. But the equation has changed since then and after a little research I found Intel core 2 duo processors beat the crap out AMD&#8217;s. The only area where AMD processors did better was memory bandwidth because of HyperTransport.</p>
<p>Intel released a line of quad core processors <a href="http://www.intel.com/pressroom/archive/releases/20070108comp.htm">recently</a>. Most of these are priced very high except Intel Core 2 Quad 6600 available in Bangalore, India for a little over Rs 11,000 (approx $280). I was very tempted to go for this one but chose Intel Core 2 Duo E4500. Although this one has only 2MB L2 cache and does not have virtualization support, I picked it for its excellent value (Rs 4800 or approx $120) and low power consumption (65W peak). Also I plan to run processes in batch mode which can run over-night, so an additional few minutes taken because of lower muscle is not an issue for me.</p>
<p>The E4500 model is ideal for <a href="http://forums.slizone.com/index.php?showtopic=9584">overclocking</a>.</p>
<h2>RAM</h2>
<p>Since I am trying to build a low-cost machine, I decided not to consider ECC and buffered RAM (the motherboard would not have supported it anyway). I got 4 x 1GB Transcend 800Mhz sticks for  Rs 1350/- ($34) each so I could use the dual-channel slots on my motherboard to the max. These are quite <a href="http://www.newegg.com/Product/ProductReview.aspx?Item=N82E16820208283">overclockable</a>.<br />
<center><img src="http://www.prashanthellina.com/images/transcend_jetram_1gb.jpg" alt="ram dimm"/></center></p>
<h2>Motherboard</h2>
<p>The criteria for motherboard was that it should support the processor&#8217;s FSB (and more for later) and memory bus speed. In addition to these, it would have to support atleast 4GB ram, have 4 SATA ports, firewire, Gigabit Ethernet, HDMI, atleast 5.1 onboard sound, decent onboard graphics. I picked GA-G33-S2H from Gigabyte based on Intel G33 chipset (Rs 4550/- or $116) (<a href="http://www.giga-byte.com.tw/Products/Motherboard/Products_Spec.aspx?ProductID=2600">specs</a>). The BIOS has support for overclocking (voltage and multipliers can be tweaked).<br />
<center><img src="http://www.prashanthellina.com/images/motherboard_ga_g33m_s2h.jpg" alt="motherboard" align="center" width="50%"/></center></p>
<h2>Other components</h2>
<p>Seagate Barracuda 320GB 7200 rpm, Samsung DVD/CD read-writer, Microsoft mouse, i-Ball keyboard, Viewsonic Touchscreen monitor.</p>
<h2>Results</h2>
<p>I put the machine under load by making it crunch some Wikipedia data and although I have not measured the timings, I know from previous observation that it is blistering fast. I have Compiz turned on in Ubuntu and the UI is highly responsive. When processing big files, I have noticed that the files are pre-cached and this does speed up things quite a bit. I am convinced that adding more RAM is a good option instead of going for the best processor in the market to improve responsiveness and perceived UI speed. 2GB of RAM should be enough for desktop usage.</p>
<p>The processor, motherboard, ram and cabinet cost me Rs 19,300 ($494).</p>
<p><strong>Calculating PI using bc</strong><br />
<em>My Machine</em><br />
time echo &#8220;scale=5000; 4*a(1)&#8221; | bc -l -q<br />
real    0m49.327s<br />
user    0m49.215s<br />
sys     0m0.012s</p>
<p><em>Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz</em><br />
real 0m27.210s<br />
user 0m27.115s<br />
sys 0m0.042s</p>
<p><a href="http://tombuntu.com/index.php/2007/11/15/benchmark-your-linux-system-with-hardinfo/">Hardinfo</a> is handy benchmarking tool for Linux.</p>
<p><em>My Machine</em><br />
Zlib 20079.481,<br />
Fibonacci 5.728,<br />
MD5 41.227,<br />
SHA1 61.985,<br />
Blowfish 20.411,<br />
Raytracing 13.476</p>
<p><em>AMD Athlon(tm) 64 Processor 3800+</em><br />
Zlib 20404.837,<br />
Fibonacci 3.490,<br />
MD5 47.381,<br />
SHA1 68.948,<br />
Blowfish 17.056,<br />
Raytracing 12.385…<br />
<em><br />
Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz</em><br />
ZLib 29264.719<br />
Fibonacci 3.254<br />
MD5 75.775<br />
SHA1 114.178<br />
Blowfish 11.052<br />
Raytracing 7.213</p>
<p>The hardinfo test results are CPU oriented. I did not build this machine to excel at these. This machine is meant for munching on GB&#8217;s of data. So memory bandwidth between CPU &#8211; RAM &#8211; HDD is a more important factor. I have not found a good benchmark to calculate this aspect. Do mail me if you know such a benchmark.</p>
<p>Overall, I am extremely happy with this configuration and definitely recommend it if you have similar requirements.</p>
<p><img src="http://www.prashanthellina.com/images/roadrunner.gif" alt="road runner"/></p>
<p><strong>Additional links</strong><br />
<a href="http://pcrigzone.com/pages/proc_mb_mem.php">how to choose hardware components</a><br />
<a href="http://www23.tomshardware.com/cpu_2007.html">CPU comparison charts at Tom&#8217;s Hardware</a><br />
<a href="http://www.computerwarehousepricelist.com/">Computer Warehouse, Bangalore &#8211; Price List</a><br />
Note: I looked up the prices in computer warehouse web site and bought the components in S.P road, Bangalore in Ankit Infotech.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.prashanthellina.com/2007/11/27/building-a-low-cost-bad-ass-server-machine/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Making Ubuntu 7.10 (Gutsy) look slicker</title>
		<link>http://blog.prashanthellina.com/2007/10/21/making-ubuntu-710-gutsy-look-slicker/</link>
		<comments>http://blog.prashanthellina.com/2007/10/21/making-ubuntu-710-gutsy-look-slicker/#comments</comments>
		<pubDate>Sat, 20 Oct 2007 19:04:27 +0000</pubDate>
		<dc:creator>prashanthellina</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[awn]]></category>
		<category><![CDATA[compiz]]></category>
		<category><![CDATA[gnome]]></category>
		<category><![CDATA[gutsy gibbon]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://blog.prashanthellina.com/2007/10/21/making-ubuntu-710-gutsy-look-slicker/</guid>
		<description><![CDATA[It has been three weeks since I  upgraded to Gutsy from the development repositories. Gutsy got released just a little more than a day back. While going through the news from the blogosphere about this event, I wished Ubuntu had released a &#8220;non-brown&#8221; desktop. I don&#8217;t like brown and have seen quite a few [...]]]></description>
			<content:encoded><![CDATA[<p>It has been three weeks since I  upgraded to Gutsy from the development repositories. Gutsy got released just a little more than a day back. While going through the news from the blogosphere about this event, I wished Ubuntu had released a &#8220;non-brown&#8221; desktop. I don&#8217;t like brown and have seen quite a few others complaining. Brown is unique but to me it smells of being different for the sake of being different.</p>
<p>The good thing about being on Linux as most of us know is the possibilities it offers for customization. A few years back customization would have required a few hours of focussed hacking but I am surprised at how easily I was able to purge the brown look and create a slick black setup. OS X and Vista please step aside, the position of &#8220;OS with Best Customizable Eye Candy&#8221; is taken.</p>
<p>Let us start with some screenshots. The instructions below will help you duplicate the same if you want.</p>
<p><a href="http://www.prashanthellina.com/images/coverflow.png"><br />
    <img src="http://www.prashanthellina.com/images/coverflow_thumb.png"/><br />
</a><br />
<small>The shift switcher compiz plugin replicates &#8220;CoverFlow&#8221;. I love this one.</small></p>
<p><a href="http://www.prashanthellina.com/images/black_terminal.png"><br />
    <img src="http://www.prashanthellina.com/images/black_terminal_thumb.png"/><br />
</a><br />
<small>black!</small></p>
<p><a href="http://www.prashanthellina.com/images/screenlets.png"><br />
    <img src="http://www.prashanthellina.com/images/screenlets_thumb.png"/><br />
</a><br />
<small>Dashboard baby!</small></p>
<h2>Theme</h2>
<p>The black theme is the same used by <a href="http://ubuntustudio.org/">Ubuntu studio</a>. Apart from looking great, it might just save a few more watts! <img src='http://blog.prashanthellina.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  I used Compiz&#8217;s &#8220;Negative&#8221; effect to make the terminal&#8217;s title bar blend in with the body of the window (Super + N) is the shortcut when focus is in the terminal window). To learn more about other Compiz effects go <strong><a href="http://blog.prashanthellina.com/2007/10/06/ubuntu-gutsy-gibbon-and-linux-on-the-desktop/">here</a></strong>.</p>
<p><img src="http://www.prashanthellina.com/images/black_terminal_cutout.png"/></p>
<p>The following instructions will get the Ubuntu Studio theme installed.</p>
<pre lang="BASH">
sudo apt-get install ubuntustudio-theme ubuntustudio-icon-theme ubuntustudio-wallpapers ubuntustudio-gdm-theme
</pre>
<p><small><a href="http://www.belutz.net/2007/05/11/installing-ubuntu-studio-theme/">originally from here</a></small></p>
<h2>Dock</h2>
<p><img src="http://www.prashanthellina.com/images/awn_dock.png"/></p>
<p>To get the dock at the bottom of the screen you have to install <strong><a href="https://launchpad.net/awn">awn</a></strong>.</p>
<pre lang="BASH">
sudo su -c 'echo deb http://download.tuxfamily.org/syzygy42 gutsy avant-window-navigator >> /etc/apt/sources.list'
sudo su -c 'echo deb-src http://download.tuxfamily.org/syzygy42 gutsy avant-window-navigator >> /etc/apt/sources.list'
wget http://download.tuxfamily.org/syzygy42/reacocard.asc
sudo apt-key add reacocard.asc
rm reacocard.asc
sudo apt-get update
sudo apt-get install avant-window-navigator-bzr awn-core-applets-bzr
</pre>
<p><small><a href="http://ubuntuforums.org/showthread.php?t=385981">originally from here</a></small></p>
<p>A slightly different looking (curved) dock can be installed using instructions <strong><a href="http://ubuntuforums.org/showthread.php?t=572019">here</a></strong>.</p>
<h2>Widgets</h2>
<p><img src="http://www.prashanthellina.com/images/screenlets_clock.png"/></p>
<p>The final touch is to add widgets to Compiz&#8217;s widget layer which will look a lot like OS X&#8217;s Dashboard.</p>
<pre lang="BASH">
sudo su -c 'echo deb http://hendrik.kaju.pri.ee/ubuntu feisty screenlets >> /etc/apt/sources.list'
wget http://hendrik.kaju.pri.ee/ubuntu/hendrikkaju.gpg -O- | sudo apt-key add -
sudo apt-get update
sudo apt-get install screenlets
mkdir ~/.config/Screenlets
mkdir ~/.config/autostart
</pre>
<p>To configure which widgets come on the screen, do</p>
<pre lang="BASH">
screenlets-manager
</pre>
<p>and select the widgets. Right click on the widget to adjust properties. </p>
<blockquote><p>
In the CCSM, enable the “Widget Layer” plugin and edit its options. Under the behavior tab, add screenletsd to the “Widget Windows” box. Your Screenlets should then disappear but toggle on and off with the F9 key.
</p></blockquote>
<p>To run CCSM (Compiz settings manager), do</p>
<pre lang="BASH">ccsm</pre>
<p><small><a href="http://tombuntu.com/index.php/2007/08/24/osx-like-widgets-with-ubuntu-screenlets-and-compiz-fusion/">originally from here</a></small></p>
<p>After adding all the eye-candy (Compiz + awn), the overall responsiveness is still good on my Dell 700m (512MB, 1.6Ghz). This means I get to keep all of this running all the time and not just for demoing!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.prashanthellina.com/2007/10/21/making-ubuntu-710-gutsy-look-slicker/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
		<item>
		<title>Ubuntu Gutsy Gibbon and Linux on the Desktop</title>
		<link>http://blog.prashanthellina.com/2007/10/06/ubuntu-gutsy-gibbon-and-linux-on-the-desktop/</link>
		<comments>http://blog.prashanthellina.com/2007/10/06/ubuntu-gutsy-gibbon-and-linux-on-the-desktop/#comments</comments>
		<pubDate>Sat, 06 Oct 2007 16:42:17 +0000</pubDate>
		<dc:creator>prashanthellina</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[gutsy gibbon]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://blog.prashanthellina.com/2007/10/06/ubuntu-gutsy-gibbon-and-linux-on-the-desktop/</guid>
		<description><![CDATA[I&#8217;ve been using Ubuntu Feisty and waiting to get Gutsy when the release comes out. However my curiosity got the better of me and I could not resist upgrading from the beta repositories. The first thing I noticed after upgrade was the amount of polish and attention to detail. Everything looks slick (thanks to Compiz).
Instructions [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using Ubuntu Feisty and waiting to get Gutsy when the release comes out. However my curiosity got the better of me and I could not resist upgrading from the beta repositories. The first thing I noticed after upgrade was the amount of polish and attention to detail. Everything looks slick (thanks to Compiz).</p>
<p><strong><a href="http://www.howtogeek.com/howto/linux/upgrade-ubuntu-from-feisty-to-gutsy/">Instructions</a></strong> to upgrade from feisty.</p>
<p><script type="text/javascript" src="http://www.ubuntu.com/files/countdown/dist/display.js"></script><br />
<noscript><img id="countdownimage" src="http://www.ubuntu.com/files/countdown/dist/710countdown_default.png" width="199" height="164" alt="Ubuntu 7.10 - Coming soon"></noscript></p>
<h2>Compiz Fusion</h2>
<p>After trying one of the earlier versions of Compiz and then Beryl, I came away quite unimpressed. It looked like eye-candy for the sake of eye-candy. &#8220;Wobbly Windows&#8221; was touted as an exciting feature. I did not want to burn CPU cycles for something as worthless as that!</p>
<p>Come Gutsy, come Compiz Fusion and its legion of plugins, the true potential of XGL has come out. The &#8220;Wall plugin&#8221; is better than &#8220;Desktop Cube&#8221; IMHO because it gives a better sense of spatial arrangement of the windows. This coupled with the &#8220;expo&#8221; plugin is plain brilliant.</p>
<p>Another effect I found useful was the ability to group windows. I am working on a website and have three windows open (HTML Editor (Screem), GVim for editing a cgi and firefox for preview). These windows belong to one logical group. So I grouped them using the &#8220;expo&#8221; plugin and marked them as &#8220;Tabbed windows&#8221; and voila &#8211; Super+Tab key now flips through the group back-to-back, very much like the &#8216;i&#8217; button on a MacOS X Dashboard widget to edit the widget details. This is a great way to reduce window clutter.</p>
<p>&#8220;Negative&#8221; plugin helps to invert colors of a window which makes reading syntax colored text files sometimes. &#8220;Annotate&#8221; plugin lets you write on the screen, perfect for product demonstration.</p>
<p>If you are a fan of iPhone&#8217;s / iTunes&#8217; &#8220;CoverFlow&#8221;, then the &#8220;Shift Switcher&#8221; plugin is your friend.</p>
<h3>Compiz Fusion screenshots</h3>
<p><a href="http://compiz.org/Home/Screenshots">http://compiz.org/Home/Screenshots</a><br />
<a href="http://dengpeng.name/blog/2007/06/24/screenshots-of-compiz-fusion/">http://dengpeng.name/blog/2007/06/24/screenshots-of-compiz-fusion/</a><br />
<a href="http://drebel.net/blog/index.php/2007/07/25/compiz-fusion-screenshots/">http://drebel.net/blog/index.php/2007/07/25/compiz-fusion-screenshots/</a><br />
<a href="http://vness.wordpress.com/2007/07/19/screenshots-of-linux-ubuntu-with-compiz-fusion/">http://vness.wordpress.com/2007/07/19/screenshots-of-linux-ubuntu-with-compiz-fusion/</a></p>
<h2>Where is the freaking printer?</h2>
<p>I have a bad bad memory. I tend to forget things [period]! I just cannot remember the ip of the damned network printer at work and usually have to hunt the Admin down for it. Having heard about improved printer support, I fired up the printer config and asked Ubuntu to find all the printers on the network and bang pops up a list of found printers. This is great and if you are like me, you will love it. I agree this is a small thing but attention to detail is always good.</p>
<h2>No more jumping through hoops to play videos</h2>
<p>Many a person I had recommended Ubuntu to, came back disappointed because videos would not play. What is the point of an operating system if the videos don&#8217;t play?, I get asked. Hmmm&#8230;. It was not Ubuntu&#8217;s fault that the video did not play. The codecs to play &#8220;MPEG4&#8243; videos have to be licensed and that is why Ubuntu cannot ship them. People have been using a nifty app called Automatix to get the codecs. In Gutsy even this is not necessary. Click on the video &#8211; Totem opens &#8211; finds codecs &#8211; asks you &#8211; you say yes &#8211; downloads &#8211; installs &#8211; play!</p>
<h2>Is linux ready for the desktop then?</h2>
<p>The answer to this depends on who you are. Linux (through Ubuntu) is great for me. I don&#8217;t have a Windows machine at home. But if you want to use Photoshop, play the latest games, Linux is not there yet. But &#8230;. It sure is getting there very fast. Dell&#8217;s offering of Ubuntu pre-installed computers is heaven-sent for Linux. Finally hardware vendors are paying attention. This means that the road to mainstream adoption is open and that hardware support will continue to improve fast.</p>
<p>The &#8220;Linux Driver Project&#8221; is a great idea. Basically companies interested in getting drivers written for their hardware put in a request and Linux developers contribute their time for writing them. One of the biggest problems Linux has been facing is hardware support. If this initiative works out Linux hardware support will at least rival Windows if not surpass it. The Linux driver project has the <a href="http://www.kroah.com/log/linux/linux_driver_project_kickoff.html">official backing of Novell</a> now. </p>
<p>Most of the computer users know Linux as a hard-to-use, geeky operating system. This image is changing thanks to recent advances in Desktop Linux. Recently <a href="http://www.nytimes.com/2007/10/04/technology/circuits/04basics.html">New York Times</a> featured <a href="http://lifehacker.com/software/linux/-307147.php">Dell/Ubuntu combination</a> on it&#8217;s front page helping to drive this image to more minds.</p>
<p>As the hardware prices fall, the cost of the operating system (say Windows) <a href="http://linux.slashdot.org/article.pl?sid=07/09/29/1922213&#038;from=rss">begins to stand out more</a> and people will start wondering why they have to pay so much. Linux is free and the equation changes. This coupled with the disappointment of Windows users over Vista will help drive more users towards Desktop Linux.</p>
<p>I am looking forward to the exciting times ahead.</p>
<h2>Try Ubuntu now</h2>
<p>If you are a Windows user and are frustrated about it&#8217;s limitations, give Ubuntu Linux a try. Ubuntu has a service called &#8220;<a href="https://shipit.ubuntu.com/">ShipIt</a>&#8221; through which you can request a free copy of Ubuntu Linux. Just pop the cd and reboot. Ubuntu will boot right from the CD without installation. If you like it, you can safely install it beside your existing Windows installation.</p>
<p>While you wait for the CD to arrive, you can check out this excellent collection of <a href="http://screencasts.ubuntu.com/">screencasts</a> about Ubuntu.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.prashanthellina.com/2007/10/06/ubuntu-gutsy-gibbon-and-linux-on-the-desktop/feed/</wfw:commentRss>
		<slash:comments>35</slash:comments>
		</item>
		<item>
		<title>Drawing on your Desktop</title>
		<link>http://blog.prashanthellina.com/2007/08/24/drawing-on-your-desktop/</link>
		<comments>http://blog.prashanthellina.com/2007/08/24/drawing-on-your-desktop/#comments</comments>
		<pubDate>Fri, 24 Aug 2007 02:55:49 +0000</pubDate>
		<dc:creator>prashanthellina</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[desktop]]></category>
		<category><![CDATA[gnome]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://blog.prashanthellina.com/2007/08/24/drawing-on-your-desktop/</guid>
		<description><![CDATA[This is related to the previous post and is meant in part to demonstrate how great Linux is for doing &#8220;weird&#8221; stuff  . This is what we are
trying to do.
 
The circles in the background have been drawn by the python script below. To get the script running you should have python and pygame [...]]]></description>
			<content:encoded><![CDATA[<p>This is related to the previous post and is meant in part to demonstrate how great Linux is for doing &#8220;weird&#8221; stuff <img src='http://blog.prashanthellina.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . This is what we are<br />
trying to do.</p>
<p><img src="http://www.prashanthellina.com/images/desktop_circles.png" alt="desktop circle graphics" /> </p>
<p>The circles in the background have been drawn by the python script below. To get the script running you should have <a href="http://www.python.org/download/">python</a> and <a href="http://www.pygame.org/download.shtml">pygame</a> installed. If you are on Ubuntu do this to install both otherwise you can get the binaries for your distribution/OS.</p>
<pre lang="BASH">sudo apt-get install python pygame</pre>
<p>The code:</p>
<pre lang="PYTHON">
import pygame
import sys
import random
import time

pygame.init()

window = pygame.display.set_mode((1280, 1024))
screen = pygame.display.get_surface()

while 1:
    for event in pygame.event.get():
        if event.type == pygame.QUIT: sys.exit(0)

    x = random.choice(range(640))
    y = random.choice(range(480))
    radius = random.choice(range(100))
    col_r = random.choice(range(255))
    col_g = random.choice(range(255))
    col_b = random.choice(range(255))

    time.sleep(.01)
    rect = pygame.draw.circle(screen, (col_r, col_g, col_b), (x,y), radius)
    pygame.display.update(rect)
</pre>
<p><a href="http://code.prashanthellina.com/code/desktop_circles.py">download code</a></p>
<p>Running the code:</p>
<p>This will set the environment variable &#8220;SDL_WINDOWID&#8221; so that the script will know what the root window is.</p>
<pre lang="BASH">
export SDL_WINDOWID=`xwininfo -root|grep "id:"|sed 's/^.*id: //'|sed 's/ (.*$//'`
</pre>
<p>We have to tell the window manager to stop drawing on the desktop. I use gnome where the &#8220;nautilus&#8221; process does the drawing. Let us ask it to stop drawing.</p>
<pre lang="PYTHON">
gconftool-2 --type bool --set /apps/nautilus/preferences/show_desktop false
</pre>
<p>Now run the script:</p>
<pre lang="BASH">
python desktop_circles.py
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.prashanthellina.com/2007/08/24/drawing-on-your-desktop/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Matrix Desktop</title>
		<link>http://blog.prashanthellina.com/2007/08/22/matrix-desktop/</link>
		<comments>http://blog.prashanthellina.com/2007/08/22/matrix-desktop/#comments</comments>
		<pubDate>Wed, 22 Aug 2007 16:32:26 +0000</pubDate>
		<dc:creator>prashanthellina</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[desktop]]></category>
		<category><![CDATA[gnome]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://blog.prashanthellina.com/2007/08/22/matrix-desktop/</guid>
		<description><![CDATA[What you see above is how my desktop looks now. You need to be using gnome to get this working.
Nautilus draws the desktop (including the icons) for you in gnome by default. We have to tell it to stop doing that, so we can do the matrix animation in its place. Nautilus can be configured [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.prashanthellina.com/images/matrix_desktop.gif" alt="Matrix Desktop Animation" /></p>
<p>What you see above is how my desktop looks now. You need to be using gnome to get this working.</p>
<p>Nautilus draws the desktop (including the icons) for you in gnome by default. We have to tell it to stop doing that, so we can do the matrix animation in its place. Nautilus can be configured using gconf.</p>
<pre lang="BASH">gconftool-2 --type bool --set /apps/nautilus/preferences/show_desktop false</pre>
<p>Now that we have the desktop to ourselves, let us ask xscreensaver &#8216;glmatrix&#8217; to start drawing itself in the desktop window (&#8217;root&#8217; window).</p>
<pre lang="BASH">/usr/lib/xscreensaver/glmatrix -root</pre>
<p>If you want the animation every time you log in, open &#8220;~/.config/autostart/glmatrix.desktop&#8221; in your text editor and paste the following.</p>
<pre lang="BASH">
[Desktop Entry]
Version=1.0
Encoding=UTF-8
Name=No name
Name[en_IN]=Desktop matrix
Exec=/usr/lib/xscreensaver/glmatrix -root
X-GNOME-Autostart-enabled=true
</pre>
<p>(<small>suggested by ElecBoy</small>) After playing around, if you want to get back to your default desktop, do </p>
<pre lang="BASH">gconftool-2 --type bool --set /apps/nautilus/preferences/show_desktop true &#038;&#038; nautilus</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.prashanthellina.com/2007/08/22/matrix-desktop/feed/</wfw:commentRss>
		<slash:comments>41</slash:comments>
		</item>
	</channel>
</rss>
