<?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:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
	xmlns:media="http://search.yahoo.com/mrss/"
>

<channel>
	<title>A Glimpse of GNU/Linux</title>
	<atom:link href="http://www.maxinbjohn.info/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.maxinbjohn.info</link>
	<description>Life, Fun and Free Software</description>
	<lastBuildDate>Wed, 16 Nov 2011 10:32:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<!-- podcast_generator="podPress/8.8" -->
		<copyright>&#xA9; </copyright>
		<managingEditor>maxin@maxinbjohn.info ()</managingEditor>
		<webMaster>maxin@maxinbjohn.info()</webMaster>
		<category></category>
		<itunes:keywords></itunes:keywords>
		<itunes:subtitle></itunes:subtitle>
		<itunes:summary>Life, Fun and Free Software</itunes:summary>
		<itunes:author></itunes:author>
		<itunes:category text="Society &amp; Culture"/>
		<itunes:owner>
			<itunes:name></itunes:name>
			<itunes:email>maxin@maxinbjohn.info</itunes:email>
		</itunes:owner>
		<itunes:block>No</itunes:block>
		<itunes:explicit>no</itunes:explicit>
		<itunes:image href="http://www.maxinbjohn.info/wp-content/plugins/podpress/images/powered_by_podpress_large.jpg" />
		<image>
			<url>http://www.maxinbjohn.info/wp-content/plugins/podpress/images/powered_by_podpress.jpg</url>
			<title>A Glimpse of GNU/Linux</title>
			<link>http://www.maxinbjohn.info</link>
			<width>144</width>
			<height>144</height>
		</image>
		<item>
		<title>Support Wikipedia !</title>
		<link>http://www.maxinbjohn.info/2011/11/16/support-wikipedia/</link>
		<comments>http://www.maxinbjohn.info/2011/11/16/support-wikipedia/#comments</comments>
		<pubDate>Wed, 16 Nov 2011 10:32:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.maxinbjohn.info/?p=3207361</guid>
		<description><![CDATA[I support Wikipedia. Donate to the Wikimedia Foundation and ensure that the Knowledge is shared to the future generations too.]]></description>
			<content:encoded><![CDATA[<p>I support Wikipedia. Donate to the Wikimedia Foundation and ensure that the Knowledge is shared to the future generations too. </p>
<p><a href="http://wikimediafoundation.org/wiki/Support_Wikipedia/en"><img border="0" alt="Support Wikipedia" src="//upload.wikimedia.org/wikipedia/commons/d/d3/Fundraising_2009-square-share-en.png" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.maxinbjohn.info/2011/11/16/support-wikipedia/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linuxgazette app for Android Platform</title>
		<link>http://www.maxinbjohn.info/2011/06/05/linuxgazette-net-app-for-android-and-windows-mobile/</link>
		<comments>http://www.maxinbjohn.info/2011/06/05/linuxgazette-net-app-for-android-and-windows-mobile/#comments</comments>
		<pubDate>Sun, 05 Jun 2011 12:52:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.maxinbjohn.info/?p=3207344</guid>
		<description><![CDATA[Today, I have created Android and Windows Mobile apps for www.linuxgazette.net Linuxgazette app for Android Thanks to www.appmakr.com for a &#8220;code-less&#8221; app generation for Android and Windows mobile platforms !! Thanks to Vishnu, Arun and Jithendra for installing and using the Linuxgazette.net application on Nexus, Wildfire and Xperia handsets.]]></description>
			<content:encoded><![CDATA[<p>Today, I have created Android and Windows Mobile apps for www.linuxgazette.net</p>
<p><img src="http://www.maxinbjohn.info/android-logo.png" alt="Android App" /><a href="http://www.maxinbjohn.info/linuxgazette.apk"> Linuxgazette app for Android</a></p>
<p>Thanks to <a href="http://www.appmakr.com">www.appmakr.com</a> for a &#8220;code-less&#8221; app generation for Android and Windows mobile platforms !!<br />
Thanks to Vishnu, Arun and Jithendra for installing and using the Linuxgazette.net application on Nexus, Wildfire and Xperia handsets.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.maxinbjohn.info/2011/06/05/linuxgazette-net-app-for-android-and-windows-mobile/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A quick fascination with QR (Quick Response) codes</title>
		<link>http://www.maxinbjohn.info/2011/04/25/a-quick-fascination-with-qr-quick-response-codes/</link>
		<comments>http://www.maxinbjohn.info/2011/04/25/a-quick-fascination-with-qr-quick-response-codes/#comments</comments>
		<pubDate>Mon, 25 Apr 2011 23:19:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.maxinbjohn.info/?p=3207333</guid>
		<description><![CDATA[The QR codes makes our life real easy. If you have the right QR Code reader application in your mobile, you just need to show your mobile to the QR code and bingo you got the text/content/app in your mobile&#8230; You don&#8217;t need to type anything. I almost got addicted to this technology when I [...]]]></description>
			<content:encoded><![CDATA[<p>The QR codes makes our life real easy. If you have the right QR Code reader application in your mobile, you just need to show your mobile to the QR code and bingo you got the text/content/app in your mobile&#8230; You don&#8217;t need to type anything. I almost got addicted to this technology when I started using the Android Mobiles.. Just click and there you go&#8230;</p>
<p>More information is available from Wikipedia:</p>
<p>http://en.wikipedia.org/wiki/QR_code</p>
<p>To make our own QR codes in Ubuntu, we need to follow these steps:</p>
<p>First, install the Library for QR encoding: &#8220;libqrencode&#8221; :<br />
# wget http://fukuchi.org/works/qrencode/qrencode-3.1.1.tar.bz2<br />
# tar jxvf qrencode-3.1.1.tar.bz2<br />
# cd qrencode-3.1.1/<br />
# ./configure &#8211;prefix=/usr<br />
# make<br />
# sudo make install</p>
<p>This will install the &#8220;qrencode library&#8221; as well as the &#8220;qrencode&#8221; application to create the QR codes.<br />
Eg. The following command will create the QR codes for you:<br />
# qrencode http://www.maxinbjohn.info -o maxinbjohn.png -s 10</p>
<p>If you are not satisfied with this application and do some programming in Python, then go on and follow these steps:</p>
<p># git clone https://github.com/bitly/pyqrencode.git<br />
# cd pyqrencode/<br />
# sudo python setup.py install</p>
<p>This will install the &#8220;qrencode&#8221; module for Python. A simple python program to create a very personal QR code:<br />
$ cat hello.py<br />
from qrencode import Encoder<br />
enc = Encoder()<br />
image = enc.encode(&#8216;http://www.maxinbjohn.info&#8217;)<br />
image.save(&#8216;maxin.png&#8217;)</p>
<p>The output of this program :<br />
<img src="http://www.maxinbjohn.info/maxin.png" alt="QR code for www.maxinbjohn.info" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.maxinbjohn.info/2011/04/25/a-quick-fascination-with-qr-quick-response-codes/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>GNOME3 .. the awesomest gnome ever&#8230;</title>
		<link>http://www.maxinbjohn.info/2011/04/06/gnome3-the-awesomest-gnome-ever/</link>
		<comments>http://www.maxinbjohn.info/2011/04/06/gnome3-the-awesomest-gnome-ever/#comments</comments>
		<pubDate>Wed, 06 Apr 2011 19:47:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.maxinbjohn.info/?p=3207320</guid>
		<description><![CDATA[Gnome 3.. with its superb looks, by far, the best Desktop experience ever.. Now, I am a gnome fan.. once again]]></description>
			<content:encoded><![CDATA[<p>Gnome 3.. with its superb looks, by far, the best Desktop experience ever..</p>
<p><img src="http://www.maxinbjohn.info/gnome3.png"  width="800" height="495" alt="Gnome 3 in my laptop" /></p>
<p>Now, I am a gnome fan.. once again <img src='http://www.maxinbjohn.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
<a title="Help promote GNOME 3!" href="https://live.gnome.org/ThreePointZero/Promote"><img border="0" alt="I am GNOME" src="http://www.gnome.org/wp-content/uploads/2011/04/iamgnome.png"/></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.maxinbjohn.info/2011/04/06/gnome3-the-awesomest-gnome-ever/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Python Script to automate the Assembly Language Debugger</title>
		<link>http://www.maxinbjohn.info/2011/04/04/python-script-to-automate-the-assembly-language-debugger/</link>
		<comments>http://www.maxinbjohn.info/2011/04/04/python-script-to-automate-the-assembly-language-debugger/#comments</comments>
		<pubDate>Mon, 04 Apr 2011 18:54:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.maxinbjohn.info/?p=3207313</guid>
		<description><![CDATA[The Assembly Language Debugger is a tool for debugging Linux elf files (executable programs) at the assembly level. ALD is available here: http://ald.sourceforge.net/ This script makes it easy to collect the complete disassembled output from ald : disas.py eg: # python disas.py ./a.out This script uses &#8220;expect&#8221; to collect the complete disassembled output of the [...]]]></description>
			<content:encoded><![CDATA[<p>The Assembly Language Debugger is a tool for debugging Linux elf files (executable programs) at the assembly level. </p>
<p>ALD is available here: <a href="http://ald.sourceforge.net/">http://ald.sourceforge.net/</a></p>
<p>This script makes it easy to collect the complete disassembled output from ald : <a href="http://www.maxinbjohn.info/scripts/disas.txt">disas.py</a><br />
eg:<br />
# python disas.py ./a.out</p>
<p>This script uses &#8220;expect&#8221; to collect the complete disassembled output of the executable file. Without this script, the user will have to keep on pressing &#8220;enter&#8221; to collect the complete output from ald. </p>
<p># This post will be moved to the random scripts page shortly</p>
]]></content:encoded>
			<wfw:commentRss>http://www.maxinbjohn.info/2011/04/04/python-script-to-automate-the-assembly-language-debugger/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Man with the GPLv3 Watch</title>
		<link>http://www.maxinbjohn.info/2011/04/01/the-man-with-the-gplv3-watch/</link>
		<comments>http://www.maxinbjohn.info/2011/04/01/the-man-with-the-gplv3-watch/#comments</comments>
		<pubDate>Fri, 01 Apr 2011 21:04:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.maxinbjohn.info/?p=3207301</guid>
		<description><![CDATA[I received my Ez430 Chronos Wireless watch development kit yesterday. A watch with temperature sensor, Pressure sensor, 3 axis accelerometer and a CC430-based development system for just $49. TI just priced it right&#8230; There were some programs to use the watch as Mouse , Controlling the PPTs and so on. Still, I wasn&#8217;t so happy, [...]]]></description>
			<content:encoded><![CDATA[<p>I received my Ez430 Chronos Wireless watch development kit yesterday. A watch with temperature sensor, Pressure sensor, 3 axis accelerometer and a CC430-based development system for just $49. TI just priced it right&#8230;</p>
<p><img src="http://www.maxinbjohn.info/ez4301.jpg" width="400" height="300"  alt="EZ430 Chronos Development kit" /></p>
<p>There were some programs to use the watch as Mouse , Controlling the PPTs and so on. Still, I wasn&#8217;t so happy, because I didn&#8217;t get to see what&#8217;s &#8220;inside&#8221; the watch &#8212; &#8220;The Internals of the firmware&#8221; <img src='http://www.maxinbjohn.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Time for building the &#8220;OpenChronos&#8221; firmware for the watch. It is licensed under GPL v3 and we will get to see the code from here:<br />
<a href="https://github.com/poelzi/OpenChronos/">https://github.com/poelzi/OpenChronos/</a></p>
<p>Make sure you are connected to INTERNET.</p>
<p>Prepare the development environment in your PC or Laptop. Lets start with the MSPGCC tool chain.<br />
# sudo su<br />
# apt-get install makeinfo<br />
# git clone git://mspgcc4.git.sourceforge.net/gitroot/mspgcc4/mspgcc4<br />
# cd mspgcc4 &amp;&amp; perl buildgcc.pl</p>
<p>select the default choices for the toolchain build options.<br />
# make<br />
The MSP430-GCC toolchain will get installed in the default path: /opt/msp430-gcc-4.4.5</p>
<p>Get the OpenChronos source:<br />
# git clone https://github.com/poelzi/OpenChronos.git</p>
<p>If you havent read the GPLv3 License till now, please do so from the OpenChronos directory<br />
# vim gpl-3.txt</p>
<p>Export the msp430 toolchain PATH<br />
# export PATH=$PATH:/opt/msp430-gcc-4.4.5/bin/</p>
<p>Go to Openchronos directory, choose the modules for the firmware and build it.<br />
This is similar to the &#8216;make menuconfig&#8217; of the Linux kernel build procedure:</p>
<p># make config<br />
# make</p>
<p>If everything goes well, you will get these two files in &#8220;build&#8221; directory.</p>
<p>eZChronos.elf<br />
eZChronos.txt</p>
<p>choose the ezChronos.txt (TI specific format for the CC430)</p>
<p>Go to the (default) path of eZ430 Control Center.<br />
# cd /usr/local/eZ430-Chronos Setup/Control Center/Chronos Control Center<br />
# ./eZ430-Chronos_CC_1_1.tcl</p>
<p>In the Control Center&#8217;s Flash tab, Select the &#8220;eZChronos.txt&#8221;. Set the Watch into &#8220;RFBSL&#8221; mode and start flashing.</p>
<p>You can see the percentage of flashing process in the LCD of the watch. Within a minute, the OpenChronos firmware will kick into action.<br />
Switch the watch to &#8220;SYNC&#8221; mode and update the date and time from your Linux PC. Now wear it.. You are the &#8220;Man with the GPLv3 Watch&#8221;</p>
<p>With default TI firmware:<br />
<img src="http://www.maxinbjohn.info/ez4302.jpg" width="400" height="300"  alt="EZ430 watch with default firmware" /><br />
With OpenChronos firmware:<br />
<img src="http://www.maxinbjohn.info/ez4303.jpg" width="400" height="300" alt="EZ430 watch with OpenChronos firmware" /></p>
<p>FAQ:<br />
1. Why are you calling this post as &#8220;Man with the GPLv3 Watch&#8221;<br />
I am a huge fan of James Bond Movies. This name is inspired by &#8220;The Man with the Golden Gun&#8221; (Roger Moore, Christopher Lee)</p>
<p>2. How do you understand that your watch uses the &#8220;original&#8221; TI firmware or OpenChronos firmware ?<br />
1. Original firmware dont show the &#8220;day of the week&#8221;<br />
2. OpenChronos firmware doesnt support the &#8220;BlueRobin&#8221; (Just press the * key to check it)<br />
3. Most visible change is in the &#8216;ACC&#8217; mode. It is shown as &#8220;ACC&#8221; in orignal firmware, where as it is &#8220;Acc&#8221; in OpenChronos firmware</p>
<p>Official list is as below:<br />
* More Features that can be configured with make config<br />
* Day of week<br />
* Disable 12h support (saves space)<br />
* Sleep Phase Clock &#8211; primary designed for http://github.com/poelzi/uberclock<br />
* The wireless flashing starts differently:<br />
Select RFBSL, Press DOWN to unlock, Press # long to start<br />
* No BlueRobin support. BlueRobin is a closed source binary blob.<br />
We don&#8217;t have a compatible object file for that<br />
* Pressing STAR and UP long sets silent mode (no beep)</p>
<p>3. What is the use of using the GPLv3 Licensed firmware on your watch?<br />
Technically, it gives me the freedom to read, study and modify the firmware of this watch.<br />
Well, I just want to use Free Softwares in all the equipments that I use. This just makes me happy <img src='http://www.maxinbjohn.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
4. Where can I get more information ?<br />
* <a href="http://processors.wiki.ti.com/index.php/EZ430-Chronos">http://processors.wiki.ti.com/index.php/EZ430-Chronos</a><br />
* <a href="http://mspgcc4.sourceforge.net/">http://mspgcc4.sourceforge.net/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.maxinbjohn.info/2011/04/01/the-man-with-the-gplv3-watch/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The Linux Foundation Credit Cards !</title>
		<link>http://www.maxinbjohn.info/2011/03/29/the-linux-foundation-credit-cards/</link>
		<comments>http://www.maxinbjohn.info/2011/03/29/the-linux-foundation-credit-cards/#comments</comments>
		<pubDate>Tue, 29 Mar 2011 09:10:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.maxinbjohn.info/?p=3207292</guid>
		<description><![CDATA[Personally, I never liked the Financial fundamentals behind the Credit Cards. However, due to some personal requirements, I have decided to go for a credit card. I got my credit card from Nordea Bank, last month. I would have applied for the Credit cards much earlier, if these Credit cards were present in India.. Yes. [...]]]></description>
			<content:encoded><![CDATA[<p>Personally, I never liked the Financial fundamentals behind the Credit Cards. However, due to some personal requirements, I have decided to go for a credit card. I got my credit card from Nordea Bank, last month.</p>
<p>I would have applied for the Credit cards much earlier, if these Credit cards were present in India..</p>
<p><img src="http://us.personalcard.net/allaboutme/designer/pcs/getpublicdesign.aspx?cardimageid=3ljbnann8" alt="Linux Foundation Credit Card 1" /><br />
<img src="http://us.personalcard.net/allaboutme/designer/pcs/getpublicdesign.aspx?cardimageid=3w1yj25l5" alt="Linux Foundation Credit Card 2" /></p>
<p>Yes. You can go for these cards if you are in US. It is provided by UMB Financial Corporation.</p>
<p>You can apply for The Linux Foundation Visa® Platinum Rewards Card here: <a href="http://www.cardpartner.com/app/the-linux-foundation">http://www.cardpartner.com/app/the-linux-foundation</a></p>
<p>Happy Hacking and Shopping</p>
]]></content:encoded>
			<wfw:commentRss>http://www.maxinbjohn.info/2011/03/29/the-linux-foundation-credit-cards/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A simple C program to calculate Levenshtein distance</title>
		<link>http://www.maxinbjohn.info/2011/03/16/a-simple-c-program-to-calculate-levenshtein-distance/</link>
		<comments>http://www.maxinbjohn.info/2011/03/16/a-simple-c-program-to-calculate-levenshtein-distance/#comments</comments>
		<pubDate>Wed, 16 Mar 2011 16:45:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.maxinbjohn.info/?p=3207271</guid>
		<description><![CDATA[Levenshtein distance is a metric for measuring the amount of difference between two sequence. The sequences will be strings in most of the real life cases. More information is available at Wikipedia:    http://en.wikipedia.org/wiki/Levenshtein_distance Its a simple program to implement it. /****************************************************** * A simple program to calculate Levenshtein distance * * * * http://en.wikipedia.org/wiki/Levenshtein_distance * [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Levenshtein distance</strong> is a metric for measuring the amount of difference between two sequence. The sequences will be strings in most of the real life cases.</p>
<p>More information is available at Wikipedia:    http://en.wikipedia.org/wiki/Levenshtein_distance</p>
<p>Its a simple program to implement it.</p>
<pre>/******************************************************
 * A simple program to calculate Levenshtein distance *
 *                                                    *
 * http://en.wikipedia.org/wiki/Levenshtein_distance  *
 *                                                    *
 ******************************************************/

#include&lt;stdio.h&gt;
#include&lt;string.h&gt;
int levenshtein_compare(const char *s1, const char *s2)
{
    int l1 = strlen(s1);
    int l2 = strlen(s2);
    return l1 != l2 ? l1 - l2 : strcmp(s1, s2);
}

int main()
{
    const char *str1 = "strong";
    const char *str2 = "string";
    printf("Levenshtein Distance is %d \n", levenshtein_compare(str1, str2));
    return 0;
}</pre>
<p>&nbsp;</p>
<p>If you want to think of it in Python, here it goes:</p>
<p># Python program for simple lavenshtein distance calculation</p>
<p>def levenshtein_compare(s1, s2):<br />
len1 = len(s1)<br />
len2 = len(s2)<br />
if (len1 != len2):<br />
ret_val =  len1 &#8211; len2<br />
else:<br />
ret_val = cmp(s2,s1) #(s1 &gt; s2) &#8211; (s1 &lt; s2)<br />
return ret_val</p>
<p>if __name__ == &#8220;__main__&#8221;:<br />
print &#8220;Distance is:&#8221;,  levenshtein_compare(&#8220;paintt&#8221;, &#8220;past&#8221;)</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.maxinbjohn.info/2011/03/16/a-simple-c-program-to-calculate-levenshtein-distance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux Gazette March edition</title>
		<link>http://www.maxinbjohn.info/2011/03/16/linux-gazetter-march-edition/</link>
		<comments>http://www.maxinbjohn.info/2011/03/16/linux-gazetter-march-edition/#comments</comments>
		<pubDate>Wed, 16 Mar 2011 11:26:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.maxinbjohn.info/?p=3207264</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><script language="javascript" type="text/javascript"
src="http://linuxgazette.net/lg.js"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.maxinbjohn.info/2011/03/16/linux-gazetter-march-edition/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Let others to locate you in the world using Android, Python, PHP and Google Maps</title>
		<link>http://www.maxinbjohn.info/2010/12/11/let-others-to-locate-you-in-the-world-using-android-python-php-and-google-maps/</link>
		<comments>http://www.maxinbjohn.info/2010/12/11/let-others-to-locate-you-in-the-world-using-android-python-php-and-google-maps/#comments</comments>
		<pubDate>Sat, 11 Dec 2010 10:59:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.maxinbjohn.info/?p=3207248</guid>
		<description><![CDATA[Android, Python, PHP, Google Maps, Locate-mii]]></description>
			<content:encoded><![CDATA[<p>&#8220;Locate mii&#8221; &#8211; a DIY solution to publish your location to the web so that other people can locate &#8220;where in the world you are !!&#8221;</p>
<p>To locate me now, go to this URL:<br />
<a rel="nofollow" href="http://goo.gl/QThKv" target="_blank">http://goo.gl/QThKv</a></p>
<p>Requirements:</p>
<p>1 .An Android Phone with Android scripting environment (for Python support).</p>
<p>2. A GPRS connection to push your latitude and longitude values to the web server</p>
<p>3. A website where you can run PHP scripts (Otherwise, you can use the Local wireless setup with Internet connection)</p>
<p>Design:</p>
<p>1. A Python script reads the latitude and longitude values from the Android&#8217;s GPS and pushes it to the web server using GPRS</p>
<p>2. A PHP script in the web server to parse and write the submitted values to corresponding files in the server</p>
<p>3. Another PHP files to read those latitude and longitude values from server and pass it to the Google Maps api to help others locate you in this world</p>
<p>Code :</p>
<p>1. livegps.py ( To fetch and submit latitude and longitude to the web from an android phone)</p>
<p>Available at :<a href="http://pastebin.com/HusGn77z"> http://pastebin.com/HusGn77z</a></p>
<p>==========================================================</p>
<p>&#8221;&#8217;<br />
Started on 10, Dec 2010 by Maxin B. John &lt;maxinbjohn@gmail.com&gt;<br />
This file is licensed under the GPLv3<br />
&#8221;&#8217;</p>
<p>import android<br />
import urllib2<br />
import time<br />
import string</p>
<p>droid = android.Android()</p>
<p>def get_update_gps_status():<br />
&#8221;&#8217; GET and Update the GPS status in Server&#8221;&#8217;</p>
<p># PHP script expects the longitude and latitude in the URL as given below<br />
GPS_URL=&#8217;http://www.maxinbjohn.info/locate-mii/test.php?lat=%s&amp;long=%s&#8217;<br />
# begins the gps location process in Phone<br />
droid.startLocating()<br />
# giving some time for the phone to think <img src='http://www.maxinbjohn.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
time.sleep(10)</p>
<p>try:<br />
# read the latitude and longitude from the phone<br />
loc= droid.readLocation()[1]<br />
# check for Null in pythonic way<br />
if loc:<br />
longitude = loc['network']['longitude']<br />
latitude =  loc['network']['latitude']<br />
# prepares the URL as expected by the PHP script<br />
url = GPS_URL % (latitude, longitude)<br />
print url<br />
try:<br />
# submits the latitude and longitude values to the web page<br />
handler = urllib2.urlopen(url)<br />
# to ensure the data submission<br />
data = handler.read()<br />
except URLError:<br />
print &#8220;Error in Connection!&#8221;<br />
finally:<br />
handler.close()<br />
except:<br />
print &#8220;Error in getting the lattitde and longitude values!&#8221;</p>
<p>if __name__ == &#8216;__main__&#8217;:<br />
&#8221;&#8217; Updating the GPS status in Server &#8221;&#8217;<br />
while True:<br />
get_update_gps_status()</p>
<p>=======================================================</p>
<p>2. test.php (sorry for the horrible naming.. It&#8217;s a simple PHP script to write down the latitude and longitude values)</p>
<p>Available at:  <a href="http://pastebin.com/A71D2ka9">http://pastebin.com/A71D2ka9</a></p>
<p>=========================================</p>
<p>&lt;html&gt;<br />
&lt;?<br />
$latitude = $_GET['lat'];<br />
$longitude = $_GET['long'];<br />
$latf = &#8220;mylattitude.txt&#8221;;<br />
$longf = &#8220;mylongitude.txt&#8221;;<br />
$latfh = fopen($latf, &#8216;w&#8217;) or die(&#8220;can&#8217;t open file&#8221;);<br />
fwrite($latfh, $latitude);<br />
fclose($latfh);<br />
$longfh = fopen($longf, &#8216;w&#8217;) or die(&#8220;can&#8217;t open file&#8221;);<br />
fwrite($longfh, $longitude);<br />
fclose($longfh);<br />
echo &#8220;var mylocation = new google.maps.LatLng($latitude, $longitude);&#8221;;<br />
?&gt;<br />
&lt;/html&gt;</p>
<p>=========================================</p>
<p>3. locate-mii.php</p>
<p>Available here:<a href="http://pastebin.com/89kpCGtp"> http://pastebin.com/89kpCGtp</a></p>
<p>============================================</p>
<p>&lt;!DOCTYPE html&gt;<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;meta name=&#8221;viewport&#8221; content=&#8221;initial-scale=1.0, user-scalable=no&#8221; /&gt;<br />
&lt;meta http-equiv=&#8221;content-type&#8221; content=&#8221;text/html; charset=UTF-8&#8243;/&gt;</p>
<p>&lt;title&gt;Locate Mii&lt;/title&gt;<br />
&lt;link href=&#8221;http://code.google.com/apis/maps/documentation/javascript/examples/default.css&#8221; rel=&#8221;stylesheet&#8221; type=&#8221;text/css&#8221; /&gt;<br />
&lt;script type=&#8221;text/javascript&#8221; src=&#8221;http://maps.google.com/maps/api/js?sensor=true&#8221;&gt;&lt;/script&gt;<br />
&lt;script type=&#8221;text/javascript&#8221;&gt;</p>
<p>var initialLocation;<br />
&lt;?<br />
$filename1 = &#8220;./mylattitude.txt&#8221;;<br />
$handle1 = fopen($filename1, &#8220;r&#8221;) or die(&#8220;can&#8217;t open file&#8221;);<br />
$lattitude = fread($handle1, filesize($filename1));<br />
fclose($handle1);</p>
<p>$filename2 = &#8220;./mylongitude.txt&#8221;;<br />
$handle2 = fopen($filename2, &#8220;r&#8221;) or die(&#8220;can&#8217;t open file&#8221;);<br />
$longitude = fread($handle2, filesize($filename2));<br />
fclose($handle2);<br />
?&gt;<br />
var mylocation = new google.maps.LatLng(&lt;? echo $lattitude ; ?&gt;,&lt;? echo $longitude; ?&gt;);<br />
var browserSupportFlag =  new Boolean();<br />
var map;<br />
var infowindow = new google.maps.InfoWindow();</p>
<p>function initialize() {<br />
var myOptions = {<br />
zoom: 18,<br />
mapTypeId: google.maps.MapTypeId.ROADMAP<br />
};<br />
map = new google.maps.Map(document.getElementById(&#8220;map_canvas&#8221;), myOptions);</p>
<p>browserSupportFlag = false;<br />
handleNoGeolocation(browserSupportFlag);<br />
}</p>
<p>function handleNoGeolocation(errorFlag) {<br />
initialLocation = mylocation;<br />
contentString = &#8220;I am here!&#8221;;<br />
map.setCenter(initialLocation);<br />
infowindow.setContent(contentString);<br />
infowindow.setPosition(initialLocation);<br />
infowindow.open(map);<br />
}<br />
&lt;/script&gt;<br />
&lt;/head&gt;<br />
&lt;body onload=&#8221;initialize()&#8221;&gt;<br />
&lt;div id=&#8221;map_canvas&#8221;&gt;&lt;/div&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p>
<p>==========================================</p>
<p>Todo:</p>
<p>1.   Code cleanup</p>
<p>2 .  Auto refreshing of google maps page</p>
<p>Warning:</p>
<p>It&#8217;s a DIY thing. I haven&#8217;t incorporated any security measures to the code. Code is really ugly and logic is pretty simple.</p>
<p>Finally don&#8217;t blame me if your boss locates you in a Cinema hall while you are in &#8220;Sick leave&#8221; <img src='http://www.maxinbjohn.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Comments are welcome !!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.maxinbjohn.info/2010/12/11/let-others-to-locate-you-in-the-world-using-android-python-php-and-google-maps/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

