<?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"
	>

<channel>
	<title>The Innovation Lover</title>
	<atom:link href="http://www.sarathlakshman.info/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sarathlakshman.info</link>
	<description>A geek's hacking workspace..</description>
	<pubDate>Thu, 12 Aug 2010 12:39:42 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
	<language>en</language>
			<item>
		<title>Exit from chroot environment - python</title>
		<link>http://www.sarathlakshman.info/2010/08/12/exit-from-chroot-environment-python/</link>
		<comments>http://www.sarathlakshman.info/2010/08/12/exit-from-chroot-environment-python/#comments</comments>
		<pubDate>Thu, 12 Aug 2010 12:38:17 +0000</pubDate>
		<dc:creator>Sarath</dc:creator>
		
		<category><![CDATA[FOSS World]]></category>

		<category><![CDATA[Google Summer of Code]]></category>

		<category><![CDATA[Pardus project]]></category>

		<category><![CDATA[chroot exit]]></category>

		<category><![CDATA[python]]></category>

		<category><![CDATA[statements]]></category>

		<guid isPermaLink="false">http://www.sarathlakshman.info/?p=541</guid>
		<description><![CDATA[chroot() is a useful system call available in most UNIX like operating systems. I have been using chroot to do several hacks for the past few years. Mostly people use chroot for fixing boot loader / GRUB. To fix GRUB, a live cd can be used to boot into a GNU/Linux system, then run
# chroot [...]]]></description>
			<content:encoded><![CDATA[<p>chroot() is a useful system call available in most UNIX like operating systems. I have been using chroot to do several hacks for the past few years. Mostly people use chroot for fixing boot loader / GRUB. To fix GRUB, a live cd can be used to boot into a GNU/Linux system, then run</p>
<p># chroot /mnt/root_partition</p>
<p>~# echo chrooted environment</p>
<p>Then, execute grub-install or any command to update GRUB configs.</p>
<p>Basically chroot makes the environment believe provided path is the root &#8220;/&#8221; of the filesystem.</p>
<p>We can exit from chrooted environment by pressing Ctrl-D.</p>
<p>chroot can be used to build chroot jail to protect server services for preventing attacker to gain complete access to the server by creating chroot jails.</p>
<p>Last day, I was working on my GSOC project Live Installer for Pardus. It was the first time, I was using chroot() in python. It had to execute a few statements in chroot environment and come back to prevous environment. But exiting from chroot environment found to be difficult and there were no direct methods to exit from it. So I had to do a little hack. I would like to share the hack so that you can reuse it without going for long search on how to do it.</p>
<div id="coding">
<pre>
import os
real_root = os.open("/", os.O_RDONLY)
os.chroot("/mnt/new_root")
# Chrooted environment
# Put statements to be executed as chroot here
os.fchdir(real_root)
os.chroot(".")

# Back to old root
os.close(real_root)
</pre>
</div>
<p>chroot() is provided by os module<br />
The major player of this hack is fchdir() which can take file descriptor has argument and change to that directory as current working directory. We open our real root using real_root = os.open(&#8221;/&#8221;, os.O_RDONLY) and its file descriptor is stored in real_root. Now chroot to new file system. Execute all the required statements. After that execute fchdir() to change current directory to old_root using real_root descriptor. Then chroot to current directory to switch back to real root.</p>
<p>Happy Hacking <img src='http://www.sarathlakshman.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.sarathlakshman.info/2010/08/12/exit-from-chroot-environment-python/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Youtube video downloader shell script</title>
		<link>http://www.sarathlakshman.info/2010/06/18/youtube-video-downloader-shell-script/</link>
		<comments>http://www.sarathlakshman.info/2010/06/18/youtube-video-downloader-shell-script/#comments</comments>
		<pubDate>Fri, 18 Jun 2010 09:15:37 +0000</pubDate>
		<dc:creator>Sarath</dc:creator>
		
		<category><![CDATA[FOSS World]]></category>

		<category><![CDATA[General]]></category>

		<category><![CDATA[My Experiments]]></category>

		<category><![CDATA[linux]]></category>

		<category><![CDATA[shell scripting]]></category>

		<category><![CDATA[video downloader]]></category>

		<category><![CDATA[youtube download]]></category>

		<guid isPermaLink="false">http://www.sarathlakshman.info/?p=531</guid>
		<description><![CDATA[Recently I were looking for youtube downloaders over the web. I found many websites filled with lot of ads. Few websites where there which gave some neat interface to download videos. I got interested and decided to write my own shell script to parse and download videos. By looking into HTTP requests, I came through [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I were looking for youtube downloaders over the web. I found many websites filled with lot of ads. Few websites where there which gave some neat interface to download videos. I got interested and decided to write my own shell script to parse and download videos. By looking into HTTP requests, I came through how downloaders work.</p>
<p>The logic is pretty simple. By passing the video_id which is received as v=videoid from youtube video URLs, to? http://www.youtube.com/get_video_info?video_id=videoid, we obtain a metadata file which contain metadata about the video we need to download. We extract a parameter called tokenid. Again pass the video_id and token to the same URL to obtain the video. We can also specify formats in which it is to be downloaded such as mp4,flv or 3gp in different video qualities. fmt=id parameter is passed to specify file format. By carefully watching the HTTP requests from youtube page, I collected variety of fmt arguments for different formats and quality. I have compiled all these info to write a youtube video downloader shell script. Download it and have fun.</p>
<div id="coding" >
<pre style="overflow:auto;">
#!/bin/bash
#Description: Youtube video downloader script
#Author: Sarath Lakshman
#url: http://sarathlakshman.info

if [ $# -ne 3 ];
then
    echo -e "Usage: $0 URL -format FORMAT\nFormats of different video qualities:\n1080 (mp4) - highest\n720  (mp4) - higher\n360  (flv) - high\n480  (flv) - low\n240  (flv) - lower\n3gp  (3gp) - least\n\nEg: $0 http://www.youtube.com/watch?v=yZPSx2r3TiY -format 1080\n"
    exit 0
fi
url=$1

declare -A formats;
declare -A extension;
formats[1080]=37;
formats[720]=22;
formats[480]=35;
formats[360]=34;
formats[240]=5;
formats[3gp]=13;

extension[1080]=mp4;
extension[720]=mp4;
extension[480]=flv;
extension[360]=flv;
extension[240]=flv;
extension[3gp]=3gp;

vid=`echo $1 | cut -d= -f2`

wget -O /tmp/meta.data "http://www.youtube.com/get_video_info?video_id=$vid&#038;el=vevo" &#038;> /dev/null

token=`sed 's/.*token=\([^&#038;=]\+\).*/\1/g' /tmp/meta.data`
title=`sed 's/.*title=\([a-zA-Z0-9%+-]\+\).*/\1/g; s/-//g; s/[%+0-9]\+/_/g' /tmp/meta.data`

echo "Downloading..."

wget -o /tmp/log.$$ -O "$title.${extension[$3]}" "http://www.youtube.com/get_video?video_id=$vid&#038;t=$token&#038;fmt=${formats[$3]}"

if grep -q "Not Found" /tmp/log.$$ ; then
    echo "Unsupported format. Please try again with lower video quality format"
    rm $title.${extension[$3]} ;
else
echo Download complete. Play $title.${extension[$3]} and enjoy \).
fi
</pre>
</div>
<p>Download the scrpt from here : <a href="http://web.sarathlakshman.info/code/youtube_dl.sh" >youtube_dl.sh</a></p>
<div id="coding">
<pre style="overflow:auto">
slynux@slynux-laptop:~/scripts$ ./youtube_dl.sh
Usage: ./youtube_dl.sh URL -format FORMAT
Formats for different video qualities:
1080 (mp4) - highest
720  (mp4) - higher
360  (flv) - high
480  (flv) - low
240  (flv) - lower
3gp  (3gp) - least

Eg: ./youtube_dl.sh http://www.youtube.com/watch?v=yZPSx2r3TiY -format 1080
</pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.sarathlakshman.info/2010/06/18/youtube-video-downloader-shell-script/feed/</wfw:commentRss>
		</item>
		<item>
		<title>diffdir : A utility to diff between directories</title>
		<link>http://www.sarathlakshman.info/2010/06/14/diffdir-a-utility-to-diff-between-directories/</link>
		<comments>http://www.sarathlakshman.info/2010/06/14/diffdir-a-utility-to-diff-between-directories/#comments</comments>
		<pubDate>Mon, 14 Jun 2010 16:46:33 +0000</pubDate>
		<dc:creator>Sarath</dc:creator>
		
		<category><![CDATA[FOSS World]]></category>

		<category><![CDATA[General]]></category>

		<category><![CDATA[My Experiments]]></category>

		<category><![CDATA[Pardus project]]></category>

		<category><![CDATA[bash]]></category>

		<category><![CDATA[diff]]></category>

		<category><![CDATA[linux]]></category>

		<category><![CDATA[pardus]]></category>

		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://www.sarathlakshman.info/?p=523</guid>
		<description><![CDATA[Hey,
I have been working on GSOC project on Pardus Live installer. I work on a separate svn branch for GSOC. When working across many files, we many need to generate diff between numerous files recursively working directory and some other branch directory. svn diff command helps only if the directories are fork of same svn [...]]]></description>
			<content:encoded><![CDATA[<p>Hey,</p>
<p>I have been working on GSOC project on Pardus Live installer. I work on a separate svn branch for GSOC. When working across many files, we many need to generate diff between numerous files recursively working directory and some other branch directory. svn diff command helps only if the directories are fork of same svn repo and with change in revisions or so.</p>
<p>I needed a generic tool to make diff out of two directories. But googling a few minutes didn&#8217;t give me pleasing results and hence I am here with my own script.</p>
<p>Try out and comment.</p>
<div id="coding">
<pre style="overflow:auto">
#!/bin/bash
#Filename: diffdir.sh
#Description: A utility to take diff of files recursively between two directories
#Author: Sarath Lakshman
#e-mail: sarathlakshman@slynux.com
#Homepage: http://www.sarathlakshman.info

olddir=$1
newdir=$2

if [ $# -ne 2 ];
then
	echo -e "\nUsage: $0 [DIR OLD] [DIR NEW] > data.diff\n\n"
	exit 0
fi

(cd $olddir; find . -type f ! -regex ".*\.svn.*" ) > /tmp/files.$$
(cd $newdir; find . -type f ! -regex ".*\.svn.*" ) >> /tmp/files.$$

sort /tmp/files.$$ -u -o /tmp/reqfiles.$$

cut -c3- /tmp/reqfiles.$$ > /tmp/uniqfiles.$$

for file in `cat /tmp/uniqfiles.$$`;
do

	[ -e "$olddir/$file" ] &#038;&#038; [ -e "$newdir/$file" ]

	if [ $? -ne 0 ];
	then

		echo [NEW] $file\:
		echo ===================================================================
		[ -e "$olddir/$file" ] &#038;&#038; cat "$olddir/$file"
		[ -e "$newdir/$file" ] &#038;&#038; cat "$newdir/$file" 

	else

		diffed_data=`diff -u "$olddir/$file" "$newdir/$file"` 

		if [[ -n $diffed_data ]];
		then

			echo $file\:
			echo ===================================================================
			echo "$diffed_data"
			echo
		fi
	fi
done
</pre>
</div>
<p>Download the script : <a href="http://web.sarathlakshman.info/code/diffdir.sh" >diffdir.sh</a></p>
<p>UPDATE : diff -Naur olddir newdir will do the stuff :p</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sarathlakshman.info/2010/06/14/diffdir-a-utility-to-diff-between-directories/feed/</wfw:commentRss>
		</item>
		<item>
		<title>InCTF hacking challenge, my team r00tkit @ second position</title>
		<link>http://www.sarathlakshman.info/2010/06/01/inctf-hacking-challenge-my-team-r00tkit-second-position/</link>
		<comments>http://www.sarathlakshman.info/2010/06/01/inctf-hacking-challenge-my-team-r00tkit-second-position/#comments</comments>
		<pubDate>Tue, 01 Jun 2010 04:45:11 +0000</pubDate>
		<dc:creator>Sarath</dc:creator>
		
		<category><![CDATA[General]]></category>

		<category><![CDATA[My Experiments]]></category>

		<category><![CDATA[bash]]></category>

		<category><![CDATA[ctf]]></category>

		<category><![CDATA[hacking]]></category>

		<category><![CDATA[linux]]></category>

		<category><![CDATA[root]]></category>

		<guid isPermaLink="false">http://www.sarathlakshman.info/?p=519</guid>
		<description><![CDATA[Recently I participated in India&#8217;s first Capture the Flag style hacking challenge, InCTF. 160 teams from all over India participated in the CTF contest. Each team consisted of at most 5 members.
The finals of the event was really fun. We had real reach machines on the network connected through a VPN. The scores are based [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I participated in India&#8217;s first Capture the Flag style hacking challenge, InCTF. 160 teams from all over India participated in the CTF contest. Each team consisted of at most 5 members.</p>
<p>The finals of the event was really fun. We had real reach machines on the network connected through a VPN. The scores are based on attacking other machines, defending, giving ethical advisories. Scores are based on Flags submission. Flags can be captured from vulnerable services on machines of other teams.</p>
<p>Each team is given a vulnerable virtual image of a GNU/Linux system with four services. We have to patch it to prevent others attacking and capturing flag from our host. We have to exploit other&#8217;s services and capture the flag.</p>
<p>The most exciting part of the game was that, we exploited a service called therasus and got a root shell.</p>
<p>We did rm -rf / on many machines of oponents and had fun watching their systems getting down <img src='http://www.sarathlakshman.info/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>My team r00tkit had only two members, my friend Syamlal and I. It was the first time we were participating for a realtime CTF event.</p>
<p>We reached second position in the hacking challenge.</p>
<p>Good work Team BIOS, CTF organizers.</p>
<p>For more see, <a href="http://inctf.amrita.ac.in/" onclick="javascript:pageTracker._trackPageview('/outbound/article/inctf.amrita.ac.in');">http://inctf.amrita.ac.in/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sarathlakshman.info/2010/06/01/inctf-hacking-challenge-my-team-r00tkit-second-position/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Narrow escape</title>
		<link>http://www.sarathlakshman.info/2010/05/19/narrow-escape/</link>
		<comments>http://www.sarathlakshman.info/2010/05/19/narrow-escape/#comments</comments>
		<pubDate>Wed, 19 May 2010 16:44:01 +0000</pubDate>
		<dc:creator>Sarath</dc:creator>
		
		<category><![CDATA[FOSS World]]></category>

		<category><![CDATA[General]]></category>

		<category><![CDATA[My Experiments]]></category>

		<category><![CDATA[photorec]]></category>

		<category><![CDATA[recovery]]></category>

		<category><![CDATA[testdisk]]></category>

		<guid isPermaLink="false">http://www.sarathlakshman.info/?p=510</guid>
		<description><![CDATA[Sometimes we get shocked when something unexpected occurs. We get stuck and feels like everything is over. Today I also had such a situation.
I was writing an important document over the last couple of days. I hadn&#8217;t kept a backup or draft, I had only single Open office text document file. While I was writing, [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes we get shocked when something unexpected occurs. We get stuck and feels like everything is over. Today I also had such a situation.</p>
<p>I was writing an important document over the last couple of days. I hadn&#8217;t kept a backup or draft, I had only single Open office text document file. While I was writing, my laptop got switch off suddenly due to some power button issue. When I powered it on and looked at the file, I got stuck. It shows 0 byte as size.<br />
I ran file filename.odt, it shows empty data. OMG. It was around 12 Pages of text and WTH !</p>
<p>I lost my hope. But I decided to go for an experiment. Installed TestDisk, which the GNU/Linux recovery suite.<br />
Ran the Photorec command. I selected the disk drive where the data is located, then chose <strong>scan unallocated space</strong>. I received 1000s of files of different format.</p>
<p>Ran,</p>
<div id="coding">
<pre>
 find . -type f -name "*.odt" | wc -l
</pre>
</div>
<p>gave me around 200 files.<br />
I thought of greping the files to find the right file. But I understood that grep over binary files won&#8217;t work.<br />
So I moved odt files to a directory.</p>
<div id="coding">
<pre>
mkdir odts
find . -type f -name "*.odt" -exec mv {} odts \;
</pre>
</div>
<p>Then I manually opened some of the files. Then I got earlier versions of the file which contains initial text only. So my breath became normal. I looked at the file size and noticed that it is of the size 27KB.<br />
So again I filtered out files using size as a contraint.</p>
<div id="coding">
<pre>
mkdir filtered_odts
find . -type f -name "*.odt" -size +27k \
-exec mv {} filtered_odts \;
</pre>
</div>
<p>So I got a list of fewer number of files. I manually found out highest size which in the order of 27K, which was the file with all text I wrote. Voila, thanks to find and testdisk. <img src='http://www.sarathlakshman.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.sarathlakshman.info/2010/05/19/narrow-escape/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Pardus YALI - a case study on GSoc Project</title>
		<link>http://www.sarathlakshman.info/2010/05/16/pardus-yali-a-case-study-on-gsoc-project/</link>
		<comments>http://www.sarathlakshman.info/2010/05/16/pardus-yali-a-case-study-on-gsoc-project/#comments</comments>
		<pubDate>Sun, 16 May 2010 13:08:02 +0000</pubDate>
		<dc:creator>Sarath</dc:creator>
		
		<category><![CDATA[FOSS World]]></category>

		<category><![CDATA[General]]></category>

		<category><![CDATA[Google Summer of Code]]></category>

		<category><![CDATA[Pardus project]]></category>

		<category><![CDATA[linux]]></category>

		<category><![CDATA[live installer]]></category>

		<category><![CDATA[pardus]]></category>

		<category><![CDATA[python]]></category>

		<category><![CDATA[yali]]></category>

		<guid isPermaLink="false">http://www.sarathlakshman.info/?p=505</guid>
		<description><![CDATA[Being a python and? code enthusiast, The most exciting feature about Pardus project is about their designs. All the of the applications pardus teams has ever written are awesome with their beauty in their code design. When ever you look at any project&#8217;s code, they are very transparent, readable and highly modular designs.
I am hacking [...]]]></description>
			<content:encoded><![CDATA[<p>Being a python and? code enthusiast, The most exciting feature about Pardus project is about their designs. All the of the applications pardus teams has ever written are awesome with their beauty in their code design. When ever you look at any project&#8217;s code, they are very transparent, readable and highly modular designs.</p>
<p>I am hacking with YALI ( Yet Another Linux Installer) Project for developing a Live OS installer. I went through the basic code and came up with an over view of YALI architecture. Hope this would be helpful for future YALI contributors and developers also.</p>
<p><strong>Working of Yali4:</strong><br />
Yali starts with xdm service, which runs start-yali4 shell script. It runs /usr/bin/yali4-bin using /usr/bin/xinit and runs in fullscreen mode without KDE WM environment.<br />
It invokes the method yali4.default_runner() which is yali4.gui.runner.Runner()</p>
<p>Pardus has its own service scripting and management technology COMAR. xdm is a comar script to serve as service for loading X.</p>
<p><strong>runner.py:</strong><br />
Runner class servers as the major class which runs the Yali. It imports the main widget from gui/YaliWindow.py (Widget class). Widget class is Setup_ui using Ui_YaliMain (main.ui)<br />
Resolution and screen size is set to maximum by reading QApplication.desktop()</p>
<p>Yali has a configuration system to behave as per different install_type.</p>
<div id="coding">
<pre style="overflow:auto" >

YALI_INSTALL,YALI_DVDINSTALL, YALI_FIRSTBOOT, YALI_OEMINSTALL, YALI_PLUGIN, YALI_PARTITIONER, YALI_RESCUE = range(7) is defined in gui/installdata.py
</pre>
</div>
<p>In Runner class, it checks which sets install_type variable according to the configuration.</p>
<p>gui/context.py defines many constants and context variables (yali4/constants.py) . yali4.sysutils.</p>
<div id=":xv" class="ii gt">checkYaliParams() is used to identify the install_type configuration,<br />
which can be passed as argument to kernel parameter.</p>
<p>In Runner, it creates an installer object by passing install_type and install_option to yali4.installer.Yali(). install_option is identified by yali4.sysutils.checkYaliOptions()</p>
<p><strong>installer.py:</strong></p>
<p>Yali class in installer.py is the main class which handles the Yali screens. Yali4 operates with the concept of screens.? mainStack Widget in the main.ui is called screen.<br />
We dynamically load and remove different screen widgets required for the instalallation wizard. The base fullscreen UI is setup by runner and the screen is loaded from installer.py<br />
Yali class in installer.py defines screen list for each install_type defined. Eg: self._screens[YALI_DVDINSTALL]</p>
<p>All different screens as defined as seperate .py files with name prefixed with Scr in yali4/gui. Each of these screen py files consist of a QWidget class Widget.<br />
Widget class gui/YaliWindow.py has createWidgets() method which loads the required screens for given install_type. stackMove() method is used to show each screen<br />
at appropriate time according to user interaction.</p>
<p><strong>Changes/Work for Live installer</strong><br />
Most of the components required for the live installer can be reuse of existing screens from Yali4 and APIs.</p>
<p>To make Yali work as window mode and change the window size to a required size, yali4/Ui/main.ui require some changes as well as runner.py require some changes to prevent it from<br />
resizing to available full screen width and height.</p>
<p>We need to add a new a new install_type YALI_LIVEINSTALL in gui/installdata.py</p>
<p>Instead of yali4/gui/ScrInstall.py, which handles installation for real pardus install medias. we have to write a new screen, ScrLiveinstall.py which can handle<br />
installation from Live media.</p>
<p>yali4/installer.py will require an entry for YALI_LIVEINSTALL,</p>
<div id="coding">
<pre style="overflow:auto" >

self._screens[YALI_LIVEINSTALL] = [                                  # Numbers can be used with -s paramter
                                       yali4.gui.ScrKahyaCheck,          # 00
                                       yali4.gui.ScrWelcome,             # 01
                                       yali4.gui.ScrCheckCD,             # 02
                                       yali4.gui.ScrKeyboard,            # 03
                                       yali4.gui.ScrDateTime,            # 04
                                       yali4.gui.ScrUsers,               # 05
                                       yali4.gui.ScrAdmin,               # 06
                                       yali4.gui.ScrPartitionAuto,       # 07
                                       yali4.gui.ScrPartitionManual,     # 08
                                       yali4.gui.ScrBootloader,          # 09
                                       yali4.gui.ScrSummary,             # 10
                                       yali4.gui.ScrLiveinstall,         # 11
                                       yali4.gui.ScrGoodbye              # 12
                                      ]
</pre>
</div>
<p>Above changes are required to bring a minimal Live installer.</p></div>
<div class="ii gt"></div>
<div class="ii gt">I have written a basic command line minimal Pardus Live installer,? <a href="http://web.sarathlakshman.info/gsoc/pardus/installer.py"  target="_blank">http://web.sarathlakshman.info/gsoc/pardus/installer.py</a>. Most of the required logic appears in its code.<br />
<span style="color: #888888;"> </span></div>
]]></content:encoded>
			<wfw:commentRss>http://www.sarathlakshman.info/2010/05/16/pardus-yali-a-case-study-on-gsoc-project/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Goodbye to SMSBuddy [zombie post]</title>
		<link>http://www.sarathlakshman.info/2010/04/29/goodbye-to-smsbuddy-zombie-post/</link>
		<comments>http://www.sarathlakshman.info/2010/04/29/goodbye-to-smsbuddy-zombie-post/#comments</comments>
		<pubDate>Thu, 29 Apr 2010 13:50:52 +0000</pubDate>
		<dc:creator>Sarath</dc:creator>
		
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.sarathlakshman.info/?p=498</guid>
		<description><![CDATA[It is very sad to announce SMSBuddy will be no more available. I went through the &#8220;Terms and Conditions&#8221; agreement of Way2SMS.com. 
Please see the agreement: http://wwwg.way2sms.com/content/Terms%20&#038;%20Conditions.html
The agreement states that users should not make derivative work based on this proprietary service. So I am sadfully saying good bye to SMSBuddy.
SMSBuddy came up as interesting project [...]]]></description>
			<content:encoded><![CDATA[<p>It is very sad to announce SMSBuddy will be no more available. I went through the &#8220;Terms and Conditions&#8221; agreement of Way2SMS.com. </p>
<p>Please see the agreement: <a href="http://wwwg.way2sms.com/content/Terms%20&#038;%20Conditions.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/wwwg.way2sms.com');">http://wwwg.way2sms.com/content/Terms%20&#038;%20Conditions.html</a></p>
<p>The agreement states that users should not make derivative work based on this proprietary service. So I am sadfully saying good bye to SMSBuddy.</p>
<p>SMSBuddy came up as interesting project with lots of feedback in the recent days. It expected it to come up as yet another interesting open source projects.<br />
Not only I coded for SMSBuddy, I also received contributions on code and UI.</p>
<p>Hiran has contributed on UI and Icon.</p>
<p>Anoop (gnuanu) has written a frontend in wxWidgets. He mainly wrote it for his colleagues to use on Windows boxes :P. He has sent me some screenshots of the UI he wrote, which works on Windows 7.<br />
I am posting the screen shots here:</p>
<table style="width:auto;">
<tr>
<td><a href="http://picasaweb.google.com/lh/photo/NeNEWvkgEBofLVfgi5XAtA?feat=embedwebsite" onclick="javascript:pageTracker._trackPageview('/outbound/article/picasaweb.google.com');"><img src="http://lh5.ggpht.com/_DtNSSwv0BQs/S9mH-YxmbxI/AAAAAAAAA_s/qd8AcmCvod8/s800/login.png" /></a></td>
</tr>
<tr>
<td style="font-family:arial,sans-serif; font-size:11px; text-align:right">From <a href="http://picasaweb.google.com/sarathlakshman/LifeBlog?feat=embedwebsite" onclick="javascript:pageTracker._trackPageview('/outbound/article/picasaweb.google.com');">life.blog</a></td>
</tr>
</table>
<table style="width:auto;">
<tr>
<td><a href="http://picasaweb.google.com/lh/photo/DDbnfglGyChLomYnqBFjnQ?feat=embedwebsite" onclick="javascript:pageTracker._trackPageview('/outbound/article/picasaweb.google.com');"><img src="http://lh6.ggpht.com/_DtNSSwv0BQs/S9mH-VQjW7I/AAAAAAAAA_w/EYXUryrYwzI/s800/selectcontact.png" /></a></td>
</tr>
<tr>
<td style="font-family:arial,sans-serif; font-size:11px; text-align:right">From <a href="http://picasaweb.google.com/sarathlakshman/LifeBlog?feat=embedwebsite" onclick="javascript:pageTracker._trackPageview('/outbound/article/picasaweb.google.com');">life.blog</a></td>
</tr>
</table>
<table style="width:auto;">
<tr>
<td><a href="http://picasaweb.google.com/lh/photo/DBWCb5-Pb1_7e8J2YKu7fQ?feat=embedwebsite" onclick="javascript:pageTracker._trackPageview('/outbound/article/picasaweb.google.com');"><img src="http://lh5.ggpht.com/_DtNSSwv0BQs/S9mH-v4NlNI/AAAAAAAAA_0/xxvjr_zZA-A/s400/mainwindow.png" /></a></td>
</tr>
<tr>
<td style="font-family:arial,sans-serif; font-size:11px; text-align:right">From <a href="http://picasaweb.google.com/sarathlakshman/LifeBlog?feat=embedwebsite" onclick="javascript:pageTracker._trackPageview('/outbound/article/picasaweb.google.com');">life.blog</a></td>
</tr>
</table>
<table style="width:auto;">
<tr>
<td><a href="http://picasaweb.google.com/lh/photo/c7n-JS9GWN9m_icPb3zqWw?feat=embedwebsite" onclick="javascript:pageTracker._trackPageview('/outbound/article/picasaweb.google.com');"><img src="http://lh5.ggpht.com/_DtNSSwv0BQs/S9mH-hsp4NI/AAAAAAAAA_4/vElJlKUiCdc/s800/addcontact.png" /></a></td>
</tr>
<tr>
<td style="font-family:arial,sans-serif; font-size:11px; text-align:right">From <a href="http://picasaweb.google.com/sarathlakshman/LifeBlog?feat=embedwebsite" onclick="javascript:pageTracker._trackPageview('/outbound/article/picasaweb.google.com');">life.blog</a></td>
</tr>
</table>
<p>Again we have to make the same statement &#8220;Proprietary software sucks&#8221;<br />
When we talk a lot about Free Software philosophy, people ask sometime questions that they haven&#8217;t encountered any problems with it. I am talking to those people. Hey guys, you have found this &#8220;SMSBuddy&#8221; interesting right ?. But are not able to use it and distribute. Why ? We are restricted with our freedom. It is restricted not with technology. But by license agreement. Which is the worst part of proprietary software. If they restrict us to provide another interface by intelligently blocking such applications which uses them as backend. It is truly a technological attempt. We have to respect their technology and we will have curiosity to know how it is done. But here, they are just putting restrictions on us for use of technology. We are restricted with our freedom.</p>
<p>Proprietary software puts locks on our creativity. It was a creative idea to write such an application. But we are not allowed. Freedom is valuable in the case of software too.</p>
<p>Free software gives us the following four freedoms:<br />
    *  The freedom to run the program, for any purpose (freedom 0).<br />
    * The freedom to study how the program works, and change it to make it do what you wish (freedom 1). Access to the source code is a precondition for this.<br />
    * The freedom to redistribute copies so you can help your neighbor (freedom 2).<br />
    * The freedom to distribute copies of your modified versions to others (freedom 3). By doing this you can give the whole community a chance to benefit from your changes. Access to the source code is a precondition for this.</p>
<p>So use free software. Spread free software. Be muft and mukt with software.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sarathlakshman.info/2010/04/29/goodbye-to-smsbuddy-zombie-post/feed/</wfw:commentRss>
		</item>
		<item>
		<title>SMSBuddy v0.1 release [zombie]</title>
		<link>http://www.sarathlakshman.info/2010/04/27/smsbuddy-v01-release/</link>
		<comments>http://www.sarathlakshman.info/2010/04/27/smsbuddy-v01-release/#comments</comments>
		<pubDate>Tue, 27 Apr 2010 14:08:23 +0000</pubDate>
		<dc:creator>Sarath</dc:creator>
		
		<category><![CDATA[FOSS World]]></category>

		<category><![CDATA[My Experiments]]></category>

		<category><![CDATA[free sms]]></category>

		<category><![CDATA[linux]]></category>

		<category><![CDATA[qt]]></category>

		<category><![CDATA[way2sms]]></category>

		<guid isPermaLink="false">http://www.sarathlakshman.info/?p=483</guid>
		<description><![CDATA[Hey all.
  Here comes the Free SMS sender application with Qt frontend, python and Wat2SMS.com web backend. This is based on my recent free sms commandline script.
Try this out and comment. Look at the screenshots.





From life.blog







From life.blog







From life.blog







From life.blog







From life.blog







From life.blog


Once you install the SMSbuddy, you can execute it using the command, &#8217;smsbuddy&#8217;
During first [...]]]></description>
			<content:encoded><![CDATA[<p>Hey all.</p>
<p><img src="http://lh6.ggpht.com/_DtNSSwv0BQs/S9hBYtuvQkI/AAAAAAAAA_I/zr2H_qqCxM0/icon.png" alt="smsbuddy icon" align="left" />  Here comes the Free SMS sender application with Qt frontend, python and Wat2SMS.com web backend. This is based on my recent free sms commandline script.</p>
<p>Try this out and comment. Look at the screenshots.</p>
<table style="width:auto;">
<tr>
<td><a href="http://picasaweb.google.com/lh/photo/HFc3XMOj3w2DcRrMG37JCQ?feat=embedwebsite" onclick="javascript:pageTracker._trackPageview('/outbound/article/picasaweb.google.com');"><img src="http://lh5.ggpht.com/_DtNSSwv0BQs/S9booifoHAI/AAAAAAAAA-U/yVTr0jPoyH4/s400/Screenshot-1.png" /></a></td>
</tr>
<tr>
<td style="font-family:arial,sans-serif; font-size:11px; text-align:right">From <a href="http://picasaweb.google.com/sarathlakshman/LifeBlog?feat=embedwebsite" onclick="javascript:pageTracker._trackPageview('/outbound/article/picasaweb.google.com');">life.blog</a></td>
</tr>
</table>
<table style="width:auto;">
<tr>
<td><a href="http://picasaweb.google.com/lh/photo/JymCraBzAgG87w_DlfdDHw?feat=embedwebsite" onclick="javascript:pageTracker._trackPageview('/outbound/article/picasaweb.google.com');"><img src="http://lh3.ggpht.com/_DtNSSwv0BQs/S9boompKmII/AAAAAAAAA-Y/3kDVBs0MUZI/s400/Screenshot-2.png" /></a></td>
</tr>
<tr>
<td style="font-family:arial,sans-serif; font-size:11px; text-align:right">From <a href="http://picasaweb.google.com/sarathlakshman/LifeBlog?feat=embedwebsite" onclick="javascript:pageTracker._trackPageview('/outbound/article/picasaweb.google.com');">life.blog</a></td>
</tr>
</table>
<table style="width:auto;">
<tr>
<td><a href="http://picasaweb.google.com/lh/photo/4ZjB10tVOwHWQlG6SDDSFQ?feat=embedwebsite" onclick="javascript:pageTracker._trackPageview('/outbound/article/picasaweb.google.com');"><img src="http://lh3.ggpht.com/_DtNSSwv0BQs/S9boo_5lC0I/AAAAAAAAA-c/HsYnu4C1iLA/s400/Screenshot-3.png" /></a></td>
</tr>
<tr>
<td style="font-family:arial,sans-serif; font-size:11px; text-align:right">From <a href="http://picasaweb.google.com/sarathlakshman/LifeBlog?feat=embedwebsite" onclick="javascript:pageTracker._trackPageview('/outbound/article/picasaweb.google.com');">life.blog</a></td>
</tr>
</table>
<table style="width:auto;">
<tr>
<td><a href="http://picasaweb.google.com/lh/photo/kidsd-lZuLw7UK25PNn8og?feat=embedwebsite" onclick="javascript:pageTracker._trackPageview('/outbound/article/picasaweb.google.com');"><img src="http://lh6.ggpht.com/_DtNSSwv0BQs/S9bopE7Df4I/AAAAAAAAA-g/nVx-oiJdoMY/s400/Screenshot-4.png" /></a></td>
</tr>
<tr>
<td style="font-family:arial,sans-serif; font-size:11px; text-align:right">From <a href="http://picasaweb.google.com/sarathlakshman/LifeBlog?feat=embedwebsite" onclick="javascript:pageTracker._trackPageview('/outbound/article/picasaweb.google.com');">life.blog</a></td>
</tr>
</table>
<table style="width:auto;">
<tr>
<td><a href="http://picasaweb.google.com/lh/photo/cnxKzZ15MGpOa3aD-B-rBg?feat=embedwebsite" onclick="javascript:pageTracker._trackPageview('/outbound/article/picasaweb.google.com');"><img src="http://lh5.ggpht.com/_DtNSSwv0BQs/S9bopVIRNZI/AAAAAAAAA-k/JerU4l3aSxs/s400/Screenshot-5.png" /></a></td>
</tr>
<tr>
<td style="font-family:arial,sans-serif; font-size:11px; text-align:right">From <a href="http://picasaweb.google.com/sarathlakshman/LifeBlog?feat=embedwebsite" onclick="javascript:pageTracker._trackPageview('/outbound/article/picasaweb.google.com');">life.blog</a></td>
</tr>
</table>
<table style="width:auto;">
<tr>
<td><a href="http://picasaweb.google.com/lh/photo/xVe3XB5OaTvdqxsSGXhbJg?feat=embedwebsite" onclick="javascript:pageTracker._trackPageview('/outbound/article/picasaweb.google.com');"><img src="http://lh4.ggpht.com/_DtNSSwv0BQs/S9boyhYX-uI/AAAAAAAAA-o/3sz8AcXXQlQ/s400/Screenshot-6.png" /></a></td>
</tr>
<tr>
<td style="font-family:arial,sans-serif; font-size:11px; text-align:right">From <a href="http://picasaweb.google.com/sarathlakshman/LifeBlog?feat=embedwebsite" onclick="javascript:pageTracker._trackPageview('/outbound/article/picasaweb.google.com');">life.blog</a></td>
</tr>
</table>
<p>Once you install the SMSbuddy, you can execute it using the command, &#8217;smsbuddy&#8217;<br />
During first run, it will ask for login username and password. You can issue you Way2SMS.com username and password. From the very next run, it will not prompt for authentication. Once if you need to change the account used by default, use File->Login to change the default account.<br />
From File->Contacts option, you can add contacts of your friends with name and mobile number.<br />
Once the SMSbuddy is started, it initiates login. You can see status message in the status bar. You can select the contacts you added using contacts dialog and send SMS.<br />
<strong><br />
Download it from here <a href="#">code removed</a></strong></p>
<p>I wrote this being lazy at home today and having Hartal celebration <img src='http://www.sarathlakshman.info/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> So don&#8217;t expect any code quality.</p>
<p>Have fun <img src='http://www.sarathlakshman.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Looking forward to your comments.<br />
<strong><br />
UPDATE1:</strong> SMSBuddy got a new icon. Thanks to <a href="http://hiran.in" onclick="javascript:pageTracker._trackPageview('/outbound/article/hiran.in');">Hiran</a> for the icon. Please note that I have updated the download url. Please the URL above. Now the icon appears in Applications -> Accessories menu and in the desktop. Have fun.</p>
<p><strong><br />
UPDATE2:</strong> I went through the &#8220;Terms and conditions&#8221; of way2sms.com.It says users are not possible to make derivative works or decompile based on this sms service. So it violates the license agreement and hence I will not be possible to continue with SMSBuddy. Hence I am removing the code and will not be distributing it anymore.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sarathlakshman.info/2010/04/27/smsbuddy-v01-release/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Google Summer of Code 2010</title>
		<link>http://www.sarathlakshman.info/2010/04/27/google-summer-of-code-2010/</link>
		<comments>http://www.sarathlakshman.info/2010/04/27/google-summer-of-code-2010/#comments</comments>
		<pubDate>Tue, 27 Apr 2010 03:15:31 +0000</pubDate>
		<dc:creator>Sarath</dc:creator>
		
		<category><![CDATA[FOSS World]]></category>

		<category><![CDATA[General]]></category>

		<category><![CDATA[Google Summer of Code]]></category>

		<category><![CDATA[Pardus project]]></category>

		<category><![CDATA[2010 summer of code]]></category>

		<category><![CDATA[foss]]></category>

		<category><![CDATA[google summer of code]]></category>

		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.sarathlakshman.info/?p=476</guid>
		<description><![CDATA[
Finally this year&#8217;s Google Summer of Code 2010 students are announced. Glad to announce, I am one of them  
This is my third year of participation with Google Summer of Code programs. It was fun working with different project and mentors along the recent years. This year&#8217;s selection procedures gave me a lot of [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://1.bp.blogspot.com/_p15UnEJyA1c/S9IuRqv-ELI/AAAAAAAAAXE/mpB-BL_l19k/s320/2010_300x267px.jpg" align="left"></p>
<p>Finally this year&#8217;s Google Summer of Code 2010 students are announced. Glad to announce, I am one of them <img src='http://www.sarathlakshman.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>This is my third year of participation with Google Summer of Code programs. It was fun working with different project and mentors along the recent years. This year&#8217;s selection procedures gave me a lot of input and support while talking to some of new mentors from different organisations Gentoo and Meego. I am with the Pardus due to my Pardus love. I enjoy it. But I missed other projects since I can work only on one project. I am thinking of working on the project I had proposed (not in gsoc context.) for fun.</p>
<p>This time I will be developing Live OS installer for Pardus. Also I will be developing Live CD creator from a Pardus installation. Optionally I have some more ideas out of gsoc context with Pardus, being a pardus developer. I will be writing a pisi-offline tool which is similar to Apt-On-CD on Ubuntu. But the one I am developing will be much better than Apt-On-CD which works based on package cache. But pisi-offline will not rely on cache. But the real installed applications.</p>
<p>My assigned mentor for the project is Mete Alpaslan, who is the author of Yali4 installer for Pardus <img src='http://www.sarathlakshman.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Project link: <a href="http://socghop.appspot.com/gsoc/student_project/show/google/gsoc2010/pardus/t127230768169" onclick="javascript:pageTracker._trackPageview('/outbound/article/socghop.appspot.com');">http://socghop.appspot.com/gsoc/student_project/show/google/gsoc2010/pardus/t127230768169</a></p>
<p>There is more glad news from my College, there is one more student from my College. Narayanan K, who would be working with OAR suite. His project url :<a href="http://socghop.appspot.com/gsoc/student_project/show/google/gsoc2010/oar/t127230761183" onclick="javascript:pageTracker._trackPageview('/outbound/article/socghop.appspot.com');">http://socghop.appspot.com/gsoc/student_project/show/google/gsoc2010/oar/t127230761183</a></p>
<p>Congrats to all students <img src='http://www.sarathlakshman.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sarathlakshman.info/2010/04/27/google-summer-of-code-2010/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Send free SMS from commandline</title>
		<link>http://www.sarathlakshman.info/2010/04/26/send-free-sms-from-commandline/</link>
		<comments>http://www.sarathlakshman.info/2010/04/26/send-free-sms-from-commandline/#comments</comments>
		<pubDate>Mon, 26 Apr 2010 04:51:34 +0000</pubDate>
		<dc:creator>Sarath</dc:creator>
		
		<category><![CDATA[General]]></category>

		<category><![CDATA[My Experiments]]></category>

		<category><![CDATA[automation]]></category>

		<category><![CDATA[free]]></category>

		<category><![CDATA[free sms]]></category>

		<category><![CDATA[python]]></category>

		<category><![CDATA[sms]]></category>

		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.sarathlakshman.info/?p=469</guid>
		<description><![CDATA[Disclaimer: My intention of writing this post and publishing the code that uses a proprietary service is not to provide a derivative work based on way2sms.com, but for educational purpose only. The code given below clearly illustrates how python like intuitive programming language can be used to create interesting interactive web based applications. Use the [...]]]></description>
			<content:encoded><![CDATA[<p><em><strong>Disclaimer:</strong> My intention of writing this post and publishing the code that uses a proprietary service is not to provide a derivative work based on way2sms.com, but for educational purpose only. The code given below clearly illustrates how python like intuitive programming language can be used to create interesting interactive web based applications. Use the following code for educational purpose only.</em></p>
<p>Last few days I had negative balance on my phone and I was very lazy to go out for a recharge. I couldn&#8217;t send any sms due to underbalance. So I had to rely on Way2SMS.com for free sms. The web interface with lots of ads and stuff irritated me. I thought it would be great if I have some utility/command that can perform the sms sending task for me <img src='http://www.sarathlakshman.info/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>So I wrote a python script for sending free sms from commandline. I am enjoying it.</p>
<p>Here it is. Have a try <img src='http://www.sarathlakshman.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>Instructions:</strong><br />
1. Go to www.way2sms.com, Create an account<br />
2. Create a text file ~/.smsconf and write following lines in it</p>
<div id="coding">
<pre>
username=your_mob_no_as_user
password=password_you_registered
</pre>
</div>
<p>3. Copy the following code to sms_send.py<br />
$ chmod a+x sms_send.py</p>
<div id="coding">
<pre style="overflow:auto" >
#!/usr/bin/env python
#Author: Sarath Lakshman ( sarathlakshman [at] slynux.com )

import urllib2,urllib,re,os

opener=urllib2.build_opener(urllib2.HTTPCookieProcessor())

customer_id=""
first_time=True
configs={}

config_handle = file(os.path.expanduser('~/.smsconf'),"r+")
config_lines = config_handle.readlines()
if len(config_lines) > 2:
    first_time=False

for line in config_lines:
    splits = line.strip().split('=')
    configs[splits[0]]=splits[1]

customer_id_regex = re.compile("custfrom[0-9]*")
success_re = re.compile("Message has been submitted successfully")

print "Logging in"

login=urllib.urlencode({'username':configs["username"], 'password':configs["password"],'login':'Login'})

opener.open("http://wwwo.way2sms.com//auth.cl", login)

if first_time:

    print "First run: Pulling customer identity..."
    handle=opener.open("http://wwwo.way2sms.com//jsp/InstantSMS.jsp?val=0")
    data=handle.read()
    customer_id=customer_id_regex.findall(data)[0]
    config_handle.write("custid=%s" %customer_id)

else:
    customer_id=configs["custid"]

config_handle.close()

print
mobno=raw_input("Enter mobile no: ")
message=raw_input("Enter message: ")
print

print "Sending.."

send_msg=urllib.urlencode({'HiddenAction':'instantsms', 'Action':customer_id,'MobNo':mobno,'textArea':message})
handle=opener.open("http://wwwo.way2sms.com//FirstServletsms?custid=",send_msg)

if len(success_re.findall(handle.read())) == 1:
    print "Message has been submitted successfully"
else:
    print "Could not complete your request"
print 
</pre>
</div>
<p>4. Try it out.</p>
<div id="coding">
<pre>
$ ./sms_send.py
Logging in

Enter mobile no: xxxxxxxxxx
Enter message: cool

Sending..
Message has been submitted successfully
</pre>
</div>
<p>Looking forward to your comments <img src='http://www.sarathlakshman.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>TODO: Here is your task. Write a GTK/Qt frontend for this.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sarathlakshman.info/2010/04/26/send-free-sms-from-commandline/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
