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

<channel>
	<title>Uncertain Binary Thoughts</title>
	<atom:link href="http://ankurs.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://ankurs.com</link>
	<description>01110100110101010101011101100010</description>
	<lastBuildDate>Thu, 11 Mar 2010 18:45:31 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Weekend Project</title>
		<link>http://ankurs.com/2010/03/weekend-project/</link>
		<comments>http://ankurs.com/2010/03/weekend-project/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 19:52:34 +0000</pubDate>
		<dc:creator>Ankur Shrivastava</dc:creator>
				<category><![CDATA[Stuff]]></category>
		<category><![CDATA[college]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[car]]></category>
		<category><![CDATA[control]]></category>
		<category><![CDATA[phone]]></category>
		<category><![CDATA[rf]]></category>
		<category><![CDATA[toy]]></category>

		<guid isPermaLink="false">http://ankurs.com/?p=607</guid>
		<description><![CDATA[In Dec 2009 at foss.in at the maemo stall i saw a guy control a small toy car through accelerometer on his N900, i thought of replicating that but it just remained in my mind, so last Saturday i finally decided to implement it and went straight to a toy store and bought a toy [...]]]></description>
			<content:encoded><![CDATA[<p>In Dec 2009 at foss.in at the maemo stall i saw a guy control a small toy car through accelerometer on his N900, i thought of replicating that but it just remained in my mind, so last Saturday i finally decided to implement it and went straight to a toy store and bought a toy RF car, one hour of hacking and i was able to control the small car through by phone (Nokia E61i) here is the video of it working.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="385" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/tdfnt-a7vkM&amp;hl=en_US&amp;fs=1&amp;rel=0" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="480" height="385" src="http://www.youtube.com/v/tdfnt-a7vkM&amp;hl=en_US&amp;fs=1&amp;rel=0" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="385" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/XK8eOvkX14U&amp;hl=en_US&amp;fs=1&amp;rel=0" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="480" height="385" src="http://www.youtube.com/v/XK8eOvkX14U&amp;hl=en_US&amp;fs=1&amp;rel=0" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>the concept is simple, i send commands through my phone over wifi to my laptop which controls the car remote, controlling a toy car remote is very easy with a Parallel port and few transistors but laptops don&#8217;t have parallel ports, so i used a micro-controller in between to sort that out, so now micro controller controls the car remote by acting on signals received over UART from laptop.<br />
the working is Phone &#8212;(WiFi)&#8212;&gt;Laptop &#8212;(USB/UART)&#8212;&gt; Micro controller &#8212;(Relays)&#8212;&gt; Car Remote &#8212;(RF)&#8212;&gt; Toy Car<br />
will post details with code sometime later</p>
]]></content:encoded>
			<wfw:commentRss>http://ankurs.com/2010/03/weekend-project/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>strange thing in python</title>
		<link>http://ankurs.com/2010/02/strange-thing-in-python/</link>
		<comments>http://ankurs.com/2010/02/strange-thing-in-python/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 12:52:17 +0000</pubDate>
		<dc:creator>Ankur Shrivastava</dc:creator>
				<category><![CDATA[Stuff]]></category>

		<guid isPermaLink="false">http://ankurs.com/?p=599</guid>
		<description><![CDATA[i recently noticed this anyone has a proper explanation for this
for literals i get this

&#62;&#62;&#62; def a():
...     b = []
...     c = {}
...
&#62;&#62;&#62; import dis
&#62;&#62;&#62; dis.dis(a)
2 0 BUILD_LIST               0
3 STORE_FAST               0 (b)

3 6 BUILD_MAP                0
9 STORE_FAST               1 (c)
12 LOAD_CONST               0 (None)
15 RETURN_VALUE
but for constructors i get this

&#62;&#62;&#62; def a():
...     b = list()
...  [...]]]></description>
			<content:encoded><![CDATA[<p>i recently noticed this anyone has a proper explanation for this</p>
<p>for literals i get this<br />
<code><br />
&gt;&gt;&gt; def a():<br />
...     b = []<br />
...     c = {}<br />
...<br />
&gt;&gt;&gt; import dis<br />
&gt;&gt;&gt; dis.dis(a)<br />
2 0 BUILD_LIST               0<br />
3 STORE_FAST               0 (b)</code><br />
<code><br />
3 6 BUILD_MAP                0<br />
9 STORE_FAST               1 (c)<br />
12 LOAD_CONST               0 (None)<br />
15 RETURN_VALUE</code></p>
<p>but for constructors i get this<br />
<code><br />
&gt;&gt;&gt; def a():<br />
...     b = list()<br />
...     c = dict()<br />
...<br />
&gt;&gt;&gt; dis.dis(a)<br />
2  0 LOAD_GLOBAL              0 (list)<br />
3 CALL_FUNCTION            0<br />
6 STORE_FAST               0 (b)</code><br />
<code><br />
3  9 LOAD_GLOBAL              1 (dict)<br />
12 CALL_FUNCTION            0<br />
15 STORE_FAST               1 (c)<br />
18 LOAD_CONST               0 (None)<br />
21 RETURN_VALUE<br />
</code><br />
i mean why the difference, i was thinking {} and dict() do the same thing, shouldn&#8217;t they?</p>
]]></content:encoded>
			<wfw:commentRss>http://ankurs.com/2010/02/strange-thing-in-python/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Begining Python workshop</title>
		<link>http://ankurs.com/2010/01/begining-python-workshop/</link>
		<comments>http://ankurs.com/2010/01/begining-python-workshop/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 21:09:33 +0000</pubDate>
		<dc:creator>Ankur Shrivastava</dc:creator>
				<category><![CDATA[Stuff]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://ankurs.com/?p=593</guid>
		<description><![CDATA[LUG Manipal is organising a workshop on python, Workshop is aimed at people interested in beginning programming with python.No programming experience required.
Details are -&#62;
Time: 5:30 pm
Place: NLH 103
Date: 29th JAN to 3rd FEB
PS :- Slides for the workshop are available Begining Python Slides
]]></description>
			<content:encoded><![CDATA[<div id="attachment_594" class="wp-caption aligncenter" style="width: 222px"><a href="http://ankurs.com/wp-content/uploads/2010/01/python.jpg"><img class="size-medium wp-image-594" title="LUG Manipal python workshop" src="http://ankurs.com/wp-content/uploads/2010/01/python-212x300.jpg" alt="LUG Manipal python workshop" width="212" height="300" /></a><p class="wp-caption-text">LUG Manipal python workshop poster</p></div>
<p>LUG Manipal is organising a workshop on python, Workshop is aimed at people interested in beginning programming with python.No programming experience required.</p>
<p>Details are -&gt;<br />
Time: 5:30 pm<br />
Place: NLH 103<br />
Date: 29th JAN to 3rd FEB</p>
<p>PS :- Slides for the workshop are available <a href="http://ankurs.com/wp-content/uploads/2010/01/python.pdf">Begining Python Slides</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ankurs.com/2010/01/begining-python-workshop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mobi Vision 2.0 Slides</title>
		<link>http://ankurs.com/2009/10/mobi-vision-2-0-slides/</link>
		<comments>http://ankurs.com/2009/10/mobi-vision-2-0-slides/#comments</comments>
		<pubDate>Thu, 15 Oct 2009 12:30:55 +0000</pubDate>
		<dc:creator>Ankur Shrivastava</dc:creator>
				<category><![CDATA[Stuff]]></category>

		<guid isPermaLink="false">http://ankurs.com/?p=561</guid>
		<description><![CDATA[First and Second Phase for MobiVision 2.0 is long over, and we can call it a workshop well done, the slides are here
Mobi Vision 2.0
View more documents from Ankur Shrivastava.

]]></description>
			<content:encoded><![CDATA[<p>First and Second Phase for MobiVision 2.0 is long over, and we can call it a workshop well done, the slides are here</p>
<div style="width:425px;text-align:left" id="__ss_2267468"><a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" href="http://www.slideshare.net/ankur.os/mobi-vision-20" title="Mobi Vision 2.0">Mobi Vision 2.0</a><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=homeankurdesktopdump1mobivisionmobivision-091018161227-phpapp01&#038;stripped_title=mobi-vision-20" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=homeankurdesktopdump1mobivisionmobivision-091018161227-phpapp01&#038;stripped_title=mobi-vision-20" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object>
<div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;">View more <a style="text-decoration:underline;" href="http://www.slideshare.net/">documents</a> from <a style="text-decoration:underline;" href="http://www.slideshare.net/ankur.os">Ankur Shrivastava</a>.</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://ankurs.com/2009/10/mobi-vision-2-0-slides/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting started with pthread</title>
		<link>http://ankurs.com/2009/09/getting-started-with-pthread/</link>
		<comments>http://ankurs.com/2009/09/getting-started-with-pthread/#comments</comments>
		<pubDate>Thu, 24 Sep 2009 19:38:34 +0000</pubDate>
		<dc:creator>Ankur Shrivastava</dc:creator>
				<category><![CDATA[C]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[begining]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[program]]></category>
		<category><![CDATA[pthread]]></category>

		<guid isPermaLink="false">http://ankurs.com/?p=562</guid>
		<description><![CDATA[Recently i have started coding in C a lot and what i came across from a lot of people is that doing Threading in C is very hard, is it really like that? here is a simple Pthread program that should clear that up

get it here
in the above program i have just created 2 threads [...]]]></description>
			<content:encoded><![CDATA[<p>Recently i have started coding in C a lot and what i came across from a lot of people is that doing Threading in C is very hard, is it really like that? here is a simple Pthread program that should clear that up<br />
<script src="http://gist.github.com/179778.js"></script><br />
get it <a href="http://gist.github.com/179778">here</a></p>
<p>in the above program i have just created 2 threads and passed thr1 ( = 1 ) and thr2 ( = 2 ) values as parameters the function void * thread ( void * ptr ) is executes as a separate thread, we create two thread objects thread1 and thread2, and start threads using pthread_create function passing thread object, function pointer and parameters as arguments, here NULL specifies default attributes for the thread, we can change this by passing pthread_attr_t structure instead of NULL.<br />
we wait for the threads to finish using the pthread_join function<br />
One major problem that is faced by most of the people is of using a library which is not a thread safe library, so you need to be careful about the libraries you use in your program, if not sure about a particular library being thread safe, just assume it not to be thread safe</p>
<p>PS &#8211; No updates from a long time as i dont have a proper net connection &#8230;.</p>
]]></content:encoded>
			<wfw:commentRss>http://ankurs.com/2009/09/getting-started-with-pthread/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A simple python socket chat example</title>
		<link>http://ankurs.com/2009/07/a-simple-python-socket-chat-example/</link>
		<comments>http://ankurs.com/2009/07/a-simple-python-socket-chat-example/#comments</comments>
		<pubDate>Wed, 29 Jul 2009 19:08:34 +0000</pubDate>
		<dc:creator>Ankur Shrivastava</dc:creator>
				<category><![CDATA[Stuff]]></category>
		<category><![CDATA[Chat]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[socket]]></category>

		<guid isPermaLink="false">http://ankurs.com/?p=557</guid>
		<description><![CDATA[i was trying to explain sockets to one of my friend and this is what i used, the code should be self explanatory, this is a very simple application of sockets&#8230;

download here
]]></description>
			<content:encoded><![CDATA[<p>i was trying to explain sockets to one of my friend and this is what i used, the code should be self explanatory, this is a very simple application of sockets&#8230;</p>
<p><script src="http://gist.github.com/145536.js"></script></p>
<p>download <a href="http://gist.github.com/raw/145536/753a6d62042163710647574ea723c42807f44aef/python-socket-chat.py">here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ankurs.com/2009/07/a-simple-python-socket-chat-example/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How Manipal got its first Linux (fedora) server</title>
		<link>http://ankurs.com/2009/06/how-manipal-got-its-first-linux-fedora-server/</link>
		<comments>http://ankurs.com/2009/06/how-manipal-got-its-first-linux-fedora-server/#comments</comments>
		<pubDate>Thu, 25 Jun 2009 17:38:16 +0000</pubDate>
		<dc:creator>Ankur Shrivastava</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[college]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[feedback]]></category>
		<category><![CDATA[manipal]]></category>
		<category><![CDATA[mit]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://ankurs.com/?p=542</guid>
		<description><![CDATA[It all started with a failing Student&#8217;s Teacher Feedback System, designed by few fourth year students of my college, in oct-nov 2008 the system was not able to scale and everything was reverted back to paper, it was then when i was contacted by a teacher from my Department ( Information and Communication Technology ), [...]]]></description>
			<content:encoded><![CDATA[<p>It all started with a failing Student&#8217;s Teacher Feedback System, designed by few fourth year students of my college, in oct-nov 2008 the system was not able to scale and everything was reverted back to paper, it was then when i was contacted by a teacher from my Department ( Information and Communication Technology ), regarding if i can improve it.</p>
<p>i asked <a href="http://djsh.net">DJ</a> if he wants to join me and after few weeks of coding there it was Manipal university&#8217;s  first (working) Feedback System, when the point of hosting it came, i was surprised to find Manipal University has no Linux servers, i mean come on no Linux what are you people click sys admins, then we decided to setup our own server in the department, thus giving Manipal university its first Linux ( fedora 10 ) server.</p>
<p>currently it just hosts the Feedback System, but we are planning to use it as local ( internal ) fedora repository mirror, we need permission from the WiFi provider ION because almost all the students use only WiFi and not LAN, last time we tried we were denied by saying &#8221; You are  a threat to our network &#8220;, lets see how it goes this time. we will also require people to manage it but i think this can be handled very well by <a href="http://lugmanipal.org">LUG Manipal</a>, some pics<br />
<div id="attachment_543" class="wp-caption aligncenter" style="width: 310px"><a href="http://ankurs.com/wp-content/uploads/2009/06/09032009001.jpg"><img src="http://ankurs.com/wp-content/uploads/2009/06/09032009001-300x225.jpg" alt="Fedora 10 server in Manipal" title="Fedora 10 server in Manipal" width="300" height="225" class="size-medium wp-image-543" /></a><p class="wp-caption-text">Fedora 10 server in Manipal</p></div><br />
<div id="attachment_544" class="wp-caption aligncenter" style="width: 310px"><a href="http://ankurs.com/wp-content/uploads/2009/06/09032009002.jpg"><img src="http://ankurs.com/wp-content/uploads/2009/06/09032009002-300x225.jpg" alt="Fedora 10 server in Manipal" title="Fedora 10 server in Manipal" width="300" height="225" class="size-medium wp-image-544" /></a><p class="wp-caption-text">Fedora 10 server in Manipal</p></div></p>
<p>PS &#8211; i am looking for a way to convince them that setting up a mirror will be helpful for them as well as students can anyone suggest me how to go about it??</p>
]]></content:encoded>
			<wfw:commentRss>http://ankurs.com/2009/06/how-manipal-got-its-first-linux-fedora-server/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Removing windows viruses from pen drives/HDD</title>
		<link>http://ankurs.com/2009/06/removing-windows-viruses-from-pen-driveshdd/</link>
		<comments>http://ankurs.com/2009/06/removing-windows-viruses-from-pen-driveshdd/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 12:05:42 +0000</pubDate>
		<dc:creator>Ankur Shrivastava</dc:creator>
				<category><![CDATA[Special]]></category>
		<category><![CDATA[folder]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[virus]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://ankurs.com/?p=530</guid>
		<description><![CDATA[last week i gave my 250GB HDD to one of my friend and when i got it back it was filled with viruses, it was that virus which creates .exe inside every , since there were a lot of folders in the HDD ( it was 200GB full ) it was practically impossible for me [...]]]></description>
			<content:encoded><![CDATA[<p>last week i gave my 250GB HDD to one of my friend and when i got it back it was filled with viruses, it was that virus which creates <folder>.exe inside every <folder>, since there were a lot of folders in the HDD ( it was 200GB full ) it was practically impossible for me to go and delete every virus in there, so i decided to make a simple script to remove these viruses here it is</p>
<p><script src="http://gist.github.com/123522.js"></script></p>
<p>Download <a href="http://gist.github.com/raw/123522/158dc4ed71fb8fe86250125eacfd9fd90b3ba2f9/rmvirus.pl">here</a></p>
<p>PS &#8211; please be careful if you have windows programs they can also get deleted </p>
]]></content:encoded>
			<wfw:commentRss>http://ankurs.com/2009/06/removing-windows-viruses-from-pen-driveshdd/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Creating your own service like tinyurl</title>
		<link>http://ankurs.com/2009/05/creating-your-own-service-like-tinyurl/</link>
		<comments>http://ankurs.com/2009/05/creating-your-own-service-like-tinyurl/#comments</comments>
		<pubDate>Sun, 24 May 2009 09:45:56 +0000</pubDate>
		<dc:creator>Ankur Shrivastava</dc:creator>
				<category><![CDATA[Stuff]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[service]]></category>
		<category><![CDATA[tinyurl]]></category>

		<guid isPermaLink="false">http://ankurs.com/?p=505</guid>
		<description><![CDATA[Few weeks ago i came across this article on Techcrunch which says tinyurl is worth $46Million (of course before twitter started using bit.ly as default) which made me think how hard is it to make a simple service like tinyurl and i figured out its not hard. so i used apache&#8217;s mod_rewrite to rewrite the [...]]]></description>
			<content:encoded><![CDATA[<p>Few weeks ago i came across <a href="http://www.techcrunch.com/2009/03/30/if-bitly-is-worth-8-million-tinyurl-is-worth-at-least-46-million/">this</a> article on Techcrunch which says tinyurl is worth $46Million (of course before twitter started using bit.ly as default) which made me think how hard is it to make a simple service like tinyurl and i figured out its not hard. so i used apache&#8217;s mod_rewrite to rewrite the url and forward the code to a php script ( url.php ) which will then search for the url in database and take the use to the original url and for shorting, url it is inserted into a table with a auto increment primary key and the key is converted to base36 which contains [a-z] and [0-9], making the short code&#8230;</p>
<p>First create a database say &#8217;shorturl&#8217;<code><br />
CREATE TABLE IF NOT EXISTS `shorturl` (<br />
`id` int(11) NOT NULL AUTO_INCREMENT,<br />
`url` varchar(300) NOT NULL,<br />
PRIMARY KEY (`id`)<br />
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;<br />
</code><br />
then create file .htaccess where you want your url to be and write<code><br />
RewriteEngine On<br />
RewriteCond %{REQUEST_URI} \/([0-9a-z]*)$ [NC]<br />
RewriteRule ^(.*) url.php?url=%1 [L]<br />
</code></p>
<p>and to create the url we will use a simple file say create.php<br />
<code><br />
&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;title&gt;Url Shortner&lt;/title&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;?php<br />
ob_start();<br />
$host=""; //host<br />
$dbuser=""; // database username<br />
$dbpass=""; // database password<br />
$db=""; //database name<br />
$con = mysql_connect($host,$dbuser,$dbpass);<br />
mysql_select_db("url",$con);<br />
if (!isset($_POST['shorten']))<br />
{<br />
echo "&lt;center&gt;&lt;h3&gt;Enter the url to shorten&lt;/h3&gt;&lt;form method='POST'&gt;&lt;input type='text' name='url' /&gt;<br />
&lt;input type='submit' name='shorten' value='Shorten' /&gt;&lt;/form&gt;&lt;/center&gt;";<br />
}<br />
else<br />
{<br />
if (isset($_POST['url']))<br />
{<br />
$url=" ".mysql_real_escape_string($_POST['url']);<br />
if (strpos($url,"http://") or strpos($url,"https://") or strpos($url,"ftp://"))<br />
{<br />
$url=mysql_real_escape_string($_POST['url']);<br />
}<br />
else<br />
{<br />
$url="http://".mysql_real_escape_string($_POST['url']);<br />
}<br />
$q="select * from url where url='{$url}'";<br />
$res = mysql_query($q,$con);<br />
$row=mysql_fetch_row($res);<br />
if (!$row)<br />
{<br />
$query="insert into url set url='{$url}'";<br />
$res = mysql_query($query,$con);<br />
}<br />
$query1="select id from url where url='{$url}' limit 1";<br />
$res=mysql_query($query1,$con);<br />
$row=mysql_fetch_row($res);<br />
echo "shortened url is http://yoursite.com/".base_convert($row[0],10,36);<br />
}<br />
}<br />
ob_end_flush();<br />
?&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
</code><br />
then our url.php file<br />
<code><br />
&lt;?php<br />
ob_start();<br />
$host=""; //host<br />
$dbuser=""; // database username<br />
$dbpass=""; // database password<br />
$db=""; //database name<br />
$con = mysql_connect($host,$dbuser,$dbpass);<br />
mysql_select_db($db,$con);<br />
if (isset($_GET['url']))<br />
{<br />
$query="select * from url where id ='".base_convert(mysql_real_escape_string($_GET['url']),36,10)."'";<br />
$res = mysql_query($query,$con);<br />
$row=mysql_fetch_row($res);<br />
header("Location: ".$row[1]);<br />
}<br />
ob_end_flush();<br />
?&gt;</code></p>
<p>Download <a href="http://ankurs.com/wp-content/uploads/2009/05/urltar.gz">here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ankurs.com/2009/05/creating-your-own-service-like-tinyurl/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Get updates of completed torrents via SMS</title>
		<link>http://ankurs.com/2009/04/get-updates-of-completed-torrents-via-sms/</link>
		<comments>http://ankurs.com/2009/04/get-updates-of-completed-torrents-via-sms/#comments</comments>
		<pubDate>Mon, 06 Apr 2009 12:13:16 +0000</pubDate>
		<dc:creator>Ankur Shrivastava</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Special]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[dbus]]></category>
		<category><![CDATA[ktorrent]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[sms]]></category>
		<category><![CDATA[torrent]]></category>
		<category><![CDATA[twit]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://ankurs.com/?p=489</guid>
		<description><![CDATA[This Sunday when i was giving DBUS a look and thinking about all the cool things possible with it, one of my friend came asking how can he control his torrents from anywhere and i thought controlling is ok, do you want SMS updates??, i fired up qdbusviewer and there it was a simple way [...]]]></description>
			<content:encoded><![CDATA[<p>This Sunday when i was giving <a href="http://www.freedesktop.org/wiki/Software/dbus">DBUS</a> a look and thinking about all the cool things possible with it, one of my friend came asking how can he control his torrents from anywhere and i thought controlling is ok, do you want SMS updates??, i fired up qdbusviewer and there it was a simple way to get sms notifications of finished torrents using well twitter and ktorrent, so here are the steps<br />
1) setup your cell phone to recieve SMS updates in twitter,<br />
2) get one more twitter account lets say ktorrent, follow ktorrent and turn device updates on,<br />
3) now save the script below say as torrenttwit.py<br />
4) now enter this ktorrent account username and password in the script below,<br />
5) start ktorrent if not already started, now run the script by typing &#8220;python torrenttwit.py&#8221;</p>
<pre>import dbus,base64,urllib2,urllib
from dbus.mainloop.glib import DBusGMainLoop

DBusGMainLoop(set_as_default=True)
username="username"
password="password"

def tweet(msg):
        request = urllib2.Request('http://twitter.com/statuses/update.json')
        request.add_header('Authorization', 'Basic %s' % base64.encodestring('%s:%s' % (username,password))[:-1])
        request.add_data(urllib.urlencode({'status': msg.encode('utf-8')}))
        opener = urllib2.build_opener()
        req= opener.open(request)

s = dbus.SessionBus()
kt = s.get_object("org.ktorrent.ktorrent","/core")

def update(k):
        torrent = s.get_object("org.ktorrent.ktorrent","/torrent/"+k)
        name = torrent.get_dbus_method("name","org.ktorrent.torrent")
        tweet("ktorrent: finished " +name())

kt.connect_to_signal("finished",update)

import gobject
loop = gobject.MainLoop()
loop.run()
</pre>
<p>you are done, now whenever a torrent finishes the script will twit and you will receive an SMS update<br />
enjoy</p>
]]></content:encoded>
			<wfw:commentRss>http://ankurs.com/2009/04/get-updates-of-completed-torrents-via-sms/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>JavaFX and Pong</title>
		<link>http://ankurs.com/2009/03/javafx-and-pong/</link>
		<comments>http://ankurs.com/2009/03/javafx-and-pong/#comments</comments>
		<pubDate>Sun, 01 Mar 2009 17:38:03 +0000</pubDate>
		<dc:creator>Ankur Shrivastava</dc:creator>
				<category><![CDATA[Stuff]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[javafx]]></category>
		<category><![CDATA[manipal]]></category>
		<category><![CDATA[mit]]></category>
		<category><![CDATA[pong]]></category>

		<guid isPermaLink="false">http://ankurs.com/?p=476</guid>
		<description><![CDATA[There was a workshop conducted by engineers form SUN in our college regarding JavaFX, which went quite well. I was planning to start with JavaFX but as there was no Official release of any Linux SDK, it kept me back but this semester i had to install Windows because of my University which wants me [...]]]></description>
			<content:encoded><![CDATA[<p>There was a workshop conducted by engineers form SUN in our college regarding <a href="http://javafx.com/">JavaFX</a>, which went quite well. I was planning to start with JavaFX but as there was no Official release of any Linux SDK, it kept me back but this semester i had to install Windows because of my University which wants me to use Visual Studio for my mini project this semester, so as i had Windows (unwillingly) on my system i planned to go and attend this JavaFX workshop.<br />
From what i have learned in these two days, JavaFX looks promising for developing Rich Internet Applications, the language is somewhat a mixture of JavaScript and Java. With Type Inference , Audio/Video support  etc making it very easy to use and create applications with.<br />
In the workshop after every thing was over we were asked to make a simple application in JavaFX, so here is my code for a Simple pong game in JavaFX<br />
the resolution is set to 1440&#215;900 you can change it to your resolution in the code<br />
<span id="more-476"></span><br />
<script type="text/javascript" src="http://snipt.net/embed/af5b15371751e9d9ebbe6b42f96d1f34"></script><br />
if you cannot see the code see <a href="http://snipt.net/ankur/a-simple-pong-game-in-javafx">here</a><br />
<br />
PS &#8211; as i dont normally boot into windows i dont think that i will do anything in it soon, i am waiting for Linux JDK to be released&#8230;&#8230;.</p>
]]></content:encoded>
			<wfw:commentRss>http://ankurs.com/2009/03/javafx-and-pong/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using Apple Keyboard in Linux (Fedora)</title>
		<link>http://ankurs.com/2009/02/using-apple-keyboard-in-linux-fedora/</link>
		<comments>http://ankurs.com/2009/02/using-apple-keyboard-in-linux-fedora/#comments</comments>
		<pubDate>Wed, 18 Feb 2009 19:23:30 +0000</pubDate>
		<dc:creator>Ankur Shrivastava</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[F key]]></category>
		<category><![CDATA[Fn]]></category>
		<category><![CDATA[keyboard]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://ankurs.com/?p=467</guid>
		<description><![CDATA[Few Days Ago i received my Apple Keyboard and i am enjoying typing on it, but having to hold down the Fn key then tap one of the F-keys to get F-keys working was irritating.
a simple solution to get it working just add this to your /etc/rc.local file
echo 2 > /sys/module/hid_apple/parameters/fnmode
and F-keys will start to [...]]]></description>
			<content:encoded><![CDATA[<p><div id="attachment_470" class="wp-caption aligncenter" style="width: 310px"><a href="http://ankurs.com/wp-content/uploads/2009/02/190220091.jpg"><img src="http://ankurs.com/wp-content/uploads/2009/02/190220091-300x225.jpg" alt="My Apple Keyboard" title="My Apple Keyboard" width="300" height="225" class="size-medium wp-image-470" /></a><p class="wp-caption-text">My Apple Keyboard</p></div><br />
Few Days Ago i received my <a href="http://www.apple.co.in/store/miscAccessories/apple_keyboard.html#overview">Apple Keyboard</a> and i am enjoying typing on it, but having to hold down the Fn key then tap one of the F-keys to get F-keys working was irritating.<br />
a simple solution to get it working just add this to your /etc/rc.local file<code><br />
echo 2 > /sys/module/hid_apple/parameters/fnmode</code><br />
and F-keys will start to work properly, enjoy</p>
<p>Update :- update for recent kernels,</p>
]]></content:encoded>
			<wfw:commentRss>http://ankurs.com/2009/02/using-apple-keyboard-in-linux-fedora/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>ION proxy login problem</title>
		<link>http://ankurs.com/2009/02/ion-proxy-login-problem/</link>
		<comments>http://ankurs.com/2009/02/ion-proxy-login-problem/#comments</comments>
		<pubDate>Sun, 15 Feb 2009 19:59:10 +0000</pubDate>
		<dc:creator>Ankur Shrivastava</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Special]]></category>
		<category><![CDATA[college]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[ION]]></category>
		<category><![CDATA[login]]></category>
		<category><![CDATA[manipal]]></category>
		<category><![CDATA[problem]]></category>
		<category><![CDATA[proxy]]></category>

		<guid isPermaLink="false">http://ankurs.com/?p=457</guid>
		<description><![CDATA[a few days ago ION (WiFi provider in Manipal University) started an ISA based proxy using NTLM authentication, which according to them was a client install!!! some people were facing problem with it, like their browsers were asking for authentication (login) again and again, and repositories were not working on Linux.
So here is a simple [...]]]></description>
			<content:encoded><![CDATA[<p>a few days ago ION (WiFi provider in Manipal University) started an ISA based proxy using <a href="http://en.wikipedia.org/wiki/NTLM">NTLM</a> authentication, which according to them was a client install!!! some people were facing problem with it, like their browsers were asking for authentication (login) again and again, and repositories were not working on Linux.<br />
So here is a simple screencast with solution for this problem it works great in Linux (esp. Fedora) i have also included configuring yum here, if someone wants to use apt-get (debian/ubuntu) they can do</p>
<p><code> export http_proxy=http://127.0.0.1:5865 </code></p>
<p>Ok coming to the main point, go and download <a href="http://sourceforge.net/projects/ntlmaps/">http://sourceforge.net/projects/ntlmaps/</a> and then watch the video <a href="http://ankurs.com/wp-content/uploads/2009/02/mov1.ogv">here</a><br />
People on windows can install python from <a href="http://python.org/ftp/python/2.6.1/python-2.6.1.msi">here</a> and then follow the steps<br />
<a href="http://ankurs.com/wp-content/uploads/2009/02/mov1.ogv">ION proxy problem solved</a><br />
Note:- If You face any problem please post back here&#8230;.<br />
PS:- every thing in Text form coming soon&#8230; (i am lazy)</p>
]]></content:encoded>
			<wfw:commentRss>http://ankurs.com/2009/02/ion-proxy-login-problem/feed/</wfw:commentRss>
		<slash:comments>52</slash:comments>
		</item>
		<item>
		<title>HowTo MPD with Pulse audio</title>
		<link>http://ankurs.com/2009/02/howto-mpd-with-pulse-audio/</link>
		<comments>http://ankurs.com/2009/02/howto-mpd-with-pulse-audio/#comments</comments>
		<pubDate>Fri, 13 Feb 2009 17:52:23 +0000</pubDate>
		<dc:creator>Ankur Shrivastava</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Stuff]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[alsa]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[daemon]]></category>
		<category><![CDATA[mpd]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[player]]></category>
		<category><![CDATA[pulse]]></category>
		<category><![CDATA[sonata]]></category>

		<guid isPermaLink="false">http://ankurs.com/?p=453</guid>
		<description><![CDATA[A Little background, i just shifted to mpd from Amarok 2.0 somewhy i dont seem to like Amarok 2 but thats a different story, For those who dont know MPD s a flexible, powerful, server-side application for playing music. which runs as a daemon and has a lot of front ends for it, Sonata being [...]]]></description>
			<content:encoded><![CDATA[<p>A Little background, i just shifted to <a href="http://en.wikipedia.org/wiki/Music_Player_Daemon">mpd</a> from Amarok 2.0 somewhy i dont seem to like Amarok 2 but thats a different story, For those who dont know MPD s a flexible, powerful, server-side application for playing music. which runs as a daemon and has a lot of front ends for it, <a href="http://sonata.berlios.de/documentation.html">Sonata</a> being a popular one.<br />
now coming to the point i use Fedora 10 and it has Pulseaudio by default, now the problem is i some time get  &#8220;NO Read Permission&#8221; in Sonata and then mpd  would stop working, in mpd.log file i will find &#8220;Error opening ALSA device &#8220;hw:0,0&#8243;: Device or resource busy&#8221; error, which means this is an pulseaudio permission issue, to solve it we need to change the mpd.conf (/etc/mpd.conf) to<br />
<code>audio_output {<br />
        type                    "pulse"<br />
        name                    "My Device"<br />
        device                  "hw:0,0"        # optional<br />
        format                  "44100:16:2"    # optional<br />
}<br />
</code><br />
then we need to add<br />
<code> load-module module-native-protocol-tcp auth-anonymous=1  </code><br />
to /etc/pulse/default.pa which gives everybody permission to use pulseaudio and thats it.</p>
]]></content:encoded>
			<wfw:commentRss>http://ankurs.com/2009/02/howto-mpd-with-pulse-audio/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>LUG Manipal&#8217;s Python Workshop</title>
		<link>http://ankurs.com/2009/01/lug-manipals-python-workshop/</link>
		<comments>http://ankurs.com/2009/01/lug-manipals-python-workshop/#comments</comments>
		<pubDate>Mon, 26 Jan 2009 07:56:13 +0000</pubDate>
		<dc:creator>Ankur Shrivastava</dc:creator>
				<category><![CDATA[Stuff]]></category>
		<category><![CDATA[lug]]></category>
		<category><![CDATA[manipal]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[workshop]]></category>

		<guid isPermaLink="false">http://ankurs.com/?p=449</guid>
		<description><![CDATA[LUG Manipal is organising a workshop on Python, which is a dynamic object-oriented programming language that can be used for many kinds of software development. It runs on Windows, Linux/Unix, Mac OS X, OS/2, Amiga, Palm Handhelds, and Nokia mobile phones. It comes with extensive standard libraries, and can be learned in a few days.
The [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_116" class="wp-caption aligncenter" style="width: 222px"><a href="http://www.lugmanipal.org/wordpress/wp-content/uploads/2009/01/python1.jpg"><img class="size-medium wp-image-116" title="Python Workshop" src="http://www.lugmanipal.org/wordpress/wp-content/uploads/2009/01/python1-212x300.jpg" alt="Python Workshop Poster" width="212" height="300" /></a><p class="wp-caption-text">Python Workshop Poster</p></div>
<p>LUG Manipal is organising a workshop on Python, which is a dynamic object-oriented programming language that can be used for many kinds of software development. It runs on Windows, Linux/Unix, Mac OS X, OS/2, Amiga, Palm Handhelds, and Nokia mobile phones. It comes with extensive standard libraries, and can be learned in a few days.<br />
The workshop requires no prerequisites, even knowledge of C is not required, it is aimed at people interested in beginning programming with Python.<br />
There is no charge for the workshop and no registration is required, everyone is invited.<br />
People using Windows are requested to Install the Following Software before coming to the workshop<br />
1) Python 2.6.1 from <a href="http://python.org/download/">here</a><br />
2) Notepad++ from <a href="http://notepad-plus.sourceforge.net/uk/site.htm">here</a></p>
<p>Note: These will also be distributed on the first day of the workshop, If you are not able to install/download them you can get them there&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://ankurs.com/2009/01/lug-manipals-python-workshop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
