Wednesday 28 February 2007

Python Phrasebook - Essential Code and Commands

Python PhrasebookOne of the most asked for feature in a book by programmers and coders is a quick reference for getting things done. That is, all the useful bits of code and other gems pertaining to a language compressed into a book whose size is ideal for carrying around where ever you go. Truth be told, there are not many such books around. When you search for a book which acts as a ready reference for any programming language, you inadvertently run into hefty 800 to 1000 page books which require significant effort on the part of the reader to navigate, let alone carry it around.

But the Phrasebook series is a set of books on a variety of programming languages which is published by Sams Publishing which aims to address this need. The advantage of the phrasebook is that it is small enough to be held in the palm of your hand. And the number of pages are no more than 300. Which means it is the exact dimension and size of an average pulp novel. But the difference is that each of those 300 pages contain a wealth of knowledge in the form of bits of useful code which can be readily used by programmers.

One such phrase book is the Python Phrasebook which has a very rich collection of customizable code snippets. "The Python Phrasebook - Essential code and commands" is authored by Brad Dayley and is divided into 10 distinct chapters each catering to a particular aspect of the Python language.

While the first chapter provides an overview of the Python language, the succeeding chapters provide bits of code in Manipulating strings in python, Managing data types, managing files, threads and databases in python and so on.

To highlight the usefulness of this little book, suppose I want to say find the right code to access a list using Python. I can do it in a number of ways. I could troll the internet to get the exact code, go through a good book on python which may or may not contain the exact code I want or make use of the easier way which is to use the Python phrasebook as a ready reference and find the exact code I am looking for in the "Managing data types" chapter. This little book contain a chapter on implementing internet communication where the author provides bits of code to achieve tasks related to sockets. And also chapters which show the code to process HTML and XML files using python.

One thing worth noting is that each code snippet is accompanied by an explanation of the code and also a short example program which utilize the code. This makes it much more easier for a Python programmer to understand the use of the code. And all code snippets address real life problems. So you will find code snippets to say, retrieve images from HTML documents, allowing users to upload files via CGI scripts, connecting to a MySQL database server, defining lists, splitting strings and so on which range from the common things to the other end of the spectrum of accomplishing specialized tasks.

To give a preview of what you get in this book, here is a sample excerpt from the Chapter 7 titled "Implementing Internet Communication".

Retrieving Email from a POP3 Server
The text below is the copyright of Sams Publishings.
mServer = poplib.POP3('mail.sfcn.org')
mServer.user(getpass.getuser())
mServer.pass_(getpass.getpass())
numMessages = len(mServer.list()[1])
for msg in mServer.retr(mList+1)[1]:
The code

The poplib module included with Python provides simple access to POP3 mail servers that allow you to connect and quickly retrieve messages using your Python scripts.

Connect to the POP3 mail server using the poplib.POP3(host [,port [,keyfile [,certfile]]]) method, where host is the address of the POP3 mail server. The optional port argument defaults to 995. The other optional arguments, keyfile and certfile, refer to the PEM-formatted private key and certificate authentication files, respectively.

To log in to the POP3 server, the code in pop3_mail.py calls the user(username) and pass_(password) methods of the POP3 server object to complete the authentication.

NOTE: The example uses getuser() and getpass() from the getpass module to retrieve the username and password. The username and password can also be passed in as clear text strings.

After it’s authenticated to the POP3 server, the poplib module provides several methods to manage the mail messages. The example uses the list() method to retr ieve a list of messages in the tuple format (response, msglist, size), where response is the server’s response code, msglist is a list of messages in string format, and size is the size of the response in bytes.

To retrieve only a single message, use retr(msgid). The retr method retur ns the message numbered msgid in the form of a tuple (response, lines, size), where response is the server response, lines is a list of strings that com- pose the mail message, and size is the total size in bytes of the message.

NOTE: The lines list returned by the retr method includes all lines of the messages, including the head- er. To retrieve specific information, such as the recipi- ent list, the lines list must be parsed.

When you are finished managing the mail messages, use the quit() method to close the connection to the POP3 server.

import poplib
import getpass
mServer = poplib.POP3('mail.sfcn.org')
#Login to mail server
mServer.user(getpass.getuser())
mServer.pass_(getpass.getpass())
#Get the number of mail messages
numMessages = len(mServer.list()[1])
print "You have %d messages." % (numMessages)
print "Message List:"
#List the subject line of each message
for mList in range(numMessages) :
for msg in mServer.retr(mList+1)[1]:
if msg.startswith('Subject'):
print '\t' + msg
Using Python to Fetch Files from an FTP Server 159
break
mServer.quit()
The Program : pop3_mail.py

password:
You have 10 messages.
Message List:
Subject: Static IP Info
Subject: IP Address Change
Subject: Verizon Wireless Online Statement
Subject: New Static IP Address
Subject: Your server account has been created
Subject: Looking For New Home Projects?
Subject: PDF Online - cl_scr_sheet.xls
Subject: Professional 11 Upgrade Offer
Subject: #1 Ball Played at the U.S. Open
Subject: Chapter 3 submission
The Output: From pop3_mail.py code above

Book Specification
Name : Python Phrasebook - Essential code and commands
ISBN No: 0-672-32910-7
Author : Brad Dayley
Publisher : Sams Publishing
No of Pages : 300
Price : Check the latest price at Amazon.com
Comments : An Ideal resource for Python programmers. Acts as a ready made code source for achieving a variety of tasks in Python.

Tuesday 27 February 2007

Most popular websites 6 out of 7 powered by GNU/Linux - concludes survey

Pingdom - an uptime monitoring company conducted a survey recently where it researched the technologies that power 7 most popular websites namely -
  • Techcrunch - A blog maintained by Mike Arrington which is dedicated to profiling and reviewing new Internet products and companies.
  • FeedBurner - a provider of RSS feed management for bloggers and other online news sources and which is currently offering more than 566,000 feeds from more than 334,000 publishers.
  • iStockPhoto - An online, royalty-free stock photo provider.
  • YouSendIt - A service allowing its users to move and share large files with others over the Web instead of sending them over email. The service has more than 3 million registered users and transfers more than 1 million files daily.
  • Meebo - This is an in-browser messaging application supporting a variety of messaging applications such as Yahoo! Messenger, Windows Live Messenger, ICQ, AIM and Jabber. Meebo users exchange more than 70 million messages every day.
  • Vimeo - claims to be one of the most popular video sharing sites; next to youtube that is. And lastly ...
  • Alexaholic - This popular site uses data from Alexa to display web traffic trends. Here you can compare and analyse one site's statistics with another.
While I do not believe these are the most popular sites (obviously there are more popular websites), these are indeed very popular and enjoy a large group of followers.

These are the findings of the survey.
  1. All these websites except Alexaholic, exclusively use Linux as their choice of OS. Alexaholic is hosted on Windows.
  2. Barring Meebo and Alexaholic, all the rest use Apache web server to serve their web pages. Meebo uses lighttpd - an alternative open source web server and Alexaholic uses IIS.
  3. All the seven websites exclusively use MySQL as their database.
  4. These are the number of web servers each of the sites employ:
    • Meebo - Greater than 40 Nos
    • Yousendit - 24 Nos
    • Alexaholic - 2 Nos
    • Techcrunch - one
    • FeedBurner - 2x70 - 140 Nos
    • iStockPhoto - 15 nos
    • Vimeo - 4 Nos
  5. The most popular server side scripting language is obviously PHP with 5 of them developed using it.
In all, the survey provides details related to web servers, database servers, network hardware, storage servers, site usage and some miscellaneous data. You can read the detailed result of the survey here.

One thing worth noting is that none of them use FreeBSD which is claimed to power many high traffic portals including Yahoo. The reason provided is that many Linux distribution companies such as Red Hat and Novell provide standardization, and more importantly support not available on the same level in FreeBSD.

Monday 26 February 2007

7 Habits for effective text editing 2.0

Being a Vi enthusiast, I am always on the look out for articles related to Vi, or rather Vi's modern avatar Vim - the versatile text editor created by Bram Moolenaar. In the past, this blog has seen a number of posts related to Vim. In fact if you ask me, the proverb "Too much of a thing" doesn't hold true for Vim.

It can easily take you a life time to learn each and every aspect of Vim though in most cases you can get along quite well by mastering just a couple of Vi commands. The sheer number of features and the permutations and combinations are that many. Then you have branched projects which aim to make Vim much more easier for the average computer user. Cream for Vim being a case to the point.

Today I stumbled upon this video which explains the 7 Habits for effective text editing in Vim which I found informative. The video is one of the series of Google TechTalks. In this video, Bram Moolenaar himself talks on the most efficient ways of editing text in Vim. The regular readers of this blog will know that Bram Moolenaar now works for Google.

The preamble of Google TechTalks goes thus :
Google TeckTalks are designed to disseminate a wide spectrum of views on topics including Current Affairs, Science, Medicine, Engineering, Business, Humanities, Law, Entertainment, and the Arts.
The video is a bit large (over 500 MB in size) and stretches over 1 hour. So make sure you have the required bandwidth to view the video. It is every bit worth watching.

Sunday 25 February 2007

Dell and Linux - The GNU/Linux support page of Dell

Dell has been recently in the news for its decision to ship Dell desktops and laptops pre-loaded with GNU/Linux. While most Dell advertisements in newspapers shows the caption "Dell recommends Windows XP" or similar, this move has come as a surprising relief for all Free software enthusiasts. More specifically, it shows the change in the way the wind blows. Of course Dell does not provide the option to ship all its computers pre-loaded with Linux. This is available only for its N-Series range of desktops and laptops.

Dell has also put up a separate page dedicated to Linux where it explains the level of support it provides for machines pre-loaded with Linux. The heading of the web page proclaims - "You choose the Linux you want. Dell does the rest. Dell|Linux makes life easier." Dell has also put together a community portal at linux.dell.com where you can get more information regarding the usage of Linux on your Dell equipment.

Update (26-Feb-2007): Dell has also started a website called dellideastorm.com where it invites opinion from the general public about the suggestions and ideas they have and which they would like Dell to incorporate in their products. Guess what, offering "Pre-Installed Linux | Ubuntu | Fedora | OpenSUSE | Multi-Boot" has the most number of votes - a total of 82959 followed by "Dell machines Pre-installed with Open Office" a distant second with 53092 votes.

Saturday 24 February 2007

Shiksha India - taking strides in providing Open Source multimedia driven educational material

Shiksha is a word in the Sanskrit language which means "to instruct" or "educate". Shiksha India - a non-profit organization, is an initiative of Confederation of Indian Industry (CII) and was launched during the India Economic Summit on 2nd of December 2001. It is managed by the Shiksha India Trust. The main aim of this organization is to provide good quality multimedia driven educational material. It has the blessings of the Indian government and it has partnered with the Ministry of Information Technology of India to provide good quality educational content in the public domain.

Mark Rais writes about how this non-profit project is playing a pivotal role in imparting education to more than half a million under privileged students. What is more important is the manner in which Open Source plays a significant role in this project.

In India, most Government controlled schools in the cities run in a relatively smooth manner and on an average have a teacher student ratio of 1:40. But as you move to the outskirts, in villages and in many remote areas, the so called government schools are just dilapidated structures with not enough teachers. And if there are teachers, the people in that area are so poor that they feel sending children to school will be a waste when they would rather ask them to do odd jobs and contribute to the family income.

To overcome this inertia among the people and to encourage them to send their children to schools, many state governments have started the free mid-day meals scheme in all government run schools in their respective states which has shown results in greater attendance in classes.

By embracing Open Source and Free Software solutions in public institutions including government run schools, India can save a huge amount of money in licensing costs which can be diverted to meet more pressing humanitarian needs. At present, the official stance of the Indian government is to use the most efficient technology in IT be it proprietary or Open source. And which one to use will be decided on a case-by-case basis. So there are no clear guidelines for or against Open Source or Free technologies. In recent times though, there is a growing awareness in many official quarters on the advantages of embracing Open Source solutions in public institutions.

Friday 23 February 2007

Eric.S.Raymond forsakes Fedora Linux and embraces Ubuntu

Eric.S.Raymond is best known for authoring the famous essay "The cathedral and the bazaar" where he discusses the theories of software engineering in terms of two fundamentally different development styles - the cathedral model of most of the commercial world versus the "bazaar" model of the Linux world. This essay has become so popular that it has also been published in a book format (By O'Reilly). One of the most often used quotes from his essay is - "Given enough eyeballs, all bugs are shallow". He is also a board member of Freespire.

In the past, Mr Raymond has been in the limelight for the push to allow proprietary codecs into Linux. His surmise is that the Linux community need to start integrating more proprietary software in order to get market share. ESR points to proprietary multimedia codecs as an example, where Linux distributions should step away from Free software ideology in order to get more users. He states that this will succeed in bringing those users back to open source later on which will lead to gaining more influence with manufacturers and media distributors thus helping make Linux a properly supported platform. And this idea he put forward was met with ridicule from a major section of the community.

Now again he has succeeded in grabbing the headlines by stating his intention to switch to Ubuntu from Fedora which he has been using till now. And he supports his move by listing the following reasons - and I quote :
  • Chronic governance problems.
  • Persistent failure to maintain key repositories in a sane, consistent state from which upgrades might actually be possible.
  • A murky, poorly-documented, over-complex submission process.
  • Allowing RPM development to drift and stagnate -- then adding another layer of complexity, bugs, and wretched performance with yum.
  • Effectively abandoning the struggle for desktop market share.
  • Failure to address the problem of proprietary multimedia formats with any attitude other than blank denial.
While I agree with him on his statement on the performance of Yum - I have myself found it quite slow - a reason attributed to it storing all the details in an XML file and then reading from it, I do not agree that Red Hat/ Fedora is in the wrong to flatly deny to incorporate proprietary multimedia formats in their distribution.

Alan Cox has given a reply to ESR's letter in the Fedora mailing list.

Ironically, another news that is being just aired is that Microsoft has been asked to pay 1.52 Billion dollars in a patent case against Alcatel-Lucent concerning the use of MP3 technology in WMP [Source: BBC].

So the risk factors concerning incorporating proprietary / patented formats in GNU/Linux is clear for all to see. Can Red Hat / Ubuntu or any other distribution survive if they are asked to pay such a huge sum for alleged patent infringement ? I doubt it.

On another note, considering that he is a board member at Freespire, and given his stand, shouldn't he be embracing Freespire instead of Ubuntu ?

Wednesday 21 February 2007

Humor: Why Geeks and Nerds Are Worth It...

I can't for the life of me understand what it is with this image associated with a geek. I mean, when somebody mentions a so and so is a geek, immediately, it conjures up in your mind a person who is married to his computer, wearing horn rimmed glasses with thick lens and squinting at a monitor for the major part he is awake. Oh yeah, a geek can never and I mean NEVER be a woman let alone find it easy to date a woman. It is really hilarious to see entire cartoon strip series being created which revolves around this stereotype of a geek.

Craiglist has a interesting write up where a female lists 15 reasons why it is a good decision to date a geek and even marry him. While it doesn't do anything to diminish the negative image of a geek, it is quite entertaining and humorous as well.

Monday 19 February 2007

10 seldom or never used GNU/Linux commands

Guess how many commands are there in GNU/Linux ? My estimate is somewhere between 1000 and 2000. And how did I arrive at this conclusion ? In my bare bones Linux installation alone, there are 1151 commands. I got this figure by running the following command :
$ ls /usr/bin /bin /sbin /usr/sbin |wc -l
1151
And each of these commands or a majority of them can be combined together to perform complex tasks, in which case, these combinations can be considered to be whole commands in their own right. Naturally, it is a humongous task to master all the 1000s of commands available in GNU/Linux. More importantly, it is easier to ignore many commands which make very good replacements of some of the commonly used commands at least for certain functions.

Brock Noland has compiled a collection of 10 commands on his site *cough* "bash cures cancer", which are seldom used by a majority of GNU/Linux users but which in his opinion are a boon for all Linux users if only they knew about them. The commands are pgrep, pstree, bc, split, nl, mkfifo, ldd, col, xmlwf and lsof . He claims that his favorite of the 10 commands is surely mkfifo. But to know why, you should read his article. He has also provided a number of examples of usage of the commands which makes it an informative read.

Sunday 18 February 2007

Tip to properly render and read Indian language websites in GNU/Linux

Yahoo India has been on a drive to localize its web content. The result being a series of portals in a multitude of Indian languages which includes Tamil, Kannada, Malayalam, Hindi, Gujarati and so on. And it has made it easier for the visitors to view the website in the Indian language of their choice by using the web address format as follows - which is :
http://in.yourlanguage.yahoo.com/
Suppose your mother tongue is Tamil, you can view the Yahoo India web page content in Tamil by typing the address 'http://in.tamil.yahoo.com/'. Cool isn't it ?

yahoo website before indic fonts were installedFig: This is how the website rendered before Indic fonts were installed

But while viewing the website rendered in the Indian languages, I was not able to read the content as the relevant Indian fonts were missing on my machine. After some search, I found that there is a package containing a variety of Indian language fonts available for Linux. They are popularly known as Indic fonts.

Yahoo website after indic fonts are installedFig: Website after indic fonts were installed

If you are using a Debian based Linux distribution, you can easily install the fonts via the command :
# apt-get install ttf-indic-fonts
which will install all the Indian language fonts on your machine. And once they are installed, it will be possible to view and read the Yahoo India websites in your regional language.

Yahoo webpage rendered in MalayalamFig: Yahoo webpage rendered in Malayalam


Fig: The same web page rendered in Hindi

You can even copy and paste pieces of text from the website to a text editor provided the text editor has been compiled with Unicode support.

News: Richard Stallman convinces Cuba to embrace GNU/Linux

When you hear the name Cuba, it concocts in your mind a picture of bankruptcy, food shortages, drug shortages, rampant unemployment et al, at least some of them a direct side effect of the US trade sanctions [source BBC]. But one thing the Cubans can be proud of is their excellent health care system which rivals even that in the US. Believe it or not, Cubans boasts of a better life expectancy than the North Americans and Cuba has better infant and adult mortality rates than the US.

Being a communist state, it was only natural for Cuba to embrace GNU/Linux as the official OS of choice for all governmental departments. But what surprises me is why it took so long. AP news reports that in a recent visit to Cuba, Richard M Stallman was able to convince the Cuban government the advantages of using a Free OS in all government offices - definitely a big feather in the cap for RMS. He was visiting Cuba to speak at an International Conference on Communication and Technologies in Havana.

It might seem that RMS is only successful with governments which are predominantly socialist in their beliefs. But the fact is, many reasons he lists in favor of supporting Free software are valid and make perfect sense for all the governments the world over irrespective of their ideologies - including (I may add) the US government. The prominent reason being :

The inherent security threat in using proprietary software for mission critical situations or in matters of state security, for the simple reason that without being able to examine the code, users can't know what it's doing or what "back door" holes developers might have left open for future entry.

I feel happy that one more country has decided to embrace GNU/Linux in a big way. Kudos to the Cubans for their foresight.

Saturday 17 February 2007

How to explain Digital Rights Management (DRM) to your dad

DRM stands for Digital Rights Management - a technical procedure which aims to make sure that the copyright holders retain control over their work by preventing unauthorized duplication of their work to ensure continued revenue streams. The Free Software Foundation (FSF) calls it Digital Restrictions Management. In recent times, DRM has caused extreme polarization even within the camps of Open Source and Free Software. With Linus Torvalds stating his displeasure over the move to formulate anti-DRM specific clauses in the upcoming GPLv3 spear headed by the FSF.

The big question is, when a lay person (such as your dad) approaches you and asks to explain what the cacophony related to DRM is all about, how do you explain in a way that he understands the basic idea of DRM without leaving him overwhelmed? If you are not sure how to address this question put forward to you, then you should read the example answers compiled by John highlighting the DRM-related problems, to help people understand what the big deal is with DRM.

Friday 16 February 2007

Humor: Is your son a computer hacker ? Check for these symptoms ...

Today I stumbled upon this very interesting article where a concerned parent lists the signs to watch out for in your kids to guard against them turning into *gasp* hackers...

Here are a couple of gems from the article...
If your son has requested a new "processor" from a company called "AMD", this is genuine cause for alarm. AMD is a third-world based company who make inferior, "knock-off" copies of American processor chips. They use child labor extensively in their third world sweatshops, and they deliberately disable the security features that American processor makers, such as Intel, use to prevent hacking.
and still further ...
There are, unfortunately, many hacking manuals available in bookshops today. A few titles to be on the lookout for are: ... "Programming with Perl" by Timothy O'Reilly; "Geeks" by Jon Katz; "The Hacker Crackdown" by Bruce Sterling; ... and "The Cathedral and the Bazaar" by Eric S. Raymond. If you find any of these hacking manuals in your child's possession, confiscate them immediately.
Even the good old Linux has not been spared.

The way the article has been written, makes it is clear that it is meant to humor the person reading it. Then again, some of those who do not know the A,B,Cs... of computers might really fall for what has been written there. Read the full article to get a good laugh.

Wednesday 14 February 2007

Free online magazines dedicated to GNU/Linux and Open Source

These are a collection of my links pointing to free online magazines dedicated to Linux and Open Source. If you look around, a lot of effort is being expended, many of those on a voluntary basis to keep alive the spirit of Linux, Open source and Freedom. The links below highlight a slice of those efforts.
  • Linux Journal - One of the foremost Linux magazines around, this magazine carry articles which are suited to a more technically oriented crowd. This magazine is made available in both print and online format. Many of the articles on its website are freely accessible but to read the most recent articles, you need to enroll in a paid subscription.

  • PClinuxOS Magazine - This is a magazine launched by PCLinuxOS enthusiasts, which is freely made available in both PDF and HTML format. PCLinuxOS is a very interesting Linux distribution which caters to those who crave for a much more complete Linux experience on the desktop. Even though the magazine has the PCLinuxOS name, it carries articles relevant to all Linux distributions.

  • Free Software Magazine - This is yet another freely available online magazine which contains articles related to GNU/Linux, open source and Free software.

  • Gnome Journal - is an online magazine devoted to everything surrounding the GNOME Desktop. The rate of new articles are a bit far and in between but then that is expected from a magazine dedicated to a narrow subject.

  • Linux Productivity Magazine - This was a magazine which used to provide a number of interesting articles on Linux. It has been discontinued since. You can find all the archives of previous issues here.

  • Linux-Mag - This is a magazine in print but their website has a number of news items related to Linux.

  • Linux Gazette - A purely voluntary effort, this is an online magazine which provides a number of interesting articles related to Linux and Free software on a regular basis.

  • Linux Focus - This is another freely available online magazine maintained exclusively through volunteer effort. The USP of this magazine is that you can read the articles featured here in multiple languages. At present, apart from English, it provides the magazine in 10 other languages including the Chinese language.

  • Insecure Magazine - This is a freely available digital security magazine discussing some of the hottest information security topics not necessarily all based on Linux. The magazine is available only in a PDF format.

  • Linuxformat.co.uk - This is a UK based print magazine but their website also contain relevant news and tips related to GNU/Linux.

  • RedHat Magazine - One might wonder why a major Linux distribution vendor like RedHat will bother to bringing out a magazine. But the fact is RedHat does publish an online magazine where you get a monthly dose of tips, howtos and news related to Linux, err... Red Hat Linux that is.

  • Tux Magazine - I especially like this online monthly magazine. It is geared towards the new Linux crowd rather than the experienced Linux users and it sends a copy of the magazine in PDF format to ones mailbox. Or rather, it used to send the PDF magazine. As of now its future is in limbo as the magazine owners have found it difficult to sustain their efforts in bringing out the magazine. Hopefully they will find some way to keep this very good magazine alive.

  • Full Circle Magazine - This is an independent magazine for the Ubuntu community available in PDF format for free download every month.

  • OpenBSD Journal - This is not a magazine per se, its more like a Slashdot style blog. But this is the closest you can get to a magazine dedicated to OpenBSD - arguably the most secure operating system on this planet.

  • O3 Magazine - This is a FREE electronic publication distributed in PDF format. The focus of o3 is on the use of Free and Open Source (FOSS) software in Enterprise Data Networking environments.
Note to readers: When ever I come across interesting websites related to Linux, I usually bookmark them for future reference. Over a period of time, I have built up an eclectic collection of links related to GNU/Linux or Unix which provide good information. Earlier, I had featured a slice of those links on the right hand column of this blog. I couldn't feature all the links there due to lack of space. Now, with a revamp of this site design, I decided to move them to their own individual pages. This post is the continuation of a series of such posts.

This article will be updated as and when I come across free online magazines related to GNU/Linux, open source and free software.

Tuesday 13 February 2007

Buy two O'Reilly books and get another book free

O'Reilly is celebrating February 2007 as the Web Design and Development month. And they have put together a special resource page dedicated to web development essentials including books, PDF Short Cuts, articles, and author events.

The highlight of the event is the above average discounts they are providing for all these web development titles which includes a massive 35% off for each title you buy (use the code 'DSUG' on their site) and if you buy two titles, you get a third one free (use the discount code 'opc10'). It is one option or the other. You cannot obviously get 35% off and a free book simultaneously as the discount codes are different. But seeing the line up of books, I can only say that this is a good opportunity to pick up a couple of web development books. I especially find the "Cascading Style Sheets: The Definitive Guide" book rather tempting. Explore more web titles on the special resource page. There's also free ground shipping in the US on orders over $29.95.

Free device driver development for Linux - courtesy of Linux kernel community

Here is an interesting news fresh out of the oven ... The Linux kernel community is offering all companies free Linux driver development. The modus operandi is perceived to be as follows :

Suppose company A has a device which it needs to work in Linux...

The company sends the specification of the device to the kernel development team. If they do not have the specifications, they may also send the contact mail of their engineer who knows about the device and is willing to answer an occasional question about the device.

Once the device driver has been developed, it is incorporated into the main Linux kernel source tree so that all Linux users who own the device will benefit from it. This driver will work with all of the different CPU types supported by Linux.

This is what the article has to say about non disclosure agreements (NDAs) and I quote :
If your company is worried about NDA issues surrounding your device's specifications, we have arranged a program with OSDL/TLF's Tech Board to provide the legal framework where a company can interact with a member of the kernel community in order to properly assure that all needed NDA requirements are fulfilled.
Apart from the original article, you can also read an FAQ about the declaration here.

Monday 12 February 2007

A collection of specialized Linux links

Here I have listed some of the popular websites related to Linux which concentrate on providing support for a specialized set of functions in GNU/Linux such as sound/audio, printing and so on. And these are the first sites to visit when you are faced with problems related to these functions.
  • Open Printing - Formerly known as linuxprinting.org, this site is a one stop resource for all your printer related problems in GNU/Linux. Does your newly bought printer refuse to cooperate with Linux , are you looking to buy a printer but want to make sure that the one you buy should fully support Linux, then this site is for you. It contains a database of all the printer models categorized into different groups depending upon the degree of support they provide for GNU/Linux as well as the relevant drivers for the printers if you need them.

  • ALSA Project (Sound drivers) - Alsa is synonymous with sound. There was a time when you had to slog it out to get sound to work correctly in GNU/Linux. In those early years, Linux made use of the OSS sound drivers which showed many shortcomings. ALSA project was born specifically to provide more modular sound drivers and also to address the shortcomings of OSS. Any time you are faced with some sound problems such as say GNU/Linux doesn't support your sound card (a rarity these days), then this is the site to visit to find a solution to these issues.

  • Linux-USB.org - This website serves as a central point of information for USB support under Linux. There are a growing number of devices from digital cameras, to mobile phones, music players, network devices and so on which have USB support. This website documents which all devices have USB drivers in Linux as well as the degree of support provided. Also check out this site which complements the linux-usb.org site in listing the different USB devices which are supported in Linux

  • TLDP.org - short for "The Linux Documentation Project" consists of a loosely knit team of volunteers who provide documentation for many aspects of Linux. On this site, you will find several forms of documentation such as Guides, HOWTOs, man pages, and FAQs related to all facets of GNU/Linux.

  • NetKit.org - This is a site which caters to that section of Linux enthusiasts who are more inclined to learn and pick up skills in networking in Linux. NetKit allows one to set up ones own virtual networking lab which can be used to study complex networks all on ones personal computer. To make it possible, Netkit heavily relies on User Mode Linux. NetKit offer the users an easy-to-use-and-install package, which at the same time implements effective network emulation.

  • Qmailrocks.org - This site is a comprehensive qmail installation resource. Qmail by the way is a mail transport agent similar to the ubiquitous sendmail. But unlike sendmail, qmail is famed for its ease of configuration. Qmailrocks.org was put together to provide a free and open resource for anyone needing help with the installation and configuration of qmail.

  • Netfilter.org - Anybody who is used to running a firewall on GNU/Linux would be aware of iptables which form the work horse of the concept called a firewall in Linux. And iptables is developed and maintained by the netfilter development team. Here you will find lots of howtos, documentation, tutorials and tips on making full use of the numerous features of iptables firewall.

  • Ndiswrapper List - This page contain a list of cards known to work with ndiswrapper.

  • Hardware compatibility list (HCL) - This is a Linux hardware compatibility list maintained at Linuxquestions.org.

  • Linux Laptop.net - This site has a detailed list of all the makes of laptops categorized according to the manufacturer and containing different user's experiences in running Linux on them. A must visit site if you are interested in buying a laptop.

  • HCL list @ Ubuntu - This is the official Ubuntu HCL for Linux.

  • Intel Linux Wireless.org - This is an official Intel site where you can learn about and download the latest development versions of the Linux-based wireless drivers for Intel adapters.
Note to readers: When ever I come across interesting websites related to Linux, I usually bookmark them for future reference. Over a period of time, I have built up an eclectic collection of links related to GNU/Linux or Unix which provide good information. Earlier, I had featured a slice of those links on the right hand column of this blog. I couldn't feature all the links there due to lack of space. Now, with a revamp of this site design, I decided to move them to their own individual pages. This post is the continuation of a series of such posts.

This article will be updated as and when I come across specialized websites related to GNU/Linux.

Sunday 11 February 2007

links2 - a cross platform console based web browser which also renders images

Recently, while I was browsing a website in Firefox, I found that it took forever to load the concerned web page. Blame it on my internet connection or on the condition of the web server hosting the web page, I was literally fed up with the wait and closed the window with disgust. It was during this time that I wondered whether it will make my browsing experience a bit more pleasant if I switched to a console web browser such as lynx.

I am aware of a number of web browsers which have a very low memory foot print and also which discard plenty of fluff - which you find increasingly in websites being built now a days - while displaying web pages. Some of these web browsers being Dillo, Lynx and Links. Dillo is a web browser which require an X server to run. But the other two are console web browsers which display only text.

Links2 is a web browser which is based on 'links' and can be run in two modes. It will display web pages only in text when run in console mode and renders images in a variety of graphics formats such as PNG, Jpeg, Gif, Tiff and Xbm when run in graphics mode from within a X window system.

You have to see it in action to actually fathom how it renders the web pages. I have included a couple of screenshots of web pages as viewed in links2 below.

Fig: All about Linux blog rendered in links2.

Fig: Google News page rendered in links2

Fig: Links2 homepage viewed from links2

As you can see from the screenshots, websites which are built using tables are rendered properly where as those which use CSS lose their layout but are still equally readable. This is because links2 does not yet support CSS.

You can install links2 in Debian based Linux distributions by executing the following command :
# apt-get install links2
One of the good things I like about links2 apart from it rendering web pages in the blink of the eye are the number of keyboard shortcuts it supports. Considering that this web browser is also designed to be run in console mode, each and every function can be accessed entirely using the keyboard. Some of the shortcuts I found really convenient are as follows :
  • '\' - toggle between viewing the web page and its source code.
  • '/' - used to search for a word or term in the website that is displayed.
  • [Esc] key - Shows a menu at the top of the browser from which you can also make choices.
  • '=' - Provides further information about the web page such as its size, the web server serving the web page and its url.
  • '|' - Pipe displays the header information.
  • '<- ' - left arrow will take you to the previous view. '->' - right arrow will take you forward to the latest view.
  • [Page up] and [Page down] - these keys can be used to navigate through the web page one page at a time. But you can also use [Space bar] and 'b' key combination for the same.
  • 'g' - will pop-up a dialog box where you can enter the url of the website you want to view. To open this dialog box with the url of the current page already entered, press 'G'.
  • Move the mouse pointer over an image and press 'i' to see only the image.
Features of links2 are varied and many. Some of them being support for javascript, background downloading of files, built in image display for Gif, Jpeg, Xbm, Tiff and Png file formats and built-in fonts in the executable without reliance on any fonts installed in the system just to name a few. You can read the entire list of features at the links2 features page.

Starting links2 in graphics mode
To start links2 in graphics mode which is the mode which displays the images, use the '-g' option with the links2 command :
$links2 -g
The above command will probe all the installed graphics drivers and run on the first found. The drivers that are supported in links2 are x, svgalib, fb, directfb, pmshell and atheos. But if you want to start links2 with a specific driver say driver 'x', pass the value to the '-driver' option as follows :
$ links2 -driver x
links2 also has a lot of other options such as say, you want to save the contents of a webpage to your hard disk. This is easily achieved by using the -dump option as follows :
$ links2 -dump http://news.google.com > news.txt
... which will save the contents of the news.google.com page into the 'news.txt' text file. Which means, using this method you can literally strip all the html elements and save only the text into file. There are a whole lot of command line switches available for links2 from those for changing the foreground and background of the webpage that is viewed to conducting a name lookup of a web address. Check the man page of links2 for more options.

Configuring Links2
As with all things related to Linux and Unix, links2 web browser also stores all its configuration parameters in a text file. If you look into your home directory, you will find a hidden directory called .links2/ which contain all the files pertaining to the user's configuration. It is in the '.links2' directory that links2 web browser stores details such as your bookmarks, the browsing history and the per user configuration details.

The configuration details are stored in the links.cfg text file which is also created in the same location. This file is automatically created by links2 when you make changes to the configuration of the web browser and need not be edited manually by the user. But it is interesting to see the data that is entered in this file. My links.cfg file shows the following details :
# FILE: ~/.links2/links.cfg
# This file is automatically generated by Links -- please do not edit.
async_dns 1
download_utime 0
max_connections 10
max_connections_to_host 8
retries 3
receive_timeout 120
unrestartable_receive_timeout 600
format_cache_size 5
memory_cache_size 1M
image_cache_size 1M
http_proxy ""
ftp_proxy ""
download_dir ""
language "English"
http_bugs.http10 0
http_bugs.allow_blacklist 1
http_bugs.bug_302_redirect 1
http_bugs.bug_post_no_keepalive 0
http_bugs.no_accept_charset 0
http_bugs.retry_internal_errors 0
http_bugs.aggressive_cache 1
http_referer 0
fake_useragent ""
fake_referer ""
ftp.anonymous_password "somebody@host.domain"
ftp.use_passive 0
ftp.fast 0
ftp.set_iptos 1
menu_font_size 16
background_color 14540253
foreground_color 0
scroll_bar_area_color 11184810
scroll_bar_bar_color 0
scroll_bar_frame_color 0
display_red_gamma 2.2000
display_green_gamma 2.2000
display_blue_gamma 2.2000
user_gamma 1.0000
bfu_aspect 1.0000
aspect_on 1
dither_letters 1
dither_images 1
display_optimize 0
gamma_correction 2
enable_javascript 1
verbose_javascript_errors 0
verbose_javascript_warnings 0
enable_all_conversions 1
enable_global_resolution 1
javascript_manual_confirmation 1
js_recursion_depth 100
js_memory_limit 5k
bookmarks_codepage us-ascii
bookmarks_file "/home/octoedge/.links2/bookmarks.html"
extension "aif,aiff,aifc" "audio/x-aiff"
extension "au,snd" "audio/basic"
extension "avi" "video/x-msvideo"
extension "deb" "application/x-debian-package"
extension "dl" "video/dl"
extension "dxf" "application/dxf"
extension "dvi" "application/x-dvi"
extension "fli" "video/fli"
extension "g" "application/brlcad"
extension "gbr" "application/gerber"
extension "gif" "image/gif"
extension "gl" "video/gl"
extension "grb" "application/gerber"
extension "jpg,jpeg,jpe" "image/jpeg"
extension "mid,midi" "audio/midi"
extension "mpeg,mpg,mpe" "video/mpeg"
extension "pbm" "image/x-portable-bitmap"
extension "pcb" "application/pcb"
extension "pdf" "application/pdf"
extension "pgm" "image/x-portable-graymap"
extension "pgp" "application/pgp-signature"
extension "png" "image/png"
extension "pnm" "image/x-portable-anymap"
extension "ppm" "image/x-portable-pixmap"
extension "ppt" "application/powerpoint"
extension "ps,eps,ai" "application/postscript"
extension "qt,mov" "video/quicktime"
extension "ra,rm,ram" "audio/x-pn-realaudio"
extension "rtf" "application/rtf"
extension "sch" "application/gschem"
extension "svg" "image/svg"
extension "swf" "application/x-shockwave-flash"
extension "sxw" "application/x-openoffice"
extension "tga" "image/targa"
extension "tiff,tif" "image/tiff"
extension "wav" "audio/x-wav"
extension "xbm" "image/x-xbitmap"
extension "xls" "application/excel"
extension "xpm" "image/x-xpixmap"
video_driver "x" "1024x675" "" ISO-8859-1
I found this web browser really sleek and easy to use. Considering that it renders graphic images without any problem when run in X windows, this could easily be a good replacement for the mainstream web browsers where one is concerned only in reading the content of a website without the usual distractions such as flash based websites and fancy CSS. Oh yeah, you can also say good bye to most ads you see cluttering websites these days when you use links2.

Friday 9 February 2007

Introducing the new design of the 'All about Linux' blog

I am sure the regular readers of this blog have noticed the change. This Linux blog has had a make over. Even though it would seem sudden to the regular readers of this blog , I had long perceived this change to be inevitable. Not that I found anything wrong with the old design but when Google upgraded the blogger blog engine to include a flood of features, it also made drastic changes to the template.

As with all things related to Google, quality plays a very important role. And at least with blogs hosted on blogger.com, backward compatibility also rates quite high. What does backward compatibility mean as far as this blog is concerned, you ask ? Well, there are over 360 articles on this 2 year old blog, many of them quite popular. When I decided to eventually make the switch from the old blogger engine to the new blogger engine, the entire switch completed in less than 2 minutes. And to underline the google trademark, all the page addresses, as well as the old template was preserved intact across the switch. So as far as the visitors of this blog need concern, so long as you did not visit during the actual time of the switch, you won't have noticed the change-over at all.

So the question in your minds must be why did I tinker with the design of the site, right ? With the old template, I wouldn't have been able to make use of a number of new features that Google has incorporated in the new blogger.com the most visible of them being 'categories' - the exact terminology used by Google is 'labels'. The blogger developers have also made it much easier to edit the style and color of the blogs by incorporating - believe it or not - drag and drop placement. So even a non-techie guy will now be able to put together his own personalized blog with out tinkering with any HTML code. I will explain the new features of blogger.com in a succeeding post.

As you can see, now instead of a two column layout, this blog features a three column layout. The blog is much more wider and is quite viewable in 800x600 and above resolutions. There is lots more white space which will allow the readers better clarity of thought while reading the articles. And the individual pages of this blog loads faster than it were before the switch. I hope all of you find the new design of this blog quite refreshing. However, this is not the final version of the design, I will be tweaking it bit-by-bit in the coming days or weeks and hopefully will be able to work out something even better. Though I concede, I do not have the stamina to do it in one go ;-).

Wednesday 7 February 2007

Book Review: Beginning SuSE Linux - 2nd Edition

SuSE Linux, one of the oldest Linux distribution was originally developed by a German company. Not many people will know that SuSE is an acronym in the German language for "Software und System-Entwicklung" which translates as software and system development. Over time, SuSE has gained a reputation as a robust, secure and easy to use Linux distribution both on the server and desktop front.

The book "Beginning SuSE Linux" is authored by Kier Thomas and published by APress. As the name of the book indicates, it is geared towards beginners in GNU/Linux who have set their eyes on trying out the SuSE Linux distribution. The book is divided into 7 different parts with the first part of the book discussing the pros and cons of using Linux as a part of ones daily routine. In this part, the author gives a well balanced view of what Linux is all about and the history behind its formation.

The second part of this book contain chapters which hand hold a person in installing SuSE Linux on ones machine. The author starts by explaining the concept of partitions, backing up your data and the benefits of dual booting between diverse OSes. The 5th chapter titled "Installing SUSE Linux" gives a thorough introduction to installing this Linux distribution on ones machine. And the steps are accompanied by screen-shots which makes it rather intuitive to follow. SuSE provides a number of installation modes and one gets to know the best way of installing it. One thing worth noting is that SuSE allows the user to shrink his Windows partition from within its Installer and this book explains it in a clear way in the section on partitioning the disk. In fact the manner in which the author has explained the steps leaves no room for doubts while installing SuSE. The succeeding chapter lists the possible problems one might face and the solutions for these problems. Most Linux users would be aware of one or more of these problems but to a new Linux user, these could be a real time saver and will save their sanity when they face these problems.

Part 3 of this book is titled "The No-Nonsense getting started guide" and has a collection of 6 chapters. These chapters give a good introduction to the SuSE Desktop - more specifically to the Gnome desktop which is the default one in SuSE. In the 8th chapter titled "Getting everything up and running", the author explains how to setup and configure the diverse hardware which form a part and parcel of a computer. For instance, this chapter deals with configuring the sound card, setting up and managing the printer including a printer on the network which is connected to a Windows machine, importing photos from a digital camera and more. But what is worth noting is that SuSE has its own unique methods and GUI tools to accomplish these tasks and the author explains these via the SuSE specific tools where ever applicable.

There is a separate chapter on securing the machine running SuSE Linux where the author impresses upon the readers the necessity of securing ones machine. He further goes on to explain the different ways of securing SuSE which includes steps to update the software. This chapter also dwells deeply on using Aparmor - SUSE's industrial grade security system.

It is really thoughtful of the author to include a chapter detailing the various commonly used Windows software and their possible Free replacements.

The 4th part of the book titled "Shell and beyond" comprises of 5 chapters deals with educating the new Linux user on the usage of command line to accomplish ones tasks. The author starts by providing a gentle introduction to the shell, the different terminals available in Linux and then gradually moves on to explain the usage of different commands which provide the true power to Linux. In the chapter titled "Understanding Linux files and users", he gives a detailed explanation of the concept of files, their permissions and how they relate in the Linux as well as explain the concept of mounting. Even though I was conversant with most of what the author was explaining, reading the book, I couldn't help feel that this book is an excellent resource for a Linux neophyte who is looking forward to taking his first baby steps in learning to be productive in Linux, more specifically SuSE Linux.

The next three chapters deal with getting SuSE Linux to play all the proprietary music and video file formats. One of the inherent disadvantages of Linux owed mostly due to the ideological stance of GPL is that it cannot play music and video encoded in a proprietary file format out of the box. But with a little effort, it is possible to provide support for these proprietary file formats in Linux. In these chapters, the author gives a good run down on the various music and video codecs and ways of getting support for them in SuSE Linux. He introduces different software which allow one to not only just play music but also to categorize, burn music onto removable media and even rip music from audio CDs and save them on to ones hard disk. Surprisingly, I found this book much more than a mere how-to-do-it sort of book as the author provides details of related facts from a lay man's perspective where ever applicable. For instance, in the chapter titled "Movies and Multimedia", while explaining how to enable media players to play the files encoded in these formats, he impresses upon the readers the ethical issues surrounding the DRM and patents.

There is a whole chapter dedicated to image manipulation where many features of the GIMP software has been explained. The author has done a splendid job of explaining this image manipulation editor within the constrains of this chapter.

The next 8 chapters deal with using SuSE in an office setup. SuSE Linux comes bundled with a plethora of applications which form a part and parcel of any office setup. This includes word processors, spreadsheets, a database, presentation software and email client just to name a few of them. This book has dedicated a chapter each in explaining how to put these software to productive use in an office setup. Catering to those die hard MS Word enthusiasts, there is also a chapter on making MS Office to work natively in SuSE Linux if at all you have a licensed copy of it lying around.

The seventh and final part of the book titled "Keeping your System Running" provides details on the vagaries of system administration such as installing, removing and updating software binaries, compiling software from source and installing it, managing users and groups optimizing your system, backing up data and scheduling tasks.

The final chapter which is the 34th chapter of this book deals with explaining various ways of connecting to the SuSE Linux machine remotely where the author explains about SSH and related tools.

This book contain three appendices with a glossary of Linux terms being one of them where the newbies among us gets to understand the meaning of Linux related geek terms. There is also an appendix containing a Bash command index which - embracing authors own words - provides a whistle stop tour of commands that can be used at the Bash Shell.

Book Specifications
Name : Beginning SuSE Linux - From Novice to Professional (2nd Edition)
ISBN No : 1-59059-674-9
Author : Kier Thomas
Publisher : APress
No of Pages : 728
Price : Check the latest price at Amazon.com
Rating : A comprehensive book, ideal for newbies who wish to learn to be well versed in installing and using SuSE Linux.

I have always maintained that writing a good book is an art. It is not just enough if the person is well versed in his area of expertise. Rather, he should also be a good communicator and should be able to sustain the reader's interest in the subject through out the book. Kier Thomas shines through in his narration of the concepts quite well. He explains in a simple, lucid and entertaining way different ways of configuring things in SuSE Linux from a users perspective. This is definitely a good book for those of us who look forward to installing and becoming productive in using SuSE Linux.

Saturday 3 February 2007

A step by step tutorial on creating a 3D effect of a photograph using Gimp

Gimp is a versatile image editor. I have been using Gimp exclusively for editing images and photos targeted for the web. Over and above its usefulness, it is also a Free software. But when it comes to finding tutorials in creating special effects of photographs, you find a whole lot of them for Adobe's Photoshop but not that many for Gimp. This could be because there is a whole industry that has been spawned by Photoshop and which depends on it for its survival.

For instance, there are a plethora of books on Photoshop, professional videos, exclusive Photoshop training institutes and even Photoshop magazines. Compared to that, Gimp lacks any of these baring a couple of books which can be counted with your fingers. But one thing which Gimp has as much as Photoshop is a very strong community backing it, a community which understands the true strengths of this Free graphics suite and use it exclusively for creating and editing images targeted for the web.

In recent times, with GNU/Linux and Free software getting increasing exposure among the masses, some of it has also rubbed off Gimp and now you find more tutorials on accomplishing special tasks using Gimp than you found earlier.

Andrew of 'Instructables' fame has written an excellent tutorial which shows how to create a 3D effect from a photo of a car which is really informative. But what is even better is that for a change, he explains how to do it using the Free software Gimp.