0% found this document useful (0 votes)
2K views116 pages

Linux For You-Aug-2009

this magazine is shared for educational purpose only and all the copy rights is reserved to EFY/LFY
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2K views116 pages

Linux For You-Aug-2009

this magazine is shared for educational purpose only and all the copy rights is reserved to EFY/LFY
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 116

A Quick Q ‘n’ A with Greg Kroah-Hartman Rs 100

ISSN 0974-1054

V D
e D 5.3
reCentOS
F

THE COMPLETE MAGAZINE ON OPEN SOURCE


VOLUME: 07   ISSUE: 6   August 2009  116 PAGES   ISSUE# 79

VBA Macro Dabble with Netkit to


Interoperability in OOo Sanbox a
Network
Roll Out
Multi-boot
Distro Discs

Create Your Own


Streaming
Radio
Android’s
Magic
Usher in a Unleashed

New Era of Web with


HTML 5
Published by EFY—ISO 9001:2000 Certified
India INR 100
US $ 12
Singapore S$ 9.5
Malaysia MYR 19
Trained participants from over 38 Countries in 6 Continents
Linux OS Administration & Security Courses for Migration
LLC102: Essentials of Linux OS RHCA Course Schedule
LLC103: Linux System & Network Administration RHS333:8 Aug; RH423:15 Aug
LLC203: Linux Advanced Administration
RH401:08 Sept; RH436:06 Oct 2009
LLC303: Linux System & Network Monitoring Tools
LLC403: Qmail Server Administration
LLC404: Postfix Server Administration
LLC405: Linux Firewall Solutions Course on 8 August ‘09
Joomla CMS
LLC406: OpenLDAP Server Administration
LLC408: Samba Server Administration
LLC409: DNS Administration
LLC410: Nagios - System & Network Monitoring Software
LLC412: Apache & Secure Web Server Administration
RH301 from 10, 17 August ‘09
Courses for Developers
LLC104: Linux Internals & Programming Essentials RHCE Exam in Bangalore 28 August ‘09
LLC105: Programming with Qt
LLC106: Device Driver Programming on Linux
LLC504: Linux on Embedded Systems
LLC107: Network Programming on Linux
LLC108: Bash Shell Scripting Essentials 4 Day Fast Track Course
LLC109: CVS on Linux starting on 8 August 2009
LLC204: MySQL on Linux
LLC205: Programming with PHP
LLC206: Programming with Perl LLC410: Nagios System & Network
LLC207: Programming with Python
LLC208: PostgreSQL on Linux
Monitoring Software - Training from 8 Aug ‘09
LLC209: Joomla CMS
LLC501: Programming with OpenGL Linux Support & Solutions
LLC504: Linux on Embedded Systems Installation, Setup and Support Solutions
RHCE Certification Training for RedHat, Ubuntu, SUSE, CentOS Servers
RH033: Red hat Linux Essentials
RH133: Red Hat Linux System Administration For more info log on to:
RH253: Red Hat Linux Networking & Security Administration www.linuxlearningcentre.com
RH300/301: Red Hat Rapid Track Certification Course
Call: 9845057731 / 9343780054
RHCSS / RHCA Certification Training Email: [email protected]
RHS333: Red Hat Enterprise Security: Network Services
RH423: Red Hat Enterprise Directory Services & Authentication RED HAT Training Partner
RHCE & RHCSS Exam Centre
RH401: Red Hat Enterprise Deployment & Systems Management
RH436: Red Hat Enterprise Clustering & Storage Management
RH442: Red Hat Enterprise System Monitoring & Performance Tuning
RHS429: Red Hat Enterprise SELinux Policy Administration

Registered Office & Corporate Training Centre LLC Satellite Centre - Bangalore
# 635, 6th Main Road, (Adj.. Bank of India) Hanumanthnagar, Bangalore 560019 # 1291, 24th Cross, 30th Main,
Tel: +91.80.22428538 / 26600839 / 26610999 TelFax: +91.80.26600839 BSK II Stage, Bangalore 560070
Cell: 9845057731 / 9343780054 Email: [email protected] Tel: +91.80.26712928
www.linuxlearningcentre.com
Contents AUGUST 2009  •  Vol. 07  No. 6  •  ISSN 0974-1054

FOR YOU & ME


16 Google’s OS: Just A Chrome
Polish or Is There Some Metal
Inside Too?
18 HTC Magic Reviewed: India Gets
a Taste of Android Magic
22 Revive the Multimedia XPerience
with XBMC
26 Video Editing on GNU/Linux: Did
I Hear You Say It’s Non-existent?
28 FOSJAM ’09 Ignites the Fire of
Freedom in Jaipur
30 GIMP for Beginners, Part 2:
Understanding Layers
36 A Quick Q ‘n’ A Session with
Greg K-H, current Linux kernel
maintainer for -stable branch
Usher in a
New Era of Web with
58 And You’re Saying There’s No
Money in the FOSS Business?
—The Success Story of
Deeproot Linux

developers
40 Usher in a New Era of Web
with HTML 5
47 Portlet Development With Liferay
50 Introducing JQuery Selectors
89 Linux Network Stack Administra-
tion: A Developer’s Approach
92 VBA Macro Interoperability in
OpenOffice.org

Admin
61 CentOS: A Blue Feather In Your
Red Hat
64 SAFENTRIX: It’s Time to Kill E-
mail Spam,
for Free!

  |  AUGUST 2009  |  LINUX For You  |  www.LinuxForU.com


Contents Editor
Rahul chopra

Editorial, Subscriptions
& Advertising

Delhi (HQ)
D-87/1, Okhla Industrial Area,
Phase I, New Delhi 110020
Phone: (011) 26810602, 26810603
Geeks Fax: 26817563
E-mail: [email protected]

66 Create Multi-boot Discs BANGALORE


No. 9, 17th Main,
1st Cross, HAL II Stage,
74 My Own Streaming Radio Indiranagar, Bangalore 560008
Ph: (080) 25260023; Fax: 25260394
78 Netkit: The Networking Sandbox E-mail: [email protected]

CHENNAI
84 make My Day! M. Nackeeran
DBS House, 31-A, Cathedral Garden Road
Near Palmgroove Hotel, Chennai 600034
86 Programming in Python for Friends Ph: 044-28275191; Mobile: 09962502404
E-mail: [email protected]
and Relations—Part 16: Creating a
Screencast Customer Care
e-mail: [email protected]

Columns Back Issues


83 The Joy of Programming: Demysti-
REGULAR FEATURES Kits ‘n’ Spares
D-88/5, Okhla Industrial Area,
Phase I, New Delhi 110020
fying the ‘Volatile’ Keyword in C 06 Editorial Phone: (011) 32975879, 26371661-2
E-mail: [email protected]
Website: www.kitsnspares.com
98 CodeSport 08 You Said It...
101 A Voyage to the Kernel—Part 15: 10 Technology News Advertising
Kolkata
Segment: 3.4, Day 14 14 Q&A Section D.C. Mehra
Ph: (033) 22294788
Telefax: 22650094
55 Industry News E-mail: [email protected]
Mobile: 09432422932

96 Tips & Tricks mumbai


Flory D’Souza
Ph: (022) 24950047, 24928520; Fax: 24954278
106 Linux Jobs E-mail: [email protected]

PUNE
108 FOSS Yellow Pages Zakir Shaikh
Mobile: 09372407753
E-mail: [email protected]

HYDERABAD
P.S. Muralidharan
Ph: 09849962660
E-mail: [email protected]

LFY DVD: CentOS 5.3 Exclusive News-stand


Distributor (India)
CentOS provides a free enterprise class computing platform that is India book house Pvt Ltd
Arch No, 30, below Mahalaxmi Bridge, Mahalaxmi,
built from publicly available source code provided by a prominent Mumbai - 400034 Tel: 022- 40497401, 40497402,
40497474, 40497479, Fax: 40497434
North American Enterprise Linux vendor. CentOS conforms fully with E-mail: [email protected]
the upstream vendors redistribution policies and aims to be 100% Printed, published and owned by Ramesh Chopra. Printed at
binary compatible. Ratna Offset, C-101, DDA Shed, Okhla Industrial Area, Phase
I, New Delhi 110020, on 28th of the previous month, and
published from D-87/1, Okhla Industrial Area, Phase I, New
Delhi 110020. Copyright © 2009. All articles in this issue,
except for interviews, verbatim quotes, or unless otherwise

LFY CD: NetBeans 6.7 explicitly mentioned, will be released under under Creative
Commons Attribution-Share Alike 3.0 Unported License
a month after the date of publication. Refer to http://
NetBeans is a free and open source IDE (integrated development creativecommons.org/licenses/by-sa/3.0 for a copy of the
licence. Although every effort is made to ensure accuracy,
environment) for software developers. You get all the tools you need to create no responsibility whatsoever is taken for any loss due to
publishing errors. Articles that cannot be used are returned
professional desktop, enterprise, Web and mobile applications with Java, C/ to the authors if accompanied by a self-addressed and
sufficiently stamped envelope. But no responsibility is taken
C++, and even dynamic languages such as PHP, JavaScript, Groovy and Ruby. for any loss or delay in returning the material. Disputes, if
any, will be settled in a New Delhi court only.
Note: All articles in this issue, except for interviews, verbatim quotes, or unless otherwise explicitly mentioned, will be released under Creative Commons Attribution-Share Alike 3.0 Unported
Licence a month after the date of publication. Refer to http://creativecommons.org/licenses/by-sa/3.0/ for a copy of the licence.

www.LinuxForU.com  |  LINUX For You  |  AUGUST 2009  |  


Editorial
Dear readers, And, it’s here that we got our quote-
“We need more competitors in of-the-month—from Abhas Abhinav,
India, for us to grow.” founder of DeepRoot Linux.
Wow! Now, that was the quote of We are looking for many more
the month for me. What we normally such stories. While we may be able
get to hear is something on the lines to publish just a select few in the
of, “Increasing competition, means magazine, we will surely try and cover
lower margins, and hence more as many as possible on www.linuxforu.
difficulties.” But then, the open source com. Here’s how you can help us in
industry was never ‘normal’. this initiative. If you own or work in an
As we meet more and more Indian firm that provides open source
customers, and those who serve solutions—contact us. If you know of a
them—it’s becoming increasingly firm that does, point it out to us. (Our
Let’s recognise clear that while open source offers e-mail ID is mentioned below.)
a lot of choices to customers with So bring it on, India! Let’s
every effort to respect to software solutions, recognise every effort to build
build a business the options get severely limited a business around open source,
when they seek vendors who can learn from that experience, and get
around open implement them—especially in India. motivated to create many more.
source, learn Thus, for customers, the strangle hold
of ‘vendor lock-in’ remains. Best Wishes!
from that In a nutshell, for open source to
experience, and grow, we do need entrepreneurs who
can bet their money and careers on
get motivated their beliefs. Rahul Chopra
We started publishing the FOSS Editor, LFY
to create many Yellow Pages (FYP) in an attempt to [email protected]
more. change precisely this scenario—to
make it easy for customers to be
able to locate plausible vendors for
different open source solutions.
Very soon, it’s going to go online too,
through www.linuxforu.com.
While the FYP makes it easy to
locate existing vendors, what can we
do to grow that list? That was the
million-dollar question put forward by
a member of the LFY team. Perhaps we
could motivate our readers to become
open source entrepreneurs, suggested
someone. And, how can we go about
doing that?
Turn to Page 58 for the answer
to that question, where we have
launched a new series of articles,
which are tagged as ‘success stories’.

  |  AUGUST 2009  |  LINUX For You  |  www.LinuxForU.com


Solutions SME Mail Servers
Mail Server Clusters High Availability
Request Tracking & Helpdesks Prox y Servers Fax Servers

Firewalls & VPNs Distributed Email Services

ed File Serving and Storage Solutions


i sfi Unified Authentication
0 s a t e rs
r 40 us Directory Services
Ove d p a i d Large Scale Email
a n
deepOfix, the deepOfix logo and DeepRoot Linux logo are trademarks of DeepRoot Linux. Linux is a registered trademark of Linux Torvalds.

Internet Link Management

Features Thin Client Solutions


Web Portals

Installs in 15 minutes
Quick to Deploy. Easy to Manage.
Completely automated and integrated OS deepOfix Support Services
Web-based Email Powered by LDAP Deployment Planning Services
Pre-integrated Spam Control and Anti-Virus User & data migration services

Intelligent and Flexible SSL / TLS for all protocols Product Installation & Integration
Account Management Email Archival Software / OS upgrades & updates
Customisations & Extensions
SMTP / POP3 / IMAP Services
Warranty for Free Software
Web-based calendar and contact management
Web & DNS hosting Backup MX hosting
Email policy framework
and quarantine manager Network & Service monitoring

fix
s
d ow n load
Ove r 60,000

ep YOU.

Document prepared using GNU/Linux and Free Software only.


de
deep fix
Brand-new
Quick Deployment.
deep fix v3.4
Easy Management. available for
Guaranteed. download now!
www.deepofix.org

deeprootlinux
Pure & Exclusive Free Software Business. We believe in: sharing, compassion and plain action. Backed by full-time hackers.
We provide: airtight solutions, solid support and Freedom. Quick deployment, easy management. Guaranteed.
http://start.deeproot.in | +91.80.40890000 | [email protected]

Proprietary License + Your Silence = Our Concern


You said it…
This mail offers a probable • Spam filtering software: ED: We agree Puppy Linux is a very
solution to the first question SpamAssassin good OS for older systems. In fact, we
in the “You Said It” section in the Of course, we'd recommend you did publish a review of version 4.1 when
July 09 issue, from Anuvrat Parashar. read up on each of these solutions, it came out last year.
It seems that he gets Error 22 on compare their features and test
Grub (no boot-able media/corrupt/ them before fully deploying them. I am amused by frequent
missing, etc), due to his BIOS news clips and articles in the
settings and not due to the DVD/ I run Mandriva 2009 64-bit press (including LFY), which state
CDs he’s got. In certain BIOS and I have an iPod Touch. or rue the fact that Windows
(mainly found in HP/Compaq), All the information that I can find dominates between 90 to 95 per
there are hard disk modes such as: on the Net is related to syncing cent of the world’s PCs. Microsoft
(1) IDE Controller: Compatibility / with Ubuntu and not Mandriva. itself recognises only genuine
Enhanced Any ideas on where I can find Windows. For the last 10 years,
(2) AHCI: On / Off information on syncing the iPod three out of every four PCs I have
In this case, he can try to Touch with Mandriva. seen in homes as well as at offices,
install by setting the BIOS mode use pirated Windows, which cannot
to ‘Compatibility’ or ‘AHCI Off ’ —Marcus, mmatzick@gmail. be recognised as Microsoft’s share of
(whichever applies to his BIOS). com the market. People continue to use
This will, in most cases, solve the pirated Windows simply because it
Grub Error 22. Hope this helps. ED: Since none of us here use works, they are used to it and are
iPod devices, we won’t be able unwilling to change to open source
—Harshit Upadhyay, to provide you with any first- due to some kind of mind block, or
[email protected] hand information. Under the are just unaware of open source.
circumstances, we’ll leave it to our Computer sellers are ever ready to
I am a systems administrator readers to address this problem. load pirated Windows, but most of
for a private institution. We However, we do think that if you’ve them now advise the customer to
want to deploy a mail server at our chanced upon Ubuntu guides/ use OpenOffice.org instead of the
institution. We would like to use a articles/forum posts, you can apply MS Office suite. If all this is taken
Linux/OSS product only. Our the same steps on a Mandriva into consideration, one can easily
institution has more than 75 system too. arrive at what Windows’ share of
employees and around 2,500 the market, actually is!
students. My query is, which free-of- I have been following the
cost mail server is best suited for a various Linux distros that —J S Karkada, Bangalore
campus of our size. you distribute with the LFY
magazine. I had tried Fedora, but
—Somu .S, linux_3250@yahoo. found it to be too bulky for basic Errata
com Internet browsing. After scouting
around, I came across a program The Fedora review published in the July
ED: Typically, you’d require the called Puppy Linux. This is really issue wrongly mentioned the Fedora 11
following components: fast and needs very minimal codename as Leonardo. It should have
• An MTA: You can choose from hardware. I have been running it been Leonidas. We regret the error.
qmail, Postfix and Sendmail. At on a Pentium III machine with
LFY we use qmail. amazing results.
Please send your comments or suggestions to:
• An IMAP server: Choose between I thought I would share these
The Editor
Dovecot and Courier IMAP. views with your other readers. If
LINUX FOR YOU Magazine
• A Web mail software: There are you have a chance, please review D-87/1, Okhla Industrial Area,
quite a few solutions here. We use it in one of your forthcoming Phase I, New Delhi 110020
Squirrel Mail. issues. Phone: 011-26810601/02/03
• Anti virus software ( just to save Fax: 011-26817563
Email: [email protected]
those on the insecure Windows): —Narasimha Pingili, Website: www.openITis.com
ClamAV [email protected]

  |  AUGUST 2009  |  LINUX For You  |  www.LinuxForU.com


Technology News
Firefox 3.5 twice as fast as Firefox 3 on complex websites
Mozilla has released Firefox 3.5, a major update to the popular Web browser. VLC is now Goldeneye
Coming one year after the launch of Firefox 3, version 3.5 introduces many new Well, that’s what version 1.0.0
features, as well as new support of the popular media player is
for a wide variety of Web code-named. The release includes
standards, the company says. frame-by-frame
Firefox 3.5 makes claims to being playback,
the best performing browser on-the-fly
Mozilla has ever released and recording and
delivers radically improved finer speed
JavaScript performance, a new control during
Private Browsing mode, native playback.
support for open video and Besides
audio, and Location Aware improvements
Browsing. The newest version of to Real Media playback and TS de-
Firefox is more than two times faster than Firefox 3, and 10 times faster than Firefox multiplexer for M2TS files from Blu-
2 on complex websites, the company claims. ray and AVCHD (in addition to fixes
Firefox 3.5 includes the new TraceMonkey JavaScript engine, which is supposed to 5.1 and 7.1 channel decoding and
to deliver unprecedented performance with today’s complex Web applications. It ordering), the new version includes
also delivers the first native integration of audio and video directly into the browser. the following new decoders: AES3,
Now everyone can easily watch open format Ogg Theora videos. Web developers Dolby Digital Plus, True HD/MLP
can use these technologies to design pages that interact with video content in and Blu-ray Linear PCM decoders.
new and exciting ways, offering richer interactive experiences beyond controlling
playback and volume. Meanwhile, location-aware browsing saves you time by A completely updated
allowing websites to ask you where you are located. If you choose to share your stack with Pardus 2009
location with a website, it can use that information to find nearby points of interest Whether you want to run
and return additional, useful data like maps of your area. It’s all optional—Firefox OpenOffice.org 3.1, Firefox 3.5.1 or
doesn’t share your location without your permission. kernel 2.6.30, Pardus 2009 packs
all these in one. What’s more, the
TI OMAP3530 reference board includes Linux support release now officially features
L&T Infotech has announced the availability of the TI OMAP3530-based reference KDE4 (version 4.2.4). Version
platform in Linux and Android flavours. The custom TI OMAP3530 reference board 2009 contains many bug fixes
is targeted at OEMs developing products such as mobile TV solutions, portable and enhancements, including
media players (PMP), personal navigation devices (PND), mobile Internet devices improved hardware support, latest
(MID) and portable gaming devices. It allows OEMs to prototype and validate their releases of Pardus Manager tools,
innovative product designs across various mobile operating systems. an up-to-date software repository,
The TI OMAP3530 application processor includes ARM performance
Cortex-A8 operating at a maximum speed of 600MHz, and C64x+ improvements
DSP operating at a maximum speed of 430MHz. The reference all over the
platform’s features include a 4.3” (10.9 cm) TFT LCD touchscreen system, etc.
(480 x 272 QVGA), 128 MB DDR II memory, 256 MB Nand Flash, Pardus 2009
a 1.8” (4.6 cm) CE-ATA hard disk, a VGA camera, a DVB-H has also been
receiver, a GPS module, an FM tuner, a USB 2.0 Host and OTG improved
support, connectivity (Wi-Fi, Bluetooth), speakers, a microphone graphically in
and headset, and a 3 x 3 matrix keyboard. It also has a microSD every part of the
slot, which can be used for WiMAX connectivity required for distribution. All
MID functionality. It can be battery-operated with a 3.7V, 1AH Li-on battery the splash systems, from bootloader
and provides a close-to-product form factor, which comes very handy for the to login screen, have been revised.
development community to enable easy demonstration of their applications on Also, Pardus’ icon theme, Milky, has
the hardware. The TI OMAP3530 reference platform includes support for Linux, been introduced to users.
WinCE 6.0 and Android 1.1 Board Support Package (BSP).

10  |  AUGUST 2009  |  LINUX For You  |  www.LinuxForU.com


Supports
Exhibit At
South Asia’s Largest ICT Event
Department of Telecommunications
Ministry of Communications & Information Technology
Government of India

Department of Information Technology


Ministry of Communications & Information Technology
Government of India

International Exhibition & Conference


Pragati Maidan, New Delhi, India
23-25 March 2010

Suppporting Journal Certified by

Organiser

217-B (2nd Floor) Okhla Industrial Estate,


Phase III, New Delhi 110 020, India
Tel: +91 11 4279 5000
Fax: +91 11 4279 5098 / 99
Bunny Sidhu, Vice President,
[email protected]
Bangalore | Chennai | Hyderabad | Mumbai
| Ahmedabad | California

www.convergenceindia.org
Technology News
Launchpad source code released
PHP 5.3.0 released Canonical, the entity behind the Ubuntu project, has open-sourced the code
The PHP development team that runs Launchpad under version 3 of the GNU Affero General Public
has released PHP 5.3.0, a major License (AGPLv3). Launchpad is used to build Ubuntu and thousands of
improvement in the 5.X series, other projects, and its users can now participate directly in the development
which includes a large number of Launchpad itself.
of new features and bug fixes. Launchpad allows developers to host and share code from many different
Some of these include: support sources using the Bazaar version control system, which is integrated into it.
for namespaces; late static Translators can collaborate
binding; Lambda Functions on translations across many
and Closures; syntax additions; different projects. End-
performance improvements and users identify bugs affecting
optional garbage collection for one or more projects so
cyclic references. Other additions that developers can then
are: optional mysqlnd PHP triage and resolve those
native replacement for libmysql; bugs. Contributors can
more consistent float rounding; write, propose, and manage
deprecation notices now handled software specifications. In
via E_DEPRECATED (part of addition, Launchpad erases
E_ALL) instead of the E_STRICT barriers to collaboration by
error level; several enhancements enabling people to support
to enable more flexibility in php. each other’s efforts across different project hosting services, both through its
ini (and ini parsing in general); new Web interface and its APIs. Launchpad has everything software projects, open
bundled extensions like ext/phar, source or not, need to be successful.
ext/intl, ext/fileinfo, ext/sqlite3, ext/ Canonical founder and CEO, Mark Shuttleworth, said: “Projects that are
enchant; and over 140 bug fixes and hosted on Launchpad are immediately connected to every other project hosted
improvements to PHP, in particular there in a way that makes it easy to collaborate on code, translations, bug fixes
to: ext/openssl, ext/spl and ext/ and feature design, across project boundaries. Rather than hosting individual
date. For users upgrading from PHP projects, we host a massive and connected community that collaborates
5.2, consult the migration guide together across many projects. Making Launchpad itself open source gives
available at php.net/migration53. users the ability to improve the service they use every day.”
Technical details about the open sourcing of Launchpad can be found on
Python 3.1 enhancements the Launchpad development wiki at dev.launchpad.net.
June 27 saw the release of a
new version of the backwards- Airtel and HTC introduce Android-powered
incompatible series of Python phone in India
3. Improvements in Python 3.1 Bharti Airtel and HTC Corporation have launched India’s
include: an ordered dictionary first Android-powered mobile phone, the HTC Magic. (Turn
type; various optimisations to Page ___ to read a review of Magic.)
to the int type; new unit-test For Airtel customers, HTC Magic allows free data
features including test skipping download of 100 MB per month for a period of six months.
and new assert methods; a much The HTC Magic will be available at a market price of
faster io module; tile support for Rs 29,900 at Airtel relationship centres and authorised
Tkinter; a pure Python reference HTC resellers across 17 cities. The cities include Delhi,
implementation of the import Mumbai, Bengaluru, Chennai, Hyderabad, Kolkata, Pune,
statement; new syntax for nested Ahmedabad, Chandigarh, Jaipur, Coimbatore, Cochin,
with statements. For more Ludhiana, Jalandhar, Lucknow, Bhubaneswar and Patna.
details check out the What’s new To begin with, Airtel customers can avail utility-based
document at docs.python.org/3.1/ applications such as Portfolio Manager, Hello Tunes
whatsnew/3.1.html. Manager, Weather Channel, Mobshare, In-mobile Search
and City Search on the HTC Magic.

12  |  AUGUST 2009  |  LINUX For You  |  www.LinuxForU.com


Technology News
NetBeans 6.7 features tighter integration with Project Kenai
Sun Microsystems and the NetBeans developer community have released Flash platform media, text
NetBeans IDE 6.7. This new version of NetBeans features tight integration frameworks now FOSS
with Project Kenai, Sun’s collaborative hosting site for free and open source Adobe has announced two new
projects. Developers can download the free, full-featured NetBeans IDE 6.7 at Adobe Flash Platform open source
www.netbeans.org. The tight initiatives. Open Source Media
integration of the new Framework (OSMF), part of the
NetBeans IDE will enable project previously code named
developers to discuss, Strobe, enables developers to
edit, debug and commit quickly and easily build feature-rich
code through one easy-to- media players optimised for the
use interface. Other key Adobe Flash Platform. The Text
features of NetBeans IDE 6.7 Layout Framework (TLF) will help
include: support for Maven, developers bring sophisticated
a community software typography capabilities to Web
project management and applications. Both OSMF and TLF
comprehension tool; the are now freely available as open
new ‘Team’ menu that source software, helping content
provides access to projects owners extend their online media
on Kenai.com; and an efforts as they look to create
automated continuous integration system with Hudson, an extensible Java- new business opportunities and
based solution that makes it easier for developers to integrate changes to their monetisation strategies to publish
project, and makes it easier for users to obtain a fresh build. It also features on the Web. For details, visit www.
improved PHP support allowing developers to connect with each other and the opensourcemediaframework.com.
latest technologies; and support for Zembly, a single registry and repository of
popular Web APIs. Nmap 5.0 released
Other highlights of the NetBeans IDE 6.7 release include improved PHP and Insecure.Org has released Nmap
GlassFish software support. The NetBeans IDE provides a rich set of features Security Scanner version 5.
for Ruby, Groovy, JavaScript and other technologies. Support for JavaFX 1.2 This is the first major release
technology is currently available for NetBeans IDE 6.5.1 and will soon be since the 4.50 release in 2007.
available for NetBeans IDE 6.7. Learn more at www.netbeans.org/features. Some improvements in Nmap
5, according to the developers,
VirtualBox 3.0 introduces guest SMP support include: the new Ncat tool aims to
Sun has released VirtualBox 3.0, a major update introducing Symmetrical be your Swiss army knife for data
Multiprocessing (SMP) in virtual machines as well as improved 3D support. The transfer, redirection, and debugging;
following major new features the addition of the Ndiff scan
were also added: Guest SMP comparison tool makes it easy to
with up to 32 virtual CPUs (VT-x automatically scan your network
and AMD-V only); for Windows daily and report on any changes
guests there is the ability to use (systems coming up or going
Direct3D 8/9 applications/games down, changes to the software
(experimental); and support services they are running, etc);
for OpenGL 2.0 for Windows, the developers have spent the last
Linux and Solaris guests. Besides summer scanning much of the
these, there are numerous other Internet and merging that data
fixes and improvements. In fact, with internal enterprise scan logs
within 10 days of the initial 3.0.0 to determine the most commonly
announcement, version 3.0.2 open ports—this allows Nmap to
was released as a maintenance scan fewer ports by default while
update with additional bug fixes. finding more open ports.
Read the latest changelog at www.virtualbox.org/wiki/Changelog.

www.LinuxForU.com  |  LINUX For You  |  AUGUST 2009  |  13


  I am a regular reader of USB device. grep and check the
your Q and A section. I have device name that the modem is
been using Mandriva 2008 on assigned.
my desktop for the past several 2. On the terminal window, run the
months and would like to following command:
thank you all for bringing out
LINUX For You magazine, which [root@localhost ~] # wvdialconf /etc/
helped me get rid of a non-free wvdial.conf
platform. Recently, I started
facing a strange problem. Often, This will scan all connected serial
when I start K3b, it does not devices, and if it detects the modem,
show up for a long time. Then it will write the configuration to
I reboot my system and it /etc/wvdial.conf (I assume that you
starts properly. Can you please have wvdial installed, if not then
suggest how I can resolve this please install it before running this
issue? command).
—Ivan, Imphal 3. Now open the /etc/wvdial.
conf file in any text editor,
  I have a server running A. There could be several enter phone as #777 and
CentOS 5 with Joomla, reasons for K3b not starting. You enter “internet” for username
WordPress, Plone and other Web do not need to restart, just grep and password. If the lines are
applications. The server crashes the PID of K3b and kill it before commented then uncomment
very frequently and stops trying to start K3b from a terminal. them. Also, add the following at
responding. One of my friends This will help you in identifying the the end of the file:
suggested that this could be due exact problem it is encountering in
to a memory leak. Please provide starting up smoothly. Init3 = AT+CRM=1
me more information about Stupid Mode = 1
memory leaks and how I ought to   I have openSUSE 11.1 in
manage the problem. my PC (Compaq Presario) – an 4. Now run the command wvdial
—Naveen Chawla, New Delhi AMD Athlon 64 machine with and wait till you see something
512 MB of RAM. Now I want to like:
A memory leak is a condition connect to the Internet using
wherein your server faces a gradual my Tata Indicom USB modem. local IP address xx.xxx.xxx.x
loss of available memory. This is But I don’t know how to do that remote IP address xxx.xxx.x.xx
due to a bug(s) in a program that in openSUSE. Kindly suggest a primary DNS address xxx.xxx.xx.xxx
allocates the memory to the program solution. secondary DNS address xxx.xxx.xxx.xxx
and does not de-allocate it when — Babanna Duggani,
the need is over. As a result, it ends [email protected] If you can see some values
up eating all the system memory instead of these multiple Xs, then it
available on the server. Most of the Tata Indicom USB means that you are connected.
Memory leaks may be one of the modems work fine with Linux. As 5. Open your Web browser and start
problems your server is facing. But you have not mentioned the exact browsing. If unable to browse,
I won’t be able to help you much model number of the modem, I then open the terminal and run
as I need to study your log files to assume it’s one of those that are the following command:
check what’s making your server supported. To make this modem
stop responding. The reasons could work, follow the steps given below: cp /etc/ppp/resolv.conf /etc/
be many, and not only necessarily 1. Open the terminal, become
a memory leak. So, I’d recommend the root user and then check This will ask you to replace the
analysing the relevant log files. dmesg after connecting your resolve.conf. Press ‘y’. 

14  |  AUGUST 2009  |  LINUX For You  |  www.LinuxForU.com


For U & Me  |  Hypo/Thesis ________________________________________________________________________________________

Google’s OS
Just A Chrome Polish or Is
There Some Metal Inside Too?
Google has announced the development of the Chrome OS. For the first time,
this search engine giant has taken its archrival Microsoft head-on. But the
emergence of Google as an omnipresent player could also have a flip side.

H
ow can you be the lord of would ever give Google an easy ride on the
the sea without your own Internet Highway.
ship? This is what Google, Google did make friends with Firefox
a company that started out and others, but for how long can you take
with a search engine, then entered domain a ride on rented cars? So Google launched
after domain, before becoming the tallest its very own Chrome browser, which like
giant of the Internet Age, has realised. most Google services is still in the beta
All of Google’s businesses are in the stage and not very efficient on the GNU/
online world—if there were no Internet Linux platform. But the next problem
or access to Google services, it would Google faced was how to entice users of
mean no business for the Mountain View Windows or a Mac to the world of Chrome.
company. The only interface to Google So it decided to develop its own operating
services has always been a browser. system as well.
Microsoft saw Google as its biggest threat While analysts are busy studying the
on this turf, so there was little chance impact this OS will have on the market,
that Microsoft’s IE (Instant Exploiter) industry and FOSS leaders have refused to

16  |  AUGUST 2009  |  LINUX For You  |  www.LinuxForU.com


_______________________________________________________________________________________________ Hypo/Thesis   |  For U & Me

comment on the Google Chrome OS. When I asked him has touched MS’s pain point.
for his opinion, leading Linux kernel developer, Greg Typically, the netbook players will now be working
Kroah-Hartman said, “There’s nothing to comment on closer with Google than with Microsoft, because they
regarding a press-release. I prefer to see actual code.” will have a free version of an OS with much more
The timing could not have been better. Netbooks are control for customisation as compared to Microsoft’s
now the preferred choice of more and more advanced product, since Chrome follows the Free Software policy.
on-the-move users. The trend is catching up in India as Also, since it is based on the Linux kernel, it is secure
well. Last week I was travelling from Delhi to Lucknow by design—which addresses one of the major concerns
on the Shatabdi, and from among the five laptop users of netbook users.
in my compartment, two were using netbooks. What we expect to happen is that more and more
Now, what are you going to run on a netbook? Vista netbook players will install the Chrome OS on their
has been a huge disaster and PC makers have had to go machines, which will give Google a strategic advantage
back to a Flintstone Age Windows-XP. (Microsoft, on to drive users to use its services and make money for
its part, is still trying to harvest that old crop, as it has itself as well as its partners. This seems to be the best
nothing more efficient in its barn.) GNU/Linux players like deal for GNU/Linux as well as for OEMs.
Novell and Red Hat have little interest in home users. The But, there are bigger dangers with using Google,
only commercial player that is giving Microsoft and Apple compared to Apple or Microsoft. Everything you do
a tough fight is Canonical’s Ubuntu. today, using any of the Google services, gives Google
Microsoft’s polished and rechristened Vista (under access to all your data and information. Honestly, today
the name of Windows 7), which is around the corner, Google knows more about you than the government
is supposed to run well on netbooks. Well, Microsoft does.
committed the blunder of claiming Vista and IE7 to be RMS has already warned us all against going in
the best OS and browsers ever, which only helped it in blindly for such services. If successful, the Chrome OS
losing its credibility further. Besides, the price tag that will put Google in a monopolistic position—and it’s
Windows comes with has also upset the OEMs. Now, no news that monopolies tend to exploit users and
what better position than this, for OEMs to not only kill competitors. One of the biggest examples is Intel,
bargain with Microsoft but also delay deals with the which now seems to have forgotten the foundations
Redmond giant as the Chrome OS will offer a ‘free’ (as laid by Moore, and is now getting into the same sinful
in cost and customisation) alternative. practices as its brother-in-arms, Microsoft.
Google is already working with Acer, Adobe, ASUS, I guess it is fine to support the Chrome OS in the
Freescale, Hewlett-Packard, Lenovo, Qualcomm, Texas beginning, because it is very important to continue
Instruments and Toshiba—a very impressive partner creating and strengthening free alternatives of any
list indeed. On the other side, Google has its Android software that people would depend on. But what I
OS for the mobile segment; thus the company has would like to add is, “Welcome Chrome, but Ubuntu
just started to stretch its boundaries—the full extent and others… pull up your socks! We might need your
of which is still unclear. The announcement of the help soon.”  
Chrome OS has definitely put Microsoft in a sorry
state. The company is now not in a position to further
By Swapnil Bhartiya
re-work on its already reworked ‘Vista as Windows 7’ to
A Free Software fund-a-mental-ist and Charles Bukowski
make it better. fan, Swapnil also writes fiction and tries to find cracks in a
Google, on the other hand, now has more muscle proprietary company’s ‘paper armours’. He is a big movie
to influence hardware players than ever before. It is buff, and prefers listening to music at such loud volumes that
already driving the Open Handset Alliance, which he's gone partially deaf when it comes to identifying anything
positive about proprietary companies. Oh, and he is also the
brought the company closer to the hardware players. assistant editor of EFYTimes.com.
And now with the Chrome OS, the search engine giant

www.LinuxForU.com  |  LINUX For You  |  AUGUST 2009  |  17


For U & Me  |  Review _______________________________________________________________________________________________

India Gets a Taste of


Android Magic
With the launch of the HTC Magic, Google’s mobile operating system finally
arrived in India. Will it herald a new era in cell phones or wilt against some very
stiff competition? We got our hands on the HTC Magic and talked to some key
members in the mobile industry to find out.

W
hen Google announced that it was working on an
open source OS for cell phones in 2007, the world
promptly sat up and took notice. It was not that
open source mobile operating systems had not been
developed before, but the involvement of a company like Google
made many see this venture in a whole new light. In November 2007,
Google not only unveiled Android but also announced the formation
of the Open Handset Alliance (OHA) to develop open standards for
mobile devices with the likes of Google, LG, Samsung, Intel and HTC
on board. The open source mobile ball was well and truly rolling,
powered by Android.
Needless to say, there was immense curiosity about the new
operating system. Would it finally herald the arrival of open source
software in a big way in the world of cell phones? Would it strike
a blow against the hegemony of Nokia, Microsoft and RIM in the
mobile OS space by offering powerful devices at a relatively lower
price? The first Android device, the HTC G1, was released last
year and while there were some mutterings about the device’s
less-than-designer looks, no one could deny that the phone’s OS
was a formidable one. Most significantly, Android represented
one of the first times in tech history that the OS of a mobile
phone had grabbed the headlines. At the time of writing this
article, no fewer than three phones running Android have been
released and in each case, it has been Android rather than the
phone’s specifications that have made the headlines.
And it’s no different in India. When HTC unveiled Magic
with Airtel, it was not the phone’s processor, camera or
touchscreen that dominated the launch but what was under
its hood—Android. Needless to say, we promptly stood in
line for a device and when we got one, put it through its
paces quite thoroughly.

It’s got the looks and specs too!


The first thing that struck us when we clapped eyes on
the Magic was how good the device looked. Unlike the
slightly clunky G1, with its visible hinges for the slide out
QWERTY keyboard, the Magic is a sleek, all-touch device

18  |  AUGUST 2009  |  LINUX For You  |  www.LinuxForU.com


_____________________________________________________________________________________________________ Review   |  For U & Me

(it has no physical keyboard). Our model was black and


had a maroon band running along its sides. Although the
The multi-touch factor
build of the device is almost totally plastic, it did not look Multi-touch has become a bit of a rage these days, thanks
‘cheap’ or fragile. Like the G1, the Magic does have a ‘chin’ to Apple’s iPhone. In simple terms, this means the ability of
at the lower end, but it did not stick out as much as in a device to respond to more than one finger placed on the
its predecessor. Its proportions of 113 x 55.56 x 13.65 mm screen at the same time.
make it very pocket-friendly and at around 113 grams, it is Conventional touchscreen devices recognise only only
on the lighter side (the iPhone 3G weighs 133 grams). one finger—so if you were to place two fingers on, say, a
Dominating the device is a 3.2 inch (8.1 cm), 65,000 HTC Diamond 2’s screen, it would recognise only one of
colour touchscreen (320 x 480 resolution), below which them and respond to it.
lies a trackball and six keys—Call receive, Call end, Menu, Multi-touch does come with its advantages—it allows
Home, Back and most interesting of all, Search (allowing the famous “pinch your fingers to zoom in or out” that is an
you to access the search function directly). Yes, that may integral part of the iPhone, and it also adds a whole new
sound a lot in these minimalistic days when screens are dimenson to playing games on the handset. However, so
followed by two or three buttons at the most, but the keys far, only two other cellphone manufacturers have followed
are well laid out and even with our big fingers, we never Apple’s example in this field (LG and Palm), as many of
really hit the wrong key. The back of the phone is plain them reckon that multi-touch is more of a feel-good factor
except for the 3.2 mega-pixel camera embedded in a small rather than a very practical one, given the hardware and
steel panel. We also noticed that unlike the G1, which had software costs that will be incurred.
the name ‘Google’ on the back, this phone came with the Interestingly, Android has support for multi-touch but so
name ‘HTC’, but more of that later. far none of the devices released on the platform have this
Removing the back reveals a healthy 1340 mAh battery, feature.
the slots for the SIM card and the MicroSD expansion card.
The sides are totally plain, barring the volume control keys too—the camera takes decent pictures, multimedia is
on the left. No, there is no dedicated camera button, but handled ably, and the call reception quality is just fine, if a
we honestly did not miss it much. And there is no stylus bit on the quiet side.
either—this device is totally finger-driven. The hardware
inside is pretty impressive too. The device comes with GPS, A terrific interface!
Bluetooth, Wi-Fi and about 288 MB of onboard memory If the Magic looks good switched off, it acquires an entirely
(a bit less in these days of GB storage, but then it can new dimension when you hit the ‘On’ switch (the Call end
be expanded with a 2GB microSD card that comes with button does the job). The screen is brilliant and as it is
the pack). Incidentally, the battery lasted us a day and a capacitive rather resistive, its response is excellent—the
half of calling, browsing and snapping—excellent for a best thing we have seen this side of the iPhone. You will
touchscreen device and streets ahead of the iPhone or need to just touch the screen lightly in most cases to get
even the BlackBerry Storm! a response. Talking of responses, the device comes with
All in all, the Magic is not going to make users haptic feedback, allowing you to feel a slight vibration
drool like the RAZR did, yet remains very flauntable every time you touch an icon or a button on-screen. We
nevertheless. Definitely one of the better-looking turned it off after a while but it can be handy for those new
touchscreen phones in the market. And one that performs to touchscreens.

Home screen Available applications Browsing Google Multi screen

www.LinuxForU.com  |  LINUX For You  |  AUGUST 2009  |  19


For U & Me  |  Review ______________________________________________________________________________________________________

Terrific browser, great notification bar…


Android: The developer speak The phone comes with the standard smartphone software.
As it is open source, Android is supposed to be a mobile There is a contacts manager, a calendar, an e-mail client,
application developer’s dream. Ilya A. Eliashevsky, a document reader (QuickOffice) and other software,
product manager, DataViz (developers of Road Sync but the application that just leapt out and grabbed our
and Documents to Go), has so far been impressed by attention was the browser. When it comes to browsing the
Android and feels that the fact that the OS is open source Internet, we had been under the impression that Safari on
makes application development faster for it. “The open the iPhone and Opera Mobile on Windows Mobile were
source concept is slightly new to our efforts and we as good as they get. Well, the Magic made us change our
are currently in the process of determining how to best minds. The Internet browser on the device is very powerful
leverage its full potential. One example where we quickly and renders pages at a decent speed while giving one far
realised the benefit was when we recently used code more control over the content—you can tweak just about
from the open source community to develop a RoadSync any setting, from Javascript and Google Gears to images,
Calendar application on Android. In this case, we were with minimum fuss. And yes, Web pages do look gorgeous
able to dramatically reduce our development costs and on that large touchscreen. True, there is no support for
more quickly provide consumers a feature rich solution Flash yet, but apart from that, we have no hesitation in
that had previously taken much longer to develop on putting the browser alongside Safari and Opera Mobile.
other platforms. I think the same speed to market and Yet, even the browser is overshadowed by the
lower cost concepts hold true for open source across the excellent notification bar that runs on top of the screen,
entire mobile food chain — from OS providers, to device which alerts you about new e-mails and text messages
manufactures, to operators and developers,” he says. that have come in. It makes the SMS/e-mail preview
The ‘open’ness of Android also appeals to David feature on some Nokia devices look frankly shabby. It
Storey, developer relations, Opera, developers of the allows you to get information about new text messages
Opera Mobile and Opera Mini browsers. “We have great and e-mails in the most unobtrusive way we have ever
respect for the open source movement and our products seen on any mobile device, making it pretty much the
run on various open source platforms. If websites and killer app for corporate users fed up of loud push e-mail
browsers are created based on open standards, you get alerts! And no, it does not slow down the device at all.
an ideal environment for innovation on all platforms and In fact, whatever one may accuse the HTC Magic of, it is
devices, including mobiles,” he says. However, he feels certainly not lack of speed—even when we were running
that Android will represent a good business opportunity four to five applications at the same time, it showed no
when more devices come out and are adopted by users. indication of slowing down.

The interface is based on version 1.5 of Android, also ...but no Android Market!
known as Cupcake. The homescreen seems pretty stark However, what is missing, catches the eye. The version of
to start off, with the huge clock at the top and four icons HTC Magic released in India does not come with Android
below, but there is a whole lot of magic (pun intended) Market, that vast reservoir of applications and software
lying beneath it. You can customise the home screen for Android phones. And this is because the version of
(which spans three screens that slide to either side) by Android running on the device has been tweaked by HTC
simply dragging and dropping items from the menu. You and is not the official one made by Google—and that is the
can place an item just about anywhere (and we mean reason why the back of the device has ‘HTC’ rather than
anywhere) on the homescreen—there are no restrictions ‘Google’ written on it.
at all. And if you don’t like an item, just keep it pressed and The absence of Market is a huge blow to the device as
then drag it into the handy rubbish bin that appears on it totally restricts what users can download on to it. Right
the bottom of the screen. Incidentally, you can access the now, HTC and Airtel have placed five free applications
menu by either hitting the Menu button or sliding up the such as weather and stock monitors on the device, but
bar at the bottom of the homescreen—we found the latter if you are looking for new software, the door is, alas,
to be much more fun. You can get back to the homescreen closed. Even a number of Google’s own applications—the
at any time by hitting the Home button or to the previous Gmail app and Google Maps - are not pre-installed and
screen by pressing (you guessed it) the Back button. worse, cannot be installed on the phone. Unlike versions
All of which makes the HTC Magic perhaps one of the of the device in others markets that also lacked access
most intuitive touchscreen devices we have come across. to Android Market but had other application download
The icons in the menu are large enough to be pressed by websites, the Indian device is largely restricted to what
your finger, while texting and e-mailing addicts will be comes on it. Ironically, the phone comes with no mapping
delighted to know that the onscreen QWERTY keypad solution on it, so the GPS in it is largely restricted to
is a treat in landscape as well as portrait mode, with an spotting your location for other apps and generating
excellent predictive text facility to boot. appropriate content. A sad waste!

20  |  AUGUST 2009  |  LINUX For You  |  www.LinuxForU.com


_____________________________________________________________________________________________________ Review   |  For U & Me

handset manufacturer, I do not have to


necessarily write the device drivers for
every component on my phone—they
are all open source. So I save a lot on
development costs. I do not have to go
out and create a developer eco-system
for this phone—it comes for free. There
are so many things that come for free
with this that a lot of the costs saved
should, I think, be passed on to the user,”
he points out.
In his opinion, the best
price point for a smartphone
in a country like India is
in the Rs 10,000-15,000
bracket—almost half that of
This the HTC Magic.
might change
in the coming days, as Ajay A missed opportunity?
Sharma, country head, HTC India, It might sound harsh to say so, but given
reveals: “We are proactively working on making the the absence of Android Market (at the time of
Android Market available on HTC’s Android devices in writing, it still had not been made available for India’s
India.” However, we cannot help but feel that a golden HTC Magic users) and the high price tag, the HTC Magic
chance has been missed. represents a missed opportunity for open source mobile
OS in India. The very fact that one cannot at present
A staggering price tag download any applications to it, makes it inferior even to
As if the absence of the Android Market was not a big a run-of-the-mill Java phone on to which one can at least
enough blow, the price tag of the device has come as a install some basic applications and games.
shock to many people. At Rs 29,990, the HTC Magic has Even if it does get patched up to include access to the
been put in a category that is alongside the iPhone 3G and Android Market, it is doubtful whether the price-conscious
even above HTC’s own Touch Diamond 2 (which boasts Indian consumer will cough up close to Rs 30,000 for a
significantly superior specs), not to mention several Nokia, device that, for all its excellent performance, still comes
Samsung and BlackBerry smartphones. “Pricing depends with relatively modest specifications. After all, even the
upon a lot of factors apart from the operating system. We iPhone struggled to make a dent in the official Indian
strive to price devices so that they offer value for money market, although it raised a storm in the grey one, where it
for our customers and justify the price tag that they was priced considerably lower.
carry. I think the HTC Magic certainly delivers on these Mind you, it would be premature to write off Android
counts,” says Sharma, but a number of industry observers or even the HTC Magic. Industry observers point out that
are not convinced that a device with relatively modest handset prices tend to decline dramatically after their
specifications and an open source operating system should launch, and if the price of the HTC Magic were to slip to the
be costing this much. more competitive Rs 22,000-25,000 range and HTC were to
To make a comparison, HTC’s own Touch Diamond make Android Market (or an alternative download location)
2 is priced at around Rs 29,500 and comes with a 5.0- accessible on it, users might just start taking it more seriously.
megapixel camera and runs on Windows Mobile 6.1. After all, it does have some very impressive hardware in
Nokia’s own flagship device, the N97, is available in the combination with an excellent interface. Even if prices do not
market for around Rs 33,000 and has a bigger touchscreen, decline, there is every indication that the HTC Magic is just
a slide out QWERTY keypad, 32 GB onboard storage and the first of the wave of Android phones that will hit India in the
a 5.0 mega-pixel camera. Samsung’s Omnia is available coming months, many of which will be at lower price points.
for around Rs 26,000 and offers more storage and a better India’s first taste of Android might not have been
camera with Windows Mobile. Vinay Goel, country head, Magical (pun intended) but Google’s mobile OS will
products, Google India, diplomatically stated that HTC definitely cast a spell in the days to come. 
must have had good reasons for its pricing of the HTC
Magic, but added that phones running on operating By: Nimish Dubey
systems like Android should logically be cheaper than their The author is a freelance writer with a passion for IT. He can be
reached at [email protected]
counterparts with similar specifications. “It is not just
because the OS is free, but also the fact that as a phone

www.LinuxForU.com  |  LINUX For You  |  AUGUST 2009  |  21


For U & Me  |  Review _______________________________________________________________________________________________

Revive the
Multimedia
XPerience
with

Let’s take XBMC for a test drive to discover its media-playing as well as media
centre capabilities.

T
he dropping prices of @ 4GHz
computer hardware are a  Motherboard: AMD 790GX with ATI
definite help in building HD 3300 IGP | ATI Radeon HD4770
decent home-theatre systems dedicated
with ease. Media centre computer software  RAM: 4GB DDR2 800 MHz RAM
helps to enhance the viewing experience, running @ 1090MHz
as they employ features with great eye  Monitor: Samsung S2233SW with
candy. Also, there is a range of media centre 1920x1080, 16:9 ( full high definition)
solutions and software that we can choose resolution
from today.  Sound card: Realtek ALC888 8 channel
Here, we’ll take a look at one of the audio
most prominent open source media centre  Speakers: Klipsch Promedia GMX 2.1 |
applications—XBMC. Altec Lansing MX5021
I tested XBMC on the following set-up:  Operating systems: Ubuntu 9.04 64 bit,
 Processor: AMD Phenom X4 9950 BE Mandriva 2009.1 KDE 32 bit, Sabayon
@ 3.1GHz | AMD Phenom II X2 550 BE 4.2 KDE 64 bit and Dreamlinux 3.5

22  |  AUGUST 2009  |  LINUX For You  |  www.LinuxForU.com


_____________________________________________________________________________________________________ Review   |  For U & Me

Installation notes
• You can get the latest Ubuntu builds from the Ubuntu
PPA at http://launchpad.net/~team-xbmc/+archive/
ppa. In order to install, first select the Ubuntu version
you have and generate the repository from the
above link. Navigate to GNOME menu→System→
Administration→Software Sources. Under the
‘Third Party Software’ tab, add the main and source
repositories. Once done, you need to add the security
keyring for XBMC—copy everything from http://
keyserver.ubuntu.com:11371/pks/lookup?op=get&se
Figure 1: The XBMC interface
arch=0x6D975C4791E7EE5E and save it as a normal
text file. Back to the Software Sources window, under
the ‘Authenticate’ tab, add the text file and reload
repositories. Now, search for xbmc using Synaptic and
install it.
• Mandriva users need to add a new repository: Mandriva
Italian Backports (MIB). You can install MIB repositories
from http://mib.pianetalinux.org/mib/repository.html.
Select the Mandriva version and CPU architecture,
copy-paste the commands in a terminal as the root
and you are good to go. Search for XBMC and install it.
Note that you will have to install some extra packages
Figure 2: XBMC playing an HD movie in order to make XBMC run without throwing fits or
aborting automatically. Open a terminal and type the
 Driver: ATI Catalyst 9.6 used in all OSs following commands as the super user: urpmi -a curl
The XBMC Media Centre, formerly the Xbox Media curl-devel.
Centre, started as a two-man army under the name
of Xbox Media Player. Initially restrained to Xbox • openSUSE users need to enable Packman repositories.
consoles, the project came to an end on December Add the repositories from http://en.opensuse.org/
13, 2003 and was succeeded by the highly acclaimed Additional_YaST_Package_Repositories#Packman
XBMC Media Centre, which had a team of almost 200 or you can directly download xbmc packages from
developers and translators working on it. packman website http://packman.links2linux.org/
XBMC is built on the high-quality and complex package/XBMC.
OpenGL interface written in C++. Despite being a • If you have the latest versions of Sabayon and
media centre application, XBMC lacks rudimentary Dreamlinux, XBMC will come pre-installed. Dreamlinux
media centre features like support for PVR recording XFCE users need to install XBMC from a binary file
and TV guides, which is a serious let down for any located at www.dreamlinux.com.br/download.html.
media centre application. Although it offers similar
features with the help of third-party plug-ins, this is Once installed, XBMC should launch without a problem.
never a very reliable solution.
With the system resources out of the way, it’s time to
Prerequisites figure out the installation source. Unlike the Xbox media
XBMC is a very resource-demanding application due player (its previous version), XBMC is available for almost
to the highly complex OpenGL implementation it all operating systems. It is available for Xbox consoles,
comes with. The website doesn’t provide the system Linux, Windows, MacOS, Apple TV and as a live CD. You
requirements for the application but it is advisable to can also grab the latest build from SVN and compile it if
have a 2 GHz or above CPU, 2GB RAM and a decent packages are not available for your distro.
graphics card with Open GL support. Though in my Although it lists Linux as a supported OS, it only
rig, I had no problem with the player except for some provides packages for Ubuntu. I will try to cover the
annoying bugs that hindered executing the program. installation in brief, but if packages are not available
Make sure you install all the proprietary graphics for your OS, then you will have to resort to compiling
drivers before using it. Users planning to run Blue-ray from source. Fortunately, many distros provide
or HD movies should have a 3 GHz multi-core CPU or a packages for XBMC or they ship it as the main media
GPU capable of hardware acceleration. centre application. Here are some of the distros that

www.LinuxForU.com  |  LINUX For You  |  AUGUST 2009  |  23


For U & Me  |  Review ______________________________________________________________________________________________________

Figure 3: Navigating the music collection Figure 5: The bookmark wizard

Figure 4: Navigating the video collection Figure 6: Image viewer

have pre-compiled binaries for XBMC: The player has very unique display options. You
1. Ubuntu: https://launchpad.net/~team-xbmc/ can navigate through your collection with small or
+archive/ppa big icons, and these come with a variety of exquisite
2. Mandriva: http://mib.pianetalinux.org/mib/ effects and some gorgeous cover flow effects. Pretty
repository.html much everything is available for you to make the
3. openSUSE: http://en.opensuse.org/Additional_ most out of your well-managed collection.
YaST_Package_Repositories#Packman The music player is very good, but I find the
4. Sabayon: http://www.sabayonlinux.org/ volume not as loud as it could be. Even cranking the
5. Dreamlinux: http://www.dreamlinux.com.br/ volume to full from the XBMC settings does not have
download.html much effect on the overall volume output. However,
For notes on installation, see the sidebox. the beauty of the player is that you can resume
doing your work, like goofing around with the player,
Rock n’ roll in eye candy viewing photographs and inspecting the collection,
Post installation, the application launches in while a small display of the currently playing track/
windowed mode—only Sabayon opens it in full movie runs at the bottom left of the application.
screen, or ‘Party Mode’ as I like to call it. Clicking on Moving on to the movies, I tried my Blue-ray, full
the maximise button, maximises the window. After high-definition content and was blown away with
pondering over various possible shortcut keys, I the output. Although the movies play as they do in
finally got the solution—you need to hit the \ (back a normal player, here you can even watch the movie
slash) key for a full-screen media centre view. in the main menu while continuing your work, as
The XBMC interface is quite lucid with very you can see in Figure 1. And you can bookmark the
well laid out categories. The player menu has been movie at a particular time interval, which allows you
segregated into videos, music, photos, weather, scripts to resume watching it from where you had left it.
and settings. The first three options will ask you to The player supports a plethora of audio/video
add media sources while it auto detects any externally and image formats. It picks up the subtitles
attached medium. On the downside, it cannot read correctly, although in some videos I have had to
Flash drives above 4GB because it still follows USB 1.1 enable them from the settings. The only let down
standards, and that too, only FAT-formatted drives. So, is not being able to play DRM-restricted media
if you’re in the habit of using EXT3/NTFS formatted files, besides the inability of XBMC to read multi-
Flash drives, you’re out of luck. session discs.

24  |  AUGUST 2009  |  LINUX For You  |  www.LinuxForU.com


_____________________________________________________________________________________________________ Review   |  For U & Me

The good thing is, you can resource hungry. It uses 50 per should include much more media
extend its capabilities from the cent of the CPU cycles of my quad centre capabilities, but they are
third-party plug-ins available core system, besides eating up a nowhere to be found; also, there
on its website. It offers media whopping 1.8 GB of RAM. On the are no proper alternatives to these
streaming from YouTube, Hulu other hand, SMplayer/VLC only missing capabilities.
and Veoh with the help of plug- uses 25-30 per cent of the CPU Overall, although XBMC does try
ins, besides other expandability and ~750MB of RAM. to steal the limelight, there are more
options that you can add. There’s In addition, coming with negatives than positives. Because of
even a weather applet that can a ‘Media Centre’ tag, XBMC its resource hogging nature and lack
fetch weather forecasts for your of media centre capabilities, it comes
city [if available] from the Web, across as a mediocre media centre.
and display it on the main screen. XBMC 9.04.1 So if you plan to build a HTPC, look
for an alternative. 
And the party’s over
I find XBMC’s interface and media Resources
streaming capabilities quite
Pros: Easy to use, eye catching
interface, media streaming • Home Page: xbmc.org
impressive. No matter what codec capabilities, lots of navigation • Wikipedia: en.wikipedia.org/wiki/
a file needs, the player is capable options, expandability. XBMC
of playing it smoothly. Playing Cons: Resource hungry, no Media
Center capabilities, no
a full HD 1080p movie on it is
support for USB 2.0 and By: Shashwat Pant
an unmatched experience—the multisession medium. No The author is a FOSS/hardware
surroundings are drenched with support for DRM files.
enthusiast who likes to review software
divine acoustics, and my family Platform: Linux, MS Windows, MacOS, and tweak his hardware for optimum
and friends are mesmerised by Apple TV, Xbox performance. He is interested in
the stunning experience the Price: Free (as in beer) Python/Qt programming and fond of
benchmarking the latest distros and
media player offers. Website: www.xbmc.org applications.
However, the player is very

www.LinuxForU.com  |  LINUX For You  |  AUGUST 2009  |  25


For U & Me  |  Preview ______________________________________________________________________________________________

Video Editing on
GNU/Linux
Did I Hear
You Say It’s
Non-existent?

If you are an amateur filmmaker with a high-definition camera, you don’t have
to worry about the secretive and suppressive world of Windows and Macs—
Kdenlive has finally arrived. It’s not perfect yet, but it’s steadily getting there.
Here is a sneak preview of all that this application has in its magic box...

A
s an amateur filmmaker, I an amateur would want. It may not be as
have always felt the lack of a perfect as its proprietary counterparts, but
powerful and trusted alternative the current release tells us much more about
to Final Cut Pro or Sony Vegas the current attitude within the GNU/Linux
on the GNU/Linux platform. There are world. Ubuntu is almost an equivalent to
many solutions, including Cinelerra, Kino, Windows and Mac for the average user;
OpenMovie, Kdenlive, etc, but none are Firefox is beating IE and Safari badly; Amarok
mature enough to match their non-free is the best music player around; VLC has no
counterparts. Also, they tend to crash competition whatsoever; then there’s the
frequently, which is unacceptable after GIMP, PidGin, Gyachee, and much more.
you’ve edited a 30-minute clip on the time GNU/Linux is like a magician’s hat—it will
line. I had stayed away from the slave world offer you whatever you ask for. Now, with
of Apple’s Mac and the monopolistic world Kdenlive, one of the missing links is being
of Microsoft Windows, but for how long? addressed too.
Then, finally, a few days back I chanced I tried creating some clips using the
up on Kdenlive again, version 0.7.5, since new version, and except for a few niceties
someone forwarded me a link. of its proprietary counterparts (which are a
This new version has made me realise must for any professional), Kdenlive did not
that Kdenlive has almost everything that disappoint at all. In fact, it impressed me

26  |  AUGUST 2009  |  LINUX For You  |  www.LinuxForU.com


____________________________________________________________________________________________________ Preview   |  For U & Me

Figure 1: Timeline

Figure 3: Render formats available

RAM and a screen size of 1024 x 768


pixels or more.
For advanced use and semi-
professional work, Kdenlive
recommends investing in a recent
computer with AMD Phenom Quad-
core processor; 4 GB of RAM; three
SATA discs for RAID-5 usage (any
Linux distribution offers RAID-5
without an additional controller), and
a recent video card with dual display.
Advanced users can stay updated
through a very active and supportive
Figure 2: Import HD content forum at www.kdenlive.org/forum/
users-forums/video-effects-and-
so much that I dropped the idea of desired AVI format so that you can transitions.
buying some creepy machine to run edit the video. Kdenlive now supports In conclusion, I’d say Kdenlive
FCP. I trust that within a couple of so many formats that you will never has now everything an amateur
years, Kdenlive will be much more have to worry (Figure 3). Once the clip wants, but to become a full-fledged
advanced and can be used ‘freely’. is rendered in the desired format, you editor there are a few more miles
The time-line of Kdenlive has can import it again and start editing. to cover—it’s just a matter of time.
improved a million times. You can Additionally, you have a rich It would be great if more users
now pull clips like you move a knife set of audio/video effects, besides could test Kdenlive and share their
through butter (Figure 1). You can transitions effects. This will enable experiences with us. 
add multiple video as well as audio you to make good quality short films
tracks. You can freely move clips without spending a penny. By Swapnil Bhartiya
from one track to another, as well Another advantage of using A Free Software fund-a-mental-ist and
as to and fro. Kdenlive supports HD Kdenlive is that you may not have to Charles Bukowski fan, Swapnil also
video, so it’s actually like taking a upgrade your machine. According to writes fiction and tries to find cracks
walk in the park to import videos the project website, it would work in a proprietary company’s ‘paper
armours’. He is a big movie buff, and
directly from my Canon VIXIA HF for you if you have a 32- or 64-bit prefers listening to music at such loud
11 (Figure 2). However, like any modern processor (AMD64 or Intel volumes that he's gone partially deaf
other software—including FCP or mono/dual core systems); a fast hard when it comes to identifying anything
Sony Vegas Pro—you can’t play HD- disc with more than 20 GB of free positive about proprietary companies.
Oh, and he is also the assistant editor
imported video smoothly; you have disc space; a Firewire interface for of EFYTimes.com.
to first transcode (render) it into the camcorder capture; at least 1 GB of

www.LinuxForU.com  |  LINUX For You  |  AUGUST 2009  |  27


For U & Me  |  Event Report _______________________________________________________________________________________

FOSJAM ’09
Ignites the Fire of Freedom in Jaipur
An introduction to Fedora, an all night hack-fest, getting to know Emacs and
developing a website within just a few minutes – the newly formed Jaipur LUG
had it all, with their very first FOSS event, FOSJAM 2009.

I
t’s just been about three months The D-Day
since the inception of the FOSJAM received more than 347 registrations
Jaipur LUG in March 2009. Yet and around 280 turned up.
the activities and workshops The event started with the ‘free software
organised by LUG-J have taken the town by song’ performed by Kapil Acharya, a LUG-J
storm. Install fests and workshops arranged member, followed by Winblows, an activity that
by the LUG members have introduced the involved bursting balloons printed with the
city to mainstream open source communities logos of you-know-what. This was a rocking
and spread the word of libre. And with its start to the event and all students soon felt the
many active members from communities like freedom wave sweeping them off their feet as
Fedora, Mozilla and WordPress, it wasn’t long they joined in the singing.
before LUG-J’s major all-India event, FOSJAM There was a brief introduction of all
(Free and Open Source Software, Jaipur Meet) the speakers at the gathering, followed by
was organised. a few words from Shakthi Kannan and a
Since it was the first FOSS-related event in vote of thanks by Jai Pandya. Then, Kannan
Rajasthan targeted at an audience still new to (shaktimaan.com) started with his talk,
the Open Source ethos, the workshops were interestingly titled, “i-want-to-do-a-project-tell-
more inclined towards hands-on sessions; me-how-2-do-it-fedora” which covered various
JECRC (Jaipur Engg College & Research Centre) aspects of netiquette (mailing lists, IRC, forum
lent a helping hand by offering their computer etiquette) and how to choose a Free and Open
labs, with Fedora running on over 90 machines. Source project.

28  |  AUGUST 2009  |  LINUX For You  |  www.LinuxForU.com


______________________________________________________________________________________________ Event Report  |  For U & Me

At the same time, there was a Kannan presented live demonstrations


session by Vivek Khurana on “How to of Fedora Electronics Lab products.
become a hacker” during the course Students from the college robotics
of which he explained the difference group, Xananoids, seemed to be highly
between the terms ‘hacker’ and motivated after the talk and discussed
‘cracker’. Another parallel discussion some future projects on which they
was moderated by Atul Jha, called, could work. It was finally time to delve
“Yes I’ll do it my way”, regarding FOSS into some basics about packaging and  Fedora 10 installations are all over
(of course!) while Deependra Singh how it is done in Fedora, with a hands- the place
Shekhawat (a security specialist) on session called, ‘RPM packaging—
spoke of open standards and their Red hot paneer butter masala.
importance, before moving on to An interesting session requested
firmware and device drivers. by several students, and which turned
out to be extremely popular, was “How
Hacking under the moonlight to make a website in less than two
After all the sessions, there was also an minutes” where Atul Jha discussed
all-night hack-fest, and more than 100 building a website using Drupal in just
people stayed back to attend it. While a few minutes. The workshop covered  A jam-packed session
there was Shakthi Kannan answering the basics like installing a Web server,
questions about Emacs, during his the basics of HTML, installing Drupal
session on “An Emacs a day keeps the and customising it according to one’s
vi-zing away”, there was also Vivek needs. In the end, everyone went
Khurana in the other lab, enlightening home with a website of their own. :-)
people on JQuery.
While I have always found Emacs The IRC session
enigmatic, many participants were very Now, this part was really cool and
impressed by it and promised to use it seemed more like a celebration
it as their default text editor for a long than a workshop. The audience  Introducing folks to open source
time to come. The JQuery hack-fest had been getting impatient to
had become more of an introductory know more about IRC because of
session since the audience didn’t seem all the buzz about it during the two
to be too well informed and Khurana days of FOSJAM and Jai Pandya
kept patiently responding to the queries did not disappoint the crowd. He
of each and every student, making full took them through a how-to on
use of the whiteboard provided, and IRC, clients like xchat and mibbit
turning into a teacher himself. and also helped students join #lug-
jaipur with mibbit.
The next day  Vivek Khurana tells you how to
Carrying forward the momentum of The closing ceremony: A new become a hacker
Day 1, Day 2 also turned out to be a beginning
grand success, despite many being tired The celebrations finally came to an
and worn out after the night before. end with Pandya tossing around
At around noon, Kannan carried the Mozilla badges, and giving away
spirit of freedom further, with his talk, Fedora DVDs and stickers. The event
“Badam halwa of embedded systems”. appropriately wound up with LUG-
Since many attendees belonged J’s guitarist, Kapil Acharya, playing
to various robotics groups in their tracks like Hotel California and
respective colleges, they were very Sayonee. There were a few random
 Time out!
interested in the topic and Kannan discussions for about half an hour
started off with the basics. It truly before the gates were finally closed.
proved to be badam-halwa for hungry It was definitely a new beginning By: Anirudh Singh Shekhawat
minds. Kannan also gave demos of for a movement that is unfolding
The author is a Fedora ambassador
some open source tools like gerbv, qucs, every day, and brought together local and developer. He is a final year student
verilog, gEDA, Tk gate, etc. FOSS enthusiasts on a common of computer science engineering. You
The next session was a Fedora platform in their mission to change can find out more about him at acedip.
blogspot.com.
Electronics Lab Demo, during which the world. 

www.LinuxForU.com  |  LINUX For You  |  AUGUST 2009  |  29


For U & Me  |  Tutorial ______________________________________________________________________________________________

GIMP for Beginners, Part 2

Understanding Layers
Welcome to the second installation of The GIMP tutorials. In this issue, we will
try to understand the most crucial part of image editing—layers. Describing
layers in words is pretty arduous.

I
nitially, working with layers combination of images forming a single
can be a bit intimidating and a image. The combination of images can either
newbie will try to avoid it. But be opaque, transparent or both, depending
once you get used to working upon the type of effects you implement.
with it, layers make editing images child’s In layman’s terms, consider an opaque
play. Of course, you need to know a few background with multiple transparent
editing tools and techniques. or opaque sheets, one over the other,
What is a layer? In general, it is a combined to form an image.
combination of materials stacked over each Figure 1 illustrates how different layer
other. But when we talk stacks combine together to form an image.
about image editing, I have created only a three-layered image,
a layer can be making it easier for you to understand.
best described The top layer is Johnny Bravo, followed by
as a a wooden border in the second and the
background in the last layer. Notice how it
looks when they are combined together.
Now, you must be wondering about
the need for all the fuss, especially when
all of this can be achieved with a single
layer itself. Well, yes, you can create
similar effects with basic editors like
KolourPaint, but when you create
an image that way, you don’t have
control over the different aspects of
it. For instance, a similar image created
using KolourPaint will not allow you
to just move Johnny Bravo’s image to any
place else. You simply cannot do it! Once
you create an image just by pasting on non-
layered parts, all the sections pasted will
be merged in the background itself, leaving
no way to edit it. So if you try to move the
‘Bravo’ part, the whole image will move
along with the background and border.
While when working with layers, you have

30  |  AUGUST 2009  |  LINUX For You  |  www.LinuxForU.com


____________________________________________________________________________________________________ Tutorial  |  For U & Me

Figure 1: Using layers to create an image

the freedom to edit, share, delete and modify as you like.


Pretty much like the FOSS idea, isn’t it?
We did learn a bit about the layer box in the previous
tutorial. For those of you who missed it, the layer box is
the third window to the left, right after the GIMP loads
up. Previously, we just had an overview of the layer box.
So in this tutorial we will get started with the details
and learn the various aspects of the layer box.
Starting from the top, the layer box has a layer
switcher. As stated earlier, this helps in switching layers
when working with multiple images. Though it is set
on ‘auto’, it means that once you click the window of Figure 2: The layer switcher in action
another image, the layer box will automatically list all
the layers involved in the selected image window, but in
case it doesn’t work, you can use this switcher to make
it work for you.
This switcher also comes in very handy while
copying a layer of an image onto another, making the
transition smoother and brisk. Figure 2 shows the
function of the layer switcher.
What follows is the most important section, in
which we will apply all the effects and styles to the layer.
Figure 3 illustrates almost all the functions of the layer
section that we need to work on.
 Layer modes: Since we have understood a bit about
layers, let’s move on to the different ways you can
set a layer in. Layer mode does away with all the Figure 3: The layer toolbox with all the options listed
frustrating methods, with just a simple drop down.
Just select a layer and set it to apply different effects.  Layer list: The middle section lists all the layers
In the ‘Bravo’ example, the layers are set in Normal added in the image. Here, you can drag, delete,
mode. You can change the mode from Normal disable/enable and even lock a layer depending on
to Overlay, and to Colour or any other pre-set, to the effect you are looking for.
provide the desired effect to your image. We will  Layer tools: Listed below are the tools used to
learn to work with them in upcoming tutorials. arrange layers:
 Opacity slider: This slide lets you set the opacity  New layer: This lets you create a new layer. You can
of the layer. You can either make the layer effects make it either opaque or transparent. It also allows
transparent, opaque or set it inbetween. Another you to fill a layer with colour. New layer has another
handy tool that helps you achieve great effects and is important function, which we shall discuss later in
just a drag away. this tutorial.

www.LinuxForU.com  |  LINUX For You  |  AUGUST 2009  |  31


For U & Me  |  Tutorial _____________________________________________________________________________________________________

notice a white/transparent or coloured section,


depending on the type of layer you have created.
Once you start creating an image, this small section
provides a preview of the effects created in the main
editing window. Though not of great use, it helps
you distinguish between layers when working with
images boasting of a huge number of layers.
 Layer eye—Enable/Disable layer: The eye that you
see in Figure 3 lets you toggle the visibility of a layer.
 Layer link: This tool locks the layer. It combines
the layer and lets you move multiple layers
simultaneously, providing precise control while
moving layers. The layer link comes in very handy at
times and helps you restore the effect to its original
state, even after moving the linked layers.
Figure 4: Working with pasted layers
 Layer mask: To the right side of the layer preview,
 Arrows: Arrows let you change the position of a there is a Layer Mask option, as shown in Figure
layer. You can move a layer above or below with 3. The Layer Mask is an add-on that you can use
the help of these arrows. However, since the GIMP as you wish. It controls the visibility of the layer.
provides you with the easy dragging and dropping of Initially the Mask is disabled, you can add it if you
layers, these arrows are actually a farce. want. If a white mask (opaque) is selected, the layer
 Duplicate layer: As the name suggests, this tool in which the mask is applied will become visible,
lets you duplicate the current selected layer with a while a black mask (transparent) will make the layer
simple click. One very handy tool for making bold transparent; even if there is image editing done on
effects. that main layer, it will not be visible, as the dark
 Anchor layer: This tool only comes into action when mask hides the drawn parts. Selecting the layer mask
you paste an image or a layer to the current active by clicking on it makes it active and after creating
image window. This lets you merge the pasted layer the mask, all the drawing done appends to the mask,
with the background layer. and not to the layer.
 Delete layer: This lets you delete an unwanted layer.
At the middle, you must have noticed some Managing layers
additional tools/sections (Figure 3). These form an Pasting/dropping layers is an essential part of editing
integral part of the Layer List section, letting you images. Whenever you paste an image in the GIMP, it
perform various effects. goes into floating transition. What this means is that
 Layer preview: On creating a layer, you will either the image pasted is not permanent yet. You can make

Figure 5: Cursor behaviour with layers

32  |  AUGUST 2009  |  LINUX For You  |  www.LinuxForU.com


____________________________________________________________________________________________________ Tutorial  |  For U & Me

it permanent either by clicking on access to all the editing options, as


a new layer or by clicking on the listed in Figure 7.
anchor layer icons. When you click  Edit Layer Attributes: This
on the new layer while the pasted option is basically the same as
layer is selected, the pasted layer layer management. Selecting it
will be assigned a new layer and will reveal a box where you can
it will be made permanent. But if enter a new name to the layer.
you click on the anchor layer, the I always default to the double-
pasted layer will be merged into the click feature as stated above.
background of the image giving you  New Layer: This option creates
little freedom for editing. Figure 4 a new layer. This is similar to the
demonstrates how pasted layers icon present in the layer box.
work.  New Layer from visible: This
Now we shall delve into moving option creates a new layer that
a layer. To get started, create a contains all the elements of the
background or open a wallpaper currently visible layers, merged
with the GIMP. Once done, grab into one.
the Text tool [A] from the toolbox  Duplicate/Anchor/Delete
and type something. Do note that Layer: These options have
whenever you try to edit/move/ similar functions to their icon
modify a layer, ensure the desired counterparts. Nothing fancy
layer is selected; else the effect will here.
be applied in the wrong section of  Merge Down: This option
the image. merges the currently selected
Select the text layer and grab the layer with the next visible layer
Move tool from the toolbox or press below. Transparency will be
‘m’. Notice the cursor change when sustained, though the active
you take it outside or inside the layer modes will be retained.
selected text layer. Figure 5 will give  Layer Boundary Size: Every
you a glimpse of the cursor change layer has its boundary, which
when taking it away or nearer the is visible when you select a
active layer region. Once you get layer, making it easier for you
the four-directional arrow key at to differentiate it from those
the foot of the cursor, left click and not selected. The size can be
while holding down the left button, increased or decreased at will.
move it wherever you want. This option does just that—you
I’m sure you’ll understand that can easily increase/decrease
layer management is very essential the size. Please note that the
if you are working with more layers. image/layer will remain intact;
It’s actually a nice habit if you get the only thing that will change is
used to it. its boundary.
The GIMP automatically gives  Layer to Image Size: All this
each layer a name so that it’s easy tool does is resize the layer
to distinguish when working with boundary to the image size.
a high number of layers, especially  Scale Layer: It is the same as
while creating wallpapers. Just resizing an image but will only
double click on a layer name and be applied to the selected layer.
you can edit the layer’s default  Add Layer Mask: This adds a
name. Figure 6 illustrates this layer mask to the selected layer.
feature. This option lets you choose the
Every layer has its own editing type of mask you want to apply
options, though some of them can on the particular layer.
be achieved easily. To gain access  Apply/Delete Layer Mask: The
to a layer’s editing options, just former appends the changes
right click on the layer and an extra done in the mask to the host
window will pop up, giving you easy layer. Delete layer mask deletes

www.LinuxForU.com  |  LINUX For You  |  AUGUST 2009  |  33


For U & Me  |  Tutorial _____________________________________________________________________________________________________

Figure 6: Managing layers


Figure 7: Layer editing options

the mask, so make sure you delete it before applying.  Flatten Image: It’s a unique case of the merge layer.
 Show Layer Mask: Lists the changes done in the It merges all the visible parts of the layer, deletes
mask applied. all the non-visible parts of the layers, removes the
 Edit Layer Mask: This option is selected by default transparency and fills it with background colour,
if you have added a layer mask. It’s nothing but a turning all the layers into one single image leaving
selection to the mask preview. You can easily switch no alpha channel behind. This is usually done when
between the layer and its mask by either using this saving an image with a JPEG extension.
option or clicking on the preview. That’s it for now. I have tried to cover almost every
 Mask to Selection: Makes an active selection to all aspect of layers —hope they’re now a bit easier to work
the editing/painting done on the mask layer. with. You don’t need to grasp these things—just go
 Add Alpha Channel: This option makes a non- through them once, fiddle around a bit and you are
transparent layer capable of handling transparency, ready to get started. The dull days are about to end, as
though it does not make it transparent. It is a very we will learn to work with tools in our next assignment.
handy tool for creating quick animation with the So stay tuned for the next tutorial and till then, happy
GIMP. GIMPin’!. 
 Alpha to Selection: This option makes an active
selection on the drawing done on layers. It makes By: Shashwat Pant
the drawing active—not the layer. So if you want to The author is a FOSS/hardware enthusiast who likes to review
edit things later on, this tool comes as a saviour. software and tweak his hardware for optimum performance.
He is interested in Python/Qt programming and fond of
 Merge Visible Layer: Merges all the active visible benchmarking the latest distros and applications.
parts of a layer, in the image.

THE COMPLETE M AGAZINE ON OPEN SOURCE


Your favourite Linux Magazine is
BETA
now on the Web, too.

LinuxForU.com
Follow us on Twitter @LinuxForYou

34  |  AUGUST 2009  |  LINUX For You  |  www.LinuxForU.com


www.LinuxForU.com  |  LINUX For You  |  AUGUST 2009  |  35
image is released under Creative Commons Attribution 2.0 Generic Licence.
For U & Me  |  Interview _ __________________________________________________________________________________________

Greg K-H is the current Linux kernel


maintainer for the -stable branch and is
well known for his contributions to the
Linux device drivers project that has
[www.flickr.com/photos/ahockley].

enabled the kernel to support the MOST


number of hardware devices, compared
to any other kernel or OS. Here we present
a quick interview with the man.
©TheAhockley

A Quick Q ‘n’ A Session with


Greg Kroah-Hartman
Q What was your first computer?
My first computer was a Radio Shack
I came in contact with the code before the
people :-) The first large gathering of open
TRS-80, Model 3. source people I met was at the first Linux
Kernel summit back in 2001. That was the

Q What was the first piece of code that you


wrote?
first time a large group of Linux kernel
developers had got together in one place. It
I learned and wrote programs in BASIC for was very good, and spawned a number of
that first machine, some of which ended projects that ended up in the kernel, as well
up being used by my parents for different as created a number of good friendships that
volunteer tasks they were involved in at still are ongoing.
the time.

Q How did you come into contact with Q What does Greg K-H do when he is not
coding :-)
the FOSS folks, and how did that Play with my kids, pull weeds from my garden,
journey start? snowboard in the winter. Normal family stuff :-)

36  |  AUGUST 2009  |  LINUX For You  |  www.LinuxForU.com


__________________________________________________________________________________________________ Interview  |  For U & Me

Q Which distribution do you use, and which desktop


environment?
I use openSUSE as my main distro, with Gentoo still on
a few server or ‘tiny’ machines I use for infrastructure. I
use SLED for testing new hardware out as part of my job.
As for the desktop environment, my laptop is now
running Moblin. Before that it was running Fluxbox. My
main desktop is running GNOME, and I have a test box
running KDE to ensure that the FACTORY branch of
openSUSE is still working properly.

Q What books and programming language(s) would you


recommend to aspiring kernel developers? Greg’s GNOME desktop
For kernel developers, C is essential—that’s all the kernel
is written in. (OK, a tiny amount of assembly is also used,
but that’s usually never touched by anyone any more.) monkey log” on the next page]; hopefully that answers
Books for kernel development include: this question sufficiently.
 Linux Kernel in a Nutshell, for how to build and
install a custom kernel. This is the place to start if
you don’t know how to do this. [It’s freely available Q We have been experiencing better driver support
on Linux as compared to competing operating
online at www.kroah.com/lkn] systems. What is the reason behind this? How different
 Linux Device Drivers, Third Edition, is a bit is the Linux driver development model compared to its
outdated, but still a good overview of Linux competitors?
drivers and how to develop them. [It’s freely The development model is very different. All drivers for
available online at lwn.net/Kernel/LDD3] Linux end up in the main kernel tree, which allows the
 Understanding the Linux Kernel is a good overall drivers to always stay up to date with the kernel, and
kernel development book, as is Linux Kernel for a lot of good optimisation and fixes to be made. It
Development, Second Edition, although both of is very powerful to be able to look at a large number
them are getting a bit out of date these days. of drivers that all do the same thing, and merge them
together into a smaller code base that is easier to

Q Is there any difference between the present


generation of developers as compared to the first?
maintain. This happens all the time in Linux, and has
turned out to work very well.
I don’t think there is any difference. We are all unique
and different people, just like everyone else :-)
Q How hard is it to convince companies to work with
the project? Theo de Raadt [Open BSD project head]

Q A lot of people point out that even Linux/free


software developers use an Apple Mac. What do
has been quite successful with Taiwanese companies in
terms of hardware support. What is your approach?
you say about that? It has been very easy to convince companies so far.
I don’t tell you what code to run, you don’t tell me We have worked with Taiwanese companies, as well
what to run, and we will all be happy. as European- and US-based companies—there is no
difference between countries.

Q What are your key areas of responsibility at


Novell? Do you work full time on the Kernel?
Q Companies like ATI and NVIDIA have still maintained
I work on the Linux Driver Project with Novell’s a distance from Linux. What is the status currently?
blessings. I’ve also been involved lately in some work to ATI hasn’t. They have released the specifications for their
get Moblin working well within openSUSE, which has hardware, which has allowed an open driver to be written.
been a lot of fun playing with a wide range of different NVIDIA has its own reasons for doing what it does. I
netbooks. All of this is related to the kernel, so I do work suggest asking them about this if you are interested.
full time on it.

Q What was the idea behind LDP (Linux Driver Q Although binary-only drivers make life easy for the
end user, in your opinion, how good are they?
Project)? How many of its goals have been They do not make life easy for end users; they make
achieved? life harder. My opinion, as well as those of a very large
You can see my longer response for this at www. number of Linux kernel contributors, was published
kroah.com/log/linux/linux_driver_project_status-2009- last year and can be seen at www.linuxfoundation.org/
06.html [reproduced as as sidebox titled “linux kernel en/Kernel_Driver_Statement.

www.LinuxForU.com  |  LINUX For You  |  AUGUST 2009  |  37


For U & Me  |  Interview ___________________________________________________________________________________________________

linux kernel monkey log


Linux Driver Project Status Report as of June 2009 providing training, this need can be met. Although I still expect myself
and other members of the LDP to continue to travel and speak about
This is a status report for the Linux Driver Project as of June 2009, this topic.
describing what has happened in the past year of work. It was
originally posted on the Linux Driver Project developer mailing list. Goal three (work in the open) has succeeded even better than I had
expected. At the Linux Kernel Summit last year, the drivers/staging/
The Linux Driver Project (LDP) is now over two years old. It sprang tree was created, allowing us a place within the main Linux kernel
up out of the complaints from some users and companies that there tree for drivers to be merged that were not yet of the high kernel
was a real “Linux driver problem”. The perception was that Linux did quality standards. This has allowed many users the ability to use their
not have good driver support, and that closed source drivers were hardware with Linux much earlier than previously possible, and it has
potentially taking over some device types. allowed a common place for the community to contribute patches
and fixes for these drivers. This has aliviated the need to hunt over the
It turns out, that almost all hardware is currently already supported on internet for various drivers.
Linux, with almost all major vendors shipping Linux drivers.
The staging tree has also provided a place for developers wishing to
So last year, I proposed the following goals: get into Linux kernel development to easily help out and start working
on code. Often times it is only the lack of knowing what to work on
1. Continue to write new drivers for any company that wishes to have that keeps many people from participating in kernel development.
them developed. These drivers are all to be released under the This portion of the kernel tree provides ample opportunities for people
GPLv2 and included in the main Linux kernel source tree hosted to help out with.
at kernel.org. Future maintenance of these drivers will be done
either by members of the original company, or by the community So, what is next for the LDP? As the previous three goals
members, depending on the wishes of the company. worked so well this past year, I propose just continuing them in
2. Continue to be a focal point for companies to learn about the the following manner:
Linux development process and become part of the kernel
community if they wish to. I hope to enlist more people to help out • We will work with any company that wishes to have Linux kernel
with this process, but if not, my airline miles logged will continue to drivers written for them, doing the work, for free, and merging the
increase. result into the mainline kernel tree.
3. Work more in an open development manner, hosting all • We will work with any company that wishes to have us work to
experimental and development code in a public git tree, getting merge their existing Linux kernel drivers into the main kernel tree.
daily testing in the linux-next tree on all architectures. • We will maintain the staging tree, containing “pre-mergable” code,
to provide a centralized point for users to use new hardware
Goal one (write drivers) has been very successful. Myself and many sooner, and for developers to be able to join the kernel community.
other members of the LDP have written new drivers for a wide range • We will work on education and training of companies and
of different hardware devices, and gotten them merged into the main developers about how the Linux kernel development process
kernel tree. Several more are currently under development and we are works, and help them achive the technical knowledge to
averaging about 2 querys a month for different drivers from different participate fully within it.
companies.
I’d first like to thank my employer, Novell, for giving me the opportunity
This work will continue to happen in the following year, as everyone to work on this project full time. Their acceptance and support for
involved seems to be happy with it. However, there will be a few the LDP is amazing and has been what has allowed it to survive and
procedural changes in how this is working, to help resolve some of produce such great results.
the issues that have occurred. For more details about this, see the
discussion on the LDP development mailing list. I’d also like to thank all of the developers who have offered to help
out with this project. Your volunteering to participate is amazing and
Goal two (educate people) has been reasonably successful. While shows the strength of the Linux developer community.
working with many companies, we have helped them become
maintainers of their own codebases within the kernel, integrating I’d also like to thank Tomasz Grzegurzko for maintaining and keeping
them into the main kernel development process, allowing themself to the linuxdriverproject.org domain and server up and running so well.
control their drivers and direction for their Linux support much easier. Also thanks to the OSU Open Source Labs for your domain and
However the need for training on how to do this kind of development, bandwidth support of the project.
and even just basic Linux kernel development skills is in very high
demand. Hopefully through the new Linux Foundation effort of posted Thu, 04 Jun 2009 in [/linux]

Q What do you say about hacks like ndiswrapper,


technically as well as legally?
usually does not work as well as a native Linux driver
does and can. 
Technically, ndiswrapper is wonderful. The ability to run a
Interview by Swapnil Bhartiya
driver written for a different operating system, on Linux, is
A Free Software fund-a-mental-ist and Charles Bukowski
a wonderful engineering achievement. I can’t say enough fan, Swapnil also writes fiction and tries to find cracks in a
good things about that hack, and I love it. Also, from a legal proprietary company’s ‘paper armours’. He is a big movie
standpoint, there is nothing wrong with it. buff, and prefers listening to music at such loud volumes that
As a long-term solution for users to rely on, that’s he's gone partially deaf when it comes to identifying anything
positive about proprietary companies. Oh, and he is also the
not a good idea, as remember, the driver was not assistant editor of EFYTimes.com.
originally written for, or even tested with, Linux. So it

38  |  AUGUST 2009  |  LINUX For You  |  www.LinuxForU.com


Developers  |  Overview _ ___________________________________________________________________________________________

Google Wave, Opera Unite, Firefox 3.5 and then Gazelle, everyone
seems to be racing to dominate the Web. What empowers them
all the more in today’s world of cloud computing and AJAX-
crazy netizens, are the latest specs of HTML 5. If you are a Web
developer worth your salt, you would not wish to miss out on
anything while the Web gets revolutionised.

Usher in a
New Era of Web with

40  |  AUGUST 2009  |  LINUX For You  |  www.LinuxForU.com


__________________________________________________________________________________________________ Overview  |  Developers

T
he Internet and its more than just a mark-up syntax for However, you can consult Table
usage are constantly documents. The very name of the 1 to figure out which of the elements
evolving. Every single language’s specifications working are already supported by today’s
day marks the launch group, Web Hypertext Application browsers.
of new and interesting ways of Technology Working Group, suggests
accessing data and interacting with how much HTML means to the Web. The latest HTML mark-up
people, pushing the boundaries of The original goal for HTML 5 was We’ll start by thinking about marking
HTML in every vertical. The current to make it easier to develop Web up a typical blog. Like the vast
version of HTML, 4.01, has been in applications. There’s evidence of this majority of sites on the Web, blogs
use for almost a decade now. Yet, the in the rash of new JavaScript APIs comprise a header, some navigation
publishers are constantly looking and support for offline development, (often a sidebar or two), a main
out for more evolved techniques to some of which are already available in content area, and a footer.
provide enhanced functionalities that a browser near you. Currently, there are no ways in
have, till now, been restrained by the HTML 4 to mark up these elements
programming languages as well as the The elements in a semantic fashion—i.e., HTML 4
browsers. So, what is this set of new ‘elements’ offers no footer or header elements
To give authors more flexibility of HTML 5 that’s making waves on of its own. Instead, they’re usually
and interoperability, and enable more the Web and elsewhere? wrapped in a generic div element,
interactive websites and applications, While there is a beautiful article a technique that is described in
HTML 5 introduces and enhances a on the Web [www.ibm.com/ the HTML 4 specification [www.
wide range of features, including form developerworks/library/x-html5], by w3.org/TR/html4/struct/global.
controls, APIs, multimedia, structure Elliotte Rusty Harold, that I would html#h-7.5.4]: “The DIV and SPAN
and semantics. strongly recommend you read for elements, in conjunction with the id
HTML 5 will be the first major a complete overview on the new and class attributes, offer a generic
change to our lingua franca since elements of HTML 5, some of the mechanism for adding structure to
XHTML 1.0 in 2000 (the latest being more important aspects that I plan to documents. These elements define
XHTML 2.0, released in 2002). You discuss in this article are: content to be inline (SPAN) or block-
must have already seen the ‘HTML  Canvas—inline SVG and MathML level (DIV), but impose no other
5 Working Draft’ [www.w3.org/  Audio interface presentational idioms on the content.
TR/html5] at the start of this year.  Video elements Thus, authors may use these elements
The W3C HTML Working Group  Offline Web applications in conjunction with style sheets, the
and WHATWG (Web Hypertext  Drag and drop lang attribute, etc, to tailor HTML to
Application Technology Working  getElementsByClassName their own needs and tastes.”
Group) have been working extra time,  Web Forms 2.0 When developing the HTML 5
trying to satisfy everyone in an open
process. Not an easy task. Sometimes,
amongst the concerns and the Compatibility structure of HTML 5 elements with today’s browsers
questions, it’s easy to forget that fact. Chrome Firefox Internet Opera Safari
A lot of us believe that the Explorer
introduction of the new specifications contentEditable Yes Yes Yes Yes Yes
is just another preposterous attempt Stylable Elements (new) Yes Yes No Yes Yes
by the bigwigs in the browser arena getElementsByClassName Yes Yes No Yes Yes
to foist what they want, onto the Cross-Document Messaging Yes Yes Yes Yes Yes
developers. But then again, there are
Web Forms 2.0 Partial No No Yes Partial
others who see it as the way forward
Drag and Drop Yes Yes Yes No Yes
to develop powerful multimedia Web
apps on an open architecture, without <audio> No 3.5 No No Yes
Flash, Silverlight or similar proprietary <video> 3.0 3.5 No Labs Yes
technologies. As Doug Schepers, the release,
W3C’s Team Contact for the SVG and partial
Web Apps Working Group says, “HTML <canvas> Yes Yes No Yes Yes
5 is not a technical achievement, it’s a Server-sent DOM Events No No No Partial No
social movement.” Client-side Storage (name/ 2.x Yes Yes No Yes
The varied opinions regarding value)
HTML 5 are because it is much Table 1 (Source: http://molly.com/html5/html5-0709.html)

www.LinuxForU.com  |  LINUX For You  |  AUGUST 2009  |  41


Developers  |  Overview _ __________________________________________________________________________________________________

author and the date published (as marking up sidebars.


well as an example of referencing the
section and article elements with <aside>
semantic class names): <h1>Archives</h1>
<ul>
<div class=”section”> <li><a href=”/2007/09/”>Sep 09</a></
<div class=”article”> li>
<div class=”header”> <li><a href=”/2007/08/”>Aug 09</a></
<h1>Page Title</h1> li>
<p>By <a href=”#”>Author</ <li><a href=”/2007/07/”>Jul 09</a></
a> on [date]</p> li>
</div> </ul>
[Article content] </aside>
Figure 1: Refurbished HTML 5 Semantics </div>
The <section> element
specs, the editor, Ian Hickson of Google, </div> The section element represents a
analysed over a billion Web pages to generic section of a document or
find out how authors were actually application, such as a chapter, for
using these elements. He discovered The <nav> element example.
that in the top 20 class names used in The nav element should contain a
the mark-up for this huge set of data, set of navigation links, either to other <section>
were classes for common requirements: pages, or fragment identifiers in the <h1>Chapter 1: The Period</h1>
footers, headers, nav, menus, content, current page. Referencing it with <p>It was the best of times, it was the
and main. semantic class names is simple: worst of times,
So the HTML 5 specs have a host it was the age of wisdom, it was the age of
of new, structural tags such as header, <div class=”nav”> foolishness,
footer, nav, article, and section, which <ul> it was the epoch of belief, it was the epoch
fit these common requirements and <li><a href=”*”>Menu item 1</a></li> of incredulity,
allow us to mark up our archetypal <li><a href=”*”>Menu item 2</a></li> it was the season of Light, it was the
blog with more meaningful elements. </ul> season of Darkness,
</div> </p>
The <header> element </section>
The header element is for page or The <aside> element
section headings. This is not to be The aside element is for content that The <figure> element
confused with a traditional masthead, is tangentially related to the content The figure element contains
which often holds just a logo mark, around it, and is typically useful for embedded media like <img> and
and should also contain one of <h1>
to <h6> in hierarchical rank. It could
also contain meta information for
that page or section of a page like
“last updated”, a version number, or
blog entry information like published
date, author, etc.
A simple example for a page
using a semantic class name that
corresponds to the HTML 5 header
might be:

<div class=”header”>
<h1>Page Title</h1>
</div>

You could include the logo mark


and other meta information within
the layer. The next example for blog Figure 2: HTML 5 is being written in two syntaxes: html and XML (Source: http://www.w3.org/QA/2008/01/
articles includes information on the html5-is-html-and-xml.html)

42  |  AUGUST 2009  |  LINUX For You  |  www.LinuxForU.com


__________________________________________________________________________________________________ Overview  |  Developers

the new elements of <audio> and you can use a ‘context’ (think about
<video>. It also contains an optional a page on a drawing pad), into which
<legend> element performing the you can issue JavaScript commands
function of a caption. Our semantic to draw anything you want. Browsers
class name version could be like can implement multiple canvas
what follows: contexts and the different APIs
provide the drawing functionality.
<div class=”figure”> Most of the major browsers
<img src=”#” alt=”*”> include the 2D canvas context
<p class=”legend”>[…]</p> capabilities—Opera, Firefox,
</div> Konqueror and Safari. In addition,
there are experimental builds of
Extensible semantics Opera that include support for a 3D
Many pages around the Web use canvas context.
micro-formats to add more structured
semantics than what’s available in The baby steps
HTML’s impoverished set of elements Creating a canvas context on your
and attributes. In this case, the values page is as simple as adding the
used for the class attribute come from <canvas> element to your HTML
agreed-upon vocabularies, sometimes document. Here’s an example:
adopted from other standards, such
as vCard, and sometimes from newly <canvas id=”CanvasID” height=”300"
minted vocabularies where no solid width=”500">
pre-existing standard exists. Show this text if the browser is not Canvas
This is a real problem that compatible
needs to be solved here. We </canvas>
need mechanisms in HTML that
clearly and unambiguously enable It is advisable to define an
developers to add richer, more element ID. This will be helpful later
meaningful semantics—not pseudo in referencing the element in the JS
semantics—to their mark-up. This is code. Moreover, the height and width
perhaps the single most pressing goal of the canvas also needs to be defined.
for the HTML 5 project. Now that you have managed
But it’s not as simple as coming to create your very first canvas,
up with a mechanism to create richer let’s shake things up a bit. To draw
semantics in HTML content: there inside your canvas, you need to use
are significant constraints on any JavaScript. First find your canvas
solution. Perhaps the biggest one is element using getElementById, then
backward compatibility. The solution initialise the context you want. Once
can’t break the millions of browsing you do that, you can start drawing
devices in use today, which will into the canvas using the available
continue to be used for years to come. commands in the context API. Let us
Any solution that isn’t backward now learn to draw a little rectangle
compatible won’t be widely adopted inside the canvas we just created.
by developers for fear of excluding
readers. // Referencing the ‘CanvasID’ element
var elem = document.getElementById(‘Canvas
Canvas—inline SVG and ID’);
MathML
The <canvas> element is another // Checking for browsers
exciting addition to the HTML 5 if (elem && elem.getContext) {
specifications, second only to <video> // You can only initialize one context per
(which will be discussed later in the element.
article). HTML 5 Canvas gives you an var context = elem.getContext(‘2d’);
easy and powerful way to draw using if (context) {
JavaScript. For each canvas element // Here comes the rectangle, now. Remember

www.LinuxForU.com  |  LINUX For You  |  AUGUST 2009  |  43


Developers  |  Overview _ __________________________________________________________________________________________________

Optional attributes of the <video> tag


Attribute Value Description
autoplay true | false If true, then the audio will start playing as soon as it is ready
controls true | false If true, the user is shown some controls, such as a play button.
end numeric value Defines where in the audio stream the player should stop playing. As default, the
audio is played to the end.
height pixels Sets the height of the video player
loopend numeric value Defines where in the audio stream the loop should stop, before jumping to the start
of the loop. Default is the end attribute’s values
loopstart numeric value Defines where in the audio stream the loop should start. Default is the start at-
tribute’s values
playcount numeric value Defines how many times the audio clip should be played. Default is 1.
poster url The URL of an image to show before the video is ready
src url The URL of the audio to play
start numeric value Defines where in the audio stream the player should start playing. As default, the
audio starts playing at the beginning.
width pixels Sets the width of the video player
Table 2 (Source: http://www.w3schools.com/tags/html5_video.asp)

to mention the X and Y co-ordinates — then the Exciting opportunities with HTML standard. Although HTML
width and height Canvas 5 is still in the draft stage, several of
context.fillRect(0, 0, 3000, 250); The drawImage method allows you to its features have already been widely
} insert other images (img and Canvas adopted by browsers like Firefox,
} elements) into your Canvas context. Safari and Chrome. Among the most
In Opera you can also draw SVG compelling is the ‘video’ element,
Borders and key-strokes images inside your canvas. <canvas> which has the potential to free Web
Now, the rectangle can be made allows pixel-based manipulation as video from its plug-in prison and
a bit more exciting by using the well. The 2D Context API provides make video content a native first-
fillStyle and strokeStyle properties. you three methods that help you class citizen on the Web—if codec
The rectangle can also be filled with draw pixel-by-pixel: createImageData, disagreements don’t stand in the way.
a certain colour using the fillrect getImageData, and putImageData. Video is one of the most
element. Here’s an example: Moreover, the fillStyle and significant areas where this trend will
strokeStyle properties can also have have a major impact. Some of the
context.fillStyle = ‘#00f’; CanvasGradient objects assigned giants of Internet video are exploring
context.strokeStyle = ‘#f00’; to them, instead of CSS ‘colour’ standards-based solutions as means
context.lineWidth = 4; strings—these allow you to use colour to break free from the constraints
gradients to colour your lines and fills imposed by proprietary browser plug-
// a few more rectangles instead of solid colours. ins. During the Google I/O conference
context.fillRect (0, 0, 150, 50); For a few demonstrations of the in the middle of July, the search giant
context.strokeRect(0, 60, 150, 50); capabilities of the canvas element, demonstrated a YouTube mock-up
context.clearRect (30, 25, 90, 60); you can visit the following URLs: built with HTML 5. In addition to
context.strokeRect(30, 25, 90, 60);  http://code.google.com/p/ using the HTML 5 video element,
paintweb it also uses new HTML structural
 http://www.blobsallad.se/ elements and other features
 http://www.benjoffe.com/code/ introduced in the upcoming version
demos/canvascape/ of the standard. The demonstration
illustrates how open technologies can
Video elements be used to deliver a high-quality user
The increasingly competitive experience to stream video playback.
browser market has at last created For content providers like
an environment in which emerging YouTube and DailyMotion, the HTML
Web standards can flourish. One 5 video element offers numerous
of the harbingers of the open Web advantages. It integrates seamlessly
renaissance is HTML 5, the next with conventional HTML content and
Figure 2: A demo of HTML 5 Canvas major version of the W3C’s ubiquitous can be manipulated with JavaScript

44  |  AUGUST 2009  |  LINUX For You  |  www.LinuxForU.com


__________________________________________________________________________________________________ Overview  |  Developers

H.264 compression algorithms and decoding that makes Theora on


other software methods needed to mobiles technically possible and
implement the codec. In order to working well. If Apple is satisfied on
use the format, adopters have to pay the legal aspects and jumps on board,
licensing fees to MPEG LA. that changes the game. I think Google
is mostly ambivalent since it supports
Debates over patents on video both right now. Opera doesn’t want
codecs H.264 anyway. IE 8 can likely be
Patent encumbrance is one of the handled by a plug-in. Apple really is
driving forces behind the HTML the deciding factor. So, Theora seems
Figure 3: This is how a video looks after embedding 5 video codec controversy. The to be, pretty much, the future.
it within <video> tags
patent licensing requirements mean
that H.264 codecs can’t be freely Audio interface
and CSS. This enables Web developers redistributed, making the format It is just as simple to embed audio
to build video player interfaces that a non-starter for Mozilla and most into a page using the audio element.
are more consistent with the rest of other open source browser vendors. Most of the attributes are common
their website. The ability to control Opera also objects, saying that the between the video and audio
playback with JavaScript allows licensing fees are too high. Mozilla elements, although for obvious
video to be a more native part of the and Opera strongly advocate Ogg reasons, the audio element lacks the
user experience in interactive Web Theora as an alternative because its width, height, and poster attributes.
applications. freedom from known patents could
This has given way to an ensure that there are no licensing <audio src=”audio.oga” controls>
absolutely dedicated HTML tag called barriers that prevent ubiquitous <a href=”audio.oga”>get the track</a>
<video>. The <video> tag defines adoption. </audio>
video, such as a movie clip or other Apple objects to Ogg Theora,
video streams. All one needs to do is claiming that the lack of known HTML 5 provides the source
embed a URL to a video file and the patents on Theora doesn’t rule out element to specify alternative video
video gets embedded into the page, the threat of submarine patents that and audio files that the browser
all by itself. The various attributes could eventually be used against may choose from, based on its
available for the <video> tags are adopters. Apple is also concerned media type or codec support. The
reproduced in Table 2. about the lack of widespread media attribute can be used to
support for hardware-based Theora specify a media query for selection
Explaining Ogg Theora and decoding, a factor that diminishes the based on the device limitations and
H.264 codecs format’s viability on mobile devices. the type attribute for specifying the
Ogg Theora is an open format that Google shares Apple’s scepticism media type and codecs. Note that
is thought to be unencumbered about the potential of Theora in the when using the source elements, the
by patents. The primary reference marketplace. The search giant claims src attribute needs to be omitted
implementation is distributed under that Theora’s lack of quality relative from the parent video or audio
an open source licence and is being to H.264 will make it an impractical element, or the alternatives given by
developed by the non-profit Xiph. choice for large-scale streaming video the source elements will be ignored.
org with funding from Mozilla. Ogg services such as YouTube. (For the
is strongly preferred by the FOSS complete e-mail sent by Ian Hickon, <video poster=”VidPost.jpg”>
community because it can be freely visit http://lists.whatwg.org/htdig. <source src=”vid.3gp” type=”video/3gpp”
redistributed without requiring cgi/whatwg-whatwg.org/2009- media=”handheld”>
licensing fees. June/020620.html) <source src=”vid.ogv” type=”video/ogg;
H.264 is a high-performance A solution that seems logical on codecs=theora, vorbis”>
codec that is maintained by the ISO/ the surface is to simply expose each <source src=”vid.mp4" type=”video/mp4">
IEC Moving Picture Experts Group platform’s underlying media playback </video>
(MPEG) as part of the MPEG-4 family. engine through the HTML 5 video <audio>
It is emerging as the dominant codec element—DirectShow on Windows, <source src=”audio.oga” type=”audio/ogg”>
for both streaming video and optical GStreamer on Linux, and QTKit <source src=”audio.mp3" type=”audio/mpeg”>
media, as it is said to deliver the visual on Mac OS X. This would make it </audio>
quality of MPEG-2 (used on DVDs) at possible for the browser to play any
roughly half the bit-rate. The MPEG video formats that are supported For authors who want a little more
LA consortium manages licensing natively on the user’s computer. control over the user interface so that
of the underlying patents that cover Now, there’s a push for hardware they can make it fit the overall design

www.LinuxForU.com  |  LINUX For You  |  AUGUST 2009  |  45


Developers  |  Overview _ __________________________________________________________________________________________________

of the Web page, the extensive API  drag – The mouse has moved, return false;
provides several methods and events with the dragged element as the })
to let scripts control the playback of event target. .bind(‘dragleave’, function(ev) {
the media. The simplest methods to  dragenter – The dragged element $(ev.target).removeClass(‘dragover’);
use are the play(), pause(), and setting has been moved into a drop return false;
currentTime to rewind to the beginning. listener, with the drop listener })
element as the event target. .bind(‘dragover’, function(ev) {
Drag and drop  dragover – The dragged element return false;
Drag and drop is one of the most has been moved over a drop })
fundamental interactions afforded listener, with the drop listener .bind(‘drop’, function(ev) {
by graphical user interfaces. In element as the event target. Since var dt = ev.originalEvent.
one gesture, it allows users to pair the default behaviour is to cancel dataTransfer;
the selection of an object with drops, returning false or calling alert(dt.getData(‘Text’));
the execution of an action, often preventDefault() in the event return false;
including a second object in the handler indicates that a drop is });
operation. It’s a simple yet powerful allowed here. });
UI concept used to support copying,  dragleave – The dragged element </script>
list reordering, deletion (a la the has been moved out of a drop
Trash/Wastebin), and even the listener, with the drop listener Since a detailed explanation of
creation of link relationships. element as the event target. the features and demonstrations is
Since it’s so fundamental, offering  drop – The dragged element has out of the scope of this article, you
drag-and-drop in Web applications been successfully dropped on can always refer to a lot of interesting
has been a no-brainer ever since a drop listener, with the drop content on:
browsers first offered mouse events listener element as the event  https://developer.mozilla.org/En/
in DHTML (Dynamic HTML). But, target. DragDrop/Drag_and_Drop
although mousedown, mousemove,  dragend – A drag has been ended,  http://decafbad.com/
and mouseup made it possible, the successfully or not, with the blog/2009/07/15/html5-drag-and-
implementation has been limited to dragged element as the event drop
the bounds of the browser window. target.  http://ljouanneau.com/lab/html5/
Additionally, since these events refer For a detailed list and for demodragdrop.html
only to the object being dragged, explanations, read www.whatwg.org/
there’s a challenge to find the subject specs/web-apps/current-work/#dnd. Last, but definitely not
of the drop when the interaction is Consider the following example of the least
completed. jQuery: If you fancy getting more involved,
Of course, that doesn’t prevent there’s still time—try using HTML
most modern JavaScript frameworks <div id=”newschool”> 5 and give your feedback to
from abstracting away most of the <div class=”dragme”>Drag me!</div> the specification group via the
problems and throwing in some <div class=”drophere”>Drop here!</div> WHATWG mailing lists [www.
flourishes while they’re at it. But, </div> whatwg.org/mailing-list]. The editor,
wouldn’t it be nice if browsers offered Ian Hickson, has put out a call
first-class support for drag-and-drop, <script type=”text/javascript”> for people to review the specs—
and maybe even extended it beyond $(document).ready(function() { looking for confusing items, typos,
the window sandbox? $(‘#newschool .dragme’) and other small problems. If you
As it turns out, this very .attr(‘draggable’, ‘true’) find one, you’ll be mentioned in the
wish is answered by the HTML .bind(‘dragstart’, function(ev) { acknowledgements. There’s plenty
5 specification section on new var dt = ev.originalEvent. to do, so dive in! 
drag-and-drop events, and Firefox dataTransfer;
3.5 includes an implementation of dt.setData(“Text”, “Dropped in zone!”);
those events. return true; By: Sayantan Pal
}) An avid Twitter user and a social media
enthusiast, the author is a passionate
The latest events .bind(‘dragend’, function(ev) {
blogger and a professional gamer
The latest drag and drop events return false; too. He also feels compelled to be
specified for HTML 5 are: }); opinionated about anything that comes
 dragstart – A drag has been $(‘#newschool .drophere’) his way, be it Linux distributions, our
marketing strategies, table etiquettes or
initiated, with the dragged .bind(‘dragenter’, function(ev) {
even the fabled Ramsay movies!
element as the event target. $(ev.target).addClass(‘dragover’);

46  |  AUGUST 2009  |  LINUX For You  |  www.LinuxForU.com


_______________________________________________________________________________________________ How To  |  Developers

Portlet
Development
With Liferay
Here’s a tutorial on developing JSR-286 portlets for the Liferay platform.

P
ortlets are small applications that Liferay
are rendered in the larger context After a small evaluation of different Portal
of a portal. When you view any of servers, I shortlisted Liferay. Here is a list of
the popular portals like Yahoo! or the winning points:
Rediff, you see the home page organised into  Support for the latest standards and
small boxes displaying mail, news, photos, specifications
advertisements and other details. These  Various innovations in the UI layer
boxes are called portlets. To develop portlets,  An extensive set of pre-build ready-to-
there are various competing (and sometimes deploy portlets
cooperating) technologies: Google Gadgets;  A good community
Microsoft Sharepoint Portal; and in the  Open development
world of Java, we have two specifications
-- JSR-286 and JSR-168 -- that govern Liferay installation
Portlet development. JSR-286 supersedes The only prerequisite to install Liferay is
JSR-168, and is mostly compatible with its that you should have the Java Development
predecessor. JSR-286 is sometimes called Kit in your system. Liferay downloads
the Portlet 2.0 specification. The are conveniently packaged with various
portlet specification is similar to application servers and servlet containers.
the Java Servlet specification. Download the one that you are comfortable
Understanding the servlet API with, and extract it. The installation is then
would shorten the process of complete. The extracted directory will be
learning Portlet technology. called LIFERAY_DIR hereafter.

Portlet containers
Portlet containers house the Prerequisites
deployed portlets and render them in Software prerequisites
the context of the portal. There are various 1. JDK 1.6
portlet containers in the market. WebLogic 2. Maven 2.1
Portal and WebSphere Portal are popular 3. Liferay 5.2
proprietary portal servers. In the
Knowledge prerequisites
open source space, we have Liferay
A working knowledge of the following technologies will
[www.liferay.com], JBoss Portal
be helpful:
[www.jboss.org/jbossportal],
1. Servlets
OpenPortal [portal.dev.java.
2. JSP
net], Pluto [portals.apache.
3. JSTL and EL
org/pluto] and others.

www.LinuxForU.com  |  LINUX For You  |  AUGUST 2009  |  47


Developers  |  How To ______________________________________________________________________________________________________

Writing the first JSR-286 portlet


Let us start with the ubiquitous example, writing
the Hello World portlet. The code is available in
liferaybook.googlecode.com.
Before we jump into coding, let’s set up the
project environment. My preferred build and
dependency management environment is Maven.
Using this, we will create a new project (use
mvn archetype:generate). Choose a normal WAR
project (option 18 in the menu). For our example,
I have given com.liferabook, hello-world and com.
liferaybook as the groupId, artifactId and the
package, respectively. To the generated pom.xml, Figure 1: Default Liferay page
add the following dependencies:
Similarities of portlet APIs with servlet APIs
<dependency> Servlet API Portlet API
<groupId>javax.portlet</groupId>
javax.servlet.http.HttpServlet javax.portlet.GenericPortlet
<artifactId>portlet-api</artifactId>
javax.servlet.http.HttpServlet. javax.portlet.GenericPort-
<version>2.0</version>
doGet() let.doView()
<scope>provided</scope>
javax.servlet.ServletException javax.portlet.PortletExcep-
</dependency>
tion
<dependency>
javax.servlet.http.HttpServle- javax.portlet.RenderRe-
<groupId>javax.servlet</groupId> tRequest quest
<artifactId>jstl</artifactId> javax.servlet.http.HttpServle- javax.portlet.RenderRe-
<version>1.2</version> tResponse sponse
</dependency> javax.servlet.RequestDis- javax.portlet.Portle-
patcher tRequestDispatcher
Now create your first portlet class: Table 1

package com.liferaybook; Coming back to our code, in the doView() method,


we first set the request attribute message with the String
import java.io.IOException; “Hello World!”, then call RequestDispatcher to include the
import javax.portlet.GenericPortlet; index.jsp.
import javax.portlet.PortletException; Note, in the Maven structure, you have to place
import javax.portlet.RenderRequest; the above code as src/main/java/com/liferaybook/
import javax.portlet.RenderResponse; HelloWorldPortlet.java.
The index.jsp page:
public class HelloWorldPortlet extends GenericPortlet {
<p>${requestScope.message}</p>
@Override
protected void doView(RenderRequest request, RenderResponse Using the Unified Expression Language (EL), we print
response) the message request attribute set in the HelloWorldPortlet
throws PortletException, IOException { class. Note that in the JSPs you need not have the
request.setAttribute(“message”, “Hello World!”); <html><head><body> elements defined. This is because
getPortletContext().getRequestDispatcher(“/index.jsp”). your portlet is rendered as a box inside the portal’s theme.
include(request, response); The JSPs are placed in the project location: src/main/
} webapp/
A couple of more configurations need to be written
} before we can deploy our brand new portlet. These are
portlet.xml and web.xml.
The code should be understandable to any The following is what portlet.xml looks like:
servlet programmer. The similarities with the
servlet API are listed in Table 1. Note that these <?xml version=”1.0” encoding=”UTF-8”?>
similarities are based on API usage; they cannot <portlet-app
correspond one-to-one in the functional or xmlns=”http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd”
operational level. version=”2.0”

48  |  AUGUST 2009  |  LINUX For You  |  www.LinuxForU.com


_____________________________________________________________________________________________________ How To  |  Developers

Figure 4: Our portlet deployed in Liferay

schemaLocation=”http://java.sun.com/xml/ns/ self-explanatory. The web.xml is an


portlet/portlet-app_2_0.xsd empty XML with no content. This is
http://java.sun.com/xml/ns/portlet/ required, because we are using EL,
portlet-app_2_0.xsd”> and this web.xml specifies the Web
app specification to version 2.5, where
<portlet> EL can be used inside JSP.
<description>Hello World Portlet</ Place both portlet.xml and web.
description> xml in the project path: src/main/
<portlet-name>hello-world-portlet</portlet- webapp/WEB-INF/.
name> Build the portlet using the mvn
<display-name>Hello World Portlet</display- package command. This will generate
Figure 2: Liferay admin menu for adding portlet name> hello-world.war in your target directory.
application
<portlet-class>com.liferaybook. This is your ready-to-deploy portlet war.
HelloWorldPortlet</portlet-class>
<supports> Portlet deployment in Liferay
<mime-type>text/html</mime-type> Start the Liferay server, then copy
<portlet-mode>VIEW</portlet-mode> the hello-world.war to the LIFERAY_
</supports> DIR/deploy/ directory. Monitor your
<portlet-info> application server log for successful
<title>Hello World Portlet</title> deployment. Once it is deployed, visit
<short-title>Hello World Portlet</short-title> the URL: http://localhost:8080/
</portlet-info> You will be able to view the
</portlet> default Liferay Portal page [Figure 1].
On to the right, you will see the link
</portlet-app> “Login as bruno”. Click this to log in as
the portal administrator. Click on the
Shown below is what web.xml menu Welcome Bruno Admin! (top-
looks like: right of the screen) and select Add
Application [Figure 2]. This will open
<?xml version=”1.0” encoding=”UTF-8”?> the Add Application panel. Under the
<web-app xmlns=”http://java.sun.com/xml/ns/ Undefined category, you will find the
javaee” deployed portlet [Figure 3]. Just drag
xmlns:xsi=”http://www.w3.org/2001/ and drop it in the screen to deploy
XMLSchema-instance” your portlet [Figure 4].
xsi:schemaLocation=”http://java.sun.com/xml/ So we have successfully developed
ns/javaee http://java.sun.com/xml/ns/javaee/web- a small “Hello World” application for
app_2_5.xsd” deployment in the Liferay Portlet
version=”2.5”> Container. In forthcoming articles in
</web-app> this series, we will discuss some more
advanced concepts of the portlet
The portlet.xml code should be specification. 

By. Subhash Chandran


Figure 3: Add application panel
The author is a software developer working in the innovation department of the Chennai-
based software firm, Sella Synergy India Ltd. He has been contributing to various
xmlns:xsi=”http:// xsi:
OpenSource projects, and publishes his contributions at his site WizTools.org. He also
www.w3.org/2001/ maintains a technical blog at indiWiz.com. He may be contacted at: [email protected].
XMLSchema-instance”

www.LinuxForU.com  |  LINUX For You  |  AUGUST 2009  |  49


Developers  |  How To _______________________________________________________________________________________________

Introducing
JQuery
Selectors
Rich Internet Applications (RIA) are created by manipulating the Document
Object Model (DOM) elements in various ways. Before working on DOM
elements we need to have an efficient and easy way to identify and select the
elements required. The JQuery library provides different options to identify an
element. The power of JQuery is that it allows us, users of the library, to write
our own selectors.

A
ll selectors will start with a $ look and feel for an element, it should be
symbol and the selector string associated with a class. JQuery provides ways
is placed within (“). Note that to select elements based on this class. For
$ is just a short form of JQuery. example, when we need to associate a click
All selectors will return an array of elements operation with all the elements that have a
that satisfy the condition. An element in the class .button, then…
array can be indexed as a JavaScript array or
by using “get”, the JQuery utility method. For $(‘.button’).click(function() {
example, to get the first DOM element in the console.log(“Element with class button is
page, we can use both $(‘*’)[0] and $(‘*’).get(0). clicked”);
});
Basic selectors
The most efficient way of selecting an $(‘*’) is used to select all the DOM
element is by using the ID of that element. elements in a page.
JQuery, in turn, uses the native method, We can combine different selectors
getElementById(). For example, to get an together using the comma. The resulting
element with the ID msg, the selector should array will contain all the elements that
be $(‘#msg’). satisfy any of the condition(s) passed. For the
An element can be selected using its following selector query:
type. To select the entire span element in a
page, we can use $(‘span’). For an appealing $(‘#msgdiv , .msgdiv’)

50  |  AUGUST 2009  |  LINUX For You  |  www.LinuxForU.com


_____________________________________________________________________________________________________ How To  |  Developers

...the resulting array will contain elements that have


their class set to msgdiv or an element that has an ID equal
to msgdiv. The same set of elements can also be matched
using the JQuery function add().

$(‘#msgdiv’).add(‘.msgdiv’)

Form selectors
Form selectors help us to select an element based on its
type. Though the same result could be achieved using
Figure 1: Hierarchy selectors
an attribute selector (as we will see), the form selector
provides a shorter way. As an example, :button will select
all the <input type=”button”> elements. Table 1 lists all form checked’) will select the radio buttons that are selected by
selectors. the user.

Form selectors Hierarchy selectors


Selector Function Examples These selectors are used to select elements based on their
positions with respect to other elements. There are four
:hidden, :text, : To select all the cor- $(‘:hidden’), will
password, : responding <type> select all the hid-
ways, using which we will be able to select an element
checkbox, :im- elements, <input den elements based on its hierarchy in the DOM. Let’s look at the HTML
age, :file, :submit, type=<type> > snippet example shown in Figure 1 to explain hierarchy
:reset, :radio selectors. Table 3 lists hierarchy selectors.
:input To select all the input $(‘:input’)
elements like text Hierarchy selectors
area
Selector Function Examples (as per
:button Will select all the the HTML snippet in
button elements Figure 1)
that include <input
$(parent To select all the child $(‘#upperul li’) will
type=”button”>, <in-
child) elements that are select all the four li(s).
put type=”submit”>
under the specified Two directly under UL
& <input
parent. The child can and two under innerul.
type=”reset”>
be directly under the
Table 1
parent or can also be
the grand child of the
Form filters also help us in making a selection based on
parent
the state of a particular element, like enabled, selected, etc,
$(parent > To select all the child $(‘#upperul > li’) will
as shown in Table 2. child) elements that are select only the first
‘directly’ under the two li elements. Since
Form filters specified parent the next two li ele-
Filter Function Examples ments are not directly
under #upperul
:enabled All elements in an $(‘:enabled’)
$(previous ~ To select all the $(‘:text ~ :button’)
enabled state
next) next elements (only will select both the
:disabled All elements that $(‘:disabled’) siblings) that are after buttons
are in a disabled the previous element
state
$(previous + To select all the $(‘:text + :button’) will
:checked Radio buttons and $(‘:checked’) to select all next) next (only siblings) select only the first
check boxes that the radio buttons/check elements that are button element
are checked boxes that are selected placed ‘immediately’
by the user after the previous
:selected Option elements $("select option: element
that are selected selected") will find the Table 3
currently selected option
Table 2
Filters
Filters are used to select a subset of elements from a
The power of form selectors can be understood when set of elements. These filters are extremely useful when
two or more of them are combined. For example, $(‘:radio: combined with the selectors that we have seen previously.

www.LinuxForU.com  |  LINUX For You  |  AUGUST 2009  |  51


Developers  |  How To ______________________________________________________________________________________________________

Basic filters Visibility filters and their functions


These filters are useful when we need to select an element Filter Function Examples
based on its position in the returned array. We have already
:visibleAll elements that are not $(‘:visible’) to select all
seen some ways to do this—for example get(n) and [n] will selected as part of the : the elements that are
give the nth element from the returned set. But get(n) or [n] hidden filter visible
can’t be used in the chaining of functions. Filters (that we :hidden All elements that are $(‘:hidden’) to select all
are going to discuss) will return a JQuery object that can be hidden either by the the elements that are
used in chaining, like $(‘:button:first’).addClass(“chained”). type or through CSS hidden
In our zebra table example, seen in the last article Table 5
[published in the May 2009 issue of LFY] we have given
different colours to every other row in a table. The same Child filters
can be achieved using the odd or even selector. tr:odd These filters are used to select an element based on its
will select every other odd element on a page, whereas tr: position with respect to its containing element, known as
even will select every other even element on a page. In the parent. When we need to select the first rows from all
our zebra table example, we have used “$(“.lfy tr:even”). the available tables in a page, we can use $(‘tr:first-child’). To
addClass(“alt”);” to select every even row under the table make this selector work on a particular element (table), we
that has class lfy and added a class alt to them. Table 4 need to prepend the selector with that element. For example,
summarises the list of basic filters and their functions with $(‘#tableid tr:first-child’) will select the first row from the table
an example. with ID tableid. As we saw in basic filters, here too we have the
nth child (number/odd/even). For example, $(‘#tableid td:nth-
Basic filters and their functions child(odd)’) will select all the odd columns from the page.
Filter Function Examples We can use the :only-child selector to select the element
that is the ONLY child for its parent.
:first To select the first $(‘:button:first’) will return
element on the the first button element in
<html xmlns=”http://www.w3.org/1999/xhtml” xml:lang=”en”>
matched set the page
<div></div>
:last To select the last $(‘:button:first’) will return
element on the the last button element in <div>

matched set the page <div><span>MySpan1</span><button>MyButton1</button></div>

:even To select the even $(‘#timetable tr:even’) se- <div><span>MySpan2</span></div>


elements on the lect all the even rows under </div>
matched set table with id timetable </html>
:odd To select the odd $(‘#timetable tr:odd’) se-
elements on the lect all the odd rows under In the above HTML snippet, $(‘span:only-child’) will
matched set table with id timetable select the span with value MySpan2. Table 6 gives the
:lt(n) To select the ele- $(‘*:lt(2)’) will return the first complete list of child selectors with their usage patterns.
ments that are be- 2 elements
fore the nth position,
excluding n Child selectors and their usage patterns
:gt(n) To select the ele- $(‘*:gt(5)’) will return all the Filter Function Examples
ments that are after elements except the first 5 parent>child All children of the $(‘table>tr’), matches
the nth position parent all the table rows
excluding n :first-child To select any ele- $(‘#tableid tr:first-
:eq(n) To select the ele- $(‘:eq(5)’) will return the 5 ment that is the first child’), matches the
ment in the given elements child for its parent first row from the table
nth position with ID tableid
Table 4
:last-child To select all the ele- $(‘#tableid tr:last-
ments that are the child’), matches all
Visibility filters last children for its that’s in the last row
These filters are used to select elements based on their parents from the table with ID
visibility in the page. An element can be in a visible tableid
or hidden state. For example, to select all the visible :nth-child(n/ To select a par- $(‘table td:odd’) to
odd/even) ticular row using select all the odd
elements in a page, we can use $(‘:visible’). $(‘:hidden’)
its position within columns from all the
will select all the hidden elements in a page. If we the parent. Can be available tables
analyse the previous selector syntaxes, we would know group-based and
that, by default, all filters will take $(‘*’) as a matched be odd or even
set when none is explicitly mentioned. Table 5 lists the Table 6
visibility filters and their functions.

52  |  AUGUST 2009  |  LINUX For You  |  www.LinuxForU.com


_____________________________________________________________________________________________________ How To  |  Developers

Attribute filters Content filters


Attribute filters are used to select elements based on Content filters are used to select elements based on what
the attribute values. For example, the text box <input the element contains. For example, :contains(text) helps us
type=”text” name=”dummyTextBox” value=”Dummy to select elements that contain the given text. To explain
TextBox” /> can be selected in the following way: ‘content filter’, let’s take the HTML snippet shown in Figure 2.
Table 8 lists the various content filters and their functions.
Attribute filters
Filter Function Examples Content filters
= Equal to $(‘:input[name=dummyTextBox]’), Filter Function Examples
matches the input element that has :con- To select all the ele- $(‘td:contains(Read)’), will
the name equal to dummyTextBox tains ments that have the select the second column
!= Not equal to $(‘:input[name!=someothername]’), (text) text specified. Case from the first two rows.
matches all the input elements that sensitive searches $(‘td:contains(read)’) won’t
don’t have name attributes or name will be made select any element
attributes of value other than :has(p) To select all the $(‘table:has(td)’), this will
someothername elements that satisfy select only the second
*= Contains $(‘:input[name*=dummyTextBox]’), the selector criteria table
matches all the elements that con- passed
tain dummyTextBox in the value of a :empty To select all the ele- $(‘table:empty’), will
name attribute ments that have no select the first table. It’s
^= Starts with $(‘:input[name^=dummyTextBox]’), children not that this also includes
matches all elements whose name text node; it means $(‘td:
attribute value starts with dummy- empty’) will select all
TextBox columns that don’t have
$= Ends with $(‘:input[name$=dummyTextBox]’), any value
matches all elements whose name :parent To select all ele- $(‘table:parent’), will select
attribute value ends with dummy- ments that have the second table
TextBox child nodes
Table 7 Table 8

www.LinuxForU.com  |  LINUX For You  |  AUGUST 2009  |  53


Developers  |  How To ______________________________________________________________________________________________________

added as part of the previous command from the


wrapped set, then we can use end(). For example:

$(‘:image’).add(‘:text’).addClass(‘inputandtextclass’).end().
add(‘imageclass’)

In the above case, the inputandtextclass class is applied


to both image and text elements, whereas imageclass class
will be applied to the image elements only.
We use find(expression) to select elements that
match the given criteria and also the descendants
Figure 2: Content filters of the already selected element set. We use
filter(expression) to select elements that match the
Note that if content filters are made to filter on * then given criteria from the given set.
they will select the complete DOM, even if only one DOM
element satisfies. For example, $(‘table:has(td)’).size() will be 1, <div>
but $(‘:has(td)’) will be of size 7 (in the above fragment) since <button value=”Check”>Check</button>
it selects all the above tr(s), the body and HTML too. </div>

Not selectors In the above HTML snippet, to select the button using:
We have looked at a good number of selectors till  find, use $(‘div’).find(‘:button’). This will search for
now. In certain scenarios, when we need a function buttons under div element.
that will negate the available functionality, the :not  filter, use $(‘div :button’).filter(‘:button’). This will
selector comes to the rescue. As we know, we can use search for the button element in the first wrapped
$(‘checkbox:checked’) to get all the check boxes that set, which has both div and button.
are selected. But how about getting the check boxes Although we have equivalent selectors $(‘div
that are not selected by the user? It’s simple! We need button’) and $(‘:button’,$(‘div’)), respectively, find and
to use :not in front as $(‘checkbox:not(‘checked’)). filter will be more useful in chaining.
JQuery selectors and filters have made the selection
Selector commands  of a DOM element easier. It is always better to use the ID
There are a set of JQuery commands/functions that selector since JQuery uses the browser native method
can be used to select an element. We know that every getElementByID(). So in any case, the ID selector is much
JQuery selector will return an array of elements. To faster than other selectors. Moreover, it’s always better to
get a particular element out of the array, we can use cache the result of selectors. The cached results can be
get(number). So $(‘:button’).get(0) is equivalent to $(‘: used (if the DOM element is not updated dynamically) for
button:first’). The inverse of get is index, which is used to future purposes, thereby making the response faster. To
find the position of an element in an array of elements. practice the above concepts, click on the following link:
Considering a page that has only one submit, element codylindley.com/jqueryselectors. 
$(‘*’).index($(‘:submit’)[0]) will return the position of the
submit button in the complete DOM. When we need to By: Lakshmi Narayanan N and Veerabahu
select all input elements that are either of type radio or Subramanian C
check box then we can use any one of the following: $(‘: The authors work at HCL Technologies Ltd, Chennai. Lakshmi
radio,:checkbox’) or $(‘:radio’).add(‘:checkbox’). Following blogs at grabyourfreedom.blogspot.com and you can contact
which, the add(JQuery expression) will add the result to him at [email protected]. Veerabahu blogs
at veechand.wordpress.com and you can contact him at
the wrapped set.
[email protected].
When we need to remove the element that is

A Portal For Technologists And Technopreneurs

54  |  AUGUST 2009  |  LINUX For You  |  www.LinuxForU.com


Industry News
Intel, Nokia to create futuristic mobile devices
Further integrating the Internet with mobile phones and computers, Intel Hello India!: A FOSS
and Nokia have announced a long-term relationship to develop a new class of campaign
Intel-based mobile computing device and chipset architecture. This is slated to Openbravo, a developer of Web-
combine the performance of powerful computers with high-bandwidth mobile based open source ERP and
broadband communications and ubiquitous Internet connectivity. Point of Sale (POS) solutions
To realise this shared vision, both companies are expanding their long- for businesses, has launched
standing relationship to define a new mobile Hello India!—a campaign
platform beyond today’s smartphones, notebooks accommodating the growing
and netbooks, enabling the development of a variety appeal for open source software
of hardware, software and mobile Internet services. in the country. The campaign
Taking advantage of each company’s expertise, these will include various initiatives,
futuristic standards-based devices will combine the beginning with the 360º business
best features of the computing and communication tour, followed by Openbravo
worlds. It promises a user experience involving training courses, amongst others.
incredible mobile applications and always on, To kick off the Hello India!
always connected wireless Internet access in a user- campaign, Openbravo teams will
friendly pocketable form factor, say sources from the be visiting Kolkata, Hyderabad,
partnership. Gurgaon, Chennai and Mumbai in
Intel will acquire a Nokia HSPA/3G modem IP August as part of its 360º Business
licence for use in future products. The effort includes Tour, which aims to recruit many
technology development and cooperation in several new business partners. The event
open source software initiatives in order to develop targets systems integrators, ISVs
common technologies for use in the Moblin and and VARs with knowledge of the
Maemo platform projects, which will deliver Linux-based operating systems for mid-market ERP sector. During the
the upcoming mobile computing devices. tour’s morning sessions, attendees
The companies are coordinating their open source technology selection will discover the growing
and development investments, including alignment on a range of key open opportunities in the open source
source technologies for mobile computing such as: oFono, ConnMan, Mozilla, landscape, especially with regards
X.Org, BlueZ, D-BUS, Tracker, GStreamer and PulseAudio. Collectively, these to implementing Openbravo’s
technologies will provide an open source standards-based means to deliver a professional products.
wealth of mobile Internet and communication experiences, with rich graphics Cees Poortman, vice president,
and multimedia capabilities. global commercial operations,
said, “Openbravo has been gaining
Linux Box celebrates 10th anniversary traction in India for some time now,
The Linux Box, a professional services organisation specialising in open source which has escalated to a point where
technology, is marking its 10th anniversary by adding custom software products we need to recruit new partners to
to its suite of services. Founded in 1999, the Ann Arbor-based company satisfy the demand for our solutions.
customises open source projects for blue chip clients such as Any serious service company in
McKesson, Harvard Management Company, Borders Group, the space should understand the
FedEx and Answers.com. The Linux Box says it currently benefits of partnering with the
provides professional, commercial services for companies company behind the most successful
looking to gain competitive advantage, reduce IT costs open source ERP, especially in a
and increase the control they have over their open source booming market for such solutions.
technologies. The 360º Business Tour is an
“We have productised our business as a direct response opportunity for any company looking
to customer need,” said Elizabeth Ziph, co-founder and chief to either start, expand or enhance
executive officer, The Linux Box. “We’ve leveraged the intellectual capital an open source business practice
gained over the years through client consultation and software integration in to realise the potential in working
order to create custom solutions. Not only does it satisfy a need voiced by our around Openbravo.”
customers, it fills a void in the marketplace.”

www.LinuxForU.com  |  LINUX For You  |  AUGUST 2009  |  55


Industry News
Linux on the mainframe voted as an attractive choice
Large enterprises continue to step up their investments in Linux on the mainframe Sun stockholders approve
in order to deliver more value to the business, while controlling IT costs, according Oracle merger agreement
to a recent global study of large enterprises commissioned by CA, Sun Microsystems has
an independent IT management software company. The study announced that at a special
surveyed 100 IT executives and managers at companies with at meeting of stockholders held on
least $2 billion in annual revenue, about their use of the Linux OS July 16, 2009, its stockholders
on IBM mainframes. Ninety-three per cent of the respondents adopted the merger agreement
projected that their use of IBM’s IFL (Integrated Facility for Linux) entered into with Oracle
speciality mainframe processor would increase or at least remain Corporation, under which Oracle
steady over the course of the next two years. Forty-two per cent will acquire Sun common stock
projected that their use of the IFL would grow between 21 per cent for $9.50 per share in cash.
and 40 per cent, and 10 per cent projected that it would grow more Approximately 62 per cent of
than 76 per cent. Sun’s stock owners voted in
The two main reasons cited for this increased Linux usage on favour of the agreement. The
the mainframe were the desire to take advantage of the computing transaction remains subject
capacity available on their mainframe’s central processors and/or to regulatory approvals and
IFLs, and their assessment that using Linux on the mainframe other closing conditions. For
would be more cost-effective than other platforms. Respondents more information regarding the
also said they were using Linux on the mainframe to support ‘green’ proposed transaction, please visit
computing initiatives and infrastructure consolidation strategies. www.sun.com/oracle.
Survey respondents were also asked to rate specific aspects of Linux on the
mainframe as challenges or advantages. Four aspects were rated as strongly MS releases GPL drivers?
advantageous: backup, restore and disaster recovery; the ability to scale to many Microsoft has released 20,000
virtual machines; security; and availability of applications. Of these, scalability lines of device driver code to the
received the strongest rating overall. CA provides a set of solutions to help manage Linux community under the GPL.
and secure z/VM and Linux environments on IBM’s System z platform. The code, which includes three
Linux device drivers, has been
Dell working on Android pocket device submitted to the Linux kernel
Dell is reportedly working on a pocket-sized Internet device that would run on community for inclusion in the
Google’s Android operating system. Fashioned after Apple’s iPod Touch, Dell’s Linux tree. The drivers will be
unnamed gadget has been in development since last year, according to a media available to the Linux community
report. The Wall Street Journal said, “Two people who saw early prototypes and MS customers alike, and
described the device as slightly larger than Apple Inc’s iPod Touch, which is are supposed to enhance the
similar to the iPhone but does not have cell phone performance of Linux when
capabilities. Another person who was briefed on virtualised on Windows Server
the company’s plans said Dell may begin selling the 2008 Hyper-V or Windows Server
device later this year, though this source said the 2008 R2 Hyper-V.
plan could be delayed or scrapped entirely.”
Dell may use chips based on designs licensed from ARM Holdings PLC, people Another MS patent deal
familiar with the company’s plans told the paper. The company does not currently Microsoft and Melco Holdings,
make any devices that use ARM-based chips. the parent company of Buffalo
In March this year, speaking at Computerworld in Tokyo, Dell CEO, Michael Inc and the Buffalo Group
Dell confirmed these rumours. “It is true that we are exploring smaller-screen (Melco Group), have entered
devices,” he said. “We don’t have any announcements to share today, but stay into an agreement that
tuned as when we have new news, we will share that with you.” Dell also said, will provide Melco Group’s
“We already have agreements with many mobile carriers around netbook devices, customers with patent coverage
so it wouldn’t be unreasonable to expect that we would have smaller mobile for their use of technologies
Internet devices or smartphones in the future.” The Texas-based company is also running Linux and other related
rumoured to be working on several Android-based smartphones that it plans to open source software.
start selling later this year.

56  |  AUGUST 2009  |  LINUX For You  |  www.LinuxForU.com


Industry News
Adobe, HTC bring Flash platform to Android
Adobe Systems and HTC have announced that the new HTC Hero is the first Google image search gets
Android phone to ship with support for Adobe Flash Platform Creative Commons filter
technology. The new phone delivers a more complete Web Let’s say you’re a blogger. You’ve
browsing experience and provides access to a broad variety of just returned from a trip to New
Flash technology-based content available on the Web today. York city, and you’re writing a post
“As the first Android device with Flash, the new HTC on the landmarks. You want to
Hero represents a key milestone for Android and the Flash illustrate your travel guide with an
Platform. With close to 80 per cent of all videos online image—since, as the saying goes, a
delivered with Adobe Flash technology, consumers want to picture is worth a thousand words.
access rich Web content on-the-go,” said David Wadhwani, It’s easy to find images of New York
vice president and general manager, Platform Business online. But you want to make sure
Unit at Adobe. “The collaboration with HTC offers people that you don’t use images without
a more complete Flash-based Web browsing experience the permission of their owners, and
today and presents an important step towards full Web you can’t afford licensing fees for
browsing with Flash Player 10 on mobile phones in the professional photographers. Well,
future.” Google’s image search can help
Users can now browse and discover a broad solve your problem. Google has
set of Web content and applications not supported launched a new
by mobile phones in the past. They can also view feature on image
YouTube videos using Flash technology, and enable full search to help
screen viewing mode by simply double-tapping the screen. you find images
that you can
“India yet to explore full potential of Digium and Asterisk” use for free, while respecting the
Drishti Soft, a provider of communications solutions, has launched the Digium wishes of artists and creators.
India portal. According to the company, Digium is the innovative force behind This feature allows you to
the world’s most widely used open source telephony platform Asterisk. The restrict your search results to
Digium India website would provide features, synonymous with Digium, to images that have been tagged with
enterprises in the Indian region. This portal hosts useful licences like Creative Commons,
tools to facilitate faster data fetching related to Digium making it easier to discover images
Cards or Switchvox equipment. from across the Web that you
On the launch, Ankur Sharma, vice president, can share, use and even modify.
marketing, Drishti Soft, said, “Businesses in India Your search will also include
are yet to explore the full potential of Digium works that have been tagged with
and Asterisk. Having a dedicated portal with other licences, like GNU Free
country specific collaboration in a market like Documentation licence, or are in
India will help Digium strengthen its presence. This portal would not only the public domain.
provide Digium users with relevant information, but also serve as a platform Google says, “This feature
for collaboration.” Digium India is also a knowledge base for Asterisk in which identifies images that are tagged
application developers and solution providers can collaborate and share their with licences that authorise reuse.
ideas. Sharma further added, “The idea is to bridge the gap between authorised You’ll still have to verify that the
resellers and Digium users in the country.” licensing information is accurate.
We can help you take the first step
Mailspect selects open source Sphinx towards finding these images,
Mailspect Inc has selected Sphinx as the search and retrieval engine for MPP, but we can’t guarantee that the
the Message Processing Platform. Sphinx is an open source project founded and content we linked to is actually
maintained by Andrew Aksyonoff of Voronezh, Russia. It was designed from in the public domain, or available
the ground up to integrate with SQL databases and scripting languages. “We under the licence.” Go to images.
chose Sphinx because it scaled and e-mail archives can grow over time into google.com/advanced_image_
huge repositories of data,” said Ovidiu Bivolaru, chief MPP engineer. “Customer search to enable this feature.
feedback about the technology has been outstanding.”

www.LinuxForU.com  |  LINUX For You  |  AUGUST 2009  |  57


Players  |  Success Story _____________________________________________________________________________________________

And You’re Saying There’s

No Money
in the FOSS Business
Strange… because we’ve captured the story of DeepRoot Linux, which speaks otherwise.

H
e is a developer like you, loves Taking off
GNU/Linux, but his passion Initially, DeepRoot Linux focused on
didn’t stop there. He decided providing network-attached storage
to work full-time on free and solutions that were approximately 25 times
open source software. He scouted around cheaper than its competitors. Later, they
for like-minded people and translated shifted focus to DeepOfix, DeepRoot’s
their combined passion into developing office server product, which was shipped
products and services around open source. along with the hardware and fulfilled office
Meet Abhas Abhinav, who, in August 2000, requirements.
founded DeepRoot Linux, a Bangalore-
based GNU/Linux free software business, Stormy weather
to quench his passion to work on free Like any other start-up, DeepRoot Linux
and open source software (FOSS) and to too faced a lot of initial turbulence. There
develop an entire ecosystem of products, were problems in getting funds for product
solutions and support around FOSS. development, in forming the team, and in
“When we were about to start, although striking the first few deals.
a whole ecosystem of open source software
was available, good software alone didn’t Financial hiccups: A story of wrong
result in people adopting FOSS in their daily priorities
lives. We saw a gap between existing great Initially, DeepRoot Linux had poor sales
software and people being able to use it. and cash flows, too, weren’t positive.
There was a need for products, solutions and The firm had no venture capital funding.
support around FOSS, for people to adopt it. Further, the team made the mistake
This need became the purpose of DeepRoot’s of focusing on product development
existence,” says Abhas. With a small team of over services around Linux. Product
three employees, Abhas started DeepRoot development demanded more funds and
right after his graduation, as he already had time; besides, the product was dependant
some part-time experience in consulting for on support services for its success. This
ISPs and Web service providers. added to the firm’s financial woes, as

58  |  AUGUST 2009  |  LINUX For You  |  www.LinuxForU.com


___________________________________________________________________________________________________ Success Story  |  Players

costs incurred were high with little or no returns. “We systems. We integrated LCD modules in it like the ones
spent a lot of time and money developing our products, you see in PCO machines with keypads, etc. This caught
but didn’t spend enough time developing the services the eye of the Hyderabad-based company, which wanted
around Linux essential for returns from the products we the same for their products. We built the entire software
developed,” says Abhas, with regret. and hardware for their product. Alongside, we released
the software developed as FOSS,” says Abhas.
Team building. An early hurdle The first services client was a company specialising
Apart from financial obstacles, DeepRoot had other in developing embedded software, called software for
problems. “Developing a team of product developers ‘controller area network’ (CANs), for cars. “The firm
was a challenge, as very few had the vision to develop used Linux in its office. We provided file services,
products, nor could they dedicate themselves full-time domain authentication, BNP, e-mail, a firewall, and
towards developing FOSS solutions,” says Abhas. proxy services,” reports Abhas.

Clear skies at last Lessons learnt


The early bumpy rides of the company became smooth During the initial phases, DeepRoot learnt that selling
after it struck a few deals. The flexibility possible due FOSS solutions by talking of Linux alone wouldn’t work
to a young and fresh team, with radical marketing as a business strategy. People needed holistic workable
strategies, helped the team win orders. “Striking our solutions around GNU/Linux. “We realised that the
first deal was a challenge and we got it by participating only way to sell Linux was by selling a complete Linux
in the IT.Com Convention. Though we didn’t have a package—products addressing the customer’s concern
product to showcase, we set up a stall and distributed with readily available services and support,” said Abhas.
brochures of DeepRoot. This participation got us DeepRoot used hardware resellers, systems integrators
attention and also our first few orders for developing and distribution chains to push this complete package.
products, services and localisation. In 2001, we again
took part in the convention and continued such DeepRoot today
marketing activities to let people know about us, Fast forwarding to the present, DeepRoot has come
our solutions and services. This helped us build our a long way from its infancy. It has developed a
business in the initial stages,” Abhas recalls. revenue-generating business model and offers a range
Meanwhile, the inexperience of the team seemed of solutions and services around Linux, catering
to be a boon rather than a bane for DeepRoot. The to multiple sectors, namely education, aerospace,
young team members were more flexible, displaying healthcare, insurance, manufacturing, cement, iron
tremendous fervour to sell products. “The lack of and steel, garment exports, non-profit organisations,
experience resulted in no preconceived notions about newspapers/publications, software services,
the client’s acceptance of a new solution provider. We semiconductors, government and defence, BPO,
placed no limitations on what we could or ought to do. financial services, Web hosting, ISP and retail.
This openness helped us keep up the enthusiasm when The solutions the company provides include
trying to sell, ultimately resulting in closing deals.” distributed e-mail, unified authentication, thin client
solutions, directory services, link management, file
The first handshakes serving and storage solutions, request tracking and
DeepRoot’s first client was an ISP in Hyderabad run helpdesks, firewalls and VPNs, mail server clusters,
by a seasoned businessman. “Back then, we developed proxy servers, etc. The solutions are built on the
server appliances that had to be plugged in to run the deepofix mail server and powered by Debian GNU/

“FOSS has tremendous business


opportunities as first, many sectors like
SMEs cannot afford proprietary software
and second, a lot of the software problems
in India are very local.”
—Abhas Abhinav

www.LinuxForU.com  |  LINUX For You  |  AUGUST 2009  |  59


Players  |  Success Story ____________________________________________________________________________________________________

Linux. DeepRoot’s Web-based software uses the Perl and Factsheet


Catalyst Web framework while the systems software is a Established August 2000
mix of C, Perl and Bash. Founder Abhas Abhinav
HR head/ Shivanand V Edrami
Sound business strategy operations head
DeepRoot has a strong business model based on No of employees 25
charging for the services it provides. “If anything goes
Website http://start.deeproot.in
wrong with your free software, we’ll fix it, regardless of
whether we developed it or not—but for a price. The Address DeepRoot Linux Pvt. Ltd.
#93/4, First Floor, Nandidurga Road,
revenue generated by selling our services around Linux
Bengaluru - 560 046 INDIA
has made us profitable for the last four years. Today, we
Phone +91.80.40890000
have around 400 such regular customers,” says Abhas.
To successfully implement this business strategy
and ensure that awareness translates into adoption, the
company focuses on marketing and strong advocacy. we chose the free software business route, as a
“We now have a dedicated team for sales and marketing. business we had a greater ability to take risks and
We also actively advocate FOSS via content, campaigns, lower experimentation costs. Decision making and
etc, because awareness alone will transform this sellers’ addressing problems was also easier and faster as the
market into a buyers’ market.” developer community would come out with solutions
that were beyond the reach of the DeepRoot team,”
The hurdles says Abhas, who believes a lot more of the business
Though DeepRoot has been able to arrive at a profitable opportunities around free software still need to be
business model, timely payments from clients and explored by entrepreneurs.
procuring funding from banks for future projects still Talking about the business potential of FOSS, he
remain a challenge. says, “FOSS has tremendous business opportunities
Nevertheless, DeepRoot has overcome its initial as first, many sectors like SMEs cannot afford
challenge of developing a team. “Today, we no longer have proprietary software and second, a lot of the software
a talent crunch as we have found developers committed to problems in India are very local. They are related to
working on free software,” says Abhas, who will again be on the way we run businesses in India and thus, need
the hunt for talent when DeepRoot expands its business. locally-developed solutions. We see FOSS solutions
and services for the Indian consumer as a hot area
DeepRoot—the route to promising careers for us, or any entrepreneur looking at free software
DeepRoot Linux provides long-term and full-time business. If you can address the local problem, you
careers to developers, and believes that such software are sure to rise.”
businesses offer promising career opportunities. But But explore the area with caution, advises Abhas.
what skillsets do they look for? “Knowledge and a long- “Focus on building FOSS products and not Web
term commitment to free software is all that is needed services because, although the returns are better now,
to pursue a full-time career in free software,” says Abhas. services around FOSS products are more promising in
Advising developers looking for a full-time career the long run. Second, don’t hold back software. Release
in free software, Abhas suggests two options: “Many it as fast as possible as it is in everyone’s interest—
companies do use free software in their products specially in the interest of your business.”
without announcing it. Such companies can be
a gateway to free software job opportunities for The path ahead
developers. Further, companies still unaware of the Looking ahead, Abhas says, “Our next line of products
potential of FOSS can also provide a challenging and will be a direct challenge to software-as-a-service,
long-term opportunity for free software developers. which locks in the customer. We hope to offer SaaS-
They can become the agents for change—to go beyond like services using FOSS and then deliver them on to
just preaching the values of FOSS and come up with local networks.” Alongside, DeepRoot aims to remain
actual free software solutions for enabling the business.” committed to solving problems, especially with regard
Whatever the route to a career in free software, Abhas to Indian businesses. 
believes one has to remain committed to FOSS and
embrace more people into the FOSS community.
By: Vanisha Joseph
The author loves to experiment and writing for LINUX For You
FOSS business opportunities abound is her latest experiment. So, beware! Just a minute, she also
DeepRoot has shown the business opportunities that happens to be a journalist during the day.
free software offers for an entrepreneur. “Because

60  |  AUGUST 2009  |  LINUX For You  |  www.LinuxForU.com


_______________________________________________________________________________________________________ Review  |  Admin

CentOS
A Blue Feather In Your Red Hat
While everyone else seems to be in a race for the latest and the greatest,
CentOS 5.3 still bundles pretty old and tested software. Well, this is not your
typical desktop OS; besides, the stability makes it a must-have for your server
deployments.

W
hat do you do when you Now what if I were to tell you that you
want to run an enterprise can get a copy of RHEL, with community
grade server but don’t have support, for use on unlimited servers for an
any money to spare for the unlimited amount of time — all for free! Yes,
software? You use free software. Not free as in it’s called CentOS, and it’s supposed to be the
freedom (Windows Servers cannot be called best free Enterprise Linux out there.
enterprise grade, so all available enterprise This is what Wikipedia has to say:
grade server operating systems are freedom “Red Hat Enterprise Linux is a commercial
software), but free, as in cost. product, available only through a paid
Let’s take the money out of this. If money subscription service that provides access
were no issue, you’d buy a subscription for to software updates and varying levels of
Red Hat Enterprise Linux. You’d get a copy of technical support. The product is largely
RHEL 5.3 and some technical support, and composed of software packages distributed
you’d be entitled to upgrades to RHEL. under open source licenses, and the source
Bring money back into the equation code for those packages is made public by
and you’ll think again. A basic subscription Red Hat.”
for RHEL with two server sockets will set It’s this source code that makes
you back about Rs 23,380 per year. That’s a Community Enterprise Operating System
basic subscription, meant for SMEs and it’s possible. CentOS builds this source code in
expensive. The most expensive subscription such a way that the final product is an almost
is about Rs 1,67,140 per year. exact clone of RHEL. It’s binary compatible

www.LinuxForU.com  |  LINUX For You  |  AUGUST 2009  |  61


Admin  |  Review _____________________________________________________________________________________________________________

with RHEL, to the extent that updates for RHEL can be Installation
used in CentOS and vice versa. If you’re running CentOS,
you’re running RHEL. CentOS installs using Anaconda, one of the most modular Linux
There are a few key differences between RHEL and installers out there. It has a GUI mode as well as a text mode.
CentOS. Red Hat uses proprietary software for systems At the boot prompt, type in the following:
management, including the infamous up2date, which • linux text vga=792 for a 1024x768 text mode installer
is used to download system updates from the Red Hat • linux resolution=1024x768 for a 1024x768 GUI installer
Update Network. CentOS replaces all the proprietary The choice you make here reverberates throughout the
parts of the OS with open source components. Up2date installation. A text mode installation will disable automatic X start-
is replaced with YUM (YellowDog Updater, Modified), up at system start, will not provide a graphical boot with RHGB, and
the same tool used in Fedora, and CentOS uses YUM all system config tools installed (including the firstboot manager)
repositories for updates and software installation. will be CLI-based. On the other hand, a GUI installation will make X
So what features does CentOS offer? run at start-up, install GUI versions of system config tools and will
1. It’s free of cost, and has community support. It’s binary enable RHGB for a graphical boot.
compatible with Red Hat Enterprise Linux.
2. It’s rock solid — suitable for use in servers, clusters and
workstations, as well as desktops and laptops.
3. It has integrated virtualisation support with a Xen
kernel.
4. Included are tools for clustering and storage clustering.
5. The ability to run as just another desktop OS with all
standard desktop features.
So let’s get started with the review.

Test bed
A copy of Sun xVM VirtualBox 3.0.2 runs on Fedora 11’s
PAE kernel on an Intel Core2Duo E7200 processor (2.53
GHz and without VT). The VM has 1 GB of RAM.

First impressions
Figure 1: Anaconda installer
Before version 5.3, I’d used a customised version of CentOS
5.1. The first thing that struck me, from the installer itself,
was the new Artwork stack. The CentOS developers have The server within
outdone themselves in this sphere, where it’s normally Jokes apart, let’s come in to what CentOS actually is
accepted that all servers should look ugly. Speaking — a server operating system. Right from installation,
of installation, it’s the same old Anaconda at version CentOS is optimised for server functions. The
11.1.2.168, with all the usual options. Check the installation ‘Recommended Partitioning Scheme’ involves creating
box for details. a separate /boot partition, and puts all the other
partitions into an LVM. Pretty cool, because ‘Dynamic
The desktop Storage Scalability’ (whatever that may be) is a big
In CentOS, you can choose between KDE 3.5.4 and GNOME thing in servers.
2.16.0. Though I prefer neither, for stability and familiarity’s At the Web stable, Apache version 2.2.3-22 heads
sake, I chose GNOME for the review. Visually, nothing has the stack, with PHP at version 5.1.6. I have had bad
changed; it’s the same old icons, the same old pointers and experiences with that PHP version; it would not
the same old GNOME. Something that could have been done let me run RoundCube Webmail on it. MySQL and
was to add more shortcuts to administration tools. The new PostgreSQL are at versions 5.0.45 and 8.1.11. There
wallpaper, however, is refreshing. you have it, your LAMP or LAPP stack. Personally,
The kernel version stands at 2.6.18-125.2.1.el5. I’ve got nothing against this except the old PHP. PHP
Throughout a major version of CentOS and RHEL (such as 5.2.10 and 5.3 SRPMs (Source RPMs) for CentOS are
5.x), the versions of software cannot change. So, because available at http://www.clfsrpm.net/php/. You’ll need
CentOS 5.0 came out with KDE 3.5.4 (and kernel 2.6.18), all to build them. You’ll also need to have the EPEL
minor versions of CentOS 5 have to carry those versions repositories added.
of software. No cosmetic fixes are provided. Updates When it comes to FTP, VSFTPD 2.0.5 just doesn’t cut
are necessary bug fixes or security fixes only. Therefore, it. It isn’t as popular as ProFTPD, and people say it’s not
OpenOffice stands at version 2.3, The GIMP at version 2.2, as easy to configure. I say, ditch it and install ProFTPD,
GCC at version 4.1.2, etc. So laugh out loud. which is available in the RPMForge repos.

62  |  AUGUST 2009  |  LINUX For You  |  www.LinuxForU.com


____________________________________________________________________________________________________________ Review  |  Admin

Figure 3: Numerous server software that are available


Figure 2: Version 5.3 sports a revamped wallpaper
OpenLDAP, Amanda-server, DHCP, DHCPv6, Quagga,
Note: Any CentOS user should have at least the Privoxy, etc. There are GUI tools to manage servers,
RPMFusion, RPMForge and EPEL repos added. Lots available from System -> Administration -> Server
of software is available in these repos that not only make Settings. These GUI tools make life for sysadmins a lot
our lives easier, but are also necessary for some tasks. easier. However, they do cut out some functionality,
leaving no option but to manually edit files to change
As for a LDAP server, CentOS includes CentOS advanced settings.
Directory Server version 8.1.0. CentOS-DS is just a Last but not the least, at the e-mail section, Dovecot
rebranded copy of Fedora Directory Server, so anyone is used as the default IMAP and POP3 daemon, but even
with experience in FDS or Red Hat DS would have though Postfix is included, Sendmail is still used as the
absolutely no trouble using CentOS-DS. default MTA. It’s just a matter of removing Sendmail
Now, let’s come to virtualisation. CentOS includes and installing Postfix, though.
Xen and QEMU. I was surprised to see something like
KVM absent. Looks like KVM is in the Extras repository. Issues while running natively
I didn’t install it, because my CPU doesn’t support VT. My PC has an nVidia nForce Networking Controller.
Virtualisation is provided by QEMU and Xen. CentOS 5.3 refuses to work with it. To resolve this issue,
Though management is a completely different matter. manually download the latest kmod-forcedeth package
It is provided by some tool called Virt-Manager. from the updates repo and install it, then run modprobe
Accessible from Applications -> System Tools -> forcedeth. Instant fix.
Virtual Machine Manager, this tool has somewhat Another issue is that since NTFS is broken in the
revolutionised virtualisation on Linux. It first made its kernel, it is not provided and you have to install ntfs-3g
mainstream appearance in Fedora 10. This tool follows from RPMForge. Even after installing it, drives are not
a connection-based architecture. You open up this tool recognised in the GNOME and KDE virtual filesystems
and connect to one or several machines and choose and have to be mounted and browsed, manually.
your Hypervisor of choice. It currently supports Xen, We have better-looking and more expensive
KVM and QEMU, so you’re covered unless you are a enterprise Linux options with more up-to-date software,
VirtualBox fanatic like me. but nothing beats CentOS. It’s free, and it’s so very
Once you are connected to a machine, you create modular that you can use it as your home OS with all
a new VM on it, using a wizard. Because it can use multimedia codecs and 3D effects, and without any
QEMU as a backend, in fully-virtualised mode, you server software. It’s so stable that only a power cut can
can have i686, x86_64, ppc, sparc, mips and mipsel bring it down. CentOS is just not something that can be
as architectures. Of course, in para-virtualised mode, laughed at. It might well be the world’s best freebie out
you can only use your host arch. All other options are there. 
standard to what you would expect from VirtualBox. It’s
a very powerful tool. I say stick with it. By: Boudhayan Gupta
The other software are pretty typical. For DNS, a The author is a 15-year-old student studying in Class 9. He
CHROOTed BIND 9.3.4 is installed. A ‘Legacy Servers’ is a logician (as opposed to a magician), a great supporter of
group includes servers for Telnet, BootParamD, XinetD, Free Software and loves hacking Linux. Other than that, he is
RARPD, RSH, RUsers, RWho, Talk and TFTP. The an experienced programmer in BASIC and can also program in
C++, Python and Assembly (NASM Syntax).
Network Servers group includes, amongst other things,

www.LinuxForU.com  |  LINUX For You  |  AUGUST 2009  |  63


Admin  |  Overview _____________________________________________________________________________________________________

It’s Time to
Kill E-mail Spam, for Free!
While there are numerous proprietary e-mail security solutions around, how
many actually manage to live up to their claims? And who says that customer
service and satisfaction never come free? LFY tries its best to search out a
solution that addresses these concerns.

W
ith the ever-increasing checks, selective grey-listing, sender address/
popularity of the Internet and domain validation, recipient address/domain
electronic messaging systems, validation, in-house proprietary blacklist
there has been an increase checks, content checks to achieve efficiency.
in the need for e-mail security systems too. It can support up to 20,000 users per domain
Whether you are a small organisation or and also supports the same number of users
have thousands of employees and have an for a sub-domain.
e-mail server for your domain, you always
need to spend a lot on fighting spam and Easy to set up
viruses. SAFENTRIX provides a hosted and Setting up the solution is very simple and
free e-mail security solution that keeps spam, does not require too much of technical
virus and malware off your network, while expertise. It can be configured by anyone
ensuring that genuine e-mails always get who has some knowledge of DNS, MX and A
through. SAFENTRIX achieves its goal by records. Neither does it require any changes
using a combination of popular open source in your current infrastructure and integrates
tools, other than the anti-spam database. seamlessly with the existing system. Also, it
SAFENTRIX, while claiming 100 per cent is compatible with all modern e-mail servers,
virus protection and over 99 per cent spam including (but not limited to):
protection, can save up to 40 per cent of your 1. Microsoft Exchange Server
e-mail bandwidth costs. And it’s available 2. Lotus Notes
in two flavours. The standard service is 3. Qmail
absolutely free, for any number of users, 4. Postfix
with no compromise on e-mail security. The 5. Sendmail
premium service offers additional peace of Apart from this, it supports all hosted
mind through compliance with industry e-mail services like Yahoo!, Gmail and others
standards (HIPAA, GLB) and a 100 per cent that provide POP/IMAP services.
service level agreement warranty. SAFENTRIX can be installed and
SAFENTRIX uses seven different layers configured in three simple steps:
of spam protection to give you a spam and 1. Register and create accounts using an
virus-free inbox. It uses IP checks, HELO automated process at http://safentrix.com.

64  |  AUGUST 2009  |  LINUX For You  |  www.LinuxForU.com


_________________________________________________________________________________________________________ Overview  |  Admin

Figure 1: Login screen for SAFENTRIX control panel Figure 2: Panel to add all the e-mail IDs that need to be filtered

2. Add domains, corresponding delivery records and SAFENTRIX, the response showed a maximum of one or
user names. two spams per e-mail account. We also tried to send an
3. Change MX records for domains. e-mail with a virus infected file attached but the system
The configuration is simple, yet has live chat support that rejected the mail. We felt it passed all the tests.
can be accessed even if you are configuring it as a free service.
Where is the ‘Spam’ folder?
Security and reliability Yes, this is what sets SAFENTRIX apart from other e-mail
SAFENTRIX has secured communications with its high security software. There is no spam/quarantine folder to
grade encryption (AES 256 bit) CAPTCHA check at keep a constant watch on. This is the result of the product
every step: it thwarts automated attacks; sends e-mail team’s efforts to reduce the responsibilities of the systems
notifications on password attacks; and ensures account administrator. The idea is that every time an e-mail gets
access is tied to the IP address for additional protection, blocked by the software, the senders get a bounce-back
besides other multiple layers of security. These include e-mail informing them about the rejection, along with a
host-based firewalls, application security layer and strong unique white-list key that can later be used to white-list
encryption that protect e-mails while in transit. that particular sender’s e-mail ID.
Having the system always up is achieved through
multiple redundant e-mail servers that ensure your Our verdict
e-mails are always received and delivered. SAFENTRIX There aren’t many e-mail security solutions around that
uses cloud computing to ensure that server problems can provide such efficient spam and virus filtering, along with
be overridden in 10 minutes or less. The system always live chat with the support team, for absolutely no cost. The
sends a bounce message when it rejects an e-mail (even if only downside seems to be that every time someone sends
it contains a virus). This allows senders to take corrective you an e-mail, two lines of their text advertisement get
action as and when required and resend the e-mail. It can appended at the end of the e-mail, which one always has
store your e-mails for up to six hours in case the e-mail the option to delete, while replying back, in case one isn’t
server MX is down. Over all, the use of SAFENTRIX can be too keen to ‘spread the love’.
considered secure and reliable. However, not everybody might be comfortable with the
idea of not having a spam folder to check up if any genuine
A mock set-up e-mails got mistakenly trashed. But then, everyone had
We tried SAFENTRIX on one of our domains. It took us wanted to kill Google too, when it introduced labels and
around 15 minutes to configure the entire system. The did away with folders.
configuration is really simple and instructions on the So, all in all, SAFENTRIX actually looks like a useful
screen are easy enough to understand. Though it provides product to get your hands on. How it will manage to start
live chat support to configure your domain, we do not earning the moolah despite dishing out so many freebies is
think that would be required, at least during the initial what remains to be seen. 
configuration. Our test domain has 50 users that used to
get around 125 spams per user per day after deactivating By: Niraj Sahay
our existing anti-spam solution. When we checked up with The author is a Sys Admin at EFY Group and part of LFY team.
all the users a day after implementing the free solution of

www.LinuxForU.com  |  LINUX For You  |  AUGUST 2009  |  65


Open Gurus  |  How To _______________________________________________________________________________________________

Create Multi-boot Discs


In this guide we will look at how to pack seven distros into one CD.

E
verybody likes to use, test and hack numbered sections. Follow Phase I through to
with mini distros, but no one likes Phase IV; then to make a live CD, follow Phase
to burn a separate CD for each V. Alternately, to create a live USB drive, follow
since a distro only takes up a small Phase VI, then continue serially.
fraction of the CD space. This results in low At all times keep two terminals open—one
resource utilisation and increases junk. What if as the normal user, and another with super-
we could keep all the distros on one single CD user privileges. In both the terminals, always
or even all the distros on one USB drive, and remain fixed inside a working directory, the
boot the distros directly from there through work_dir/. We will either point directories/
an interactive menu system? Yes, that’s what files relative to ‘word_dir’ or in an absolute
we are going to do! We are going to pack seven path. If some source packages are required
mini distros into one CD/DVD or USB drive to be compiled, launch a new terminal in the
that’s ready-to-boot, so that we can carry them source directory, carry on the compilation and
around and boot any distro anywhere, anytime, terminate it.
and at any place. When you see the ‘#’ symbol beside a
This guide is written with primarily a CD/ command, switch to the root console and
DVD as the target medium, but we will also execute; and when you see ‘$’, run it in
show you how this can be done with a Flash normal user terminal.
drive. We will pack PuppyLinux, GeexBox, If there are not enough permissions when
Slitaz, Goblinx (mini), Austrumi, CDlinux trying to modify/remove some file, then chmod
(standard) and DSL into a CD and USB drive. it with the appropriate permissions first.
The whole process is divided into seven When describing the USB booting, we will
phases. Each phase is further sub-divided into call the USB partition ‘/dev/sdXy’, where ‘X’ is

66  |  AUGUST 2009  |  LINUX For You  |  www.LinuxForU.com


____________________________________________________________________________________________________ How To  |  Open Gurus

the disk alphabet (number) and ‘y’ is the partition number. # mount goblinx*.iso /mnt/tmp7 -o loop,uid=<id>,gid=<group>
Replace ‘X’ and ‘y’ as per your drive’s values. In my case it
was ‘/dev/sdb1’ (X=b, y=1) Change the distro ISO file names as per the downloaded file.
In this guide the OS versions are: Austrumi 1.7.2,
PuppyLinux 4.0, Slitaz 1.0, CDlinux 0.9.1, DSL 4.2.2, GeexBox
Warning: Always be extra careful when executing 1.2.2, and GoblinX Micro 2.7.
commands in super-user mode. Double check which
device you are operating on when setting boot flags,
bootloaders, etc, or you may render your system Note: If you decide to mount the images as the
unbootable. root user (without UID, GID options) then do the copy
operations as the root. After you have done all the
copying, ‘chown’ the copied files to the normal user.
Phase I: Preparation
Create the work_dir/ directory into which we will dump all
the resources. Create mbcd/ and boot/ directories in chains
inside work_dir/. We’ll use mbcd/ to hold the compiled Shortcut: You can skip Steps 3 and 4 of this phase,
image files, while boot/ will hold the boot files for the if you plan to use isomaster or file-roller and extract the
image. Then change directory to word_dir/ and be sure to required files in the subsequent phases.
remain fixed in this location.

$ mkdir -p work_dir/mbcd/boot Phase II: Copying


$ cd work_dir Now we will copy the OS files from the mount points
to a proper location in our image directory. First let us
Download the distros and then copy them into work_dir/. understand the requirements briefly while copying the files.
Check the “Links and references” section at the end of the Each OS has a kernel and an initial ramdisk file where the
article for the official websites of the distros. kernel is decompressed and gets loaded into the RAM. Then
Create temporary directories in /mnt/, which we will it loads the files needed, mounts the OS filesystem and runs
use as mount points of the ISO images. (You can mount programs to set up the OS.
one image and then unmount it to reuse it, but for easy The kernel and the initial ramdisk files are loaded
reference we will mount all the ISOs at once.) Make seven through the bootloader from the media. There is a
directories, tmp1 to tmp7 in /mnt/. filesystem for each OS where all the programs, scripts and
configurations are installed. In the mini distros, these are
# mkdir /mnt/tmp{1,2,3,4,5,6,7} generally compressed, and/or encapsulated in a filesystem.
For example, CDlinux and PuppyLinux use squashfs.
We will now mount the ISO images in the mount point There may be more than one such filesystem for an OS,
directories. Remember to keep track of which OS is mounted each containing the required files for a certain application
in which directory. You can name the directories accordingly, software. For example, an additional squashfs module
such that you can identify each from its name. But for can be downloaded for OpenOffice.org, or Java runtime in
simplicity, we will refer to them as ‘tmpX’. PuppyLinux.
Austrumi, Puppy Linux, Slitaz, CDlinux, DSL, GeeXboX, Some distros find the compressed filesystems in a
and GoblinX (Micro) will be mounted into tmp1, tmp2, tmp3, certain location relative to the root of the bootable media.
tmp4, tmp5, tmp6 and tmp7, respectively. We will set the For some distros, the locations of the files can be altered, but
owner and group of the mounted images to your normal user information about the changed location should be conveyed
account and its group, by specifying the UID (user ID) and by passing an appropriate boot parameter when booting,
GID (group ID) options. and so some distros can search their files in all the attached
As a normal user, run id -u and id -g to find out the user disks of the system, automatically.
and group IDs, respectively, and note them down. Replace To know the requirements of a certain OS, you should
<id> and <group> in the following commands with your read the documentation in the official site, discuss it in
UID and the GID, respectively. forums or on the IRC channel. If you understand shell scripts,
mount the initial ramdisk of the distro and read the loading
# mount austrumi*.iso /mnt/tmp1 -o loop,uid=<id>,gid=<group> script to decipher it.
# mount puppy*.iso /mnt/tmp2 -o loop,uid=<id>,gid=<group> After copying the OS files, make sure the copied files
# mount slitaz*.iso /mnt/tmp3 -o loop,uid=<id>,gid=<group> are accessible to the distros, and the different OS files don’t
# mount CDlinux*.iso /mnt/tmp4 -o loop,uid=<id>,gid=<group> create any conflict. Although we’ll relocate some files and
# mount dsl*.iso /mnt/tmp5 -o loop,uid=<id>,gid=<group> directories to avoid conflicts, we will, by and large, try to keep
# mount geexbox*.iso /mnt/tmp6 -o loop,uid=<id>,gid=<group> the copying clean with minimum relocations.

www.LinuxForU.com  |  LINUX For You  |  AUGUST 2009  |  67


Open Gurus  |  How To _ ____________________________________________________________________________________________________

Some files might have read-only permission to the Then make a directory called CDlinux inside mbcd and
owner, in which case we’ll need to do a chmod u+w before copy the directories extra and settings into it.
modifying, deleting and overwriting it.
$ mkdir mbcd/CDlinux
[1] Austrumi $ cp -r /mnt/tmp4/CDlinux/extra \
Copy austrumi.fs and austrumi.tgz from /mnt/tmp1/boot/ /mnt/tmp4/CDlinux/settings mbcd/CDlinux
into mbcd/boot/
After this, copy the lang directory into CDlinux/ if
$ cp /mnt/tmp1/boot/austrumi.* mbcd/boot/ required. When writing the config file in Phase IV, you can
pass your language as the kernel parameter. CDlinux allows
Copy bzImage and initrd.gz from /mnt/tmp1/isolinux to you to place customised packages inside the CDlinux/local,
mbcd/boot/austrumi. which gets automatically detected when booting—so you
can use it if needed.
$ mkdir mbcd/boot/austrumi
$ cp /mnt/tmp1/isolinux/initrd.gz \ [5] DSL
/mnt/tmp1/isolinux/bzImage mbcd/boot/austrumi Now it’s time for DSL, mounted on /mnt/tmp5. Copy
linux24 and minirt24.gz files from /mnt/tmp5/boot/isolinux
Austrumi searches for its files in the boot directory, so to mbcd/boot/dsl.
you need to keep it in there. From version 1.8.x of Austrumi,
the kernel and the initial ramdisk files are located in the $ mkdir mbcd/boot/dsl
austrumi/ directory in the image. $ cp /mnt/tmp5/boot/isolinux/linux24 \
/mnt/tmp5/boot/isolinux/minirt24.gz mbcd/boot/dsl
[2] Puppy Linux
Puppy Linux does not need any specific location for the DSL searches the cloop file (the Knoppix compressed
files to be kept; it finds its files from any attached media. loopback filesystem) in the KNOPPIX/KNOPPIX path, by
We will place the Puppy files in a directory. Copy initrd.gz default. We will relocate it and keep it in the directory dsl/
and vmlinuz into mbcd/boot/puppy. Then copy pup_400.sfs instead, because if you decide to keep multiple Knoppix-
and zdrv_400.sfs to mbcd/Puppy. based distros, which have the same cloop file name and
path, you need to keep the cloops in different directories
$ mkdir mbcd/boot/puppy mbcd/Puppy with different distro names. If the cloop path is altered,
$ cp /mnt/tmp2/initrd.gz \ information about this change must be conveyed by
/mnt/tmp2/vmlinuz mbcd/boot/puppy passing a boot parameter while booting (discussed later).
$ cp /mnt/tmp2/pup_400.sfs \ Copy the Knoppix cloop file from /mnt/tmp5/KNOPPIX/
/mnt/tmp2/zdrv_400.sfs mbcd/Puppy KNOPPIX and place it into mbcd/dsl.

You can download and add additional Puppy .sfs $ mkdir mbcd/dsl
modules and keep them here. $ cp -r /mnt/tmp5/KNOPPIX/KNOPPIX mbcd/dsl

[3] Slitaz [6] GeeXboX


Now let me draw your attention to /mnt/tmp3, the Slitaz Copy vmlinuz, initrd.gz and splash.png file from /mnt/tmp6/
mount point. Copy bzImage and rootfs.gz from /mnt/tmp3/ GEEXBOX/boot into mbcd/boot/geexbox.
boot to mbcd/boot/slitaz, and copy vmlinuz-<version_no>-
slitaz to mbcd/boot. $ mkdir mbcd/boot/geexbox
$ cp /mnt/tmp6/GEEXBOX/boot/vmlinuz \
$ mkdir mbcd/boot/slitaz /mnt/tmp6/GEEXBOX/boot/initrd.gz \
$ cp /mnt/tmp3/boot/bzImage \ /mnt/tmp6/GEEXBOX/boot/splash.png mbcd/boot/geexbox
/mnt/tmp3/boot/rootfs.gz mbcd/boot/slitaz
$ cp /mnt/tmp3/boot/vmlinuz-*-slitaz mbcd/boot Then copy the whole of the /mnt/tmp6/GEEXBOX
directory into the root of our image and remove the boot
[4] CDlinux directory inside mbcd/GEEXBOX as we have moved all that’s
Copy the bzImage and the initrd from /mnt/tmp4/CDlinux required in mbcd/boot. (chmod is needed, as the directory has
into mbcd/boot/cdlinux. a permission of 444.)

$ mkdir mbcd/boot/cdlinux $ cp -r /mnt/tmp6/GEEXBOX mbcd/


$ cp /mnt/tmp4/CDlinux/bzImage \ $ chmod -R u+w mbcd/GEEXBOX
/mnt/tmp4/CDlinux/initrd mbcd/boot/cdlinux $ rm -rI mbcd/GEEXBOX/boot

68  |  AUGUST 2009  |  LINUX For You  |  www.LinuxForU.com


____________________________________________________________________________________________________ How To  |  Open Gurus

[7] GoblinX mini to enable the graphical menu system.


Copy vmlinux and initrd.gz of GoblinX from /mnt/tmp7/ If you had SYSLINUX installed previously, then run one of
boot into mbcd/boot/goblinx. the following commands and note down the paths:

$ mkdir mbcd/boot/goblinx $ locate vesamenu.c32 isolinux.bin


$ cp /mnt/tmp7/boot/vmlinuz \
/mnt/tmp7/boot/initrd.gz mbcd/boot/goblinx …or

Then copy the /mnt/tmp7/goblinx directory into mbcd/. $ rpm -ql syslinux | grep vesamenu.c32 && rpm -ql syslinux | grep isolinux.bin

$ cp -r /mnt/tmp7/goblinx mbcd/ If you do not have SYSLINUX, install it using your


package manager. Or download the source from the
This ends the copying process of our seven operating systems. SYSLINUX website, extract and run make, but don’t install
it (if you want to avoid installation—that is, only execute
Phase III: Creating the boot directory ./configure && make). Get the required files from the source
Now we will install the boot files that are required to make directory.
the ISO file or the USB bootable. We can use either the GRUB Make a directory called mbcd/boot/isolinux, and copy
or SYSLINUX bootloader and we will cover the installation isolinux.bin and vesamenu.c32 to mbcd/boot/isolinux.
of both in this article. In Phase V we will either use GRUB or
SYSLINUX to make the CD ISO image bootable (though both $ mkdir mbcd/boot/isolinux
the bootloader files can reside in the image without conflicts). $ cp /path_to/vesamenu.c32 \
/path_to/isolinux.bin mbcd/boot/isolinux
[1] Installing GRUB
Make a directory named grub under mbcd/boot/.

$ mkdir mbcd/boot/grub Shortcut: To avoid downloading and compiling


SYSLINUX or Grub, just copy isolinux.bin and vesamenu.
To boot from the CD, Grub needs a special image for c32 for SYSLINUX and stage2_extorito file from any
loading Stage 2. You need the stage2_eltorito file. If you have distro’s /boot directory, and continue to the next step.
got Grub installed in your system, then execute any one of
the following commands and note the path:

$ locate stage2_eltorito Phase IV: Making the configuration file


The previous phase sets the bootloader files; now we need
…or to instruct the bootloader which OS to boot. We also need
a menu from where the user can select an OS to boot and
$ rpm grub rpm -ql grub | grep stage2_eltorito we need a configuration file. The Syntax differs in Grub and
SYSLINUX. To know more about config file syntax, use the
Else, download the GRUB source, compile it and get the man pages.
eltorito image. Some distros need different boot parameters to be
I am assuming you have the stage2_eltorito under the passed for USB and CD versions. We will present the
/eltorito_dir which represents the absolute path of the configuration files for the live CD version in Section 1 (GRUB)
location of the stage2_eltorito file in your system. Copy and 2 (ISOLINUX) below, after which we will describe the
stage2_eltorito into mbcd/boot/grub. modifications needed for the live USB version in Section 3.

$ cp /eltorito_dir/stage2_eltorito mbcd/boot/grub/ [1] The Grub configuration file


The Grub configuration file will have three lines for each OS
entry. The first line, “label text”, displays the entry that we see
Note: The Grub files that have to be copied in on a Grub menu. In the second line we specify the location
order to boot from the USB drive are described in Phase of the OS kernel to be loaded, and pass the needed boot
VI, Section [2]. parameters. In the third line, we point the initial ramdisk
through the initrd command associated with the kernel.
You can add more than one entry for each distro, each
[2] Installing SYSLINUX using an OS-specific boot parameter. You can also write the
Two files are required to install the SYSLINUX: isolinux.bin parameters in a text file and display it when some key is
is needed to make the image bootable, and vesamenu.c32 pressed or use other ways to display text parameters. Check

www.LinuxForU.com  |  LINUX For You  |  AUGUST 2009  |  69


Open Gurus  |  How To _ ____________________________________________________________________________________________________

the man page for more details. apm=power-off vga=791 knoppix_dir=dsl nomce noapic fromhd quiet
Everyone would like to add a cool boot screen to the BOOT_IMAGE=knoppix
‘Multi-boot CD’. Make an image with the GIMP or download initrd /boot/dsl/minirt24.gz
one and name it splash.jpg. To make it ready for Grub, keep it
inside work_dir/; then execute the following: title GeeXboX
#uncomment the below line for liveCD
$ convert -colors 14 -depth 8 -resize 640x480! splash.jpg splash.xpm.gz kernel /boot/geexbox/vmlinuz root=/dev/ram0 rw rdinit=linuxrc
boot=cdrom lang=en remote=atiusb receiver=atiusb keymap=qwerty
The above command transforms the image into 640 splash=silent vga=789 video=vesafb:ywrap,mtrr hdtv quiet
x 480 pixels, 14 colours XPM, and compresses it in a gzip #uncomment the below line for liveUSB and replace the UUID value with your
file—splash.xpm.gz—so that Grub can display it. Move this device UUID
into mbcd/boot/grub. # kernel /boot/geexbox/vmlinuz root=/dev/ram0 rw rdinit=linuxrc
boot=UUID=0196-F5B5 lang=en remote=atiusb receiver=atiusb
$ cp splash.xpm.gz mbcd/boot/grub keymap=qwerty splash=silent vga=789 video=vesafb:ywrap,mtrr hdtv quiet
initrd /boot/geexbox/initrd.gz

Shortcut: Download the readymade Grub title GoblinX


loadable-format image from the Internet. kernel /boot/goblinx/vmlinuz vga=791 ramdisk_size=6666 root=/dev/
ram0 rw load=Muser locale=english splash=silent changes=/goblinx/ run.f
initrd /boot/goblinx/initrd.gz
In the configuration file, add the following line to load
it: splashimage=/boot/grub/splash.xpm.gz. Go through it and check how the paths are changed.
Just make sure that each absolute path within the CD
Following is what the file looks like: (considering the mbcd directory as the root) is valid, and
points to the correct kernel and ramdisk file.
splashimage=/boot/grub/splash.xpm.gz Now save it with the name grub.conf inside mbcd/
boot/grub.
title Austrumi
#uncomment the below line for liveCD [2] The ISOLINUX configuration file
kernel /boot/austrumi/bzImage dolivecd By changing some syntax of the above Grub file we can
#uncomment the below line for liveUSB create the isolinux.cfg file and save it in mbcd/boot/isolinux.
# kernel /boot/austrumi/bzImage dousb The following snippet shows the contents of this file:
initrd /boot/austrumi/initrd.gz
F1 list.msg
title Puppy DEFAULT vesamenu.c32
#uncomment the below line for liveCD PROMPT 0
kernel /boot/puppy/vmlinuz pmedia=cd DISPLAY list.msg
#uncomment the below line for liveUSB MENU BACKGROUND splash.jpg
# kernel /boot/puppy/vmlinuz pmedia=usbflash
initrd /boot/puppy/initrd.gz LABEL austrumi
MENU LABEL Austrumi Linux
title CDlinux #uncomment the below line for liveCD
kernel /boot/cdlinux/bzImage quiet KERNEL /boot/austrumi/bzImage dolivecd
initrd /boot/cdlinux/initrd #uncomment the below line for liveUSB
# KERNEL /boot/austrumi/bzImage dousb
title Slitaz APPEND initrd=/boot/austrumi/initrd.gz
kernel /boot/slitaz/bzImage rw root/dev/null vga=normal
initrd /boot/slitaz/rootfs.gz LABEL puppy
MENU LABEL Puppy Linux
title DSL #uncomment the below line for liveCD
#uncomment the below line for liveCD KERNEL /boot/puppy/vmlinuz pmedia=cd
kernel /boot/dsl/linux24 ramdisk_size=100000 init=/etc/init lang=us #uncomment the below line for liveUSB
apm=power-off vga=791 knoppix_dir=dsl nomce noapic quiet BOOT_ # KERNEL /boot/puppy/vmlinuz pmedia=usbflash
IMAGE=knoppix APPEND initrd=/boot/puppy/initrd.gz
#uncomment the below line for liveUSB
# kernel /boot/dsl/linux24 ramdisk_size=100000 init=/etc/init lang=us LABEL cdlinux

70  |  AUGUST 2009  |  LINUX For You  |  www.LinuxForU.com


____________________________________________________________________________________________________ How To  |  Open Gurus

MENU LABEL CDlinux


KERNEL /boot/cdlinux/bzImage quiet
APPEND initrd=/boot/cdlinux/initrd

LABEL slitaz
MENU LABEL Slitaz
KERNEL /boot/slitaz/bzImage rw root/dev/null vga=normal
APPEND initrd=/boot/slitaz/rootfs.gz

LABEL dsl
MENU LABEL Damn Small Linux
#uncomment the below line for liveCD
KERNEL /boot/dsl/linux24 ramdisk_size=100000 init=/etc/init lang=us
apm=power-off vga=791 knoppix_dir=dsl nomce noapic quiet BOOT_
IMAGE=knoppix
#uncomment the below line for liveUSB
# KERNEL /boot/dsl/linux24 ramdisk_size=100000 init=/etc/init lang=us A screenshot of the boot screen of our multi-boot CD
apm=power-off vga=791 knoppix_dir=dsl nomce noapic fromhd quiet
BOOT_IMAGE=knoppix save it inside mbcd/boot/isolinux/ as list.msg. It is printed on
APPEND initrd=/boot/dsl/minirt24.gz the screen at boot time by DISPLAY list.msg. The line ‘F1 list.
msg’ displays the ‘list.msg’ file whenever you press F1.
LABEL geexbox An example of list.msg follows:
MENU LABEL GeeXBoX
#uncomment the below line for liveCD To boot the Operating System type in the keyword
KERNEL /boot/geexbox/vmlinuz root=/dev/ram0 rw rdinit=linuxrc in the prompt and press enter
boot=cdrom lang=en remote=atiusb receiver=atiusb keymap=qwerty ===============================
splash=silent vga=789 video=vesafb:ywrap,mtrr hdtv quiet Operating System Name Keyword
#uncomment the below line for liveUSB and replace the UUID value with your ———————————————
device UUID Austrumi Linux austrumi
# KERNEL /boot/geexbox/vmlinuz root=/dev/ram0 rw rdinit=linuxrc Puppy Linux puppy
boot=UUID=0196-F5B5 lang=en remote=atiusb receiver=atiusb CDlinux cdlinux
keymap=qwerty splash=silent vga=789 video=vesafb:ywrap,mtrr hdtv quiet Slitaz slitaz
APPEND initrd=/boot/geexbox/initrd.gz Damn Small Linux dsl
GeeXboX geexbox
LABEL goblinx GoblinX goblinx
MENU LABEL GoblinX Linux ————————————————
KERNEL /boot/goblinx/vmlinuz vga=791 ramdisk_size=6666 root=/dev/
ram0 rw load=Muser locale=english splash=silent changes=/goblinx/ run.f
APPEND initrd=/boot/goblinx/initrd.gz [2] Configuration changes for the live USB
In Phase VI we will describe how to make a bootable live
Now copy the JPEG image, say splash.jpg, to mbcd/ USB with SYSLINUX and Grub. If you are creating a multi-
boot/isolinux/. SYSLINUX can load JPEG images directly boot live USB, only then make the following changes to the
without any modification (with the help of the vesamenu. configuration file (Grub or SYSLINUX).
c32 module). For Austrumi: replace ‘dolivecd’ with ‘dousb’ and for
Puppy, replace ‘pmedia=cd’ with ‘pmedia=usbflash’. For DSL,
$ cp splash.jpg mbcd/boot/isolinux append the ‘fromhd’ boot parameter in the kernel line. For
GeeXBox, you need to specify the UUID of your USB device.
If you decide not to include the vesamenu.c32 module, To get the UUID of your USB partition, execute the following:
you can always have a text menu. Without this vesamenu.
c32 module, the ‘MENU’ keywords will not be recognised and # blkid /dev/sdXy
therefore no graphical menu will be displayed. It will show
an error and fall back to text mode showing a boot: prompt ...after replacing /dev/sdXy with the appropriate device
asking for an OS label. Enter the label of the OS (beside the name in your case, and noting down the value of the UUID
‘LABEL’ field) that you want to boot and press Enter. To avoid field. In my case, the command was blkid /dev/sdb1 and the
memorising the label names, write a plain text file containing UUID was 0196-F5B5. Now pass the UUID by appending
the OS name list and their corresponding label names and the following to the kernel line:

www.LinuxForU.com  |  LINUX For You  |  AUGUST 2009  |  71


Open Gurus  |  How To _ ____________________________________________________________________________________________________

‘boot=UUID=<your_uuid>’ $ mv /media/disk/boot/isolinux /media/disk/boot/syslinux


$ mv /media/disk/boot/syslinux/isolinux.cfg /media/disk/boot/syslinux/
The configuration files contain the live USB lines syslinux.cfg
(commented). So, comment the lines for the live CD and $ mv /media/disk/boot/syslinux/isolinux.bin /media/disk/boot/syslinux/
uncomment the lines for the live USB to get the desired syslinux.bin
changes.
Now install SYSLINUX in the USB drive’s partition where
Phase V: Making the ISO image you have the boot directory:
Recheck the mbcd/ for errors—check if all the paths to the
configuration files are valid, whether all the files are copied, # syslinux -sd boot/syslinux /dev/sdXy
unnecessary back-up files ending with tilde have been
removed “~”, etc. If the USB drive partition that has the bootloader is
We will use mkisofs to make the ISO image. Run the /dev/sdb1, then the above command would be:
following command if you are making a Grub bootable
image. # syslinux -ds boot/syslinux/ /dev/sdb1

$ mkisofs -iso-level 3 -R -J —input-charset=utf8 \ This will alter the MBR (Master Boot Record) by
-b boot/grub/stage2_eltorito -c boot/boot.catalog \ installing the boot code and installing ldlinux.sys in the
-no-emul-boot -boot-load-size 4 -boot-info-table -o mbcd.iso mbcd partition.

If you want to make the ISO image boot with ISOLINUX [2] Installing Grub
instead, point to the isolinux.bin boot image: The grub-install shell script will be used to do this job. The
following command installs Grub in both the MBR and the
$ mkisofs -iso-level 3 -R -J —input-charset=utf8 \ partition.
-b boot/isolinux/isolinux.bin -c boot/boot.catalog \
-no-emul-boot -boot-load-size 4 -boot-info-table -o mbcd.iso mbcd # grub-install --root-directory=/media/disk /dev/sdX

Now burn it into a CD-R. The /media/disk/ directory should point to the mount
point of your USB partition. This will install the boot
code in the MBR and install Stage1.5 and Stage 2 into the
Tip: Test the ISO file in a virtual machine before partition and set the configuration file.
you burn a CD.

Note: Use the Grub shell for better control.

Phase VI: Making the Swiss knife


Now it’s time to convert your USB Flash drive to a GNU/
Linux-powered, home-made Swiss knife with seven [3] Set the boot flag
flavours. Unmount the USB partition and make it bootable by
We will describe how to make your USB drive bootable setting the boot flag with parted, fdisk or any partition
with both SYSLINUX and Grub. Though this process is manager.
not destructive, it is always advisable to back up data (see
‘Notes on USB Booting’). First copy all the contents of # umount /dev/sdXy
work_dir/mbcd/ into the USB drive partition: # parted /dev/sdX set y boot on

$ cp -r mbcd/* /media/disk/ For example, if your USB drive partition is /dev/sdb1


(containing the boot directory), then the above commands
Then install the Grub or SYSLINUX bootloader and set would be:
the boot flag.
# umount /dev/sdb1
[1] Installing SYSLINUX # parted /dev/sdb set 1 boot on
In the USB drive, rename the directory isolinux/ to
syslinux/, rename isolinux.cfg to syslinux.cfg and isolinux. After you have installed either Grub or SYSLINUX, make
bin to syslinux.bin. Assuming your USB drive is mounted in the changes in the configuration file as described in Phase IV,
/media/disk, execute: Section [3].

72  |  AUGUST 2009  |  LINUX For You  |  www.LinuxForU.com


____________________________________________________________________________________________________ How To  |  Open Gurus

Phase VII: Cleaning up # dd if=/path/to/mbr.bin of=/dev/sdX


Finally, we’ll need to clean up the mess we’ve created. Notice
that the working directory has grown to a huge size, because To clear the boot code section of MBR, execute the
you have three copies of each OS in it (the original ISO, the following command:
extracted files, and the files inside the mbcd.iso). We will
dispose of the work_dir/, excluding mbcd.iso (obviously). # dd if=/dev/zero of=/dev/sdX bs=440 count=1

$ mv mbcd.iso .. Note that we didn't clear the whole 446 bytes here.
$ cd .. This is because byte number 441 to 444 are used to store
# rm -rI work_dir disk signatures, and the remaining two bytes are kept
# umount /mnt/tmp? empty. For more information visit en.wikipedia.org/wiki/
# rmdir /mnt/tmp? Master_boot_record.
It is recommended to back up your boot sector along
To add, modify or change the mbcd image, you do not with your files before making the USB bootable. To back up
need to mount all those distros again; just extract ‘mbcd.iso’, the boot sector, execute the following:
make edits, and repack it to an ISO, or use ISOmaster.
# dd if=/dev/sdX of=usb_mbr_bak bs=512 count=1
Adding more than one Knoppix-based distro
All Knoppix-based live distros have a compressed To restore the MBR, execute:
filesystem, the cloop file, in the same location
— KNOPPIX/KNOPPIX. So no more than one Knoppix- # dd if=usb_mbr_bak of=/dev/sdX
based distro can reside in a media. To keep more
than one of these, the cloop files of the second A multi-booting media is always intriguing, especially
distro should be kept in different directories or have when it has a collection of great mini distros. Now that we have
different names. After you change the cloop file’s booted a CD/DVD and a USB drive, why don’t we do the same
path, you need to pass it with the boot parameters with an internal HDD. This can be done exactly as we did for
shown below: the USB drive. Keep the OS files in the root of a drive and make
sure all the locations are correct in the config file; then make the
knoppix_dir=<path to dir containing the cloop file with leading “/”> HDD bootable with Grub or SYSLINUX. Next, load the config
knoppix_name=<name of the cloop file> file from the menu; if Grub or SYSLINUX is already installed,
then this is done—you just need to call the configuration file
For example, we have kept the DSL cloop file in the dsl/ with the configfile command from the Grub shell.  
directory, so we have passed knoppix_dir=dsl/. If the name
of the cloop file is changed, then you also need to append
“knoppix_name=newname” as the kernel parameter. An Note: Please play safe, because sometimes you
example for Grub is shown below. It’s recommended to only come to know you’ve lost something important
change only directories. when you restart your system the next morning.

kernel /boot/dsl/linux24 knoppix_dir=dsl/ knoppix_name=newname


Links and references
• Puppy Linux: www.puppylinux.org/
Notes on USB booting • Damn Small Linux: www.damnsmalllinux.org/
To boot from a USB drive, you need to plug it in and make • GeexBox: www.geexbox.org/
sure that your system supports booting from a USB drive. • GoblinX: www.goblinx.com.br/en/
Consult your motherboard manual to change the boot order. • Slitaz: www.slitaz.org/en/
• Austrumi: cyti.latgola.lv/ruuni/
The Master Boot Record or the boot sector consists of
• CDlinux: www.cdlinux.info/
512 bytes and it resides at the beginning of the disk—the first • Grub: www.gnu.org/software/grub
sector. The first 446 bytes is reserved for the boot code. The • Syslinux: www.syslinux.zytor.com
boot code needs to be installed in order to make the BIOS • GRUB man pages
• SYSLINUX man pages
boot from this drive. The next 64 bytes contain the partition
table. Each partition is described with 16 bytes, so the disk
can contain four primary partitions. The last two bytes By: Arjun Pakrashi
contain the signature. The author is currently pursuing a B.Sc in computer science
SYSLINUX supplies a sample MBR, the mbr.bin file, from Asutosh College in Kolkata. His main areas of interest are
open source software, Linux programming and data structures.
which can be used to overwrite the MBR boot code. To He plans to do research-based work, and become an OSS
do this, first locate mbr.bin in your system and execute contributor.
the following:

www.LinuxForU.com  |  LINUX For You  |  AUGUST 2009  |  73


Open Gurus  |  How To _______________________________________________________________________________________________

My Own
Streaming Radio

Looking for a way to stream your music over the home network? MPD (Music
Player Daemon) with the Icecast server could be a viable option.

I
cecast? Don’t worry, I am not “My own radio? Wow! Where do I
going to talk about chiselling begin?”
sculptures out of ice here. Icecast It’s fairly simple actually. We will cover
is a server—an audio streaming the basics about creating and using a
server to be precise. It can broadcast both basic MPD set-up, which can be used as a
MP3 and Ogg Vorbis format audio in the local streaming service on your machine.
form of streams. What I wanted was to be Personally, I find it better than most players
able to access my music library on my iPod out there. This will, in turn, help us with the
Touch while at home. So, I was looking for streaming application in the backend. Then,
a way to stream my music over the home we will explore setting up Icecast. Take a look
network. After a little search and review, at Figures 1 and 2 to get a more holistic view.
MPD (Music Player Daemon) with the Icecast
server seemed to be the best option. Music Player Daemon
With this set-up, you can run even MPD (Music Player Daemon) is a daemon
your own Internet radio. You can select (a piece of software that runs in the
the bit rate of the stream, the number of background) that manages your music for
channels to stream, and the quality of the you. It’s a client-server architecture. MPD
Ogg streams…there are numerous options acts as a server; and when you install a client,
to choose from. you can use it to interact with MPD and play

74  |  AUGUST 2009  |  LINUX For You  |  www.LinuxForU.com


____________________________________________________________________________________________________ How To  |  Open Gurus

music. It’s great to set up some old computer as the MPD


server and route that music throughout your network. The Listener
MP3/OGG
advantage lies in the fact that it will require less space for Audio Stream
Client
Enjoys the
storage—everyone has their own account and they can MPD stream
listen to whatever music they want to as long as it is on the
server (or optionally, on your local machine). Source MP3/OGG MP3/OGG
Listener
Client ICECAST Client
Unless you are using Linux from Scratch or Rock Linux, Makes the
Audio Stream
SERVER -- Audio Stream
Enjoys the
your distribution repositories have the binaries for MPD. stream Distributes the stream
stream
Install MPD and copy the file /etc/mpd.conf.example to /
etc/mpd.conf. Open it in any preferred text editor. And then MP3/OGG
Listener
Client
configure MPD as follows. Audio Stream
Enjoys the
stream
Edit the file and add the following lines—this is the
most basic and simple, single-user configuration for MPD Any Stream Player

that we will use with Icecast:


Figure 1: An overview of the streaming server
music_directory “/home/user/music” # Your music dir.
playlist_directory “/var/lib/mpd/playlists” # to know how to setup your driver.
db_file “/var/lib/mpd/db”
log_file “/var/log/mpd/mpd.log” Most of the fields in the configuration file above are
error_file “/var/log/mpd/mpd.error” self-explanatory. You only need to change the music
pid_file “/var/run/mpd/mpd.pid” directory to your music directory path. Keep the other
state_file “/var/lib/mpd/mpdstate” paths and even the user as mpd. We will get back to that
user “mpd” later. Save the file for now. Come back to the root console.
# Binding to address and port causing problems Let’s create a new user, mpd, which will be used to
# in mpd-0.14.2 best to leave commented. access MPD.
# bind_to_address “127.0.0.1”
# port “6600” useradd -g mpd -d /var/lib/mpd

audio_output { Then make sure that the directory is owned by the mpd
type “alsa” user, as well as the mpd group, by issuing the following
name “My ALSA Device” command:
device “hw:0,0” # optional
format “44100:16:2” # optional chown mpd:mpd /var/lib/mpd -R
}
Moving along, we now have to create the files
# We assume that you use ALSA in this config. mentioned earlier, and then transfer ownership of some
# If you are using any other driver, please visit the files and directories to mpd:mpd. Execute the following
# official docs at http://mpd.wikia.com/wiki/Configuration commands.

Computer -> MPD + IceCast Server Laptop


Controlled with
ncmpcp p locally
Ncmpcpp controls MPD #2
MPD #1 MPD #2 Stream Player
(also output on port 6600) (also output on port 6601)

Icecast server on port 8000


ALSA driver/mixer ALSA driver/mixer

http://<IP-Address>:8000/stream.ogg

Desktop speakers Laptop speakers

Figure 2: How the streaming server works

www.LinuxForU.com  |  LINUX For You  |  AUGUST 2009  |  75


Open Gurus  |  How To _ ____________________________________________________________________________________________________

touch /var/lib/mpd/db <authentication>


touch /var/lib/mpd/mpdstate <!-- Sources log in with username ‘source’ -->
touch /var/run/mpd/mpd.pid <source-password>yourPass</source-password>
touch /var/log/mpd/mpd.log <!-- Relays log in username ‘relay’ -->
touch /var/log/mpd/mpd.error <relay-password>yourPass</relay-password>
chown -R mpd:mpd /var/lib/mpd <!-- Admin logs in with the username given below -->
chown -R mpd:mpd /var/run/mpd <admin-user>adminUserName</admin-user>
chown -R mpd:mpd /var/log/mpd <admin-password>adminPass</admin-password>
</authentication>
Now almost everything is done. Create the MPD music
database as the root user. Then set 755 permissions to your <hostname>Local IP of your machine</hostname>
home music directory.
<listen-socket>
mpd --create-db <port>Port you want to use</port>
chmod a+x /home/user </listen-socket>
chmod -R a+x /home/user/music
<fileserve>1</fileserve>
You are done. You can install some MPD client, say
mpc, ncmpc or Sonata (my favourite) and check if MPD <paths>
runs. Start MPD as follows: <!-- basedir is only used if chroot is enabled -->
<basedir>/usr/share/icecast</basedir>
/etc/rc.d/mpd start
<!-- Note that if <chroot> is turned on below, these paths must both
If everything is working fine (which it should if you be relative to the new root, not the original root -->
follow the instructions given), then we can move on to the <logdir>/log</logdir>
next section. <webroot>/web</webroot>
<adminroot>/admin</adminroot>
Setting up Icecast <alias source=”/” dest=”/status.xsl”/>
Install Icecast. I am not going into the details of that </paths>
one either. The following section gives the details about
setting up a live Internet stream feed, which can be <logging>
used as Internet radio. This article does not, in any way, <accesslog>access.log</accesslog>
condone the use of copyrighted music, podcasts or any <errorlog>error.log</errorlog>
other media files for use on the Internet. If you do not <loglevel>4</loglevel> <!-- 4 Debug, 3 Info, 2 Warn, 1 Error -->
have the legal rights to stream a particular file, please <logsize>10000</logsize> <!-- Max size of a logfile -->
do not stream it over the Internet. The author and </logging>
the magazine is not responsible for any illegal action
committed by the user. I’m glad we had this talk. Let’s <security>
move on... <chroot>1</chroot>
Open the file /etc/Icecast.xml in your favourite text
editor and edit the file to match your needs. The following <changeowner>
code is the sample configuration file for Icecast that I am <user>icecast</user>
using right now: <group>icecast</group>
</changeowner>
<icecast>
<limits> </security>
<clients>100</clients>
<sources>2</sources> </icecast>
<threadpool>5</threadpool>
<queue-size>524288</queue-size> You need to change a few things in the above code
<client-timeout>30</client-timeout> to make the connection a more secure one. In the
<header-timeout>15</header-timeout> <authentication> tag, the default passwords and the port
<source-timeout>10</source-timeout> (8000) used by Icecast are listed. Change them to any
<burst-on-connect>1</burst-on-connect> suitable password and port. Remember, using the default
<burst-size>65535</burst-size> port and passwords makes Icecast more prone to attacks.
</limits> Again, for more security, we will change the <chroot>

76  |  AUGUST 2009  |  LINUX For You  |  www.LinuxForU.com


____________________________________________________________________________________________________ How To  |  Open Gurus

format “44100:16:2” # 44KHz 16 bit 2 channel audio.


mount “/stream.ogg” # Change to /stream.mp3 for mp3.
password “somepass” # The password for ‘source’.
quality “2” # optional for ogg stream.
bitrate “64” # optional for mp3 stream.
user “source”
}

Then add the following lines in case you are NOT using
Alsa as the second audio out, to make sure MPD does not
crash when Icecast is not running:

Figure 3: Icecast server status page audio_output {


type “alsa”
section to reflect <chroot>1</chroot>. Enter the user as name “fake out”
Icecast, and enter the group also as Icecast. More on this driver “null”
later. For now, also change the paths to: }

<paths> Well. That’s it folks. All you need to do is to start Icecast


<basedir>/usr/share/icecast</basedir> and restart MPD.
<logdir>/log</logdir>
<webroot>/web</webroot> /etc/rc.d/icecast start
<adminroot>/admin</adminroot> /etc/rc.d/mpd restart
</paths>
Here, make sure that Icecast is started before MPD in
Save the file and create a user Icecast with the default order to allow MPD to recognise it. You can add both the
group Icecast, and the home directory as /usr/share/ daemons to the start-up list. Just add their names to /etc/
Icecast/ as follows: rc.conf file. Make sure that the Icecast statement is before
mpd on that file.
useradd -g icecast -d /usr/share/icecast/ icecast
How to play the stream
That’s about it. Run Icecast with the following If you have reached this point without any trouble, then
command: it’s fairly simple to play the stream. If you are using a
Linux machine to play the songs, you have numerous
icecast -b -c /etc/icecast.xml options. Almost all the standard players come with
stream input compatibility. It’s available in MPlayer,
To test if Icecast is really working, open http:// Amarok, Exaile, Rhythmbox, and many others. The
localhost:8000/ in your Web browser (replace 8000 with term used is either an Internet radio stream or just a
the port you are using). You should be greeted with an streaming media. For Windows, you can use Winamp.
“Icecast2 Status” page (refer to Figure 3). This indicates I started out doing this for iPod Touch. I found a
that everything is running properly. free application called MPoD for iPod that can either be
used as a controller for MPD or as a player with Icecast.
How to stream using MPD If you are unsure whether your player can play the audio
All right, you have installed and configured Icecast. The streams, please Google for the information, as providing
next step now is to add the Icecast stream channel as a how-to for all players in this guide is impossible and
the output for MPD. You will have to decide what stream impractical.
you want to use (Ogg or MP3) and change the options You now have yourself an Internet radio. Go test it out
accordingly. Just add the following to the audio outputs and, of course, don’t forget to have some fun. 
section in the mpd.conf file:

audio_output { By: Aditya Shevade


type “shout” National Talent Scholar, Aditya Shevade, a final year electronics
encoding “ogg” # change to mp3 for mp3 stream. engineering student, takes keen interest in programming and
name “foobar stream” electronic design. A Linux user for past two years, he enjoys
playing keyboard and is a good photographer. To know more
port “8000” # the port you are using.
about him, visit www.adityashevade.com
host “localhost” # the host in use.

www.LinuxForU.com  |  LINUX For You  |  AUGUST 2009  |  77


Open Gurus  |  How To _______________________________________________________________________________________________

Netkit
The Networking Sandbox
Networking is very interesting and I’m sure many of us would like to experiment
with it, but the unavailability of laboratories with sufficient computers is
a stumbling block. What if I tell you that you can turn any computer into a
network device at no extra cost?

N
etkit is a virtualised environment They will be displayed as terminals. Each
on the top of User Mode Linux of the terminals can be programmed using
that gives wings to your network different *nix tools to make them work as
experimentation dreams. This different network devices such as routers, a
article focuses on how to get started with gateway, etc.
Netkit, including modelling and testing
complex networks with it. What can Netkit do?
In order to master networking we need It is never advisable to conduct experiments
to hack on real-time network devices such on the primary network of an entity, since
as routers, gateways and other costlier it hosts services that are critical for its
devices that are not always readily available. operations. On the other hand, network
It is a physical strain plugging in the cables, equipment could be expensive, and even for
switching on the devices, logging in to simple experiments, sufficient equipment
routers, etc, apart from the logical exercise should be available in the same test bed.
of designing and setting up the network. Under the circumstances, Netkit—a
Anyone attempting all this has to be hands- system to emulate computer networks by
on with several devices, several interfaces, creating a real-time environment—comes
protocols, physical interconnections, etc. to the rescue. The one-line description
Netkit, on the other hand, is the laziest of Netkit is: “The poor man’s system for
and easiest way to learn, understand and test experimenting.” It has been developed and
a network on a virtual environment. It is also maintained by the Network Research Group
a great teaching aid. of the Roma Tre University (in Rome, Italy).
Using the Netkit toolkit, we can create The virtualised environment for the
as many virtual machines as we need. Netkit toolkit is based on UML (User Mode

78  |  AUGUST 2009  |  LINUX For You  |  www.LinuxForU.com


____________________________________________________________________________________________________ How To  |  Open Gurus

Linux—user-mode-linux.sourceforge.net). Each emulated processes (including VMs) and configuration settings


network device is a virtual GNU/Linux system. Since on the host machine
GNU/Linux is shipped with software supporting most of The Netkit lab is an interesting facility that comes inbuilt
the network protocols, any machine can be configured to with the Netkit toolkit. While emulating a large network, it is
act as a bridge/switch or as a router. Each virtual machine harder to configure each of the VMs individually, every time
has a console (terminal window) with a root shell. you want to conduct a new experiment. Netkit lab facilities
help in setting up complex labs consisting of several virtual
Installing and setting up Netkit machines. Here are some commands to manipulate and keep
The hardware requirements for Netkit are pretty basic: track of the running labs:
 ≥ 600 MHz CPU  lstart starts a Netkit lab
 ~10 MB memory for each VM (depending on the VM  lhalt gracefully halts all the VMs of a lab
configuration)  lcrash causes all the VMs of a lab to crash
 ~600 MB of disk space + ~1-20 MB for each VM  lclean removes temporary files from a lab directory
(depending on the usage of the VM)  linfo provides information about a lab without starting it
As for software requirements, you'll need a GNU/Linux  ltest allows you to run tests to check that the lab is
installation and of course, you can download Netkit working properly
from www.netkit.org if it’s not available in your distro’s
online software repositories. [Netkit works fine on many Starting virtual hosts
distributions—see wiki.netkit.org/index.php/Status]. Each of the VMs represents a network device or a host. In
Download the following three files: netkit-X.Y.tar.bz2, order to start a virtual machine with the name ‘pc1’, use
netkit-filesystem-FX.Y.tar.bz2 and netkit-kernel-KX.Y.tar.bz2. the following command:
Unpack them in the same location:
slynux@gnubox:~$ vstart pc1
slynux@gnubox:~$ mkdir ~/netkit ============= Starting virtual machine “pc1” =============
// Follow the following order in extraction of archives Kernel: /home/slynux/netkit/kernel/netkit-kernel
slynux@gnubox:~$ tar -xjf netkit-X.Y.tar.bz2 -C ~/netkit Modules: /home/slynux/netkit/kernel/modules
slynux@gnubox:~$ tar -xjf netkit-filesystem-FX.Y.tar.bz2 -C ~/netkit Memory: 16 MB
slynux@gnubox:~$ tar -xjf netkit-kernel-KX.Y.tar.bz2 -C ~/netkit Model fs: /home/slynux/netkit/fs/netkit-fs
Filesystem: /home/slynux/pc1.disk
Now it requires you to set up some environment Hostfs at: /home/slynux
variables to make Netkit work. Append the following lines
to your ~/.bashrc: Running ==> /home/slynux/netkit/kernel/netkit-kernel modules=/home/
slynux/netkit/kernel/modules name=pc1 title=pc1 umid=pc1 mem=20M
export NETKIT_HOME=~/netkit ubd0=/home/slynux/pc1.disk,/home/slynux/netkit/fs/netkit-fs root=98:1
export PATH=$PATH:$NETKIT_HOME/bin uml_dir=/home/slynux/.netkit/mconsole hosthome=/home/slynux quiet
export MANPATH=:$NETKIT_HOME/man con0=xterm con1=null SELINUX_INIT=0

You can now check your Netkit installation by opening A console terminal corresponding to pc1 will pop up.
a new terminal running the following check_configuration. You can create any number of virtual hosts using the vstart
sh bash script. command. We will use options like—eth0,—eth1 to specify
the network interface and its connection. For example:
slynux@gnubox:~$ cd $NETKIT_HOME
slynux@gnubox:~$ ./check_configuration.sh slynux@gnubox:~$ vstart pc1 --eth0=A

If it succeeds, your Netkit installation is successful. slynux@gnubox:~$ vstart pc2 --eth0=A

An introduction to Netkit commands Here we have two machines pc1 and pc2. The—eth0
We will now look into some of the Netkit commands used argument corresponds to the network interface, while ‘A’
to start, configure and monitor Netkit virtual machines in the—eth0=A argument specifies the collision domain
and the virtual labs. of the network—i.e., in the above example, pc1 and pc2
 vstart starts a new virtual machine are connected on the same network family as if they are
 vlist lists the currently running virtual machines interconnected through a network hub.
 vconfig attaches network interfaces to running VMs If there is a pc3—vstart pc3—eth0=B—it means pc3
 vhalt gracefully halts a virtual machine is connected to a different network hub and pc3 is not
 vcrash causes a virtual machine to crash reachable from pc1 or pc2. In order to bridge both hubs, we
 vclean is the “panic command” to clean up all Netkit require a router in between.

www.LinuxForU.com  |  LINUX For You  |  AUGUST 2009  |  79


Open Gurus  |  How To _ ____________________________________________________________________________________________________

looking at the command output. For example: ping


google.com
 ifconfig is used to set the IP address for an interface.
To set the IP address of eth0, just use ifconfig eth0 <ip
address> netmask <netmask>
 The route command can be used to set the routes
for an IP network. For example, route add default gw
192.168.0.1 dev eth0 sets 192.168.0.1 as the default
gateway for the interface as eth0.
 You can use the tcpdump command for packet sniffing.
With this command, you can monitor the network
data packets transfer through a network interface. For
example, tcpdump -i eth0
 You can use traceroute to trace the packet route. This
means that you can find out the gateways through
which a packet travels to reach its destination. For
example, traceroute mec.ac.in

Hands-on network emulation


Figure 1: A network with three hosts interconnected via a network hub We will now look at how to emulate simple networks using
Netkit. A network with three hosts interconnected via a
network hub is shown in Figure 1.
It is very easy to set up a network of machines
connected through a common network hub. Execute the
following commands:

slynux@gnubox:~$ vstart pc1 --eth0=A


slynux@gnubox:~$ vstart pc2 --eth0=A
slynux@gnubox:~$ vstart pc3 --eth0=A

These three commands will create three terminals,


namely Virtual Console #0 (pc1), Virtual Console #0 (pc2),
Virtual Console #0 (pc3).
Let’s list the details of active virtual machines using the
command, vlist.

slynux@gnubox:~$ vlist
USER VHOST PID SIZE INTERFACES
slynux pc1 4485 22852
Figure 2: A network with a router to bridge two families of networks slynux pc2 4944 22852
slynux pc3 5503 22852
We can shut down the machine from outside the
virtual terminal using the command vhalt [virtual host Total virtual machines: 3 (you), 3 (all users).
name]. If something goes wrong and needs the virtual Total consumed memory: 68556 KB (you), 68556 KB (all users).
machine to be forcefully shut down, use the command slynux@gnubox:~$
vcrash [hostname].
The—con0 argument for the vstart command will Now we can set IP addresses for each of the machines
help you in specifying the terminal to be used for a VM. using ifconfig:
To use the same terminal in which commands are typed,
use—con0=this or if you want Konsole as the terminal, pc1# ifconfig eth0 192.168.0.1
use—con0=konsole. pc2# ifconfig eth0 192.168.0.2
pc3# ifconfig eth0 192.168.0.3
Some network manipulation/config commands
 The ping command is to check connectivity. We Try to ping between these machines—for example,
can ping another machine on a network using its IP from pc1 (with IP address 192.168.0.1), ping 192.168.0.2.
address/hostname and check the connectivity by A router is a network device used to bridge two

80  |  AUGUST 2009  |  LINUX For You  |  www.LinuxForU.com


____________________________________________________________________________________________________ How To  |  Open Gurus

networks of a different family of IP addresses. A network


with a router to bridge two families of networks is shown
in Figure 2.
We will now build a router using a virtual machine.
First, start two virtual machines with network interfaces
of different collision domains. Then set the IP addresses
of the different families. Start a virtual machine with
two interfaces of collision domains, and set IP addresses
for the interfaces.

slynux@gnubox:~$ vstart pc1 --eth0=A // PC1


slynux@gnubox:~$ vstart pc1 --eth0=B //PC2
slynux@gnubox:~$ vstart router --eth0=A --eth1=B // Router

Execute the following commands in the virtual Figure 3: A network with two routers for advanced routing of different addresses
machines.
advanced routing of different addresses.
On R1: This experiment is more interesting, since we
will use two routers and a bunch of route command
router# ifconfig eth0 192.168.0.1 executions to specify more address routes.
router# ifconfig eth1 192.168.1.1 Let’s start two VMs with interfaces belonging to
collision domains A and C, and two routers R1 and R2
On PC1: with collision domains of the interfaces A, B and B, C.
Execute the following commands:
pc1# ifconfig eth0 192.168.0.2
pc1# route add default gw 192.168.0.1 // Setting default gateway slynux@gnubox:~$ vstart pc1 --eth0=A
slynux@gnubox:~$ vstart pc2 --eth0=C
On PC2: slynux@gnubox:~$ vstart r1 --eth0=A --eth1=B
slynux@gnubox:~$ vstart r2 --eth0=B --eth1=C
pc1# ifconfig eth0 192.168.1.2
pc1# route add default gw 192.168.1.1 // Setting default gateway On PC1:

Run the following ping tests to check if things are in pc1# ifconfig eth0 192.168.0.5
place: pc2# ifconfig eth0 192.168.3.5

pc1# ping 192.168.0.1 r1# ifconfig eth0 192.168.0.1


pc1# ping 192.168.1.1 r1# ifconfig eth1 192.168.2.1
pc1# ping 192.168.1.2
r2# ifconfig eth1 192.168.2.3
pc2# ping 192.168.1.1 r2# ifconfig eth0 192.168.3.1
pc2# ping 192.168.0.1
pc2# ping 192.168.0.2 Add the routes:

Now execute the traceroute command to find out r1# route add -net 192.168.3.0 netmask 255.255.255.0 gw 192.168.2.1 dev
the path of the network packet transfer. eth0
r2# route add -net 192.168.0.0 netmask 255.255.255.0 gw 192.168.2.3 dev
On PC1: eth1

pc1:~# traceroute 192.168.1.2 pc1# ping 192.168.3.5


traceroute to 192.168.1.2 (192.168.1.2), 64 hops max, 40 byte packets pc2# ping 192.168.0.1
1 192.168.0.1 (192.168.0.1) 4 ms 3 ms 6 ms
2 192.168.1.5 (192.168.1.2) 1 ms 1 ms 1 ms Let’s now connect a network with the host machine
gateway and access the Internet.
This means that it first passes through the gateway Each of the virtual machines used here are Debian
192.168.0.1 and reaches the destination. Sid-based GNU/Linux installations. So we can update
Figure 3 shows a network with two routers for and install custom tools by providing connectivity

www.LinuxForU.com  |  LINUX For You  |  AUGUST 2009  |  81


Open Gurus  |  How To _ ____________________________________________________________________________________________________

to the virtual machines. We can share the Internet slynux@gnubox:~$ cd netkit_testlab


connection available on the host machine with the slynux@gnubox:~/netkit_testlab$ mkdir pc1 pc2 r1
virtual machine using an interface argument. slynux@gnubox:~/netkit_testlab$ vim lab.conf
Use the—eth0=tap,TAP-ADDRESS,GUEST-ADDRESS
argument along with the vstart command to share Type the following lines excluding the comments
the Internet connection. TAP-ADDRESS is the address starting with // and save the lab.conf text file:
attached with eth0 and GUEST-ADDRESS is the address
attached for a new virtual interface created in the host r1[0]=”A” // specifies eth0, collision domain = A
machine. r1[1]=”B” // specifies eth1, collision domain=B
The following example shows how to share an
Internet connection with the virtual machine: pc1[0]=”A” // specifies eth0, collision domain=A
pc2[0]=”B” //specifies eth0, collision domain=B
slynux@gnubox:~$ vstart pc1 --eth0=tap,192.168.1.94,192.168.1.98 --
eth1=A Type the commands to be executed during start up
and save to a text file:
Now you can ping from pc1 to your Internet gateway
to check the connectivity. slynux@gnubox:~/netkit_testlab$ vim pc1.startup
Set nameserver, by executing the following ifconfig eth0 192.168.0.2
command: route add default gw 192.168.0.1

pc1# echo nameserver 192.168.0.1 > /etc/resolv.conf // 192.168.0.1 is slynux@gnubox:~/netkit_testlab$ vim pc2.startup
the nameserver here. ifconfig eth0 192.168.1.2
pc1# apt-get update route add default gw 192.168.1.1

You can now install additional applications to the slynux@gnubox:~/netkit_testlab$ vim r1.startup
virtual machine by using apt-get. ifconfig eth0 192.168.0.1
ifconfig eth1 192.168.1.1
pc1# apt-get install <package name>
Now let’s start the Netkit Lab using the lstart
Netkit Lab command:
Manually running vstart and a series of commands like
route, ifconfig, etc, becomes very difficult and complex slynux@gnubox:~$ cd netkit_testlab // change current directory to
in the case of emulating comparatively large networks. the lab directory
It also requires doing the same thing again and again slynux@gnubox:~/netkit_testlab$ lstart
if we are to emulate the same network topology. Netkit
Lab, an add-on script, is an exciting feature of the In order to shut down all the machines, use the lhalt
Netkit toolkit. You can write Netkit Lab configuration command from the Netkit Lab directory:
files such that by simply executing Netkit Lab, we
can configure emulation on the network. Numerous slynux@gnubox:~/netkit_testlab$ lhalt
virtual machines can be initialised from Netkit Lab
configuration files. Try writing the lab config for more complex network
Let us see how to make Netkit Lab work. topologies.
Create a directory (say, netkit_testlab) and include Netkit is arguably the best way to start
the following files in the netkit_testlab directory. experimenting with networking. Some universities are
 lab.conf – this file consists of configuration details already using Netkit as a teaching aid. Through the
about the virtual machines like interfaces and UML-supported backbone, Netkit provides a real-time
collision domains. experience on emulation on network topologies. Find
 <virtual_machine>.startup – this file consists of more bytes from www.netkit.org. Happy hacking till we
commands to be executed initially while the virtual meet again! 
machine starts.
 <virtual_machine> – a blank directory with the By: Sarath Lakshman
same name as that of the virtual machine. The author is a Hacktivist of Free and Open Source
Let us set up a Netkit Lab to bridge two machines Software from Kerala. He loves working on the GNU/Linux
through a router with different IP address families: environment and contributes to the PiTiVi video editor
project. He is also the developer of SLYNUX, a distro for
newbies. He blogs at www.sarathlakshman.info
slynux@gnubox:~$ mkdir netkit_testlab

82  |  AUGUST 2009  |  LINUX For You  |  www.LinuxForU.com


_____________________________________________ Guest Column  |  The Joy of Programming

S.G. Ganesh

Demystifying the ‘Volatile’ Keyword in C


Most programmers don’t understand the meaning and significance of the ‘volatile’ keyword. So let’s
explore that this month.

O
ne of my favourite interview questions for novice disastrous: the loop will never terminate because neither
programmers is: “What is the use of the ‘volatile’ is curr_time updated nor is the timer de-referenced
keyword?” For experienced programmers, I ask: repeatedly to get new (updated time) values.
“Can we qualify a variable as both ‘const’ and ‘volatile’—if What we need is a way to tell the compiler not to
so, what is its meaning?” I bet most of you don’t know the ‘play around’ with such variables by declaring them
answer, right? volatile, as in:
The keyword ‘volatile’ is to do with compiler
optimisation. Consider the following code: volatile long * timer = 0x0000ABCD;
volatile curr_time = *timer;
long *timer = 0x0000ABCD;
// assume that at location 0x0000ABCD the current time is available Now, the compiler will not do any optimisation
long curr_time = *timer; on these variables. This, essentially, is the meaning
// initialize curr_time to value from ‘timer’ of the ‘volatile’ keyword: It declares the variables as
// wait in while for 1 sec (i.e. 1000 millisec) ‘asynchronous’ variables, i.e., variables that are ‘not-
while( (curr_time - *timer) < 1000 ) modified-sequentially’. Implicitly, all variables that are not
{ declared volatile are ‘synchronous variables’.
curr_time = *timer; // update current time How about qualifying a variable as both const and
} volatile? As we know, when we declare a variable as const,
print_time(curr_time); we mean it’s a ‘read-only’ variable—once we initialise it, we
// this function prints the current time from the will not change it again, and will only read its value. Here is
// passed long variable a modified version of the example:

Usually, hardware has a timer that can be accessed long * const timer = 0x0000ABCD;
from a memory location. Here, assume that it’s // rest of the code as it was before..
0x0000ABCD and is accessed using a long * variable ‘timer’
(in the UNIX tradition, time can be represented as a long We will never change the address of a timer, so we can
variable and increments are done in milliseconds). The put it as a const variable. Now, remember what we did to
loop is meant to wait one second (or 1,000 milliseconds) declare the timer as volatile:
by repeatedly updating curr_time with the new value from
the timer. After a one second delay, the program prints the volatile long * timer = 0x0000ABCD;
new time. Looks fine, right?
However, from the compiler point of view, what the We can now combine const and volatile together:
loop does is stupid—it repeatedly assigns curr_time with
*timer, which is equivalent to doing it once outside the volatile long * const timer = 0x0000ABCD;
loop. Also, the variable ‘timer’ is de-referenced repeatedly
in the loop—when it is enough to do it once. So, to make It reads as follows: the timer is a const pointer to a
the code more efficient (i.e., to optimise it), it may modify long volatile variable. In plain English, it means that the
loop code as follows: timer is a variable that I will not change; it points to a
value that can be changed without the knowledge of the
curr_time = *timer; // update current time compiler! 
long temp_time = *timer;
while( (curr_time - temp_timer) < 1000 ) About the author:
{ /* do nothing here */ S G Ganesh is a research engineer in Siemens (Corporate
Technology). His latest book is “60 Tips on Object Oriented
}
Programming”, published by Tata McGraw-Hill. You can reach
him at [email protected].
As you can see, the result of this transformation is

www.LinuxForU.com  |  LINUX For You  |  AUGUST 2009  |  83


image is released under Creative Commons Attribution 2.0 Generic Licence.
Open Gurus  |  Tips and Tricks _____________________________________________________________________________________
©ThePrairie dawn [www.flickr.com/photos/jamesjordan/].

make My Day!
The ‘make’ utility is one of the cleverest tools in the world of open source. It can
be used in a variety of situations that are not just limited to programming. This
article explores a little-known feature of ‘make’.

T
o begin with, here’s the exists and is newer than its prerequisites.
disclaimer: this article is not The commands are executed only if the
a tutorial or manual for make. target is not up-to-date. The commands
Please read and understand may end up updating the target. Each of
the documentation for make before you try the prerequisites can be the target in other
the experiment mentioned in this article. make rules. Thus we have a whole tree of
There are literally thousands of sources from targets and prerequisites.
where you can learn about make. The tutorial make is a very clever program. It works
at www.wlug.org.nz/MakefileHowto is a neat backwards, starting with the target of
and crisp one. The one at www.makelinux. the first rule in the file. It walks down the
net/make3/make3-PART-1.html is longer and recursion chain of target-prerequisite-
more in depth. target, until it finds a target that has no
With that out of our way, let’s get prerequisites, or whose prerequisites
started, shall we? A make rule is composed have no rules. Once it hits one of those,
of the following: it walks back up its recursion chain and
runs commands as necessary. It creates
target: prerequisites a recursion chain for every prerequisite it
commands encounters that has a rule, and resolves
it. It can also detect vicious circles of the
A target is considered ‘up to date’ if it following kind: A depends on B, B depends

84  |  AUGUST 2009  |  LINUX For You  |  www.LinuxForU.com


____________________________________________________________________________________________ Tips and Tricks  |  Open Gurus

on C, C depends on A.
In the simplest of cases, the prerequisites are all files.
But there may be situations in which you would like to
use a directory as one of the prerequisites. make enables
you a way to handle this too.
Imagine the following scenario: you have a directory
lfy/ where you have files lfy1, lfy2, lfy3. You usually zip all
the files of lfy/ and keep it as a fallback copy. Every time
a new file is added to lfy/, or when any of the existing
files in lfy/ is updated, you would like to zip lfy/ again,
and store all files in a single zip file lfy.zip.
You can write a simple rule with the target as lfy.
zip, and prerequisites as lfy1, lfy2, lfy3. But if you have
1000 files in lfy/, you cannot obviously list each of them
by name. Or, if files keep getting added or removed
from lfy/ frequently, you don’t want to keep rewriting
the rules each time. You would like to use a wildcard
expansion of lfy/ and let the wildcard do all the book-
keeping. Try the following experiment:
1. Create a directory lfy/ and add the dummy files lfy1,
lfy2 and lfy3 in it using touch. In fact, you can fill up
the directory with a 1000 files, if you want.
2. Create a blank file testmake and enter the following in it:

# testmake start
# Calling sequence “make -f testmake”
objects := $(wildcard lfy/*)
lfy.zip : $(objects)
echo lfy is more recent
zip lfy.zip lfy/*
#end testmake

3. Run make, using make -f testmake. It will create lfy.
zip.
4. Run make using make -f testmake. Nothing happens,
since lfy.zip is up-to-date.
5. Now run touch lfy/lfy1 and run make -f testmake.
It will update lfy.zip. In fact, lfy.zip will get updated
every time any file in the lfy/ directory is touched
(updated).
6. Remember, lfy.zip should not be in the lfy/ directory,
since it will cause an endless loop in the above
script.
You can get all the files of the above experiment along
with documentation, as a single zip/tar bundle by sending a
mail to [email protected]. In fact, this is a more elegant
solution than the one I proposed in an earlier article in LFY
(‘Treasure Hunt with Find’, July 2008). 

By Dr. S Parthasarathy
Dr Partha is an aggressive supporter of FOSS. He teaches
discrete mathematics, and preaches LaTeX and Linux to
students of computer science. His website at http:\\algolog.
tripod.com\nupartha.htm gives more details about him. Contact
him at drpartha[at]gmail[dot]com.

www.LinuxForU.com  |  LINUX For You  |  AUGUST 2009  |  85


Open Gurus  |  Let’s Try _____________________________________________________________________________________________

Programming in Python for Friends and Relations—Part 16

Creating a
Screencast
Create screencasts to demonstrate your products.

S
creencasts are an increasingly Defining the screencast
common way of explaining In this tutorial, start with taking a sequence
software products—I probably of screenshots you wish to elaborate
prefer Turbogears to Django on. Then write a script for each of the
because of the 20-minute wiki screencast by screenshots. The application—Festival or
Kevin Dangoor [files.turbogears.org/video/ eSpeak—will be the ‘actor’ that converts
20MinuteWiki2nd.mov]. So, this month, let the dialogue in the script into a voice. Each
us create a movie. A programmed slide show scene will comprise the screenshot being
has been chosen as a simple illustration. The displayed for as long as it takes to speak the
ideas can be expanded to create effective and corresponding dialogue.
compelling screencasts. The same concept Create a set of screenshots for the
can transform your digital images into an product you wish to talk about in a
exciting audio/video treat for your parents. directory, numbering them sequentially—for
A movie is really a sequence of images example, PhotoApp00.png, PhotoApp02.png,
displayed at a predefined rate. The images are … PhotoApp05.png.
synchronised with the soundtrack. A group of You can either write the script in a
images along with the corresponding audio is separate text file for each screenshot or in
regarded as a ‘scene’ in a movie. Independently a single file. In this tutorial, we will look
created scenes can be pieced together to create at writing it in a single file—a header line
the illusion of a longer movie. followed by the script and a blank line for

86  |  AUGUST 2009  |  LINUX For You  |  www.LinuxForU.com


___________________________________________________________________________________________________ Let’s Try  |  Open Gurus

each of the slides in order. The first two characters of the needed for the duration of the speech file.
header will be the image number. The speech file and the images (using the mf://xx*.
jpg URL) are combined and converted into an AVI file by
00 using Mencoder. The sound file is converted to an MP3. If
Start the python application my_photos from the terminal you are familiar with FFmpeg, you may use that instead
of Mencoder.
01 Finally, all the AVI files are combined into a single AVI file.
A new image will be displayed to you. The code for the generator to fetch the image and the
text file will be as follows:
02
Type the text you would like to appear as a caption in the text box. def scene_data(script_file):
while True:
03 # the first two characters in the script are the scene id
Once you press enter, the text will be displayed on the image as you can scene_id = script_file.readline()[:2]
see. # readline will return an empty string after EOF
if scene_id.strip() == ‘’:
04 break
Now, click on the save and next button. The image will be saved. # the images are png files in screencast subdirectory
im_file = ‘screencast/PhotoApp’ + scene_id + ‘.png’
05 image = Image.open(im_file)
And you will be shown the next picture. frame = image.resize((640,480))
Repeat the steps until all the photographs are processed. # read lines until an empty line
Note, that if you do not wish to put a caption on a picture text = ‘’
and save it, you can press the next button. while True:
line = script_file.readline()
The implementation if line.strip() == ‘’:
The core logic of your application will be as follows: break
# Append replacing new line by a space
#!/usr/bin/env python text += line.replace(‘\n’, ‘ ‘)
import os, sys yield scene_id, frame, text
import wave
import Image, ImageTk, ImageDraw The script file structure was explained above. The
code keeps reading the script file until there is no more
script_file = open(‘Script.txt’) data. The first two characters of the header line are
# iterate over each scene the scene ID. The images must be named as per a fixed
for scene_id, image, text in scene_data(script_file): format with two characters being the scene ID.
duration = text_to_speech(text) The image is resized to a fixed size. The generator
# create frames assuming 25 frames per sec yields the values of the scene ID, the resized image and
for frame_no in range(25*duration): the text associated with that image.
image.save(scene_id + “%03d”%frame_no +”.jpg”) The next step is the code to convert the text to speech.
# convert the frames into a scene
os.system(‘mencoder -audiofile ‘ + scene_id + ‘text.wav -oac mp3lame def text_to_speech(text):
“mf://’ \ # uncomment ESPEAK or FESTIVAL command and system call
+ scene_id +’*.jpg” -mf fps=25 -o out_’ \ #ESPEAK = ‘espeak -w text.wav -s120 “%s”’
+ scene_id + ‘.avi -ovc lavc -lavcopts vcodec=mpeg4’) #os.system(ESPEAK % (text))
# Create an animated scene to end using the last image FESTIVAL = ‘echo %s | text2wave -o text.wav -F 44100 -scale 2.0’
animated_scene(image) os.system(FESTIVAL % (text))
# combine the scenes into a single film win = wave.open(‘text.wav’)
os.system(‘mencoder -ovc copy -oac mp3lame -o output.avi out_*.avi’) # modify the wave file to add a short silence
# before the start and at the end
The script file is opened. It’s best for the scene ID to wout = wave.open(scene_id + ‘text.wav’,’w’)
be a numeric string of a fixed number of digits. That will # create the wave file with same parameters in the input file
ensure the order of scenes is easily maintained. wout.setnchannels(win.getnchannels())
An image and the corresponding text are selected. wout.setsampwidth(win.getsampwidth())
The text is converted to a speech file. The image is copied wout.setframerate(win.getframerate())
as many times as the number of frames that will be # half a second of silence

www.LinuxForU.com  |  LINUX For You  |  AUGUST 2009  |  87


Open Gurus  |  Let’s Try ____________________________________________________________________________________________________

silence_frames = win.getframerate()/2 draw_s.rectangle([(0,0), box_size], fill=’RED’)


# mono 16bit sound frames draw_s.text((25,25),’The’)
silence_data = silence_frames*’\x00\x00’ # create a green circle with diameter 100
wout.writeframes(silence_data) im_circle = Image.new(‘RGB’,box_size)
data = win.readframes(win.getnframes()) draw_c = ImageDraw.Draw(im_circle)
wout.writeframes(data) draw_c.ellipse([(0,0),box_size], fill=’GREEN’)
wout.writeframes(silence_data) draw_c.text((25,75),’End’)
# divide the number of frames by frame rate # create a mask to show only the (green) circle
duration = float(wout.getnframes())/wout.getframerate() r,mask,b = im_circle.split()
win.close() # create the frames
wout.close() scene_id = ‘99’
return duration x_s = 0
x_c = 640 - 100
The code to get a wave file of the speech is a mere two for frame_no in range(nframes - 1):
lines. You can use the espeak or the text2wave command image = bg_image.copy()
from the Festival package. The latter’s voice quality is image.paste(im_square, (x_s,200))
better. (I needed the frequency of the wave file to be image.paste(im_circle, (x_c,200), mask)
44100 for the sound for various scenes to be synchronised x_s += x_step
after conversion to MP3 audio.) x_c -= x_step
You can use the wave module to improve the image.save(scene_id + “%03d”%frame_no +”.jpg”)
presentation by inserting short silences at the start and # freeze the final frame for a second
the end of the wave file. This makes the presentation for frame_no in range(nframes, nframes + 25):
sound more natural. image = bg_image.copy()
image.paste(im_square, (270,200))
End with a little animation image.paste(im_circle, (270,200), mask)
On the final image, a red square moves from left to right image.save(scene_id + “%03d”%frame_no +”.jpg”)
with ‘The’ written on it. You also create a green circle that # convert the frames into a scene. Use the logout sound
moves from right to left with ‘End’ written on it. The two os.system(‘mencoder -audiofile /usr/share/sounds/logout.wav \
merge at the centre. The image is frozen for a second. You -oac mp3lame “mf://’ + scene_id +’*.jpg” -mf fps=25 -o out_’ \
add the logout sound of the desktop to the scene. As it is + scene_id + ‘.avi -ovc lavc -lavcopts vcodec=mpeg4’)
the final image, you can ignore differences in the duration
of the sound file and the video. Even a small bit of animation takes some code.
The core concept is that you create the foreground
def animated_scene(bg_image): images that will appear to move. Make a copy of the
“””A square with ‘the’ and a circle with ‘end’ original image that will serve as the background. Paste
float across a background image from opposite sides the foreground images at a new location and save the
and merge. resulting image as a frame.
“”” In our restless world, time is at a premium. So, go
duration = 2 ahead and create 30-second just-in-time tutorials for
nframes = 25*duration your application, and they are sure to be a hit. 
box_size = (100,100)
x_step = (640 - 100)/(2*nframes)
By: Dr. Anil Seth
# create a red square 100x100
The author is a consultant by profession and can be reached at
im_square = Image.new(‘RGB’, box_size)
[email protected]
draw_s = ImageDraw.Draw(im_square)

A Portal For Technologists And Technopreneurs

88  |  AUGUST 2009  |  LINUX For You  |  www.LinuxForU.com


____________________________________________________________________________________________ Overview   |  Developers

Linux Network Stack


Administration
A Developer’s Approach
This article explores the various methods of managing the networking stack using
application-level C programs, kernel-level C programs, the proc filesystem, etc.

O
f late, Linux has been gaining programs, the proc filesystem, etc.
popularity in IT-enabled industries. proc is a virtual filesystem that can be
Linux networking has grown side by located under the /proc mount point. This is
side with the operating system, and really not a filesystem, but a window to look
it’s very common to see Linux-enabled devices into the Linux kernel. The files inside /proc are
in the networking domain. not really files but can be termed as calls to
Linux provides a very versatile, efficient kernel functions. Therefore, reading or writing
and well-organised network stack. The TCP/IP a proc file results in a function call invoked in
implementation of Linux could be considered kernel space, which can be used to read/write
one of the best amongst operating systems. kernel parameters and therefore monitor
While packet processing through TCP/IP is and/or control the Linux networking stack. The
a very interesting topic, this article will cover Linux networking stack also provides many
monitoring and managing the Linux TCP/IP virtual files inside /proc, which can be used to
stack. Although there are many tools that can monitor and/or control the networking stack.
be used for the same purpose, this article aims This article is divided into three sections—
to explore administration of the networking monitoring, management/control and security,
stack without using external tools. This is more though sometimes it is difficult to make a clear
useful, especially for developers while working distinction between these three aspects.
on embedded or remote systems where such
‘external’ tools are not available. Monitoring
This article attempts to cover the various Here, we will cover some of the methods to
methods of managing the networking stack, i.e., monitor the TCP/IP networking stack.
by application-level C programs, kernel-level C Packet monitoring: The primary

www.LinuxForU.com  |  LINUX For You  |  AUGUST 2009  |  89


Developers  |  Overview _ __________________________________________________________________________________________________

requirement of network stack administration is to monitor strncpy(ifr.ifr_name, IF_NAME, IFNAMSIZ);


the packet flow through the system. Linux provides a file ioctl(fd, SIOCGIFFLAGS, &ifr);
named /proc/net/dev, which shows the packet flow through ifr.ifr_flags |= IFF_PROMISC;
every interface in the system. The following table shows an ioctl(fd, SIOCSIFFLAGS, &ifr);
example from /proc/net/dev file. Although the file has many
more fields, some have been stripped down for a better /* bind to “eth0” if only those packet arriving on “eth0” are required */
understanding. strncpy(ifr.ifr_name, IF_NAME, IFNAMSIZ);
setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, (char*)&ifr, sizeof(ifr));
foo@localhost:~$ cat /proc/net/dev
recv(fd, buf, sizeof(buf), 0);
Inter-| Receive Transmit
face | bytes packets errs drop | bytes packets errs drop The above code snippet, with ignored error checks, shows
lo: 80036 1597 0 0 | 80036 1597 0 0 how to capture a packet arriving at the interface eth0. The
eth0: 0 0 0 0 | 0 0 0 0 packet contents can be used to have a deeper look into the
eth1: 26922 154 0 0 | 19871 194 0 0 established or attempted connections/flows.
In the above example, socket_type is used as SOCK_RAW
As the example shows, the system has received 26922 to receive the entire packet including the link layer header.
bytes and 154 packets over the eth1 interface while the eth0 The SOCK_DGRM socket_type can be used to capture
interface has not received any packet. Similarly, the system packets with the link layer header removed.
has transmitted 19871 bytes and 194 packets over the eth1 When the protocol field is set to ETH_P_ALL, all protocol
interface. Clearly, no error packets were received, and none packets are received.
were dropped either. Many packet-capturing tools are based on PF_PACKET
Therefore this file can be used for a quick view of packet sockets. Those packet-capturing tools provide the additional
flow through the system. functions of packet filtering, organised display of packet
As the received/transmitted packets are processed by IP contents, etc, which make administration simpler.
and TCP/UDP protocols, a deeper look of the packet flow can
be viewed in /proc/net/snmp file. A stripped down view of the Management/Control
file is shown below: This section describes some methods for the management
and control of the TCP/IP networking stack.
Ip: InReceives InDiscards OutRequests OutDiscards Packet forwarding: A networking system running Linux
Ip: 2725 0 2519 0 can be configured to run as a host or as the router. In the
Icmp: InMsgs InErrors OutMsgs OutErrors latter case, the system can forward packets destined for other
Icmp: 72 0 73 0 machines, to the appropriate next hop. Packet forwarding on
Udp: InDatagrams NoPorts InErrors OutDatagrams Linux can be controlled, per interface, by modifying /proc/sys/
Udp: 116 0 0 116 net/ipv4/conf/<device_name>/forwarding. Writing 0 in this file
disables packet forwarding while 1 enables packet forwarding.
The above example shows the packet distribution at the Address resolution: The ARP protocol is used for IP
upper layers. This file shows many more packet counts for address resolution. Complex networking systems have many
different cases like packet header errors, address errors, port interfaces and many IP addresses. It is possible to control
errors, etc. which source address is put in to the ARP protocol headers
Therefore this file is useful for a quick view of connection using the file located at /proc/sys/net/ipv4/conf/<device_
patterns through the system. name>/arp_announce. It takes the following values:
Packet capturing: Linux provides a very powerful and  0 – (default) any local address
versatile socket interface that can be used to pick packets  1 – uses the address from the same subnet as the target
directly from the Ethernet or IP layer. These sockets are called address
PF_PACKET sockets. The following small snippet of C code  2 – prefers the primary address
shows how to use PF_PACKET sockets to capture packets Therefore, this file provides a way to control address
arriving at the system. resolution.
Resolution timeout: The Linux kernel tries to resolve an
#define IF_NAME “eth0” IP address through ARP if the address is not already resolved.
struct ifreq ifr = {0} This process queues the outgoing application packets and
starts the address resolution procedure.However, if the target
fd = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL)); system is not reachable, the kernel must give up address
resolution after some tries and intimate the application
/* Set promiscuous mode to capture even those packets which are not destined about the unreachable destination. The maximum number
to our host */ of attempts to resolve the IP address through multicast/

90  |  AUGUST 2009  |  LINUX For You  |  www.LinuxForU.com


__________________________________________________________________________________________________ Overview  |  Developers

broadcast ARP can be specified in the file /proc/sys/net/ipv4/ Linux provides gratuitous ARP message processing
neigh/<device_name>/mcast_solicit. control by editing the file /proc/sys/net/ipv4/conf/<device_
Local port range: If a networking application does not name>/arp_accept.
specify the transport port (i.e., binds to port 0), the kernel For example, the command “echo 0 > /proc/sys/net/ipv4/
assigns one local port to the application. The port is chosen conf/<device_name>/arp_accept” forces the system to drop all
from a range that can be controlled by file /proc/sys/net/ipv4/ gratuitous ARP messages on the given device.
ip_local_port_range. Note: ARP gratuitous messages can be useful for
networking systems that provide IP address
Security redundancy over multiple interfaces. In such cases, for
The Linux networking stack provides many ways to perform example, eth0 and eth1 having the same IP address but
stack hardening. This helps in making the system more secure different MAC addresses, only one of the interfaces remains
and less vulnerable to external attacks. active. As soon as an active interface goes down for some
Capabilities: The Linux kernel provides an API, “int reason, the standby interface becomes active and sends a
capable(int cap)”, which can be used to verify the credentials gratuitous ARP message with the same IP address but a
of a running application, and if the application does not have different MAC address. Therefore, all the hosts in the network
sufficient privileges, the process can be terminated. Linux update their ARP cache and start sending traffic to the eth1
defines several capabilities like CAP_NET_ADMIN, CAP_ interface, thereby providing IP address redundancy.
NET_RAW, etc. Details for all the capabilities can be looked Cache thrashing: Since the Linux kernel accepts ARP
up in the include/linux/capability.h file. The following code responses (including gratuitous ARP responses) to update the
snippet shows how to verify whether the application holds ARP cache, it is possible to mount an ARP cache thrashing
privileges to open raw sockets: attack where continuous ARP responses are flooded to the
victim system. To prevent such attacks, the Linux kernel
if (!capable(CAP_NET_RAW)) provides a way to specify the minimum time interval between
return –EPERM; /* application does not have privileges to open raw sockets */ two consecutive ARP responses to be accepted. The time
interval can be specified in the file /proc/sys/net/ipv4/neigh/
ICMP Redirect: ICMP Redirect is sent by gateways to <device_name>/locktime.
a host if it, due to a wrong assumption, sends a packet to ICMP flood: The ICMP echo request and echo reply
the gateway destined for the local host in the same subnet. messages are used to verify network connectivity
However, an attacker can forge and send an ICMP Redirect between two hosts. These messages do not carry any
packet to a host, to divert packets for certain destinations user data or useful data, and are only used to check
through the attacker’s host. network connectivity. However, it is possible to flood
Therefore, sometimes it is necessary to control ICMP a system with ICMP echo messages causing the target
Redirect messages. This can be done by editing /proc/sys/net/ system to do unnecessary processing and making the
ipv4/conf/<device_name>/accept_redirects. Writing 0 in this system slow down.
file forces the system to ignore all ICMP Redirect messages. Linux provides a way to control such ICMP echo
Secure redirect: To combat a forged ICMP redirect messages by editing the following files:
message and still accept a valid ICMP redirect message, Linux  /proc/sys/net/ipv4/icmp_echo_ignore_all
provides a secure redirect mechanism, which is accessed  /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
by editing the file /proc/sys/net/ipv4/conf/<device_name>/ As the names suggest, the above files can be used to
secure_redirect. selectively drop either all or broadcast ICMP echo messages.
Writing 0 to this file forces Linux to accept the ICMP Therefore, it is possible to prevent any ICMP flood attacks
redirect message from any host, while 1 means Linux will using the above mentioned files.
accept the ICMP redirect message only from gateways Although this article covers some of the features of
present in the default gateway list. This prevents most of administering the Linux networking stack, Linux is much
the malicious ICMP redirects and accepts only legitimate richer and more flexible than indicated here, in terms of
redirects. management and control.
Cache poisoning: The ARP protocol provisions for This flexibility makes Linux one of the most sought after
gratuitous ARP messages, by which a host itself can announce operating systems in the networking industry. Linux will go a
the IP and MAC address. All the hosts receiving gratuitous long way in the years to come. 
ARP messages update their ARP cache with the new MAC
address announced. By: Mohan Lal Jangir
However, this feature can be exploited by malicious hosts The author works as a development lead in Samsung India’s
that announce some other host’s IP address as their MAC software operations at Bangalore. He has a master’s degree in
Computer Technology from IIT Delhi, and is very interested in
address. Thereby, the attacker causes all other hosts in the Linux, networking and network security. He can be reached at
network to forward packets destined to a legitimate host, to [email protected].
the attacker.

www.LinuxForU.com  |  LINUX For You  |  AUGUST 2009  |  91


Developers  |  How To _______________________________________________________________________________________________

VBA Macro
Interoperability in
OpenOffice.org

This article explains VBA support in OpenOffice.org, including the build


process of Go-oo.

T
he ABC Auditing Company OOo that could handle VBA also. Thankfully,
decides to migrate to this is not a dream and is possible with
OpenOffice.org. The firm gets a some versions of OOo that support VBA.
copy of OOo installed on every ABC Auditing should have chosen the right
machine and trains its employees to work version when it decided to migrate to OOo.
with documents in ODF (Open Document
Format), as well as with older documents VBA macros
that were prepared in the MS Office format, Visual Basic for Applications (VBA) is an
in OOo. Everything seems to be going implementation of Microsoft’s Visual Basic
smoothly. integrated into Microsoft Office applications.
Suddenly, however, it’s noted that a few You may wonder about the need for
important Excel (spreadsheet) documents such a discussion in a FOSS article. Well,
with macros are not functioning properly in many organisations are migrating to OOo
OOo. They may need a developer to rewrite nowadays, but a lot of their old documents
VBA code in OOBasic. This may take some are in the MS Office format. When an MS
time and money, as going back to the old Office document is opened in OOo, the VBA
environment is not an option any longer. macros present in them are unusable under
The manager now wishes he had a copy of most circumstances. So VBA macros have to

92  |  AUGUST 2009  |  LINUX For You  |  www.LinuxForU.com


_____________________________________________________________________________________________________ How To  |  Developers

be rewritten in OOBasic to avail the same functionality in


OOo. This becomes a major issue in migrating to OOo. To
overcome this, recent versions of OOo come with support
of VBA interoperability. The Go-oo flavour of OOo is a
better choice for this purpose.

Some background on Go-oo


Go-oo is Novell’s effort, which is an addition to Sun’s core.
Some pending issues in the upstream have been fixed and
it comes with some additional functionality. Here are a few
advantages that the Go-oo people claim, when compared
to other flavours of OOo.
 Quicker start-up
 VBA support and better Excel interoperability.
 A quick starter in the system tray.
For a complete list of the advantages, please visit go-
oo.org/discover. Figure 1: OOo architecture [Source : wiki.services.openoffice.org/wiki/Architecture]
So, thinking of getting a copy of Go-oo? You will find
that pre-built binaries for Linux, Mac and Windows are  sw is for Writer
available from go-oo.mirrorbrain.org/stable.  chart2 is for Calc charts
At present, Go-oo support for VBA is to a much greater  formula is for math
extent for Excel spreadsheets compared to only a little for  oovbaapi is for VBA support
Word documents. There's no VBA support for Power Point  sfx2 is a framework for Calc, Writer, Impress, etc.
presentations, yet. You need to build Go-oo from sources  vcl is the UI Core
to do some hacks or add VBA bits. The rest of this article It is not advisable to change modules in the bottom
explains how to build Go-oo and how to contribute by or middle layers like vcl, svx, etc. This is because changing
adding VBA properties and objects. these modules may lead to many side effects. Always try to
fix issues by changing the top layer.
VBA support in OOo
The latest versions of upstream OOo and many versions of About ooo-build
Go-oo come with VBA support. When an Excel document Unlike the upstream OOo, one should obtain a copy of ooo-
is opened in OOo, the VBA code used for macros is loaded build first, as it is a wrapper for Sun’s core. It contains many
as it is, with an additional line at the beginning—Option patches that are pending for upstream approval (though,
VBASupport 1. This tells the macro handler of OOo to of course, accepted by the Go-oo team) and additions to
process the code as per VBA specifications instead of the core. On configuring ooo-build, a download script will
default OOBasic. retrieve the required sources. When you run make inside
To enable/disable VBA Model, go to Tools→Options→ ooo-build the sources are extracted, patches are applied
Load/Save→VBA Properties. For each type of document, and then it prepares for an actual build. Thus, compared
opt for load/save options. If the option ‘Executable code’ is to the core, Go-oo enables faster integration of hacks by
not selected for Excel documents, the VBA code in Excel contributors and additional features like VBA.
is loaded as comments when opened in OOo, just like in Once a patch is approved by upstream at a later time,
older versions that don’t have VBA support. then only it's removed from ooo-build and merged into core.

OOo architecture Building Go-oo


The OOo source is divided into modules. The advantage The build takes around 8-10 hours on a machine with a
of this modular design is that each module can be rebuilt typical configuration—and could take more or less time
independently if you want to update the concerned depending on hardware configuration. On a machine with
libraries to reflect changes. For example, if a Calc related an AMD Athlon 1700+ processor and 512 MB RAM, it takes
bug needs to be fixed, only the sc module should be rebuilt. around 10 hours. On a Core 2 Duo 2GHz processor with 3
Around 200 modules exist in the current source code— GB RAM it takes around 4.5 hours.
at a location like ooo-build/build/ooo3??-m??. For example, Create two files -- t1and t2, before and after a build in
the source tag ooo310-m15 means OOo 3.1.0 version, with order to figure out the time taken.
milestone 15.
Some of the important modules are: touch t1 ; make ; touch t2
 sc is for Calc
 sd is for Draw and Impress The difference between time stamps of the t1 and t2

www.LinuxForU.com  |  LINUX For You  |  AUGUST 2009  |  93


Developers  |  How To ______________________________________________________________________________________________________

files will tell you the time taken for the build. 4. make: This will start the build process, starting with
You can interrupt the build process in the middle if extracting source files, applying patches, and then
you’re running out of disk space. Free up some disk space going on to the actual build (configuring and compiling
and then run make again to resume the build process. If each module). Wait until the actual build starts, as
some missing packages are reported in the middle (which many missing packages will be reported at this phase.
happens very rarely), install them and run make again to For example, if an error like ‘cups.h not found’ appears,
resume. install the cups-devel package to fix it. Once a few
modules (boost, stlport, etc) start compiling, you can
Requirements take a break until the build completes.
 A 1.5 GHz or higher processor 5. bin/ooinstall -l <path-to-install>: It installs OOo
 512 MB RAM; 1 GB or higher recommended to with links from the built sources—that’s why it’s called
minimise build time a ‘linkoo’ build. You can also use the make install
 10 GB free disk space (just for build, excluding OS command to install your OOo build. However, after
requirements), 5 GB or more space for further hacks every hack you have to run make install again in order
and if you plan to add debug support for some to reflect the changes. So the special script ooinstall can
modules. be used instead to reflect changes without a reinstall
 A distro with a comfortable package manager every time.
 Internet connectivity on Linux recommended
6. cd <path-to-install>/program
Step-by-step procedure
1. Check out ooo-build: You can check out the ooo-build 7. source ./ooenv: This will prepare a shell to run OOo.
repository through version controls like SVN, Git, etc:
svn co svn://svn.gnome.org/svn/ooo-build/trunk ooo-build 8. ./soffice.bin: You can also add options like -writer,
or: -calc, or -impress, to run specific components directly.
git clone git://anongit.freedesktop.org/git/ooo-build/ooo-build The soffice command takes the file name as the
You can also manually download the latest ooo- argument, which is loaded on start-up.
build tarball from download.go-oo.org. However, using a
version control is always advisable. Hacking Go-oo
2. Configure: Now that the soffice instance is running properly from the
./autogen.sh --with-distro=YOURDISTRO --with-gcc- built source, let’s do a small hack. Go to the vcl/ directory
speedup=ccache,icecream [ooo-build/build/ooo3??-m??/vcl/] and edit source/window/
Here you have to specify your distribution name menu.cxx by changing the following line (around line
with the --with-distro option. To see a list of supported number 1800):
distros, run the script once without this option. Use the
nearest match if a specific distro is not listed. pData->aText = rStr;
The ccache,icecream option helps to accelerate
the build process. The build time will substantially to:
reduce if you add those with the --with-gcc-speedup pData->aText = String(rStr).Reverse();
option. Use --with-icecream-bindir=/usr/bin if you get Run the following commands to build the vcl module:
an error like “icecream’s gcc not found”. If you haven’t
used version control and downloaded the tarball . ../LinuxX86Env.Set.sh ## dot space dot dot slash LinuxX86Env.Set.sh
directly, use the configure script instead of autogen.sh. build
./configure --with-distro=YOURDISTRO --with-gcc-
speedup=ccache,icecream You can use build debug=true instead to add debugging
support for a specific module.
3. ./download: This will download the required sources We’ll use the deliver command on completion of the
directly using wget. Please note that the resume option build to ensure changes are made when, by chance, make
is not available, as the download script won’t use wget install is run at a later time.
with resume option. If your Internet connection is slow Now, make sure no previous instance is running by
or not available you have to download the required closing OOo manually or with the command:
sources manually using a different machine and copy
to src/ directory. Apply your own logic to find out the killall -9 soffice.bin
required sources. Use the --with-tag option during
configuration to use different sources other than the Re-run soffice.bin from the program directory to see
default. the changes. Notice anything different? Yes, all the menu
item characters are now in the reverse order (Figure 2).

94  |  AUGUST 2009  |  LINUX For You  |  www.LinuxForU.com


_____________________________________________________________________________________________________ How To  |  Developers

Undo the above change and build again to revert back to a


sensible OOo install.
Pick up any other issue from qa.openoffice.org and hack
on it.
Anyway, that was just an example—although, not at
all useful. This article mainly focuses on implementing
missing VBA properties and objects. Figure 2: OOo hacked to make the names of the menu items appear in reverse order

Adding VBA bits MsgBox Application.Sheets(1).Name


As mentioned earlier, OOo is not fully interoperable Application.Sheets(2).Name=”Hello”
with VBA, which is still under heavy development by
Sun, Novell and others. So contributions are expected to To add a new VBA Object, say Sample, create XSample.
improve interoperability. idl in oovbaapi/ooo/vba/excel/. Add the concerned entry in
ooo-build/test/macro/missing_vbafeatures.ods will give makefile.mk, then build and deliver in oovbaapi. Next, create
you an updated list of missing VBA features. vbasample.hxx and vbasample.cxx in sc/source/ui/vba/ with
To add any VBA object or property, we need to modify an addition of vbasample.o to makefile.mk, followed by
two modules: build and deliver in sc.
1. oovbaapi module—idl files, interface for objects
2. sc module—hxx, cxx files, actual implementation HelperAPI
Here is a small example on how a property is added to HelperAPI is a parallel solution to support VBA in Star
a VBA object. Office, which is Sun’s proprietary offering based on OOo.
Pick up any missing property from missing_vbafeatures. But with the agreement of Sun and Novell to work together
ods, say Application.Sheets. Implementation for the on VBA, Sun has donated HelperAPI and made it open
Application Worksheets property is already available, so now. HelperAPI is implemented in Java, whereas oovbaapi
linking the Sheets property to the Worksheets property are C++ based. But still, understanding HelperAPI can help
can fix the issue. Actually, Sheet differs from Worksheet in one to implement VBA better and avoid working from
the sense that a sheet can be a worksheet or a chart. For scratch.
the moment, let’s consider both as the same. So you now have the basic idea on adding the VBA
Go to oovbaapi/ directory, and add the following line property. I hope you can now start building Go-oo and add
to ooo/vba/excel/XApplication.idl just before the line that some other missing features. Patches can be sent to Noel
reads “any Worksheets( [in] any aIndex );”: Power (noel dot power at novell dot com), leader of the
VBA Interoperability Project.
any Sheets( [in] any aIndex );
Acknowledgements
Now build and deliver the oovbaapi module. Next, go to I would like to thank Noel Power for his constant
the sc module, open the source/ui/vbaapplication.hxx file mentoring support in the VBA project; Shreyas Srinivasan,
and add the prototype for Sheets: former Go-oo team member, for the initial support and
mentorship on the OOo project without which I couldn’t
virtual css::uno::Any SAL_CALL Sheets( const css::uno::Any& aIndex ) throw have imagined myself with Ooo; and Michael Meeks, leader
(css::uno::RuntimeException); of the Go-oo team, for the kind support towards OOo
contributions. 
…which is similar to the Worksheets function.
Go to source/ui/vbaapplication.cxx and add the
References
definition for the above function:
• go-oo.org
• wiki.services.openoffice.org/wiki/VBA
uno::Any SAL_CALL ScVbaApplication::Sheets( const uno::Any&aIndex ) • api.openoffice.org/source/browse/api/helperapi
throw (uno::RuntimeException) • #go-oo channel or irc.freenode.net
{ • blogs.sun.com/GullFOSS/entry/sun_and_novell_work_
together
return getActiveWorkbook()->Worksheet(aIndex);
}
By: Rajesh Sola
The ooo-build/test/macro/ directory contains many xls The author is a faculty member of the computer science
and ods files to test VBA features. To test this hack, open department at NBKRIST, Vidyanagar. He is a FOSS enthusiast
any available Excel document and add the following VBA and contributor. He has presented talks on VBA interoperability
and programming OOo with macros and extensions in many
code in an existing or new module: FOSS conferences. You can reach him at rajesh at lisor dot org.

www.LinuxForU.com  |  LINUX For You  |  AUGUST 2009  |  95


Tips Tricks
How to get to a particular port on a downloaded from CPAN:
remote server
The netcat command is handy. <your_perlcode.pl>

netcat -w 3 -z -vvn 64.233.187.99 79-81 The output will be saved in the <your_perlcode.pl.tdy> file.
(UNKNOWN) [64.233.187.99] 81 (?) : Connection timed out For C programs, use GNUIndent, as indicated below:
(UNKNOWN) [64.233.187.99] 80 (www) open
(UNKNOWN) [64.233.187.99] 79 (finger) : Connection timed out indent <your_c_code.c>

This example essentially runs a port scan on google. That’s all! Now <your_c_code.c> will be indented
com from Port 79 to 81, and waits for 3 seconds for a properly. There’s no ‘tidy’ for Python because you in any
port to time out. You can see that only port 80 is open. I case write tidy beautiful Python code.
use this constantly when troubleshooting connections
between application servers and databases, especially —Jaganadh G, [email protected]
when firewalls are involved.
This is much more meaningful than a simple
ping. Note that netcat only accepts IP addresses, not Is my file defragmented?
host names, so you can ping a host first to get its IP If we want to know how badly a file is fragmented
address first. Also note that port scans may violate in ext2/ext3 in Linux, there is a utility called filefrag. It
your own network policies and could be construed makes allowances for indirect blocks for ext2 and ext3
as a form of hacking, so use at your own risk and tell filesystems. Syntax: filefrag <filename>. For example:
someone what you’re going to do before you do it.
You can install netcat on Windows using Cygwin (the # filefrag list.sh
command is nc in Cygwin). list.sh: 1 extent found
# filefrag -v list.sh
—Ajeet Singh Raina, [email protected] filefrag -v list.sh
Checking list.sh
Filesystem type is: ef53
Sort folders by size Filesystem cylinder groups is approximately 237
To sort folders by size, use the following command: Blocksize of file list.sh is 4096
File size of list.sh is 15275 (4 blocks)
du --max-depth=1 /home/ | sort -n -r First block: 143526
Last block: 143529
—Ajeet Singh Raina, [email protected] list.sh: 1 extent found

Use the -v option for the verbose mode to see the


How to indent programs properly complete blocks list.
Would you like to indent your C or Perl code
properly? Note: 1.To execute the filefrag you need to be the
If so, for Perl use perltidy as shown below. It can be super-user.

96  |  AUGUST 2009  |  LINUX For You  |  www.LinuxForU.com


2. This utility can be used for a file on any filesystem. find $HOME -name “*.mp3” | cpio -o --format=tar -F mymp3.tar

—Rajesh Battala, [email protected] You can list the contents of a .tar file, as follows:

cpio -it -F mymp3.tar


Change your default editor in Debian/
Ubuntu And to extract them, use the command below:
Execute the following command:
cpio -i -F mymp3.tar
sudo update-alternatives --config editor
—Remin Raphael, [email protected]
The options in my Debian system are:

There are 6 alternatives which provide ‘editor’. A shell inside Vim


While editing some text in Vi or Vim you may
Selection Alternative want to execute some shell commands. To do so, go to
esc mode and execute the command as follows:
———————————————————————
:!sort # for sorting the text contents
1 /bin/ed
If you want to use a shell (while programming) use
2 /bin/nano the following commands:

3 /usr/bin/vim.tiny :sh

*+ 4 /usr/bin/vim.gnome Now you can use a shell. After finishing the task with
the shell, press ^D to return to the file.
5 /usr/bin/mcedit-debian
—Jaganadh G, [email protected]
6 /usr/bin/emacs21

Press enter to keep the default[*], or type selection Nmap tips


number: Many systems and network administrators
The + sign denotes the default option, and the * sign find nmap useful for tasks such as network inventory,
denotes the actual selection; to change from vim to nano, managing service upgrade schedules, and monitoring
just press 2 in this example and then press ENTER. host or service uptime.
For checking the local system, use the following code:
Now, all applications that use an editor will use the
new default one. # nmap localhost

—Remin Raphael, [email protected] To check the remote system, issue the command
given below:
Copy files to and from archives
cpio is a tool to copy files from one place to # nmap <ip>
another, and to create archives (like tar), or extract files —Sivakumar E, [email protected]
from an archive file.
The good thing is that cpio takes its input from
other commands like ls or find. So you can archive all
Share Your Linux Recipes!
.mp3 in your home directory by entering the following
The joy of using Linux is in finding ways to get around
command: problems—take them head on, defeat them! We invite you
to share your tips and tricks with us for publication in LFY
ls *.mp3 | cpio -o --format=tar -F mymp3.tar so that they can reach a wider audience. Your tips could be
related to administration, programming, troubleshooting or
general tweaking. Submit them at www.linuxforu.com. The
Or, if you want to include sub-folders, use the sender of each published tip will get an LFY T-shirt.
code:

www.LinuxForU.com  |  LINUX For You  |  AUGUST 2009  |  97


CodeSport
Sandya Mannarswamy

Welcome to another installment of CodeSport. This month, we will continue our


discussion on deadlocks in multi-threaded applications. We will also discuss the
issue of false sharing in multi-threaded applications.

T
hanks to all the readers who mutex_lock(&count_var_lock);
sent in their responses to the printf( “count value is = %d\n”, count_var);
problems we discussed in the mutex_unlock(&count_var_lock);
previous issue. In last month’s
takeaway problem, I had given a small pthread_continue(child_thread_id);
snippet of multi-threaded code and asked }
you to find out what could have been the
potential bug hiding in it. Congratulations return(0);
to our readers Nilesh Govande, Vivek Goel, }
Arivendu Bhardwaj, Abel Sajaykumar and
Mrigendra Nagar for getting the correct void *counter_func(void *arg)
answer. As pointed out by these readers, {
the code snippet had a potential deadlock int i;
situation. Here is the buggy code snippet
from the takeaway problem: while (1)
{
void *counter_func(void *); Printf(“incrementing the counter value\n”);
mutex_lock(&count_var_lock);
int count_var; count_var++;
mutex_t count_var_lock;
//do nothing
main() for (int i=0; i<MAXCNT; i++);
{
char str[80]; mutex_unlock(&count_var_lock);
pthread_t child_thread_id;
//do nothing
pthread_create(&child_thread_id, NULL, counter_func); for (int j=0; j<MAXCNT; j++);
}
while(1)
{ return((void *)0);
}
//read the next string
Scanf (“%s”, str); As these readers correctly pointed out,
pthread_suspend(child_thread_id); the following is the deadlock condition: child
thread(counter_func) has locked the count_

98  |  AUGUST 2009  |  LINUX For You  |  www.LinuxForU.com


_______________________________________________________________________________________________ Guest Column  |  CodeSport

var_lock and the main thread sets the child thread to Given below is a small code snippet containing two
suspend. In this case, the main thread will wait indefinitely concurrent transactions. Can you determine what will
for count_var_lock and the child thread will be in suspend happen in a wait-die scheme and in a wound-wait scheme,
mode forever. respectively, for this code snippet?

Strategies to avoid deadlock T1 T2


There are deadlock prevention, deadlock avoidance and
deadlock detection and recovery strategies. Deadlock Begin transaction Begin transaction
prevention aims at removing one of the four conditions Read_item(customer ‘A’)
that are necessary for a deadlock to happen. Since ‘mutual Write_item(customer ‘A’)
exclusion’ is a condition that cannot be removed, we try to
remove any one of the other three conditions. If we want to Read_item(order ‘123’) Read_item(customer ‘A’)
avoid the ‘hold and wait conditions’, then all the resources Write_item(order ‘123’)
that a process/thread requires to complete its work inside
the critical section must be acquired all at once. This leads
to inefficient resource allocation and unnecessary holding We have seen that deadlock and race conditions are
of resources over long periods of time. two major issues a programmer has to keep in mind
If we want to avoid the ‘no preemption condition’, when writing multi-threaded code. There is another
then processes can be preempted of the resources they performance pitfall that many novice programmers fall
have. When resources are preempted, processes may lose into when writing multi-threaded code. It is known as false
whatever work they have done so far. This can lead to sharing, which we shall discuss next.
substantial overheads. If the ‘circular wait’ condition is to
be avoided, then a programmer-imposed linear ordering of False sharing
resources is enforced in the acquisition of resources. While Let’s assume you have a single threaded application that
‘acquire ordering of resources’ is more efficient in terms of is responsible for issuing movie tickets and counting how
resource utilisation compared to the first two strategies, many were issued each day. And there is a global variable
it is not flexible and requires a programmer to specify the called num_total_tickets that gets incremented for each
ordering of resources for each system. ticket issued. Here is the code snippet that does the
Consider our classic deadlock example where one increment:
thread acquires lock A first and then requests lock B, and
a second thread acquires lock B first and then requests int num_total_tickets = 0;
lock A. Such a condition will be avoided if a lock order
is imposed in which lock A appears earlier than lock incrementTicketCounter()
B. Hence, if the application code requires thread 2 to {
acquire lock B first and lock A next, then this will be a lock num_total_tickets++;
acquisition order violation. Such a violation can be flagged }
by a static source code analysis tool.
There are two types of deadlock prevention strategies, You were asked to parallelise the application and make
namely wait-die and wound-wait. In this case, each critical it multi-threaded. You created N number of threads, each
section is executed as a transaction. The transactions of which can do the ticket issue now. Therefore, the global
use a time-stamp to identify the older and younger variable num_total_tickets is a shared variable across all
transactions. Both in wait-die and in wound-wait schemes, threads and needs to be updated by each thread when it
a rolled back transaction is restarted with its original issues a ticket. You used a mutex to protect the variable.
timestamp. Older transactions have precedence over Now your code looks like what’s shown below:
newer ones, and starvation is hence avoided. The two
schemes are as follows: int num_total_tickets = 0;
 In the wait-die scheme, an older transaction waits for pthread_mutex_t ticket_mutex;
a younger transaction to release a data item. Younger
transactions never wait for older ones; they are rolled incrementTicketCounter()
back instead. A transaction may die several times {
before acquiring the needed data item. pthread_mutex_lock(&ticket_mutex);
 In the wound-wait scheme, an older transaction num_total_tickets++;
forces rollback of younger transaction instead of pthread_mutex_unlock(&ticket_mutex);
waiting for it. Younger transactions may wait for }
older ones. There may be fewer rollbacks than in the
wait-die scheme. When you asked a colleague to review the code,

www.LinuxForU.com  |  LINUX For You  |  AUGUST 2009  |  99


CodeSport  |  Guest Column ________________________________________________________________________________________________

she suggested that since the total_num_tickets is only num_tickets_per_thread[thread_id] by each thread.
printed when the application exits at the end of the day, Assuming a cache line of size 64 bytes, we see that 16
you can parallelise this counter so that the contention elements of the array can fit in the same cache line.
on the single shared counter is removed. You then came Now, whenever any of these threads updates an array
up with the following version of code: element, it will invalidate the copies present in all other
processors’ cache. This will result in that particular
int num_tickets_per_thread [N]; //N is the number of threads in your cache line ping-ponging across all caches of the
application processors that access this array. This problem is known
as false sharing. A processor updating the array element
incrementTicketCounter() it owns, ends up invalidating the other processor’s
{ cache copies because of their co-location in the same
int thread_id = pthread_self(); cache line.
num_total_tickets[thread_id] ++; Unlike true sharing where the same datum is
accessed by multiple threads, in this case, different
} threads access different data items. Because of their co-
location in the same cache line, the line gets migrated
void PrintTotalTickets() across the different processor caches. This phenomenon
{ is known as false sharing. This will result in an
//only the main thread calls this function, so no locking needed increased number of cache misses and will show up as
for (int i = 0; i < N; i++) an increase in the execution time of the application.
num_total_tickets += Num_tickets_per_thread[i]; Also, as the number of threads in the application
printf (“%d”, num_total_tickets); increases, the performance becomes poorer as the
} cache line now ping-pongs to more processor caches,
causing a severe scalability issue.
Note that the API pthread_self gets the ID of the
thread calling this function. Does this code have any Takeaway problem for this month
performance problems? At first glance, it does not Now how can we work around the false cache line-
appear so. All the threads update their own array sharing problem in our example code snippet? We
element. Hence no synchronisation is needed between need to pad each array element so that each element
them. PrintTotalTickets is called only by the main is present in a separate cache line. This will avoid the
thread to print the total number of tickets when the cache line false sharing, but will come at the expense of
program finishes. So this function also does not need an increased space allotted to the array. Our takeaway
any synchronisation to access the num_tickets_per_ problem this month is to modify our sample code so
thread array. Therefore, where is the performance as to eliminate false sharing. Please do send me your
bottleneck? solutions to this.
Remember that your multi-threaded application If you have any favourite programming puzzles that
runs on a multi-processor system. Each processor has you would like to discuss on this forum, please send
its own cache and the cache coherence is enforced them to me at sandyasm_AT_yahoo_DOT_com. Till we
through hardware. Cache coherence ensures that meet again next month, happy programming! 
different copies of the same memory location kept in
each of the processor’s local caches are consistent with
each other. When a processor needs to modify data in About the author:
its cache that is also present in other processors’ caches, Sandya Mannarswamy. The author is a specialist in compiler
it first needs to invalidate the copies present in other optimisation and works at Hewlett-Packard India. She has a number
caches. This is known as cache line invalidation. of publications and patents to her credit, and her areas of interest
include virtualisation technologies and software development tools.
Now consider the update of each array element

THE COMPLETE M AGAZINE ON OPEN SOURCE


Your favourite Linux Magazine is
BETA
now on the Web, too.

LinuxForU.com
Follow us on Twitter @LinuxForYou

100  |  AUGUST 2009  |  LINUX For You  |  www.LinuxForU.com


A Voyage to the
Kernel
Part 15

Segment: 3.4, Day 14

W
elcome to another segment of struct thermal_cooling_device *cdev = to_cooling_
our voyage! In this article, we’ll device(dev);
talk about device drivers.
Device drivers are important return cdev->ops->get_max_state(cdev, buf);
when it comes to topics closely related to }
kernel-level programming. The device driver
layer is required to have an interface to all static ssize_t
physical devices. There are three types of device thermal_cooling_device_cur_state_show(struct device *dev,
drivers—character, block and network. The struct device_attribute *attr, char *buf)
character and block devices are specific to the file {
subsystem—for example, in the case of tape drives struct thermal_cooling_device *cdev = to_cooling_
and modems we meddle with character devices device(dev);
(which are to be accessed sequentially), while
block devices can be accessed in any order. return cdev->ops->get_cur_state(cdev, buf);
Here is a sample piece of code that shows a }
‘cooling operation’ (please refer to thermal_sys.
c, in your kernel source, for more details and for static ssize_t
all the steps). thermal_cooling_device_cur_state_store(struct device *dev,
struct device_attribute *attr,
/* sys I/F for cooling device */ const char *buf, size_t count)
#define to_cooling_device(_dev) \ {
container_of(_dev, struct thermal_cooling_device, device) struct thermal_cooling_device *cdev = to_cooling_
device(dev);
static ssize_t int state;
thermal_cooling_device_type_show(struct device *dev, int result;
struct device_attribute *attr, char *buf)
{ if (!sscanf(buf, “%d\n”, &state))
struct thermal_cooling_device *cdev = to_cooling_ return -EINVAL;
device(dev);
if (state < 0)
return sprintf(buf, “%s\n”, cdev->type); return -EINVAL;
}
result = cdev->ops->set_cur_state(cdev, state);
static ssize_t if (result)
thermal_cooling_device_max_state_show(struct device *dev, return result;
struct device_attribute *attr, char *buf) return count;
{ }

www.LinuxForU.com  |  LINUX For You  |  AUGUST 2009  |  101


A Voyage to the Kernel  |  Guest Column ______________________________________________________________________________

static struct device_attribute dev_attr_cdev_type =


Legend
System-Call resource
__ATTR(type, 0444, thermal_cooling_device_type_show, NULL); Interface VFS dependency
vfs common code
static DEVICE_ATTR(max_state, 0444, subsystem
affs ext ext2
thermal_cooling_device_max_state_show, NULL);
fat hpfs isofs source modules
static DEVICE_ATTR(cur_state, 0644,
minix msdos ncpfs daemon
thermal_cooling_device_cur_state_show,
bin_exec nfs proc smbfs
thermal_cooling_device_cur_state_store);
a.out ELF sysv ufs xiafs

static ssize_t Java script


buffer-cache
thermal_cooling_device_trip_point_show(struct device *dev,
struct device_attribute *attr, char *buf) buffer kflushd
{
struct thermal_cooling_device_instance *instance; device drivers

char block
instance = loop cdrom
ftape keyboard random real-time
clock
container_of(attr, struct thermal_cooling_device_instance, attr); floppy ide
sound mouse mem printers

video XT hard scsi


serial monitor pc watchdog drives
if (instance->trip == THERMAL_TRIPS_NONE)
return sprintf(buf, “-1\n”);
else
Figure 1: File subsystem structure
return sprintf(buf, “%d\n”, instance->trip);
}
CSRs of the peripheral to confirm whether the current
We know that in Linux, a device is accessed as request has been addressed. If it is done, it proceeds to
though it is a file in the filesystem (let’s call this a device the next.
special file). Now you can guess why it is easy to add We go for polling when we consider low-speed
a new part by incorporating the hardware-dependent hardware devices (say a floppy drive). And, finally, in the
code to support the abstract file interface. We know case of DMA, the DD begins a DMA transfer between
that, given a large number of different hardware devices, the system’s main memory and the peripheral. It should
the procedure to write a new device driver should not be noted that this transfer operation also allows the
be complex in any respect. CPU to work on other tasks along with this. Once the
It should be noted that the Linux kernel employs a process is over, the CPU receives an interrupt. You may
buffer cache to effectively deal with block devices, and see that this method is far more complicated than those
access to them is through a buffer cache subsystem. This mentioned earlier.
further improves the overall system performance (if you
wish to know why, then I would say because it reduces the Interrupts
reads and writes to the hardware devices). You may also If a device intends to report a change, it does so using
notice that each hardware device has a request queue and an interrupt to the CPU. The same method is used to
if the buffer cache is not in a position to ‘address’ a request let the CPU know that a task has been completed. If
from in-memory buffers, the buffer cache adds a request to these are of a high value (logical) then the CPU ceases
the device’s request queue. And it will remain dormant till the current operation and begins to execute the Linux
the request has been ‘addressed’. kernel’s interrupt handling code. When a particular
Let’s now go to the technical side of the process. The interrupt is being handled, the other interrupts may
buffer cache essentially uses kflushd (kernel thread) be put on hold until the original interrupt is handled.
to write buffer pages out to the device (and to remove While programming, you need to take note of the
them from the cache). If, for instance, a request has efficiency of the handlers, otherwise other interrupts
been placed before a DD (device driver), then it begins would be lost. Now assume a condition in which the
the process by manipulating the device’s control and CPU is unable to finish the work in the time frame.
status registers (CSRs). There are broadly three modes Then, it will employ a bottom-half handler to handle the
to move data from the core part of the system to the remaining portion of the work. This will be executed by
peripheral device. They are: polling, direct memory the scheduler in the next phase.
access (DMA), and interrupts. I’m sure that these are
familiar terms to even intermediate-level users. But, Let’s experiment with customising your kernel
considering the good number of newbies interested in You may have plenty of reasons to consider
learning about this topic, let me sum up the concepts. customisation. Advanced users will try to patch the
In the first case, the device driver regularly checks the kernel to support hardware that is not currently

102  |  AUGUST 2009  |  LINUX For You  |  www.LinuxForU.com


______________________________________________________________________________ Guest Column  |  A Voyage to the Kernel

/.
/usr
/usr/src
/usr/src/linux-source-2.6.27.tar.bz2
/usr/share
/usr/share/doc
/usr/share/doc/linux-source-2.6.27
/usr/share/doc/linux-source-2.6.27/copyright
/usr/share/doc/linux-source-2.6.27/changelog.Debian.gz

Now, as the root user (you may use: sudo /bin/bash),


execute the following:

cd /usr/src
Figure 2: Using dpkg to list the kernel source files bunzip2 linux-source-2.6.27.tar.bz2
tar xvf linux-source-2.6.27.tar
ln -s linux-source-2.6.27 linux

Then, let’s make a copy of the existing kernel


configuration by issuing the following:

cp /boot/config-`uname -r` /usr/src/linux/.config

Now let’s start customising it:

root@GNU-BOX:/usr/src# cd /usr/src/linux-headers-2.6.27-7
root@GNU-BOX:/usr/src/linux-headers-2.6.27-7#
root@GNU-BOX:/usr/src/linux-headers-2.6.27-7# make menuconfig
HOSTCC scripts/basic/fixdep

Figure 3: Configuring the kernel in Ubuntu HOSTCC scripts/basic/docproc


HOSTCC scripts/kconfig/conf.o
supported by the kernel. And if you are an scripts/kconfig/conf.c: In function ‘conf_askvalue’:
intermediate-level user you might want to take away scripts/kconfig/conf.c:104: warning: ignoring return value of ‘fgets’,
some ‘extra’ features (and support) from the kernel declared with attribute warn_unused_result
and build a custom one with just the essentials. scripts/kconfig/conf.c: In function ‘conf_choice’:
Well, we cannot address patching at this stage. But we scripts/kconfig/conf.c:306: warning: ignoring return value of ‘fgets’,
can speak about how customisation works. Please note that declared with attribute warn_unused_result
this demonstration is on an OS derived from Debian. HOSTCC scripts/kconfig/kxgettext.o
In Segment 1, we discussed commands like uname. HOSTCC scripts/kconfig/lxdialog/checklist.o
Now let’s have: HOSTCC scripts/kconfig/lxdialog/inputbox.o
HOSTCC scripts/kconfig/lxdialog/menubox.o
aasisvinayak@GNU-BOX:~$ uname -r HOSTCC scripts/kconfig/lxdialog/textbox.o
2.6.27-7-generic HOSTCC scripts/kconfig/lxdialog/util.o
HOSTCC scripts/kconfig/lxdialog/yesno.o
We’ve got the version number. Now let’s get the HOSTCC scripts/kconfig/mconf.o
source code by issuing the following command: SHIPPED scripts/kconfig/zconf.tab.c
SHIPPED scripts/kconfig/lex.zconf.c
sudo apt-get install linux-source-2.6.27 kernel-package libncurses5- SHIPPED scripts/kconfig/zconf.hash.c
dev fakeroot HOSTCC scripts/kconfig/zconf.tab.o
In file included from scripts/kconfig/zconf.tab.c:2486:
You can use dpkg to show you the files. Please scripts/kconfig/confdata.c: In function ‘conf_write’:
refer to the screenshot in Figure 2. scripts/kconfig/confdata.c:501: warning: ignoring return value of ‘fwrite’,
You can also see that the source is located at declared with attribute warn_unused_result
/usr/src/. scripts/kconfig/confdata.c: In function ‘conf_write_autoconf’:
scripts/kconfig/confdata.c:739: warning: ignoring return value of ‘fwrite’,
aasisvinayak@GNU-BOX:~$ dpkg -L linux-source-2.6.27 declared with attribute warn_unused_result

www.LinuxForU.com  |  LINUX For You  |  AUGUST 2009  |  103


A Voyage to the Kernel  |  Guest Column ______________________________________________________________________________

Figure 6: Built-in options


Figure 4: The config dialogue box

Figure 7: Changing the configuration

Figure 5: Saving an alternate configuration file

scripts/kconfig/confdata.c:740: warning: ignoring return value of ‘fwrite’,


declared with attribute warn_unused_result
In file included from scripts/kconfig/zconf.tab.c:2487:
scripts/kconfig/expr.c: In function ‘expr_print_file_helper’:
scripts/kconfig/expr.c:1090: warning: ignoring return value of ‘fwrite’,
declared with attribute warn_unused_result
HOSTLD scripts/kconfig/mconf
scripts/kconfig/mconf arch/x86/Kconfig

Figure 8: Running make clean


Note: For the time being, let us set aside the details
concerning confdata.c and expr.c. But you can use
the above code as a reference in subsequent discussions. After making the changes, we can save the new
configuration and exit:
This will launch a configuration dialogue box that
will allow you to configure various aspects with regards # using defaults found in /boot/config-2.6.27-7-generic
to your kernel. You will get an option to save your #
alternate configuration file and later use the same. This #
is elucidated in Figures 4 and 5. # configuration written to .config1
You can also see that options like kernel debugging #
will have an * (asterisk) attached to it, which means that
those features are built in.
Now let’s go back to the general set-up to make a few *** End of Linux kernel configuration.
changes (see Figure 7). If you stumble upon something *** Execute ‘make’ to build the kernel or try ‘make help’.
new while configuring the kernel, you can rely on the
Help button. Time for a make clean? Refer to Figure 8 for a

104  |  AUGUST 2009  |  LINUX For You  |  www.LinuxForU.com


______________________________________________________________________________ Guest Column  |  A Voyage to the Kernel

typical terminal output. */


So far, so good… Now about compilation: SEMOPM 32 /* ~ 100 max num of ops per semop call */
SEMVMX 32767 /* semaphore maximum value */
fakeroot make-kpkg –initrd –append-to-version=-custom kernel_
image kernel_headers /* unused */
SEMUME SEMOPM /* max num of undo entries per process */
This command is most likely to work. If SEMMNU SEMMNS /* num of undo structures system wide */
anything goes wrong, just delete the entry in GRUB SEMAEM (SEMVMX >> 1) /* adjust on exit max value */
and give another try after logging into the system SEMMAP SEMMNS /* # of entries in semaphore map */
using the old kernel version. SEMUSZ 20 /* sizeof struct sem_undo */

Logical filesystems 3. Shared memory


It is quite comfortable to access block devices with /*
a logical filesystem. This can be mounted in the * Keep _SHM_ID_BITS as low as possible since SHMMNI
virtual filesystem; which implies that the block * depends on it and there is a static array of size SHMMNI.
device contains file (and structure) details, which */
permit the logical filesystem to access the device. _SHM_ID_BITS 7
You need to note that the device can only support _SHM_IDX_BITS 15
one logical filesystem at a time.
You can guess that when a filesystem is /*
made to mount as a subdirectory, the directories * _SHM_ID_BITS + _SHM_IDX_BITS must be <= 24 on the i386 and
and files existing on the device will be seen as * SHMMAX <= (PAGE_SIZE << _SHM_IDX_BITS).
subdirectories of the mount point (which itself is */
a subdirectory). This also offers a great amount SHMMAX 0x2000000 /* max shared seg size (bytes) */
of abstraction (as the users need not know the SHMMIN 1 /* really PAGE_SIZE */ /* min shared seg size (bytes) */
specific details of the logical filesystem) and SHMMNI (1<<_SHM_ID_BITS) /* max num of segs system wide */
flexibility. SHMALL (1<<(_SHM_IDX_BITS+_SHM_ID_BITS))
You might already know that Linux uses the /* max shm system wide (pages) */
concept of inodes to represent a file on a block SHMLBA PAGE_SIZE /* attach addr a multiple of this */
device and one can also comprehend that the idea SHMSEG SHMMNI /* max shared segs per process */
is virtual. It can be used as a storage location for
any information concerning an open file on the 4. Number of open files
disk, and it stores associated buffers (and even the NR_INODE 3072 /* this should be bigger than NR_FILE */
mapping between device blocks and file offsets). NR_FILE 1024 /* this can well be larger on a larger system */
Now, it is time to wind up this voyage. IPC, external
Linux kernel limits interface and data structures are some of the important
Here is an overview of the default Linux kernel topics that we will discuss next month. Experiment
limits (the kernel parameter): with your kernel and let me know the results.
1. Maximum number of processes Happy kernel hacking! 
NR_TASKS 512
MAX_TASKS_PER_USER (NR_TASKS/2) By: Aasis Vinayak PG
The author is a hacker and a free software activist who does
2. Semaphores programming in the open source domain. He is the developer
SEMMNI 128 /* ? max # of semaphore identifiers */ of V-language—a programming language that employs AI
and ANN. His research work/publications are available at
SEMMSL 32 /* <= 512 max num of semaphores per id */
www.aasisvinayak.com
SEMMNS (SEMMNI*SEMMSL) /* ? max # of semaphores in system

A Portal For Technologists And Technopreneurs

www.LinuxForU.com  |  LINUX For You  |  AUGUST 2009  |  105


FOSS Yellow Pages
FOSS Yellow Pages The best place for you to buy and sell FOSS products and services

The best place for you to buy and sell FOSS products and services
HIGHLIGHTS
 A cost-effective marketing tool
 A user-friendly format for customers to contact you
 A dedicated section with yellow back-ground, and hence will stand out
 Reaches to tech-savvy IT implementers and software developers
 80% of LFY readers are either decision influencers or decision takers
 Discounts for listing under multiple categories
 Discounts for booking multiple issues

FEATURES
 Listing is categorised on the basis of products and services
 Complete contact details plus 30-word description of organisation
 Option to print the LOGO of the organisation too (extra cost)
 Option to change the organisation description for listings under different categories

TARIFF
Category Listing Value-add Options
ONE Category......................................................... Rs 2,000 LOGO-plus-Entry....................................................... Rs 500
TWO Categories...................................................... Rs 3,500 Highlight Entry (white background)............................. Rs 1,000
THREE Categories................................................... Rs 4,750 Per EXTRA word (beyond 30 words).......................... Rs 50
ADDITIONAL Category............................................ Rs 1,000

Key Points TERMS & CONDITIONS


 Above rates are per-category basis.  Fill the form (below).
 Above rates are charges for publishing in a single issue of  You can use multiple copies of the form for multiple listings
LFY. under different categories.
 Max. No. of Words for Organisation Description: 30 words.  Payment to be received along with booking.

Tear & Send Tear & Send


ORDER FORM
Organisation Name (70 characters):����������������������������������������������������������������������������������������������������������
Description (30 words):______________________________________________________________________________________________________________________
_________________________________________________________________________________________________________________________________________
Email:___________________________________________________________________ Website: _________________________________________________________
STD Code: __________________Phone: ____________________________________________________________ Mobile:_____________________________________
Address (will not be publshed):_______________________________________________________________________________________________________________
_____________________________________________________ City/Town:__________________________________________ Pin-code:_________________________

Categories
Consultants High Performance Computing Software Development
Consultant (Firm) IT Infrastructure Solutions Training for Professionals
Embedded Solutions Linux-based Web-hosting Training for Corporate
Enterprise Communication Solutions Mobile Solutions Thin Client Solutions

Please find enclosed a sum of Rs. ___________ by DD/ MO//crossed cheque* bearing the No. _________________________________________ dt. _ ________________ in favour of
EFY Enterprises Pvt Ltd, payable at Delhi. (*Please add Rs. 50 on non-metro cheque) towards the cost of ___________________ FOSS Yellow Pages advertisement(s)
or charge my credit card    VISA     Master Card   Please charge Rs. _________________
against my credit card No.                                     C V V No. ___________ (Mandatory)

Date of Birth _____ / _____ / _________ (dd/mm/yy)   Card Expiry Date _______ / _______ (mm/yy)

EFY Enterprises Pvt Ltd., D-87/1, Okhla Industrial Area, Phase 1, New Delhi 110 020
Ph: 011-26810601-03, Fax: 011-26817565, Email: [email protected]; Website: www.efyindia.com Signature (as on the card)

To Book Your Listing, Call: Dhiraj (Delhi: 09811206582), Somaiah (B’lore: 09986075717)
www.LinuxForU.com  |  LINUX For You  |  AUGUST 2009  |  107
FOSS Yellow Pages
The best place for you to buy and sell FOSS products and services
To advertise in this section, please contact:
Dhiraj (Delhi) 09811206582, Somaiah (Bangalore) 09986075717

Consultant (Firm) Mobile: 09968756177, Fax: 011-26187551 product cyn.in. cyn.in is a web 2.0
Email: [email protected] group collaboration software created
IB Services Web: www.compteki.com by Cynapse, that inter-connects your
Free Installation of GNU/Linux on or www.compteki.in people with each other and their Netcore Solutions Pvt Ltd
Laptops and Desktops. Thin client collective knowledge, seamlessly. No.1 company for providing Linux
solutions based on Debian and It combines the capabilities of Based Enterprise Mailing solution
Ubuntu. Laptops and Desktops Education & Training collaboration tools like wikis, blogs, file with around 1500+ Customer all over
pre-installed with Debian and Ubuntu. repositories, micro blogs, discussions, India. Key Solutions:
Migration to GNU/Linux. Data Aptech Limited audio, videos, and other social •Enterprise Mailing and Collaboration
Recovery.Navi Mumbai IT, Multimedia and Animation applications into a seamless platform. Solution •Hosted Email Security •Mail
Kerala Education and Training cyn.in helps teams to build collaborative Archiving Solution •Push Mail on
Mobile: 09847446918 Mumbai knowledge by sharing and discussing Mobile •Clustering Solution
Email: [email protected] Tel: 022-28272300, 66462300 various forms of digital content within Mumbai
Web : www.ibservices.in Fax: 022-28272399 a secure, unified application that is Tel: 022-66628000
Email: [email protected] accessible using a web based interface Mobile: 09322985222
OS3 Infotech Web: www.aptech-education.com, or a rich desktop client. Email: [email protected]
•Silver Solutions Partner for Novell •High www.arena-multimedia.com Mumbai Web: www.netcore.co.in
Availability Computing Solutions •End- Tel: 022-28445858, 28445629
to-end Open Source Solutions Provider IT-Campus: Academy of Information Email: [email protected]
•Certified Red Hat Training Partner Technology Web: www.cynapse.com
•Corporate and Institutional Training IT training and solution company with
Navi Mumbai over 12 years of experience. - RHCE DeepRoot Linux Pvt Ltd
Mobile: 09324113579 •Software Training •Hardware Training Pure & Exclusive Free Software
Email: [email protected] •Multimedia And Animation •Web Business. Creators of the deepOfix Red Hat India Pvt Ltd
Web: www.os3infotech.com Designing •Financial Accounting Mail Server. We provide: airtight Red Hat is the world's leading
Kota (Raj.) solutions, solid support and Freedom open source solutions provider.
Taashee Linux Services Tel: 0744-2503155, Mobile: 09828503155 We believe in: sharing, compassion Red Hat provides high-quality,
100% Support on LINUX ,OSS Fax: 0744-2505105 and plain action. Backed by full-time affordable technology with its
& JBOSS related projects. We Email: [email protected] hackers. Quick deployment, easy operating system platform, Red
specialize in high-availability and Web: www.doeacc4u.com management. Guaranteed. Hat Enterprise Linux, together with
high-performance clusters,remote Bangalore applications, management and
and onsite system management, Mahan Computer Services (I) Limited Tel: 080-40890000 Services Oriented Architecture (SOA)
maintenance services,systems Established in 1990, the organization Email: [email protected] solutions, including JBoss Enterprise
planning, Linux & JBOSS consulting is primarily engaged in Education Web: www.deeproot.in Middleware. Red Hat also offers
& Support services. and Training through its own & support, training and consulting
Hyderabad Franchise centres in the areas of IT ESQUBE Communications Solutions services to its customers worldwide.
Mobile: 09392493753, Fax: 040-40131726 Software, Hardware, Networking, Pvt Ltd Mumbai
Email: [email protected] Retail Management and English. The Founders of ESQUBE are faculty Tel: 022-39878888
Web: www.taashee.com institute also provides customized at the Indian Institute of Science, Email: [email protected]
training for corporates. Bangalore and carry over eight Web: www.redhat.in
Torrid Networks Pvt Ltd New Delhi decades of experience and
Torrid is a leading provider of Tel: 011-25916832-33 fundamental knowledge in the field
information technology consulting Email: [email protected] of DSP and Telecommunication. Hardware & Networking
with focus on Information Security Web: www.mahanindia.com ESQUBE plays a dominant role in Institute
Services and Open Source Solutions. the creation of IP in the domain of
Noida Sensors, Signals and Systems. Xenitis Technolab Pvt Ltd
Tel: 0120-4545100, Mobile: 09015505583 Enterprise Comm. Solutions Bangalore Xenitis TechnoLab is the first of its
Fax: 0120-4235064 Tel: 080-23517063 kind, state-of-the-art infrastructure,
Email:[email protected] Aware Consultants Email: [email protected] Hardware, Networking and
Web: www.torridnetworks.com We specialize in building and Web: www.esqube.com I.T Security training institution
managing Ubuntu/Debian headquartered in Kolkata.
Linux servers and provide good Keen & Able Computers Pvt Ltd TechnoLab is the training division
Computer (UMPC) For Linux dependable system administration. Microsoft Outlook compatible open of Xenitis group of Companies. It
And Windows We install and maintain in-house source Enterprise Groupware is the proud owner of ‘Aamar PC’,
corporate servers. We also provide Mobile push, Email Syncing of the most popular Desktop brand
Comptek International dedicated and shared hosting as well Contacts/Calendar/Tasks with of Eastern India. These ranges of
World’s smallest computer comptek as reliable wireless/hybrid networking. mobiles PC’s are sold in the west under
wibrain B1 umpc with Linux,Touch Bangalore •Mail Archival •Mail Auditing •Instant the brand name of ‘Aamchi PC’, in
Screen, 1 gb ram 60gb, Wi-Fi, Tel: 080-26724324 Messaging the north as ‘Aapna PC’ and in the
Webcam, upto 6 hour battery Email: [email protected] New Delhi south as ‘Namma PC’.
(opt.), Usb Port, max 1600×1200 Web: www.aware.co.in Tel: 011-30880046, 30880047 Kolkata
resolution, screen 4.8”, 7.5”×3.25” Mobile: 09810477448, 09891074905 Tel: 033-22893280
Size, weight 526 gm. Cynapse India Private Limited Email: [email protected] Email: [email protected]
New Delhi We are the creators of open source Web: www.keenable.com Web: www.techonolabindia.com

108  |  AUGUST 2009  |  LINUX For You  |  www.LinuxForU.com


FOSS Yellow Pages
The best place for you to buy and sell FOSS products and services
To advertise in this section, please contact:
Dhiraj (Delhi) 09811206582, Somaiah (Bangalore) 09986075717

IT Infrastructure Solutions Clover Infotech Private Limited Tel: 080-42823000, Fax: 080-42823003
Clover Infotech is a leading Email: [email protected]
Absolut Info Systems Pvt Ltd technology services and solutions Web: www.pacerautomation.com
Open Source Solutions Provider. provider. Our expertise lies in Ingres Corporation
Red Hat Ready Business Partner. supporting technology products Ingres Corporation is a leading
Mail Servers/Anti-spam/GUI related to Application, Database, provider of open source database
interface/Encryption, Clustering & Middleware and Infrastructure. We software and support services.
Load Balancing - SAP/Oracle/Web/ enable our clients to optimize their Ingres powers customer success
Thin Clients, Network and Host business through a combination of by reducing costs through highly Red Hat India Pvt Ltd
Monitoring, Security Consulting, best industry practices, standard innovative products that are hallmarks Red Hat is the world's leading
Solutions, Staffing and Support. processes and customized client of an open source deployment and open source solutions provider.
New Delhi engagement models. Our core uniquely designed for business critical Red Hat provides high-quality,
Tel: +91-11-26494549 services include Technology applications. Ingres supports its affordable technology with its
Fax: +91-11-4175 1823 Consulting, Managed Services and customers with a vibrant community operating system platform, Red
Mobile: +91-9873839960 Application Development Services. and world class support, globally. Hat Enterprise Linux, together with
Email: [email protected] Mumbai Based in Redwood City, California, applications, management and
Web: www.aisplglobal.com Tel: 022-2287 0659, Fax: 022-2288 1318 Ingres has major development, sales, Services Oriented Architecture (SOA)
Mobile: +91 99306 48405 and support centers throughout solutions, including JBoss Enterprise
Advent Infotech Pvt Ltd Email: [email protected] the world, and more than 10,000 Middleware. Red Hat also offers
Advent has an experienced techno- Web: www.cloverinfotech.com customers in the United States and support, training and consulting
marketing team with several years of internationally. services to its customers worldwide.
experience in Networking & Telecom DeepRoot Linux Pvt Ltd New Delhi Mumbai
business, and is already making Pure & Exclusive Free Software Tel: 011-40514199, Fax: +91 22 66459537 Tel: 022-39878888
difference in market place. ADVENT Business. Creators of the deepOfix Email: [email protected]; [email protected] Email: [email protected]
qualifies more as Value Added Mail Server. We provide: airtight Web: www.ingres.com Web: www.redhat.in
Networking Solution Company, we solutions, solid support and Freedom
offers much to customers than just We believe in: sharing, compassion Keen & Able Computers Pvt Ltd Srijan Technologies Pvt Ltd
Routers, Switches, VOIP, Network and plain action. Backed by full-time Open Source Solutions Provider. Srijan is an IT consulting company
Management Software, Wireless hackers. Quick deployment, easy Red Hat Ready Business Partner. engaged in designing and
Solutions, Media Conversion, etc. management. Guaranteed. Mail Servers/Anti-spam/GUI building web applications, and IT
New Delhi Bangalore interface/Encryption, Clustering & infrastructure systems using open
Tel: 46760000, 09311166412 Tel: 080-40890000 Load Balancing - SAP/Oracle/Web/ source software.
Fax: 011-46760050 Email: [email protected] Thin Clients, Network and Host New Delhi
Email: marketingsupport@ Web: www.deeproot.in Monitoring, Security Consulting, Tel: 011-26225926, Fax: 011-41608543
adventelectronics.com Solutions, Staffing and Support. Email: [email protected]
Web: www.adventelectronics.com Duckback Information Systems New Delhi-110019 Web: www.srijan.in
Pvt Ltd Tel: 011-30880046, 30880047
Asset Infotech Ltd A software house in Eastern India. Mobile: 09810477448, 09891074905
We are an IT solution and training Business partner of Microsoft, Email: [email protected]
company with an experience of 14 Oracle, IBM, Citrix , Adobe, Redhat, Web: www.keenable.com A company focussed on Enterprise
years, we are ISO 9001: 2000. We Novell, Symantec, Mcafee, Computer Solution using opensource software.
are partners for RedHat, Microsoft, Associates, Veritas , Sonic Wall LDS Infotech Pvt Ltd Key Solutions:
Oracle and all Major software Kolkata Is the authorised partner for RedHat • Enterprise Email Solution
companies. We expertise in legal Tel: 033-22835069, 9830048632 Linux, Microsoft, Adobe, Symantec, • Internet Security and Access
software ans solutions. Fax: 033-22906152 Oracle, IBM, Corel etc. Software Control
Dehradun Email: [email protected] Services Offered: •Collaborative • Managed Services for Email
Tel: 0135-2715965, Mobile: 09412052104 Web: www.duckback.co.in Solutions •Network Architecture Infrastructure.
Email: [email protected] •Security Solutions •Disaster Mumbai
Web: www.asset.net.in HBS System Pvt Ltd Recovery •Software Licensing Tel: 022-66338900; Extn. 324
System Integrators & Service •Antivirus Solutions. Email: [email protected]
BakBone Software Inc. Provider.Partner of IBM, DELL, HP, Mumbai Web: www. technoinfotech.com
BakBone Software Inc. delivers Sun, Microsoft, Redhat, Trend Micro, Tel: 022-26849192
complexity-reducing data protection Symentic Partners of SUN for their Email: [email protected]
Want to register your organisation in
technologies, including award- new startup E-commerce initiative Web: www.ldsinfotech.com
winning Linux solutions; proven Solution Provider on REDHAT, FOSS Yellow Pages

FREE
Solaris products; and application- SOLARIS & JAVA Pacer Automation Pvt Ltd
focused Windows offerings that New Delhi Pacer is leading providers of IT *
reliably protect MS SQL, Oracle, Tel: 011-25767117, 25826801/02/03 Infrastructure Solutions. We are
Exchange, MySQL and other partners of HP, Redhat, Cisco,
business critical applications.
Fax: 25861428
Email: [email protected] Vwmare, Microsoft and Symantec. For
New Delhi Our core expertise exists in, Call: Dhiraj (Delhi) 09811206582
Tel: 011-42235156 Consulting, building and Maintaining Somaiah (Bangalore) 09986075717
Email: [email protected] the Complete IT Infrastructure.
*Offer for limited period.
Web: www.bakbone.com Bangalore

www.LinuxForU.com  |  LINUX For You  |  AUGUST 2009  |  109


FOSS Yellow Pages
The best place for you to buy and sell FOSS products and services
To advertise in this section, please contact:
Dhiraj (Delhi) 09811206582, Somaiah (Bangalore) 09986075717

Tetra Information Services Pvt Ltd Desktop for SME users. Its affordable and many other original software companies, Semiconductor and
One of the leading open source (Rs. 500 + tax as special scheme), licenses. Application development companies
provders. Our cost effective business Friendly (Graphical UserInterface) and Mumbai across the globe.
ready solutions caters of all kind of Secure (Virus free). Tel: 022-25001812, Mobile: 09821097238 Bangalore
industry verticles. New Delhi Email: [email protected] Tel: 080-28565801/05, Fax: 080-28565800
New Delhi Tel: 011-26014670-71, Fax: 26014672 Web: www.bluechip-india.com Email: [email protected]
Tel: 011-46571313, Fax: 011-41620171 Email: [email protected] Web: www.integramicroservices.com
Email: [email protected] Web: www.openlx.com
Web: www.tetrain.com Software Development iwebtune.com Pvt Ltd
iwebtune.com is your one-stop, total
Tux Technologies Linux Experts Carizen Software (P) Ltd web site support organisation. We
Tux Technologies provides consulting Carizen’s flagship product is Rainmail provide high-quality website services
and solutions based on Linux and Intaglio Solutions Intranet Server, a complete integrated and web based software support to
Open Source software. Focus areas We are the training and testing software product consisting modules any kind of websites, irrespective of
include migration, mail servers, partners of RedHat and the first to like mail sever, proxy server, gateway the domain or the industry segments.
virus and spam filtering, clustering, conduct RHCSS exam in delhi for the anti-virus scanner, anti-spam, Bangalore
firewalls, proxy servers, VPNs, server first time ever. groupware, bandwidth aggregator & Tel: 080-4115 2929
optimization. New Delhi manager, firewall, chat server and fax Email: [email protected]
New Delhi Tel: 011-41582917, 45515795 server. Infrastructure. Web: www.iwebtune.com
Tel: 011-27348104, Mobile: 09212098104 Email: [email protected] Chennai
Email: [email protected] Web: www.intaglio-solutions.com Tel: 044-24958222, 8228, 9296 Sarvasv Technologies Pvt Ltd
Web: www.tuxtechnologies.co.in Email: [email protected] Web OSX Windows Linux Mobile
Web: www.carizen.com LAMP W3C apps. Agile, BDD,
Veeras Infotek Private Limited Linux Vendor/Distributors TDD development. On-Demand,
An organization providing solutions DeepRoot Linux Pvt Ltd SaaS, ERP, CRM, HRM. Open
in the domains of Infrastructure GT Enterprises Pure & Exclusive Free Software Source integration. Online project
Integration, Information Integrity, Authorized distributors for Red Business. Creators of the deepOfix management. VCS (git, svn).
Business Applications and Hat and JBoss range of products. Mail Server. We provide: airtight automated deployment.
Professional Services. We also represent various OS’s solutions, solid support and Freedom Greater Noida
Chennai Applications and Developer Tools like We believe in: sharing, compassion Mobile: 09711472457, 09810270848
Tel: 044-42210000, Fax: 28144986 SUSE, VMWare, Nokia Qt, MySQL, and plain action. Backed by full-time Email: [email protected]
Email: [email protected] Codeweavers, Ingres, Sybase, hackers. Quick deployment, easy Website: www.sarvasv.in
Web: www.veeras.com Zimbra, Zend-A PHP Company, High management. Guaranteed.
Performance Computing Solutions Bangalore Unistal Systems Pvt Ltd
from The Portland Group, Absoft, Tel: 080-40890000 Unistal is pioneer in Data Recovery
Linux-Based Web-Hosting Pathscale/Qlogic and Intel Compilers, Email: [email protected] Software & Services. Also Unistal is
Scalix-Messaging solution on Linux Web: www.deeproot.in national sales & support partner for
Manas Hosting Platform. BitDefender Antivirus products.
ManasHosting is a Bangalore- Bangalore New Delhi
based company that is dedicated in Mobile: +91-9845009939, +91-9343861758 Tel: 011-26288583, Fax: 011-26219396
helping small and midsize business Email : [email protected] Email: [email protected]
companies to reach customers Web: www.gte-india.com Web: www.unistal.com
online. We believe that by creating InfoAxon Technologies Ltd
a website, all you have is just web Taurusoft InfoAxon designs, develops and
presence; but to get effective Contact us for any Linux Distribution supports enterprise solutions stacks Software and Web
traffic on your website, it is equally at reasonable rates. Members get leveraging open standards and open Development
important to have a well designed additional discounts and Free CD/ source technologies. InfoAxon’s
one. This is why we provide the best DVDs with each purchase. Visit our focus areas are Business Intelligence, Bean eArchitect Integrated Services
of Web Hosting and Web Designing website for product and membership CRM, Content & Knowledge Pvt Ltd
services. Also, our services are details Management and e-Learning. Application Development, Web
backed with exceptionally good Mumbai Noida Design, SEO, Web Marketing, Web
quality and low costs Mobile: 09869459928, 09892697824 Tel: 0120-4350040, Mobile: 09810425760 Development.
Bangalore Email: [email protected] Email: [email protected] Navi Mumbai
Tel: 080-42400300 Web: www.taurusoft.netfirms.com Web: http://opensource.infoaxon.com Tel: 022-27821617, Mobile: 9820156561
Email: [email protected] Fax: 022-27821617
Web: www.manashosting.com Integra Micro Software Services (P) Email: [email protected]
Software Subscriptions Ltd Web: www.beanarchitect.com
Integra focuses on providing
Linux Desktop Blue Chip Computers professional services for software Mr Site Takeaway Website Pvt Ltd
Available Red Hat Enterprise Linux, development and IP generation Our product is a unique concept in
Indserve Infotech Pvt Ltd Suse Linux Enterprise Server / to customers. Integra has a major India usingwhich a person without
OpenLx Linux with Kalcutate Desktop, JBoss, Oracle, ARCserve practice in offering Telecom Services having any technical knowledge can
(Financial Accounting & Inventory Backup, AntiVirus for Linux, Verisign/ and works for Telecom companies, create his website within 1 hour; we
on Linux) offers a complete Linux Thawte/GeoTrust SSL Certificates Device Manufacturers, Networking also have a Customer Care Center

110  |  AUGUST 2009  |  LINUX For You  |  www.LinuxForU.com


FOSS Yellow Pages
The best place for you to buy and sell FOSS products and services
To advertise in this section, please contact:
Dhiraj (Delhi) 09811206582, Somaiah (Bangalore) 09986075717

in India for any kind ofafter sales Training for Corporate Cochin Chennai
help. We are already selling it world Tel: 0484-2335324 Tel: 044-45582525
over with over 65,000 copiessold. Bascom Bridge Email: [email protected] Email: [email protected]
It comes with FREE Domain Name, Bascom Bridge is Red Hat Certified Web: www.focuzinfotech.com Web: www.mazenetsolution.com
Web Hosting and Customer Care partner for Enterprise Linux 5 and also
Center forFree Support via Phone providing training to the individuals G-TEC Computer Education Netweb Technologies
and Email and features like PayPal and corporate on other open source ISO 9001:2000 certified IT Company, Simplified and scalable storage
Shopping Cart, Guestbook, Photo technologies like PHP, MySQL etc. International Testing Centre, solutions.
Gallery, Contact Form, Forums, Ahmedabad Specialised in Multimedia & Animation, Bangalore
Blogs and many more. The price Tel: 079-27545455—66 conduct MCP, MCSE 2000, MCDBA Tel: 080-41146565, 32719516
ofcomplete package is just Rs 2,999 Fax: 079-27545488 and MCSA certificates, CCNA, Email: [email protected]
per year. Email: [email protected] CCNP, the Only authorized centre by Web: www.netwebindia.com
Patiala Web: www.bascombridge.com INTERNATIONAL AND EUROPEAN
Mobile: 91-9780531682 COMPUTER UNION to conduct New Horizons India Ltd
Email: [email protected] Brainnet ICDL, Adobe Certifications, training New Horizons India Ltd, a joint
Web: www.mrsite.co.in Kolkata on Web Designing, Tally, Spoken venture of New Horizons Worldwide,
Tel: 033-40076450 English. Conducts Corporate and Inc. (NASDAQ: NEWH) and the
Salah Software Email: [email protected] institutional training. International Shriram group, is an Indian company
We are specialized in developing Web: www.brainware-india.com certifications issued. operational since 2002 with a global
custom strategic software solutions Bangalore foot print engaged in the business
using our solid foundation on focused Centre for Excellence in Telecom Tel: 080-43567000 of knowledge delivery through
industry domains and technologies. Technology and Management Email: [email protected] acquiring, creating, developing,
Also providing superior Solution Edge (CETTM), MTNL managing, lending and licensing
to our Clients to enable them to gain MTNL’s Centre for Excellence Gujarat Infotech Ltd knowledge in the areas of IT, Applied
a competitive edge and maximize in Telecom Technology and GIL is a IT compnay and 17 years of Learning. Technology Services and
their Return on Investments (ROI). Management (CETTM) is a state of expericence in computer training field. Supplementary Education. The
New Delhi the art facility to impart Technical, We have experience and certified company has pan India presence
Tel: 011-41648668, 66091565 Managerial and corporate training to faculty for the open Source courses with 15 offices and employs 750
Email: [email protected] Telecom; Management personnel. like Redhat, Ubantoo,and PHP, Mysql people.
Web: www.salahsoftware.com CETTM has AC lecture halls, Ahmedabad New Delhi
computer Labs and residential facility. Tel: 079-27452276, Fax: 27414250 Tel: 011-43612400
Mumbai Email: [email protected] Email: [email protected]
Thin Client Solutions Tel: 022-25714500, 25714586, 25714585, Web: www.gujaratinfotech.com Web: www.nhindia.com
25714586
Digital Waves Fax: 022-25706700 Lynus Academy Pvt Ltd Network NUTS
The ‘System Integration’ business Email: [email protected] India’s premier Linux and OSS India’s only Networking Institute
unit offers end-to-end Solutions on Web: http://cettm.mtnl.in/infra training institute. by Corporate Trainers. Providing
Desktops, Servers, Workstations, Chennai Corporate and Open classes
HPC Clusters, Render Farms, Complete Open Source Solutions Tel: 044-42171278, 9840880558 for RHCE / RHCSS training and
Networking, Security/Surveillance RHCT, RHCE and RHCSS training. Email: [email protected] certification. Conducted 250+ Red
& Enterprise Storage. With our Hyderabad Web: www.lynusacademy.com Hat exams with 95% result in last 9
own POWER-X branded range Tel: 040-66773365, 9849742065 months. The BEST in APAC.
of Products, we offer complete Email: [email protected] Linux Learning Centre Private Limited New Delhi
Solutions for Animation, HPC Web: www.cossindia.com Pioneers in training on Linux Tel: 46526980-2
Clusters, Storage & Thin-Client technologies. Mobile: 09310024503, 09312411592
Computing ElectroMech Bangalore Email: [email protected]
Mobile: 09880715253 Redhat Linux and open source Tel:080-22428538, 26600839 Web: www.networknuts.net
Email: [email protected] solution , RHCE, RHCSS training Email: [email protected]
Web: www.digitalwaves.in and exam center,Ahmedabad and Web: www.linuxlearningcentre.com STG International Ltd
Vadodara An IT Training and Solution
Enjay Network Solutions Ahmedabad Maze Net Solutions (P) Ltd Company,Over an experience of
Gujarat based ThinClient Solution Tel: 079-40027898 Maze Net Solution (P) Ltd, is a pioneer 14years.We are ISO 9001:2000
Provider. Providing Small Size Email: [email protected] in providing solutions through on Certified.Authorised Training Partners
ThinClient PCs & a Full Featured Web: www.electromech.info time, quality deliverables in the fields of Red Hat & IBM-CEIS. We cover all
ThinClient OS to perfectly suite of BPO, Software and Networking, Software Trainings.
needs of different working Focuz Infotech while providing outstanding training New Delhi
environment. Active Dealer Channel Focuz Infotech Advanced Education to aspiring IT Professionals and Call Tel: 011-40560941-42, Mobile:
all over India. is the quality symbol of high-end Center Executives. Backed by a team 09873108801
Gujarat Advanced Technology Education in of professional workforce and global Email: [email protected]
Tel.: 0260-3203400, 3241732, 3251732, the state. We are providing excellent alliances, our prime objective is to offer Web: www.stgonline.com
Mobile: 09377107650, 09898007650 services on Linux Technology the best blend of technologies in the www.stgglobal.com
Email: [email protected] Training, Certifications and live spheres of Information Technology (IT)
Web: www.enjayworld.com projects to students and corporates, and Information Technology Enabled
since 2000. Services (ITES).

www.LinuxForU.com  |  LINUX For You  |  AUGUST 2009  |  111


FOSS Yellow Pages
The best place for you to buy and sell FOSS products and services
To advertise in this section, please contact:
Dhiraj (Delhi) 09811206582, Somaiah (Bangalore) 09986075717

TNS Institute of Information Love and Selfless Service. Bikaner Indian Institute of Job Oriented
Technology Pvt Ltd Mobile: 09393733174 Tel: 0151-2202105, Mobile: 09928173269 Training Centre
Join RedHat training and get Email: [email protected] Email: [email protected], Ahmedabad
100% job gaurantee. World's most Web: www.amritahyd.org [email protected] Tel: 079-40072244—2255—2266
respected Linux certification. After Mobile: 09898749595
RedHat training, you are ready to join Centre For Industrial Research and Disha Institute Email: [email protected]
as a Linux Administrator or Network Staff Performance A franchisee of Unisoft Technologies, Web: www.iijt.net
Engineer. A Unique Institute catering to the Providing IT Training & Computer
New Delhi need for industries as well as Hardware & Networking Institute of Advance Network
Tel: 011-3085100, Fax: 30851103 Students for trainings on IT, CISCO Dehradun Technology (IANT)
Email: [email protected] certification, PLC, VLSI, ACAD, Tel: 3208054, 09897168902 •Hardware Engg.•Networking
Web: www.tiit.co.in Pneumatics, Behavior Science and Email: [email protected] •Software Engg. •Multimedia
Handicraft. Web: www.unisofttechnologies.com Training.
Webel Informatics Ltd Bhopal Ahmedabad
Webel Informatics Ltd (WIL), a Tel: 0755-2661412, 2661559 EON Infotech Limited (TECHNOSchool) Tel: 079-32516577, 26607739
Government of West Bengal Fax: 0755-4220022 TechnoSchool is the most Fax: 079-26607739
Undertaking. WIL is Red Hat Training Email: [email protected] happening Training Centre for Red Email: contact @iantindia.com
Partner and CISCO Regional Web: www.crispindia.com Hat (Linux- Open Source) in the Web: www.iantindia.com
Networking Academy. WIL conducts Northern Region. We are fully aware
RHCE, RHCSS, CCNA, Hardware Center for Open Source Development of the Industry's requirement as our IPCC
and Software courses. And Research Consultants are from Linux industry. Bridging Gap with professionals.
Kolkata Linux, open source & embedded We are committed to make you a Lucknow
Tel: 033-22833568, Mobile: 09433111110 system training institute and total industry ready individual so that Tel: 0522-3919496
Email: [email protected] development. All trainings provided by your dreams of a professional career Email: [email protected]
Web: www.webelinformatics.com experienced exports & administrators are fulfilled. Web: www.ipcc.co.in
only. Quality training (corporate and Chandigarh
individual). We expertise in open Tel: 0172-5067566-67, 2609849 Koenig Solutions (P) Ltd
Training for Professionals source solution.Our cost effective Fax: 0172-2615465 A reputed training provider in India.
business ready solutions caters of all Email: [email protected] Authorised training partner of Red
AEM kind of industry verticals. Web: http://technoschool.net Hat, Novell and Linux Professional
AEM is the Best Certified Redhat New Delhi Institute. Offering training for RHCE,
Training Partner in Eastern India since Mobile: 09312506496 GT Computer Hardware Engineering RHCSS, CLP, CLE, LPI - 1 & 2.
last 3 years. AEM conducted more Email: [email protected] College (P) Ltd New Delhi
than 500 RHCE exams with 95- Web: www.cfosdr.com Imparting training on Computer Mobile: 09910710143, Fax: 011-25886909
100% pass rate. Other courses— Hardware Networking, Mobile Email: [email protected]
RHCSS,SCNA,MCSE,CCNA. Cisconet Infotech (P) Ltd Phone Maintenance & International Web: www.koenig-solutions.com
Kolkata Authorised Red Hat Study cum Exam Certifications
Tel: 033-25488736, Mobile: 09830075018 Centre. Courses Offered: RHCE, Jaipur NACS/CIT
Email: [email protected] RHCSS, CCNA, MCSE Tel: 0141-3213378 We are Providing Training of LINUX to
Web: www.aemk.org Kolkata Email: [email protected] Professional & Cooperate.
Tel: 033-25395508, Mobile: 09831705913 Web: www.gteducation.net Meerut
Agam Institute of Technology Email: [email protected] Tel: 0121-2420587, Mobile: 9997526668
In Agam Institute of Technology, we Web: www.cisconetinfo.com HCL Career Development Centre Email: [email protected]
provide hardware and networking Bhopal Web: www.nacsglobal.com
training since last 10 years. We CMS Computer Institute As the fountainhead of the most
specialise in open source operating Red Hat Training partner with 3 Red significant pursuit of human mind NACS Infosystems (P) Ltd
systems like Red Hat Linux since we Hat Certified Faculties, Cisco Certified (IT), HCL strongly believes, “Only NACS is a organization which is
are their preferred training partners. (CCNP) Faculty , 3 Microsoft Certified a Leader can transform you into a providing training for all international
Dehradun Faculties having state Of The Art IT Leader”. HCL CDC is a formalization certification, and also NACS is the
Tel: 0135-2673712, Mobile: 09760099050 Infrastructure Flexible Batch Timings of this experience and credo which authorized Training Partner of Redhat
Web: www.agamtecindia.com Available..Leading Networking has been perfected over three and also having testing centre
Institute in Marathwada decades. of THOMSON PROMETRIC and
Amritha Institute of Computer Aurangabad Bhopal PEARSON VUE.
Technology Tel: 0240-3299509, 6621775 Tel: 0755-4094852
Amrita Technologies provides Email: [email protected] Email: [email protected]
an extensive training in high Web: www.cmsaurangabad.com Web: www.hclcdc.in To advertise in this section,
end certification programs and
Networking Solutions like Redhat Cyber Max Technologies IINZTRIX E Technologies Pvt Ltd
please contact
Linux, Redhat Security Services, OSS Solution Provider, Red Hat No. 1 Training prvinder in this region. Somaiah (B’lore:
Cisco, Sun Solaris, Cyber Security Training Partners, Oracle,Web, Thin meerut 09986075717) Dhiraj (Delhi:
Program IBM AIX and so on with a Clients, Networking and Security Tel: 0121-4020111, 4020222 09811206582) on
strong focus on quality standards Consultancy. Also available CCNA Mobile: 09927666664
and proven technology processes and Oracle Training on Linux. Also Email: [email protected] 011-2681-0602 Extn. 222
with most profound principles of available Laptops & PCs Web: www.iintrix.com

112  |  AUGUST 2009  |  LINUX For You  |  www.LinuxForU.com


FOSS Yellow Pages
The best place for you to buy and sell FOSS products and services
To advertise in this section, please contact:
Dhiraj (Delhi) 09811206582, Somaiah (Bangalore) 09986075717

Meerut Tel: 011-46015674, Mobile: 9212114211 Email: [email protected] Email: [email protected]


Tel: 0121-2767756, Fax: 0121-4006551 Email: [email protected] Web: www.qsoftindia.com Web: www.trimax.in
Mobile: 09897796603
Email:[email protected], Neuron IT Solutions Software Technology Network Vibrant e Technologies Ltd
[email protected]. We offer end to end services and STN is one of the most Vibrant e Technologies Ltd. Is a
Web: www.nacsglobal.com support to implement and manage acknowledged name in Software authorised Red Hat Test and Testing
your IT Infrastructure needs. We also Development and Training. Apart Centre, has won the prestigious
Netdiox Computing Systems offer Consulting services and Training from providing Software Solutions award “ REDHAT BEST CERTIFIED
We are one-of-a-kind center for in Advanced Linux Administration. to various companies, STN is also TRAINING PARTNER 2007-2008’’
excellence and finishing school Chennai involved in imparting High-end for Western region. Vibrant offers
focusing on ground breaking Mobile: 09790964948 project based training to students courses for RHCE 5, RHCSS etc.
technology development around Email: [email protected] of MCA and B.Tech etc. of various Mumbai
distributed systems, networks, Web: www.neuronit.in institutes. Tel: 022-26285066/6701
storage networks, virtualisation and Chandigarh Email: [email protected]
fundamental algorithms optimized for Plexus Software Security Systems Tel: 0172-5086829 Web: www.vibrantcomputers.com
various appliance. Pvt Ltd Email: [email protected]
Bangalore Plexus, incorporated in January 2003 Web: stntechnologies.com Ultramax Infonet Technilogies Pvt Ltd
Tel: 080-26640708 is successfully emerged as one of Training in IT related courses
Mobile: 09740846885 the best IT Company for Networking, South Delhi Computer Centre adn authorised testing center of
Email: [email protected] Messaging & Security Solutions SDCC is for providing technical Prometric, Vue and Red Hat.
and Security Training. Networking, training courses (software, hardware, Mumbai
NetMax-Technologies Messaging & Security solutions is networking, graphics) with career Tel: 022-67669217
Training Partner of RedHat,Cisco coupled with the expertise of its courses like DOEACC “O” and “A” Email: [email protected]
Chandigarh training; this has put Plexus in the Level and B.Sc(IT),M.Sc(IT),M.Tech(IT) Web: www.ultramaxit.com
Tel: 0172-2608351, 3916555 unique position of deriving synergies from KARNATAKA STATE OPEN
Email: [email protected] between Networking, Messaging & UNIVERSITY. Yash Infotech
Web: www.netmaxtech.com Security Solutions and IT Training. New Delhi Authorized Training & Exam Center.
Chennai Tel: 011-26183327, Fax: 011-26143642 Best Performing Center in Lucknow for
Tel: 044-2433 7355 Email: southdelhicomputercentre@gmail. RH Training and Examinations. LINUX
Email: [email protected] com, southdelhicomputercentre@hotmail. & Open Source training institute for
Web: www.plexus.co.in com. IT professionals & Corporate Offering
Netxprt institute of Advance Web: www.itwhizkid.com Quality Training for RHCE, RHCSS,
Networking Professional Group of Education www.itwhizkid.org PHP, Shell Script, Virtualization and
Netxprt Noida is a Leading RHCE & RHCSS Certifications Troubleshooting Techniques & Tools.
organization to provide Open Source Jabalpur Ssytems Quest Lucknow
training on RedHat Linux RHCT and Tel: 0761-4039376, Making Tomorrow’s professionals Tel: 0522-4043386, Fax: 0522-4043386
RHCE Training with 30Hrs. extra Mobile: 09425152831 TODAY Email: [email protected]
exam preparation module. Email: [email protected] Bangalore
Noida Tel: 080-41301814
Tel: 0120-4346847, Mobile: 09268829812 Q-SOFT Systems & Solutions Pvt Ltd Email: [email protected] Web Hosting
Email: [email protected] Q-SOFT is in a unique position for Web: www.ssystemsquest.com
Web: www.netxprtindia.com providing technical training required Perfect Innovation
to become a Linux Administration Trimax FuturePerfect Web Hosting Spider
Netzone Infotech Services Pvt Ltd under one roof. Since inception, the A Div of Trimax IT Infrastructure and • Web Hosting • Web Design
Special batches for MCSE, CCNA commitment of Q-SOFT towards Services Limited. Redhat RHCE, • Web Application Development
and RHCE on RHEL 5 with exam training is outstanding. We Train on RHCT Training & Exam Center, • SMS Hosting • Corporate Hosting
prep module on fully equipped labs Sun Solaris, Suse Linux & Redhat MCTS, MCITP, MCSE 03, CCNA, • Dedicated Servers
including IBM servers, 20+ routers Linux. CCNP, Prometric Center. Puducherry
and switches etc. Weekend batches Bangalore Mumbai Tel: 0413-3202726, 3246999
are also available. Tel: 080-26639207, 26544135, 22440507 Tel: 022-40681313, Mobile: 09987705638 Email: [email protected]
New Delhi Mobile: +91 9945 282834 Fax: 022-40681001 Web: www.webhostingspider.com

Want to register your organisation in


FOSS Yellow Pages For FREE
*

Call: Dhiraj (Delhi) 09811206582 Somaiah (Bangalore) 09986075717


or mail: [email protected], [email protected]
*Offer for limited period.

www.LinuxForU.com  |  LINUX For You  |  AUGUST 2009  |  113


114  |  AUGUST 2009  |  LINUX For You  |  www.LinuxForU.com
How can mobile solutions
help us increase revenue? How can I leverage the benefits
of cloud computing?

Where can I see all the latest technology


innovations in one place?
How can virtualization make our
business more efficient?
Will unified communications
help us improve customer
responsiveness?

REGISTER TODAY
MUMBAI | 7Ð9 OCTOBER for a Conference Pass
or Reserve Your
Bombay Exhibition Centre Free Expo Pass.
www.interop.com/mumbai

Answers. Action. AdvAntAge.


The Leading Global Business Technology Event is Coming to India ©2009 TechWeb, a division of United Business Media LLC.

Get the information you need to build your competitive edge at IT’s most comprehensive
Conference and Expo. See all the latest innovations—including virtualization, mobility and
cloud computing—that will help you increase efficiency, drive revenue and reduce costs.

Register Today for a Conference Pass or Reserve Your Free Expo Pass.
www.interop.com/mumbai

For Exhibiting and Sponsorship opportunities Contact Pankaj Jain at + 91 98101 72077 or email: [email protected].

SPOnSORS: MEDIA SPOnSORS: SuPPORTInG ASSOCIATIOnS:


Gold BronzE

BadGE
www.LinuxForU.com  |  LINUX For You  |  AUGUST 2009  |  115
Opslag FS2

Tyrone Opslag FS2 is a all-in-one storage solution that aims to meet all your requirements for
storage virtualization. It is an extremely flexible solution with a wide choice of
interface/protocols/disk-subsystem and provides extremely high redundancy.

You can use it as a NAS or a SAN. For customers looking for extremely high-performance storage
solutions we offer SRP target support & NFSoRDMA (over Infiniband interface).
It is a highly scalable solution and can scale up to 384TB

Opslag Storage Arrays


Specification
Host Interface:
SAS Two Min SAS 4x 3Gb SAS Ports - 300MB/sec per port
FC : Two 4Gb Fibre Channels - 400MB/sec per channel
iSCSI : 4 x 1Gbps Ethernet with iSCSI offload
RAID level 0, 1, 10(1E), 3, 5, 6, 30, 50, 60 or JBOD
1GB Bat
Battery backed cache with ECC
Online RAID level/stripe size migration
Online capacity expansion and RAID level migration simultaneously
Instant availability and background initialization
Greater than 2TB per volume set (64-bit LBA support)

Drives:
Supports up to 16-hot-swap SAS/SATAII HDDs in one box
Supports up to 80 HDDs by cascading multiple JBODs

Management:
LCD Control Panel for setup, alarm mute and configuration
Firmware-embedded web browser-based RAID manager -
access your RAID subsystem from any standard internet
browser via 10/100 Lan port

Enclosure:
3U rack-mountable with rail-kit
* The product picture is representative and the actual
Redundant Power supply product may differ in looks. Please contact us for complete information.

You might also like