foss.in 2006

Last thursday, I was on the train ‘Lal bagh Express’ leading towards the city of Bangaluru. It was my journey to Bangalore after an year, the last time I was there being to attend the test at MRO-Tek. I had moved to 3 different jobs then, am in my 3rd job now. I was carrying those memories with me, trying to retrieve my kannada vocabulary, which I enjoy inheriting from my father, whose mother tongue is kannada.

This time I was not for any interviews or tests, but was for few good days in life. I was going for foss.in. it was something which had been a buzz word for a few weeks now. Many were looking eagerly for it. The most important thing which drew people towards it was an opportunity to meet people. We have been acqauinted with one another through IRC channels for some time now and we wanted to match names to faces. This was one opportunity for that. Apart from that, there were some cool talks scheduled.

foss.in was formally openned up on 24th Novemember 2006. It was held at JN Tata Auditorium in Indian Institute of Science, Bangaluru. This is the first time am been to foss.in as well as a nation wide event, participated by international figures. I was there, in the early morning (8 am is supposed to be early morning in Bangaluru :P ). We had been planning for a few days on how to reconize one another, where to meet, etc. And thankfully when I was lurking around, Kushal came there. With his help I got my passes (and for my team too). Slowly one by one started joining in, Pradeepto, Bharkha, Anurag, Roshan aka Ubunturos, and Shrikarnt. I also met Devdas (f3ew), Taj, PowerPork, t3rmin4t0r, kartik, tazz and many others. I really had a good time matching names with faces :D

Ok, will have a quick look around about my 3 days…

Day 1:

The openning keynote address by Suparna Bhattacharya, about minimalistic development method followed among the Linux Kernel Developers.

Web Development in Common Lisp by Vamsee Kanakala. He is a Chennai LUG member too and one of the guys I was acqauinted with. It was really a nice talk, though he stumbled on some errors during the demonstration.

Solving the fundamental structural problem in free software by Andrew Cowie. It was one of the best talks I had heard. He really made audience enjoy the talk and for the first time, I blogged it live into my live journal pages.

The day ended with the above keynote address. We had got the delegate kit, a nice cotton bag and a ultra-kewl mug with foss.in embossed on it.

Later, our gang (me, pradeepto, devmodem, kushal, n3oo3n, baks) went to a keralite restaurant and ate appams with aviyal and kuruma. Kushal had got his new Lenovo laptop and spent his whole night tweaking it in Fedora ;)

Day 2:

The day started with Aaron Seigo openning up with the keynote address, a talk on KDE4 and the exciting new things which are available with it.

I really missed the talk of Rasmus on Getting rich with PHP.

After lunch, we had a KDE-In BoF. We discussed about what we need to make more people embrace KDE, how to help people who want to start with KDE development, how to make kde-in more active and many more things. As most of us was acqainted with Aaron, we could talk more things freely.

It was immediately followed by FOSS in Education BoF. It was actually intended to be concentrating more on streamlining the activities of NRCFOSS, with inputs from the FOSS community. But, it rather stayed in very low levels of computers in schools. Hope, we discussed much serious things :s

The closing keynote was a panel of prominant FOSS faces in India, compered by Thaths. There weresome hot discussions and wide range of topics discussed.

I stayed at Dushyant’s (derek[]) place for the night, where we watched the Code movie in my laptop.

Day 3:

The openning keynote was a really informative talk on ‘Impact of Patents and Copyright Laws in India on FOSS’. There was an active participation from the audience as well as Sunil Abraham was very informative.

Kartik Mistry’s talk on ‘How to become an Indian Debian Developer’ was another nice one to attend. It had some interesting information about contributing to the Debian development and packaging for Debian.

Priti Patil, of CDAC Mumbai, talked on the Janabhaaratii Project, which deals on making a Distribution with 100% localization support in Marathi.

After lunch, Aaron Seigo talked about KDE4 development. It dealt with developing GUIs with KDE4, how and where to get help, etc.

Sirtaj Singh (Taj) talked about the Qt Graphics View.

The best talk I had heard in my life was the closing keynote on Chaos Computer Club by Tim Pritlove. There was 3 mind blowing videos, revealing the misunderstood lives of the Hacker community.

The curtains of foss.in 2006 fell down with a closing ceremony headed by Atul Chitnis. And, I made my way back home later that night by train.

I have uploaded some photos on my flickr as well as more pictures are available in flickr, which has foss.in photos from all those who have uploaded there.

e17 on Ubuntu – A brief enlightenment

e17 is the DR17 version of the Enlightenment window manager. Enlightenment is one of the other well known window managers in Unix/Linux world and its advantage is light weight and simplicity. e16 was simpler, yet it did not satisfy the eye candy that the users migrating to Linux demanded. But, e17 has solved this much by bringing in some elite eye candy which doesn’t ask you for much RAM.

I had used e16, though GNOME has been my favourite. But, I wasn’t confortable with e16 much. When I came across an article in LFY about e17, I wanted to have a look. The enlightenment which is available in ubuntu repository is e16 (am afraid so!). And, it messed up along with my GNOME/metacity that when I booted back in metacity, it was showing elements of enlightenment along with it. I had a bad day clearing all the mess it did.

But yesterday, Sudharsh told me about e17 and showed me a script which will download the required files from the CVS repos and compile-install it on my machine. I tried it in my workbox at office, but it demanded some dependencies which weren’t met. But, I thought of checking it out in my Laptop at home.

I tried it today. We need to just get this script in your local machine, give it executable permission and run it in a terminal. The script will run in 2 phases, phase 1 takes care of downloading all the files and phase 2 compiles the downloaded files and installs them in the local system.

$ sudo apt-get install build-essential cvs libtool libltdl3-dev automake1.9 autotools-dev libpopt-dev libcurl3-dev libx11-dev x11proto-xext-dev libbz2-dev libid3tag0-dev libpng12-dev libtiff4-dev libungif4-dev libjpeg62-dev libssl-dev libfreetype6-dev bison flex xlibs-dev gettext libimlib2-dev libxml2-dev libxcursor-dev libgtk1.2-dev autoconf pkg-config libpng3-dev libxine-dev libxkbfile-dev libsqlite3-dev giblib-dev libxmu-dev libxdamage-dev libxcomposite-dev libtag1-dev libtagc0-dev giblib-dev libasound2-dev

A small note on this, rather a warning: you need an additional library which is missed in the list of dependencies to be installed prior to running the script. The missing thing is libxslt and do an apt-get install for these 2 packages – libxslt1.1 and libxslt1-dev

$ sudo apt-get install libxslt1.1 libxslt1-dev

To run the script

$./easy_e17.sh –skip=etk_server -i

The `–skip` option skips the download and installation of ‘etk_server’ which I was adviced to.

If you want any additional help then,

$./easy_e17.sh –help

If you encounter any problem, especially dependency, then install the corresponding package. If it happens during compilation stage, later you can run the script skipping the download part using this command,

$./easy_e17.sh –skip-cvsupdate -i

After it has compiled and installed, there is one step you need to do before you can login into e17. Do the following

$sudo vi /usr/share/xsessions/e17.desktop

Add the following lines into the file and save

[Desktop Entry]
Encoding=UTF-8
Name=E-17
Comment=
Exec=/opt/e17/bin/enlightenment_start
Icon=
Type=Application

If you refer to the actual ubuntu forum page, then you will notice it is ‘enlightenment’ instead of ‘enlightenment_start’. But, when you boot it using that option then when you login it will ask you to change the option as I have given.

The last thing to do is that add the path ‘/opt/e17/bin/’ to your $PATH. This is because e17 got installed in ‘/opt/e17/bin’ and hence we need to put in on the PATH environment variable to be found.

$ export PATH=$PATH:/opt/e17/bin/

Now, logout of the current desktop. While loging in back, remember to change the session to e17. I will advice you to select ‘Use for this session only’ option, so you can first experience, hang around and change if you do like. Otherwise, you have the existing desktop/window manager as the defaulft.

Will add more about my e17 experience later. Enjoy the enlightening experience.

PyProgram #1 – Replacing contents of a string using a dictionary of replacements

Came across a nice programming problem, actually intended for an exam on Python. Was in a mood to try solving them using my ‘solpa’ knowledge of Python.

Problem: Given the input string ‘aabbabccdab’, replace the characters as follows: a with l, b with m, c with n, d with o, using dictionaries. The replacement should produce a new string, instead of changing the original string.

Solution:

Create an input string

inputstr = ‘aabbabccdab’

Create a dictionary of replacement letter pairs

convdict = {‘a’:'l’, ‘b’:'m’, ‘c’:'n’, ‘d’:'o’}

We have the input string, how to read individual letters? Try this

# for x in inputstr: print x

Now we have to read each letter to the string, find the replacement letter from the dict and replace it. Wait! Rather add it to a new string. One way is to initialize an empty list and add letter by letter to it and finally join them as a string.

outputlst = []

So, here is the python code which is going to do the replacement and append it to the list.

for x in inputstr: outputlst.append(convdict[x])

But, now we have only a list of the letters replaced from the string, while we need an output string. So, we have to join the elements of the list.

import string

outputstr = string.join(outputlst, ”)

Hmm, let us check.

print outputstr

llmmlmnnolm

Hurray!

Is there a better way than to do this ? Without using list, of course, just add the replacements to a string.

outputstrn = “”

for x in inputstr: outputstrn = outputstrn+convdict[x]

print outputstrn

Always try to do it simple, the way your are confident of getting an answer. Once you are done, have a second look of making the code small and further simple. Hope, I did come up with a decent solution. :)

With respect to Sridhar Ratna‘s comment, I tried to make use of string.makestrans(). After a little help from Casanova, I could end up with a little different but a simpler solution. But am not sure how to use a dictionary of replacement letters in this method, will figure it soon :)

Module: string

Syntax: maketrans(from, to) –> string

Description: Returns a translation table, a string of 256 bytes long,, suitable for use in strings.translate. The strings from and to must be of the same length.

Code:

import string

transtr = string.maketrans(“abcd”,”lmno”)

outputstr = string.translate(“aabbabccddab”,transtr)

print outputstr

‘llmmlmnnoolm’

The Silk Clouds

Went out to catch some fresh air this morning and looked at the skies to find out how thick the rain clouds were. What I expected was presence dark clouds, instead there was this white cloud, as white as silk. It was like some one had gone over the skies and dumped a huge lump of silk over there. The some one may be mother nature ;)

Will I leave such a sight ?! Ran back, got my Digicam and took a few snaps of it. It would have been great if I had some green around, instead of concrete structures. Anyway, here is one of the snaps, which I felt was better than the others.

The Silk Cloud

There is one good news to add on. I have recieved a lot of appreciation for this picture, thanks a lot for every one who spoke back to me about this. One of my friends Mrugesh Karnik ,aka floyd_n_milan as people in #linux-india knows, has ideas to make a sketch of this drawing. Its going to be either a pencil sketch or an oil painting. Hope to see it soon and its the main reason I went for a Creative Common License for this picture.

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License.

–>

Faster Browsing !?

We all do browse and wish we can browse faster. Am not meaning the ability of the individual to browse faster, neither the ability of the browser like FireFox, but some thing else which looks techy but really determines the speed of browsing. It is called resolving domain names or Domain Name Servers (DNS).

If you have ever tried to configured your network, even your Internet connection at home, you would have encountered something called as DNS. DNS can be simply said as a service which resolves domain names into the corresponding TCP/IP address. For example, when we type http://www.google.com in the address bar of our browser and press enter/go, something happens in the background which we haven’t worried much till now. The domain name which you typed (google.com) gets translated into the corresponding IP address which will specify the server where google.com is hosted or where the actually request for the page `google.com` should be sent. This is done with the help of DNS servers which help our computer to resolve the domain name to its IP address.

But where are these servers and how will I know them ? Do not worry, your system can obtain them automatically from your Internet Service Provider (ISP). Or else, there are enough number of DNS around the web, which are globally accessible and available for public.

Ok, lets come to the point.. making the browser resolve the domain names faster. Is it with the browser, your computer hardware, operating system, your ISP or the DNS itself ? Hmmm.. its within our reach, perhaps within the reach of our operating system.

How ? There are some software tools which can help you with this. One such tool, which is available for all famous distributions of Linux, all flavors of BSD, Mac, is dsnmasq.

The official site of dnsmasq defines it to be a light weight, easy to configure DNS forwarder and DHCP server. Let us now mind about the DHCP part now. The dnsmasq can pick up the addresses of the local machines which are not in the global domain as well. Hence, it is more suitable for small home networks where using BIND is an overkill.

How does dnsmasq help us ? What dnsmasq does is that, it caches the nameserver lookups and make use of this cache for future looks ups. Its nothing but similar to taking a history of the dns lookups and referring this history for future. Thus, when we lookup for a domain name resolution, then the cache is searched first. If there is an entry there, then the domain name gets resolved within our local system itself. Else, the DNS servers are contacted and an entry is added to the cache for the resolved domain name.

How to get dnsmasq ?

  1. From the official archive of dsnmasq at thekelleys.org
  2. From the repository of your distribution, using apt-get (if present)
  3. Using package managers like Synaptic, if dnsmasq is supported by your distribution.

Installation and Configuration

First, get dnsmasq installed using apt-get,

$ sudo apt-get install dnsmasq

Once dnsmasq got installed, we need to fiddle with some configurations before everything works fine.

Edit the file /etc/dnsmasq.conf, uncommenting the line that reads

listen-address=127.0.0.1

The next thing to edit is /etc/dhcp3/dhclient.conf, to ensure that the following lines are present.

prepend domain-name-servers 127.0.0.1;
request subnet-mask, broadcast-address, time-offset, routers,
domain-name, domain-name-servers, host-name,
netbios-name-servers, netbios-scope;

This line just makes sure, the first place the domain name is looked up is 127.0.0.1 which is nothing but your own computer, a place where your dnsmasq is running to serve you. Thus, the dnsmasq cache is first searched for domain name resolution and then proceeded to the other DNS servers listed in /etc/resolv.conf.

There are couple of steps left, first is to edit /etc/resolv.conf once and add the following line,

nameserver 127.0.0.1

Next, the final step, is to restart your dnsmasq service for the changes we made till now to take effect. To do this, type the following in the terminal,

$ sudo /etc/init.d/dnsmasq restart

Testing ?! Yes, indeed we have to test to make sure its really working out. Hmm.. being connected to the Internet, fire up your terminal and execute the following…

$ dig yahoo.com

The output will be as follows…

; <<>> DiG 9.3.2 <<>> yahoo.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 32837
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 5, ADDITIONAL: 5

;; QUESTION SECTION:
;yahoo.com. IN A

;; ANSWER SECTION:
yahoo.com. 68 IN A 216.109.112.135
yahoo.com. 68 IN A 66.94.234.13

;; AUTHORITY SECTION:
yahoo.com. 172691 IN NS ns2.yahoo.com.
yahoo.com. 172691 IN NS ns3.yahoo.com.
yahoo.com. 172691 IN NS ns4.yahoo.com.
yahoo.com. 172691 IN NS ns5.yahoo.com.
yahoo.com. 172691 IN NS ns1.yahoo.com.

;; ADDITIONAL SECTION:
ns1.yahoo.com. 172268 IN A 66.218.71.63
ns2.yahoo.com. 172268 IN A 68.142.255.16
ns3.yahoo.com. 172270 IN A 217.12.4.104
ns4.yahoo.com. 172270 IN A 68.142.196.63
ns5.yahoo.com. 172268 IN A 216.109.116.17>

;; Query time: 325 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Fri Nov 10 21:10:08 2006
;; MSG SIZE rcvd: 229

It took 325 msec. But, we expected it to be fast, isn’t it ? Wait! This is the first time we are resolving the domain name. Lets see what it happens when we try it again. Execute the same command again and check, it will result as below..

; <<>> DiG 9.3.2 <<>> yahoo.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 7500
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;yahoo.com. IN A

>;; ANSWER SECTION:
yahoo.com. 66 IN A 66.94.234.13
yahoo.com. 66 IN A 216.109.112.135

;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Fri Nov 10 21:10:10 2006
;; MSG SIZE rcvd: 59

See, the query time is 0 msec. This is really fast isn’t it (unless you expected some negative numbers there :p). Good work, dnsmasq!

So, the post ends here ? Naah! I have a little more to say. I had the problem that everytime I connected, the resolv.conf got replaced with the DNS nameservers sent by the ISP. The reason is I have configured pppoe to obtain the nameservers from the peer during connecting up. Also, i wasn’t having resolvconf. So, if you are in a similar situation that you have to manually add “127.0.0.1″ every time you get connected, then better do the following.

$ sudo apt-get install resolvconf

Edit the file /etc/resolvconf/resolv.conf.d/head and add this line to it,

nameserver 127.0.0.1

In addition to this, you can edit the file /etc/ppp/peers/dsl-provider and comment the following line.

usepeerdns

Now, disconnect your Internet connection and connect again. Check out the resolve.conf file whether you have the entry for “127.0.0.1″ at the top of the list. If you have, then you have done everything fine. If not, then you have messed up somewhere. You can also check this blog, which is the one I used up to set dnsmasq :)

Happy Browsing! Faster Browsing! :)

Emacs 23 – Phase II

Things keep changing with time, rather they evolve and improve to better things. This is one such an occasion to look back at something which has moved to the next stage. wondering what ? Am talking about emacs-snapshot which I wrote about a month ago.

I was really surprised to hear from G0SUB that emacs-snapshot was available in the repository as .deb package. And still happier to know that I could update my earlier emacs-snapshot with our favorite `apt-get update`.

Baishampayan Gose has set up an APT repository, from which we can install it over Ubuntu Dapper machines. And, I successfully installed it in my Ubuntu Edgy laptop. The steps are as follows…

#1. Add the following line to /etc/apt/sources.list

deb http://people.ubuntu-in.org/~ghoseb/apt/ dapper main

If you are interested in getting the source and install from it then,

deb-src http://people.ubuntu-in.org/~ghoseb/apt/ dapper main

#2. Do sudo apt-get update to update your package list with the newly added repository.

#3. To do a fresh install of the emacs-snapshot package do,

sudo apt-get install emacs-snapshot-gtk

#4. If you already have a vanilla emacs-snapshot package, which I wrote about in my earlier blog post, then do this…

sudo apt-get upgrade

This will upgrade your earlier installation to the new version.

#5. If you are doing a fresh install, then you have to edit your .emacs file, provided you have emacs21 in your system. If so, then put the following code into the .emacs file.

(set-default-font "Bitstream Vera Sans Mono-8")

#6. To launch the new emacs-snapshot type this into the terminal and press ‘Enter’,

emacs-snapshot-gtk --enable-font-backend

You can also create a launcher and add the above command into the command field.

Experiment, enjoy and get us feedbacks :) If you have further queries or suggestions, you can post them in G0SUB’s blog post about the same :)

gNewSense 1.0 – One more to the numerous!

It was a fresh Friday morning, with a second depression formed over Chennai and rain pouring down like hell, when I had just turned up online and was checking digg.com. One of the posts which attracted my attention was the release of another new GNU/Linux distribution named “gNewSense”. I read the article as well as checked out gnewsense.org, which is the official web site of the project.

This new distribution gNewSense is nothing new in the real sense. Off late, Ubuntu has become really a distribution for the comman man and has acclaimed wide fame. But, there were some non-free (`Free as in Freedom`) stuff contained within which has been a subject of criticism off late. Thus a new distro was created by taking out binary blobs from Ubuntu Dapper, making them free to end up with a more ‘Free’ GNU/Linux distribution.

In addition, their website talks about scripts with which anyone can create an entirely new distribution, based on Ubuntu Dapper. There is a step by step guide to help out creating a new distribution.

Although it is said to be the clone of Ubuntu Dapper, there are a few distinct features such as,

  • Firmware and restricted packages removed
  • Logos of Ubuntu has been removed
  • Universe repos enabled by default
  • Emacs and build-essential are part of the default installation

Other than this, it is nothing but Ubuntu Dapper. But it is said that in coming releases more non-free softwares might me removed and this gNewSense made 100% free software.

I downloaded the 661MB iso image of gNewSense Live 1.0 and burned it up in a CD. The iso image can be obtained from cdimage.gnewsense.org or from various mirrors sites that the supporters of this new endeavor has put up. I downloaded from one put up by Gnuklear in his site gnuklear.org.

$ wget -c http://gnuklear.org/gnewsense/gnewsense-livecd-1.0.iso

The official press release by FSF talks more about the project as well as calls for volunteers for acting as developers, website maintainers, graphic artists, freedom verifiers and documentation writers.

There is a very active community already up for the distro in the IRC channel #gnewsense @ irc.freenode.net.

Now comes my personal opinion.. ahem ahem.. this looks cool, ok ?! But, I have been hearing a particular criticism from a part of community, which I found to be justified. Why do we need another distro when there are already numerous ? And that too, one which is nothing but an already existing distribution with a few software, tagged to be non-free, being stripped off from it. Not all people out there are followers of FSF and hence, they accept and agree on certain amount of non-free softwares which one or another make their life a little better without compromising a lot on ‘Freedom’. This is also seen as a move to yank away a part of Ubuntu community which is not too happy with the existence of non-free softwares within Ubuntu. But, will it really affect the existing distributions and their popularity or community strength ? I seriously doubt it. May be a 100 people might migrate from other distributions with a new sense of freedom but not those who have settled down with one distro for their life. I mean those people who will forgive certain inabilities of their favorite distribution even when there is something which is ‘said to be better’ available. I am one of these men, a proud Ubuntero. As of now, I find no other distribution which I personally feel as good as Ubuntu. There are a lots of fellow Ubunteros, Debians, Fedoro Cores, Red Hats, Mandrivians, Suse’s etc etc. out there.

For the eyes of a Free Software zealot, it might be the distro he has been longing for; but for an ordinary Linux enthusiast, it adds one more to the numerous existing flavors of Linux (pardon me if I should have said GNU/Linux instead). For me, it was no better than Dapper Drake or rather Edgy Eft which am currently running.

To be a bit optimistic, let us wait and see what the gnewsense community leads itself to. Whether it is going to reach a height that Dapper Drake did or it is going to see a fall which many other not-so-famous Linux distributions did, is in their own hands of the newly born gNewSense community.

Long live the Freedom! Long live the Community! :)