<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><!-- generator="wordpress/2.3.3" --><rss 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:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>42klines</title>
	<link>http://www.42klines.com</link>
	<description>decode(code);</description>
	<pubDate>Sat, 11 Sep 2010 12:48:19 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.3</generator>
	<language>en</language>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/42klines" /><feedburner:info uri="42klines" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>What to expect from the Ruby expect library?</title>
		<link>http://feedproxy.google.com/~r/42klines/~3/Sc7_tOD_oYg/what-to-expect-from-the-ruby-expect-library.html</link>
		<comments>http://www.42klines.com/2010/08/14/what-to-expect-from-the-ruby-expect-library.html#comments</comments>
		<pubDate>Sat, 14 Aug 2010 13:37:18 +0000</pubDate>
		<dc:creator>Sudhanshu</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Ruby]]></category>

		<category><![CDATA[Tools]]></category>

		<category><![CDATA[UNIX]]></category>

		<category><![CDATA[debugging]]></category>

		<category><![CDATA[expect]]></category>

		<category><![CDATA[gdb]]></category>

		<category><![CDATA[irb]]></category>

		<category><![CDATA[PTY]]></category>

		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://www.42klines.com/2010/08/14/what-to-expect-from-the-ruby-expect-library.html</guid>
		<description><![CDATA[A little background first - expect is a library to interact with programs using ruby. Conceptually it&#8217;s based on the original UNIX expect program which is commonly used to automate UNIX administration. Expect library provides an API which can be passed a regex to match the expected output from the program, and optionally an action [...]]]></description>
			<content:encoded><![CDATA[<p>A little background first - expect is a library to interact with programs using <a href="http://ruby-lang.org/" onclick="javascript:pageTracker._trackPageview ('/outbound/ruby-lang.org');">ruby</a>. Conceptually it&#8217;s based on the original UNIX expect program which is commonly used to <a href="http://james.bond.edu.au/courses/inft41634@032/papers/expect.pdf" onclick="javascript:pageTracker._trackPageview ('/outbound/james.bond.edu.au');">automate</a> UNIX administration. Expect library provides an API which can be passed a regex to match the expected output from the program, and optionally an action to take on a match. I have been experimenting with the expect library to automate a gdb session. Expect is an <a href="http://ruby-doc.org/stdlib/libdoc/pty/rdoc/index.html" onclick="javascript:pageTracker._trackPageview ('/outbound/ruby-doc.org');">undocumented</a> module and <a href="http://www.vim.org/scripts/script.php?script_id=494" onclick="javascript:pageTracker._trackPageview ('/outbound/www.vim.org');">:Ri</a> does not help. So just in case you are not able to get it to work for you, read on.</p>
<h3 class="post-section">Table of Contents</h3>
<ul>
<li><a href="#101.1">Spawning interactive programs</a></li>
<ul>
<li><a href="#101.1.1">Method 1 - Single interaction</a></li>
<li><a href="#101.1.2">Method 2 - Multiple interactions</a></li>
</ul>
<li><a href="#101.2">Expect library</a></li>
<li><a href="#101.3">Resources</a></li>
</ul>
<h3 class="post-section"><a name="101.1" title="101.1"></a>Spawning interactive programs</h3>
<p>Ruby has several ways to spawn programs. For a nice treatment of the subject check out Avdi&#8217;s <a href="http://devver.wordpress.com/2009/10/12/ruby-subprocesses-part_3/" onclick="javascript:pageTracker._trackPageview ('/outbound/devver.wordpress.com');">excellent blog posts</a> on the subject. We&#8217;ll use Ruby&#8217;s <span id="code">PTY</span> library to spawn the program, and interact with it using expect. Using <span id="code">PTY</span> library prevents <span id="code">IO</span> buffering, which can cause problems during interaction with a spawned process. Let&#8217;s see how to make gdb print out a help message, using two methods.</p>
<p><a name="101.1.1" title="101.1.1"></a><strong>Method 1 - Single interaction</strong><br />
This ruby script will take a string as an argument, and print out gdb help for it. We&#8217;ll spawn a gdb process, send it the gdb help command and read the results from its stdout. Listing 1 shows the script. You&#8217;d notice that <span id="code">PTY.spawn</span> is passed a <a href="http://innig.net/software/ruby/closures-in-ruby.rb" onclick="javascript:pageTracker._trackPageview ('/outbound/innig.net');">Ruby block</a>, which is executed immediately after the gdb process is spawned. When the block ends the gdb process gets terminated. <span id="code">PTY.spawn</span> passes in the input/output <span id="code">File</span> objects for the child gdb process, as well as its pid to the block. The <span id="code">till_prompt()</span> method, reads all output from gdb till the next gdb prompt is seen, and returns the data read as a string. Notice the use of <span id="code">IO.getc()</span> method. We don&#8217;t use <span id="code">IO.gets</span> because when gdb prints out its prompt, it waits for input from the use and therefore does not print a newline, after the prompt. If <span id="code">IO.gets</span> is used, it will stall waiting for a newline after the prompt is printed by gdb.</p>
<p>Sample output after executing this script is shown in Listing 2. This is a deliberately minimal program, designed to demonstrate concepts, and does not attempt to do any error handling.</p>
<div class="syntax-highlighted">
<span style="background-color: #444444"><font color="#a8a8a8">&nbsp;1 </font></span><font color="#ffd7af"><b>#!/usr/bin/env ruby</b></font><br />
<span style="background-color: #444444"><font color="#a8a8a8">&nbsp;2 </font></span>require&nbsp;<font color="#8a8a8a">&#8216;</font><font color="#d78787">pty</font><font color="#8a8a8a">&#8216;</font><br />
<span style="background-color: #444444"><font color="#a8a8a8">&nbsp;3&nbsp;</font></span><br />
<span style="background-color: #444444"><font color="#a8a8a8">&nbsp;4 </font></span><font color="#ffd7af"><b>def</b></font>&nbsp;<font color="#ffff87">till_prompt</font>(cout)<br />
<span style="background-color: #444444"><font color="#a8a8a8">&nbsp;5 </font></span>&nbsp;&nbsp;&nbsp;&nbsp;buffer = <font color="#8a8a8a">&quot;&quot;</font><br />
<span style="background-color: #444444"><font color="#a8a8a8">&nbsp;6 </font></span>&nbsp;&nbsp;&nbsp;&nbsp;<span style="background-color: #3a3a3a"><font color="#d7d7af">loop</font></span>&nbsp;{ buffer &lt;&lt; cout.getc.chr; <span style="background-color: #3a3a3a"><font color="#d7d7af">break</font></span>&nbsp;<font color="#ffd7af"><b>if</b></font>&nbsp;buffer =~ <font color="#8a8a8a">/</font><font color="#d78787">\(gdb\)</font><font color="#8a8a8a">/</font>&nbsp;}<br />
<span style="background-color: #444444"><font color="#a8a8a8">&nbsp;7 </font></span>&nbsp;&nbsp;&nbsp;&nbsp;<span style="background-color: #3a3a3a"><font color="#d7d7af">return</font></span>&nbsp;buffer<br />
<span style="background-color: #444444"><font color="#a8a8a8">&nbsp;8 </font></span><font color="#ffd7af"><b>end</b></font><br />
<span style="background-color: #444444"><font color="#a8a8a8">&nbsp;9&nbsp;</font></span><br />
<span style="background-color: #444444"><font color="#a8a8a8">10 </font></span><font color="#d7d7af"><b>PTY</b></font>.spawn(<font color="#8a8a8a">&quot;</font><font color="#d78787">gdb</font><font color="#8a8a8a">&quot;</font>) <span style="background-color: #3a3a3a"><font color="#d7d7af">do</font></span>&nbsp;|<font color="#ffd7af"><b>gdb_out</b></font>, <font color="#ffd7af"><b>gdb_in</b></font>, <font color="#ffd7af"><b>pid</b></font>|<br />
<span style="background-color: #444444"><font color="#a8a8a8">11 </font></span>&nbsp;&nbsp;&nbsp;&nbsp;printf till_prompt(gdb_out)<br />
<span style="background-color: #444444"><font color="#a8a8a8">12 </font></span>&nbsp;&nbsp;&nbsp;&nbsp;gdb_in.printf(<font color="#8a8a8a">&quot;</font><font color="#d78787">help </font><font color="#8a8a8a">#{</font><font color="#ffd7af"><b>ARGV</b></font>[<font color="#87d7d7">0</font>]<font color="#8a8a8a">}</font><font color="#d7afaf">\n</font><font color="#8a8a8a">&quot;</font>)<br />
<span style="background-color: #444444"><font color="#a8a8a8">13 </font></span>&nbsp;&nbsp;&nbsp;&nbsp;puts till_prompt(gdb_out)<br />
<span style="background-color: #444444"><font color="#a8a8a8">14 </font></span><span style="background-color: #3a3a3a"><font color="#d7d7af">end</font></span>
</div>
<p style="text-align: center"><strong>Listing 1 - gdb.rb</strong></p>
<div class="terminal">
[sudhanshu@sudhanshu-desktop]$ ./gdb.rb break<br />
 help break<br />
Set breakpoint at specified line or function.<br />
break [LOCATION] [thread THREADNUM] [if CONDITION]<br />
LOCATION may be a line number, function name, or &#8220;*&#8221; and an address.<br />
If a line number is specified, break at start of code for that line.<br />
If a function is specified, break at start of code for that function.<br />
If an address is specified, break at that exact address.<br />
With no LOCATION, uses current execution address of selected stack frame.<br />
This is useful for breaking on return to a stack frame.</p>
<p>THREADNUM is the number from &#8220;info threads&#8221;.<br />
CONDITION is a boolean expression.</p>
<p>Multiple breakpoints at one place are permitted, and useful if conditional.</p>
<p>Do &#8220;help breakpoints&#8221; for info on other commands dealing with breakpoints.<br />
(gdb)<br />
[sudhanshu@sudhanshu-desktop]$
</p></div>
<p style="text-align: center"><strong>Listing 2 - gdb.rb output</strong></p>
<p>Notice the one shot usage of this program. It exits immediately and that&#8217;s why sending <span id="code">PTY.spawn</span> a block for execution makes sense here. We&#8217;ll see why we&#8217;d not want to send a block of code to execute, in the next method of spawning interactive processes.</p>
<p><a name="101.1.2" title="101.1.2"></a><strong>Method 2 - Multiple interactions</strong><br />
This method is useful in those circumstances, where you&#8217;d like to save the input, output objects returned by <span id="code">PTY.spawn</span> for later and interact with the process multiple times using these objects. Let&#8217;s rewrite the gdb.rb program in Listing 1, to be used as a loadable library in irb, instead of a one-shot program. Listing 3 shows this program. You&#8217;d notice the new <span id="code">gdb()</span> method which is provided as an API to run arbitrary gdb commands.  Also notice that this time we store a reference to the input/output objects returned by <span id="code">PTY.spawn</span>. Listing 4 shows how this version can be used by the user more interactively.</p>
<div class="syntax-highlighted">
<span style="background-color: #444444"><font color="#a8a8a8">&nbsp;1 </font></span><font color="#ffd7af"><b>#!/usr/bin/env ruby</b></font><br />
<span style="background-color: #444444"><font color="#a8a8a8">&nbsp;2 </font></span>require&nbsp;<font color="#8a8a8a">&#8216;</font><font color="#d78787">pty</font><font color="#8a8a8a">&#8216;</font><br />
<span style="background-color: #444444"><font color="#a8a8a8">&nbsp;3&nbsp;</font></span><br />
<span style="background-color: #444444"><font color="#a8a8a8">&nbsp;4 </font></span><font color="#ffd7af"><b>def</b></font>&nbsp;<font color="#ffff87">till_prompt</font>(cout)<br />
<span style="background-color: #444444"><font color="#a8a8a8">&nbsp;5 </font></span>&nbsp;&nbsp;&nbsp;&nbsp;buffer = <font color="#8a8a8a">&quot;&quot;</font><br />
<span style="background-color: #444444"><font color="#a8a8a8">&nbsp;6 </font></span>&nbsp;&nbsp;&nbsp;&nbsp;<span style="background-color: #3a3a3a"><font color="#d7d7af">loop</font></span>&nbsp;{ buffer &lt;&lt; cout.getc.chr; <span style="background-color: #3a3a3a"><font color="#d7d7af">break</font></span>&nbsp;<font color="#ffd7af"><b>if</b></font>&nbsp;buffer =~ <font color="#8a8a8a">/</font><font color="#d78787">\(gdb\)</font><font color="#8a8a8a">/</font>&nbsp;}<br />
<span style="background-color: #444444"><font color="#a8a8a8">&nbsp;7 </font></span>&nbsp;&nbsp;&nbsp;&nbsp;<span style="background-color: #3a3a3a"><font color="#d7d7af">return</font></span>&nbsp;buffer<br />
<span style="background-color: #444444"><font color="#a8a8a8">&nbsp;8 </font></span><font color="#ffd7af"><b>end</b></font><br />
<span style="background-color: #444444"><font color="#a8a8a8">&nbsp;9&nbsp;</font></span><br />
<span style="background-color: #444444"><font color="#a8a8a8">10 </font></span><font color="#ffd7af"><b>def</b></font>&nbsp;<font color="#ffff87">gdb</font>(string)<br />
<span style="background-color: #444444"><font color="#a8a8a8">11 </font></span>&nbsp;&nbsp;&nbsp;&nbsp;<font color="#ffd7af"><b>@gdb_in</b></font>.printf(<font color="#8a8a8a">&quot;</font><font color="#8a8a8a">#{</font>string<font color="#8a8a8a">}</font><font color="#d7afaf">\n</font><font color="#8a8a8a">&quot;</font>)<br />
<span style="background-color: #444444"><font color="#a8a8a8">12 </font></span>&nbsp;&nbsp;&nbsp;&nbsp;puts till_prompt(<font color="#ffd7af"><b>@gdb_out</b></font>)<br />
<span style="background-color: #444444"><font color="#a8a8a8">13 </font></span><font color="#ffd7af"><b>end</b></font><br />
<span style="background-color: #444444"><font color="#a8a8a8">14&nbsp;</font></span><br />
<span style="background-color: #444444"><font color="#a8a8a8">15 </font></span><font color="#ffd7af"><b>@gdb_out</b></font>, <font color="#ffd7af"><b>@gdb_in</b></font>, <font color="#ffd7af"><b>@pid</b></font>&nbsp;= <font color="#d7d7af"><b>PTY</b></font>.spawn(<font color="#8a8a8a">&quot;</font><font color="#d78787">gdb</font><font color="#8a8a8a">&quot;</font>)<br />
<span style="background-color: #444444"><font color="#a8a8a8">16 </font></span>printf till_prompt(<font color="#ffd7af"><b>@gdb_out</b></font>)
</div>
<p style="text-align: center"><strong>Listing 3 - gdb_irb.rb</strong></p>
<div class="terminal">
[sudhanshu@sudhanshu-desktop]$ irb<br />
&gt;&gt; require &#8216;gdb_irb.rb&#8217;<br />
GNU gdb (GDB) 7.1-ubuntu<br />
Copyright (C) 2010 Free Software Foundation, Inc.<br />
License GPLv3+: GNU GPL version 3 or later &lt;http://gnu.org/licenses/gpl.html&gt;<br />
This is free software: you are free to change and redistribute it.<br />
There is NO WARRANTY, to the extent permitted by law.&nbsp;&nbsp;Type &quot;show copying&quot;<br />
and &quot;show warranty&quot; for details.<br />
This GDB was configured as &quot;i486-linux-gnu&quot;.<br />
For bug reporting instructions, please see:<br />
&lt;http://www.gnu.org/software/gdb/bugs/&gt;.<br />
(gdb)=&gt; true<br />
&gt;&gt; gdb &quot;help break&quot;<br />
&nbsp;help break<br />
Set breakpoint at specified line or function.<br />
break [LOCATION] [thread THREADNUM] [if CONDITION]<br />
LOCATION may be a line number, function name, or &quot;*&quot; and an address.<br />
If a line number is specified, break at start of code for that line.<br />
If a function is specified, break at start of code for that function.<br />
If an address is specified, break at that exact address.<br />
With no LOCATION, uses current execution address of selected stack frame.<br />
This is useful for breaking on return to a stack frame.</p>
<p>THREADNUM is the number from &quot;info threads&quot;.<br />
CONDITION is a boolean expression.</p>
<p>Multiple breakpoints at one place are permitted, and useful if conditional.</p>
<p>Do &quot;help breakpoints&quot; for info on other commands dealing with breakpoints.<br />
(gdb)<br />
=&gt; nil<br />
&gt;&gt; gdb &quot;file /bin/date&quot;<br />
&nbsp;file /bin/date<br />
Reading symbols from /bin/date&#8230;(no debugging symbols found)&#8230;done.<br />
(gdb)<br />
=&gt; nil<br />
&gt;&gt; gdb &quot;r&quot;<br />
&nbsp;r<br />
Starting program: /bin/date <br />
[Thread debugging using libthread_db enabled]<br />
Tue Aug 10 05:37:22 IST 2010</p>
<p>Program exited normally.<br />
(gdb)<br />
=&gt; nil<br />
&gt;&gt; @gdb_in.inspect<br />
=&gt; &quot;#&lt;File:/dev/pts/4&gt;&quot;<br />
&gt;&gt;<br />
?&gt; @gdb_out.inspect<br />
=&gt; &quot;#&lt;File:/dev/pts/4&gt;&quot;<br />
&gt;&gt;
</div>
<p style="text-align: center"><strong>Listing 4 - Interactive GDB in irb</strong></p>
<p>Notice how irb &#8220;wraps&#8221; around gdb and created a much more powerful debugging environment on top of gdb. We could for instance read large amounts of data from the process being debugged into Ruby variables/classes and analyze it using the far more powerful facilities provided by the Ruby programming enviroment, as compared to gdb macros/scripts.</p>
<h3 class="post-section"><a name="101.2" title="101.2"></a>Expect library</h3>
<p>Now that we have seen how to spawn processes in Ruby, and interact with them with custom code, let&#8217;s see how to use the expect library to interact with them. The expect library adds an <span id="code">expect()</span> method to the <span id="code">IO</span> class, which is the basis of all input output in Ruby. The <span id="code">expect()</span> method is just a beefed up version of the <span id="code">till_prompt()</span> method that we saw above.</p>
<p>While the <span id="code">till_prompt()</span> method used a fixed pattern to match the next gdb prompt, the <span id="code">expect()</span> method takes a ruby <span id="code">String</span> or a regular expression object of type <span id="code">Regexp</span> as a pattern to match against program output.</p>
<p>The <span id="code">till_prompt()</span> method simply returned the whole buffer after matching the fixed pattern. However, the <span id="code">expect()</span> method can optionally take a Ruby block to execute as soon as the pattern matches. This block is passed in the array containing the result of the match. Alternatively, if a block is not given, it will return the result array containing the buffer against which the pattern was matched, followed by the flattened, <a href="http://ruby-doc.org/core/classes/MatchData.html" onclick="javascript:pageTracker._trackPageview ('/outbound/ruby-doc.org');">MatchData</a> object returned by <a href="http://ruby-doc.org/core/classes/Regexp.html#M001205" onclick="javascript:pageTracker._trackPageview ('/outbound/ruby-doc.org');">Regexp#match()</a>.</p>
<p>Apart from these the <span id="code">expect()</span> method can optionally take a timeout value in seconds as its second argument. If no match is found within the given time limit, it returns nil. Thus the API can be summarized in the following way:</p>
<div class=syntax-highlighted>
<span style="background-color: #444444"><font color="#a8a8a8">1 </font></span>result = <font color="#d7d7af"><b>IO</b></font>.expect(<font color="#8a8a8a">&quot;</font><font color="#d78787">pattern</font><font color="#8a8a8a">&quot;</font>&nbsp;| <font color="#8a8a8a">/</font><font color="#d78787">pattern</font><font color="#8a8a8a">/</font>&nbsp;[, timeout <span style="background-color: #3a3a3a"><font color="#d7d7af">in</font></span>&nbsp;secs]) [&nbsp;{ |<font color="#ffd7af"><b>array</b></font>|&nbsp;&#8230;. }&nbsp;]
</div>
<p>Note that if a block is passed into <span id="code">expect()</span>, the return value  is that returned by the block, which can be anything and not necessarily an array. Now let&#8217;s see the implementation of the above two programs using the <span id="code">expect()</span> method.</p>
<div class="syntax-highlighted">
<span style="background-color: #444444"><font color="#a8a8a8">1 </font></span><font color="#ffd7af"><b>#!/usr/bin/env ruby</b></font><br />
<span style="background-color: #444444"><font color="#a8a8a8">2 </font></span>require&nbsp;<font color="#8a8a8a">&#8216;</font><font color="#d78787">pty</font><font color="#8a8a8a">&#8216;</font><br />
<span style="background-color: #444444"><font color="#a8a8a8">3 </font></span>require&nbsp;<font color="#8a8a8a">&#8216;</font><font color="#d78787">expect</font><font color="#8a8a8a">&#8216;</font><br />
<span style="background-color: #444444"><font color="#a8a8a8">4&nbsp;</font></span><br />
<span style="background-color: #444444"><font color="#a8a8a8">5 </font></span><font color="#d7d7af"><b>PTY</b></font>.spawn(<font color="#8a8a8a">&quot;</font><font color="#d78787">gdb</font><font color="#8a8a8a">&quot;</font>) <span style="background-color: #3a3a3a"><font color="#d7d7af">do</font></span>&nbsp;|<font color="#ffd7af"><b>gdb_out</b></font>, <font color="#ffd7af"><b>gdb_in</b></font>, <font color="#ffd7af"><b>pid</b></font>|<br />
<span style="background-color: #444444"><font color="#a8a8a8">6 </font></span>&nbsp;&nbsp;&nbsp;&nbsp;gdb_out.expect(<font color="#8a8a8a">/</font><font color="#d78787">\(gdb\)</font><font color="#8a8a8a">/</font>) { |<font color="#ffd7af"><b>r</b></font>|&nbsp;gdb_in.printf(<font color="#8a8a8a">&quot;</font><font color="#d78787">help </font><font color="#8a8a8a">#{</font><font color="#ffd7af"><b>ARGV</b></font>[<font color="#87d7d7">0</font>]<font color="#8a8a8a">}</font><font color="#d7afaf">\n</font><font color="#8a8a8a">&quot;</font>) }<br />
<span style="background-color: #444444"><font color="#a8a8a8">7 </font></span>&nbsp;&nbsp;&nbsp;&nbsp;puts gdb_out.expect(<font color="#8a8a8a">/</font><font color="#d78787">\(gdb\)</font><font color="#8a8a8a">/</font>)[<font color="#87d7d7">0</font>]<br />
<span style="background-color: #444444"><font color="#a8a8a8">8 </font></span><span style="background-color: #3a3a3a"><font color="#d7d7af">end</font></span>
</div>
<p style="text-align: center"><strong>Listing 5 - gdb_expect.rb</strong></p>
<div class="syntax-highlighted">
<span style="background-color: #444444"><font color="#a8a8a8">&nbsp;1 </font></span><font color="#ffd7af"><b>#!/usr/bin/env ruby</b></font><br />
<span style="background-color: #444444"><font color="#a8a8a8">&nbsp;2 </font></span>require&nbsp;<font color="#8a8a8a">&#8216;</font><font color="#d78787">pty</font><font color="#8a8a8a">&#8216;</font><br />
<span style="background-color: #444444"><font color="#a8a8a8">&nbsp;3 </font></span>require&nbsp;<font color="#8a8a8a">&#8216;</font><font color="#d78787">expect</font><font color="#8a8a8a">&#8216;</font><br />
<span style="background-color: #444444"><font color="#a8a8a8">&nbsp;4&nbsp;</font></span><br />
<span style="background-color: #444444"><font color="#a8a8a8">&nbsp;5 </font></span><font color="#ffd7af"><b>def</b></font>&nbsp;<font color="#ffff87">gdb</font>(string)<br />
<span style="background-color: #444444"><font color="#a8a8a8">&nbsp;6 </font></span>&nbsp;&nbsp;&nbsp;&nbsp;<font color="#ffd7af"><b>@gdb_in</b></font>.printf(<font color="#8a8a8a">&quot;</font><font color="#8a8a8a">#{</font>string<font color="#8a8a8a">}</font><font color="#d7afaf">\n</font><font color="#8a8a8a">&quot;</font>)<br />
<span style="background-color: #444444"><font color="#a8a8a8">&nbsp;7 </font></span>&nbsp;&nbsp;&nbsp;&nbsp;puts <font color="#ffd7af"><b>@gdb_out</b></font>.expect(<font color="#8a8a8a">/</font><font color="#d78787">\(gdb\)</font><font color="#8a8a8a">/</font>)[<font color="#87d7d7">0</font>]<br />
<span style="background-color: #444444"><font color="#a8a8a8">&nbsp;8 </font></span><font color="#ffd7af"><b>end</b></font><br />
<span style="background-color: #444444"><font color="#a8a8a8">&nbsp;9&nbsp;</font></span><br />
<span style="background-color: #444444"><font color="#a8a8a8">10 </font></span><font color="#ffd7af"><b>@gdb_out</b></font>, <font color="#ffd7af"><b>@gdb_in</b></font>, <font color="#ffd7af"><b>@pid</b></font>&nbsp;= <font color="#d7d7af"><b>PTY</b></font>.spawn(<font color="#8a8a8a">&quot;</font><font color="#d78787">gdb</font><font color="#8a8a8a">&quot;</font>)<br />
<span style="background-color: #444444"><font color="#a8a8a8">11 </font></span>puts <font color="#ffd7af"><b>@gdb_out</b></font>.expect(<font color="#8a8a8a">/</font><font color="#d78787">\(gdb\)</font><font color="#8a8a8a">/</font>)[<font color="#87d7d7">0</font>]
</div>
<p style="text-align: center"><strong>Listing 6 - gdb_irb_expect.rb</strong></p>
<p>Beginners with the Ruby expect library can get into trouble if they assume that the pattern being passed in to the <span id="code">expect()</span> method will be matched against each line output by the spawned program. This assumption is incorrect, because as we saw the pattern is actually matched against all the characters read into a buffer which includes newline characters. It&#8217;s also worth mentioning that the newlines seen by <span id="code">expect()</span> are &#8220;\r\n&#8221; and not &#8220;\n&#8221;.</p>
<p>As a debugging mechanism there&#8217;s a global variable called <span id="code">$expect_verbose</span>, provided by the expect library. Set this variable to <span id="code">true</span> in your program, and <span id="code">expect()</span> method will print every character read at each intermediate step on <span id="code">stdout</span>. This is an extremely useful tool for debugging expect programs.</p>
<h3 class="post-section"><a name="101.3" title="101.3"></a>Resources</h3>
<ul>
<li>Source Code: <a href="http://www.42klines.com/resources/101/gdbrb.tgz">tgz</a>, <a href="http://www.42klines.com/resources/101/gdbrb.zip">zip</a></li>
<li>Ruby 1.9.2 <a href="http://redmine.ruby-lang.org/issues/show/1473" onclick="javascript:pageTracker._trackPageview ('/outbound/redmine.ruby-lang.org');">improves expect</a></li>
<li>An <a href="http://marc.info/?l=ruby-talk&#038;m=104759066322769&#038;w=2" onclick="javascript:pageTracker._trackPageview ('/outbound/marc.info');">alternative implementation</a> of expect</li>
<li><a href="http://net-ssh.rubyforge.org/" onclick="javascript:pageTracker._trackPageview ('/outbound/net-ssh.rubyforge.org');">Ruby and SSH</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.42klines.com/2010/08/14/what-to-expect-from-the-ruby-expect-library.html/feed</wfw:commentRss>
		<feedburner:origLink>http://www.42klines.com/2010/08/14/what-to-expect-from-the-ruby-expect-library.html</feedburner:origLink></item>
		<item>
		<title>Ubuntu Intrepid 8.10 Quickstart</title>
		<link>http://feedproxy.google.com/~r/42klines/~3/MiGH_cKn_PA/ubuntu-intrepid-810-quickstart.html</link>
		<comments>http://www.42klines.com/2009/04/29/ubuntu-intrepid-810-quickstart.html#comments</comments>
		<pubDate>Wed, 29 Apr 2009 11:23:50 +0000</pubDate>
		<dc:creator>Sudhanshu</dc:creator>
		
		<category><![CDATA[Tools]]></category>

		<category><![CDATA[UNIX]]></category>

		<guid isPermaLink="false">http://www.42klines.com/2009/04/29/ubuntu-intrepid-810-quickstart.html</guid>
		<description><![CDATA[This article is a quick rundown of everything that I needed to do, before I became reasonably productive, after a reinstall of Ubuntu. A recent virus attack on my Windows desktop left me fuming - the loss of productivity for two days and the amount of damage done, was enough to propel me back to [...]]]></description>
			<content:encoded><![CDATA[<p><i>This article is a quick rundown of everything that I needed to do, before I became reasonably productive, after a reinstall of Ubuntu. A recent virus attack on my Windows desktop left me fuming - the loss of productivity for two days and the amount of damage done, was enough to propel me back to my Linux desktop.</i></p>
<p>I got the time and opportunity recently to get my desktop set for its second-innings with Linux. This page serves as a holder for all that I learned in the process and to prevent me from trying to relearn all of this, if I have to do this again. Hopefully, it&#8217;ll help anyone else trying to go through the same process.<br />
My wife likes to work on Windows, so it has been my primary OS at home, so far. I didn&#8217;t want another outage due to a virus attack, so I decided to install Windows under VMWare for her, while I have some peace of mind with Linux on my desktop. I had the following goals for my new setup:</p>
<ol>
<li>Dual-boot between Ubuntu and Windows XP from my first hard-disk</li>
<li>Find suitable Ubuntu replacements for all the goodies I have been using in Windows</li>
<li>Share files easily between the dual-booted Windows XP and Ubuntu easily</li>
<li>Able to hibernate Ubuntu when power goes off automatically</li>
<li>Restart system automatically when power comes back up</li>
<li>Run Windows XP as guest in Ubuntu VMware host</li>
<li>Let Windows XP guest access Internet and share files with host Ubuntu OS</li>
</ol>
<p>I am going to gloss over details in most of the steps below, because this post is not really meant to explain the why or how of things. However, in case someone wants details, I have provided links covering the same in-depth. I have leveraged a lot of work done by other people and my gratitude goes out to them for their time and effort. </p>
<p>My planned dual-boot setup looks like this:</p>
<p  style="text-align: center"><a href="http://www.42klines.com/wp-content/uploads/2009/04/partioning.png" title='Partitioning'><img src='http://www.42klines.com/wp-content/uploads/2009/04/partioning.png' alt='Partitioning' style="border: medium none ; padding-right: 20px; padding-top: 10px" /></a></p>
<p>So here&#8217;s a quick walkthrough of steps needed to reach the above goals:</p>
<h3 class="post-section">Table of Contents</h3>
<ul>
<li><a href="#93.1">Install Windows XP first</a></li>
<li><a href="#93.2">Install Ubuntu Intrepid 8.10</a></li>
<li><a href="#93.3">Update packages in Ubuntu 8.10</a></li>
<li><a href="#93.4">Install applications in Ubuntu 8.10</a></li>
<li><a href="#93.5">Download and install VMWare Server 2.0 for Linux</a></li>
<li><a href="#93.6">Disable KVM</a></li>
<li><a href="#93.7">Install Windows XP as guest OS</a></li>
<li><a href="#93.8">Set up VMWare networking</a></li>
<li><a href="#93.9">Download and install other apps</a></li>
<li><a href="#93.10">Set up your fonts</a></li>
<li><a href="#93.11">Configure your UPS</a></li>
<li><a href="#93.12">Configure your apps</a></li>
<li><a href="#93.13">Setup screen rotation</a></li>
<li><a href="#93.14">Setup Firefox</a></li>
<li><a href="#93.15">Install applications in Windows XP Guest</a></li>
<li><a href="#93.16">Configure Samba in Ubuntu Intrepid 8.10</a></li>
</ul>
<p><br/></p>
<h3 class="post-section"><a name="93.1" title="93.1"></a>Install Windows XP first</h3>
<p> No brainer. This is an insurance against something not working in the VMWare Windows XP guest OS. I create an extra <b>common</b> partition for use by both Windows/Ubuntu. In previous configurations its been FAT32 since both Linux and Windows could write to it easily, but this time I created it as NTFS, since Ubuntu has read-write support for NTFS partitions now and it seems to be working fine for some time now. Yeah, I am feeling adventurous! But just in case, I won&#8217;t be using the partition for any mission-critical stuff, that I can&#8217;t afford to lose. If something goes wrong, this partition is going back to being FAT32.<br/></p>
<h3 class="post-section"><a name="93.2" title="93.2"></a>Install Ubuntu Intrepid 8.10</h3>
<p> I created a big <span id="code">/var</span> partition so that I can put my virtual machines in that partition. I also want to play with sharing virtual machines between Windows and Linux host OS. Such virtual machines would be <i>copies</i> of guest VMs in <span id="code">/var/vmware</span> and kept in the <span id="code">common</span> partition.<br/></p>
<h3 class="post-section"><a name="93.3" title="93.3"></a>Update packages in Ubuntu 8.10</h3>
<p> The update manager in Ubuntu will be prompting you for updates by now, which may run into hundreds of Mbs. We can start the updates and leave them running overnight. Or you could complete the steps below and update later. As long as updates are being downloaded, you won&#8217;t be able to install anything else.</p>
<p><strong><em>Update:</em></strong> On a Ubuntu 8.10 system which is fresh and hasn&#8217;t been updated you may not be able to install Samba, because of some packaging errors, so you may want to complete any updates first, before going ahead.</p>
<h3 class="post-section"><a name="93.4" title="93.4"></a>Install applications in Ubuntu 8.10</h3>
<p> The next step is to install all needed applications, replacements for what you use in Windows etc. Before doing this just <a href="http://www.google.com/linuxrepositories/index.html" onclick="javascript:pageTracker._trackPageview ('/outbound/www.google.com');">add Google&#8217;s repositories</a> to your system. Here you go:</p>
<p><i>Apps:</i></p>
<p class="code-block"><code><br />
sudo apt-get -y install msttcorefonts<br />
sudo apt-get -y install libdvdread3 regionset<br />
sudo apt-get -y install samba smbclient smbfs<br />
sudo apt-get -y install vpnc<br />
sudo apt-get -y install thunderbird thunderbird-gnome-support latex-xft-fonts<br />
sudo apt-get -y install picasa<br />
sudo apt-get -y install inkscape<br />
sudo apt-get -y install amarok<br />
sudo apt-get -y install vlc<br />
sudo apt-get -y install conky iotop htop powertop<br />
sudo apt-get -y install adobe-flashplugin<br />
sudo apt-get -y install sysinfo<br />
sudo apt-get -y install gworldclock<br />
sudo apt-get -y install rar p7zip-full unrar<br />
sudo apt-get -y install gnome-do<br />
sudo apt-get -y install nmap<br />
sudo apt-get -y install wine<br />
sudo apt-get -y install compizconfig-settings-manager<br />
sudo apt-get -y install sun-java6-plugin sun-java6-jr<br />
sudo apt-get -y install chkconfig<br />
sudo apt-get -y install sensors-applet<br />
sudo apt-get -y install nautilus-actions<br />
sudo apt-get -y install nautilus-open-terminal<br />
sudo apt-get -y install nautilus-script-manager<br />
sudo apt-get -y install nautilus-filename-repairer<br />
sudo apt-get -y install nautilus-script-debug<br />
sudo apt-get -y install nautilus-image-converter<br />
sudo apt-get -y install nautilus-script-collection-svn<br />
sudo apt-get -y install diff-ext<br />
sudo apt-get -y install gnome-themes-extras<br />
sudo apt-get -y install gnochm<br />
sudo apt-get -y install gftp<br />
sudo apt-get -y install apcupsd<br />
sudo apt-get -y install gapcmon<br />
sudo apt-get -y install screenlets<br />
sudo apt-get -y install terminator<br />
sudo apt-get -y install electricsheep<br />
sudo apt-get -y install guayadeque<br />
sudo apt-get -y install xbindkeys xbindkeys-config<br />
</code></p>
<p><i>Development:</i></p>
<p class="code-block"><code><br />
sudo apt-get -y install vim-full vim-gnome<br />
sudo apt-get -y install subversion subversion-tools db4.6-util<br />
sudo apt-get -y install manpages-dev<br />
sudo apt-get -y install rapidsvn<br />
sudo apt-get -y install meld<br />
sudo apt-get -y install systemtap<br />
sudo apt-get -y install g++<br />
sudo apt-get -y install libncurses5-dev<br />
sudo apt-get -y install gettext<br />
sudo apt-get -y install kernel-patch-scripts<br />
sudo apt-get -y install linux-source-x.x.x<br />
sudo apt-get -y install linux-crashdump<br />
sudo apt-get -y install linux-doc<br />
sudo apt-get -y install linux-headers-`uname -r` build-essential xinetd<br />
sudo apt-get -y install kernel-package fakeroot wget bzip2<br />
sudo apt-get -y install kerneltop<br />
sudo apt-get -y install oprofile<br />
sudo apt-get -y install crash<br />
sudo apt-get -y install cscope<br />
sudo apt-get -y install ctags<br />
sudo apt-get -y install ack-grep<br />
</code></p>
<h3 class="post-section"><a name="93.5" title="93.5"></a>Download and install VMWare Server 2.0 for Linux</h3>
<p> There are several flavors of VMWare, VMWare Server being the free one for both Windows and Linux. Download the server from <a href="http://www.vmware.com/download/server/" onclick="javascript:pageTracker._trackPageview ('/outbound/www.vmware.com');">here</a>. Install it as described <a href="http://www.howtoforge.com/how-to-install-vmware-server-2-on-ubuntu-8.10" onclick="javascript:pageTracker._trackPageview ('/outbound/www.howtoforge.com');">here</a>.  You may run into a problem when configuring VMware server 2.0.1 in Ubuntu 8.10. It tries to build the VSOCK module and load it in the kernel, but fails. This can be solved by patching the vmware-config.pl file with a patch provided by an enterprising user. <a href="http://ubuntuforums.org/showpost.php?p=6267637&#038;postcount=17" onclick="javascript:pageTracker._trackPageview ('/outbound/ubuntuforums.org');">Download</a> it here.</strong><br />
<i>Before the patch:</i></p>
<p class="code-block"><code><br />
...<br />
...<br />
Unable to make a vsock module that can be loaded in the running kernel:<br />
insmod: error inserting '/tmp/vmware-config0/vsock.o': -1 Unknown symbol in module<br />
There is probably a slight difference in the kernel configuration between the<br />
set of C header files you specified and your running kernel.  You may want to<br />
rebuild a kernel based on that directory, or specify another directory.<br />
_<br />
The VM communication interface socket family is used in conjunction with the VM<br />
communication interface to provide a new communication path among guests and<br />
host.  The rest of this software provided by VMware Server is designed to work<br />
independently of this feature.  If you wish to have the VSOCK feature  you can<br />
install the driver by running vmware-config.pl again after making sure that<br />
gcc, binutils, make and the kernel sources for your running kernel are<br />
installed on your machine. These packages are available on your distribution's<br />
installation CD.<br />
[ Press the Enter key to continue.]<br />
</code></p>
<p><i>After the patch:</i></p>
<p class="code-block"><code><br />
VMWare config patch VSOCK!<br />
`/tmp/vmware-config1/../Module.symvers' -> `/tmp/vmware-config1/vsock-only/Module.symvers'<br />
Building the vsock module.<br />
_<br />
Using 2.6.x kernel build system.<br />
make: Entering directory `/tmp/vmware-config1/vsock-only'<br />
make -C /lib/modules/2.6.27-7-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules<br />
make[1]: Entering directory `/usr/src/linux-headers-2.6.27-7-generic'<br />
  CC [M]  /tmp/vmware-config1/vsock-only/linux/af_vsock.o<br />
  CC [M]  /tmp/vmware-config1/vsock-only/linux/driverLog.o<br />
  CC [M]  /tmp/vmware-config1/vsock-only/linux/util.o<br />
/tmp/vmware-config1/vsock-only/linux/util.c: In function ‘VSockVmciLogPkt’:<br />
/tmp/vmware-config1/vsock-only/linux/util.c:157: warning: format not a string literal and no format arguments<br />
  CC [M]  /tmp/vmware-config1/vsock-only/linux/vsockAddr.o<br />
  LD [M]  /tmp/vmware-config1/vsock-only/vsock.o<br />
  Building modules, stage 2.<br />
  MODPOST 1 modules<br />
  CC      /tmp/vmware-config1/vsock-only/vsock.mod.o<br />
  LD [M]  /tmp/vmware-config1/vsock-only/vsock.ko<br />
make[1]: Leaving directory `/usr/src/linux-headers-2.6.27-7-generic'<br />
cp -f vsock.ko ./../vsock.o<br />
make: Leaving directory `/tmp/vmware-config1/vsock-only'<br />
The vsock module loads perfectly into the running kernel.<br />
</code></p>
<h3 class="post-section"><a name="93.6" title="93.6"></a>Disable KVM</h3>
<p> VMWare Server won&#8217;t be able to execute your guest OS until you unload/turn-off the built-in KVM virtualization engine in the Linux kernel. Do this:</p>
<p class="code-block"><code><br />
    > sudo rmmod kvm_intel<br />
    > sudo rmmod kvm<br />
    > sudo chkconfig -e kvm<br />
</code></p>
<p><span id="code">chkconfig</span> will open an editor. Just replace <b>on</b> with <b>off</b>.<br/></p>
<h3 class="post-section"><a name="93.7" title="93.7"></a>Install Windows XP as guest OS</h3>
<p> Access VMWare Server using your web-browser at this link: <a href="http://127.0.0.1:8222" onclick="javascript:pageTracker._trackPageview ('/outbound/127.0.0.1:8222');">http://localhost:8222</a>. Add a datastore. I use <span id="code">/var/vmware</span> (that&#8217;s the reason behind <span id="code">/var</span> partition being so big). Create a virtual machine and install the guest OS. Windows XP in VMWare server 2.0.1 can only run on IDE disks. I am not sure if you&#8217;d face this problem during a fresh install, but I faced this when migrating a Windows XP guest VM to Ubuntu, which was created in Windows XP itself as host OS on a virtual SCSI disk. So I had to use <a href="http://www.acronis.com/homecomputing/download/trueimage/" onclick="javascript:pageTracker._trackPageview ('/outbound/www.acronis.com');">Acronis TrueImage</a> first, to clone the virtual SCSI disk to a new virtual IDE drive within the guest VM and then migrate it to Linux host. Some users tried out Norton Ghost for the same but reported having problems with it (although I have seen others using it successfully, with some hoops and twists). </p>
<p>Next, add a new disk to your virtual machine. Start the Windows XP guest OS and format this new drive. Then turn on file sharing and give read-write access to this particular drive. I like to give the host read-write access to the guest&#8217;s drive, so that its easy to transfer data between the host and guest using this shared drive. Also the guest stores all data on this drive. The advantage of a separate drive for your data is that this disk can easily be moved to another VM, in case your current VM goes kaput.</p>
<p>Access the shared folders in guest VMs from <span id="code">Places &gt; Network</span>. You could setup this folder to be mounted easily by tweaking instructions provided <a href="http://www.mattvanstone.com/2006/06/automatically_mounting_smb_sha/" onclick="javascript:pageTracker._trackPageview ('/outbound/www.mattvanstone.com');">here</a>. You can also create a shortcut for your guest OS from VMWare server browser console, for easy access.</p>
<p>Install the VMWare tools in the Windows XP guest OS from the VMWare browser console. You&#8217;d need these for seamless integration of the guest OS with the host. These tools make life a lot easier, when dealing with display settings, mouse cursor etc.</p>
<p><strong><em>Update:</em></strong> The key mappings for some of the keys in your guest Windows XP OS may be wrong at this time. Some keys such as the Del, Arrow keys etc. might not work for you in the guest OS. To fix this problem add the following line to your <span id="code">/etc/vmware/config</span> file. This fixed the problem for me. For more details, see this <a href="http://communities.vmware.com/thread/177321" onclick="javascript:pageTracker._trackPageview ('/outbound/communities.vmware.com');">thread</a>.</p>
<p class="code-block"><code><br />
xkeymap.nokeycodeMap = true<br />
</code></p>
<h3 class="post-section"><a name="93.8" title="93.8"></a>Set up VMWare networking</h3>
<p> You might want to read <a href="http://knol.google.com/k/juniper-hacks/configuring-vmware-20-server-networking/1xqkuq3r2h459/4#" onclick="javascript:pageTracker._trackPageview ('/outbound/knol.google.com');">this</a> first. You&#8217;d want to configure your guest OS to use <a href="http://www.vmweekly.com/articles/networking_in_vmware/1/" onclick="javascript:pageTracker._trackPageview ('/outbound/www.vmweekly.com');">NAT VMWare networking</a> option in order to let it access the Internet, as well as communicate with the host OS. VMWare will use the <span id="code">vmnet8</span> interface for this purpose. Find out the subnet configured by default on the vmnet8 interface, by VMWare server. On my machine this is <span id="code">192.168.4.0</span>. The default gateway and the DNS server for your guest OS in that case is <span id="code">192.168.4.2</span>. You can use DHCP within your guest OS to configure its network and <a href="http://www.virtuatopia.com/index.php/VMware_Server_2.0_DHCP_Configuration#Configuring_the_VMware_Server_DHCP_Server_on_Linux_Hosts" onclick="javascript:pageTracker._trackPageview ('/outbound/www.virtuatopia.com');">VMWare&#8217;s DHCP server</a> will automatically assign IP addresses to your guest VMs. I use static addresses though, which allows me to set up permissions easily using IP addresses in various other configuration files such as Samba etc.</p>
<p class="code-block"><code><br />
> sudo ifconfig vmnet 8<br />
vmnet8    Link encap:Ethernet  HWaddr 00:50:56:c0:00:08<br />
          inet addr:192.168.4.1  Bcast:192.168.4.255  Mask:255.255.255.0<br />
          inet6 addr: fe80::250:56ff:fec0:8/64 Scope:Link<br />
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1<br />
          RX packets:1223 errors:0 dropped:0 overruns:0 frame:0<br />
          TX packets:164 errors:0 dropped:0 overruns:0 carrier:0<br />
          collisions:0 txqueuelen:1000<br />
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)<br />
</code></p>
<p>We could now install other operating systems and test them out too. One of the things that I have been planning to do is to give direct access to rest of the 3 physical disks to a NAS distribution such as OpenFiler, FreeNAS etc and see which one can I use for managing my disks under RAID protection. But more on that in some later post. For now our setup should begin to look like this:</p>
<p  style="text-align: center"><a href="http://www.42klines.com/wp-content/uploads/2009/04/virtualmachines.png" title='Virtual Machines'><img src='http://www.42klines.com/wp-content/uploads/2009/04/virtualmachines.png' alt='Virtual Machines' style="border: medium none ; padding-right: 20px; padding-top: 10px"/></a></p>
<h3 class="post-section"><a name="93.9" title="93.9"></a>Download and install other apps</h3>
<ul>
<li><a href="http://prozilla.genesys.ro/?p=download" onclick="javascript:pageTracker._trackPageview ('/outbound/prozilla.genesys.ro');">Prozilla</a></li>
<li><a href="http://getsongbird.com/download/" onclick="javascript:pageTracker._trackPageview ('/outbound/getsongbird.com');">Songbird</a></li>
<li><a href="http://get.adobe.com/air/" onclick="javascript:pageTracker._trackPageview ('/outbound/get.adobe.com');">Adobe AIR</a></li>
<li><a href="http://www.tweetdeck.com/beta/" onclick="javascript:pageTracker._trackPageview ('/outbound/www.tweetdeck.com');">Tweetdeck</a></li>
</ul>
<h3 class="post-section"><a name="93.10" title="93.10"></a>Set up your fonts</h3>
<p> Go to <span id="code"> System &gt; Preferences &gt; Appearance &gt; Fonts</span>. Turn on <span id="code">Sub-pixel smoothing</span>.</p>
<h3 class="post-section"><a name="93.11" title="93.11"></a>Configure your UPS</h3>
<p> I have an APC Back UPS RS 800 (as written on front-panel), which the driver identifies as Back UPS BR 800. I tried installing <span id="code"><a href="http://www.networkupstools.org/" onclick="javascript:pageTracker._trackPageview ('/outbound/www.networkupstools.org');">NUT</a></span> for monitoring my UPS but it did not work. Finally after much mucking around, I found <span id="code">apcupsd</span> which was able to monitor my UPS and shutdown/hibernate it when the power goes off. A <a href="http://www.apcupsd.com/manual/manual.html" onclick="javascript:pageTracker._trackPageview ('/outbound/www.apcupsd.com');">detailed guide</a> on configuring it is present here. You can find a <a href="http://flossexperiences.wordpress.com/2008/10/26/configuring-apcupsd/" onclick="javascript:pageTracker._trackPageview ('/outbound/flossexperiences.wordpress.com');">shorter one</a> here. The program <span id="code"><a href="http://sourceforge.net/project/screenshots.php?group_id=54413" onclick="javascript:pageTracker._trackPageview ('/outbound/sourceforge.net');">gapcmon</a></span> is a great way to keep a tab on the UPS including past history. My <span id="code">/etc/apcupsd/apcupsd.conf</span> file is as shown below and that is followed by some troubleshooting tips.</p>
<p class="code-block"><code><br />
> cat /etc/apcupsd/apcupsd.conf | grep -v "#" | grep -v "^$"<br />
UPSNAME BackUPS-RS800<br />
UPSCABLE usb<br />
UPSTYPE usb<br />
POLLTIME 30<br />
LOCKFILE /var/lock<br />
SCRIPTDIR /etc/apcupsd<br />
PWRFAILDIR /etc/apcupsd<br />
NOLOGINDIR /etc<br />
ONBATTERYDELAY 6<br />
BATTERYLEVEL 20<br />
MINUTES 6<br />
TIMEOUT 0<br />
ANNOY 120<br />
ANNOYDELAY 60<br />
NOLOGON disable<br />
KILLDELAY 0<br />
NETSERVER on<br />
NISIP 127.0.0.1<br />
NISPORT 3551<br />
EVENTSFILE /var/log/apcupsd.events<br />
EVENTSFILEMAX 10<br />
UPSCLASS standalone<br />
UPSMODE disable<br />
STATTIME 0<br />
STATFILE /var/log/apcupsd.status<br />
LOGSTATS off<br />
DATATIME 0<br />
LOTRANSFER  208<br />
HITRANSFER 253<br />
</code></p>
<p>You may have to create the device nodes, which are used by apcupsd to monitor the UPS. To create those devices, use this script:</p>
<p class="code-block"><code><br />
> sudo /usr/share/doc/apcupsd/examples/make-hiddev<br />
> ls -l /dev/usb/hid<br />
total 0<br />
crw-r--r-- 1 root root 180,  96 2009-04-22 15:33 hiddev0<br />
crw-r--r-- 1 root root 180,  97 2009-04-22 15:33 hiddev1<br />
crw-r--r-- 1 root root 180, 106 2009-04-22 15:33 hiddev10<br />
crw-r--r-- 1 root root 180, 107 2009-04-22 15:33 hiddev11<br />
crw-r--r-- 1 root root 180, 108 2009-04-22 15:33 hiddev12<br />
crw-r--r-- 1 root root 180, 109 2009-04-22 15:33 hiddev13<br />
crw-r--r-- 1 root root 180, 110 2009-04-22 15:33 hiddev14<br />
crw-r--r-- 1 root root 180, 111 2009-04-22 15:33 hiddev15<br />
crw-r--r-- 1 root root 180,  98 2009-04-22 15:33 hiddev2<br />
crw-r--r-- 1 root root 180,  99 2009-04-22 15:33 hiddev3<br />
crw-r--r-- 1 root root 180, 100 2009-04-22 15:33 hiddev4<br />
crw-r--r-- 1 root root 180, 101 2009-04-22 15:33 hiddev5<br />
crw-r--r-- 1 root root 180, 102 2009-04-22 15:33 hiddev6<br />
crw-r--r-- 1 root root 180, 103 2009-04-22 15:33 hiddev7<br />
crw-r--r-- 1 root root 180, 104 2009-04-22 15:33 hiddev8<br />
crw-r--r-- 1 root root 180, 105 2009-04-22 15:33 hiddev9<br />
</code></p>
<p><strong>Update:</strong> With Ubuntu 10.04 editing fstab to mount usbfs was not found to be necessary.<BR></p>
<p>Add this line to <span id="code">/etc/fstab</span>:</p>
<p class="code-block"><code><br />
none /proc/bus/usb usbfs defaults 0 0<br />
</code></p>
<p><strong>Update:</strong> With Ubuntu 10.04 it was necessary to edit the file <span id="code">/etc/default/apcupsd</span> and replace <span id="code">ISCONFIGURED=no</span> with <span id="code">ISCONFIGURED=yes</span>, before starting the <span id="code">apcupsd</span> daemon. </p>
<p>Start the UPS monitoring daemon:</p>
<p class="code-block"><code><br />
> sudo mount -a<br />
> cat /proc/bus/usb/devices<br />
...<br />
...<br />
T:  Bus=01 Lev=01 Prnt=01 Port=01 Cnt=02 Dev#=  6 Spd=1.5 MxCh= 0<br />
D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1<br />
P:  Vendor=051d ProdID=0002 Rev= 1.06<br />
S:  Manufacturer=American Power Conversion<br />
S:  Product=Back-UPS BR  800 FW:9.o4 .I USB FW:o4<br />
S:  SerialNumber=xxxxxxxxxxxx<br />
C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr= 24mA<br />
I:* If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=00 Driver=(none)<br />
E:  Ad=81(I) Atr=03(Int.) MxPS=   6 Ivl=10ms<br />
...<br />
> sudo /etc/init.d/apcupsd start<br />
> sudo cat /var/log/daemon.log<br />
...<br />
Apr 25 16:21:01 Zork apcupsd[6015]: NIS server startup succeeded<br />
Apr 25 16:21:01 Zork apcupsd[6015]: apcupsd 3.14.4 (18 May 2008) debian startup succeeded<br />
...<br />
> ps aux | grep ups<br />
root      5826  0.0  0.0  20824  1024 ?        Ssl  Apr28   0:01 /sbin/apcupsd<br />
root     12064  0.0  0.0   2964   776 ?        S    Apr28   0:00 hald-addon-hid-ups: listening on /dev/usb/hiddev0<br />
</code></p>
<p>You might want to reboot once, if it does not start the first time. That should start the <span id="code">hald-addon-hid-ups</span> process, which is necessary for apcupsd to monitor the UPS. </p>
<p>Since a lot of us don&#8217;t have the luxury of continuous power, unlike the developed world, we&#8217;d want to shutdown/hibernate the machine when the power goes off. I prefer hibernation, instead of shutting it down, because any virtual machines running don&#8217;t have to be shut down as well when the power goes off. Apart from that, when the power returns, we get the luxury of having our desktop back with any virtual machines running in the exact pristine state, as they were. Also we could configure the BIOS to power ON the machine automatically when the power returns (if your BIOS has that option). Just follow these ArchLinux <a href="http://wiki.archlinux.org/index.php/APC_UPS#Hibernating_instead_of_shutting_down" onclick="javascript:pageTracker._trackPageview ('/outbound/wiki.archlinux.org');">instructions</a> to configure UPS triggered hibernation. These worked for me on Ubuntu 8.10 as well.</p>
<h3 class="post-section"><a name="93.12" title="93.12"></a>Configure your apps</h3>
<p> For me this involves downloading the configuration files such as <span id="code">.vimrc</span>,  <span id="code">.bashrc</span> etc. that I maintain in a subversion repository online. Other things that we&#8217;d like to do at this point is adding icons of most frequently accessed apps to the panel, add any useful applets (especially the hardware temperature monitoring applet - it saved my graphics card once, which I found running at more than 85 degrees), etc. Another thing I like to do is to turn on Compiz from <span id="code">System &gt; Preferences &gt; Appearance &gt; Visual Effects</span>. Then I fire up <span id="code">System &gt; Preferences &gt; <a href="http://www.phoronix.com/scan.php?page=article&#038;item=simple_ccsm&#038;num=1" onclick="javascript:pageTracker._trackPageview ('/outbound/www.phoronix.com');">CompizConfig Settings Manager</a></span> and turn on <span id="code">Blur Windows, Window Previews</span>. Also to turn on Nautilus&#8217;s subversion integration scripts run this command:</p>
<p class="code-block"><code><br />
> nautilus-script-manager enable Subversion<br />
</code></p>
<p><b><i>Update:</b></i> The vpnc client for Ubuntu 8.10 keeps on dropping connections frequently. To fix this, add the following line to the file <span id="code">/etc/vpnc/default.conf</span> file:</p>
<p class="code-block"><code><br />
DPD idle timeout (our side) 0<br />
</code></p>
<h3 class="post-section"><a name="93.13" title="93.13"></a>Setup screen rotation</h3>
<p> When working with source code, I like to rotate my screen by 90 degrees, so that I can see more of the source code on my <a href="http://www.dell.com/content/products/productdetails.aspx/monitor_2408wfp?c=us&#038;l=en&#038;s=dfo" onclick="javascript:pageTracker._trackPageview ('/outbound/www.dell.com');">Dell monitor</a> in one go. My Nvidia GeForce 8800 GTS card allows me to rotate the screen in Ubuntu. Its a shame that this support does not come built into Ubuntu&#8217;s display preferences dialog box - yeah, it says it can rotate the display, but won&#8217;t. To add this support, edit <span id="code">/etc/X11/xorg.conf</span> file and add this line to the <span id="code">Screen:</span> section:</p>
<p class="code-block"><code><br />
Option "RandRRotation" "true"<br />
</code></p>
<p>Then rotate the screen:</p>
<p class="code-block"><code><br />
> /etc/init.d/gdm stop<br />
> /etc/init.d/gdm start<br />
> xrandr -o left<br />
</code></p>
<h3 class="post-section"><a name="93.14" title="93.14"></a>Setup Firefox</h3>
<p> I like to install these add-ons for Firefox:</p>
<table cell-padding="2" border="0" width="100%">
<tr>
<td width="33%">
<ul>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/1122" onclick="javascript:pageTracker._trackPageview ('/outbound/addons.mozilla.org');">Tab Mix Plus</a></li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/1865" onclick="javascript:pageTracker._trackPageview ('/outbound/addons.mozilla.org');">Adblock Plus</a></li>
</ul>
</td>
<td width="33%">
<ul>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/2410" onclick="javascript:pageTracker._trackPageview ('/outbound/addons.mozilla.org');">Xmarks</a></li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/26" onclick="javascript:pageTracker._trackPageview ('/outbound/addons.mozilla.org');">Download StatusBar</a></li>
</ul>
</td>
<td width="33%">
<ul>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/1843" onclick="javascript:pageTracker._trackPageview ('/outbound/addons.mozilla.org');">Firebug</a></li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/4605" onclick="javascript:pageTracker._trackPageview ('/outbound/addons.mozilla.org');">IMDB search</a></li>
</ul>
</td>
</tr>
</table>
<h3 class="post-section"><a name="93.15" title="93.15"></a>Install applications in Windows XP Guest</h3>
<p> Here is my list of essentials for Windows XP:</p>
<table cell-padding="2" border="0" width="100%">
<tr>
<td width="33%">
<ul>
<li><a href="http://lifehacker.com/software/featured-windows-download/take-and-annotate-screenshots-with-screenshot-captor-304548.php" onclick="javascript:pageTracker._trackPageview ('/outbound/lifehacker.com');">Screenshot Captor</a></li>
<li><a href="http://www.putty.org/" onclick="javascript:pageTracker._trackPageview ('/outbound/www.putty.org');">Putty</a></li>
<li><a href="http://lifehacker.com/5039956/five-best-ftp-clients" onclick="javascript:pageTracker._trackPageview ('/outbound/lifehacker.com');">WinSCP</a></li>
<li><a href="http://lifehacker.com/software/virtual-desktops/download-of-the-day-dexpot-windows-224671.php" onclick="javascript:pageTracker._trackPageview ('/outbound/lifehacker.com');">Dexpot</a></li>
<li><a href="http://lifehacker.com/software/productivity/download-of-the-day-gridmove-windows-199404.php" onclick="javascript:pageTracker._trackPageview ('/outbound/lifehacker.com');">GridMove</a></li>
<li><a href="http://lifehacker.com/software/productivity/download-of-the-day-foxit-pdf-reader-109741.php" onclick="javascript:pageTracker._trackPageview ('/outbound/lifehacker.com');">Foxit PDF Reader</a></li>
<li><a href="http://lifehacker.com/5115354/manipulate-vector-images-with-open-source-inkscape" onclick="javascript:pageTracker._trackPageview ('/outbound/lifehacker.com');">Inkscape</a></li>
</ul>
</td>
<td width="33%">
<ul>
<li><a href="http://lifehacker.com/tag/Google-Chrome/" onclick="javascript:pageTracker._trackPageview ('/outbound/lifehacker.com');">Google Chrome</a></li>
<li><a href="http://lifehacker.com/tag/picasa/" onclick="javascript:pageTracker._trackPageview ('/outbound/lifehacker.com');">Google Picasa</a></li>
<li><a href="http://lifehacker.com/software/subversion/hack-attack-using-subversion-with-tortoisesvn-192367.php" onclick="javascript:pageTracker._trackPageview ('/outbound/lifehacker.com');">TortoiseSVN</a></li>
<li><a href="http://lifehacker.com/315023/take-vim-with-you-with-gvim-portable" onclick="javascript:pageTracker._trackPageview ('/outbound/lifehacker.com');">Vim</a></li>
<li><a href="http://lifehacker.com/software/zip/how-to-create-and-extractrar-files-221066.php" onclick="javascript:pageTracker._trackPageview ('/outbound/lifehacker.com');">7-Zip</a></li>
<li><a href="http://lifehacker.com/software/featured-windows-download/speed-up-file-copying-with-teracopy-263492.php" onclick="javascript:pageTracker._trackPageview ('/outbound/lifehacker.com');">Teracopy</a></li>
<li><a href="http://www.mochasoft.dk/freeware/x11.htm" onclick="javascript:pageTracker._trackPageview ('/outbound/www.mochasoft.dk');">Mocha X Server</a></li>
</ul>
</td>
<td width="33%">
<ul>
<li><a href="http://lifehacker.com/software/geek-to-live/geek-to-live-automatically-back-up-your-hard-drive-147855.php" onclick="javascript:pageTracker._trackPageview ('/outbound/lifehacker.com');">SyncBack</a></li>
<li><a href="http://lifehacker.com/software/hard-drives/download-of-the-day-windirstat-154071.php" onclick="javascript:pageTracker._trackPageview ('/outbound/lifehacker.com');">WinDirStat</a></li>
<li><a href="http://lifehacker.com/5137090/ccleaner-cleans-up-after-chrome" onclick="javascript:pageTracker._trackPageview ('/outbound/lifehacker.com');">CCleaner</a></li>
<li><a href="http://blogs.msdn.com/noahc/archive/2006/10/11/change-screen-resolution-with-one-keyboard-shortcut.aspx" onclick="javascript:pageTracker._trackPageview ('/outbound/blogs.msdn.com');">QRes</a></li>
<li><a href="http://lifehacker.com/software/clipboard/download-of-the-day-ditto-windows-249974.php" onclick="javascript:pageTracker._trackPageview ('/outbound/lifehacker.com');">Ditto</a></li>
<li><a href="http://lifehacker.com/software/windows/download-of-the-day-sysinternals-suite-windows-237010.php" onclick="javascript:pageTracker._trackPageview ('/outbound/lifehacker.com');">Sysinternal utils</a></li>
<li><a href="http://lifehacker.com/395046/five-best-antivirus-applications" onclick="javascript:pageTracker._trackPageview ('/outbound/lifehacker.com');">AVG Antivirus</a></li>
</ul>
</td>
</tr>
</table>
<p>Now that you have installed all the basic apps you&#8217;d want to backup your Windows XP VM so that you don&#8217;t need to repeat the Windows XP installation ever. Copy the contents of the directory containing your virtual machines. Compress this copy and keep it safe somewhere - I am sure you&#8217;ll need it someday, Windows being what it is!</p>
<h3><a name="93.16" title="93.16"></a>Configure Samba in Ubuntu Intrepid 8.10</h3>
<p> To share files in the Ubuntu host with the Windows XP guest you&#8217;d want to setup Samba in Ubuntu such that it shares the data folders with the guest. A typical Samba setup is described <a href="http://ubuntuforums.org/showthread.php?t=202605" onclick="javascript:pageTracker._trackPageview ('/outbound/ubuntuforums.org');">here</a>. If you need a simpler no frills setup, find it <a href="http://www.jonathanmoeller.com/screed/?p=532" onclick="javascript:pageTracker._trackPageview ('/outbound/www.jonathanmoeller.com');">here</a>. The first link worked for me within a couple of minutes.</p>
<p>Phew! That was a long task list. If you want to find out more about some other stuff you could tweak, take a look at <a href="http://ubuntuguide.org/wiki/Ubuntu:Intrepid" onclick="javascript:pageTracker._trackPageview ('/outbound/ubuntuguide.org');">these</a> <a href="http://nickj.org/Ubuntu_8.10_desktop_setup_steps" onclick="javascript:pageTracker._trackPageview ('/outbound/nickj.org');">pages</a> as well. Well, this page maybe already outdated (Ubuntu 9.04 just got released, but hopefully I am not off by a huge margin, when I make a jump to the next release of Ubuntu). For now I am not going to the next Ubuntu distribution unless there&#8217;s a really compelling reason to do so.</p>
<p>The maximum amount of time I spent in Ubuntu was in setting up the UPS and troubleshooting the installation of VMWare server in Ubuntu. That stuff just works in Windows. Add a bunch of utilities on top of that and you are ready to go! I wish it was the same with Ubuntu&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.42klines.com/2009/04/29/ubuntu-intrepid-810-quickstart.html/feed</wfw:commentRss>
		<feedburner:origLink>http://www.42klines.com/2009/04/29/ubuntu-intrepid-810-quickstart.html</feedburner:origLink></item>
		<item>
		<title>Travelling</title>
		<link>http://feedproxy.google.com/~r/42klines/~3/ojQ1e-BT6v8/travelling.html</link>
		<comments>http://www.42klines.com/2008/04/20/travelling.html#comments</comments>
		<pubDate>Sun, 20 Apr 2008 12:23:34 +0000</pubDate>
		<dc:creator>Sudhanshu</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.42klines.com/2008/04/20/travelling.html</guid>
		<description><![CDATA[I am travelling. So there may not be any updates for 3 weeks. I may post photographs from my trip to my Flickr hangout though. Just in case you are interested in photography, please do drop in and say hi there.


]]></description>
			<content:encoded><![CDATA[<p>I am travelling. So there may not be any updates for 3 weeks. I may post photographs from my trip to my <a href="http://www.flickr.com/photos/zork" onclick="javascript:pageTracker._trackPageview ('/outbound/www.flickr.com');">Flickr</a> hangout though. Just in case you are interested in photography, please do drop in and say hi there.</p>
<p  style="text-align: center"><img src='http://www.42klines.com/wp-content/uploads/2008/04/pict6793-1.JPG' alt='Plane' style="border: medium none ; padding-right: 20px; padding-top: 10px" /><img src='http://www.42klines.com/wp-content/uploads/2008/04/pict6785-1.JPG' alt='Over The Ocean' /></p>
<p style="text-align: center"><img src='http://www.42klines.com/wp-content/uploads/2008/04/pict6860-1.JPG' alt='Singapore' style="border: medium none ; padding-right: 20px; padding-top: 10px" /><img src='http://www.42klines.com/wp-content/uploads/2008/04/pict6875-1.JPG' alt='Leaving Hongkong' /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.42klines.com/2008/04/20/travelling.html/feed</wfw:commentRss>
		<feedburner:origLink>http://www.42klines.com/2008/04/20/travelling.html</feedburner:origLink></item>
		<item>
		<title>Recovering photographs from a memory card</title>
		<link>http://feedproxy.google.com/~r/42klines/~3/n5NO3gUCmlY/recovering-photographs-from-a-memory-card.html</link>
		<comments>http://www.42klines.com/2008/04/12/recovering-photographs-from-a-memory-card.html#comments</comments>
		<pubDate>Sat, 12 Apr 2008 13:53:40 +0000</pubDate>
		<dc:creator>Sudhanshu</dc:creator>
		
		<category><![CDATA[Photography]]></category>

		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.42klines.com/2008/04/12/recovering-photographs-from-a-memory-card.html</guid>
		<description><![CDATA[I am an avid photographer and generally take a lot of photographs on my outdoor excursions. On my last trip the memory card in my camera became inaccessible, while trying to save the clicked photograph in it. Dozens of previously clicked photographs, also vanished without trace. 
The camera&#8217;s image viewer simply refused to display any [...]]]></description>
			<content:encoded><![CDATA[<p>I am an avid photographer and generally take a lot of photographs on my outdoor excursions. On my last trip the memory card in my camera became inaccessible, while trying to save the clicked photograph in it. Dozens of previously clicked photographs, also vanished without trace. </p>
<p>The camera&#8217;s image viewer simply refused to display any previously clicked images. My heart sank. Not only could I take more photographs throughout the trip, I also lost the few shots I had taken already. If it wasn&#8217;t for a good photograph recovery software for Windows, I&#8217;d have lost these photographs.</p>
<p style="text-align: center"><a href="http://www.flickr.com/photos/zork/2408915809/" onclick="javascript:pageTracker._trackPageview ('/outbound/www.flickr.com');"><img src='http://www.42klines.com/wp-content/uploads/2008/04/recovered_pic1.png' alt='Recovered Photograph' style="border: medium none ; padding-right: 20px; padding-top: 10px" /></a><a href="http://www.flickr.com/photos/zork/2408915815/" onclick="javascript:pageTracker._trackPageview ('/outbound/www.flickr.com');"><img src='http://www.42klines.com/wp-content/uploads/2008/04/recovered_pic2.png' alt='Recovered Photograph' style="border: medium none ;" /></a></p>
<p style="text-align: center"><strong>Recovered Photographs</strong></p>
<p>I had been planning for a while to recover photographs from that SD card. The photograph recovery software I found is one added reason to keep on coming back to Windows, despite all of its flaws. Some programs just work, without too much tinkering, when you have little time to satisfy your inner geek.</p>
<p><strong>Most SD cards use the FAT filesystem</strong>, because its simple, well understood and there are <a href="http://freedos-32.sourceforge.net/showdoc.php?page=fat" onclick="javascript:pageTracker._trackPageview ('/outbound/freedos-32.sourceforge.net');">free</a> or <a href="http://www.on-time.com/rtfiles-32.htm" onclick="javascript:pageTracker._trackPageview ('/outbound/www.on-time.com');">embedded device driver implementations</a> available easily out there for using this filesystem.  I was trying to find out time to tinker with the details of the FAT filesystem, though <strong>after finding <a href="http://www.z-a-recovery.com/" onclick="javascript:pageTracker._trackPageview ('/outbound/www.z-a-recovery.com');">Zero Assumption Recovery</a>, I feel no need to do so.</strong></p>
<p>Cutting the long story short, this software recovered almost all of my photographs, that I had clicked. A few photographs could only be partially recovered, but these were too few and unimportant for me to worry about. This program is a shareware program, but the image recovery portion of the program is free for use.</p>
<p><strong>Apart from the program, you may need a card reader. Your camera connected to the PC using a data cable may also work.</strong> I have been using a TECH-COM multiple card reader to access my SD cards, ever since I lost my camera&#8217;s data cable. The SD card I used to recover the data was a 2GB Transcend card, bought about a year ago. The card wasn&#8217;t in use for a long time. This was only the second time I was using it in my camera. A surprisingly short life, as far as I know, for a SD card. Two of my other SD cards - a 1 GB card and another 512 MB card, also from Transcend continue to work perfectly, after more than a year of frequent use.</p>
<p style="text-align: center"><img src='http://www.42klines.com/wp-content/uploads/2008/04/equipment.PNG' alt='Equipment' /></p>
<p style="text-align: center"><strong>Equipment</strong></p>
<p>This is not a complete review of this software. Although, it can recover files from NTFS, ext2/ext3 partitions, I did not test drive these features. The program has several other configurable options, but I just evaluated the photographs recovery feature. This is the only free feature of this program. Rest of the features are severely limited.</p>
<p>With the default options <strong>the program took 58 minutes to analyze the 2GB SD card in two phases.</strong> In the first phase it looks for any filesystem metadata blocks, followed by recovering the data blocks of each photograph file in the second phase. Out  of total 592 photographs that could be recovered, 14 were incompletely recovered. This could be because the data blocks of those 14 photographs were overwritten. Even then a recovery rate of 98% is remarkable. </p>
<p style="text-align: center"><img src='http://www.42klines.com/wp-content/uploads/2008/04/photograph_half_recovered.png' alt='Incomplete Recovery' style="border: medium none ; padding-right: 20px; padding-top: 10px" /><img src='http://www.42klines.com/wp-content/uploads/2008/04/photographs_fully_recovered.png' alt='Completely Recovered' style="border: medium none ; padding-right: 20px; padding-top: 10px" /></p>
<p style="text-align: center"><strong>Incomplete &#038; Completely Recovered Photographs </strong></p>
<p>There however seem to be several image recovery options to detect end-of-file, which decide the speed of data recovery. The dialog box below lets you choose these options. Image analysis is the default option. <strong>I chose the <strong>None</strong> option and this reduced the data recovery time to 5 mins from 58 mins earlier.</strong> The software was still able to recover all the photographs. Maybe in some corner cases, image analysis is a better option, though.</p>
<p style="text-align: center"><img src='http://www.42klines.com/wp-content/uploads/2008/04/image_recovery_options.png' alt='Image Recovery Options' /></p>
<p style="text-align: center"><strong>End-of-file detection options for image recovery</strong></p>
<p>The program seems to understand several file formats, including photographs, which means it can be more reliable when recovering these files. The screenshot below shows the dialog box where you can select the file formats which the software tries to validate while recovering the data.</p>
<p style="text-align: center"><img src='http://www.42klines.com/wp-content/uploads/2008/04/file_formats.png' alt='File Formats' /></p>
<p style="text-align: center"><strong>File formats validated</strong></p>
<p>The screenshot below shows the photographs selection dialog, after it was done analyzing the SD card. Whenever you click on a photograph shown in the dialog box below, it shows a preview of that photograph in a separate window, as shown above. One annoying behaviour of this dialog is that it only shows photographs in incremental batches of 100. When you click on the link at the bottom of the tree, to show the next 100, it expands the tree and scrolls back to the top. Then you&#8217;ll have to scroll back down, to get back to the next photograph. If you are not careful enough, to keep track of which photograph you were viewing last, you&#8217;ll lose track of where to start again.</p>
<p style="text-align: center"><img src='http://www.42klines.com/wp-content/uploads/2008/04/photographs_recovery_ii.png' alt='Recovered Files' /></p>
<p style="text-align: center"><strong>List of photographs recovered</strong></p>
<p>The program, however, is not without other flaws. <strong>It crashed after completing the two recovery phases i.e. making me wait for more than an hour.</strong> It again crashed immediately with a memory access violation error, as soon as it executed the second time. I was finally able to get it to recover my files on the third attempt. Three hours of labour, but finally I had the photographs I needed. If the end-of-file selection option was known to me earlier, I&#8217;d have been able to recover the photographs much faster.</p>
<p>For a complete walkthrough with screenshots for each step of recovery, check out this <a href="http://www.z-a-recovery.com/demo-ir.htm" onclick="javascript:pageTracker._trackPageview ('/outbound/www.z-a-recovery.com');">tutorial</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.42klines.com/2008/04/12/recovering-photographs-from-a-memory-card.html/feed</wfw:commentRss>
		<feedburner:origLink>http://www.42klines.com/2008/04/12/recovering-photographs-from-a-memory-card.html</feedburner:origLink></item>
		<item>
		<title>Mom, how do I become more creative?</title>
		<link>http://feedproxy.google.com/~r/42klines/~3/BttRMs4LMCY/mom-how-do-i-become-more-creative.html</link>
		<comments>http://www.42klines.com/2008/03/26/mom-how-do-i-become-more-creative.html#comments</comments>
		<pubDate>Wed, 26 Mar 2008 09:00:13 +0000</pubDate>
		<dc:creator>Sudhanshu</dc:creator>
		
		<category><![CDATA[Books]]></category>

		<category><![CDATA[Ideas]]></category>

		<guid isPermaLink="false">http://www.42klines.com/2008/03/26/mom-how-do-i-become-more-creative.html</guid>
		<description><![CDATA[Do you sometimes wonder why some people seem to be more creative than others? How do the creative ones keep coming up with ideas? This post looks at this and is biased towards people involved with technological development. After all as I said before this blog is about software development.
Getting ideas is the easy part. [...]]]></description>
			<content:encoded><![CDATA[<p>Do you sometimes wonder why some people seem to be more creative than others? How do the creative ones keep coming up with ideas? This post looks at this and is biased towards people involved with technological development. After all as I said <a href="http://www.42klines.com/2008/02/24/hello-world.html" target="_blank">before</a> this blog is about software development.</p>
<p><strong>Getting ideas is the easy part. The difficult part is to execute those ideas.</strong> Yet, it’s so difficult to get into the idea-generation mode itself for a lot of people. This post will look at the easy part - how to generate ideas.</p>
<h3 class="post-section">Table of Contents</h3>
<ul>
<li><a href="#43.1">Motivation</a></li>
<li><a href="#43.2">Avoid Distraction</a></li>
<li><a href="#43.3">Stimuli</a></li>
<li><a href="#43.4">Hack Mode</a></li>
<li><a href="#43.5">Resources</a></li>
</ul>
<h3 class="post-section"><a name="43.1" title="43.1"></a>Motivation</h3>
<p><em>“The cure for boredom is curiosity. There is no cure for curiosity.”</em> - <a href="http://www.library.csi.cuny.edu/dept/history/lavender/386/dparker.html" onclick="javascript:pageTracker._trackPageview ('/outbound/www.library.csi.cuny.edu');" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.library.csi.cuny.edu');">Dorothy Parker</a></p>
<p><strong>The most important pre-requisite for generating ideas is motivation.</strong> The various sources of motivation have been <a href="http://chiron.valdosta.edu/whuitt/col/motivation/motivate.html" onclick="javascript:pageTracker._trackPageview ('/outbound/chiron.valdosta.edu');" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/chiron.valdosta.edu');">studied</a> in <a href="http://www.uri.edu/research/lrc/scholl/Notes/Sources_Inducement_Matrix.htm" onclick="javascript:pageTracker._trackPageview ('/outbound/www.uri.edu');" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.uri.edu');">different</a> <a href="http://www3.telus.net/linguisticsissues/motivation.html" onclick="javascript:pageTracker._trackPageview ('/outbound/www3.telus.net');" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www3.telus.net');">contexts</a>. Broadly speaking there are two sources of motivation - <strong>intrinsic satisfaction and external rewards.</strong></p>
<p>Intrinsic satisfaction can be generated by satisfying one’s curiosity, taking action to improve yourself in an area, generating new insights from existing knowledge, solving difficult problems etc.</p>
<p>Similarly external factors such as financial rewards, recognition of achievements, promotions and so on are also instrumental in motivating people.</p>
<p style="text-align: center"><img src="http://www.42klines.com/wp-content/uploads/2008/03/dilbert-motivation-boss-blog.jpg" alt="External Motivation" /></p>
<p style="text-align: center"><strong>External Motivation</strong></p>
<p>Intrinsic satisfaction though, is the best form of motivation, since it’ll most likely help you play the creative game longer, before you need a <a href="http://www.scottberkun.com/essays/33-how-to-survive-creative-burnout/" onclick="javascript:pageTracker._trackPageview ('/outbound/www.scottberkun.com');" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.scottberkun.com');">reboot</a>. Nevertheless, whenever you feel you are losing motivation, <a href="http://www.lifehack.org/articles/productivity/how-to-stay-motivated.html" onclick="javascript:pageTracker._trackPageview ('/outbound/www.lifehack.org');" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.lifehack.org');">help is at hand</a>. If you try <a href="http://www.du4.com/dave/phrases.asp" onclick="javascript:pageTracker._trackPageview ('/outbound/www.du4.com');" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.du4.com');">avoiding these phrases</a>, the motivation will last longer.</p>
<p style="text-align: center"><img src="http://www.42klines.com/wp-content/uploads/2008/03/dilbert-temp-motivation-2.png" alt="Dilbert Motivation - I" /></p>
<p style="text-align: center"><img src="http://www.42klines.com/wp-content/uploads/2008/03/dilbert-temp-motivation-3.png" alt="Dilbert Motivation - II" /></p>
<p style="text-align: center"><strong>Temporary Motivation</strong></p>
<p><a href="http://blog.modernmechanix.com/2006/09/06/dissatisfaction-americas-greatest-asset-2/" onclick="javascript:pageTracker._trackPageview ('/outbound/blog.modernmechanix.com');" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/blog.modernmechanix.com');">Dissatisfaction</a> is a type of intrinsic motivation. It can emanate from lack of quality of a service, inefficiency with which we are forced to work, financial issues, intellectually unsatisfying work, the failure to identify one’s purpose of life, etc. Whatever be the reason, it makes people take action or at least urges them to do so.</p>
<p><a href="http://www.lifehack.org/articles/productivity/4-reasons-why-curiosity-is-important-and-how-to-develop-it.html" onclick="javascript:pageTracker._trackPageview ('/outbound/www.lifehack.org');" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.lifehack.org');">Curiosity</a> though takes the cake when it comes to finding out an infinite source of motivation. People who are curious are constantly exploring things, asking themselves questions, looking for stimuli and so on. All of that leads to learning new things, which when combined with existing knowledge or ideas leads to new ideas or concepts.</p>
<p style="text-align: center"><img src="http://www.42klines.com/wp-content/uploads/2008/03/dilbert-curiosity.jpg" alt="Curiosity" /></p>
<p style="text-align: center"><strong>Curiosity </strong></p>
<p>In the video below <a href="http://en.wikipedia.org/wiki/Richard_Feynman" onclick="javascript:pageTracker._trackPageview ('/outbound/en.wikipedia.org');" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/en.wikipedia.org');">Richard Feynman</a> talks about his early experiences as a boy and it’s striking how curious he was as a child. More interviews and interesting discussions with Richard Feynman are captured in the book <a href="http://www.amazon.com/Pleasure-Finding-Things-Out-Richard/dp/0465023959/ref=pd_bbs_sr_1/102-6878412-6136913?ie=UTF8&amp;s=books&amp;qid=1177540554&amp;sr=8-1" onclick="javascript:pageTracker._trackPageview ('/outbound/www.amazon.com');" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.amazon.com');">The Pleasure of Finding Things Out</a>. Look at what his curiosity got <a href="http://content.cdlib.org/ark:/13030/kt5n39p6k0/" onclick="javascript:pageTracker._trackPageview ('/outbound/content.cdlib.org');" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/content.cdlib.org');">translated</a> into.</p>
<p><strong>
<div class="vvqbox vvqyoutube" style="width:425px;height:355px;">
<p id="vvq4f957a4da2f7b"><a href="http://www.youtube.com/watch?v=Sk8TVopOBGE" onclick="javascript:pageTracker._trackPageview ('/outbound/www.youtube.com');">http://www.youtube.com/watch?v=Sk8TVopOBGE</a></p>
</div>
<p> </strong></p>
<p style="text-align: center"><strong>The Pleasure of Finding Things Out</strong></p>
<p>In his book <a href="http://www.amazon.com/Lateral-Thinking-Creativity-Perennial-Library/dp/0060903252/ref=pd_bbs_sr_1?ie=UTF8&amp;s=books&amp;qid=1206279422&amp;sr=1-1" onclick="javascript:pageTracker._trackPageview ('/outbound/www.amazon.com');" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.amazon.com');">Lateral Thinking</a>, Edward de Bono talks about lateral thinking as a way of using information to bring about creativity and insight restructuring. Lateral thinking is an alternative to vertical thinking. It helps to put together or structure information in new patterns. <strong>While vertical thinking seeks to select a possible path from several, lateral thinking seeks to generate new paths.</strong> The result - new insights. It’s a wonderful book and really echoed a lot of what I have learned along the way, about generating ideas. Highly recommended.</p>
<h3 class="post-section"><a name="43.2" title="43.2"></a>Avoid Distraction</h3>
<p>The second pre-requisite for being more creative is a distraction-less zone. I am sure you won’t find yourself going very far with creativity if your wife’s nagging you to get the kitchen sink pipe fixed or change your kid’s nappies. Get that done <a href="http://7pproductions.com/blog/2008/02/18/a-primer-on-getting-things-done/" onclick="javascript:pageTracker._trackPageview ('/outbound/7pproductions.com');" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/7pproductions.com');">right now</a>, and find yourself a quiet corner to sit in later. I am sure your <a href="http://www.turnoffyourtv.com/" onclick="javascript:pageTracker._trackPageview ('/outbound/www.turnoffyourtv.com');" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.turnoffyourtv.com');">television</a> won’t <a href="http://www.cartoonstock.com/blowup_stock.asp?imageref=vsh0165&amp;artist=Shirvanian,+Vahan&amp;topic=vsh0165+" onclick="javascript:pageTracker._trackPageview ('/outbound/www.cartoonstock.com');" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.cartoonstock.com');">help</a> either. That’s one of the reasons why I haven’t got a television at home.</p>
<p>If you are <a href="http://business-standard.com/common/storypage_c.php?leftnm=10&amp;autono=315737" onclick="javascript:pageTracker._trackPageview ('/outbound/business-standard.com');" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/business-standard.com');">losing money</a> in the stock market, that won’t help either. Finding a good mutual fund to park that money into, can let you forget about the day to day vicissitudes of the market. There are <a href="http://www.getrichslowly.org" onclick="javascript:pageTracker._trackPageview ('/outbound/www.getrichslowly.org');" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.getrichslowly.org');">other</a> <a href="http://www.thesimpledollar.com" onclick="javascript:pageTracker._trackPageview ('/outbound/www.thesimpledollar.com');" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.thesimpledollar.com');">ways</a> to get rich as well.</p>
<p>Automate your bill payments. My cell-phone bill gets paid automatically by <a href="http://209.85.175.104/search?q=cache:CZfyqcPRAKIJ:rbidocs.rbi.org.in/rdocs/ECS/DOCs/19631.doc+Electronic+Clearing+Service&amp;hl=en&amp;ct=clnk&amp;cd=1&amp;gl=in&amp;client=firefox-a" onclick="javascript:pageTracker._trackPageview ('/outbound/209.85.175.104');" onclick="javascript:pageTracker._trackPageview ('/outbound/209.85.175.104');">ECS</a> through my credit card. One less thing to worry about.</p>
<p>I recently found out that I am losing nearly 5000 bucks every year due to late payments. It’s because I pay by cheque which takes 3-4 days for payment realization. Since I tend to remember the due dates for payments, I end up dropping cheques on the last day, which results in late payments. So I have started getting rid of all my credit cards, which cannot be paid through netbanking. One more thing to worry less about every month. Phew.</p>
<p>The whole point of all that is to <a href="http://www.rememberthemilk.com" onclick="javascript:pageTracker._trackPageview ('/outbound/www.rememberthemilk.com');" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.rememberthemilk.com');">get</a> <a href="http://calendar.google.com" onclick="javascript:pageTracker._trackPageview ('/outbound/calendar.google.com');" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/calendar.google.com');">organized</a> <a href="http://www.google.com/notebook" onclick="javascript:pageTracker._trackPageview ('/outbound/www.google.com');" onclick="javascript:pageTracker._trackPageview ('/outbound/www.google.com');">and</a> <a href="http://www.lifehack.org" onclick="javascript:pageTracker._trackPageview ('/outbound/www.lifehack.org');" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.lifehack.org');">cut down</a> on distractions. <strong>The less you worry about the mundane things, the more you can think freely about wonderful new things.</strong></p>
<p>Now after looking at the two essential pre-requisites, let’s take a look at the two essential ingredients for creativity.</p>
<h3 class="post-section"><a name="43.3" title="43.3"></a>Stimuli</h3>
<p>Now when you are both motivated and in a distraction-less zone, what do you do? <strong>Load yourself with information.</strong> Go ahead and read about all the new stuff people are <a href="http://www.techcrunch.com" onclick="javascript:pageTracker._trackPageview ('/outbound/www.techcrunch.com');" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.techcrunch.com');">building</a>, <a href="http://www.sciam.com/" onclick="javascript:pageTracker._trackPageview ('/outbound/www.sciam.com');" onclick="javascript:pageTracker._trackPageview ('/outbound/www.sciam.com');">discovering</a>, <a href="http://www.newscientist.com/" onclick="javascript:pageTracker._trackPageview ('/outbound/www.newscientist.com');" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.newscientist.com');">inventing</a> and <a href="http://www.wired.com/wired/archive/6.03/antigravity.html" onclick="javascript:pageTracker._trackPageview ('/outbound/www.wired.com');" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.wired.com');">fooling around</a> with. You need stimulation - the first ingredient to creative output.</p>
<p>Reading is just one way of stimulating yourself. There are several other ways to do so. Take a look at <a href="http://www.gapingvoid.com/Moveable_Type/archives/000729.html" onclick="javascript:pageTracker._trackPageview ('/outbound/www.gapingvoid.com');" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.gapingvoid.com');">this page</a> by <a href="http://www.gapingvoid.com/Moveable_Type/archives/000009.html" onclick="javascript:pageTracker._trackPageview ('/outbound/www.gapingvoid.com');" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.gapingvoid.com');">Hugh MacLeod</a>, where he talks about the various inspirations for his early back of the business card cartoons. You may also like to read this article he wrote about <a href="http://www.gapingvoid.com/Moveable_Type/archives/000932.html" onclick="javascript:pageTracker._trackPageview ('/outbound/www.gapingvoid.com');" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.gapingvoid.com');">how to be creative</a>. The widget below shows off Hugh&#8217;s latest adventure with cartooning.</p>
<style type="text/css">           div#gapingvoidwidget {      text-align: center; } </style>
<p><script src="http://www.gapingvoid.com/widget/widget.php?filter=n&amp;size=400" type="text/javascript"></script></p>
<p>Attend <a href="http://ted.com/index.php/" onclick="javascript:pageTracker._trackPageview ('/outbound/ted.com');" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/ted.com');">conferences</a>. Be a member of organizations like <a href="http://www.acm.org/" onclick="javascript:pageTracker._trackPageview ('/outbound/www.acm.org');" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.acm.org');">ACM</a>, <a href="http://www.ieee.org/" onclick="javascript:pageTracker._trackPageview ('/outbound/www.ieee.org');" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.ieee.org');">IEEE</a> and keep track of all the research being done in your area of interest. Added benefits of membership are access to <a href="http://ieeexplore.ieee.org/" onclick="javascript:pageTracker._trackPageview ('/outbound/ieeexplore.ieee.org');" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/ieeexplore.ieee.org');">online</a> <a href="http://www.acmqueue.org/" onclick="javascript:pageTracker._trackPageview ('/outbound/www.acmqueue.org');" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.acmqueue.org');">journals</a> and sometimes <a href="http://pd.acm.org/books/saf_books.cfm" onclick="javascript:pageTracker._trackPageview ('/outbound/pd.acm.org');" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/pd.acm.org');">books</a>.</p>
<p>Be on the <a href="http://www.emergentchaos.com/archives/2008/03/quantum_progress.html" onclick="javascript:pageTracker._trackPageview ('/outbound/www.emergentchaos.com');" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.emergentchaos.com');">cutting edge</a>. Look at what’s getting <a href="http://del.icio.us/popular/" onclick="javascript:pageTracker._trackPageview ('/outbound/del.icio.us');" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/del.icio.us');">popular</a> on the <a href="http://reddit.com/r/technology/" onclick="javascript:pageTracker._trackPageview ('/outbound/reddit.com');" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/reddit.com');">technology</a> front. Have a <a href="http://blog.ted.com/2007/08/100_websites_yo.php" onclick="javascript:pageTracker._trackPageview ('/outbound/blog.ted.com');" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/blog.ted.com');">list of resources</a> to check out when you are looking for <a href="http://del.icio.us/search/?fr=del_icio_us&amp;p=idea&amp;type=all" onclick="javascript:pageTracker._trackPageview ('/outbound/del.icio.us');" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/del.icio.us');">ideas</a>. Know <a href="http://www.noodletools.com/debbie/literacies/information/5locate/adviceengine.html" onclick="javascript:pageTracker._trackPageview ('/outbound/www.noodletools.com');" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.noodletools.com');">how to find out more information</a> on a <a href="http://www.42klines.com/2008/03/02/42klines-a-search-engine-for-unix-programmers.html" target="_blank">topic</a>.</p>
<p>Occasionally, you will find yourself in the midst of information overload. When it’s getting too much to handle, follow the advice in <a href="http://www.lifehack.org/articles/productivity/beyond-test-taking-learning-to-handle-information.html" onclick="javascript:pageTracker._trackPageview ('/outbound/www.lifehack.org');" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.lifehack.org');">these</a> <a href="http://www.lifehack.org/articles/productivity/go-on-a-high-information-diet.html" onclick="javascript:pageTracker._trackPageview ('/outbound/www.lifehack.org');" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.lifehack.org');">articles</a> to get the zing back in your life.</p>
<h3 class="post-section"><a name="43.4" title="43.4"></a>Hack Mode</h3>
<p><strong>The second ingredient for creative output is getting into something akin to <a href="http://catb.org/esr/jargon/html/H/hack-mode.html" onclick="javascript:pageTracker._trackPageview ('/outbound/catb.org');" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/catb.org');">hack mode</a>.</strong> Mihaly Csikszentmihalyi (no I don&#8217;t know how to pronounce that) talks about the flow state of consciousness in his book <a href="http://www.amazon.com/exec/obidos/redirect?tag=gp04-20&amp;path=http%3A//www.amazon.com/Flow-Psychology-Experience-Mihaly-Csikszentmihalyi/dp/0060920432" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.amazon.com');">Flow: The Psychology of Optimal Experience</a>. Everyone has their <a href="http://www.lifehack.org/articles/productivity/30-tips-to-rejuvenate-your-creativity.html" onclick="javascript:pageTracker._trackPageview ('/outbound/www.lifehack.org');" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.lifehack.org');">own</a> <a href="http://www.mpdailyfix.com/2006/09/101_ways_to_brew_up_a_great_id.html" onclick="javascript:pageTracker._trackPageview ('/outbound/www.mpdailyfix.com');" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.mpdailyfix.com');">method</a> of <a href="http://www.scottberkun.com/essays/56-creative-thinking-hacks/" onclick="javascript:pageTracker._trackPageview ('/outbound/www.scottberkun.com');" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.scottberkun.com');">getting</a> <a href="http://www.lifehack.org/articles/lifehack/how-to-boost-your-creative-output.html" onclick="javascript:pageTracker._trackPageview ('/outbound/www.lifehack.org');" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.lifehack.org');">into</a> hack mode. It’s usually realized when you have managed to achieve the previous three requirements - motivation, a distraction-less zone and some stimuli (a problem you are trying to solve?).</p>
<p>In this state you become oblivious to everything outside the sphere of the problem you are trying to solve. Your mind is awash with images, flow diagrams - a plasma of information, ideas and imagination. It’s almost like a drug-induced state, which turns into pain and distress, if something unexpectedly yanks you out of it.</p>
<p>I tend to get into hack mode during the night. As an example I have written about a 1000 lines of multi-threaded chat server code, the virtual memory implementation of a toy operating system, a 150ms input to result levenshtein implementation which works with a database of 2.88million strings (a week long hack-mode session) in single hack-mode sessions. Although, these did not involve a huge amount of work, considering what some people are able to achieve in a day, they probably are good examples of work achievable in hack mode.</p>
<p>All that hacking however is preceded by a hack mode for generating or putting together ideas for what needs to be done. It&#8217;s similar except that I am not implementing anything. Just thinking, juggling, <a href="http://www.watt-evans.com/wheredoyougetyourideas.html" onclick="javascript:pageTracker._trackPageview ('/outbound/www.watt-evans.com');" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.watt-evans.com');">combining</a>, and toying with different ideas in my mind.</p>
<p>These are the 4 pillars of a creative jumpstart. There are several articles (linked from this post itself) which talk about creativity, being creative, getting into the <em>zone</em>, etc. I have found that almost all the points they mention belong to <strong>MASH</strong> (motivation, avoid distraction, stimuli and hack mode) in some way or the other.</p>
<p>Just remember <strong>MASH</strong> and apply it in your own life. I am sure each one of you will take a different approach to achieve it. Find your own way out through the maze. There are several exits.</p>
<h3><span class="resources"><a name="43.5" title="43.5"></a>Resources</span></h3>
<p><a href="http://www.amazon.com/Pleasure-Finding-Things-Out-Richard/dp/0465023959/ref=pd_bbs_sr_1?ie=UTF8&amp;s=books&amp;qid=1206458002&amp;sr=8-1" onclick="javascript:pageTracker._trackPageview ('/outbound/www.amazon.com');"><img src="http://www.42klines.com/wp-content/uploads/2008/03/200px-the_pleasure_of_finding_things_out.thumbnail.jpg" style="border: medium none ; padding-right: 20px; padding-top: 10px" /></a><a href="http://www.amazon.com/Lateral-Thinking-Creativity-Perennial-Library/dp/0060903252/ref=pd_bbs_sr_1?ie=UTF8&amp;s=books&amp;qid=1206457902&amp;sr=8-1" onclick="javascript:pageTracker._trackPageview ('/outbound/www.amazon.com');"><img src="http://www.42klines.com/wp-content/uploads/2008/03/lateral_thinking.thumbnail.jpg" style="border: medium none ; padding-right: 20px; padding-top: 10px" /></a><a href="http://www.amazon.com/Flow-Psychology-Experience-Mihaly-Csikszentmihalyi/dp/0060920432/ref=pd_bbs_sr_1?ie=UTF8&amp;s=books&amp;qid=1206457960&amp;sr=8-1" onclick="javascript:pageTracker._trackPageview ('/outbound/www.amazon.com');"><img src="http://www.42klines.com/wp-content/uploads/2008/03/flow.thumbnail.jpg" style="border: medium none ; padding-right: 20px; padding-top: 10px" /></a></p>
<h3></h3>
]]></content:encoded>
			<wfw:commentRss>http://www.42klines.com/2008/03/26/mom-how-do-i-become-more-creative.html/feed</wfw:commentRss>
		<feedburner:origLink>http://www.42klines.com/2008/03/26/mom-how-do-i-become-more-creative.html</feedburner:origLink></item>
		<item>
		<title>20 high performance program design related links</title>
		<link>http://feedproxy.google.com/~r/42klines/~3/9ckH7K0OSqM/20-high-performance-program-design-related-links.html</link>
		<comments>http://www.42klines.com/2008/03/14/20-high-performance-program-design-related-links.html#comments</comments>
		<pubDate>Fri, 14 Mar 2008 16:13:27 +0000</pubDate>
		<dc:creator>Sudhanshu</dc:creator>
		
		<category><![CDATA[Performance]]></category>

		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.42klines.com/2008/03/14/20-high-performance-program-design-related-links.html</guid>
		<description><![CDATA[This is a list of links to various articles, papers etc. related to high performance program design.

What every programmer should know about memory?
There is a lot more to hash functions than they teach you at school.
How to search for the word pen1s in 185 emails every second.
Regular expression matching can be simple and fast
A scalable [...]]]></description>
			<content:encoded><![CDATA[<p>This is a list of links to various articles, papers etc. related to high performance program design.</p>
<ol>
<li><a href="http://udrepper.livejournal.com/19557.html" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/udrepper.livejournal.com');">What every programmer should know about memory?</a></li>
<li><a href="http://sayspy.blogspot.com/2008/02/there-is-lot-more-to-hash-functions.html" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/sayspy.blogspot.com');">There is a lot more to hash functions than they teach you at school.</a></li>
<li><a href="http://mailinator.blogspot.com/2008/01/how-to-search-for-word-pen1s-in-185.html" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/mailinator.blogspot.com');">How to search for the word pen1s in 185 emails every second.</a></li>
<li><a href="http://swtch.com/~rsc/regexp/regexp1.html" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/swtch.com');">Regular expression matching can be simple and fast</a></li>
<li><a href="http://people.freebsd.org/~jasone/jemalloc/bsdcan2006/jemalloc.pdf" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/people.freebsd.org');">A scalable concurrent malloc implementation for FreeBSD</a></li>
<li><a href="http://www.allthingsdistributed.com/2007/12/eventually_consistent.html" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.allthingsdistributed.com');">Eventual consistency</a></li>
<li><a href="http://portal.acm.org/citation.cfm?id=1022596&amp;coll=GUIDE&amp;dl=GUIDE&amp;ret=1" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/portal.acm.org');">Latency lags bandwidth</a></li>
<li><a href="http://pl.atyp.us/content/tech/servers.html" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/pl.atyp.us');">High Performance Server Design</a></li>
<li><a href="http://www.byte.com/abrash/" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.byte.com');">Michael Abrash&#8217;s Graphics Programming Black Book</a></li>
<li><a href="http://www.usenix.org/events/vee05/full_papers/p153-yunhe.pdf" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.usenix.org');">Virtual Machine Showdown: Stack vs Registers</a></li>
<li><a href="http://www.kegel.com/c10k.html" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.kegel.com');">The C10k problem</a></li>
<li><a href="http://judy.sourceforge.net/doc/10minutes.htm" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/judy.sourceforge.net');">Judy Arrays</a></li>
<li><a href="http://en.wikipedia.org/wiki/MapReduce" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/en.wikipedia.org');">Map-Reduce Framework</a></li>
<li><a href="http://en.wikipedia.org/wiki/Amdahl%27s_law" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/en.wikipedia.org');">Amdahl&#8217;s Law</a></li>
<li><a href="http://arstechnica.com/articles/paedia/cpu/pipelining-1.ars" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/arstechnica.com');">Pipelining: An overview - Part I</a></li>
<li><a href="http://arstechnica.com/articles/paedia/cpu/pipelining-2.ars" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/arstechnica.com');">Pipelining: An overview - PartII</a></li>
<li><a href="http://en.wikipedia.org/wiki/CPU_cache" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/en.wikipedia.org');">Wikipedia: CPU Cache</a></li>
<li><a href="http://arstechnica.com/cpu/004/pentium-1/pentium-1-1.html" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/arstechnica.com');">Pentium: An Architectural History - Part I</a></li>
<li><a href="http://arstechnica.com/articles/paedia/cpu/pentium-2.ars" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/arstechnica.com');">Pentium: An Architectural History - Part II</a></li>
</ol>
<p>Ok, so you might be wondering, where&#8217;s the 20th link? I lied. You just get 19. In case anyone has more interesting links related to high performance program design, please do leave them in the comments!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.42klines.com/2008/03/14/20-high-performance-program-design-related-links.html/feed</wfw:commentRss>
		<feedburner:origLink>http://www.42klines.com/2008/03/14/20-high-performance-program-design-related-links.html</feedburner:origLink></item>
		<item>
		<title>Add 42klines search engine to Firefox’s search bar</title>
		<link>http://feedproxy.google.com/~r/42klines/~3/yFAz1r9VZfg/add-42klines-search-engine-to-firefoxs-search-bar.html</link>
		<comments>http://www.42klines.com/2008/03/09/add-42klines-search-engine-to-firefoxs-search-bar.html#comments</comments>
		<pubDate>Sun, 09 Mar 2008 18:35:00 +0000</pubDate>
		<dc:creator>Sudhanshu</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Tools]]></category>

		<category><![CDATA[UNIX]]></category>

		<guid isPermaLink="false">http://www.42klines.com/2008/03/09/add-42klines-search-engine-to-firefoxs-search-bar.html</guid>
		<description><![CDATA[I wanted an easier way to get to the 42klines search engine I created for UNIX programmers. So, I found out a few ways to put it on the Firefox search bar (IE7 supported as well). There are easy ways and another slightly more hands-on, pull up your sleeves, grab the tools and get to [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted an easier way to get to the <a href="http://www.42klines.com/2008/03/02/42klines-a-search-engine-for-unix-programmers.html" target="_blank">42klines search engine</a> I created for UNIX programmers. So, I found out a few ways to put it on the Firefox search bar (IE7 supported as well). There are easy ways and another slightly more hands-on, pull up your sleeves, grab the tools and get to work type.</p>
<p><strong>The 3-step Install</strong><br />
First the easy one. Mozilla provides a Firefox extension called <a href="https://addons.mozilla.org/en-US/firefox/addon/3682" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/addons.mozilla.org');">Add to Search Bar</a>, which can apparently add any search bar on any website to the Firefox search bar. These are the steps:</p>
<ul>
<li>Install the extension.</li>
<li>Right click on the 42klines search bar and select the &#8220;Add to Search Bar&#8230;&#8221; option</li>
<li>Change the name of the engine in the dialog box that pops up, if you like and you are done.</li>
</ul>
<p>More details <a href="http://cybernetnews.com/2006/10/29/add-any-search-field-to-firefoxs-search-box/" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/cybernetnews.com');">here</a>. So that was the easy way. You can use this method to add a search bar from any web page to your browser&#8217;s search bar. If that worked for you and you are not interested in knowing anymore, skip the rest of the post.</p>
<p><strong>Generate Plugin &amp; Install<br />
</strong>There is another way to add a search engine to your Firefox search bar. There is an online search engine plugin generator available for generating search plugins at <a href="http://www.searchplugins.net" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.searchplugins.net');">www.searchplugins.net</a>. Here are the steps to follow:</p>
<ol>
<li>Register on the www.searchplugins.net website</li>
<li>Go to the search engine page and make a search for the word TEST.</li>
<li>When the search results appear, copy the URL in the browser&#8217;s location bar. For the 42klines search engine this is the <a href="http://www.42klines.com/unix_search.html?cref=http%3A%2F%2Fwww.42klines.com%2Fsearch%2Funix%2F42klines_unix_context.xml&amp;cof=FORID%3A11&amp;q=TEST&amp;sa=Search#1252" target="_blank">URL</a>.</li>
<li>Go to the <a href="http://www.searchplugins.net/generate.aspx" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.searchplugins.net');">plugin generator</a> page and paste the URL in the &#8220;Search URL:&#8221; field of the form.</li>
<li>Fill up the rest of the form and create the search engine plugin.</li>
<li>You will be given the option to add the search engine plugin to the search bar. Click on the link and you are done.</li>
</ol>
<p>This method is useful for people who provide a search engine of their own. Their search engine will now be listed among all the other search engines listed on www.searchplugins.net if they made it public. You can also grab the generated plugin&#8217;s source file in the OpenSearch XML format from your account on this site. This allows you to use the source file to provide a link on your website, which triggers a javascript, which installs the search engine to a user&#8217;s browser search bar easily from your own website.</p>
<p><strong>Getting your hands dirty<br />
</strong>Now how about getting down to brass tacks and do it the hard way. Mozilla provides a way to easily add search engines from their <a href="https://addons.mozilla.org/en-US/firefox/browse/type:4" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/addons.mozilla.org');">search-engine add page</a>. But what if the search engine you want to add is not listed among those. Or what if you have created your own search engine and want to allow people to add it to their browser&#8217;s search bar through a link on your web page? Read on.</p>
<p>To allow adding your search engine to a user&#8217;s Firefox browser search bar from your web page, you need to follow these two steps:</p>
<ol>
<li>Create an icon for your search engine and <a href="http://software.hixie.ch/utilities/cgi/data/data" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/software.hixie.ch');">encode it</a> in BASE64.</li>
<li>Create a search engine <a href="http://developer.mozilla.org/en/docs/Creating_OpenSearch_plugins_for_Firefox" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/developer.mozilla.org');">descriptor file</a>.</li>
<li>Provide a <a href="http://developer.mozilla.org/en/docs/Adding_search_engines_from_web_pages" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/developer.mozilla.org');">link on your website</a> which installs the search engine through Javascript.</li>
<li>Optionally add search engine plugin <a href="http://developer.mozilla.org/en/docs/Creating_OpenSearch_plugins_for_Firefox#Autodiscovery_of_search_plugins" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/developer.mozilla.org');">auto-discovery support</a> on your website.</li>
</ol>
<p>Older browsers did not have the support for search bars, so you need not worry about them. Firefox 1.5 used another format called <a href="http://developer.apple.com/macosx/sherlock/" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/developer.apple.com');">Sherlock</a> for adding a search engine to the browser search bar. Newer browsers (Firefox 2.0+ &amp; IE7) use a format called <a href="http://www.opensearch.org/" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.opensearch.org');">OpenSearch</a>. The above links describe creating a search engine plugin using OpenSearch. OpenSearch allows a lot more than described in the links present in the above steps. Read through the documentation in case you are interested to know more.</p>
<p><strong>Resources</strong><br />
<a href="http://mycroft.mozdev.org/index.html" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/mycroft.mozdev.org');">Mozilla Mycroft Project</a>: Search engine plugins for Firefox &amp; IE7<br />
<a href="http://mycroft.mozdev.org/generator/" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/mycroft.mozdev.org');">Mycroft Plugin Generator</a>: Advanced search engine plugin generator<br />
<a href="http://mycroft.mozdev.org/submitos.html" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/mycroft.mozdev.org');">Mycroft Search Engine Submission</a>: Submit plugin to the Mycroft directory (OpenSearch format)<br />
<a href="http://mycroft.mozdev.org/submit.html" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/mycroft.mozdev.org');">Mycroft Sherlock Submission</a>: Mycroft page for submitting legacy Sherlock plugins<br />
<a href="http://developer.mozilla.org/en/docs/Extensions" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/developer.mozilla.org');">Mozilla Extensions</a>: Create a Firefox extension if you like.<br />
<a href="http://software.hixie.ch/utilities/cgi/data/data" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/software.hixie.ch');">Encode data in Base64</a>: Online tool you can use for encoding the search engine image in Base64.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.42klines.com/2008/03/09/add-42klines-search-engine-to-firefoxs-search-bar.html/feed</wfw:commentRss>
		<feedburner:origLink>http://www.42klines.com/2008/03/09/add-42klines-search-engine-to-firefoxs-search-bar.html</feedburner:origLink></item>
		<item>
		<title>42klines: A Search Engine For UNIX Programmers</title>
		<link>http://feedproxy.google.com/~r/42klines/~3/xHZ-NZwa4mk/42klines-a-search-engine-for-unix-programmers.html</link>
		<comments>http://www.42klines.com/2008/03/02/42klines-a-search-engine-for-unix-programmers.html#comments</comments>
		<pubDate>Sun, 02 Mar 2008 14:13:24 +0000</pubDate>
		<dc:creator>Sudhanshu</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[UNIX]]></category>

		<category><![CDATA[Unix Programming Search Tools]]></category>

		<guid isPermaLink="false">http://www.42klines.com/2008/03/02/42klines-a-search-engine-for-unix-programmers/</guid>
		<description><![CDATA[Are you a UNIX programmer? Then this may be very useful to you.
Google has offered the ability to create a customized search engine (CSE) which searches a list of sites given by you. I decided to take it for a test drive. I ended up with a surprisingly useful search engine customized to serve UNIX [...]]]></description>
			<content:encoded><![CDATA[<p>Are you a UNIX programmer? Then this may be very useful to you.</p>
<p>Google has offered the ability to create a customized search engine (CSE) which searches a list of sites given by you. I decided to take it for a test drive. I ended up with a surprisingly useful search engine customized to serve UNIX programmers. You can find the search engine box at the top of this blog. It currently searches more than 400 websites which are useful for UNIX programmers. You will find a search box which looks like this on the top of this blog.</p>
<p style="text-align: center"><img src="http://www.42klines.com/images/customsearch.gif" alt="Unix Programmer's Search Engine" border="0" width="336" height="77" /></p>
<h3>Table of Contents</h3>
<ul>
<li><a href="http://www.42klines.com/2008/03/02/42klines-a-search-engine-for-unix-programmers.html#29.1">Why is it useful?</a></li>
<li><a href="http://www.42klines.com/2008/03/02/42klines-a-search-engine-for-unix-programmers.html#29.2">What websites does 42klines search?</a></li>
<li><a href="http://www.42klines.com/2008/03/02/42klines-a-search-engine-for-unix-programmers.html#29.3">Can I put this search engine on my own website?</a></li>
<li><a href="http://www.42klines.com/2008/03/02/42klines-a-search-engine-for-unix-programmers.html#29.4">Can I add my own bookmarks to 42klines?</a></li>
<li><a href="http://www.42klines.com/2008/03/02/42klines-a-search-engine-for-unix-programmers.html#29.5">Custom search engine flavors</a></li>
<li><a href="http://www.42klines.com/2008/03/02/42klines-a-search-engine-for-unix-programmers.html#29.6">Getting your hands dirty</a></li>
<li><a href="http://www.42klines.com/2008/03/02/42klines-a-search-engine-for-unix-programmers.html#29.7">Resources</a></li>
</ul>
<h3 class="post-section"><a title="29.1" name="29.1"></a>Why is it useful?</h3>
<p>If you do a Google web search, the search engine cannot identify the context in which you have done the search, immediately.  A keyword such as &#8220;signals&#8221; can imply different things (traffic signals, hand signals, UNIX signals?). In order to be useful to all people, Google gives search results from different contexts, if applicable, in its search results. This means Google web search can end up wasting your time (you&#8217;ll have to filter results manually) while reducing the relevance of results in your context. A CSE, however returns results related to exactly what you want.</p>
<p>I realized the usefulness of this, while discussing the semantics of handling signals by multi-threaded processes in Linux, with a colleague recently. The problem we were facing was related to the way gdb was handling signals received by a multi-threaded process, we were tracing. We were not sure about the current Linux semantics so we decided to search. Co-incidentally I had added around 200 websites to this custom search engine related to UNIX programming a few days ago. So I decided to give it a test drive. I searched for <a href="http://www.42klines.com/unix_search.html?cx=014118245657335175305%3Ar-sg6wwbckg&amp;cof=FORID%3A11&amp;q=signals+thread&amp;sa=Search#927" title="Custom Search Engine">signals thread</a>. The top 5 results from the CSE gave me more than I needed to know, about Linux signal handling in multi-threaded processes. I compared the results with Google <http: web_search.html?domains="www.42klines.com&amp;q=signals+thread&amp;sitesearch=&amp;sa=Search&amp;client=pub-8629922327029409&amp;forid=1&amp;channel=9848564822&amp;ie=ISO-8859-1&amp;oe=ISO-8859-1&amp;safe=active&amp;flav=0000&amp;sig=mQ8NkOVduWY_JUnD&amp;cof=GALT%3A%23008000%3BGL%3A1%3BDIV%3A%23336699%3BVLC%3A663399%3BAH%3Acenter%3BBGC%3AFFFFFF%3BLBGC%3A336699%3BALC%3A0000FF%3BLC%3A0000FF%3BT%3A000000%3BGFNT%3A0000FF%3BGIMP%3A0000FF%3BFORID%3A11&amp;hl=en">web search, and found that a <a href="http://www.linuxjournal.com/article/3985" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.linuxjournal.com');">very good article</a> related to this topic, was not present at all in the <a href="http://www.42klines.com/web_search.html?domains=www.42klines.com&amp;q=signals+thread&amp;sitesearch=&amp;sa=Search&amp;client=pub-8629922327029409&amp;forid=1&amp;channel=9848564822&amp;ie=ISO-8859-1&amp;oe=ISO-8859-1&amp;safe=active&amp;flav=0000&amp;sig=mQ8NkOVduWY_JUnD&amp;cof=GALT%3A%23008000%3BGL%3A1%3BDIV%3A%23336699%3BVLC%3A663399%3BAH%3Acenter%3BBGC%3AFFFFFF%3BLBGC%3A336699%3BALC%3A0000FF%3BLC%3A0000FF%3BT%3A000000%3BGFNT%3A0000FF%3BGIMP%3A0000FF%3BFORID%3A11&amp;hl=en" target="_blank">first</a> <a href="http://www.google.com/custom?q=signals+thread&amp;hl=en&amp;safe=active&amp;client=pub-8629922327029409&amp;channel=9848564822&amp;cof=FORID:11%3BGL:1%3BLBGC:336699%3BLC:%230000ff%3BVLC:%23663399%3BGFNT:%230000ff%3BGIMP:%230000ff%3BDIV:%23336699%3B&amp;domains=www.42klines.com&amp;sig=mQ8NkOVduWY_JUnD&amp;flav=0000&amp;ad=w9&amp;oe=ISO-8859-1&amp;start=10&amp;sa=N" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.google.com');">few</a> <a href="http://www.google.com/custom?q=signals+thread&amp;hl=en&amp;safe=active&amp;client=pub-8629922327029409&amp;channel=9848564822&amp;cof=FORID:11%3BGL:1%3BLBGC:336699%3BLC:%230000ff%3BVLC:%23663399%3BGFNT:%230000ff%3BGIMP:%230000ff%3BDIV:%23336699%3B&amp;domains=www.42klines.com&amp;sig=mQ8NkOVduWY_JUnD&amp;flav=0000&amp;ad=w9&amp;oe=ISO-8859-1&amp;start=20&amp;sa=N" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.google.com');">pages</a> of the web search results! Moreover, I found that almost all the CSE&#8217;s results in the first page were directly relevant to what I wanted to know, while the quality of web search results wasn&#8217;t that high.<br />
</http:></p>
<p>The results on the web weren&#8217;t that bad, but they were not the best either. Google has done a good job with the custom search engine offering. Take a look at the results from the first page of web search below. Then try the <a href="http://www.42klines.com/unix_search.html?cx=014118245657335175305%3Ar-sg6wwbckg&amp;cof=FORID%3A11&amp;q=signals+thread&amp;sa=Search#927" target="_blank">42klines search</a>. Do you see the difference?</p>
<p style="text-align: center"><img src="http://www.42klines.com/images/websearchresults.gif" alt="Results of Web Search" align="middle" border="0" width="463" height="757" /></p>
<p class="image-caption" style="text-align: center">No! I am not interested in girls who give me mixed signals.</p>
<h3 class="post-section"><a title="29.2" name="29.2"></a>What websites does 42klines search?</h3>
<p>For a start I have seeded the engine with more than 400 websites which can be useful to UNIX programmers. They loosely fall in the following categories:</p>
<ol>
<li>Research organizations (<a href="http://ieeexplore.ieee.org" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/ieeexplore.ieee.org');">IEEE</a>, <a href="http://www.acm.org/publications/" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.acm.org');">ACM</a>, <a href="http://www.citeseer.org" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.citeseer.org');">Citeseer</a> etc.)</li>
<li>UNIX/Programming Magazines (<a href="http://www.ddj.com/" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.ddj.com');">DDJ</a>, <a href="http://www.linuxjournal.com" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.linuxjournal.com');">Linux Journa</a>l, <a href="http://www.lwn.net" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.lwn.net');">LWN</a> , <a href="http://kerneltrap.org" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/kerneltrap.org');">KernelTrap</a> etc.)</li>
<li>Forums (<a href="http://groups.google.com/group/alt.os.development/*" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/groups.google.com');">Interesting</a> <a href="http://groups.google.com/group/comp.unix.programmer" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/groups.google.com');">google</a> <a href="http://groups.google.com/group/alt.os.assembly" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/groups.google.com');">groups</a>, etc)</li>
<li>OS development resources (<a href="http://www.nondot.org/sabre/os/" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.nondot.org');">NonDot</a>, <a href="http://www.sandpile.org" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.sandpile.org');">Sandpile</a>, <a href="http://www.x86.org" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.x86.org');">x86</a> etc)</li>
<li>Bookmarking sites (<a href="http://reddit.com/r/programming" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/reddit.com');">Reddit</a>, <a href="http://del.icio.us/tag/kernel" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/del.icio.us');">Del.icio.us</a>)</li>
<li>Free web hosted books (<a href="http://www.xml.com/ldd/chapter/book/" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.xml.com');">Linux Device Drivers</a>, <a href="http://openbookproject.net" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/openbookproject.net');">OpenBookProject</a> etc.)</li>
<li>Document hosting sites (<a href="http://www.scribd.com/category/Computer/UNIX" onclick="javascript:pageTracker._trackPageview ('/outbound/www.scribd.com');">Scribd</a>, <a href="http://en.wikipedia.org/wiki" onclick="javascript:pageTracker._trackPageview ('/outbound/en.wikipedia.org');">Wikipedia</a>, <a href="http://www.howtoforge.com" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.howtoforge.com');">Linux HOWTOs</a> etc.)</li>
<li>Blogs and personal websites hosting useful programming information (<a href="http://blog.rlove.org" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/blog.rlove.org');">Robert Love</a>, <a href="http://udrepper.livejournal.com" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/udrepper.livejournal.com');">Ulrich Drepper</a> etc.)</li>
<li>University courses available online and useful for UNIX programmers (<a href="http://ocw.mit.edu/OcwWeb/Electrical-Engineering-and-Computer-Science" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/ocw.mit.edu');">MIT Open Courseware</a> etc.)</li>
<li>Application hosting/indexing websites (<a href="http://sourceforge.net" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/sourceforge.net');">Sourceforge</a>, <a href="http://directory.fsf.org" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/directory.fsf.org');">FSF</a> etc.)</li>
<li>Conferences (<a href="http://www.usenix.org/" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.usenix.org');">USENIX</a>, <a href="http://en.wikipedia.org/wiki/Linux_conference" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/en.wikipedia.org');">Linux Conferences</a> etc.)</li>
<li>Miscellaneous pages</li>
</ol>
<h3 class="post-section"><a title="29.3" name="29.3"></a>Can I put this search engine on my own website?</h3>
<p>Yes, you can easily do that. The search engine hosted on this website is a <a href="http://www.google.com/coop/docs/cse/cref.html" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.google.com');">linked CSE</a>. Another flavor of it called the stored CSE, is hosted in Google&#8217;s databases. The differences between the two flavors have been detailed later on in the post. You can easily <a href="http://fusion.google.com/add?hl=en&amp;moduleurl=http%3A%2F%2Fwww.google.com%2Fcoop%2Fapi%2F014118245657335175305%2Fcse%2Fr-sg6wwbckg%2Fgadget" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/fusion.google.com');">add</a> the stored CSE flavor to your <a href="http://www.google.com.ig" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.google.com.ig');">iGoogle</a> page as a gadget. You can <a href="http://pastie.caboo.se/pastes/160053" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/pastie.caboo.se');">download</a> this code to put the 42klines search engine on your blog or website. Customize the look in whatever way you want. The search results are hosted on a page on this website, because that page requires another snippet of code from Google. If you want to host the results on your website, let me know. I&#8217;ll provide the code necessary to do so. You can skip the rest of the post, if you are not interested in knowing how the search engine works. If you want to add your own bookmarks useful for UNIX programmers in the 42klines search engine, read on. A few useful resources are listed at the end of this post.</p>
<h3 class="post-section"><a title="29.4" name="29.4"></a>Can I add my own bookmarks to 42klines?</h3>
<p>Whenever I find good links or websites useful to me as a UNIX programmer I plan to add them to this search engine, for everyone&#8217;s benefit. The list of websites which are currently indexed can be given to Google in an <a href="http://www.google.com/coop/docs/cse/label_file.html" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.google.com');">annotation file</a> in the XML format. The annotation file for 42klines search engine is hosted in a <a href="http://subversion.tigris.org/" onclick="javascript:pageTracker._trackPageview ('/outbound/subversion.tigris.org');">Subversion</a> repository:  <a href="http://svn2.assembla.com/svn/42klines_search" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/svn2.assembla.com');">http://svn2.assembla.com/svn/42klines_search</a> on Assembla. <a href="http://www.assembla.com" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.assembla.com');">Assembla</a> hosts subversion repositories for projects. If you are interested in adding more links to 42klines, send a mail to me at <strong>sudhanshu.goswami at 42klines dot com</strong>. I&#8217;ll send an invite to you from Assembla.  Checkout the 42klines search engine&#8217;s websites list by running this command:</p>
<p class="code-block"><code>svn checkout  http://svn2.assembla.com/svn/42klines_search</code></p>
<p>If you prefer GUIs, you can also use <a href="http://rapidsvn.tigris.org/" onclick="javascript:pageTracker._trackPageview ('/outbound/rapidsvn.tigris.org');">RapidSVN</a> on Linux to do the same. The 42klines search engine on this website is a linked CSE. It has a stored CSE flavor as well. The difference between the two flavors are detailed in the next section. List of websites to be searched are maintained in a different way for each flavor. Going forward, I plan to update the linked CSE first, while periodically bringing the stored CSE in sync with it. I maintain two flavors because, it is easy to add the stored CSE to iGoogle as a gadget.</p>
<h3 class="post-section"><a title="29.5" name="29.5"></a>Custom Search Engine Flavors</h3>
<p>The table below describes the differences between a linked CSE and a stored CSE.</p>
<p></p>
<table class="wptable rowstyle-alt" id="wptable-2"  cellspacing="1">
	<thead>
	<tr>
		<th class="sortable" style="width:300px" align="left">Stored Custom Search Engine</th>
		<th class="sortable" style="width:300px" align="left">Linked Custom Search Engine</th>
	</tr>
	</thead>
	<tr>
		<td style="width:300px" align="left">Can be built using wizards hosted <a href="http://www.google.com/coop/manage/cse/create/1" onclick="javascript:pageTracker._trackPageview ('/outbound/www.google.com');">here</a>.</td>
		<td style="width:300px" align="left">Metafiles can only be created manually.</td>
	</tr>
	<tr class="alt">
		<td style="width:300px" align="left">Websites searched are stored in Google's database.</td>
		<td style="width:300px" align="left">Websites searched are stored in an annotation file hosted on your server.</td>
	</tr>
	<tr>
		<td style="width:300px" align="left">Websites added to search engine database get immediately reflected in the search results.</td>
		<td style="width:300px" align="left">Websites added to annotation files will get reflected in the search results on the next refresh by Google. To immediately refresh or test annotation file, you can use this <a href="http://www.google.com/coop/cse/cref" onclick="javascript:pageTracker._trackPageview ('/outbound/www.google.com');">tool</a>.</td>
	</tr>
	<tr class="alt">
		<td style="width:300px" align="left">Maximum number of sites = 5000.</td>
		<td style="width:300px" align="left">Multiple annotation files allowed. Each file's max size = 3MB. Total file sizes <= 10 MB.</td>
	</tr>
	<tr>
		<td style="width:300px" align="left">Get their own Google hosted web pages like <a href="http://www.google.com/coop/cse?cx=014118245657335175305%3Ar-sg6wwbckg" onclick="javascript:pageTracker._trackPageview ('/outbound/www.google.com');">this</a>.</td>
		<td style="width:300px" align="left">No home page for a linked CSE created on Google. You can create your own home page for it.</td>
	</tr>
	<tr class="alt">
		<td style="width:300px" align="left">People can volunteer to contribute from a stored CSE's home page.</td>
		<td style="width:300px" align="left">This option is not available for a linked CSE.</td>
	</tr>
	<tr>
		<td style="width:300px" align="left">Restricted in number of things possible.</td>
		<td style="width:300px" align="left">Be creative. You can customize your annotation files on the fly. <a href="http://www.google.com/coop/docs/cse/cse_file.html" onclick="javascript:pageTracker._trackPageview ('/outbound/www.google.com');">How?</a> You can switch from a stored CSE to a linked CSE like <a href="http://www.google.com/coop/docs/cse/cx_cref_transition.html" onclick="javascript:pageTracker._trackPageview ('/outbound/www.google.com');">this</a>.</td>
	</tr>
	<tr class="alt">
		<td style="width:300px" align="left">Google provides links to add this kind of an engine easily to your blog or iGoogle home page. E.g. use <a href="http://fusion.google.com/add?hl=en&amp;moduleurl=http%3A%2F%2Fwww.google.com%2Fcoop%2Fapi%2F014118245657335175305%2Fcse%2Fr-sg6wwbckg%2Fgadget" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/fusion.google.com');">this</a> to add it to your iGoogle page.</td>
		<td style="width:300px" align="left">Linked CSE has to be manually added to a website. E.g. Linked CSE flavor of 42klines search engine can be added by <a href="http://pastie.caboo.se/pastes/160053/download" onclick="javascript:pageTracker._trackPageview ('/outbound/pastie.caboo.se');">downloading</a> and adding this <a href="http://pastie.caboo.se/pastes/160053" onclick="javascript:pageTracker._trackPageview ('/outbound/pastie.caboo.se');">piece of code</a> to your website.</td>
	</tr>
</table><p>
</p>
<h3 class="post-section"><a title="29.6" name="29.6"></a>Getting your hands dirty</h3>
<p>This section is just a blurb about things to know, while working with Google&#8217;s custom search engine. I&#8217;ll list them down pointwise.</p>
<ol>
<li>Opera&#8217;s latest version does not seem to be supported. Some features like saving options for the search engine worked, but the &#8220;Save&#8221; button got permanently disabled after saving. These kinds of problems may occur if you are using uncommon browsers. YMMW.</li>
<li>I tried to replace the context file of the stored search engine with that of the linked search engine using the Advanced tab of the search engine&#8217;s wizard interface, however it did not work. So, no home page for the linked CSE could be created on Google.</li>
<li>If you are not trying to customize a search engine in non-traditional ways, and just want a search box for your blog/homepage, you are better off sticking to a Stored custom search engine. However, if you have got special needs or have more than 5000 websites to search, you&#8217;ll have to use a linked search engine.</li>
<li>Google&#8217;s custom search engines can be customized to a great extent to give highly targeted results. This can be achieved by assigning topics to websites and labeling them. Labels can be used to tweak the search results in the favor of websites stamped with a particular label or completely provide search results only from websites stamped with that label. Further a boost factor can be associated with websites to boost search results from them. You can refer to this CSE <a href="http://www.google.com/coop/docs/cse/glossary.html" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.google.com');">glossary</a>, if you are having trouble following these terms.</li>
<li>Google&#8217;s management interface for stored CSEs does not provide the ability to assign labels, boost strengths for some websites, add filters, created nested search engines etc. You can do all of these with stored CSEs, but you will have to first download the annotation file for the stored websites and the context file for your stored search engine. Then you will have to edit them manually and upload them. This can be done from the Advanced tab of the management interface.</li>
</ol>
<h3><span class="resources"><a title="29.7" name="29.7"></a>Resources</span></h3>
<p>42klines CSE: <a href="http://pastie.caboo.se/pastes/160053" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/pastie.caboo.se');">Download code to put on your website here</a><br />
<a href="http://fusion.google.com/add?hl=en&amp;moduleurl=http%3A%2F%2Fwww.google.com%2Fcoop%2Fapi%2F014118245657335175305%2Fcse%2Fr-sg6wwbckg%2Fgadget" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/fusion.google.com');">42klines iGoogle gadget</a>: Add this search engine to your iGoogle page<br />
<a href="http://svn2.assembla.com/svn/42klines_search" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/svn2.assembla.com');">42klines subversion repository</a><br />
<a href="http://www.coopdir.com" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.coopdir.com');">Coopdir</a>: Directory of custom search engines.<br />
<a href="http://www.google.com/coop/cse/examples/GooglePicks" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.google.com');">GooglePicks</a>: Picked custom search engines by Google.<br />
<a href="http://www.rubycorner.com/" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.rubycorner.com');">RubyCorner</a>: A custom search engine for Ruby programmers.<br />
<a href="http://www.google.com/coop/cse?cx=010104417661136834118%3Aat1-hsftvfo" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.google.com');">Python CSE</a>: A custom search engine for Python programmers.<br />
<a href="http://www.google.com/coop/cse?cx=002165917076592449621%3Ay8jmiivon3o" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.google.com');">Linux</a>: A custom search engine for linux users created by a sysadmin.</p>
<p><em><strong>Update:</strong> Some cleanups done to the post. Added a table of contents, but unfortunately the anchor links did not work as expected. Still trying to figure out how to fix this. [Mar 2: Fixed. At the cost of breaking previous permalinks. Please update any bookmarks to permanent links. This site is going through some initial growing pains.]  </em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.42klines.com/2008/03/02/42klines-a-search-engine-for-unix-programmers.html/feed</wfw:commentRss>
		<feedburner:origLink>http://www.42klines.com/2008/03/02/42klines-a-search-engine-for-unix-programmers.html</feedburner:origLink></item>
		<item>
		<title>Hello world!</title>
		<link>http://feedproxy.google.com/~r/42klines/~3/3YDyqgqljy0/hello-world.html</link>
		<comments>http://www.42klines.com/2008/02/24/hello-world.html#comments</comments>
		<pubDate>Sun, 24 Feb 2008 14:05:28 +0000</pubDate>
		<dc:creator>Sudhanshu</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.42klines.com/2008/02/24/hello-world/</guid>
		<description><![CDATA[42klines is live!
Keeping tradition with the first introductory program code snippet, I am preserving the title of this post to Hello World! which Wordpress helpfully provided. After all software is what this blog is all about.
As mentioned in the about page of this blog, this blog is meant to record my own experiences when playing with software, writing [...]]]></description>
			<content:encoded><![CDATA[<p><font color="#e00000">42klines </font><font color="#000000">is live!</font></p>
<p>Keeping tradition with the first introductory program code snippet, I am preserving the title of this post to Hello World! which Wordpress helpfully provided. After all software is what this blog is all about.</p>
<p>As mentioned in the <a href="http://www.42klines.com/about">about</a> page of this blog, this blog is meant to record my own experiences when playing with software, writing code, working with people and exploring new ideas. If you find value in whatever you find here, please leave your comments, insights and your own experiences. The posts on this blog may not appear regularly, as I do not plan to blog     according to a maintained schedule. I&#8217;ll blog about only those things that I consider valuable to anyone technically or personally. People interested in systems programming, algorithms, performance and software design in general may find the blog most useful. Sometimes blog posts may be about new ideas that I am pondering upon, so anyone interested in opening a startup may be interested as well. I&#8217;ll write more about why I&#8217;d like to give away ideas like this in a later post. I hope to work on any posts here on weekends so most of the time they may appear on Saturday or Sundays.</p>
<p>To keep track of any new content, you can grab the RSS feed. In case you haven&#8217;t used any RSS feed reader as yet, I recommend <a href="http://www.google.com/reader" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.google.com');">Google Reader</a>. Firefox users may find this <a href="http://www.markdbd.com/proyectos/google_reader_notifier/" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.markdbd.com');">extension</a> useful. You may also want to try the up and coming <a href="http://fav.or.it/" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/fav.or.it');">fav.or.it</a> which is in closed beta for now. If you register on the website you may get an invitation. Do let me know how it fared in your evaluation.</p>
<p>In case you don&#8217;t like a web based reader, you can try <a href="http://www.mozilla.com/thunderbird/" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.mozilla.com');">Mozilla Thunderbird</a> (though it has some quirks of its own).</p>
<p><em><strong>Update (Mar 2, 2008):</strong></em> <em>Here is a <a href="http://www.webware.com/8301-1_109-9881104-2.html?part=rss&amp;tag=feed&amp;subj=Webware" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.webware.com');">review</a> of fav.or.it.<br />
</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.42klines.com/2008/02/24/hello-world.html/feed</wfw:commentRss>
		<feedburner:origLink>http://www.42klines.com/2008/02/24/hello-world.html</feedburner:origLink></item>
	</channel>
</rss><!-- Dynamic Page Served (once) in 5.101 seconds -->

