<?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>Thoughts of a coder</title>
	<atom:link href="http://www.sandaru1.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sandaru1.com</link>
	<description>It's how I think! It's how I code!</description>
	<pubDate>Fri, 09 May 2008 01:21:25 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>Freedom of choice&#8230;</title>
		<link>http://www.sandaru1.com/2008/05/09/freedom-of-choice/</link>
		<comments>http://www.sandaru1.com/2008/05/09/freedom-of-choice/#comments</comments>
		<pubDate>Fri, 09 May 2008 01:14:54 +0000</pubDate>
		<dc:creator>sandaruwan</dc:creator>
		
		<category><![CDATA[General]]></category>

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

		<category><![CDATA[Open Source]]></category>

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

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

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

		<guid isPermaLink="false">http://www.sandaru1.com/?p=139</guid>
		<description><![CDATA[&#8220;Every human has four endowments - self awareness, conscience, independent will and creative imagination. These give us the ultimate human freedom&#8230; The power to choose, to respond, to change.&#8221; - Stephen R. Covey
Here is a list of choices I made :
Operating System : Linux
There are lot of reasons why you should use linux : easy [...]]]></description>
			<content:encoded><![CDATA[<p>&#8220;<em>Every human has four endowments - self awareness, conscience, independent will and creative imagination. These give us the ultimate human freedom&#8230; The power to choose, to respond, to change.</em>&#8221; - <strong>Stephen R. Covey</strong></p>
<p>Here is a list of choices I made :</p>
<p><strong>Operating System</strong> : <a href="http://en.wikipedia.org/wiki/Linux">Linux</a></p>
<p>There are lot of reasons why you should use linux : easy access to software, no viruses/adware, fast, possibility of configuring every bit. There is also a long list reasons why you shouldn&#8217;t run linux, which I don&#8217;t agree with most of them, except some great Windows only(may be Mac supported) software like Photoshop; and few drivers.</p>
<p><strong>Desktop</strong> : <a href="http://www.gnome.org/">GNOME</a><br />
Simple elegant interface. Pretty stable.</p>
<p><a href='http://www.sandaru1.com/wp-content/uploads/2008/05/gnome.png'><img src="http://www.sandaru1.com/wp-content/uploads/2008/05/gnome-300x240.png" alt="Gnome Desktop" title="gnome" width="300" height="240" class="alignright size-medium wp-image-142" /></a></p>
<p><strong>Window Manager</strong> : <a href="http://www.compiz.org/">compiz</a> (<a href="http://www.compiz-fusion.org/">compiz-fusion</a>)<br />
Rather than the cool 3D effects, there are some really useful plugins in compiz. For example : Expo, Scale.</p>
<p><a href='http://www.sandaru1.com/wp-content/uploads/2008/05/expo.png'><img src="http://www.sandaru1.com/wp-content/uploads/2008/05/expo-150x150.png" alt="Expo Plugin" title="expo" width="150" height="150" class="alignnone size-thumbnail wp-image-140" /></a> <a href='http://www.sandaru1.com/wp-content/uploads/2008/05/scale.png'><img src="http://www.sandaru1.com/wp-content/uploads/2008/05/scale-150x150.png" alt="Scale Plugin" title="scale" width="150" height="150" class="alignnone size-thumbnail wp-image-143" /></a></p>
<p><strong>Web Browser</strong> : <a href="http://www.mozilla.com/firefox/">Firefox 2</a><br />
Firefox 3 has some great fixes on critical bugs like memory leaks, but there is one flaw. Some of the plugins I&#8217;m using are not available/stable for Firefox 3. So, I&#8217;ll stick to Firefox 2 for few more months.</p>
<p><strong>Mail Client</strong> : <a href="http://www.mozilla.com/thunderbird/">Thunderbird</a><br />
I&#8217;m not a heavy user of the desktop mail clients. I only use thunderbird for one of my mail accounts. There is no specific reason I&#8217;m choosing thunderbird over <a href="http://www.gnome.org/projects/evolution/">evolution</a>, just like the interface.</p>
<p><strong>IM</strong> : <a href="http://www.pidgin.im/">piding</a> / <a href="http://emesene.org/">emesene</a><br />
Pidgin is one of the best multi protocol IM clients available in linux(<a href="http://kopete.kde.org">kopete</a> is also nice). Depicts the fact it supports many protocols, that&#8217;s only basic features. Most of my friends are using MSN network, and emesene is capable of handling those, and thousand times better than the crappy <a href="http://www.amsn-project.net">aMSN</a> interface.</p>
<p><strong>VOIP</strong> : <a href="http://www.skype.com/">Skype</a><br />
Just one word : clear</p>
<p><strong>IRC</strong> : <a href="http://www.xchat.org/">xchat</a><br />
Nice interface. </p>
<p><strong>File Transfer (ftp/sftp)</strong> :  <a href="http://filezilla-project.org">Filezilla</a>/<a href="http://en.wikipedia.org/wiki/GVFS">GVFS</a><br />
If I&#8217;m using a separate client for file transfer, that would definitely filezilla, but it&#8217;s much easier to mount the shares directly using GVFS and use it like a local directory.</p>
<p><strong>Word Processing</strong> : <a href="http://www.abisource.com/">abiword</a><br />
It&#8217;s a light weighted, really fast word processor. Even though it&#8217;s light weighted, all necessary features are there.</p>
<p><strong>Graphics</strong> : <a href="http://www.adobe.com/products/photoshop/">Adobe Photoshop</a><br />
Yes, Adobe Photoshop, that&#8217;s the best I&#8217;ve ever seen. I never got along with gimp. Anyhow, I rarely mess with graphical stuff, yet I still miss Photoshop.</p>
<p><strong>Text Editor/IDE</strong> : <a href="http://www.gnome.org/projects/gedit/">gedit</a><br />
Simple, clean interface and have syntax highlighting. I can survive without an integrated debugger. </p>
<p><a href='http://www.sandaru1.com/wp-content/uploads/2008/05/gedit.png'><img src="http://www.sandaru1.com/wp-content/uploads/2008/05/gedit-300x240.png" alt="GEdit" title="gedit" width="300" height="240" class="alignnone size-medium wp-image-141" /></a></p>
<p><strong>Video Player</strong> : <a href="http://www.mplayerhq.hu/">mplayer</a>/<a href="http://www.videolan.org/vlc/">vlc</a><br />
Those will play almost anything.</p>
<p><strong>Audio player</strong> : <a href="http://banshee-project.org">banshee</a><br />
Banshee has a nice audio library management features. Similar artists + cover info rocks.<br />
Worth mentioning : one of the best media library management softwares I&#8217;ve seen is <a href="http://www.microsoft.com/windows/windowsmedia/players.aspx">Windows Media player</a>.</p>
<p><strong>Twitter Client</strong> : <a href="http://live.gnome.org/DanielMorales/Twitux">twitux</a><br />
Very stable, with many features. <a href="http://www.twhirl.org">twhirl</a> is stunning, but adobe AIR still doesn&#8217;t support tray icons on linux.</p>
<p><strong>File Sharing</strong> : <a href="http://en.wikipedia.org/wiki/BitTorrent_%28protocol%29">bittorrent</a><br />
The content is reliable - well you have to read the comments.</p>
<p><strong>Torrent client</strong> : <a href="http://azureus.sourceforge.net">azureus</a><br />
Many features + plugins. I&#8217;m using the webui plugin, with auto start init script. (If you are curious, there is a azureus command line option : &#8211;ui=console)</p>
<p><strong>Email Service</strong> : <a href="http://www.gmail.com/">gmail</a> / <a href="https://www.google.com/a/">Google apps</a><br />
It&#8217;s the cool ajax interface. The usage of conversations instead of individual mails is also remarkable. I&#8217;m using google apps to handle my gunathilake.com domain.</p>
<p><strong>RSS Reader</strong> : <a href="http://reader.google.com/">Google Reader</a><br />
Easy to use. Rather than a desktop RSS client, I can access it from anywhere. When I&#8217;m at somewhere with an internet connection killing time, I always have something to do. The sharing feature is handy too.</p>
<p><strong>Photo sharing</strong> : <a href="http://picasa.google.com/">Picasa</a><br />
It&#8217;s the desktop application - It&#8217;s easier to upload.</p>
<p><strong>Blogging platform</strong> : <a href="http://www.wordpress.org/">wordpress</a><br />
Wordpress is a solid, easy to use platform. From a developers point of view, it&#8217;s internal structure is amazing. </p>
<p><strong>Bookmarking</strong> : <a href="http://www.foxmarks.com/">foxmarks</a><br />
I tried to use social bookmarking sites like <a href="http://del.icio.us/">del.icio.us</a>. But I don&#8217;t bookmark much, so I just use the firefox builtin bookmarking. I don&#8217;t want to experience losing my bookmarks again, that&#8217;s why I&#8217;m using foxmarks.</p>
<p><strong>Web Developer plugins</strong> : <a href="http://www.getfirebug.com">firebug</a> / <a href="http://addons.mozilla.org/firefox/addon/60">web developer toolbar</a><br />
Just check the plugins - you&#8217;ll see.</p>
<p><strong>Virtualization</strong> : <a href="http://www.virtualbox.org/">VirtualBox</a><br />
I&#8217;m using VirtualBox to access IE to test sites. VirtualBox has nice integration features like free mouse.</p>
<p><a href='http://www.sandaru1.com/wp-content/uploads/2008/05/virtualbox.png'><img src="http://www.sandaru1.com/wp-content/uploads/2008/05/virtualbox-300x240.png" alt="VirtualBox" title="virtualbox" width="300" height="240" class="alignnone size-medium wp-image-144" /></a></p>
<p><strong>What I read</strong><br />
Except reading my friends blogs, here are few feeds from my RSS reader.</p>
<ul>
<li><a href="http://www.techcrunch.com">Techcrunch</a> - I believe they have spies all over the world. Anything related to startups, it&#8217;s over there. Easy to keep track of what&#8217;s happening on the internet.</li>
<li><a href="http://www.linuxtoday.com/">Linux today</a> - Everything related to linux/open source</li>
<li><a href="http://planet.gnome.org">Gnome planet</a> - Some nice content over there, related to gnome.</li>
<li><a href="http://www.readwriteweb.com">ReadWriteWeb</a> - This is like techcrunch. Techcrunch gives you more news, this will give you analysis/comparisons.</li>
<li><a href="http://www.smashingmagazine.com">Smashing Magazine</a> - A source to get inspired - collections of creative work all over the internet.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.sandaru1.com/2008/05/09/freedom-of-choice/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Gnome Online Desktop</title>
		<link>http://www.sandaru1.com/2008/04/13/gnome-online-desktop/</link>
		<comments>http://www.sandaru1.com/2008/04/13/gnome-online-desktop/#comments</comments>
		<pubDate>Sun, 13 Apr 2008 11:49:12 +0000</pubDate>
		<dc:creator>sandaruwan</dc:creator>
		
		<category><![CDATA[Hacks]]></category>

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

		<category><![CDATA[Open Source]]></category>

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

		<guid isPermaLink="false">http://www.sandaru1.com/?p=135</guid>
		<description><![CDATA[Few years ago, the internet is mostly used for information and emails. Over the fast few years, it has changed a lot. Recently(around last two years), the desktop applications started to consume the power of web. Since then, some platforms yet not much popular emerged, like Mozilla Prims, Adobe AIR.
But as for today, generally, the [...]]]></description>
			<content:encoded><![CDATA[<p>Few years ago, the internet is mostly used for information and emails. Over the fast few years, it has changed a lot. Recently(around last two years), the desktop applications started to consume the power of web. Since then, some platforms yet not much popular emerged, like <a href="http://wiki.mozilla.org/Prism">Mozilla Prims</a>, <a href="http://www.adobe.com/products/air/">Adobe AIR</a>.</p>
<p>But as for today, generally, the online applications and desktop are separated. <a href="http://live.gnome.org/OnlineDesktop">Gnome Online Desktop</a> tries to bridge the gap between those two.</p>
<p>This weekend, I gave it a trail run. Here it goes :</p>
<p><strong>Installation</strong></p>
<p>I installed the system on Ubuntu Gusty, which doesn&#8217;t have online desktop is repositories (I think only fedora have them). So, I had to build from the sources. I followed <a href="http://live.gnome.org/OnlineDesktop/Jhbuild">the building guide</a> they have given on using jhbuild. </p>
<p>Then, I installed <a href="http://live.gnome.org/JhbuildDependencies/Ubuntu">gnome dependencies for ubuntu</a>. There were problems with the installation. &#8220;<strong>gtk-doc</strong>&#8221; was not there. So, I just ignored it and installed other packages. Then, there was a conflict between &#8220;<strong>libxul-dev</strong>&#8221; and &#8220;<strong>xulrunner-1.9-dev</strong>&#8220;. &#8220;<strong>apt-cache show libxul-dev</strong>&#8221; indicated that version is &#8220;1.8.x.x&#8221;, so I only installed &#8220;<strong>xulrunner-1.9-dev</strong>&#8220;.</p>
<p>First, I installed jhbuild from repositories(<strong>sudo apt-get install jhbuild</strong>). Then, created the .jhbuildrc file as it says, and tried the command. But it started to complain about a &#8220;<strong>lib_packages</strong>&#8221; variable. I googled for it, and the first hit was from the same page. Apparently, the wiki page have been updated very recently, and the script has been changed(to non-working version). So, I edited &#8220;.jhbuildrc&#8221; file, and removed &#8220;<strong>addpath(&#8217;PYTHONPATH&#8217;, os.path.join(lib_packages, &#8216;gtk-2.0&#8242;))</strong>&#8221; line. Now, jhbuld is working fine, but for the obvious reasons, apt-getting from ubuntu, doesn&#8217;t install the &#8220;online-desktop&#8221; module. So, I removed it, and got the jhbuild from gnome SVN.</p>
<p>Now, it started to build 101 packages. Normally, if I was emerging in gentoo, I would go for a tea, have a nap and come back later. But since I ignored &#8220;<strong>gtk-doc</strong>&#8221; and &#8220;<strong>libxul-dev</strong>&#8220;, I knew those two would fire back later. After going through many packages, it complained about the gtk doc. By analyzing the error message, I managed to install &#8220;<strong>gtk-doc-tool</strong>&#8220;, and it continued. Then again, some xul errors popped up. It was complaining that some &#8220;idl&#8221; files are missing. Going through &#8220;<strong>/usr/share/idl</strong>&#8221; revealed that both &#8220;unstable&#8221; and &#8220;stable&#8221; are installed, thus those are in sub directories. Once I moved to &#8220;<strong>/usr/share/idl/xulrunner/unstable</strong>&#8221; to &#8220;<strong>/usr/share/idl/xulrunner/</strong>&#8220;, and done same with the &#8220;<strong>/usr/includes/xulrunner/unstalbe</strong>&#8220;, it worked fine and compiled all packages. Then, I followed the rest of the guide, and logged out(I created the session &#8220;.desktop&#8221; on &#8220;<strong>/usr/share/xsessions/</strong>&#8221; instead of &#8220;<strong>/etc/X11sessions</strong>&#8220;). </p>
<p><strong>Login In</strong></p>
<p>I crossed my fingers, and logged into the gnome online desktop session. Gnome startup splash was followed by the bug-buddy saying mugshot crashed. I just ignored it, and continued. The sidebar said I&#8217;m &#8220;nobody&#8221; and firefox started with the session. Then, I clicked &#8220;enable online desktop&#8221;, and it took me to &#8220;<a href="http://online.gnome.org/">online.gnome.org</a>&#8221; which I successfully logged in. But the desktop still says, I&#8217;m &#8220;nobody&#8221;.</p>
<p>I suspected this might be related to mugshot, so I ran mugshot from terminal again. This time, it ran without any problems. Then, I close firefox, and went through the login process again, but it&#8217;s the same results. After going through some files, I found there is a firefox extension, and that was not installed. There was a shell script called &#8220;firefox-update.sh&#8221;, but running it didn&#8217;t help, instead it created some broken symlinks. Then, I created a symlink manually to &#8220;<strong>od/lib/mozilla/extensions/ {longstring}/firefox@mugshot.org</strong>&#8221; in &#8220;<strong>/usr/lib/firefox/plugins</strong>&#8220;. Then, the extension loaded, but still it&#8217;s the same results.</p>
<p>Then, I killed few hours with mugshot-client and bigboard source code, but didn&#8217;t come up with anything. The last chance was thinking that something is wrong with gconf settings. So, I logged out, created a new user, and logged back in. </p>
<p><strong>Playing Around</strong></p>
<p><a href='http://www.sandaru1.com/wp-content/uploads/2008/04/desktop.jpg'><img src="http://www.sandaru1.com/wp-content/uploads/2008/04/desktop-150x150.jpg" alt="" title="desktop" width="150" height="150" align="left" style="margin-right:10px" /></a> Mugshot crashed as usual at the startup, but then I ran it again it gave a black and white tray icon. It was a long shot, but I was lucky! Online authentication worked. The problem with my used account must be either mozilla settings or dbus settings.</p>
<p>However, mugshot icon turned into purple and suddenly it crashed(Just after I logged in from web interface). So, I saved the bug report, and started to play around a little bit. The sidebar downloaded my information(name,photo,online services) from the gnome online account and displayed those, but I already know those <img src='http://www.sandaru1.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> Of course those are useful as much as bookmarks. Then, the &#8220;recent documents&#8221; from places menu is moved to sidebar. That&#8217;s a good choice, quick access. </p>
<p><a href='http://www.sandaru1.com/wp-content/uploads/2008/04/allapps.jpg'><img src="http://www.sandaru1.com/wp-content/uploads/2008/04/allapps-150x150.jpg" alt="" title="allapps" width="150" height="150" align="right" style="margin-left:10px" /></a><br />
The next stock in sidebar is &#8220;<strong>Applications</strong>&#8220;. It showed some applications like &#8220;Firefox&#8221;, &#8220;Terminal&#8221;. It also showed &#8220;Thunderbird&#8221; as not installed, which is actually installed and used exclusively :-/ So, I wanted to change the list of applications showed there. The Application Main panel is quite attractive and nicely build. It&#8217;s very easy to find applications. However, only very limited set of applications can be added to the sidebar. I can understand everything else, but this? I&#8217;ve no clue.</p>
<p>Then the &#8220;<strong>people</strong>&#8221; stock was there, but unfortunately I don&#8217;t have any friends on my mugshot account. It only showed some generic user called &#8220;Gnome Online&#8221;(or something similar). I accidentally added another email address to &#8220;Gnome Online&#8221;, then I found out there is no way to remove that. The only option was to just remove that user(There is no point of keeping a bot with wrong addresses associated with it). Once I logged into gtalk via  pidgin, the people stock got filled with my gtalk contacts list. But it&#8217;s just some photos+names, nothing else. </p>
<p>I added the &#8220;<strong>Google Mail</strong>&#8221; account, and it worked without giving out any problems. After a complete swap of the sidebar, It felt like nothing is new in online desktop. So, my next guess was there must be something amazing in mugshot client. </p>
<p><strong>Mugshot Adventure</strong></p>
<p>I googled for a little bit about what mugshot client do, but didn&#8217;t find any useful information. Then, I checked mugshot bugzilla to see whether anyone else has got these problems. But I was alone. So, I fired up Xchat, joined #gnome-hackers on GimpNet. However, I didn&#8217;t get any replies(that&#8217;s my bad timing, the channel was very quite when I was dropping there - probably most of the people are sleeping). </p>
<p>The Online Desktop getting started said something about mugshot-client should be bootstraped. I had no idea what that means, so I logged back into my normal *perfect* gnome desktop(By the way, I&#8217;m a big gnome fan <img src='http://www.sandaru1.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ), and ran &#8220;<strong>jhbuild bootstrap</strong>&#8220;. Then, it installed 14 more packages. So, I cleared the built file from mugshot-client checkout directory using &#8220;make clean&#8221; and executed the mugshot-client build command(&#8221;<strong>jhbuild build meta-online-desktop -t mugshot-client</strong>&#8220;). </p>
<p>Here comes the trouble again - it gave me weird error saying &#8220;<strong>hippo canvas python module not found</strong>&#8221; - which the files/headers are there. Then, I rebuild several other modules like &#8220;<strong>hippo-canvas, desktop-data-model, gnome-settings-daemon, online-desktop</strong>&#8221; and tried building &#8220;<strong>mugshot-client</strong>&#8221; but nothing worked. Then, it must be something I did with the bootstrap command - I&#8217;m not even a little bit familiar with jhbuild, so I decided the best thing to do is rebuild everything from scratch.</p>
<p>First, I removed the install directory. Then, cleared the build files in the checkout directory. The &#8220;bash&#8221; saved me from lot of trouble. I didn&#8217;t have to worry too much about going into each directory and running &#8220;<strong>make clear</strong>&#8220;. If you are interested, following are the two commands,<br />
<code><br />
for x in `ls *.tar.gz *.tar.bz2`; do rm -rf `echo $x | sed 's/.tar.gz$//;s/.tar.bz2$//'`; done<br />
for x in `find | grep Makefile$`; do  make -C `echo $x | sed 's/\/[^\/]*$//&#8217;` clean; rm $x; done<br />
</code></p>
<p>After clearing everything, I ran the full build command along with the &#8220;<strong>time</strong>&#8221; command. After 1 hour, 59 minutes and 49 seconds, it finished(2.4Ghz dual-core 2GB RAM). </p>
<p>Then, I re login to online desktop and now it&#8217;s worst; both bigboard(sidebar) and mugshot-client crashed. They must have just committed a non-working version on bigboard around that time <img src='http://www.sandaru1.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> However, bigboard bug was simple, they were trying to integrate google docs(good news!!) - and gdata.gdocs package was not there. I simply removed &#8220;<strong>import gdata.docs as gdocs</strong>&#8221; line from &#8220;<strong>bigboard/google.py</strong>&#8220;, and sidebar is back in business.</p>
<p>The bug-buddy was a real rescue buddy on musgshot-client. I <a href="http://www.sandaru1.com/wp-content/uploads/2008/04/hippo.diff">changed few lines of code</a>, and it&#8217;s started working again. <em>(I didn&#8217;t exactly fix it - Just changed some lines that it wouldn&#8217;t crash, just work barely</em>). However, the result was not what I expected, it&#8217;s just getting the updates from mugshot site, and displays the notifications. </p>
<p>Speaking of mugshot site, it let users integrate many services into one feed, which seems to be a great idea, but since I don&#8217;t have any friends on mugshot, I couldn&#8217;t really experience it. My idea is it would be a much easier to keep track with friends this way.</p>
<p><strong>Programmers point of view aka &#8220;Thoughts of a coder&#8221;</strong></p>
<p>From the users point of view, online desktop doesn&#8217;t have any killer features *yet*. Anyhow, reading of some of design documentation enlightened me <img src='http://www.sandaru1.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> The technology used is online desktop is XMPP, which means, it&#8217;s using push technology instead of pull; less bandwidth usage, less server load, quick response time. </p>
<p>Just like most of other opensource products, they also have core libs which helps other developers to tap into the system, and make use of that. This means a real integration between all desktop-online bridging applications.</p>
<p><strong>Conclusion</strong></p>
<p>Simple conclusion, it&#8217;s not ready yet. Of course, it should be - I built it from the trunk. Anyhow, considering the large number of gnome developers, and super cool gnome desktop, I feel like online desktop is not upto it&#8217;s full potential. A lot of simple yet effective improvements can be done, like improving the &#8220;Applcation&#8221; stock, or &#8220;Workspace Switcher&#8221;. I&#8217;m not sure why they are only adding people from &#8220;Gtalk/XMPP/..&#8221; connections to people stock(probably something with the design). Most of my friends are using MSN(may be I&#8217;ll check whether I can create a plugin for <a href="http://emesene.org/">emesene</a> to throw out some dbus signals).</p>
<p>The good news is, once the basic core framework of online desktop is much stable, developers will create some stunning integration apps. </p>
<p>Precisely, this is something you should checkout, but I&#8217;m not exactly sure how soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sandaru1.com/2008/04/13/gnome-online-desktop/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Improve jhbuild downloading</title>
		<link>http://www.sandaru1.com/2008/04/11/improve-jhbuild-downloading/</link>
		<comments>http://www.sandaru1.com/2008/04/11/improve-jhbuild-downloading/#comments</comments>
		<pubDate>Fri, 11 Apr 2008 00:51:47 +0000</pubDate>
		<dc:creator>sandaruwan</dc:creator>
		
		<category><![CDATA[Hacks]]></category>

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

		<category><![CDATA[Open Source]]></category>

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

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

		<guid isPermaLink="false">http://www.sandaru1.com/?p=134</guid>
		<description><![CDATA[Yesterday, I tried to install Gnome Online Desktop. Since, this is fairly new, it has to be build from the source. Gnome Online Desktop is a complete branch of gnome desktop, which will of course have many dependencies.  It&#8217;ll take years to download each and compile manually. That&#8217;s why they have jhbuild (it works [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday, I tried to install <a href="http://live.gnome.org/OnlineDesktop/">Gnome Online Desktop</a>. Since, this is fairly new, it has to be build from the source. Gnome Online Desktop is a complete branch of gnome desktop, which will of course have many dependencies.  It&#8217;ll take years to download each and compile manually. That&#8217;s why they have <a href="http://www.freedesktop.org/wiki/Software/jhbuild">jhbuild</a> (it works like gentoo emerge). </p>
<p>This is April, which is supposed to be the best month of Sri Lanka with festivals/celebration. But there is a price to pay, thundering (Last year, lighting took my laptop <img src='http://www.sandaru1.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> ). My connection goes down for each 10 minutes.</p>
<p>So, while jhbuild downloading a module, the connection goes down, and when I restart jhbuild, download doesn&#8217;t continue from where I left off. It downloads the whole file again. So, here is a very simple one line hack to prevent that from happening to you.</p>
<p>In jhbuild/versioncontrol/tarball.py, line 171, add a command line option &#8220;-c&#8221; to wget command. If you are not happy with &#8220;wget&#8221;, you can change it to whatever you want(prozilla,aget,d4x).</p>
<p>I&#8217;m still building online desktop (101 packages :-/ ), can&#8217;t wait to see what it can do.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sandaru1.com/2008/04/11/improve-jhbuild-downloading/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Hallelujah</title>
		<link>http://www.sandaru1.com/2008/04/11/hallelujah/</link>
		<comments>http://www.sandaru1.com/2008/04/11/hallelujah/#comments</comments>
		<pubDate>Thu, 10 Apr 2008 21:36:22 +0000</pubDate>
		<dc:creator>sandaruwan</dc:creator>
		
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.sandaru1.com/?p=133</guid>
		<description><![CDATA[This is my cousin Sashika, singing few songs. Enjoy!


]]></description>
			<content:encoded><![CDATA[<p>This is my cousin Sashika, singing few songs. Enjoy!</p>
<p><object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/amz83oHUAq8&#038;hl=en"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/amz83oHUAq8&#038;hl=en" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object></p>
<p><object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/JmgKJH-BmhY&#038;hl=en"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/JmgKJH-BmhY&#038;hl=en" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sandaru1.com/2008/04/11/hallelujah/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Be Linux</title>
		<link>http://www.sandaru1.com/2008/04/04/be-linux/</link>
		<comments>http://www.sandaru1.com/2008/04/04/be-linux/#comments</comments>
		<pubDate>Fri, 04 Apr 2008 15:15:24 +0000</pubDate>
		<dc:creator>sandaruwan</dc:creator>
		
		<category><![CDATA[Linux]]></category>

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

		<guid isPermaLink="false">http://www.sandaru1.com/?p=132</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p><object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/PLHjT5-XM9o&#038;hl=en"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/PLHjT5-XM9o&#038;hl=en" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sandaru1.com/2008/04/04/be-linux/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Wordpress Picasa plugin</title>
		<link>http://www.sandaru1.com/2008/04/04/wordpress-picasa-plugin/</link>
		<comments>http://www.sandaru1.com/2008/04/04/wordpress-picasa-plugin/#comments</comments>
		<pubDate>Fri, 04 Apr 2008 01:37:32 +0000</pubDate>
		<dc:creator>sandaruwan</dc:creator>
		
		<category><![CDATA[wordpress]]></category>

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

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

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

		<guid isPermaLink="false">http://www.sandaru1.com/?p=131</guid>
		<description><![CDATA[There is a quick update on picasa plugin.
If you want multiple users, in the picasa username field, separate users by semicolons ( ; ). You can use the album names inside brackets infront of the username. Separate album names by commas ( , ). 
Example : sandaruwang(Adams Peak, IOI 2006);yasaruwan(sivali)
Download from here.
]]></description>
			<content:encoded><![CDATA[<p>There is a quick update on picasa plugin.</p>
<p>If you want multiple users, in the picasa username field, separate users by semicolons ( ; ). You can use the album names inside brackets infront of the username. Separate album names by commas ( , ). </p>
<p>Example : sandaruwang(Adams Peak, IOI 2006);yasaruwan(sivali)</p>
<p><a href="http://downloads.wordpress.org/plugin/picasa-wordpress-widget.zip">Download from here.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sandaru1.com/2008/04/04/wordpress-picasa-plugin/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Wordpress 2.5</title>
		<link>http://www.sandaru1.com/2008/03/30/wordpress-25/</link>
		<comments>http://www.sandaru1.com/2008/03/30/wordpress-25/#comments</comments>
		<pubDate>Sat, 29 Mar 2008 19:23:00 +0000</pubDate>
		<dc:creator>sandaruwan</dc:creator>
		
		<category><![CDATA[Open Source]]></category>

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

		<guid isPermaLink="false">http://www.sandaru1.com/?p=129</guid>
		<description><![CDATA[I just upgraded &#8220;Thoughts of a coder&#8221; to wordpress 2.5. Mostly user&#8217;s won&#8217;t feel any difference, but there is a huge user interface change in the admin section. The upgrading process was fairly simple and straight forward.
Speaking of the new features, the admin dashboard is really slick and customizable. You can see have a glance [...]]]></description>
			<content:encoded><![CDATA[<p>I just upgraded &#8220;Thoughts of a coder&#8221; to <a href="http://www.wordpress.org/">wordpress</a> 2.5. Mostly user&#8217;s won&#8217;t feel any difference, but there is a huge user interface change in the admin section. The upgrading process was fairly simple and straight forward.</p>
<p>Speaking of the new features, the admin dashboard is really slick and customizable. You can see have a glance of what is going on with your blog in few seconds. The dashboard was there for a long time, but the interface highlights the information quickly.</p>
<p>Another feature I noticed was plugin upgrades. The wordpress upgrading process recommend disabling plugins beforehand. So, when I return back to plugins to activate plugins, there were some light yellow bars informing me about the updates of plugins, and more interestingly there is a link to upgrade automatically. Just of a click of that upgraded the plugin without giving any problems.</p>
<p>I just figured out while writing this post, the old upload form is no longer there. Instead there are set of buttons called &#8220;Add media&#8221;, which links to media library. <strike>You can now easily add photos/videos/audios to your post without any problems.</strike><br />
<em><strong>Edit : </strong>First, I thought wordpress is integrated with flash audio/video player, or when you gave a youtube url, it automatically embeds the video, but it turned out to be just pasting the link. However, the uploading is rather nice than the earlier version. </em> </p>
<p>I&#8217;m glad they haven&#8217;t seem to change any API/hooks, so the plugins that used to work before will hopefully work without any changes. My plugin &#8220;Picasa Photos&#8221; just worked. Overall, it&#8217;s a pretty good release with fairly noticeable features. Worth upgrading.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sandaru1.com/2008/03/30/wordpress-25/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Free(dom) Software and Free Rice</title>
		<link>http://www.sandaru1.com/2008/02/23/freedom-software-and-free-rice/</link>
		<comments>http://www.sandaru1.com/2008/02/23/freedom-software-and-free-rice/#comments</comments>
		<pubDate>Sat, 23 Feb 2008 00:39:44 +0000</pubDate>
		<dc:creator>sandaruwan</dc:creator>
		
		<category><![CDATA[General]]></category>

		<category><![CDATA[Open Source]]></category>

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

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

		<guid isPermaLink="false">http://www.sandaru1.com/2008/02/23/freedom-software-and-free-rice/</guid>
		<description><![CDATA[Last week, proving one of the most effective open source successes, firefox hit 500+ million downloads. There are no arguments, they have definitely changed the world. Now, in honor of firefox downloads, they are going to change the world in another perspective by helping the Free Rice foundation.

Now, it&#8217;s your turn.
]]></description>
			<content:encoded><![CDATA[<p>Last week, proving one of the most effective open source successes, <a href="http://www.mozilla.com/en-US/firefox/">firefox</a> hit <a href="http://www.spreadfirefox.com/500million">500+ million downloads</a>. There are no arguments, they have definitely changed the world. Now, in honor of firefox downloads, they are going to change the world in another perspective by helping the <a href="http://www.freerice.com">Free Rice foundation</a>.</p>
<p><a href="http://www.freerice.com"><img src="http://freerice.com/banners/468_60_FullBanner.jpg" alt="Free Rice" /></a></p>
<p>Now, it&#8217;s your turn.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sandaru1.com/2008/02/23/freedom-software-and-free-rice/feed/</wfw:commentRss>
		</item>
		<item>
		<title>IOI - The contest begins!!</title>
		<link>http://www.sandaru1.com/2008/02/19/ioi-the-contest-begins/</link>
		<comments>http://www.sandaru1.com/2008/02/19/ioi-the-contest-begins/#comments</comments>
		<pubDate>Mon, 18 Feb 2008 21:36:54 +0000</pubDate>
		<dc:creator>sandaruwan</dc:creator>
		
		<category><![CDATA[General]]></category>

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

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

		<guid isPermaLink="false">http://www.sandaru1.com/2008/02/19/ioi-the-contest-begins/</guid>
		<description><![CDATA[If you ever wanted to see mummies in Egypt, here comes the chance. Sri Lankan Olympiad in Informatics is calling for contestants. If you are a school student under 20, just go ahead and register at www.ioi.lk. 
If you want more info on IOI, read the wiki. 
P.S - The LK DNS is very promising.. [...]]]></description>
			<content:encoded><![CDATA[<p>If you ever wanted to see mummies in Egypt, here comes the chance. Sri Lankan Olympiad in Informatics is calling for contestants. If you are a school student under 20, just go ahead and register at <a href="http://www.ioi.lk">www.ioi.lk</a>. </p>
<p>If you want more info on IOI, read the <a href="http://en.wikipedia.org/wiki/International_Olympiad_in_Informatics">wiki</a>. </p>
<p>P.S - The LK DNS is very promising.. but just in case, if you can&#8217;t access ioi.lk, try <a href="http://ioi.ucsc.cmb.ac.lk/">http://ioi.ucsc.cmb.ac.lk/</a></p>
<p>Just for the record, photo was not my idea.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sandaru1.com/2008/02/19/ioi-the-contest-begins/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Google Charts</title>
		<link>http://www.sandaru1.com/2008/01/31/google-charts/</link>
		<comments>http://www.sandaru1.com/2008/01/31/google-charts/#comments</comments>
		<pubDate>Thu, 31 Jan 2008 07:42:58 +0000</pubDate>
		<dc:creator>sandaruwan</dc:creator>
		
		<category><![CDATA[Google]]></category>

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

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

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

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

		<guid isPermaLink="false">http://www.sandaru1.com/2008/01/31/google-charts/</guid>
		<description><![CDATA[There are handful feasible flash based charting solutions, and they just work really great - with interaction. But unfortunately most of those are not open source, nor free. Few months ago(may be it has been there for longer?), google released a chart api which can generate a PNG image based on your data.
The charts API [...]]]></description>
			<content:encoded><![CDATA[<p>There are handful feasible flash based charting solutions, and they just work really great - with interaction. But unfortunately most of those are not open source, nor free. Few months ago(may be it has been there for longer?), google released a <a href="http://code.google.com/apis/chart/">chart api</a> which can generate a PNG image based on your data.</p>
<p>The charts API very easy to use, and everything is encoded in the URL. So, you can either download the image and host it on your servers, or rather use that in the web page itself without any troubles at all.</p>
<p>Yesterday, I gave it a try. I got some of my apache logs, parsed them, and used google APIs to draw the charts. The results look good.</p>
<p style="text-align:center">
<a href='http://www.sandaru1.com/wp-content/uploads/2008/01/bar-chart1.png' title='Bar Chart'><img src='http://www.sandaru1.com/wp-content/uploads/2008/01/bar-chart1.png' alt='Bar Chart' /></a>
</p>
<p>The log files are too big to parse quickly and contains lot of junk data. So, I wrote the code so that it only takes the &#8220;200 OK&#8221;, and ignores &#8220;js,css,png,jpg,gif&#8221; requests. Here is the php code.</p>
<pre  name="code"  class="php">
	$ignored = array('css','js','png','jpg','gif');

	$vals = array();

	$f = fopen("/var/log/apache2/access.log","r");
	while (!feof($f)){
		$line = fgets($f);
		preg_match("/(.*) - - \[(.*)\] \&#8221;GET (.*) HTTP\/1.1\&#8221; 200/&#8221;,$line,$matches);
		// If it&#8217;s not 200 OK - just ignore it
		if (empty($matches))
			continue;
		$path = pathinfo($matches[3]);
		if (in_array($path["extension"],$ignored))
			continue;
		$time = strtotime($matches[2]);
		$month = date(&#8221;M/y&#8221;,$time);
		$vals[$month]++;
	}

	function text_encode($vals,$max) {
		$tvals = array();
		foreach($vals as $val) {
			$tvals[] = round($val/$max*100,1);
		}
		return implode($tvals,&#8221;,&#8221;);
	}

	function get_y_axis($vals) {
		$max = max($vals)+3000;
		$step = $max/5.0;
		$temp = array();
		for($i=0;$i<5;$i++)
			$temp[] = round($i*$step);
		$temp[] = $max;
		return implode($temp,"|");
	}

	echo "http://chart.apis.google.com/chart?chs=500x300&#038;chd=t:"
			.urlencode(text_encode($vals,max($vals)+3000)).
			"&#038;cht=bvg&#038;chbh=50&#038;chxt=x,y&#038;chxl=0:|".
			urlencode(implode(array_keys($vals),'|')).
			"|1:|".urlencode(get_y_axis($vals))."\n";
</pre>
<p>Even though this contains code for ommiting unrelated results, it takes too much time. So, you can use the piping to create a simple log file, which is reasonably speed than running this through the whole log file. For example I use this command to create a smaller version of the log file.</p>
<pre  name="code" >
cat sandaru1_log | grep 'HTTP/1.1" 200' | grep -v '.css HTTP'
	| grep -v '.png HTTP' | grep -v '.js HTTP'
	| grep -v '.jpg HTTP' | grep -v '.gif HTTP' > log
</pre>
<p>Google Charts also provides ability to generate pie charts. It&#8217;s easier to use a pie chart for browser percentages. </p>
<p style="text-align:center">
<a href='http://www.sandaru1.com/wp-content/uploads/2008/01/pie-chart.png' title='Pie Chart'><img src='http://www.sandaru1.com/wp-content/uploads/2008/01/pie-chart.png' alt='Pie Chart' width="600" height="325" /></a>
</p>
<p>Here is the code :</p>
<pre  name="code"  class="php">
	$vals = array();

	function parseUserAgent($ua)
  	{

    	$userAgent = array();
 		$agent = $ua;
    	$products = array();

		$pattern  = "([^/[:space:]]*)&#8221; . &#8220;(/([^[:space:]]*))?&#8221;
		.&#8221;([[:space:]]*\[[a-zA-Z][a-zA-Z]\])?&#8221; . &#8220;[[:space:]]*&#8221;
		.&#8221;(\\((([^()]|(\\([^()]*\\)))*)\\))?&#8221; . &#8220;[[:space:]]*&#8221;;

		while( strlen($agent) > 0 )
		{
			if ($l = ereg($pattern, $agent, $a))
			{
				// product, version, comment
				array_push($products, array($a[1],    // Product
                                        $a[3],    // Version
                                        $a[6]));  // Comment
				$agent = substr($agent, $l);
			}
			else
			{
				$agent = &#8220;&#8221;;
			}
		}

		// Directly catch these
		foreach($products as $product)
		{
			switch($product[0])
			{
				case &#8216;Firefox&#8217;:
				case &#8216;Netscape&#8217;:
				case &#8216;Safari&#8217;:
				case &#8216;Camino&#8217;:
				case &#8216;Mosaic&#8217;:
				case &#8216;Galeon&#8217;:
				case &#8216;Opera&#8217;:
					$userAgent[0] = $product[0];
					$userAgent[1] = $product[1];
					break;
			}
		}

		if (count($userAgent) == 0)
		{
			// Mozilla compatible (MSIE, konqueror, etc)
			if ($products[0][0] == &#8216;Mozilla&#8217; &#038;&#038;
            	!strncmp($products[0][2], &#8216;compatible;&#8217;, 11))
			{
				$userAgent = array();
				if ($cl = ereg(&#8221;compatible; ([^ ]*)[ /]([^;]*).*&#8221;,
                           $products[0][2], $ca))
				{
					$userAgent[0] = $ca[1];
					$userAgent[1] = $ca[2];
				}
				else
				{
					$userAgent[0] = $products[0][0];
					$userAgent[1] = $products[0][1];
				}
			}
			else
			{
				$userAgent = array();
				$userAgent[0] = $products[0][0];
				$userAgent[1] = $products[0][1];
			}
		}

		if (strstr($userAgent[1],&#8221;http:/&#8221;))
			$userAgent[1] = &#8220;&#8221;;

		return $userAgent[0]
			.($userAgent[0]==&#8221;"||$userAgent[1]==&#8221;"?&#8221;":&#8221; &#8220;)
			.$userAgent[1];
	}

	$f = fopen(&#8221;log&#8221;,&#8221;r&#8221;);
	while (!feof($f)){
		$line = fgets($f);
		preg_match(&#8221;/([\d.]+).* [^ ] [^ ] \[(.*?)\] (.*?) (.*) (.*)&#8221;
				.&#8221; (\d+) ([^ ]+) (.*?) \&#8221;(.*?)\&#8221;/&#8221;,
					$line,$matches);
		$bot = parseUserAgent($matches[9]);
		$bot = preg_replace(&#8221;/Firefox 2.*/&#8221;,&#8221;Firefox 2&#8243;,$bot);
		$bot = preg_replace(&#8221;/Firefox 1.*/&#8221;,&#8221;Firefox 1&#8243;,$bot);
		$vals[$bot]++;
	}

	$others = 0;

	foreach($vals as $key => $val)
		if ($val<500) {
			$others += $val;
			unset($vals[$key]);
		}

	$vals['Others'] = $others;
	$vals['Unknown'] = $vals['-'];
	unset($vals['-']);

	$lables = array();
	function text_encode($vals,$sum) {
		global $lables;
		$tvals = array();
		foreach($vals as $key => $val) {
			$tvals[] = round($val/$sum*100,1);
			$lables[] = $key.&#8221; (&#8221;.round($val/$sum*100,2).&#8221; %)&#8221;;
		}
		return implode($tvals,&#8217;,');
	}

	echo &#8220;http://chart.apis.google.com/chart?cht=p&#038;chd=t:&#8221;.
			urlencode(text_encode($vals,array_sum($vals))).
			&#8220;&#038;chs=700&#215;400&#038;chl=&#8221;.
			urlencode(implode($lables,&#8221;|&#8221;)).&#8221;\n&#8221;;
</pre>
<p>This code will get the user agent, parse it and generate a pie chart. <a href="http://www.dotvoid.com/view.php?id=68">The user agent parse function</a> is by dotvoid.com.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sandaru1.com/2008/01/31/google-charts/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
