<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>r4g54g4r's h4ckl0g</title>
	<atom:link href="http://ragsagar.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://ragsagar.wordpress.com</link>
	<description>an0th3r h4ck3r's w3blog</description>
	<lastBuildDate>Wed, 01 Feb 2012 02:24:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='ragsagar.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>r4g54g4r's h4ckl0g</title>
		<link>http://ragsagar.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://ragsagar.wordpress.com/osd.xml" title="r4g54g4r&#039;s h4ckl0g" />
	<atom:link rel='hub' href='http://ragsagar.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Fed up with rumors about Anna University results!</title>
		<link>http://ragsagar.wordpress.com/2012/01/10/fed-up-with-rumours-about-anna-university-results/</link>
		<comments>http://ragsagar.wordpress.com/2012/01/10/fed-up-with-rumours-about-anna-university-results/#comments</comments>
		<pubDate>Tue, 10 Jan 2012 17:12:20 +0000</pubDate>
		<dc:creator>Rag Sagar.V രാഗ് സാഗര്‍.വി</dc:creator>
				<category><![CDATA[My Thoughts]]></category>
		<category><![CDATA[Anna]]></category>
		<category><![CDATA[BE/Btech]]></category>
		<category><![CDATA[expected date]]></category>
		<category><![CDATA[nov/dec]]></category>
		<category><![CDATA[results]]></category>
		<category><![CDATA[University]]></category>

		<guid isPermaLink="false">http://ragsagar.wordpress.com/?p=280</guid>
		<description><![CDATA[Last month itself there were talks that the final year BE/BTech results will be available by January first or second week. When it became January there were posts in various unofficial blogs that the results will be coming out by January 4th. Blogs said that on worst case it will be postponed to January 5th [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ragsagar.wordpress.com&amp;blog=4629970&amp;post=280&amp;subd=ragsagar&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Last month itself there were talks that the final year BE/BTech results will be available by January first or second week. When it became January there were posts in various unofficial blogs that the results will be coming out by January 4th. Blogs said that on worst case it will be postponed to January 5th and they even stated the time University will be updating it in the database. But days passed, nothing happened. And this cycle is still going on. I was thinking how much traffic will they be getting during these days. I just wanted to know how much clicks they will be getting for using those particular keywords in their posts. Even if they are providing fake news they will be getting lots of hits. Even i am checking those blogs twice daily. They are exploiting students&#8217; eagerness to know about their examination results. Let me check the increase in number of traffic to this blog after posting this. I will come up with an update to this post if there is considerable increase in number of clicks.<br />
BTW, now one of the University site says that the results are expected to come out by January 12th.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ragsagar.wordpress.com/280/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ragsagar.wordpress.com/280/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ragsagar.wordpress.com/280/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ragsagar.wordpress.com/280/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ragsagar.wordpress.com/280/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ragsagar.wordpress.com/280/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ragsagar.wordpress.com/280/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ragsagar.wordpress.com/280/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ragsagar.wordpress.com/280/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ragsagar.wordpress.com/280/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ragsagar.wordpress.com/280/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ragsagar.wordpress.com/280/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ragsagar.wordpress.com/280/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ragsagar.wordpress.com/280/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ragsagar.wordpress.com&amp;blog=4629970&amp;post=280&amp;subd=ragsagar&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ragsagar.wordpress.com/2012/01/10/fed-up-with-rumours-about-anna-university-results/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1a7e8963f353728017ca6f72a2e5ee04?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ragsagar</media:title>
		</media:content>
	</item>
		<item>
		<title>PHP script to generate Indian Flag</title>
		<link>http://ragsagar.wordpress.com/2011/08/21/php-script-to-generate-indian-flag/</link>
		<comments>http://ragsagar.wordpress.com/2011/08/21/php-script-to-generate-indian-flag/#comments</comments>
		<pubDate>Sun, 21 Aug 2011 16:13:03 +0000</pubDate>
		<dc:creator>Rag Sagar.V രാഗ് സാഗര്‍.വി</dc:creator>
				<category><![CDATA[Scripts]]></category>
		<category><![CDATA[gd library]]></category>
		<category><![CDATA[indian flag]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://ragsagar.wordpress.com/?p=276</guid>
		<description><![CDATA[A script written by Adhil Azeez to generate Indian flag in php. Actually he wanted to share the code here on Independence day. But i was not able to post it that day. After that a series of things happened that prevented me from getting online and updating my blog. So here is the code.. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ragsagar.wordpress.com&amp;blog=4629970&amp;post=276&amp;subd=ragsagar&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A script written by <a href="http://www.facebook.com/adhilnv" title="Adhil's facebook profile" target="_blank">Adhil Azeez</a> to generate Indian flag in php. Actually he wanted to share the code here on Independence day. But i was not able to post it that day. After that a series of things happened that prevented me from getting online and updating my blog. So here is the code..</p>
<p><pre class="brush: php;">
&lt;?php
/*
 * Filename: tricolor.php
 * Dependencies: GD Library mostly precombile with php 4.0+
 * Author: Adhil Azeez NV
 * Description: Generates Indian National Flag Image
 */

//Create a resource identifier for the image res in ration 3:2
$flag = imagecreate(1350, 900); 
if (!$flag) {
    die(&quot;Some error occured&quot;);
}
//Color identifiers definitions
$white = imagecolorallocate($flag, 255, 255, 255);
$saffron = imagecolorallocate($flag, 255, 153, 51);
$green = imagecolorallocate($flag, 18, 136, 7);
$blue = imagecolorallocate($flag, 00, 0, 137);

//Draw the tricolor sections.The white portion is no need to be specified since
//the background color is white.
imagefilledrectangle($flag, 0, 0, 1350, 300, $saffron);
imagefilledrectangle($flag, 0, 600, 1350, 900, $green);

//Draw the Ashoka Chakra
//The Circle can be created with imageellipse itself after setting the thickness.
//But unfortunetly due to a bug in GD library(reported more than 5 years ago :()
//the thickness is being ignored.
imagefilledellipse($flag, 675, 450, 240, 240, $blue);
imagefilledellipse($flag, 675, 450, 210, 210, $white);

//Draw the center small circle
imagefilledellipse($flag, 675, 450, 42, 42, $blue);

for ($angle = 0; $angle &lt;= 360; $angle = $angle + 15) {

//Draw 24 small circles in the Ashoka Chakra at the border of the circle adjacent
// to 24-spoke
    $x = 675 + 105 * cos(deg2rad($angle+7.5));
    $y = 450 + 105 * sin(deg2rad($angle+7.5));
    imagefilledellipse($flag, $x, $y, 10.5, 10.5, $blue);

//Draw the 24 spooks
    $x1 = 675 + 8 * cos(deg2rad($angle));
    $y1 = 450 + 8 * sin(deg2rad($angle));
    $x2 = $x1 + 40 * cos(deg2rad($angle - 5));
    $y2 = $y1 + 40 * sin(deg2rad($angle - 5));
    $x3 = 675 + 105 * cos(deg2rad($angle));
    $y3 = 450 + 105 * sin(deg2rad($angle));
    $x4 = $x1 + 40 * cos(deg2rad($angle + 5));
    $y4 = $y1 + 40 * sin(deg2rad($angle + 5));
    imagefilledpolygon($flag, array($x1, $y1, $x2, $y2, $x3, $y3,$x4,$y4), 4, $blue);
}
//if the script being invocked from CLI and has a filename arguments then write
//the out put to the file else print to the outputstream.
if (isset($_SERVER['argv'][1])) {
    if(imagejpeg($flag, $_SERVER['argv'][1] . '.jpg', 100))
    	echo &quot;National Flag saved to &quot;.$_SERVER['argv'][1] . '.jpg';
    else
    	echo &quot;Some error occured&quot;;
} else {
    header(&quot;Content-type: image/jpeg&quot;);
    imagejpeg($flag, null, 100);
}
imagedestroy($flag);
?&gt;
</pre></p>
<p><strong>Design</strong></p>
<p>    The script makes use of php GD library. It outputs the image to current<br />
    output stream or save to a file. </p>
<p>    If php GD library have anti aliasing support then we can enable that for much<br />
    better render.Currently anti aliasing is not enabled in the script.</p>
<p>    The output is in JPEG format but it can be changed to other format if necessary<br />
    with a few modification in the script.<br />
<strong><br />
Dependencies</strong><br />
    PHP needs GD Library support. Most of the php distribution compiled with it.</p>
<p><strong>Usage</strong><br />
    php flag.php filename</p>
<p>    Filename argument is optional. If not present the script will output to the<br />
    current output stream</p>
<p>   for example:<br />
        php flag.php | display<br />
        will open the image in ImageMagick picture viewer</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ragsagar.wordpress.com/276/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ragsagar.wordpress.com/276/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ragsagar.wordpress.com/276/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ragsagar.wordpress.com/276/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ragsagar.wordpress.com/276/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ragsagar.wordpress.com/276/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ragsagar.wordpress.com/276/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ragsagar.wordpress.com/276/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ragsagar.wordpress.com/276/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ragsagar.wordpress.com/276/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ragsagar.wordpress.com/276/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ragsagar.wordpress.com/276/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ragsagar.wordpress.com/276/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ragsagar.wordpress.com/276/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ragsagar.wordpress.com&amp;blog=4629970&amp;post=276&amp;subd=ragsagar&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ragsagar.wordpress.com/2011/08/21/php-script-to-generate-indian-flag/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1a7e8963f353728017ca6f72a2e5ee04?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ragsagar</media:title>
		</media:content>
	</item>
		<item>
		<title>How to automatically wake up your computer at a particular time ( Resume by RTC alarm in Arch Linux )</title>
		<link>http://ragsagar.wordpress.com/2011/08/15/how-to-automatically-wake-up-your-computer-at-a-particular-time-resume-by-rtc-alarm-in-arch-linux/</link>
		<comments>http://ragsagar.wordpress.com/2011/08/15/how-to-automatically-wake-up-your-computer-at-a-particular-time-resume-by-rtc-alarm-in-arch-linux/#comments</comments>
		<pubDate>Mon, 15 Aug 2011 08:34:22 +0000</pubDate>
		<dc:creator>Rag Sagar.V രാഗ് സാഗര്‍.വി</dc:creator>
				<category><![CDATA[Howtos]]></category>
		<category><![CDATA[acpi]]></category>
		<category><![CDATA[alarm]]></category>
		<category><![CDATA[arch]]></category>
		<category><![CDATA[automatic booting]]></category>
		<category><![CDATA[automatic wakeup]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[resume by rtc]]></category>
		<category><![CDATA[RTC]]></category>
		<category><![CDATA[wakeup]]></category>

		<guid isPermaLink="false">http://ragsagar.wordpress.com/?p=216</guid>
		<description><![CDATA[A step by step how-to to wake up your PC at a particular time and start downloading files.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ragsagar.wordpress.com&amp;blog=4629970&amp;post=216&amp;subd=ragsagar&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>My ISP provides unlimited download from 2am to 8am. So i was not able to sleep after 2 from the time i switched to the new broadband plan. Keeping the system on and setting a cronjob to start downloading after 2 was an option. But i was more concerned about the increasing electricity charge, than my sleep. Besides it is my social responsibility to save energy as a gonna-be software engineer :p. After a bit of googling and hacking i was able to wake up my system at a particular time. Here i am going to explain how i made my arch linux system to boot automatically at 2 am.</p>
<p>The configuration is done in Arch Linux. For automatic wakeup it needs a BIOS which supports RTC alarm. Most of them manufactured after 2000 supports this feature.</p>
<h2>1) Check if your BIOS supports automatic wakeup</h2>
<p>Execute the command below as root.<br />
<pre class="brush: plain;"># grep rtc /var/log/messages.log
rtc_cmos 00:03: RTC can wake from S4
rtc0: alarms up to one month
</pre><br />
If you can find something like this in the output.It says that the system can wakeup and a wakeup time can be setup.</p>
<h2>2) Enable automatic wakeup in BIOS</h2>
<p>Go to your BIOS setup, Under Power Management search for something like &#8220;Wake by RTC Alarm&#8221; or &#8220;Resume by RTC alarm&#8221; or &#8220;RTC resume&#8221;.Then enable it.</p>
<h2>3) Set the hardware clock time standard as UTC</h2>
<p>Edit the /etc/rc.conf file as root and set the HARDWARECLOCK variable to UTC</p>
<p><pre class="brush: plain;">[ragsagar@h4ckb0x ~]$ grep ^HARDWARECLOCK /etc/rc.conf
HARDWARECLOCK=&quot;UTC&quot;</pre></p>
<p>Make sure that your timezone is set correctly in /etc/rc.conf<br />
More help : https://wiki.archlinux.org/index.php/Time</p>
<h2>4) Set the alarm time</h2>
<p>Execute the following commands as root</p>
<p><pre class="brush: plain;"># echo 0 &gt; /sys/class/rtc/rtc0/wakealarm
# echo `date '+%s' -d '+ 5 minutes'` &gt; /sys/class/rtc/rtc0/wakealarm
</pre></p>
<p>This will set the the alarm time as 5 minutes into the future. </p>
<p><a href="http://ragsagar.files.wordpress.com/2011/08/set_alarm_5.png"><img src="http://ragsagar.files.wordpress.com/2011/08/set_alarm_5.png?w=500&#038;h=313" alt="" title="set_alarm_5" width="500" height="313" class="alignnone size-full wp-image-225" /></a></p>
<p>Now run<br />
<pre class="brush: plain;">$ cat /sys/class/rtc/rtc0/wakealarm</pre></p>
<p>If the output of above command is something like &#8220;1313383930&#8243;, the alarm is set. It is epoch time. If it doesn&#8217;t yield any result make sure that the HARDWARECLOCK variable is set to UTC and reboot and try again to set the alarm time.</p>
<p>Now run<br />
<pre class="brush: plain;">$ cat /proc/driver/rtc
</pre></p>
<p><a href="http://ragsagar.files.wordpress.com/2011/08/proc_driver_rtc.png"><img src="http://ragsagar.files.wordpress.com/2011/08/prod_driver_rtc.png?w=500&#038;h=313" alt="" title="proc_driver_rtc" width="500" height="313" class="alignnone size-full wp-image-224" /></a></p>
<p>Go through rtc_time, alrm_time and alrm_date and check if they are correct(will be in UTC).Turn off the system and leave the power on. Check if the system is booting automatically after five mintues.</p>
<h2>5) Setting the alarm to a particular time and date.</h2>
<p>To set the alarm to woke up the system at 16th Aug 2:05am, Run the following as root</p>
<p><pre class="brush: plain;"># echo 0 &gt; /sys/class/rtc/rtc0/wakealarm
# date --date &quot;Aug 16 , 2011 02:05:00&quot; +%s &gt; /sys/class/rtc/rtc0/wakealarm</pre></p>
<p>You can convert the epoch time to readable format and check the alarm time is correct.</p>
<p><pre class="brush: plain;">[root@h4ckb0x ragsagar]# cat /sys/class/rtc/rtc0/wakealarm
1313440500
[root@h4ckb0x ragsagar]# date -d @1313440500 +%F&quot; &quot;%T
2011-08-16 02:05:00
</pre></p>
<p><a href="http://ragsagar.files.wordpress.com/2011/08/particular_tme.png"><img src="http://ragsagar.files.wordpress.com/2011/08/particular_tme.png?w=500&#038;h=313" alt="" title="Setting alarm at a particular time" width="500" height="313" class="alignnone size-full wp-image-223" /></a></p>
<p><strong>Note :</strong> The mythtv wiki about acpi wakeup says that setting the hardware clock after setting alarm will disable the alarm while most of the linux distribution sets hardware clock during shutdown. They suggest to disable hardware clock adjusting during shutdown. To do that in Archlinux set the HARDWARECLOCK=&#8221;" in /etc/rc.conf . But in my arch system the alarm was not working when i set HARDWARECLOCK=&#8221;" whereas it worked when i gave HARDWARECLOCK=&#8221;UTC&#8221;. So if the wake up alarm is not working do try after changing the value of this variable.</p>
<p>To start downloading when the system boots up, i added a cronjob to <a href="http://ragsagar.wordpress.com/2011/08/13/script-to-reboot-teracom-router/" title="Script to restart router" target="_blank">restart the router</a> at 2:15 and 7:45 (to account the download in happy hours). Also added &#8220;transmission-gtk&#8221; to the gnome-session-properties. So that transmission will be launched on startup and downloading will be started.</p>
<p><strong>Reference :</strong></p>
<p>http://www.mythtv.org/wiki/ACPI_Wakeup</p>
<p>https://wiki.archlinux.org/index.php/Time</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ragsagar.wordpress.com/216/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ragsagar.wordpress.com/216/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ragsagar.wordpress.com/216/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ragsagar.wordpress.com/216/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ragsagar.wordpress.com/216/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ragsagar.wordpress.com/216/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ragsagar.wordpress.com/216/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ragsagar.wordpress.com/216/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ragsagar.wordpress.com/216/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ragsagar.wordpress.com/216/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ragsagar.wordpress.com/216/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ragsagar.wordpress.com/216/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ragsagar.wordpress.com/216/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ragsagar.wordpress.com/216/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ragsagar.wordpress.com&amp;blog=4629970&amp;post=216&amp;subd=ragsagar&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ragsagar.wordpress.com/2011/08/15/how-to-automatically-wake-up-your-computer-at-a-particular-time-resume-by-rtc-alarm-in-arch-linux/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1a7e8963f353728017ca6f72a2e5ee04?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ragsagar</media:title>
		</media:content>

		<media:content url="http://ragsagar.files.wordpress.com/2011/08/set_alarm_5.png" medium="image">
			<media:title type="html">set_alarm_5</media:title>
		</media:content>

		<media:content url="http://ragsagar.files.wordpress.com/2011/08/prod_driver_rtc.png" medium="image">
			<media:title type="html">proc_driver_rtc</media:title>
		</media:content>

		<media:content url="http://ragsagar.files.wordpress.com/2011/08/particular_tme.png" medium="image">
			<media:title type="html">Setting alarm at a particular time</media:title>
		</media:content>
	</item>
		<item>
		<title>Script to reboot teracom router</title>
		<link>http://ragsagar.wordpress.com/2011/08/13/script-to-reboot-teracom-router/</link>
		<comments>http://ragsagar.wordpress.com/2011/08/13/script-to-reboot-teracom-router/#comments</comments>
		<pubDate>Sat, 13 Aug 2011 00:23:50 +0000</pubDate>
		<dc:creator>Rag Sagar.V രാഗ് സാഗര്‍.വി</dc:creator>
				<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Shell Scripts]]></category>
		<category><![CDATA[expect]]></category>
		<category><![CDATA[restart router]]></category>

		<guid isPermaLink="false">http://ragsagar.wordpress.com/?p=212</guid>
		<description><![CDATA[A slightly edited version of the script to restart router written by Madhusudan.C.S to make it work with teracom router given by bsnl.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ragsagar.wordpress.com&amp;blog=4629970&amp;post=212&amp;subd=ragsagar&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A slightly edited version of the script to restart router written by <a href="http://www.madhusudancs.info/restart-router" title="Madhusudan.C.S" target="_blank">Madhusudan.C.S</a> to make it work with teracom router given by bsnl.</p>
<p><pre class="brush: bash;">
#!/usr/bin/env expect

set username admin
set pass admin
set host 192.168.1.1

spawn telnet ${host}

expect -re &quot;Login:&quot;
send &quot;${username}\r&quot;

expect &quot;Password:&quot;
send &quot;${pass}\r&quot;

expect -re &quot;successful&quot;
send &quot;console enable\r&quot;
send &quot;restart\r&quot;
expect eof 

</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ragsagar.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ragsagar.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ragsagar.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ragsagar.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ragsagar.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ragsagar.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ragsagar.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ragsagar.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ragsagar.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ragsagar.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ragsagar.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ragsagar.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ragsagar.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ragsagar.wordpress.com/212/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ragsagar.wordpress.com&amp;blog=4629970&amp;post=212&amp;subd=ragsagar&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ragsagar.wordpress.com/2011/08/13/script-to-reboot-teracom-router/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1a7e8963f353728017ca6f72a2e5ee04?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ragsagar</media:title>
		</media:content>
	</item>
		<item>
		<title>Python code to find solution for jumbled word puzzle</title>
		<link>http://ragsagar.wordpress.com/2011/07/24/python-code-to-find-solution-for-jumbled-word-puzzle/</link>
		<comments>http://ragsagar.wordpress.com/2011/07/24/python-code-to-find-solution-for-jumbled-word-puzzle/#comments</comments>
		<pubDate>Sun, 24 Jul 2011 09:44:17 +0000</pubDate>
		<dc:creator>Rag Sagar.V രാഗ് സാഗര്‍.വി</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://ragsagar.wordpress.com/?p=205</guid>
		<description><![CDATA[Here is a python script to find solution for a jumbled word. Give a jumbled word as parameter, it will list the possible solutions. Don&#8217;t forget to change the &#8216;dictfile&#8217; to the wordslist file you have in your system. Here is the screenshot of script output.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ragsagar.wordpress.com&amp;blog=4629970&amp;post=205&amp;subd=ragsagar&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here is a python script to find solution for a jumbled word. Give a jumbled word as parameter, it will list the possible solutions.<br />
<pre class="brush: python;">
import sys

dictfile = &quot;/usr/share/dict/cracklib-small&quot;

def get_words(text):
	&quot;&quot;&quot; Return a list of dict words &quot;&quot;&quot;
	return text.split()
	

def get_possible_words(words,jword):
	&quot;&quot;&quot; Return a list of possible solutions &quot;&quot;&quot;
	possible_words = []
	jword_length = len(jword)
	for word in words:
		jumbled_word = jword
		if len(word) == jword_length:
			letters = list(word)
			for letter in letters:
				if jumbled_word.find(letter) != -1:
					jumbled_word = jumbled_word.replace(letter,'',1)
			if not jumbled_word:
				possible_words.append(word)
	return possible_words		
			
				
if __name__ == '__main__':
	words = get_words(file(dictfile).read())
	if len(sys.argv) != 2:
		print &quot;python %s &lt;jumbled word&gt;&quot; % sys.argv[0]
		sys.exit()
	jumbled_word = sys.argv[1]
	words = get_possible_words(words,jumbled_word)
	print &quot;possible words :&quot;
	print '\n'.join(words)

</pre></p>
<p>Don&#8217;t forget to change the &#8216;dictfile&#8217; to the wordslist file you have in your system.</p>
<p>Here is the screenshot of script output.</p>
<p><a href="http://ragsagar.files.wordpress.com/2011/07/unjumbled.png"><img src="http://ragsagar.files.wordpress.com/2011/07/unjumbled.png?w=500&#038;h=356" alt="" title="unjumbled output" width="500" height="356" class="alignnone size-full wp-image-207" /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ragsagar.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ragsagar.wordpress.com/205/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ragsagar.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ragsagar.wordpress.com/205/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ragsagar.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ragsagar.wordpress.com/205/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ragsagar.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ragsagar.wordpress.com/205/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ragsagar.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ragsagar.wordpress.com/205/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ragsagar.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ragsagar.wordpress.com/205/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ragsagar.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ragsagar.wordpress.com/205/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ragsagar.wordpress.com&amp;blog=4629970&amp;post=205&amp;subd=ragsagar&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ragsagar.wordpress.com/2011/07/24/python-code-to-find-solution-for-jumbled-word-puzzle/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1a7e8963f353728017ca6f72a2e5ee04?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ragsagar</media:title>
		</media:content>

		<media:content url="http://ragsagar.files.wordpress.com/2011/07/unjumbled.png" medium="image">
			<media:title type="html">unjumbled output</media:title>
		</media:content>
	</item>
		<item>
		<title>Python script that ranks Hollywood actors based on number of appearances in top 100 movies</title>
		<link>http://ragsagar.wordpress.com/2011/06/15/python-script-that-ranks-hollywood-actors-based-on-number-of-appearances-in-top-100-movies/</link>
		<comments>http://ragsagar.wordpress.com/2011/06/15/python-script-that-ranks-hollywood-actors-based-on-number-of-appearances-in-top-100-movies/#comments</comments>
		<pubDate>Wed, 15 Jun 2011 14:11:35 +0000</pubDate>
		<dc:creator>Rag Sagar.V രാഗ് സാഗര്‍.വി</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[actors ranking]]></category>
		<category><![CDATA[codejam]]></category>
		<category><![CDATA[imdb]]></category>
		<category><![CDATA[imdbpy]]></category>

		<guid isPermaLink="false">http://ragsagar.wordpress.com/?p=200</guid>
		<description><![CDATA[Actually this is a sample question appeared in codejam contest conducted by mobme wireless. Imdbpy python module is used to retrieve movie informations from imdb. For those who don&#8217;t know about this event : http://codejam.mobme.in/ Sample Question : Write a program that ranks Hollywood actors based on the number of their appearances in a list [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ragsagar.wordpress.com&amp;blog=4629970&amp;post=200&amp;subd=ragsagar&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Actually this is a sample question appeared in codejam contest conducted by mobme wireless. Imdbpy python module is used to retrieve movie informations from imdb.  </p>
<p>For those who don&#8217;t know about this event : http://codejam.mobme.in/</p>
<p>Sample Question : </p>
<blockquote><p>Write a program that ranks Hollywood actors based on the number of their appearances in a list of top 100 movies. There are a number of top movie lists on the Internet and it&#8217;s up to you to choose one. We&#8217;d prefer you choose one that has an open API.</p></blockquote>
<p>Solution in Python : </p>
<p><pre class="brush: python;">
#!/usr/bin/env python

__author__ = &quot;Rag Sagar.V&quot;
__email__ = '@'.join(['ragsagar','.'.join([_ for _ in ['gmail','com']])])


from twisted.internet import reactor, threads
import re,imdb,itertools


actors_rating = {} #actors_rating['actor name'] = rank
rank = 0
count = 1
current_rank = 0
concurrent = 5
finished = itertools.count(1)
reactor.suggestThreadPoolSize(concurrent)


try:
	imdb_access = imdb.IMDb()
except imdb.IMDbError, err:
	print err
		
top_100 = imdb_access.get_top250_movies()[:100]


def populate_actors(mid):
	movie = imdb_access.get_movie(int(mid))
	#print movie
	for i in (0,1):
		actor_name =  movie['cast'][i]['name']
		if actors_rating.has_key(actor_name):
			actors_rating[actor_name] = actors_rating[actor_name] + 1
		else:
			actors_rating[actor_name] = 1
	if finished.next()==added:
		reactor.stop()
	
added = 0
for movie in top_100:
	added += 1	
	req = threads.deferToThread(populate_actors, movie.getID())

try:
	reactor.run()
except KeyboardInterrupt:
	reactor.stop()	

   
for actor in sorted(actors_rating, key=actors_rating.get, reverse=True):
	previous_rank = current_rank
	current_rank = actors_rating[actor]
	if previous_rank !=  current_rank :
		rank += count
		count = 1
	else:
		count += 1	
	print rank,actor   
    
    
</pre></p>
<p>Dependency :<br />
imdbpy</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ragsagar.wordpress.com/200/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ragsagar.wordpress.com/200/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ragsagar.wordpress.com/200/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ragsagar.wordpress.com/200/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ragsagar.wordpress.com/200/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ragsagar.wordpress.com/200/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ragsagar.wordpress.com/200/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ragsagar.wordpress.com/200/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ragsagar.wordpress.com/200/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ragsagar.wordpress.com/200/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ragsagar.wordpress.com/200/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ragsagar.wordpress.com/200/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ragsagar.wordpress.com/200/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ragsagar.wordpress.com/200/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ragsagar.wordpress.com&amp;blog=4629970&amp;post=200&amp;subd=ragsagar&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ragsagar.wordpress.com/2011/06/15/python-script-that-ranks-hollywood-actors-based-on-number-of-appearances-in-top-100-movies/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1a7e8963f353728017ca6f72a2e5ee04?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ragsagar</media:title>
		</media:content>
	</item>
		<item>
		<title>Display wishes depending on time when you open the console</title>
		<link>http://ragsagar.wordpress.com/2011/06/07/display-wishes-depending-on-time-when-you-open-the-console/</link>
		<comments>http://ragsagar.wordpress.com/2011/06/07/display-wishes-depending-on-time-when-you-open-the-console/#comments</comments>
		<pubDate>Tue, 07 Jun 2011 17:42:41 +0000</pubDate>
		<dc:creator>Rag Sagar.V രാഗ് സാഗര്‍.വി</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[bashrc]]></category>
		<category><![CDATA[time]]></category>

		<guid isPermaLink="false">http://ragsagar.wordpress.com/?p=187</guid>
		<description><![CDATA[Here is a python script to wish you Good Morning or Good Evening according to the time of the day. Now if you want to display it when you open the console add the following line to your ~/.bashrc file. python /path/to/the/script.py Happy Hacking!<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ragsagar.wordpress.com&amp;blog=4629970&amp;post=187&amp;subd=ragsagar&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here is a python script to wish you Good Morning or Good Evening according to the time of the day.</p>
<p><pre class="brush: python;">
#!/usr/bin/python
import time

current_hour = time.strptime(time.ctime(time.time())).tm_hour

if current_hour &lt; 12 :
	print &quot;Good Morning!&quot;
elif current_hour == 12 :
	print &quot;Good Noon!&quot;
elif current_hour &gt; 12 and current_hour &lt; 18 :
	print &quot;Good AfterNoon!&quot;
elif current_hour &gt;= 18 :
	print &quot;Good Evening!&quot;
</pre></p>
<p>Now if you want to display it when you open the console add the following line to your ~/.bashrc file.</p>
<blockquote><p>python /path/to/the/script.py</p></blockquote>
<p>Happy Hacking! <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ragsagar.wordpress.com/187/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ragsagar.wordpress.com/187/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ragsagar.wordpress.com/187/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ragsagar.wordpress.com/187/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ragsagar.wordpress.com/187/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ragsagar.wordpress.com/187/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ragsagar.wordpress.com/187/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ragsagar.wordpress.com/187/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ragsagar.wordpress.com/187/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ragsagar.wordpress.com/187/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ragsagar.wordpress.com/187/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ragsagar.wordpress.com/187/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ragsagar.wordpress.com/187/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ragsagar.wordpress.com/187/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ragsagar.wordpress.com&amp;blog=4629970&amp;post=187&amp;subd=ragsagar&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ragsagar.wordpress.com/2011/06/07/display-wishes-depending-on-time-when-you-open-the-console/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1a7e8963f353728017ca6f72a2e5ee04?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ragsagar</media:title>
		</media:content>
	</item>
		<item>
		<title>Reliance Customer Care freaking me out!! :-(</title>
		<link>http://ragsagar.wordpress.com/2011/04/01/reliance-customer-care-freaking-me-out/</link>
		<comments>http://ragsagar.wordpress.com/2011/04/01/reliance-customer-care-freaking-me-out/#comments</comments>
		<pubDate>Fri, 01 Apr 2011 15:24:23 +0000</pubDate>
		<dc:creator>Rag Sagar.V രാഗ് സാഗര്‍.വി</dc:creator>
				<category><![CDATA[My Thoughts]]></category>
		<category><![CDATA[customer care]]></category>
		<category><![CDATA[reliance]]></category>
		<category><![CDATA[sucks]]></category>

		<guid isPermaLink="false">http://ragsagar.wordpress.com/?p=184</guid>
		<description><![CDATA[Two months before i lost 10rs from my mobile balance without using it. When i contacted Reliance customer care they told me that &#8220;A joke pack has activated in your account by me last month and this is for the second time they are taking money,It is not possible to refund the money now, but [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ragsagar.wordpress.com&amp;blog=4629970&amp;post=184&amp;subd=ragsagar&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Two months before i lost 10rs from my mobile balance without using it. When i contacted Reliance customer care they told me that &#8220;A joke pack has activated in your account by me last month and this is for the second time they are taking money,It is not possible to refund the money now, but they will deactivate it. It is possible to refund the money only within 24hours after activation of the pack.&#8221; I told them that i didn&#8217;t activate any such packs and told to deactivate it. On this month 25th i again noticed a decrease in balance by 10rs. So i contacted the customer care executive on 25th morning. He told that a joke pack has been subscribed that&#8217;s why i lost the money and it is possible to refund the money as no activation has yet taken place.So i told him to refund. As it didn&#8217;t got activate after an hour, i contacted the Customer care again. They told me to wait for 24hours. I waited for 24 hours and contacted them again on 26th evening and what they said was the same, to wait for 24hours. Told the same when i called them on 27th. When i called on 28th one CC executive told me that a complaint has been registered and that i have to wait for two days and i will be getting the complaint no as sms. Within two days i got two messages from them one containing the complaint number and the other informing that the offer pack has been deactivated. But the money was still not refunded. So i contacted them on 31st (yesterday), a CC executive told me that i will be surely refunded within 24hours and told me to wait. Today when i called them one guy telling me that my pack is not yet deactivated, i can deactivate it through an sms and it is not possible to refund the money. WTF??????</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ragsagar.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ragsagar.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ragsagar.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ragsagar.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ragsagar.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ragsagar.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ragsagar.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ragsagar.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ragsagar.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ragsagar.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ragsagar.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ragsagar.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ragsagar.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ragsagar.wordpress.com/184/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ragsagar.wordpress.com&amp;blog=4629970&amp;post=184&amp;subd=ragsagar&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ragsagar.wordpress.com/2011/04/01/reliance-customer-care-freaking-me-out/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1a7e8963f353728017ca6f72a2e5ee04?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ragsagar</media:title>
		</media:content>
	</item>
		<item>
		<title>Times i hate being a Kottayam native</title>
		<link>http://ragsagar.wordpress.com/2011/01/26/times-i-hate-being-a-kottayam-native/</link>
		<comments>http://ragsagar.wordpress.com/2011/01/26/times-i-hate-being-a-kottayam-native/#comments</comments>
		<pubDate>Wed, 26 Jan 2011 05:28:35 +0000</pubDate>
		<dc:creator>Rag Sagar.V രാഗ് സാഗര്‍.വി</dc:creator>
				<category><![CDATA[My Thoughts]]></category>
		<category><![CDATA[income certificate palakkad kottayam village office]]></category>

		<guid isPermaLink="false">http://ragsagar.wordpress.com/?p=181</guid>
		<description><![CDATA[Yesterday i went to village office to get income certificate. To get subsidy in interest of educational loan from central govt we have to give income certificate to the bank. Village officer asked me about my native. I told him Palakkad. Then he asked about my father&#8217;s native. i told him Kottayam. Then he asked [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ragsagar.wordpress.com&amp;blog=4629970&amp;post=181&amp;subd=ragsagar&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Yesterday i went to village office to get income certificate. To get subsidy in interest of educational loan from central govt we have to give income certificate to the bank. Village officer asked me about my native. I told him Palakkad. Then he asked about my father&#8217;s native. i told him Kottayam. Then he asked me if we have any property there, i nodded my head and told him we are living here for the past 30 years and we have nothing left there. He told me to get a report from the village office in Kottayam that we don&#8217;t have any property there. Then only he will give income certificate. i told him several times that we don&#8217;t have anything left there and we have property here. But he kept on saying the same. I should have lied that my father&#8217;s native is Palakkad. TIMES I HATE BEING A KOTTAYAM NATIVE </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ragsagar.wordpress.com/181/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ragsagar.wordpress.com/181/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ragsagar.wordpress.com/181/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ragsagar.wordpress.com/181/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ragsagar.wordpress.com/181/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ragsagar.wordpress.com/181/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ragsagar.wordpress.com/181/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ragsagar.wordpress.com/181/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ragsagar.wordpress.com/181/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ragsagar.wordpress.com/181/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ragsagar.wordpress.com/181/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ragsagar.wordpress.com/181/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ragsagar.wordpress.com/181/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ragsagar.wordpress.com/181/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ragsagar.wordpress.com&amp;blog=4629970&amp;post=181&amp;subd=ragsagar&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ragsagar.wordpress.com/2011/01/26/times-i-hate-being-a-kottayam-native/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1a7e8963f353728017ca6f72a2e5ee04?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ragsagar</media:title>
		</media:content>
	</item>
		<item>
		<title>Fetch malayalam meanings of english words from ml.wiktionary.org in command line</title>
		<link>http://ragsagar.wordpress.com/2010/11/30/174/</link>
		<comments>http://ragsagar.wordpress.com/2010/11/30/174/#comments</comments>
		<pubDate>Tue, 30 Nov 2010 11:18:17 +0000</pubDate>
		<dc:creator>Rag Sagar.V രാഗ് സാഗര്‍.വി</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[malayalam]]></category>
		<category><![CDATA[ml.wiktionary]]></category>
		<category><![CDATA[wikipedia]]></category>

		<guid isPermaLink="false">http://ragsagar.wordpress.com/?p=174</guid>
		<description><![CDATA[Fetch malayalam meanings of english words from malayalam wiktionary.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ragsagar.wordpress.com&amp;blog=4629970&amp;post=174&amp;subd=ragsagar&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This time its the script to fetch the malayalam meanings of english words from malayalam wiktionary.</p>
<p><pre class="brush: python;">
#!/usr/bin/python
#-*- coding: utf-8 -*-
# http://ragsagar.wordpress.com

from HTMLParser import HTMLParser
import urllib2,sys


class Parser(HTMLParser):
	
	def __init__(self):
		self.in_header = False
		self.in_definition = False
		HTMLParser.__init__(self)
	
	def handle_starttag(self, tag, attrs):
		if tag == 'li':
			self.in_header = True
		if tag == 'a' and self.in_header :
			self.in_definition = True
	
	def handle_endtag(self, tag):
	    	if tag == 'li':
			self.in_header = False
		if tag == 'a' :
			self.in_defintion = False
			
	def handle_data(self, data):
		if self.in_definition:
			print data 
			exit(0)
					


try :
	search_item = sys.argv[1]
except IndexError:
	print &quot; syntax : %s &lt;definiton&gt; &quot; % sys.argv[0]
	exit(1)
search_link = &quot;http://ml.wiktionary.org/w/index.php?title=%s&amp;printable=yes&quot; % (urllib2.quote(search_item.encode('utf-8')))


request = urllib2.Request(search_link)
request.add_header('User-agent', 'Mozilla/5.0 (hb)')
try :
	response = urllib2.urlopen(request)
except urllib2.HTTPError :
	print &quot;No definition found &quot;
except urllib2.URLError :
	print &quot;Unable to connect to internet &quot;
else :
	parser = Parser()
	data = response.read()
	parser.feed(data)
			
</pre></p>
<p>Output in my terminal<br />
<div id="attachment_179" class="wp-caption alignnone" style="width: 310px"><a href="http://ragsagar.files.wordpress.com/2010/11/malayalamwiki.png"><img src="http://ragsagar.files.wordpress.com/2010/11/malayalamwiki.png?w=300&#038;h=209" alt="" title="malayalam wiktionary" width="300" height="209" class="size-medium wp-image-179" /></a><p class="wp-caption-text">malayalam meaning</p></div></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ragsagar.wordpress.com/174/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ragsagar.wordpress.com/174/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ragsagar.wordpress.com/174/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ragsagar.wordpress.com/174/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ragsagar.wordpress.com/174/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ragsagar.wordpress.com/174/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ragsagar.wordpress.com/174/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ragsagar.wordpress.com/174/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ragsagar.wordpress.com/174/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ragsagar.wordpress.com/174/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ragsagar.wordpress.com/174/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ragsagar.wordpress.com/174/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ragsagar.wordpress.com/174/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ragsagar.wordpress.com/174/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ragsagar.wordpress.com&amp;blog=4629970&amp;post=174&amp;subd=ragsagar&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ragsagar.wordpress.com/2010/11/30/174/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1a7e8963f353728017ca6f72a2e5ee04?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ragsagar</media:title>
		</media:content>

		<media:content url="http://ragsagar.files.wordpress.com/2010/11/malayalamwiki.png?w=300" medium="image">
			<media:title type="html">malayalam wiktionary</media:title>
		</media:content>
	</item>
	</channel>
</rss>
