Tuesday, October 12, 2010

Run Fennec on the Android Emulator




I was curious about Fennec ( Mozilla's mobile browser ) but since I don't own an android phone ( not yet.. ) I couldn't try it out. I recently discovered that Fennec can be made to run on the Android emulator, and here's how..

Note: My OS is Lucid Lynx and all instructions are as per my OS.

Here's how you make a Fennec build that runs on the Android emulator:

1. Install Android SDK ( you need to have JDK 5 or 6 )

you can get the Android SDK from here : http://developer.android.com/sdk/index.html

unzip the tar ball in a suitable location
cd android-sdk-linux_x86/tools
./android

This will open up the Android SDK and AVD manager. Here you should install the SDK Platform Android 2.2, API 8 and setup a new AVD ( Android Virtual Device ) with it as the Target.

now you can run the emulator inside the tools directory with..

./emulator -avd name_of_your_avd


check http://developer.android.com/sdk/installing.html for detailed installation instructions.


2. make a Fennec build that will run on the emulator

currently available Fennec nightlies wont run on the emulator so you need to build a version that will, by using the correct build instructions in the .mozconfig file. Here's how..

- First download the Android NDK and unzip it in the same location you unzipped the SDK.
http://ftp.mozilla.org/pub/mozilla.org/mobile/source/android-ndk-r4c-0moz3.tar.bz2 

- Clone the Fennec repository inside your mozilla-central repo ( cd to mozilla code folder and run

hg clone http://hg.mozilla.org/mobile-browser mobile )

If you don't already have a mozilla-central code repository you will need to get it first and setup mozilla build requirements on your system. See https://developer.mozilla.org/En/Simple_Firefox_build).

- Create the following .mozconfig file inside your mozilla-central code directory

http://pastebin.mozilla.org/1158636

( make sure to set the correct paths for the Android SDK, NDK and tools directories)

- run sudo make -f client.mk inside your mozilla-central repo.

(Fennec took about an hour and a half to build:I)

- When build is complete cd into the newly created objdir-android folder and run sudo make package. This will create a fenneck.apk file inside the objdir-android/embedding/android folder.

-Now copy the fennec.apk file into the android-sdk-linux_x86/tools folder and run

emulator -avd name_of_your_avd -partition-size 256 -memory 512

-While the emulator is running, in a new terminal install the fennec.apk in the emulator using

android-sdk-linux_x86/tools/adb install fennec.apk

The installation will print 'Success' confirming Fennec has been installed on your emulator!

Monday, September 20, 2010

Testing patches from Bugzilla

I just started using MQ (Mercurial Queues). Now that I've tried it I can't imagine ever using a mercurial repo without it! I know that sounds a bit cliche, like something out of a commercial, but it's true!

Here's how to test patches from bugzilla. With MQ you can apply the patches, test them and then remove them with ease if you want to revert back to trunk code. Well the main purpose of MQ is to help with code development so that you can write new patches, edit, update, and remove when needed. But there is also times you want to test someone else's patches, for example from a bug on Bugzilla, in this case too MQ can help.

How to test patches using MQ.. (updated 23.09.2010)

- First make sure you have MQ installed. MQ is a Mercurial extension. Make sure you have MQ setup by following the Mozilla MQ guide ( https://developer.mozilla.org/en/Mercurial_Queues ).

- Now you can use either method 1 or method 2 below to import the patches to MQ..

Mtd 1:

hg qimport -n name-of-patch patch-url
(patch-url will be the atachment url from bugzilla)

Mtd2:

A more convenient method is to use the qimportbz extension which will allow you to import patches directly from the Bug# http://robarnold.org/hg-qimport-my-bugzilla-patch-redux/

After setting up qimportbz extension do:

hg qimport bz://xxxxxx
(xxxxxx is the bug number on bugzilla)

When a list of patches is displayed enter the numbers of the patches you want with a space in between. The first patch applied will be named with the bugnumber (you can rename this later in the .hg/patches folder). The qimport extension will attempt to name all the following patches with the same name and give the error..

A patch file named 'bug-xxxxxx.diff' already exists in your patch directory. Rename patch 'abcdef' (yyyyyy) (r)/overwrite (o)?

Hit enter and give a new name for the patch. Continue for all the remaining patches until importing is complete.

-After importing the patch(es)..

hg qpush name-of-patch
(apply the patch to MQ. you can use -a option to apply all the patches at once)

Test the patch(es)

hg qpop
(removes patches from the top of the queue)

For a quick lookat MQ commands see http://mercurial.selenic.com/wiki/MqExtension

Tuesday, August 24, 2010

Talking to your browser




I stumbled upon a really interesting firefox addon recently called 'Firesay'. The 'Firesay' addon is a first step towards enabling voice commands in the Firefox browser. It has a limited set of voice commands. What worked for me were 'Switch' (to switch to left or right tab), 'Close Tab', 'Multi-task' ( to open a website in the background - worked for me for CNN and Facebook), 'Page Up/Down' and 'Scroll Up/Down'.

I was curious to see if it would work in SeaMonkey too so I tweaked the extension which I downloaded from here http://bit.ly/bv0e2r and tried it in SeaMonkey. Only Scroll and Page Up/Down worked for me in SM and the response was bit slower than on Firefox. Still it seemed like something really exciting to experiment with. What I really want in SM is voice commands to switch between each of the apps in the SM suite. So that for example when I'm browsing the Internet I could simply say 'Chatzilla' and switch to Chatzilla and then say 'Browser' to switch back to the browser or 'Mail' to switch to Mail. Right now I'm planning on using the Firesay addon as a guide towards achieving that.

Firesay pluses

- It doesn't need training. It has a few standard commands built in. This is the concept of Voice Browsing where you have multiple users and a limited vocabulary.

- It works in the presence of noise even. I used the headset microphone for testing with my favorite radio station (http://www.tnlrocks.com/listen_live/player.html) playing in the browser and still it picked up my commands without any mistakes.

Firesay minuses

- It only works in Windows because it utilizes the built in Speech recognition software of Windows.

I'm bit surprised Mozilla hasn't made more progress in Voice Browsing though. Seems Opera is ahead in the game with Opera Voice but unlike Firesay you need to press a button to activate the listening every time you use it. Opera also has gesture recognition for browsing which may be intended to provide easy access to the handicapped. Voice commands seems the more natural way of communicating with a computer to me though. I'll let you be the judge of that http://www.youtube.com/watch?v=kkNxbyp6thM.

Tuesday, August 10, 2010

MailNews Sync 0.3.5 - Sync feed and newsgroup headers in Seamonkey

It's pencils down week in GSoC 2010 and MailNews Sync for Seamonkey has reached version 0.3.5 on AMO.

MailNews Sync 0.3.5

-Setting up MailNews Sync

You can install MailNews Sync 0.3.5 from here. It requires Firefox Sync addon which you can get from here (or you can get the development version I used for testing from here).
MailNews Sync engine has been set to true by default.

-Initial Sync

MailNews sync engine will sync all feed headers on first sync. However for syncing newsgroup headers there is a UI option 'Sync Message Headers' which can be selected from the right click menu of any newsgroup (please see image below). I have included this UI option because newsgroups may contains tens of thousands of messages and having all their headers synced up on initial sync will take a very long time. When sync option is selected for a newsgroup a preference 'mailnews.sync.accounts.fullupload' will be set with the newsgroup's name so that its headers will be synced up at next sync. At the same time another Boolean preference 'mailnews.sync.account.nntp.newsgroup_name' will be set to indicate that sync should be done for that newsgroup.

If sync doesn't run immediately as expected (the sync scheduler runs periodically depending on the amount of items that are in the queue waiting to be synced to the server) you may force sync to run immediately by clicking on the sync icon in the statusbar or by selecting the 'Sync Now' option in 'Tools' ->'Sync' menu.


If stop-script warning is encountered during sync please accept continue for now, until this is fixed in a future version.


-Up sync

Up sync happens in batches of 100 records at a time and can take sometime depending on the number of header records you are going to sync. In sync activity log (about:sync-log) a changed header item is indicated as follows,
Tracker.MailNews     DEBUG Changed item,
ID: 4AF3E769.60505@hfigge.myfqdn.de ,
FLAGGED: true , READ: false , TAG: $label2
This will be upsynced to server depending on whether or not duplicate record is present.


-Down Sync (includes caching)

Down will be indicated by a log record as follows,
Store.MailNews       DEBUG (10468)Down sync of mailnews header,
ID: 9pqdnYvr3Nr2GYLWnZ2dnUVZ_q1i4p2d@mozilla.org ,
URL: mozilla.support.seamonkey , FLAGGED: true , READ: true ,
TAG: [{"tagId":"$label2","tagName":"Work","tagColor":"#FF9900"}]

Store.MailNews DEBUG (10469)Down sync of mailnews header,
ID: 3IadnWFGE7zk_GrXnZ2dnUVZ_vSdnZ2d@mozilla.org ,
URL: mozilla.support.seamonkey , FLAGGED: true , READ: true ,
TAG: [{"tagId":"$label2","tagName":"Work","tagColor":"#FF9900"}]

If the feed of newsgroup of that header record is not available on the other pc, the header record will be cached in a file /weave/mailnews/mailnewsReSync.json. On every SM start-up it the MailNews Sync engine will search for those header feed/newsgroup subscriptions and apply them if available. Caching can be turned off using preference 'mailnews.sync.caching.enabled'

-Syncing Flags, Tags and Read status

MailNews Sync also supports syncing of custom tags and sync multiple tags applied for a message.

I also started work on feed and newsgroup subscription sync but since this was not origianlly planned for the project I will work on it later. There is also the possibility of extending MailNews Sync for syncing email headers. More details about the project can be found here.

Working with Seamonkey community has been really great so far. It's just a great developer community and #seamonkey is definitely one of the most funny and interesting IRC channels on moznet!:D Seamonkey developers work really hard but they really enjoy the work they do and they are very supportive of newcomers. I am especially thankful to KaiRo (Robert Kaiser) and Iav (Igor Velkov) for mentoring this project and also to everyone in the SM developer community who have promptly responded to my queries and helped me correct my coding errors etc. Hope to write another post about my full GSoC experience later on! There is still 5 days left for firm pencils down date and I hope to get some more testing and bug fixing done before that, then i'll be taking a 3 week break for my end semester exams. Afterward I will get back to SM to work on integrating MailNews Sync into comm-central along with the rest of sync code and to try out some C++ work for a change:)


Monday, July 19, 2010

Testing and QA

I have updated my previous blogpost with links to the project testing plan, but I thought it would be better to have a separate blogpost to keep track of the testing and QA work.

For the detailed Testing plan please see (http://code.google.com/p/weave-mailnews-sync/wiki/TestPlan?ts=1279537331&updated=TestPlan)

QA Day 1 (19th July):

Completed testing with Config 01. None of the tests failed but 5 issues were reported that need fixing.

QA Day 2 (23rd July):

Completed testing with Config 02. No new issues reported. Custom tag sync (http://bit.ly/cayX3L) was also tested between the Windows 7 and Ubuntu 9.04 machines.

Thursday, July 15, 2010

GSoC 2010 Mid term evaluations

Mid term evaluations are here and I hope to have a progress meeting with my mentor to get his detailed feedback on the project.

I have packaged the MailNews sync engine into an xpi file and uploaded it to the mailnews sync project site (http://code.google.com/p/weave-mailnews-sync/downloads/list). It requires Firefox 1.4 (https://addons.mozilla.org/en-US/firefox/addon/10868/) to work (it is basically an extension of an extension!). The MailNews Sync extension currently syncs status, flag and tag data of Feed and Newsgroup items between different Seamonkey instances. I tested it on Seamonkey 2.0. I couldn't test it on Seamonkey trunk 2.1 yet but I'm hoping that everything will work smoothly there as well. Since comm-central build is not working (sm tinderbox is having a few hot days..) I will test with currently available nightly build.

Few things left to be done this week:

- Decide on a solid test plan for MailNews sync engine
- Start testing and bug fixing for mailnews engine

Update!

I have posted the MailNews engine test plan to the project site ( http://code.google.com/p/weave-mailnews-sync/wiki/TestPlan?ts=1279510088&updated=TestPlan ). Testing will be done using 4 configurations.

Week 1 (18th to 24th July) :Config 01&02
Week 2 (25th to 31st July) : Config 03&04

All issues will be reported and tracked on http://code.google.com/p/weave-mailnews-sync/issues/list.

Testing begin today!

Thursday, July 8, 2010

Sync services become part of the mozilla platform

With Bug 571902 the weave sync services have now been integrated into the mozilla platform by the weave developer team. The sync code can now be found in the mozilla-central repo under services/. Look forward to seeing Seamonkey include sync as a service in a future release. My GSoC project mentor KaiRo has reported Bug 576970 to get the sync UI ported into Seamonkey (comm-central repo). Although landing sync code in mozilla platform means the application specific code has been separated (mainly ui code) there is still app-specific code in the services/sync which is why I still need my tabs sync patch for Seamonkey to be approved by the Weave team.

Work done last week:

1. Updated my patch for getting tabs sync to work in Seamonkey to include new weave code changes.

2. Started a new mercurial repo to track changes I make to the weave code.
https://bitbucket.org/hariniachala/sm-weave

Learned a lot about mercurial in the process.

3. Changed mailnews extension code to sync both feed and newsgroup mailheaders (status and tags). I am using a svn repo for the mailnews extension.
http://code.google.com/p/weave-mailnews-sync/

Work to be done:

1. Sync mailnews engine by default on application startup.
2. Create a testing plan for testing new mailnews engine in Seamonkey & Thunderbird.
3. Update mercurial repo with mailnews code.
4. Track Bug 576970 and see how sync can be ported into Seamonkey!:)

During this time I discussed with KaiRo on some aspects of the project. It was decided that all weave development for Seamonkey should be tested with Seamonkey trunk code. It was also decided to continue development of mailnews engines as a separate extension.

Wednesday, June 30, 2010

MailNews read status and tag name sync

I didn't post my GSoC project weekly update last week because I couldn't do any of the project work last week because we had our final year project evaluations that week. This week however I was able to get back to work on the project:)

I am happy to finally have feed status and tag name up and down sync working in my MailNews engine. But I cannot celebrate yet because I have some tasks to clear yet. I am listing them below so I can track my progress on these tasks in future.

1. Weave have changed their code structure and shifted their code repository from http://hg.mozilla.org/labs/weave to http://hg.mozilla.org/services/fx-sync. The engine code API is still is pretty much the same but I have to test my MailNews Engine with the new weave code and especially look how changes made with Bug 572436 will affect it.

2. Generalize the MailNews Engine status and tag name sync so that it will work for both feeds and newsgroups. (avoiding email for now because differences in protocols such as POP and IMAP result in new complications to sync).

3. Do complete testing for MailNews Engine in Seamonkey and TB (must decide which version to do the testing for?).

4. File new bug to include MailNews Engine in Weave and followup on old Tabs for Seamonkey bug.

Project mid evaluations will be held 12th-16th July and project closing will be 9th-14th August. So I have about 6weeks to finish all the work. I will have to speed up my work a bit but hope to get everything done on schedule:)

Saturday, June 19, 2010

Adding thunderbird support to mail news extension

Writing the new mailnews engines into a separate extension somehow made it easier for me to keep track of my own code. Of course writing the code directly inside the weave extension was easier but I found keeping track of my code to be a bit messy process. So the plan is to to now continue development in the separate extension and submit the patches to weave once the code is tested and fully functional.

This week I added thunderbird support to the mailnews-sync extension. I used weave-ext.xpi and weaver.xpi made to add weave functionality to thunderbird by Shane Caraveo (aka. mixedpuppy). The xpis can be found on his blog here: http://shane.caraveo.com/2010/05/28/addon-roundup/. I have updated the svn with the tb support code (http://svn2.xp-dev.com/svn/mailnews-sync/trunk/). The extension works on current thunderbird build (3.2a1pre which is ominously named as the 'Shredder').

Next week is going to be busy with final year project presentations and demos but I plan to test and complete the mailnews read status up&down sync within the week. I also need to follow up with the tabs sync patch on bugzilla.

Other news:

Lightning in Seamonkey

I recently tried out the lightning extension in Seamonkey and it seems to me to be the perfect calendar app. I used to be a fan of Google Calendar but I needed to be online and logged into Gmail to view it so I stopped using it after awhile. Lighting seems just super for me. There is another student from the junior batch in my university who is working on Lighting for his GSoC project this year. More details can be found on his blog here: http://meharuban.blogspot.com/

Got my GSoC 2010 package today!

Was very happy to receive my GSoC package today. I am now the proud owner of a Google pen, 2 GSoC 2010 laptop stickers, a GSoC 2010 notepad and my very first visa card! I haven't planned what I will do with the money although I have a general idea of saving up for my masters studies which will either be on business or IT, i still have to decide..

Seamonkey & me..

This week I had a chat with my mentor Robert Kaiser and he gave me some insights into the history of Seamonkey and the way forward for the project. Here is the link to the Seamonkey 2.0 & the Vision beyond article :http://home.kairo.at/blog/2009-02/the_draft_new_seamonkey_vision. I am really interested in having the 'all is a tab' option in Seamonkey and hope to contribute to making that vision a reality soon after my GSoC work:)


Thursday, June 10, 2010

So suite!

I took a bit of a break from work today afternoon to design my very own Seamonkey tee.





Wednesday, June 9, 2010

Writing the new mailnews sync engine as a separate extension

I have shifted the mailnews sync engine into a separate extension so that it can be used with existing weave extension. You can find the code here.


I am currently working on this repository but the basic engine functionality is already implemented. This extension should be used along with latest Firefox Sync version(1.4a1pre). New mailnews engine however will not show up in the Sync preferences pane unless a slight code change is made in weave(http://pastebin.mozilla.org/733149). However the mailnews engine is set to be active by default.

I will start submitting the mailnews engine patches to Weave as well soon. Since Weave is due to be a part of the central mozilla code i need to have the new engine code integrated into Weave.

Wednesday, June 2, 2010

The Downfall of Agile Hitler

Got a link to this video from Igor Velkov, one of my GSoC project mentors. Thought it really funny to see Hitler's character talking about Agile development so sharing it here..


Of course the English subtitles are fake!:D

Tuesday, June 1, 2010

New MailNews Engine for Weave and other news..

Weave MailNews Engine

I finally have my new MailNews Engine running on Weave. The Weave API is a bit complex and so it took me some time to understand it and use it correctly. Right now I simply have the new engine registering on Weave and the engine tracker running. The tracker is my first step towards creating new records for keeping track of mailnews message property changes (read/unread status, flagging, tagging etc.). Next steps are to get upsync and down working for these records. Will upload the new engine code to svn and post a link here soon..

My First Weave patch review

Got my first weave patch reviewed (https://bugzilla.mozilla.org/show_bug.cgi?id=567583). I need to make the changes mentioned by mconnor and resubmit the patch. Learnt that I especially need to pay more attention to code styles in future. Followed https://developer.mozilla.org/En/Developer_Guide/Coding_Style to learn the correct code styles used in Mozilla code.

The 3 week holiday

University if closed for 3 weeks because some guys picked a fight and the VC thought it best to punish all 2000+ students instead of just punishing the people who were actually in the fight. Our final year project evaluations have been postponed because of this and this means we will have to start on our jobs soon after finishing university in September. I don't mind though because this holiday gives me time to work on my GSoC project. Also university work was getting hectic with project evaluations and mid semester exams coming up so the break is much appreciated (thank you Mr. VC!).

Monday, May 24, 2010

Official start of Google Summer of Code is today..

It's May 24th! Official date to begin coding for Google Summer of Code. Of course I already started coding before the official start date because I have to manage the summer of code work with my final semester of study in university.
What I have done so far

-Submitted a patch to get Tabs sync working on weave (see: https://bugzilla.mozilla.org/show_bug.cgi?id=567583)
-Wrote a separate extension to get/set read/unread status of mailnews (working on feeds currently) messages
-Started work on weave engine for mailnews sync (however I still haven't managed to install the engine into weave so that still has to be done)

Mid term evaluations are due July 12 by which time I should have the new mailnews engine functional for both upsync and down sync. I will be posting weekly updates on this blog so stay tuned:)


Saturday, May 22, 2010

Getting Weave (Firefox) Sync to work on Seamonkey (and maybe Thunderbird too!)

This post is about the development environment I am using to get the weave sync (more about the new name change later!) addon to work for Seamonkey. I have setup the development environment so that I can code the extension from one central location (my eclipse IDE) and test any changes made immediately in Firefox, Seamonkey and Thunderbird all at once. Before doing this, making sure the code worked for all three applications was a nightmare, but I finally figured out the right way to do it.

I am doing all the development from ubuntu (jaunty) and using eclipse as my IDE. I have xulrunner installed on ubuntu and xulbooster plugin installed in eclipse. I also have the jsEclipse plugin installed in eclipse for easy editing of javascript files. I followed the build instructions for weave available at https://wiki.mozilla.org/Labs/Weave/Building to get the latest weave source and build it. Build didn't work the first time around though, and I had to tweak the Makefile a bit to get it to work. Getting the code to install in all Firefox, Seamonkey and Thunderbird applications was done by creating extension proxies (https://developer.mozilla.org/en/Setting_up_extension_development_environment#Firefox_extension_proxy_file). Once all that was done I only had to restart each application to view the changes I had made in the code. If any changes are made to the .in files (install.rdf.in and chrome.manifest.in) however I had to run make again.

Name Change

For marketing reasons Weave Sync will soon be renamed as Firefox Sync (from version 1.3 onwards). This will make things very confusing when the addon is adopted to Seamonkey and Thunderbird. Users will then have Firefox Sync installed as an addon on Seamonkey or Thunderbird and that just doesn't make much sense namewise. The name change has not been officially announced yet. I got to know about it from my project mentor's blog( http://home.kairo.at/blog/2010-05/weave_is_firefox_is_seamonkey_is_confusi ). Regardless of the name change however I will continue my project to get tabs and mailnews sync functionality working for Seamonkey. There are plans to integrate Weave to the Mozilla platform soon (like Personas) so all naming issues will disappear once that is done.

Tuesday, May 18, 2010

Tabs sync for Seamonkey with Weave Sync add-on

Oops, I'm late in submitting my weekly report! Things didn't go as planned for this week. I found that the tabs sync engine of weave that previously worked on SM in weave version 1.1 no longer worked for SM in weave 1.2.3. This is due to the changes brought on to weave in version 1.2 along with the new overlay which included the about:weave-tabs page for viewing 'Tabs From Other Computers'. The syncing functionality stopped working because now tabs were being accessed from the browser session instead of using gBrowser global variable. The browser session is accessed using the nsISessionStore interface. The XPCOM url for accessing nsISessionStore in SM is different from that of FX (SM: "@mozilla.org/suite/sessionstore;1" , FX: "@mozilla.org/browser/sessionstore;1"). Therefore the util.js file in weave modules had to be changed to get tabs sync working again in weave for version 1.2.3. Some other javascript files also required changes (FX specific code like gBrowser.loadOneTab and gBrowser.loadTabs had to be replaced.

Once the url was resolved tab sync was again fuctional in SM. The next task was to get the 'Tabs from other computers' menu displayed with a proper overlay and have the about: weave-tabs page correctly display the list of tabs from other computers.

I have written an experimental xpi for testing weave tabs sync on SM. I just tested this on the new Seamonkey 2.1 Alpha 1 which has just been released (http://www.seamonkey-project.org/releases/seamonkey2.1a1/). The xpi can be downloaded from here https://sourceforge.net/projects/tabs-for-sm-wv/files/.

This xpi has tabs sync working for SM. Next step is to report a bug in BMO and submit my patch to it. I still have one issue left to resolve though. It appears the code only syncs tabs between different SM instances. FX tabs for example do not show up on SM. This needs fixing.

It seems the biggest issue in getting weave sync to work on SM is that every time weave code is changed it is written specifically for FX so there is a chance SM fucntionality will be affected.

Sunday, May 9, 2010

Listening to mailnews property changes

Last week was bit busy with job interviews and completing final year project work so I had to limit the time I had to work on my SM-Weave project. Hope to catch up on more work this week.

Here's what I did last week..

I setup a listener for mail/news item property changes. Now I can capture any read/unread status changes made in the UI as well as other property changes such as tagging a mailnews item. I will use this listener in the Tracker class of my weavesync engine which I have just started work on.

The updated code with the listener is in the svn.

The same listener code also works in Thunderbird and I will continue testing in both SM and TB to try to have the final sync engine working on both apps.

For this week I need to somehow catch NeilAway (who is always away;) ) on SM IRC and discuss the best place to put the weave menu item 'Tabs From Other Computers'. Then get it approved by KaiRo (IRC nick of my project mentor) and write the overlay and possibly have it submitted as a patch for weave.

Also hope to get my first experimental weave engine working before next week.

Thursday, April 29, 2010

Setup WeaveSync test server on localhost

Google requires us to keep track of our GSoC project work, therefore I decided to use my dear old (or maybe not so old..) blog to report my weekly work :) This is my first report..

GSoC work : Week 1 (26th Apr to 2nd May)

I had two options for a test server for Weave. The Weave 1.0 full server, which comes in two parts (sync server and registration server) or the Weave Minimal server. Since the Weave wiki itself mentions that the full server is complicated to setup and advises people to try the minimal server instead, I decided to setup the minimal server first and then try my luck with the full server.

The full server can be setup with a MySQL database, however the minimal server requires SQLite. Both servers require SSL setup on the webserver (i am using Apache2).

How to setup SSL on Apache2

SSL (new version is TLS) is a cryptographic protocol for providing end-to-end security for communication over the Internet. While looking for a tutorial to setup SSL I came across this article http://www.symantec.com/connect/articles/apache-2-ssltls-step-step-part-1 which gives a good explanation of how SSL works.

For setting up SSL I referred the tutorials http://beeznest.wordpress.com/2008/04/25/how-to-configure-https-on-apache-2/ & http://www.debian-administration.org/article/Setting_up_an_SSL_server_with_Apache2.

The steps were:

1. Enable SSL on apache2
2. Generate key and certificate
3. Edit my virtual hosts configuration file ( /etc/apache2/sites-available/default ).

This gave me the following configuration: http://pastebin.mozilla.org/720065

Now I can access https://localhost from the browser (first time you do this you get a security warning, then you need to add an exception and save the server certificate).


Setup Weave Minimal Server on localhost

I got the server from here : http://tobyelliott.wordpress.com/2009/09/11/weave-minimal-server/ and setup after following the instructions in the ReadMe file. I had to install SQLite3 which I did by using 'apt-get install sqlite3'.

Now I could run weave extension using my custom test server. For the server URL i specified https://localhost/weave_minimal/ and everything worked (well not the first time, because I hadn't added an exception for https://localhost the first time!) just as if I were using the Mozilla server.

The SQLite database is the weave_db file and to view the data I used the SQlite database browser application.


Setup Weave 1.0 full server

I setup the full server on locahost as well in case I require it for future testing. This was harder to setup than the minimal server.

I setup the database with MySQL and followed the installation guides https://wiki.mozilla.org/Labs/Weave/Sync/1.0/Setup (for sync server) & https://wiki.mozilla.org/Labs/Weave/User/1.0/Setup (for registration server). The server requires php to support both PDO & JSON. I had to add PDO support to my existing php5 installation to get the server working.

To run weavesync addon with full server, I specified the server URL as https://localhost/ (end '/' is always required).

I could browse the sync data using the MySQL Query Browser program.

Right now I'm using the minimal server, because there is still an error with the sync server of the full server installation (the sync server test doesn't run - it gives Authentication error and although syncing happens with the extension there is an error in the 'id' field that specifies the type of payload (history, tabs, prefs etc.) being synchronized. I hope to fix this problem soon.

This week I also got to know some of the Seamonkey developers and how they communicate over IRC:) I also had my first official meeting with my mentor, Robert Kaiser to discuss the project. During this meeting it was decided to complete feed status syncing first before working on mail status syncing due to the problems that will arise in mail status sync especially for POP3 mail downloads. Since tab sync is already functional, it was decided have a suitable overlay for 'Tabs from other computers' and test the functionality with it. I will be working on this next week.

So how was my first week as a GSoC student? Definitely exciting!:) It's my first time working with the opensource community and the Seamonkey community was very kind and welcoming:) I also had the opportunity to reply to some Seamonkey user queries this week and try out some IRC commands like /me !:D

That's it for week no. 1 but hope to have much more to report in the coming weeks (15 more to go!):)

Monday, April 26, 2010

Google Summer Of Code 2010!

Wow. I'm selected to Google Summer Of Code 2010! This is my first time applying and since its my final year in university, i thought it would probably be my last chance too! So I was so afraid to check results and see a rejection. I didn't check email until 12.30am (the time of announcement in local time), and I couldn't believe it when i saw the Congratulations email! I checked on the gsoc site as well just to make sure the Google mail program hadn't got it wrong smehw!:D

Then I did a quick chat with my other friends who got selected and thanked my mentor(Robert Kaiser) for selecting me and also thanked Igor Velkov(my assistant mentor of sorts:)). I still have a long list of people to thank though! Everyone who has encouraged me in anyway to enroll for Google Summer Of Code!

GSoC is a big step for me, because I hope to learn all about Opensource programming from it and hopefully it will help me achieve my long term goals and ambitions in life:)

The project I am selected to participate in is a Mozilla project for the Seamonkey internet application suite, which is a browser and email and news all rolled into one. It's just like using Firefox with Email and News built in. And even better the project is an addon and still better its about data synchronization! This is so relevant to my final year project in university that it seems like just the perfect project for me!:)

The project is about implementing tabs and mailnews status sync engines for WeaveSync addon for Seamonkey. I have already started up some work on this and hosted it here (http://svn2.xp-dev.com/svn/smread/trunk/).

So what is a Seamonkey? This is one of the first questions I had when deciding to apply for this project. Seamonkey is a kind of shrimp and it was a code name for the original Mozilla Netscape suite. This later became Seamonkey. There are pics of seamonkeys on wikipedia but I prefer the Seamonkey icon which is quite lovely:)



If you haven't tried Seamonkey yet I suggest you check it out now. You can download it here. http://www.seamonkey-project.org/. It's the perfect solution for keeping track of all the blogs and new sites you follow and keeping track of your email properly:) And with the WeaveSync addon for tabs and mailnews sync coming up soon its gonna get a whole lot better!;)

Thank you to the Seamonkey, Mozilla and Google opensource communities for giving me this wonderful opportunity!

Saturday, April 17, 2010

Turn your laptop into a wireless router in Ubuntu

It is easy to setup an ad-hoc wireless network on Windows (http://www.kombitz.com/2009/02/09/windows-7-how-to-create-an-ad-hoc-network/) to share your internet connection with another pc over a wireless connection but doing the same on Ubuntu is complicated. No wizards here, just plain old terminal commands.

Converting your laptop into a wireless router is an easy way to share your internet connection (broadband) with another laptop without requiring a multi port router or a wirless router or any cable connections. See diagram below..

Here's how I did it on Ubuntu 9.04. Took a lot of experimenting to find the right method but the following steps finally got it working.

-First, install the packages dnsmasq, ipmasq, and dhcp3-server

sudo apt-get install dnsmasq
sudo apt-get install ipmasq
sudo apt-get install dhcp3-server

-Assign a static IP address for the wireless card on the desktop machine by editing the file /etc/network/interfaces. Add these lines to the end of the file (if you already see wlan0 somewhere else, delete that first):

auto wlan0
iface wlan0 inet static
address 192.168.0.1
netmask 255.255.255.0
broadcast 192.168.0.255
wireless-mode ad-hoc
wireless-essid YOUR-NETWORK-SSID-HERE
wireless-key YOUR-NETWORK-KEY

-Next edit the file /etc/default/dhcp3-server by finding the line with INTERFACES="" and replacing it with

INTERFACES="wlan0"
(This tells the DHCP server to listen on the local network for connections)

-Now open the file /etc/dhcp3/dhcpd.conf. Find the following lines:

option domain-name "example.org";
option domain-name-servers ns1.example.org, ns2.example.org;

default-lease-time 600;
max-lease-time 7200;

and replace them with:

#option domain-name "example.org";
#option domain-name-servers ns1.example.org, ns2.example.org;

#default-lease-time 600;
#max-lease-time 7200;

Then paste this at the end of the file:

subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.100 192.168.0.200;
option domain-name-servers 192.168.0.1;
# option domain-name "internal.example.org";
option routers 192.168.0.1;
option broadcast-address 192.168.0.255;
default-lease-time 600;
max-lease-time 7200;
}

-Set up IP masquerading and forwarding:

sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
sudo dpkg-reconfigure ipmasq

The default answers should be fine.

-Set up DNS masquerading:

sudo dpkg-reconfigure dnsmasq

-Now start everything up!

sudo ifdown wlan0
sudo ifup wlan0
sudo /etc/init.d/dnsmasq restart
sudo /etc/init.d/dhcp3-server restart

Now if everything went well you would be able to see the newly setup netowrk in the list of wireless networks of your other pc and you can connect to it:)

However when running sudo ifdown wlan0 I got the error..

Error for wireless request "Set Mode" (8B06) : SET failed on device wlan0 ; Invalid argument.Error for wireless request "Set ESSID" (8B1A) : SET failed on device wlan0 ; Invalid argument.
sudo modprobe ndiswrapper

I think this is because my wireless network card did not have a native Linux driver. I fixed this by running..

sudo modprobe ndiswrapper

Ndiswrapper is a Linux module which allows Ubuntu to use the Windows driver for wireless cards (in most cases).

Everything is working fine now and I'm sharing my broadband internet connection with another laptop via a wireless connection now.

References:




Tuesday, April 13, 2010

How to show/hide desktop icons on ubuntu.

If your desktop ever looks as cluttered as the 'Before' pic below you will definitely find this method useful!

Sometime back I wrote a blog post on how to do the same thing for windows http://hariniachala.blogspot.com/2009/11/hide-messy-looking-desktop-icons-with.html. When looking for a similar method for my ubuntu desktop i came across this..

http://bayu.freelancer.web.id/2009/05/03/showhide-desktop-icon-on-ubuntu/

Follow the instructions in the link and soon your desktop will be magically free of all clutter!

Before



After



If you like my wallpaper you can get it here (http://bit.ly/35rzNB). The word at the bottom means 'Spring'. I've put it in Greek to add a touch of mystery to the wallpaper:)

Tuesday, March 16, 2010

Running apache2 server on ubuntu and tracking its activity..

This is a simple guide to install and run apache2 server on ubuntu and track the server activity while it is running.

Install apache2 server on ubuntu through terminal..

sudo apt-get install apache2


Track server by running following command in a separate terminal

tail -f /var/log/apache2/error.log

now you can see the server activity being logged in this terminal.

Start apache2 server

cd /etc/init.d
sudo ./apache2 start

You can also do

sudo ./apache2 --help

to view all available commands.

Now go to http://localhost in your browser

The message 'It works!' will be displayed. (the file displayed is index.html in /var/www folder)

Sunday, February 28, 2010

Running Ubuntu inside Windows

Love this! No more rebooting for windows or ubuntu. No need for a separate VM. I am running ubuntu inside windows and can access both ubuntu and windows programs at the same time. Right now I am running IE on windows while downloading packages on Synaptic Package Manager on ubuntu.

I am running Vista with 3GB RAM and core 2 duo processor and things run pretty much normal without slowing down.

Totally recommend this for anyone using Windows and Ubuntu on dual boot.


Here's a screenshot of what ubuntu inside windows looks like on my machine.


Reblog this post [with Zemanta]

Tuesday, February 9, 2010

Send SMS for free to dialog Sri Lanka numbers from your email

This is not an ideal way to send SMS but it works, its easy and its free! Well not 100% free because to activate it the SMS receiver must dial 711. That will cost around Rs 3/-.

next go to your email program and create a new message.
in the 'To' field put the email address(es) in the following format

77xxxxxxx@dialog.lk

(this is the dialog number of the receiver followed by '@dialog.lk')

in the 'Subject' field put your message (this should be less than 120 characters)
leave message body blank
send the message
the receiver will get the message immediately.

This is an easy way to send short SMS alerts for free to a group of people. I found this method out while referring to the 'Pocket Office' service offered by dialog.

http://www.dialog.lk/personal/mobile/features-and-vas/messaging/pocket-office/

If anyone knows of a better way to send SMS for free to dialog please let me know. I tried out different services available online but none of them worked.

Friday, January 29, 2010

Avatar Craze!

Okay I'm a huge fan of the movie and I'm deeply dissapointed I can't watch it in 3D! Just thought I'd post some of my favourite Avatar pics/wallpapers here in my blog.