linux magazine uk 20

83

Upload: -

Post on 11-Mar-2016

247 views

Category:

Documents


3 download

DESCRIPTION

linux magazine uk 20

TRANSCRIPT

Page 1: linux magazine uk 20
Page 2: linux magazine uk 20
Page 3: linux magazine uk 20

COMMENT

3LINUX MAGAZINEIssue 20 • 2002

We pride ourselves on the origins of our magazinewhich come from the very start of the Linux revolution.We have been involved with Linux market for six years

now through our sister European-based titles Linux Magazine (aimed at professionals) and Linux User(for hobbyists), and through seminars, conferences and events.

By purchasing this magazine you are joining an information network that enjoys the benefit of allthe knowledge and technical expertise of all the major Linux professionals and enthusiasts. No otherUK Linux magazine can offer that pedigree or such close links with the Linux Community. We're notsimply reporting on the Linux and open source movement - we're part of it.

Current issues

RIGHTSANDWRONGS

General ContactsGeneral Enquiries 01625 855169Fax 01625 855071

www.linux-magazine.co.ukSubscriptions [email protected] Enquiries [email protected] [email protected] [email protected]

Editor John [email protected]

Assistant Editor Colin [email protected]

Sub Editor Gavin [email protected]

Contributors Alison Davies, RichardIbbotson, Dean Wilson, Frank Booth, Jack Owen, Steve Cobrin, Steven Goodwin, Janet Roebuck, David Tansley,Bruce Richardson

International Editors Harald [email protected] [email protected] [email protected]

International Contributors Björn Ganslandt, Georg Greve,Jo Moskalewski, Anja Wagner,Patricia Jung, Stefanie Teufel,Christian Perle, Nico Lumma,Carsten Zerbst, Tim SchurmannMarianne Wachholz,

Design Advanced Design

Production Rosie Schuster

Operations Manager Debbie Whitham

Advertising 01625 855169Kenny Leslie Sales [email protected]üro [email protected]

PublishingPublishing Director Robin Wilkinson

[email protected]

Subscriptions and back issues01625 850565

Annual Subscription Rate(12 issues) UK: £44.91. Europe (inc Eire) :£59.80 Rest the World: £77.00Back issues (UK) £6.25

Distributors COMAG, Tavistock Road, WestDrayton, Middlesex England UB7 7QE

Print R. Oldenbourg

Linux Magazine is published monthly by Linux New Media UKLtd, Europa House, Adlington Park, Macclesfield, Cheshire,England, SK10 4NP. Company registered in England. Copyright and Trademarks (c) 2001 Linux New Media UK LtdNo material may be reproduced in any form whatsoever in wholeor in part without the written permission of the publishers. It isassumed that all correspondence sent, for example, letters, e-mails, faxes, photographs, articles, drawings, are supplied forpublication or license to third parties on a non-exclusiveworldwide basis by Linux New Media unless otherwise stated inwriting.ISSN 14715678Linux is a trademark of Linus TorvaldsLinux New Media UK Ltd is a division of Linux New Media AG,Munich, Germany

DisclaimerWhilst every care has been taken in the content of the magazine, thepublishers cannot be held responsible for the accuracy of theinformation contained within it or any consequences arising from theuse of it. The use of the CD provided with the magazine or anymaterial providied on it is at your own risk. The CD is comprehensivelychecked for any viruses or errors before reproduction.

Technical SupportReaders can write in with technical queries which may beanswered in the magazine in a future issue, however LinuxMagazine is unable to directly provide technical help orsupport services either written or verbal.

The European Union Copyright Directive is aiming to restrictour rights by limiting the usage of copyrighted works towhatever the owner decides. So you could buy a CD and it

would only be legal to play it on a music centre but not on a PC,or to copy it to some other format, like compact cassette, to playin the car. Within the directive (Passed in May 2001) was thephrase “Rights-Management Information”. This means that yourprivate usage is limited. A side effect will enable proprietary fileformats to limit what you can do. We could end up with a licencesaying you cannot use our software if you criticise us, or any ofour friends and so ending any form of free speech and democracy.But no one would do that now, would they?

It is May and so before the summer sun takes its toll and forcesus outside and away from our screens, a flourish of Linux activity isabout to occur. Lots of projects are churning new versions. Mozillais soon to launch version 1.0, which will mean the browser willhave come a long way in usability and stability. Next we can allinstall the latest distributions to keep up with security andapplications. The fact that they usually come with new toys iseither a distraction or bonus depending on your mood and who isin the room with you. We also have the annual Linux Installdaysarranged by the Dorset user group where we can all help spreadthe word and help one another.

Happy Hacking

John SouthernEditor

Page 4: linux magazine uk 20

NEWS

6 LINUX MAGAZINE Issue 20 • 2002

LINUX NEWS

SmoothWall – IPCop clarificationIn last month’s Linux Magazine we ran a feature onIPCop (Issue 19, pages 24-25). We failed to mentionthat the current version of IPCop (v0.1.1) is fruit bornout of the SmoothWall project. IPCop started life as afork from the SmoothWall project afterdisagreements over licensing.

The current IPCop is mainly the work of LaurenceManning, the principle author of SmoothWall, andPierre-Yves Paulus also from SmoothWall. While theIPCop project is trying to move the project on in adifferent direction, we feel it is important to also

appreciate the history, time and commitments made.If that wasn’t not bad enough, when we ran an

interview with Richard Morrell from SmoothWall inIssue 15 we managed to misspell the names of TedTs’o and Joe Arruda. Apologies all round.

InfoSmoothWall: http://www.smoothwall.org/Slashdot discussion:http://slashdot.org/articles/02/03/17/1332207.shtmlIPCop: http://www.ipcop.org/

Minneapolis-based DigiInternational, which has officesin Bristol, has introduced thenew PortServer CM – a product

line focused on the demandingrequirements of data centre managers.

The PortServer CM enables systemadministrators to monitor and control ITequipment such as UNIX and Linux servers,routers, network switches, intelligentpower supplies and telephone switches,through serial console ports. Administratorscan securely access any mix of thesedevices via TCP/IP connections overEthernet LANs or dial-up modem

connections. Administrators will find theembedded Linux OS a comfortable andflexible environment from which to manageand monitor their IT equipment.

The PortServer CM incorporates SecureShell (SSH v2 or v1), a robust, standards-based security protocol, to protect againstunauthorised monitoring, i.e. sniffing, byunauthorized users. The PortServer CM alsoprovides access to approved users on a perport basis. Access to the PortServer CMmay be further restricted through the useof the firewall functionality of the IPfiltering feature.

Additional features of the PortServer CM

include clustering, the ability to manage upto 512 console ports from one masterPortServer CM. The radius client providesport specific access and moves all the userinformation to a central server on thenetwork. For direct access to a specificport, the user can choose to Reverse Telnetor assign each port a separate IP address.The PortServer provides a Web-based GUIthat supports HTTPS for those who preferto securely manage the device through a browser.

Secure console management

InfoDigi International: http://www.digi.com

Linux wants YOUIf you’re looking to do a Linux install for the firsttime, but have been put off by a fear of theunknown, then the Linux Install Day 2002 is justfor you. Experienced Linux users around thecountry will be setting up workshops, giving newand inexperienced users the chance to go throughLinux installations, even on their own hardware ifthey have managed to bring it along, or, at thevery least answer questions and giveencouragement for later.

Two big days have been planned, Sunday 19 Mayand Sunday 9 June, though some of the local LinuxUser Groups have chosen Saturdays or other daysaround that time. The UK has 60 or more suchgroups, just see our User Group pages in the back ofthe magazine, and most will be arranging somethingaround the Install Day.

InfoLinux Install Day 2002: http://www.linuxinstallday.org/

Page 5: linux magazine uk 20

NEWS

8 LINUX MAGAZINE Issue 20 • 2002

Qt remains one of the niftiest toolkits for buildinggraphical user interfaces (GUIs) in Linux, Unix andeven Windows. Its applications are environment-portable, it’s included in most recent Linuxdistributions, it’s much easier to use than thestandard Motif toolkit for Unix systems, and itprovides Windows users with native-lookinginterfaces.

Frustrated by the lack of a good tutorial-stylemanual when Qt made its debut, author MatthiasKalle Dalheimer crafted the first edition of“Programming with Qt,” which has become a muchthumbed-through tome on many a programmer’sbookshelf. Dalheimer’s motivation for updating“Programming with Qt” for Version 3 was the factthat “the Qt landscape has changed considerablysince the first edition was published. It is no longer aniche product, but one that is widely used. Especiallythe embedded version, Qt/Embedded, has brought Qtinto many new places, so the need of a goodtutorial-style introduction (but also of some moreadvanced programming topics that I also cover) iseven more pressing than before.”

“Programming with Qt, 2nd Edition” shows howto use all of the Qt GUI elements, and coversadvanced topics like 2D transformations and drag-

and-drop. Thebook containsexercises and fullyworked-outanswers to makelearning easy,debugging hints,and instructionsfor reading andwriting XML documents.Among the many features adding value to thesecond editions a new chapter onnetwork programming.

What’s Dalheimer’s prediction for the future of Qt?“This might seem pretty bold, but I believe that inone or two years from now, at least in the embeddedspace, Qt will be the most often used toolkit which inturn will also give its desktop (Windows, Unix/Linuxand Mac OS X) versions another boost. Consequently,I would expect ‘Qt programming experiencemandatory’ in job ads to be as common as the ‘Javaprogramming experience mandatory’ or ‘MFCprogramming experience mandatory’ is today.”

InfoO’Reilly (UK): http://www.oreilly.com/catalog/prowqt2/

Programming with Qt

Panasonic takes stake in MontaVistaMatsushita Electric Industrial (MEI)has, through its subsidiary, PanasonicDigital Concepts Center (PDCC), takena stake in theembedded Linuxspecialist MontaVistaSoftware.

“As embeddedapplications become morenetwork-oriented,consumer electronicscompanies are looking toLinux as a robust and cost-effectivedevelopment platform,” said CharlesC. Wu, Managing Director ofInvestments for PDCC. “PanasonicDigital Concepts Centre recognises thetremendous traction that MontaVistahas gained in the increasinglyimportant area of embedded softwaresolutions. We look forward to astrategic relationship that will meldMontaVista Software’s strengths withPanasonic’s global leadership inconsumer electronics.”

MEI joins a list of high-profile

investors, including IBM, Sony, USVenture Partners and others, who alsoinvested in MontaVista Software in its

third round of fundingannounced earlier thisyear.

“Consumerelectronics andcommunicationsinfrastructure are the twomarkets we believe holdthe most opportunity for

Linux,” said Jim Ready, MontaVistaCEO and embedded industry pioneer.“Manufacturers of high-volume,competitively priced consumerelectronics devices especiallyappreciate the non-proprietary natureof Linux, which does not lock them into paying royalties and licensing fees.”

InfoMontaVista Software: http://www.mvista.com/Funding information: http://www.mvista.com/news/2002/MV_Fund.html

Dates announced forLinux Expo UK 2002Clear your diaries now, as the 9-10 October seethe return of the Linux Expo UK 2002 to Olympiain London, following on from the success of lastyears bash.

Now in its fourth year, Linux Expo is the UK’slargest exhibition and conference dedicated tothis open source revolution. It brings together allthe major players in the Linux computing sphereto provide the definitive review of all the latestproducts and services emerging around thisrapidly developing technology.

If you are evaluating the importance andimpact of Linux technology on your ITinfrastructure, you can meet over 80 internationalplayers who are leading the Linux revolution.From development tools, e-commerce, securityand Internet tools to Linux-based training andsupport; this is your unique opportunity to discuss your Linux issues directly with the industry leaders.

InfoLinux ExpoUK 2002:ttp://www.linuxexpouk.co.uk/

Page 6: linux magazine uk 20

NEWS

9LINUX MAGAZINEIssue 20 • 2002

Software Ag LinuxcommitmentSoftware Ag is showing off its Tamino XML Server,now that it runs on Red Hat Linux 7.2, SuSE Linux7.2 and SuSE Linux Enterprise Server 7 for IA-32. Thisenhanced Linux support underscores its commitmentto the popular Open Source operating systems. TheIBM S/390 mainframe family has been supported bySuSE Linux Enterprise Server 7 and Tamino XMLServer since last year.

Tamino XML Server is a high-performance platformfor managing data via the Internet and Intranets.Software Ag’s XML server manages information of alltypes – within and across organisations. In particularunstructured data, whose content was previouslyvery difficult to standardise, can be managedefficiently with Tamino. XML enables the universaland platform-independent exchange of businessdocuments and data between customers andbusiness partners.

InfoSoftware Ag:http://www.softwareag.co.uk/casestudies/

Fire and LightningLightning, the Swiss-based network securityappliances and solutions company, has introducedits MultiCom Enterprise Ethernet. This enterprise-level firewall appliance delivers stateful inspectionfirewall technology, unlimited node security, andIPSec VPN connectivity.

The MultiCom Enterprise Ethernet responds tothe demands of medium and large businesseswishing to securely connect to the Internet and toremote sites through secure, extended networks.

Gilles Trachsel, Product Marketing Manager ofLightning said: “Lightning presents the MultiComEnterprise Ethernet to the enterprise sector as acost-effective alternative to current firewallappliances on the market. This product respondsto the demands of our customers requiring a high-quality, cost-effective solution that offersmaximum security, high performance, integratedswitching and separate DMZ interface.”

InfoLightning Instrumentation:http://www.lightning.ch/

Page 7: linux magazine uk 20

NEWS

10 LINUX MAGAZINE Issue 20 • 2002

Running weblogswith SlashVisionaries have the ability to draw piecestogether to reveal a broader vista than wemight otherwise be able to see, but theyare usually not the force for change thatcreates the vision. Invention itself is thework of one or more individuals whopause to look at the pieces of a puzzleand ask, “Hey, what if?” Slash, the Open Source softwarethat drives the popular http://www.slashdot.org site, evolved as theSlashdot creators asked this question while their site took shape:“What if you could build a program to manage a Web site, wherepeople could organise and create things through a browser instead ofHTML editors and FTP clients? What if you let readers publish theirthoughts, and comment on stories and on the comments of otherusers?” Slashdot has subsequently triggered a revolution of its own,drawing hundreds of thousands of users and dozens of imitators.

In O’Reilly’s just-released book, “Running Weblogs with Slash” co-authors Brian Aker and Dave Krieger show readers how to make thispopular, powerful, and free system work for their own sites.

“Running Weblogs with Slash” was written for anyone who wantsto get a weblog up and running. As Rob Malda, creator of Slash,writes in the foreword, “Hopefully, what we’ve learned over the yearswill make it easier for you to tell your story.”

InfoO’Reilly: http://www.oreilly.com/catalog/runblogslash/

Remote heart monitoring, doctors given access to patient recordsand ambulances guided by satellite navigation systems, all from asingle hand held device: according to Compaq, this is the future forthe health care system in the UK. At Healthcare 2002, Compaq willdeliver its vision of how the implementation of wireless technologywill deliver a tangible and compelling return on investment (ROI)with the Compaq iPAQ at the core of communications andworking methods throughout health care operations.

Illustrating how health care organisations can cut costs whileincreasing the time doctors are able to spend with patients,Compaq will outline how it is working with York NHS Trust.There, a wireless network is already giving health professionalsfast, always-on access to essential information, such as electronicpatient records, while they are on their rounds in wards and otherclinical areas. Following the success of these initial steps, thehospital is now looking at ways that wireless technology canfurther transform the organisation.

Sue Rushbrook, head of systems and network services, YorkHealth said, “One of the crucial elements to ensuring thesuccessful implementation and real time usage of the ElectronicPatient Record is the clinician’s ability to access it at the point ofhealth care delivery. The deployment of one single mobile devicethat is capable of delivering voice and data services to enable thisease of access is now a realistic option.”

InfoCompaq: http://www.compaq.com/

Wireless injection for the NHS

Turbo10 Search Engine has been rankedas the UK’s number one engine bySearch Engine Spy, the UK’s leadingsearch engine industry watchdog.According to Search Engine Spy, Turbo10is a “refreshing change from manysearch engines mixing design, speed andcontent to create a truly superb searchengine.”

Nigel Hamilton, Turbo10’s Co-founderand Managing Director said, “We aredelighted to be ranked number one onSearch Engine Spy. It confirms that ourformula of speed, simplicity and relevantresults is working.”

Turbo10 Search Engine recentlyannounced its launch into the Deep Net,enabling users for the first time to searchspecialist information sources previouslyoverlooked by traditional search engines.

London based, Turbo10 is the firstsearch engine to bridge the gap betweenthe surface Web and the Deep Net.Crawler-based search engines like AltaVista and Google only search static Webpages – the surface web. But the surface

Web only represents a small proportionof the information available on the Net.

Turbo10 has created unique searchengine adapter technology, called theTurbo10 Trawler to connect to the DeepNet - a vast array of specialist databasesthat range from business associations,universities, libraries, and governmentdepartments.

“By delving into the Deep Net we arebroadening the depth and range ofsearch results for the online searcher. TheTrawler connects in real-time, so unlikecrawler-based engines, we search in thepresent not the past.” Nigel Hamilton, aformer Computer Science UniversityLecturer, said.

The Turbo10 Trawler can query up to10 different databases, retrieve theresults, rank and display them in aconsistent interface.

Turbo10 takes pole position Red Hat LinuxAdvanced ServerRed Hat Linux Advanced Server, the firstenterprise-class Linux operating system, isdesigned for demanding enterprise environmentsthat are migrating away from UNIX. In addition,Red Hat will unveil unprecedented enterpriseapplication support for Red Hat Linux AdvancedServer at a partner and customer launch eventtoday in New York City.

Red Hat Linux Advanced Server products willenable large companies to accelerate theirmigration from costly, proprietary UNIX to farmore cost-effective Linux running on Intel-basedserver systems. A recent total cost of ownership(TCO) analysis by IDC research showed that Linuxreduces per-user costs by almost half ininternet/intranet/extranet environments whencompared to RISC/UNIX solutions. In collaborativecomputing these savings can exceed 75 per cent.Red Hat Linux Advanced Server now brings thisbreakthrough TCO to database and applicationworkloads that are common in large enterprises.

InfoRed Hat Europe: www.redhat.com/

InfoTurbo10: http://turbo10.com/Search Engine Spy:http://www.searchenginespy.co.uk/

Page 8: linux magazine uk 20

NEWS

12 LINUX MAGAZINE Issue 20 • 2002

K-splitter

GETTINGBETTER

Figure 1: A glossary of a completely different kind

Bugfix A bug is a faultin software or hardware.The name stems fromthe days of bigcomputers, when insectsreally did causehardware failures.Manufacturers anddevelopers usually go toa lot of trouble tocorrect the fault asquickly as possible witha “bugfix”; usually apiece of code to beplayed in by the user.

Figure 2: The pro tool Kivio mp in action

The time has come

to spring-clean the

hard drive, because

whether it’s the beta

version of KDE 3.0 or

the new releases of

Kivio, KOffice or

Quanta Gold – a

number of

interesting updates

will be demanding

space on your home

computer

What exactly is a PIM?The acronym PIM is on everyone’s lips at the momentand lots of people have a PDA in their pockets butwhen anyone asks what these abbreviations actuallymean, many have to shrug regretfully. The KDEdevelopers of the PIM-gang (or to be more precisePersonal Information Management-gang) want tocorrect this sorry state of affairs at once.

At http://pim.kde.org/glossary/glossary.php (Figure1) the developers around Klaus Stärk have compiled aglossary which should cast some light on the darkjungle of acronyms and concepts. This domain cannotyet be reached via the main navigation, since themakers believe that they have not yet collectedenough content. They are therefore asking all usersof programs such as KOrganizer to send in any andall KDE words, which they have ever wantedexplained. In order to speed things up, Klaus Stärkhas added a form at the end of the site, via whichyou can send your contributions directly to him.

Software in fluxIt’s not only KDE that’s getting fit for spring, many ofthe programs around it are sparkling with newversions and features. theKompany.com has released

a new version of Kivio mp, the expanded – and sadly,not Free – version of the flowchart and vectorgraphics software Kivio(http://www.thekompany.com/products/kivio/). Thepro tool costs $99.95 as a CD set and $89.95 for thedownload version. For all those not wishing to buy apig in a poke, or gamble the money at ftp://ftp.rygannon.com/pub/KiviompDemo/ there is a demoversion for downloading and trying out.

Apart from a few bugfixes the latest release alsoincludes some new features. So for example, text cannow be rotated and for drawings there is now a layerfunction. Plus, undo options have been implementedwhen adding and deleting pages and layers.

But these are not the only innovations fromtheKompany.com. The HTML editor Quanta Gold(Figure 3) has also made a version jump. In version3.3.2 support for DTML (the Document TemplateMarkup Language from Zope) and ColdFusion hasbeen added. Furthermore Quanta Gold now has aplug-in interface. theKompany.com plans to creatediverse plugins for this, for example a databasewizard to make it simpler to create database-orientedWeb sites. The CD set of Quanta Gold costs $49.95,while the download version at $39.95 will look goodin the accounts. The demo version can be obtainedfrom ftp://ftp.rygannon.com/pub/QuantaGoldDemo/.Further information can be found at http://www.thekompany.com/products/quanta/.

Page 9: linux magazine uk 20

NEWS

13LINUX MAGAZINEIssue 20 • 2002

Half-time for KDE 3.0Since the first release of a beta version in mid-December last year, KDE 3.0 has grown out of theembryo stage. Especially good news is that inaddition to the bugfixes, which are obligatory inoriginal versions, the beta provides numerousimprovements and innovations compared with thefirst alpha versions. For example a new clipboardsystem is included, with innovations that ought toplease Windows migrants and operating systemhoppers in particular. In future there will be twoclipboards: the old, familiar X-variant and theclipboard in the style of Windows/Mac, on which textis no longer copied to the clipboard with the aid ofthe middle mouse button but via Ctrl+C.

The development environment KDevelop has beenexpanded by “Cross-Compiler Functionality” andadapted to the requirements of Qt/embeddedprojects. The former makes it possible to createprograms with Qt-based user interfaces for PDAssuch as Compaq’s iPaq and the Sharp Zaurus. Thenew Kdevelop abilities come at just the right time forhobby developers because the Qt manufacturerTrolltech has started a programmer competition forthe Sharp Zaurus (http://contest.trolltech.com/).

Just how quickly such a porting can occur is provenby the team surrounding Benjamin C. Meyer, who hasrewritten Kinkatta, his AOL-Aim chat-client, for the Qtembedded system. Source code and binaries for theporting, known as Kinkatta-Lite, should be availablesoon for testing on the homepage of the project athttp://kinkatta.sourceforge.net/).

In addition, the KDE 3 releases of Konqueror, KMailand the KDE standard terminal emulation Konsolehave a few surprises in store for users who enjoyexperimenting. Anyone wanting to know more aboutthe innovations in the new version of the desktopenvironment not mentioned here can find a moredetailed article in this issue (page 27).

With all these innovations, the KOffice developersobviously did not want to be left behind and for their

part have provided a new version of the KDE OfficeSuite at http://download.kde.org/stable/koffice-1.1.1/for download. Unlike their desktop colleagues,though, this release does not dish up so many newfeatures, but on the other hand increased value hasbeen attached to an improvement in performanceand greater stability.

The Konqueror takes over KoreaWhile in the German Bundestag the debate is stillgoing on as to whether Linux will be granted apermanent position on government computers, theKorean government has already done the deed. Asthe firm Hancom Linux http://www.hancom.com/ hasannounced with justifiable pride, 120,000 copies ofthe distribution HancomLinux Deluxe 2.0 havealready been sold to the Korean government. Thesecontain, in addition to many other softwarepackages, KDE 2 and the – also Qt-based – Hancomoffice package.

In the newsThanks to Christopher Molnar, the steadily growingnumbers on the KDE mailing lists are now alsoavailable on a news server, so that in future youwill no longer have to log on to every conceivablelist, but will be able to forage comfortably throughthe most interesting mail exchanges in yourpreferred newsreader.

To do this in the KDE reader Knode, for example,under the menu item Settings/ConfigureKnode/Accounts/News click New, make a new accessand christen it, for simplicity’s sake, KDE. In Server,enter news.uslinuxtraining.com. Now all you have todo is click on Account/Subscribe to Newsgroups, fishout the appropriate groups and fetch the articles.That’s about it – the mail is delivered, and overfullmailboxes are now a thing of the past. This doeshave one small drawback: access is restricted to read-only. So anyone wanting to take part in discussionswill still have to be registered on the respectivemailing lists.

Pipe of peaceAs a belated Christmas gift Mosfet announced at theend of last year that it has ported 20 effects for itsnew graphic multi-purpose weapon PixiePlus, whichwe presented at great length in Linux Magazine Issue19, to KDE 3 and in future will again contribute codeto the KDE Project. The KDE developers did not hangabout for long and immediately integrated the workinto the existing CVS tree.

With that, the differences of opinion between thetwo parties, which have caused a few waves in thepast year, will hopefully be banished from the world.Who knows, now this has happened, maybe we canlook forward soon to some new colourful KDE stylesfrom the Mosfet company.

Plug-in A programfragment which can be“plugged in”, as anexpansion into a largerprogram. Prominentsoftware with plug-intechnology includesGIMP and XMMS.

Figure 3: Quanta Gold provides Web designerswith the perfect graphical overview

Page 10: linux magazine uk 20

NEWS

14 LINUX MAGAZINE Issue 20 • 2002

Gnomogram

JOLLY LITTLEHAT MAN

Libraries required:Gnumeric: libxml >= 1.8.14, libole2 >= 0.2.4, Optional: bonobo >= 1.0.9, gb0.0.17, gda >= 0.2.92, guile >= 1.5, guppi >= 0.40.0Truevision: gtkglareaFileroller: gdk-pixbuf >= 0.9.x, Oaf >= 0.6.5, Bonobo >= 1.0, Gnome VFS >= 1.0

By using Gnumeric’s Autoformatsubstantial charts can be produced rapidly

This month

Gnomogram takes a

look at Gnumeric,

File Roller,

Truevision and the

GNOME 2.0 Alpha

release

GnumericGnumeric, the second software package to bedeveloped at Ximian (creators of Evolution), has nowreached the magical version number 1.0. Despiteintensive tests, however, yet another bug managed tocreep in shortly before the release, which waspromptly fixed in version 1.0.1. This means that now,

after around three and a half years ofdevelopment, there is a first-class spreadsheetavailable, which has nothing to fear from the

competition.As with Evolution, one can immediately see

Gnumeric’s similarity to its Microsoft equivalent.Every Excel user should feel at home in a very shorttime – especially since Excel documents can be bothimported and exported. In addition to Excel,Gnumeric also gets on with Import Applixware, Lotus123 and numerous other formats. Unfortunately,though, you will have to go without Excel

documents, unless you are prepared to compileGnumeric with support for the still very primitiveGNOME-Basic. The developers of GNOME-Basicaffirm, by the way, that macroviruses in GNOME-Basic simply could not exist – only time will tell ifthey are right.

For a long time the greatest point of criticismabout Gnumeric was the lack of and/or highlyunstable support for graphs. This problem has nowbeen solved with the aid of the program Guppi. Thistool, which specialises in graphs, provides its servicesvia Bonobo and can be embedded in a document

Almost on schedule, the Alpha version of GNOME2.0 has now been let loose on the world under thename “Rolig Liten Hattgubbe”. The name comesfrom Swedish and means something like “jolly littlehat man” – but the only people who will have funwith this version are programmers and passionatetesters.

The latter should take a look at GNOME newsand consider installing GNOME 2.0 with a different––prefix than GNOME 1, because otherwiseGNOME 1 programs will be overwritten. Howeverthe purely GNOME 2.0 libraries can be installed in

parallel with the latest GNOME 1.4 libraries.Anyone wanting to test GNOME 2.0, without at

the same time turning your entire system on itshead, can take a little look at the GNOMEdeveloper site, into the development of GNOME2.0. Also, the modifications visible to the user havebeen summarised athttp://www106.pair.com/rhp/gnome-2-new.html.One particularly nice feature here is the new stockicons, which are already being used in someprograms such as Evolution, as well as the newversion of GDM.

GNOME 2.0 Alpha

Page 11: linux magazine uk 20

NEWS

15LINUX MAGAZINEIssue 20 • 2002

without any problem. Other data types, such asimages, can also be embedded in the same way; forthe latter the Bonobo component of the imageviewer Eye of GNOME is required.

There are a wide variety of ways to analyse data –Gnumeric offers functions from correlation analysis tothe histogram. By using a target and/or solutionsearch, initial values can be manipulatedautomatically so that a function outputs a specifiedvalue. Also useful is the option of defining complexfilters. To do this, values and criteria are specified inthe document, which Gnumeric applies one againstthe other. Unfortunately, many of the functionsdescribed are anything but self-explanatory – so it isworthwhile, in any case, taking a look in theGnumeric documentation, which goes way beyondthe usual Readme.

TruevisionTruevision is a program for creating 3D scenes, similarto the well-known Windows 3D modeller Moray. LikeMoray, Truevision does not calculate the finished 3Dscene itself, but hands it over to the raytracer POV-Ray. As the name Raytracer suggests, POV-Raycalculates the path of rays of light through a scene,so as to achieve a near-photo-realistic image. Butsince it would be unbelievably time-consuming tosimulate all the rays of light, virtual lines of sight areemitted from the camera. Where these strike anobject, further rays are sent out in turn, in order todetermine the illumination of the strike point.Together with other techniques such as Radiosity – a“run” of the objects with each other based ondiffuse light – POV-Ray is thus able to calculateastounding images.

All POV-Ray scenes are based on a range ofobjects, which can be created in the Create dialog ofTruevision. Here, in addition to simple forms such asspheres or cylinders, can also be found various lightsand atmospheric effects such as mist. Unfortunatelysome of the more complex POV-Ray objects such asblobs, prisms or the Julia fractal are still lacking – butno doubt these will follow in the subsequentversions.

Already in this version, it is possible to createbeautiful scenes without 3D fractals. The mostimportant resources for this are the CSG operators(Constructive Solid Geometry), with the aid of whichseveral simple objects can be linked, as with Booleanoperators. So a new object is created from severalobjects or their intersection.

In order to keep perspective with complex scenes,it is also possible to create layers from several objects,which can be scaled and moved around as a singleentity. Also, by modifying the co-ordinates, thismovement can of course also be done by mouse inone of the views. When doing so it can be usefulthat Truevision, in addition to the grid view, also

With the aid of File Roller archives canbe simply created and unpacked in anyconceivable format. Apart from thenice surfaces File Roller also hassomething else to make it better thanits predecessors, such as Guitar – i.e.it’s possible to look at lots of filesdirectly from the program.

To do this, File Roller searches withOaf for a suitable Bonobo component,which is started in a new window. Ifno suitable component is found, thetext viewer is used. Files can bedisplayed in the main window both listed in directories or completely. Theprogram is also able, in the Add dialog, to add sub-directories recursively andoffers the usual features such as skipping backup files and symbolic links.

File Roller

offers a preview via OpenGL.Just as important as the object itself is the texture

assigned to it. Truevision comes with a comprehensivecollection of textures in a separate package(Truevision-Extramat). In the case of almost all surfacesthere is a preview – if not, this can be computed inthe material editor. The individual characteristics ofwhat are sometimes highly complicated textures areshown, as in Moray, in a tree view. To understand allthe options, it’s also worthwhile at this point taking alook in the POV-Ray documentation.

One option that is completely lacking in Truevisionis animation, and it is not exactly simple to createanimations under POV-Ray anyway. Often individualscenes are quite enough to occupy the computer forsome time. Anyone who has several computers,though, has the option of getting them to worktogether with the PVM patch.

URLsGNOME 2.0 news http://news.gnome.org/gnome-news/1011293794/

index_htmlInfo for GNOME 2.0 testers http://news.gnome.org/gnome-news/1011290700/

index_htmlGNOME Developer’s Site http://developer.gnome.org/dotplan/What’s new in GNOME 2.0 http://www106.pair.com/rhp/gnome-2-new.htmlGnumeric homepage http://www.gnome.org/projects/gnumeric/GNOME-Basic homepage http://www.gnome.org/gb/Truevision homepage http://truevision.sourceforge.netPOV-Ray homepage http://www.povray.orgPOV-Ray documentation http://www.povray.org/ftp/pub/povray/Official/Docs/PVM patch for POV-Ray http://www-

mddsp.enel.ucalgary.ca/People/adilger/povray/pvmpov.html

File Roller http://fileroller.sourceforge.net

File Roller when viewing theTruevision archive

Page 12: linux magazine uk 20

LETTERS

16 LINUX MAGAZINE Issue 20 • 2002

A fair copI read the IPCop review (April 2002) withgreat interest and found it useful but I dothink the author should have found space

to mention that IPCop is a fork of the GPL version ofSmoothwall. I don’t think that significant informationshould be left out, particularly since you’ve hadSmoothwall on your coverdisc and interviewedRichard Morrell. I know that it’s an awkward issueboth because there is some bad feeling between theIPCop and Smoothwall teams and because theSmoothwall product has been the subject of a seriesof controversial accusations and counter-accusationswithin the UK Linux community. A way round thismight have been to simply provide links to pagesdiscussing the issues around the fork.

Controversy aside, while forking a project isperfectly acceptable under the GPL, giving credit tothe original developers is only courteous.Bruce Richardson, via email

LM It is true that Smoothwall and IPCop areinextricably linked. The significance of theirrelationship was underestimated and, at the time, itdid not seem fitting, or necessary to mention it in anarticle that dealt with setting up and configuringIPCop. It was not our intention to mislead anyoneabout the history of IPCop and the fact that verysignificant parts of it have come from the Smoothwallproject, and, if we have done so, we are sorry.

In our News section we have included someclarification on this matter and we do hope to havean interview with Laurence Manning, the principleauthor of SmoothWall, in next month’s magazine.

We have all the time in the worldI work in Denmark and my laptop clock isalways wrong. How do I set it so it is anhour ahead of UK time and change this

when I come home. William Worthington, via email

LM GMT (Greenwich Mean Time), now referred to asUTC (Co-ordinated Universal Time) or Zulu time, isbased about the fact that the sun directly overheadzero degrees longitude is at noon. This is a universaltime so 16:00 UTC in London is 16:00 in Sydney.Local time however varies. In the UK we move to BST(British summer time) to gain extra daylight in the

lighter months and other countries have their owntime zones. Denmark is in the Central EuropeanTimezone and so is UTC +1 while New York is in USAEastern Standard, UTC -5.

Check your current system time with the command“date”. As root you can change this. For example for13 May 16:54 2003 you need date 051316542003.Unfortunately the system time will reset to yourhardware clock time when you power down.

Come and have your say

WRITE ACCESS

Write to LinuxMagazineYour views and opinions areimportant to us, so we dowant to hear from you,about Linux-related subjectsor anything else that youthink would interest Linuxusers.

Send your submissions to:

By post:Letters PageLinux MagazineEuropa HouseAdlington ParkMacclesfieldCheshireSK10 4NP

By email:[email protected]

Be sure to leave your postaladdress whichever methodyou choose.

Living in the Free worldIn interviews in the past, Richard M.Stallman warns of the fallacy of userswho are willing to mix Free software,

like GNU/Linux, and proprietary software, likeStarOffice or VMware, pouring cold water on theidea that even some access to Free software canbe beneficial in using more Free software. Surelythis is wrong. Any use of Free software has got tobe applauded, even in a mixed environment,because the use of Free software will lead to theuse of more Free software, if available for the taskat hand. This is the point, there isn’t always Freesoftware available that will take on that task orthat will do it well enough. What would RMS do,not finish our work out of principle? Does he livein the real world?Richard Stratford, via email

LM RMS may not live in the real world, he is aman with very deep ideologies and he lives bythem. He also sees much wrong with the world,and he feels passionately that he could make achange to one part of it, the closed softwareworld. If necessary he will die of old age trying ashe is often quoted as saying. He sees the worldvery much in black and white, whereas the rest ofus have the luxury, or is it a complication, of seethe shades of grey.

You can take RMS and his views as inspiration –many do – but it is much harder to take him as anexample of how things should be done. His skillset allows him to live in a different world. If hewants access to some software that is currentlynot Free, he’ll write it, in the real world that’s notusually possible.

Page 13: linux magazine uk 20

Convergence of technologiesI am very excited about the prospect of Linux (forPlayStation 2) and can see a whole new market opening up for bothLinux users and games developers. I believe it to be

the brink of something new and exciting, the meldingof ‘consumer’ electronics and free spirited, outof the box development. Personal computershaven’t quite made it to ‘consumer electronic’status yet, maybe their time is up. I doubt thaton its first outing Linux (for PlayStation 2) willbe anything other than clunky, but it will surelybe the forerunner of some new technologicalleaps. I can’t begin to imagine how the futurewill unfold, and that’s the exciting bit.Steven Wells, via email

LM You might be right, it is an exciting timeand no one can predict the outcome – andthey never will. It is true that Linux developers,be they professional or hobbyists, have lessrestraints as to how they can allow a projectto flow. It takes only the slightest whiff ofsuccess before a project is picked up andcarried off by its own momentum to reach far grander things than the originaldevelopers had dreamed of. Who is to say that something similar wont happenin this case, with a whole slew of ‘consumer’ software changing peoples lives. It’sa nice thought, anyway. Next month, we do hope to have a review of Linux (forPlayStation 2), what it’s capable of and, more importantly, what it’s not. Let’shope it bolsters your ego rather than dampens it.

LETTERS

17LINUX MAGAZINEIssue 20 • 2002

Change the hardware (BIOS) clock to your newsystem time with:

hwclock ––systohc ––etc

This assumes the hardware clock is set to UTC time.By doing this, local time will automatically takeaccount of summer time. If the clock is still wrongthen the usual reason is the internal battery has diedand needs replacing.

Now that you have the BIOS clock as UTC and thesystem clock shows local time you only need tochange timezones on the computer when youchange countries for all to be in order. In the etcdirectory you will find a text file called timezone.Simply edit this for your zone and reset.

Ready to receiveHow is Linux for supporting TV and Radiocards? I am considering the purchase of aPCI TV/Radio card, but am uncertain of

what support I can expect to find. Is it even practiceto start considering a Linux system for a hard diskVCR? Any advice is greatly received.John Warde, Leicester

LM This is still a continual problem for Linux usersand the availability of drivers can hold you backconsiderably. There are sites likehttp://www.linuxhardware.org/ that often can leadyou the right way, and a search on Google will bringup yet more clues for you.

Hard disk video recording does seem to be morefeasible with the news that the guys athttp://www.linuxtv.org have released version 1 oftheir Video Disk Recorder.

Stick to the scriptThis may sound like a stupid newbiequestion but how do I run scripts? I have looked everywhere. I know I am

using a Bourne Again script editor but nothing seems to work. Please don’t ignore me. Everyonestarts somewhere.Andrew Bailey, Glasgow

LM The Bourne Again Shell (usually refer to as bash)should give you a prompt in a terminal window. You

first need to write your script in a text editor and saveit. Let’s start by opening up an editor and typing:

#!/bin/shecho Hello World

Now save this as a file called test.sh. Do a listing tofind the permissions such as:

fred@space:~ > ls –l–rw–r–– r–– 1 fred usersU27 May 3 17:43 test.sh

This tells us that fred has permissions to read andwrite to the file but not execute it. Change thepermissions with:

fred@space:~ > chmod +744 test.shfred@space:~ > ls –l–rwxr–– r–– 1 fred usersU27 May 3 17:43 test.sh

Now we can run the script by calling it:

fred@space:~ > ./test.shHello World#

Page 14: linux magazine uk 20

INTERVIEW

18 LINUX MAGAZINE Issue 20 • 2002

Sam Williams

FREEDOMUNBOUND

InfoAuthor Sam WilliamsPublisher O’Reilly(www.oreilly.com)Price £15.95ISBN 0-596-00287-4

Linux Magazine

caught up with

Sam Williams,

author of “Free as

in Freedom”, a

biography of

Richard Stallman

and his crusade for

Free software

Linux Magazine – How long did it take you to writethe book?Sam Williams – About a year from start to finish, atime that was full of love and treachery, some of thebaser human emotions. About 18 months ago I wasapproached by an agent from a publishing companywho was interested in doing a book about RichardStallman, and negotiations were started.Unfortunately the book project fell through becauseof some of the unique licensing issues involved, butnot the relationship that developed with the agentfrom the publishing company and me, we were laterto get married.

O’Reilly was the only publisher that couldaccommodate the content licence that we required interms of the digital realm. About June last year theyagreed, then from August until Christmas the mainwriting took place, although most of the main writinghad already been organised in the form of research, Ijust had to go through my log. I spent about 30 days ina row writing everyday all day.LM – What did you know of Richard Stallman beforeyou were asked to write the book?SW – I had interviewed him about three or four timesbefore. My first encounter with him would have beenthe LinuxWorld trade show, March 1999, where theinitial launch of GNOME 1.0 took place, with full presscoverage. I was just clueless at the time, and I askedhim “What does this mean for the Linux operatingsystem?” and I remember him jumping down mythroat for not calling it GNU/Linux, reminding me that itwas disrespectful to all of those that had worked onthe GNU project to not give it the more full title ofGNU/Linux.

At first, he seemed to me to be a prima donna, butas I got to know him more I came to realise that thiswas just how I was interpreting his quirky personallity.LM – Do enough people see past his quirkypersonality?SW – That was my approach to the book. The idearunning through my head was that will people see RMSdifferently in a hundred years in the future, when hispersonality is not around to get in the he way. I feltthat it would be a complete disservice not to focus on

that personality and how it has hampered him in someways and given him strength in others. RMS will say itabout himself that his primary asset is that ofstubbornness, not everybody could say “I’m never evergoing to use proprietary software again for the rest ofmy life”. Well, he said it, has the will to back it up, and,more importantly has the coding skills to go and writesome thing and do that every day to build somethingthat he can use and that other people can build upon.LM – Did you know about GNU before yourintroduction to RMS?SW – I knew about it but only in a general way, as partof doing research into Linux. I only got to know aboutit at the ‘99 LinuxWorld show. Here he really made hiscomeback, with all the tech media gathered, theycalled it the coming out party for Linux. He really usedthat platform skilfully, to make people aware that therehad been work going on since ‘85 and the Linux OSwasn’t something that Linus Torvalds had pulled out ofhis brain, being disrespectful to the GNU project andnot acknowledging how much effort is involved indeveloping an operating system of this size. So I knewa little about GNU by listening to some of his speeches,but it really was in the course of writing the book thatmy respect, both for him and the project, was raised.LM – What were the licensing issues that halted thebook originally?SW – I was approached by a company who wereinterested in doing an electronic book about RMS, theywanted a subject that was going to appeal to theInternet community. I said I would do it, but then,during the course of researching the book I realisedthat RMS really detested the electronic book and itsproprietary formats, with the texts of such books being‘rented’ in a restricted form. The whole RMS argumentwas that software should give you liberty, and we werecreating a product that would give readers less libertythan a paper book.

Unfortunately, the publishers were not in thebusiness of giving away their content. The subjectmatter would have made it a prime target for thecracker community, taking the challenge to make surethe text was made available. We couldn’t reachagreement on this, so the book deal fell through.

Page 15: linux magazine uk 20

REPORT

19LINUX MAGAZINEIssue 20 • 2002

The GNU project was set up in 1984 byRichard Stallman after he began torealise that what had once been a

community of Free software users andprogrammers based around anemerging Internet had disappearedand had been replaced by an anti-social and unethical crowd ofpeople who had all signed a non-disclosure agreement so that theycould work on computers andoperating systems such as theoriginal VAX systems, which at thattime were the latest thing. Things hadto change. When RMS lectures abouthow the concept of the GNU project came tohim he explains that Free software is about thefollowing:

● You have the freedom to run the program, for anypurpose.

● You have the freedom to modify the program tosuit your needs. (To make this freedom effective inpractice, you must have access to the source code,since making changes in a program without havingthe source code is exceedingly difficult.)

● You have the freedom to redistribute copies, eithergratis or for a fee.

● You have the freedom to distribute modifiedversions of the program, so that the communitycan benefit from your improvements.

It’s precisely this kind of morality that has shockedthe present day proprietary software manufacturersand distributors who have all followed the non-disclosure model, which conspires to lock in the enduser and make sure that they will never be able tomake a choice over which type of software orprogram they will run on their computers at sometime in the future. The proprietary software modelgenerates vast sums of money for one person or fora very small group of people. The Free softwaremodel can actually help to make money for abusiness or an individual but it doesn’t generate the

Bradley teaches,

hacks and provides

documentation about

Free software. In

February 2001 he

was appointed as the

full-time Vice

President of the FSF.

He took a little out

of his busy schedule

to talk with Richard

Ibbotson about the

FSF and what they

set out to achieve

kind of greed and avarice that you can expect fromthe proprietary model. As such it is seen to be

somewhat more desirable and a good dealmore forgiving of its end users – both from

the point of view of the licence and fromthe point of view of what you canactually do with it once you haveinstalled Free software. The goal of theGNU project was to give the end userfreedom. It does that through the useof something called copyleft, which is a

reference to copyright law.

Strong foundationsThe Free Software Foundation (FSF) came into

being around 1985 after the EMACS project wasstarted and it was realised that interest in the GNUproject was growing. The FSF came into being as atax-exempt charity, which could accept donations forFree software development. The EMACS project waseventually extended to include other Free softwareend eventually FSF books were produced to generategreater interest and further funding. In the presentday both the FSF and the GNU project are such anamazing success that when IBM came to theconclusion that they would take a serious interest inGNU/Linux they asked the FSF to look after theirlicence for them into perpetuity.

In more recent times Bradley has taken an interestin the DMCA (Digital Millennium Copyright Act) andthe European Union directive to introduce the samelegal structure within the EU. We are entering aworld of digital media where you can get yourbooks, music and movies digitally and the mediacompanies want a leak-proof pipe from their mediato you – without this you can make perfect verbatimcopies of all the things they send you. Bradleyquickly points out when asked about digital rightsissues the FSF is not interested in supporting thepirating of copyrighted material, it’s all aboutquestioning the freedom of the individual. In asimilar way the DMCA assumes that you are acriminal and that without any real evidence you maybe found to be guilty or not guilty.

Talking about freedom

BRADLEY M. KHUN

InfoFree Software Foundation:http://www.fsf.orgGNU Project: http://www.gnu.org/gnu/thegnuproject.htmlPatent issues: http://www.patent.gov.uk/about/consultations/conclusions.htm

http://europa.eu.int/comm/internal_market/en/indprop/comp/02-277.htm

Page 16: linux magazine uk 20

FEATURE

20 LINUX MAGAZINE Issue 20 • 2001

The new release of

SuSE 8.0 has finally

arrived to the great

relief of the

developers involved

and to the excitement

of the end users and

SuSE fans alike.

Richard Ibbotson

gives us a hands-on

view of the new

distro

SuSE has introducedsome major newinnovations into its

Professional and Personalversions of SuSE 8.0, whichmeans that it’s well worthhaving a look at it. Fromwhen you first open up theirglossy and well thought outmanuals to the finish whenyou begin to click on themouse and ooh and ah at the excellent and highlystable desktop you can be fairly certain that youare onto a good thing.

The desktop users have got the latest and greatestin the shape of KDE 3.0, GNOME 1.4, XFCE 3.8,Windowmaker 0.80.0 and Enlightenment, as well asseveral other minimalist and lightweight desktops.You can also mix and match these to great effect andmake any or all of them suit your own personaltastes. There are many universities and Governmentdepartments out there using these desktops to goodeffect. In recent times there are even commercialorganisations using the Linux desktops rather thanother products.

InstallationIf you do need to dual boot a Linux partition with aWindows one, then that’s very easy to configure atthe time that you run the SuSE Linux installation.

After booting from the floppy boot disk or the firstCD you will be presented with several screens thatwill ask you about resizing your Windows partition.

You are not committed to thefinal size of the partition until youare presented with a screen thatwill tell you that your partition willbe re-sized. The installationprocess has been simplified quitea bit, whether it’s for thestraightforward SuSE Linuxinstallation or whether you do infact need a dual boot machine. After placing the first CD in the

computer, the installer will check all of the hardwareon your system and find things like CD-RWs or LS120drives, as well as floppy drives and all of your otherhardware. It will then take you through an easy tounderstand graphical installation process, which willask you questions and give you a few choices aboutwhat it is that you want to do with your newlyinstalled machine. Boot configuration is sorted outfor you for the next time you start the machine. TheXwindows configuration should be a trivial part ofthe installation process.

Providing your graphics card and monitor are notmuch more than two years old everything should befine, though many people have found that olderhardware works just as well. If you do have problemsconsult people on one of the many LUG discussion

A reason to celebrate

SuSE 8.0

SuSE 8.0 welcome screen Taking control of multimedia

Page 17: linux magazine uk 20

FEATURE

21LINUX MAGAZINEIssue 20 • 2001

lists or ask for some help from the SuSE supportdepartment. Basic configuration is part of the 60 or90-day support scheme, which comes with every boxof the software. The test machine that was used withthe SuSE 8.0 software presented no problems at allfor automatic configuration of a workstation and thatwas with a very much out of date Belinea monitorwhich would probably look much better sitting on ascrap heap than on a test bench.

ApplicationsAs is always the case, SuSE Linux does have a greatchoice of desktop applications. This includes manyfeature-rich wordprocessors, all of them Free, as wellas organisers, email applications and a bewilderingarray of Web browsers, which quite simply leave theMicrosoft stuff firmly in the last century.

OpenOffice.org has now been included into theSuSE distribution. In time it will probably replace thepresent Star Office 5.2 due to the licensing conditionsthat affect Star Office 6.0. Other word processors areof course present, such as Kword 1.1.1. This can savein a variety of formats such as RTF, Abiword and oneor two others. If you’re a Palm Pilot or Handspringfan then you might like to have a look at the latestversion of Abiword. Not only does it do your normalrun of the mill MS Word documents but it will alsohandle HTML and TeX and most important of all itwill save with the Palm extension on any documentso that you can use Jpilot or Kpilot to transfer yourdocuments over to your PDA for the next day’sbusiness or pleasure. There is a free version ofAbiword for Windows that you can download fromthe Net.

There’s also all of the expected Postscript and PDFutilities that will enable to you to produce those topclass documents that people look at more than once.It’s great to know that Postscript is still used and willbe in use for a long time to come. You can use theabove for Web pages or, if you aren’t a highly trainedTeX person, you can use something like MozillaComposer to write a graphical Web page and thenfinish off with Quanta+ by hacking the code. Thereare other HTML authoring tools on the CDs – it’s bestto have a look at them to find out what’s there.

Internet toolsThe wonderful array of text processing tools isbacked up by the Internet-based tools. The Webbrowsers that are included are Mozilla 0.98 whichalso has Mozilla mail and Mozilla Composer forproducing Web pages; Opera, which is small andlight when compared with the others; Konquerorwhich is very popular just now; Galeon for theGNOME fans and several others. If you are a bit oldfashioned then you can always use Netscape andNetscape mail. Speaking of mail applications. If youare a Eudora or Outlook person and you can’t cope

with anything else you are in for a few surprises withthe new desktops that are around just now. Kmail isprobably a good replacement for Eudora. Evolution1.0.2 – that long-promised Outlook clone and PIM –is also now a part of SuSE 8.0. Other mailers that youcan use include Balsa and Spruce, which are GUI-based applications that are easy to use. If you are atraditional Unix user you can of course use somethinglike Pine or Mutt to do all of those things that youwould have done on another platform.

The development tools are all there for the aspiringprogrammer or hacker, whowants to either developsome software or justexperiment with some ideasthat might not work out.Tools like automake and theGCC compiler are present.There is also the IBM Javadevelopment tools and C++compilers and many othertools. Glade and Anjuntaprovide for GNOMEdevelopment on the desktopand Kdevelop for the KDE people. There is also a freeversion of Kylix for anyone who wants to risk such anadventure.

For the purposes of leisure, or perhaps even forday-to-day use at work, there are tools for digitalphotography or listening to music or mixing it at thetime of recording or you can watch your favouriteDVDs or TV programmes on your computer. Listeningto music from CD or MP3 is something of a joy whenusing Alsa sound tools and a good set of speakers.

Server-side upIf you want a server rather than a desktopworkstation or notebook installation then SuSE Linuxdoes have NFS and NIS server software built in, aswell as DNS software and the various bits and piecesof security software that are normally associated withservers. If you want a Samba server, version 2.23a isthe one that comes with the CDs. This will allow youto set up shares on a Linux computer so that itservers files to a local network or to a remote

YaST2 foryour PDA

WindowMakerdesktop

SuSE Linuxdoes have agreat choiceof desktop

applications

Page 18: linux magazine uk 20

FEATURE

22 LINUX MAGAZINE Issue 20 • 2001

network with SSL security protocols. This gives you arock solid server that your MS Windows computerscan connect to.

For a reliable mail server that also has a spam filterand virus scanner, you’ll need to get hold of the SuSE8.0 Professional version, which can build a mail serverwith an MTA such as Sendmail or Postfix. Both ofthese are well understood and they also come with avirus scanner (Amavis) built-in. If you don’t want touse Amavis there are many other Linux-based virusscanners out there, such as Sophos or the Trendmicroones that you will have to pay for.

There are many thousands of Apache Webservers out there on the Net, all of which aremaintained by an army of technicians and systemadministrators. The SuSE distribution has a wealthof information about Apache and how to configureit. There is also a good choice of Apache modulesand plenty of support for this application can befound from the SuSE list and through pay forprofessional services. The Apache configurationtool, Comanche, is also included.

In a nutshellThe kernel people out there might want to knowabout the new 2.4.18 kernel that is a part of the 8.0release. The usual selection of SuSE standard kernelsfor i386, i586/i686 uniprocessor and SMP(Symmetrical Multi-Processor) has been added to,with the first time inclusion of an nVidia kernel. Thismeans that you have a great choice of PC hardwareto run. Alpha and Sparc versions will come alonglater. You can still re-compile your kernel for yourown requirements to improve the performance ofyour computer if that is what is required.

YaST2, which has now replaced YaST1, performspackage management and system updates, as wellchanges in configuration. YaST Update Online willallow you to manually or automatically connect to aSuSE server so that your machine can check for anddownload updates. There are quite a few systemadministrators out there who like to know what it isthat is being installed into their computers on theirnetworks. The manual update will allow to you sayyes or no to a package before accepting that the

package is what you want to install. If you are also aDebian GNU/Linux fan you might prefer apt-get? Ifthat’s the case you can use apt4rpm to get hold ofyour updates.

Net configurationConfiguring your Net connection, whether it’s athome or in a commercial or Governmentenvironment, is well catered for. YaST2 can be used inconsole mode without Xwindows, so that you cantake advantage of command line configuration anduse YaST2 to help you with the difficult parts such asconfiguring an ISDN card or ADSL connection. ADSL isbest configured with a cable modem through theEthernet interface. You can also configure and use theBT Alcatel USB modems after recompiling the kerneland installing the Benoit Papillault software from theNet, which is available from Sourceforge. The SuSEfirewall is included in the Professional version.

You can use the SuSE security list to ask questionsabout things like how to configure /etc/hosts.deny orwhich parameters to put into the firewall when youset it up. There is also the personal firewall, whichyou might want to use on a notebook when you aretravelling. For home use on a dial-up connection youshould use the full version of the firewall so that youcan find out with logged messages just who it is thatis having a go at your systems. In present daycircumstances this is no longer a joke and you shouldtake notice of this.

ConclusionIf there is something that hasn’t been mentionedabove then it’s because there isn’t enough room toexplain all of it here. If you have a specific need orwish then you should find that the SuSE 8.0 releasewill have already identified your problems and sortedthem out. The Professional version comes to you in awell-presented box with a very full set of manuals.You get seven CDs and one DVD, which contains allof the software that is on the other CDs and a goodbit more as well. The Personal version costs less buthas everything that you might need for your ownworkstation to write letters and to send faxes.

Supplier SuSE

Price To be confirmed

Web http://www.suse.co.uk

For All-inclusive

Against No YaST1 included

SuSE 8.0

rating

XFCErunning

Memory info from the control centre

Get hold ofthe SuSE 8.0Professional

version

Page 19: linux magazine uk 20

ON TEST

23LINUX MAGAZINEIssue 20 • 2002

Six months have passed since the last Mandrakeboxed set was released, so now seems like asgood a time as any to put on show the latest

efforts of the MandrakeSoft developers and thecommunity that has built up around them.

Mandrake Linux takes upon itself the role of beingthe cutting edge Linux system for Intel, AMD andPowerPC processors. This is helped by the wayMandrakeSoft communicates with its users throughits Cooker project, while maintaining a firm belief inease of use and accessibility for new or lessexperienced users. Because of this ease of use andthe excellent array of programs and desktop utilities,Mandrake Linux is often thought of as being suitablefor desktop use only. In truth, a full and wide rangingset of server applications come supplied withMandrake Linux making it a versatile all rounder.

What’s available?Mandrake Linux 8.2 ships in three forms:

● The 8.2 ProSuite Edition featureseight CDs (including two specialserver CDs), one DVD, and twocomprehensive manuals. Alsoincluded is a subscription for twoupdate CDs – to be receivedduring the product life – whichcontain security and bug fixes. The ProSuite isaimed squarely at the high-end enterprise sectorwith requirements for a product that is highlydependable, secure and scalable. US$149.

● The PowerPack Edition features seven CDs packedwith thousands of the best Open Source andcommercial applications, an installation guide, plusa detailed reference manual. US$69.

● The Standard Edition includes three CDs plus aninstallation and user’s guide. Price to be confirmed.

The MandrakeSoft Web site only quotes prices inUS$, which we have quoted for you to use as aguide. No price was available on the Web site for theStandard Edition at the time of writing, but as aguide Linux Mandrake 8.1 Standard Edition was soldin the UK for £32.

You also have the opportunity to download thethree disc set from the Mandrake Web site or from itsvarious mirrors. You may even be able to buy copiesof these downloaded sets from places lineLinuxEmporium.

What’s new?Mandrake Linux 8.2 doesn’t come with any startlinglynew packages, but should be considered a revamp of8.1, with lots of improvements. The kernel hasmoved up to 2.4.18 and includes a special enterpriseversion for those of you that need support for largeamounts of memory – greater that 1,024Mb – andare lucky enough to have multi-processor units. Theuse of this new kernel now means that Supermountcan safely return to the distribution, the dropping ofwhich has been the source of much consternation.

As mentioned earlier, Mandrake Linux is wellpositioned to act in the role of server, somethingoften forgotten or overlooked. To this end, a newversion of Samba has been included, which now usesXFS to allow Windows file sharing with NT like ACLs(Access Control Lists).

Out of the cooker and into the boiling pot

MANDRAKE 8.2Sometime around

the end of April,

shelves will have

been packed with

the latest boxed set

release from

MandrakeSoft,

Mandrake Linux

version 8.2. Will they

still be there or have

they all been

snapped up? Colin

Murphy has the

answer

Cooker – bubbling underMandrakeSoft makes a big effort to enlist the help of the community, be it foractual development or for testing, with the main bulk of this done through itsCooker project. Cooker is a Mandrake Linux in development (if you were to looknow, you will see what will be version 8.3) where new packages get added andaccess and compatibility to those packages gets improved. Because of thisconstant change, things will often be broken, or become unstable at best.

Cooker is being made available for people to report what is wrong with it, soyou should not consider using it for a working system, unless you like to live verydangerously! Cooker can be downloaded from the MandrakeSoft Web site, aswell as from some mirrors. The rolling, automatic update is achieved with toolslike URPMI – the same tool which is also used to update the stable version – youjust point it at the Cooker directories instead.

Occasionally, snapshots are made of a minimally unstable version of Cooker forthose who still want to try out some of the most recent developments, but don’twant to invest time in maintaining it regularly, or have access to do that.

To participate with Cooker you really should subscribe to the busy Cookermailing list, details of which can be found at http://www.linux-mandrake.com/en/cookerdevel.php3.

Page 20: linux magazine uk 20

ON TEST

24 LINUX MAGAZINE Issue 20 • 2002

To help you with server-side applications you willalso have access to Apache 1.3.23, PHP 4.1.2, MySQL3.23.47, PostgreSQL 7.2, Sendmail 8.12.1 and a hostof other servers.

It was really most unfortunate that the freeze datefor the development of Linux Mandrake 8.2 camejust days before the fixed and final release of KDE3,which meant missing out on a big scoop that SuSEhas picked up.

Ease of installationThe accessibility of Mandrake Linux comes in partfrom the effort put in by the developers to make theinstallation as easy as possible, thanks to the DrakXprogram. If you’ve used Mandrake Linux before thenthe graphical installation will still be familiar to you,though there have been some pleasant tweaks.Should this be your first Mandrake install, or evenyour first Linux install, then you’re in for an equallypleasant surprise.

The graphical installer can take on the role of handholding assistant, or, should you need no handholding, just give you something pretty to look atduring the install. The graphical install screens giveyou plenty of information about what is happening

and, more importantly, lots of contextualhelp on what information is requiredfrom you: from something as simple asselecting your security level (Figure 1) tosomething as complex – for a first timeuser – as reformatting your hard drive(Figure 2), or (Figure 3) showing howeasy it is to customise the packages youwant to install. It is worthwhile readingall of the information presented on thesescreens, even if you are comfortable with

Mandrake installs, you will learn more about what isgoing on during the installation.

Right from the start, the installation program willask you to choose between a recommended install,where DrakX will make the bulk of the decisions foryou, or an expert install, where you get the chance totailor and control a lot of the options and pathsduring the installation. You don’t need to be anexpert to use this class of installation, but you willneed to be a lot more interactive, which is not such abad thing in our judgment.

A new minimal installation mode, which installsnothing but the base system, is now available. Thisinstallation mode leaves users with a functional, butvery basic Mandrake Linux installation taking up only65Mb on their hard disk. Since there will be nographical servers, you will be left a command linewhen this minimum installation is first booted,though this does give you the opportunity to thencontinue to install whatever packages you wish –giving you full control over how you want to tailoryour system. One command line tool to help you dothis is URPMI, an automatic software managementsystem, which provides a hassle-free way to installand upgrade applications, via a network if necessary.

Figure 1: Here the on-screen prompts ask youabout what security levelyou want

Figure 2: Disk partitioning can be confusingfor the new user, but the graphical partition

manager makes it less stressful

Figure 3: Groups ofpackages can be selected

and then individuallytailored to suit your needs

Page 21: linux magazine uk 20

ON TEST

25LINUX MAGAZINEIssue 20 • 2002

ConfigurationThe installation process takes in a lot of theconfiguration information so that you very nearlyhave a working system the first time you boot yourmachine, this applies to things like your networkconnections and printer setup, unlike some otherLinux distributions which put you through a postinstall configuration process.

Even so, there is always some configuration todo, things on your system change, maybe becauseyou have added new hardware or want to run newservices. Mandrake Linux makes use of yet moregraphical wizardry, now allowing the lessexperienced users to shape and control theirsystem. The Mandrake Control Center is a centralrepository for these graphical wizards and will befamiliar to Mandrake Linux users of previousversions, but it has been overhauled and improvedfor version 8.2.

The new ‘Mount Points’ section in the ControlCenter now allows you to set up and configure NFSmount points, Samba mount points and partitionsharing as well as the familiar control that you hadover the mount points on your fixed hard drives aswell as removable media like CD-ROMs.

To help you know how and what to configure,it’s good to see that the Mandrake documentationhas been reworked. The documentation is availableto you on your local system, enabling you to readand search with your favourite browser and is alsoincluded in dead tree format for when you havetrouble getting to sleep. Access to such helpmakes a system much easier to access andunderstand.

What you get There are thousands of packages supplied withMandrake Linux, here is a list of some of the ones

most people will find a use for on a day to day basisin the field of multimedia and productivity:

● Mozilla 0.9.8 and Galeon 1.0.3: Web browsers.● XMMS 1.2.6: play and manage MP3 and Ogg

Vorbis files and CDs.● Grip 2.98: rip your favourite CDs.● GIMP 1.2.3, gPhoto2: so you can download and

manipulate all of your digital data.● Gnomemeeting 0.84: share good times with family

and friends with this fully-featured videoconferencing software.

● KOffice 1.1.1: KDE office suite.● StarOffice 6.0: the full-featured and MS Office

compatible office suite, though this is onlyavailable within the Mandrake Linux ProSuite andPowerPack Editions. If you are going for one of thelesser editions you will still have the chance to playwith OpenOffice.

At the heart of the system you will find improvedsupport for FireWire devices as well as USB 2.0, i830DRM, ATA133 and the GeForce 3 graphics chip set.You will also find:

● XFree86 4.2 ● Glibc 2.2.4● Gcc 2.96 and 3.0

Supplier MandrakeSoft

Price To be confirmed

Web www.linux-mandrake.com/en/

For Easy to install and configure

Against Just missed out on KDE3

Mandrake Linux 8.2

ratingFigure 4: Just one of the manyconfiguration wizards available

Figure 5: MandrakeControl Center set toconfigure somemount points

Figure 6: Settingconfiguration data to runservices like an FTPserver is straightforwardwith the help of thegraphical wizard

Page 22: linux magazine uk 20

FEATURE

26 LINUX MAGAZINE Issue 20 • 2001

The new Red Hat

Linux 7.2 Update pack

is released. Jack

Owen takes a look to

see if its worth the

time and money

The update pack arrived on the doormat andafter fighting with the wrapping we weregreeted with a single A5 piece of paper, three

CD-ROMs and a credit card-sized Survival CD-ROM.The paper explains that the two update CDs arebootable and will update your current Red Hatdistribution, while the Utilities/Games CD can bebrowsed and installed if you wish.

Up to date updatesHaving religiously followed the Red Hat

Network Errata warning and updatingpackages when reminded, the

autoboot disc ran smoothlywithout the need for

intervention.Hundreds of packages

are included and the mostnoticeable updates included

KDE 2.2.2 and XFree86 4.1. Inthe background though are the more

important changes such as Openssh andrsync. The latter we had already updatedbut this did not hinder the process.

The second disc of the update pair contained thesource rpm files and a copy of the rescue CD.Hopefully with Red Hat we will never need to findout if this works. The text file for this part of the CDis worth reading, not so you can remember itverbatim but so that when disaster happens youknow what to expect on the CD. We particularly likedthe cut down e3 editor and the graphical installer,Anaconda.

Fun with a capital FThe third CD-ROM is the Utilities/Games CD. This CDis more of a bribe to keep you from straying to othernewer distributions rather than an essential additionto the Red Hat package.

To ease printing CUPs is provided along with thelatest foomatic drivers. If security had still been anissue after updating then the new FireStarter firewallconfigurator will win you over. Gnomemeeting is alsoincluded, which we had been waiting to try out for

some time. The video conferencing software makesuse of your webcam but can work with just voiceinput.

Multimedia is also taken care of with Xine,vcdimager and GIMP plug-ins. Then we come ontogames. Here Red Hat have realised that perhaps weall need a little time to unwind and have included theflight simulator FlightGear plus another twenty gamesto keep us happy. The Wine release included is fromthe very end of January.

Small and neatThe final disc in the box is the credit card-sized SysAdmin CD. I have to say that just the kudos of havingthis meant everyone else in the department wasjealous. It was quite noisy in the drive at first butquickly quietened down. This provides the same dataas was on the second update disc, containing a30Mb Red Hat distribution. With this you have thetools to check and recover filesystems. Themonitoring software lets you check and manage anetwork while the editors and mail utilities willhandle any communications problems quickly. Thepurpose of this CD, apart from making othersenvious, is that by always being able to carry it withyou, you always have tools to hand. Yes, fulldistribution discs and a laptop are the ideal weaponsof choice, but the quick and dirty fixes that this discprovides mean it will soon become invaluable.

ConclusionRather than release yet another distribution andcause everyone to reinstall, this update pack is ideal.Security and peace of mind is taken care of and theupdate of packages is a nice bonus. The utilities andgames add a little fun to make the updated Red Hat7.2 system rival any of the newer distributions. RedHat also gives the impression that it was aimed at thebusy system administrator. By including the utilitiesCD it has shown that it’s not all about work andsome joy can also be had. There again the credit cardCD is worth the pack alone. Well, that’s enough ofwhat is included. We’re off to play Parsec and maybetry out more programs under Wine.

Red Hat updates

WORK REST & PLAY

Supplier Red Hat

Web www.europe.redhat.com

For Great Sys Admin disc

Against If you donwload updates

it’s inessential

Red Hat 7.2 Update Pack

rating

Page 23: linux magazine uk 20

ON TEST

27LINUX MAGAZINEIssue 20 • 2002

When the digit before the decimal point of aversion number changes, this usuallysuggests drastic modifications to the

software. KDE 3.0 however proves that this doesn’thave to mean that users will hardly recognise theirprograms any more. The current version change ismore like a leisurely step in comparison to the leapfrom KDE 1.x to 2.x. The change in optics will onlyimmediately catch the eye of the most observantusers and apart from this nothing particularly incisivehas changed to the technology under the hood. Sowhy the new major version number?

From right to left and back againThe intention is that KDE’s versioning remains insynch with that of the underlying GUI Library. WithKDE 3.0, this essentially concerns the porting of KDE2.2.x to Qt 3.0.x. Now this in itself does not soundparticularly mind-blowing, however it has quiteinteresting consequences: since the support for non-Latin alphabets, as well as bi-directionalrepresentation has improved in Qt 3, KDE alsoprofits from this.

A KDE 2 application like the KDE control centre ona SuSE 7.2 installation (not intended for the Israelimarket) with an imported Hebrew KDEInternationalising Package only outputs question

marks (Figure 1), whereas the language conversionworks perfectly with KDE 3. Not only can Hebrewprogram labels be surveyed (see Figure 2) without theadditional installation of fonts, but also thearrangement of the menus and buttons automaticallyadapt to the right-to-left reading direction giving amirror image of what European eyes are used to.

The KDE control panel (bar) however was notobliging (at least in the latest CVS version before

KDE 3.0

SMALL CAUSE, LARGE EFFECT

KDE 3.0, in its release

candidate state, was

one the stars of the

Linux World Expo in

New York. Patricia

Young takes a closer

look at the pre-

release versions

Major version number This is generally defined as the number before the firstdecimal point of a version specification – in contrast to the “minor versionnumbers”, which follow thereafter. This main version number normally only changeswith large re-organisations and improvements in functionality. If another decimalpoint follows the minor version number, the number following this usually defines a“maintenance release”, which in theory is only concerned with bug fixes. However,not all projects adhere to this unwritten rule.

GUI Library A collection of source code for elements and graphic user surfaces(buttons, windows, menu bars, dialogs etc.), which programmers have prefabricatedand made available as classes. The most common under Linux are GTK+ and Qt.

Bi-directional representation (or “Bidi” for short). There are times within textswritten from right to left (such as Hebrew and Arabic), that terms may arise inlanguages written from left to right (e.g. English or Russian). Thewriting/representation direction must therefore change for a short while. This is avery demanding and sophisticated function of GUI programming.Figure 1: The transfer to Arab or

Hebrew is not as simple with KDE 2.x

Page 24: linux magazine uk 20

ON TEST

28 LINUX MAGAZINE Issue 20 • 2002

going to press), so that the arrows in the mirroredstart menu were pointing in the wrong direction.

The fact that KDE 3 so miraculously gets thecorrect font is due to the reworked QFont class in Qt3. The consequence of this is that the program nolonger stubbornly outputs the same old backupsymbols (which cover all characters) when it can’tfind the correct font. Instead of this, it picks thesuitable glyphs from the available system fonts andeven mixes these together if necessary. Letting theold KDE code use the new QFont API was therebyone of the most difficult functions of the porting.

New features thanks to Qt The revised and completely new additions to Qt 3account for the new featuresin KDE 3. The desktopenvironment thus receives,for example, Xineramasupport without anyextra hassle. As wellas this, the new Qt 3class QTextEdit (whichalready provides a simpleRichtext editor) shortens

the code of several KDE programs. By the way, it ispretty self-evident that the KDE editor Kate is notbased on QTextEdit. The new Qt classes that facilitatethe access to SQL databases don’t leave any trackson the KDE 3 core packages. This is more of anadvantage for the KDE programs of other users.

With its new releasable/movable windows, KDE 3has added a feature, which Qt has had since itsversion 2.2. If a program window consists of severalfragments, then those that have a small bar (as inFigure 3) can be dragged onto the desktop. Theseindependent windows can even be shifted toseparate virtual desktops. In particular where severalmonitors are used, with each one displaying anothervirtual desktop, you can improve the clarity of controlof programs that need as much space as possible forthe main window.

Those of you who take the separation of windowstoo far should take a deep breath – the re-integrationof window segments back into the main windowrequires a steady hand. Shifting the windowfragments with the left mouse button, the tip of thecursor must be exactly aligned with an edge of themain window or one of the sub-windows integratedtherein.

New applicationsThe many small and larger bug fixes and detailimprovements, which essentially constitute KDE 3,

Class Contains “object-oriented programming” code, with which objects (forexample a button, a font or a whole application) can be produced. In order thatthese very general objects can be individually created (so that they behavedifferently), they contain class implementation functions, with which thecharacteristics (properties) of an object (for example its colour) can be modified.Objects can also “do things” (an application can close itself, a button can executean action), which can also be implemented by the functions (methods) of this class.

Glyph A character from a font.

API Application Programmer’s Interface. The answer to the question: “How can aclass be used without having to know about the implementation details?” –expressed in a programming language. With C or C++, the API is concealed in aclass, normally in the header files with the ending “.h”. An API is actually onlycomplete with the appropriate API documentation, which describes what the classand its functions do as well as which function arguments have which meaning etc?

Figure 2: WithKDE 3 howeverit’s a matter of

course

Figure 3: Overloaded main windows can be broken up

Figure 4: Edutainment in KDE: Kgeo, Kvoctrain and Ktouch

Page 25: linux magazine uk 20

ON TEST

29LINUX MAGAZINEIssue 20 • 2002

do not however hide the fact that the number ofapplications has not (naturally enough) remainedconstant. The new core package Kdeedu containsnine learning-software programs – one for everydifferent level. The sensible and very applicablevowel trainer Kvoctrain is extremely useful forusers of all levels – pupils and teachers alike – asare the geometry drawing program Kgeo (Figure 4)and the home planetarium Kstars. Pre-schoolchildren can learn the letters of the Frenchalphabet with the Klettres–bear (Figure 5), andthen practice touch-typing with Ktouch. Usingthese programs is not always child’s play – themode of operation of some applications is not selfevident without studying the documentation(which is not always available).

Easier operation At the top of the list of applications that haveundergone the most improvement are (next to themandatory Konqueror) two very differentapplications: Konsole and Kmail.

The first now also responds to the followingcommand line options: –tn terminal Typ, –– noframe,–– noscrollbar and nomenubar. While changing theterminal type (for example on vt100), it is possible todo without the shadow around the command linefield on a Konsole with a missing frame in order tokeep things as simple as possible. This is particularlyinteresting for people who operate remotely,potentially from machines with other operatingsystems. This can be switched on again (the same fora missing scroll bar) through the Settings menu item.There is even a quick variation that doesn’t need themenu bar: the key combination of Ctrl+Alt+M will dothe trick. On the strange side for a program of such amodest range of functions is Konsole’s new “Tip ofthe day” feature.

KMail for its part can now read mailboxes in theMaildir format (one email per file, whereby a higherranking directory represents the mail folder). Inparticular, this will make fans of the Qmail mail serverhappy. On the other hand, the IMAP problem child

remains just that: we unfortunately could not test theannounced improvements in the pre-version as theprogram constantly crashed when trying to establisha connection with the IMAP server.

Good things come in smallpackagesThe planning list for KDE 3 was long and noteverything on that list was implemented. There wasoriginally the idea of an icon server, which was tocache icons during a KDE session, i.e. make iconsavailable that had already been used in anapplication. The target of this was to accelerate theloading time at the start of an application. Howeverin the course of the discussions, it turned out thatthe problem could be solved without the use of anadditional help program. If icons are only loadedwhen they are really needed by the application(instead of all at the beginning), this not only speedsup the starting time, but also saves yet anotherserver.

Whether all the new innovations andimprovements are interesting enough to warrant atransfer to KDE 3.0 is for each individual user todecide. Several KDE and Qt versions can alsopeacefully co-exist next to each other if disk space innot a limiting factor. The decision not to put its usersthrough any major changes (apart from transferringto a new library version) is testimony to the fact thatthe KDE team has become more mature andresponsible.

Supplier KDE.org

Web http://www.kde.org

For Grows community spirit

Against The benefits aren’t obvious

KDE 3.0

rating

Xinerama: Representation of a virtual desktop on several monitors, wherebywindows can be dragged from one to the other. Individual windows can also besituated “on the edge”, i.e. partly on one screen and partly on another (or severalothers).

SQL database: A collection of data that is stored in the form of tables and can beaccessed with the assistance of a Structured Query Language. Examples of DatabaseManagement Systems(DBMS) on the SQL basis are mySQL, PostgreSQL and Oracle.

IMAP: Internet Message Access Protocol. This is one possible way of accessingemails stored on another computer with an appropriate utility program. From theuser’s point of view, it looks as if the mail boxes have been processed locally.

InfoAnnouncements on the new KDE releases:

http://www.kde.org/announcements/Planned features for KDE 3.0: http://developer. kde.

org/development-versions/kde-3.0-features.htmlCo-existence assistance for KDE 2 and 3:http://www.

pupeno.com.ar/runningkdes/http://www.rons.net.cn/english/FSM/2kde3http://www.kde.org/kde2-and-kde3.html

Figure 5: Pre school with Klettres

Page 26: linux magazine uk 20

ON TEST

30 LINUX MAGAZINE Issue 20 • 2002

Even standard PCs, sold en masse throughsupermarkets and computer discount chains, areamply equipped today: Pentium 4s or AMD

Athlons with 1.5GHz processors are common. Themanufacturers are also generous when it comes tothe working memory, with 256Mb RAM being prettymuch a standard in today’s climate. Such a systemcan, operated under Linux, easily allow for a secondoperating system using an emulator, such asVMware.

It comes at a priceVMware Workstation is anything but cheap. Thosewho use Linux mainly because most applications andupdates can be acquired either cheaply or for freewill not be too happy about the price tag of theversion 3.0. It comes at £225 for the boxed versionand £205 when downloaded from the Web server asa VMware archive (prices fromhttp://www.greymatter.com orhttp://www.qbssoftware.com). If you qualify underthe educational heading then http://www.pugh.co.ukhas it for £139 for the boxed CD or £119 for the key.

If you wish to purchase the product directly fromUSA, the prices are $329 (plus delivery) for the boxed

set and $299 for the download option. The goodnews for those of you who have the version 2.0 isthat the update only costs £150/£120(boxed/download version).

No-hassle installationWe tested the installation of VMware Workstation3.0 under SuSE Linux 7.3 on a Pentium 4 1.4GHzwith 256Mb RAM. The rpm package was installedwith a simple rpm –i .... As in the older VMwareversions, the setup script command vmware-config.plcomes next. This installs the kernel modules necessaryfor operation and sets up the DHCP and Sambaservers. These servers allow the guest operatingsystem an automatic network configuration and (sothat it is a Windows configuration) access to theuser’s Linux home directory.

The first use of the vmware command, that cannow be carried out with normal user rights (nolonger only with the administrator root rights), causesVMware to ask for the licence key.

Using the licence key, as well as the details of username and company, VMware generates a licence file,located under ~/.vmware/license.ws.3.0. Old VMware2.0 licence keys can no longer be used. By the way,in contrast to older versions, only one key can beused. This key runs out at the end of thirty days andcan only be substituted by a full-blooded (and fullypaid for) licence.

The VMware Configuration Wizard can be startedas soon as the key has been activated. This initiatesthe set up of a new guest operating system. VMwareWorkstation 3.0 supports MS-DOS, Windows (3.11,95, 98, Me, NT, 2000 Pro, 2000 Server, 2000Advanced Server, XP Home, XP Professional), Linuxand FreeBSD (Figure 1).

Windows XP as a guestWe were primarily interested in testing the XPinstallation, as it is well known that VMware workswell with older Windows versions. We thereforeselected XP Professional and took on all the standardsettings for the virtual drive and the networkinstallation. Confirming the specifications will causethe Wizard configuration to close. Clicking Power Onin the VMware window will then activate the virtualPC, which, after the normal BIOS set-up run and self

Run virtual machines under Linux

VMWARE 3.0VMware is the

oldest commercial

PC emulator for

Linux. It has just

been brought out in

its newest version

3.0, which supports

Windows XP. Hans-

Georg Esser puts it

through its paces

Figure 1: VMware Workstation 3.0 supports more guest operating systems than ever

Page 27: linux magazine uk 20

ON TEST

31LINUX MAGAZINEIssue 20 • 2002

test, is booted from the Windows CD (Figure 2)After the completely installed XP is started for the

first time, there is not a lot to see, as the monitor is setto four bit colour depth –. Don’t panic – the VMwareTools, integrated into VMware, can easily remedy this.Simply select the menu point Settings/VMware ToolsInstall (Figure 3) in VMware. After confirmation byclicking Install in a dialog window, a new virtual driveis integrated and XP automatically starts the setupprogram (that is saved on it).

XP seems to have some reservations about thisgraphic card drive and acknowledges this with awarning. Simply ignore this by clicking ContinueInstallation and the installation will continue withoutany further hitches. The new drive is activatedimmediately (no restart necessary!), so that movingthe mouse outside the VMware window is not aproblem and, thanks to an increase in the colourdepth, the desktop display is back to what we wouldhave expected.

In contrast to the earlier versions, this is reallyneatly done. The only thing you will want to changebefore starting work is the screen resolution (forexample to 1024x768). This can be achieved throughthe properties dialog (context menu on the emptydesktop). See Figure 4.

NetworkOut of the box, VMware supplies a DHCP server onthe vmnet1 virtual network interface. As theVMware network card is installed, XP is therebysupplied with an IP address and can access the hostcomputer. VMware uses its own sub-network forthis, which is separate from the normal network(which is created later). If you don’t want this,because for example you want to be able to accessan Internet gateway in the local network, you canalso assign the guest system an address in the localnetwork. The change in configuration takes placequickly under Windows XP:

● Open the system controls through Start/SystemControls.

● Double click Network Connections.● Click the LAN Connection icon.● In the new window “Status of LAN Connection”,

activate the Properties button.● A second window appears. Choose the “Internet

Protocol (TCP/IP)” point on the list and clickConfigure.

● In the third (and last) window, “Properties”,activate the IP address, sub-network, gateway andDNS server manual input, and enter the necessarydata for the local network. The inputted IP addressmust naturally be up and running.

● Close all the windows (in the opposite order) byclicking OK or Close.

A reboot is not necessary here. XP allows (as did itspredecessor Windows 2000) changes to the networkconfiguration without the necessity of a restart. If

Figure 2: Looks like a PC, acts like a PC:starting the virtual computer

Figure 3: The “Insertion” of the VMwareTools disk is done through the menu

Figure 4: When theVMware Tools are

installed, the resolutioncan also be set

Page 28: linux magazine uk 20

ON TEST

32 LINUX MAGAZINE Issue 20 • 2002

everything has worked, you can check the networkroute in a console window: Start/AllPrograms/Accessories/Entry Request (Figure 6). Youcan then test the connection with the preinstalledInternet Explorer (Figure 7).

At long last, ISO imagesTo have more than one CD constantly available hasalways be a simple matter under Linux. All you needis to create a one to one copy (an Image) of a CDusing:

dd if=/dev/cdrom of=/tmp/cd-image.iso

This can then be mounted at any time with:

mount –o loop /tmp/cd-image.iso /mnt/cdrom

VMware Workstation 3.0 allows this for its guestsystems with a similar amount of ease. The “CD-ROMImage” device type can be selected in theconfiguration editor under SCSI or IDE Devices. After

entering the image filename and clicking install,the CD image will beavailable the next timethe virtual Windows isstarted under its owndrive ID (letter). Figure 9shows the image as anextra “E: Drive”,although the normal DVDdrive can of coursecontinue to be used.Thanks to SCSIemulation, a wholeselection of images can

thus be permanently incorporated. From Windows’ point of view, the ISO images are

genuine CDs in physical CD drives. – Software whichchecks whether it was really started from a physicalCD and not from disk or from the net can thereforebe persuaded to work in this way.

Raw disks – IDE and SCSIIs there yet another “native” Windows installation onyour system in a FAT or a NTFS partition? If so, thenyou will be pleased about the possibility of simplyintegrating the real disk like a virtual one. To do this,go into the configuration editor and simply assign afree IDE or SCSI device with the appropriate devicefile (e.g. /dev/hda for the first IDE drive) and the type“Raw Disk”. In principle, you can even do withoutthe creation of a virtual drive and operate only withthe real thing; a parallel boot up of the sameWindows installation on the genuine and virtualcomputer will however probably fail due to largedifferences in hardware. The direct drive-access is

Figure 5: In order to beable to access the serversor gateways in the localnetwork, simply modifyXP’s network settings.

Figure 6: You canalso check that thesettings are correctby entering “route

print” in thecommand line.

Figure 7: If the connection is OK, XP’s Internet Explorercan also call up the Linux Magazine homepage

Page 29: linux magazine uk 20

ON TEST

33LINUX MAGAZINEIssue 20 • 2002

nevertheless advantageous, as this gives you thepossibility of accessing the NTFS partitions of yourcomputer from the guest system: NTFS filesystemscan only be “read only” mounted under Linux, andeven this often causes difficulties. In the test, theaccess to the real drive and two partitions created byWindows 2000 (NTFS and FAT) was possible withouta problem.

By the way, read and write rights are necessary forthe direct drive-access to the appropriate device files.In the case of SuSE Linux 7.3, this could be achievedusing one of two methods:

● Admission of the user into the “disk” group. Allmembers of the group disk can access the drivebecause the /dev/hda file belongs to the root userand the disk group and has the “rw–rw–––– “rights. Open the /etc/group file as root and modifythe line “disk: x: 6: “ to “disk: x: 6: username “,whereby username must be adapted accordingly.

● The second possibility is simpler but is onlyrecommended on a single-user computer, as thisgives every user full read and write rights to thedisk: chmod a+rw /dev/hda.

What else is new?The outstanding new feature of VMware workstation3.0 is clearly the support of XP. We have alreadydiscussed some other features, and as well as thesethe new version also has:

● USB support, through which, for example, USBcameras that are not supported by Linux may beused,

● DVD support,● NAT (network address translation): with this

network alternative, the virtual machine shares theIP address with the Linux host. This on the onehand simplifies the set-up, but on the other handleads to problems if both computers (host andguest) want to offer their services on the same port.

For this reason, the VMwaremanufacturer offers so-called “GuestOS Kits”. These allow a guestoperating system to be createdfaster, as the complete installationprocedure has already beenexecuted by VMware. In the case ofWindows 2000 Professional (theonly presently available version), thewhole installation is taken care ofmerely by the entry of the serialnumber.

PerformanceWe installed VMware on a Pentium4 1.4GHz. The program was

executed both locally, as well as remotely from anavailable computer within the network. XP ran in theemulated computer at a sufficient rate in both cases;only in the remote access did the slowed screenconstruction lead to us waiting. Under normalapplication however, such as the start on the hostcomputer, all features of the program workedsmoothly.

The improvements of VMware workstation 3.0over the predecessor make an update into aninteresting proposition. – Hard to understand is thesharp increase in price. This makes VMware, as wellas the need for an additional Windows license, intoan investment of sizable magnitude. With the newprices, VMware has signalled its departure from theprivate user market. Perhaps a 3.0 version of VMwareExpress will also appear on the market in the not-too-distant future. VMware Express 2.0, which wasavailable until recently, permitted the installation ofWindows only as a guest system and was markedlycheaper.

Figure 8: VMware now supports the integration of ISO images

Figure 9: Under XP, theimage is displayed as the

“E: Drive”, the DVD drive isdenoted as D:

Supplier Vmware Inc.

Price £225/205

Web http://www.vmware.com

For Stable, performs well

Against Now very expensive

VMware 3.0

rating

Page 30: linux magazine uk 20

ON TEST

34 LINUX MAGAZINE Issue 20 • 2002

The complete email solution?

CALDERA VOLUTIONMESSAGING SERVER 1.0R

Figure 1: Installation is done automatically

There are now more

and more commercial

products joining the

already gigantic

range of Open

Source MTAs,

promising an

integrated solution

together with a Web

interface. Nico

Lumma investigates

just one example,

Caldera’s Volution

Messaging Server

An MTA (Mail Transfer Agent) alone rarelycomprises the complete mail infrastructure incompanies these days. There is usually an

IMAP server as well, and since the invention of theWeb as the all-beatifying Internet service, electronicmail should as far as possible also be accessible viathe Web. The idea is that people who don’t want todevote a great deal of time to assembling separatesoftware components will, conversely, rather spendsome money to get a total solution.

Caldera’s product for this target group is called theVolution Messaging Server 1.0. As well as theproduct CD, the manufacturer and Linux distributoralso supplies a somewhat slender manual, in whichinstallation and configuration are explained. Calderaconfidently insists that you use its own operatingsystem for the mail solution: Open Linux Server 3.1 orOpen Unix 8 must be installed on the prospectivemailserver. The Linux distribution is nevertheless alsoavailable as an out of the box product by download.

Caldera Open Linux Server 3.1 was installed inshort order on the test server, which occurred veryrapidly and efficiently thanks to the multi-taskinginstallation tool Lizard, which functions beautifully.When the Messaging Server product CD is theninserted in the drive, with the KDE desktop open, it isautomatically recognised and KDE merely enquires asto whether autorun.sh should be startedautomatically. If this is agreed to, the installation ofthe necessary packages proceeds extremely briskly(Figure 1) and, at the same time, completely freefrom any configuration queries. Lastly, rpms areinstalled with the graphic progress indicator keepingthe user informed about the activities of the installer.

Getting startedSince 4 January it has been possible to download theMaintenance Pack 1.0.1 from the Caldera FTP site.The user only has to unpack a tar archive and executeinstall.sh – the rpms are then automatically refreshed.The Maintenance Pack fixes security problems in MTAPostfix, the Cyrus IMAP Server and the Web-mailsolution IMP.

It takes relatively little time to get Open LinuxServer 3.1 and the Messaging Server – includingupdates – up and running. This is also speeded up bythe fact that the installation completely skips therestarts, which are usual with other distributions. TheMessaging Server is then configured via a Webinterface, which can be found athttps://Hostname/msg. The Apache Web server isautomatically started on the Messaging Server andcan make SSL-encrypted connections in its basicconfiguration.

The admin area is reached in the usual way withthe username-password combination admin/admin,which is why the first thing the system administratorshould do is change the password of this user. TheWeb interface itself is very clear and divided into fourmain points: Domains, Users, Aliases and System(Figure 2).

In the test environment there is only the domain,localhost, which is why it is a good idea to create atleast one proper domain first of all (Figure 3), towhich one can then add one or more users, who canalso be given aliases. Domains, users and aliaseswhich have been created can, of course, be changedor deleted. The LDAP server stores all the data. Forboth users and aliases, there is a search mask, withthe aid of which one can find the correspondingentries quickly and easily.

The menu item System offers the Admin theoption of changing his password or getting anoverview of the current processes in the MessagingServer. He can also grant users some accessoptions. These include changing the respectivepassword, adapting a user profile or making one’sown aliases. If a more detailed Postfix configurationis desired, though, the system administrator mustrely on an editor and modify the correspondingconfiguration files.

The Web-based configuration menu is also availableto the individual user, although in this case it is only

Page 31: linux magazine uk 20

ON TEST

35LINUX MAGAZINEIssue 20 • 2002

possible to change a few personal settings or to installa vacation memo or a mail-forward. Options, such asmail-filters or more complex vacation configurationwill, however, be sought in vain.

Outlook as the measure of all things?The item Client-Setup offers one very interestingfeature, which allows Outlook/Outlook Express (98,2000, XP) to be configured automatically. A click onConfigure creates a Visual Basic script file with thepersonal configuration data of the user, which is thenimmediately executed and makes the correspondingsettings in Outlook and sets up an account. At thispoint, there was an error message in the test, butnevertheless the corresponding data was saved forposterity in an Outlook account.

This is how users of this Windows mail clientobtain a completely configured email account andfully installed access to the LDAP server at no greatexpense. For other mail programs, the menu itemClient-Setup allows all important data to be seen at aglance, in order then to enter it into theconfiguration of the Mail User Agent.

Caldera explicitly points out that the MessagingServer is compatible with Outlook. This is certainlytrue, since Outlook speaks POP3, IMAP and SMTPlike any other good mail client. But this statementsuggests a range of functions similar to Microsoft’sExchange Server – and that’s promising far toomuch. The Windows mail client can certainly call on

the LDAP server of Messaging Server and via thefree/busy function you can make your scheduleavailable, but this extends only as far as showingothers in the LAN when you are busy or have sometime. The complete integration of the calendarfeature with the server does not, however, exist.This would, for example, enable users to let otherpeople enter and/or delete an appointment or toblock times.

The Web-mail client IMP (version 2.2.7) whichcomes as part of the package functions solidly,though it is unfortunately not integrated in theMessaging Server, but to be found athttps://Hostname/horde/imp. IMP (Figure 4) offers allfeatures one would expect of a Web-mail client: Itcan cope with several folders and subscribe to variousIMAP folders, allows searches of the LDAP databankand can send attachments.

However, it offers no option for filtering emails. Itwould also make sense to be able to apply Procmailor SIEVE rules actually on the server – here, too,Messaging Server has to pass.

Conclusion Even though Volution Messaging Server’s range offunctions is fairly slender, it does look attractive forthose who don’t want to configure thisfunctionality themselves. The installation, duringwhich only the required packages are installed,works without a hitch and getting started isequally smooth.

However, a Web browser admin will run agroundearly on, doing everyday tasks such as entering arelay mailserver – without a text editor and Postfixknow-how, nothing will work. Nor do the manual oronline help provide any assistance. One tasty morselis the automatic configuration script for Windowsusers, but this should be expanded as a matter ofurgency for Linux users, too.

Lastly, the high price for not very much in theway of functionality will play a part in theimplementation decision, especially in view of thelicensing policy, which, under the cheapest licence,allows it to be used by only 25 clients.

Figure 2: The Admin area after logging in

Figure 3: The options for making a domai.

Supplier Caldera

Price $899 (plus $249 for Open Linux

Server 3.1.1)

Web http://www.caldera.com

For Easy to install and get started

Against Expensive, limited function

range

Volution Messaging Server

rating

Figure 4: The inbox under the IMP Web-mail client

Page 32: linux magazine uk 20

ON TEST

36 LINUX MAGAZINE Issue 20 • 2002

Acronis’ OS Selector is a very powerful product,which uses a simple GUI that combines a verypowerful disk editor, partition manager and

boot manager all in one. It understands Linuxfilesystems, including EXT3 andReiserFS; it can copy, move andresize partitions; and though it maynot be as user-friendly ascompeting products likePowerQuest’s Partition Magic, withwhich, unfortunately, it also sharesthe same licensing restrictions (useby one person on one machineonly), it does have a few extrafeatures. It’s questionable, though,whether these are enough to makethe product a worthwhile purchase.

What’s in the box?The software comes boxed, withlots of impressive sounding productinfo on it. Inside the box were a CD,manual and a registration card containing theProduct-ID used when configuring the software andregistering with Acronis.

The CD runs from Windows, can create install

floppies and, best of all, is bootable and will take youstraight through to install the software, or allow youto repair some conditions. The CD contains AdobeAcrobat 5, OS Selector itself (version 5.00 build 472

for this review) and a PDF version of theprinted manual.Ok what should things look like?The DOS-like OS Selector screendisplays on boot-up and offersthe choice of booting via mouseor cursor keys to Windows XP orLinux. In the case of the Linuxoption it actually boots to LILO,where we choose the specificconfiguration of Linux we want. Itis important to note, that youmust still maintain an appropriateLILO or GRUB configuration, ifyou want to boot Linux, and thatthis may need to be recreated

after any partitioning changes. Thisimplies that you must ensure you maintain a Linuxboot floppy.

Test machinesLaptop 1: Pentium II MMX 200MHz, Hi-GradeNotino AS6000, 80Mb RAM, 6Gb IDE hard disk,floppy drive.

When we tried to boot the CD on this Laptop, OSSelector immediately fell over with a programexception error. When a Partition Magic rescue floppywas used, it identified a disk error, fixed it andsuccessfully came up. OS Selector still failed to run.We deleted all the existing partitions and tried again,still without success. We finally tried swapping thehard disk, all to no avail. Not an auspicious start.

Laptop 2: Pentium III 750 MHz with SpeedStep, Hi-Grade UltiNote AS8400, 192Mb RAM, 20Gb IDEhard-disk, floppy drive, DVD drive.

This time at least the OS Selector boot ran, andoffered to install itself, however it needed a FAT32 orFAT16 partition to install in and had problems findingone until we ran the Disk Administrator option andcreated and formatted a partition for it – all of whichis supposed to be automated.

The system configuration that we were trying toachieve was as follows:

Steve Cobrin takes a

look at the latest

version of the

partition and boot

manager which

includes support for

Windows, XP NTFS,

SuSE Linux 7.3

ReiserFS, and Red Hat

Linux 7.2 Ext3

filesystems

OS Selector Boot Menu

Acronis OS Selector 5.0 Deluxe

OS SELECTOR

Page 33: linux magazine uk 20

ON TEST

37LINUX MAGAZINEIssue 20 • 2002

14Mb Primary hidden FAT16 OS Selectorpartition

4Gb Primary NTFS – Windows 2000 Standardserver

4Gb Primary NTFS – Windows .NET serverbeta3

Extended Partition containing:6Gb FAT32 Windows data partition3.35Gb SuSE Linux 7.2 – root partition805Mb Linux – /home partition399Mb Linux – swap partition

It should be noted that Partition Magic does NOTsupport the management of partitions containingWindows Server OSes, for that you need thesignificantly more expensive VolumeManager version.

At various times OS Selector offered to selectsupport for ASPLinux, a distribution we’d not heardof before – we chose not to.

After setting up our partitions, it was interesting tonote that Partition Magic thought that there was anerror with our setup, as OS Selector created apartition that was on a cylinder boundary. It isunfortunate that partition managers can disagree asto what should be reported as an error. Also at onepoint it appeared as though our Linux Swap partitionbegan before the start of our extended partition. It’snot clear whether OS Selector caused this – itcertainly couldn’t fix it and in the end we had to fix itby recreating the partitions from fdisk running from aLinux Rescue disk.

We really wanted each Windows OS to think itwas the C: drive, and the FAT32 partition the D:drive. This is the sort of sneakiness we’ve previouslymanaged by using PowerQuest’s Partition Magic and Windows 95 and 98SE. However, we justcouldn’t work out how to do this with Windows 2Kand OS Selector.

Once OS Selector is installed and configured, itsnot always clear what partitions are being booted,and we never got the partition hiding featuresworking properly. After selecting “Use WindowsNT/2000/XP partitions hiding” against the .NETpartition, things went badly and it wasn’t possibleto boot anything but Linux. This would have beeneasily remedied if OS Selector had an option toallow booting from CD, whilst hiding selectedpartitions. I’ve only seen this available once onQuarterDeck’s Partition-It software, which seems tobe no longer available.

Well, eventually I decided to give in and reinstall,and let Win .NET and Win 2000 have their ownunique drive letters. After that it all went quite well– the partitioning software is quite intuitive,although the GUI is much less elegant than that ofPartition Magic.

Laptop 3: Pentium III 1.2GHz with SpeedStep, Dell

Latitude C610, 512MB RAM, 30GB IDE hard-disk,floppy drive, DVD/CDRW combo drive.

Having installed Windows XP and SuSE Linux 7.3on the third laptop, all seemed well enough.Although Partition Magic complained of apartitioning error on the disk, OS Selector didn’tseem to care. It’s difficult to know whether to beworried or not about this, which in itself is quiteworrying!

Desktop PC: Dual Pentium III 400MHz, ASUS P2BSMotherboard with on-board SCSI Ultra 2, 256MbRAM, 1x9Gb SCSI hard disk, one 1x18Gb SCSI hard disk.

This is a machine on which we’d already hadseveral versions of Windows and Linux installed, sothere was a lot of legacy partitioning for OS Selectorto configure; it really wasn’t very happy.

The menu we got it to provide was:

● 1.Windows XP Professional Edition ● 2.Windows 2000 Professional Edition ● 3.Linux

The interesting thing, with the NT-family of Windowsis that they have their own boot loader, which will beautomatically configured when Windows installs, soselecting either Windows options actually takes youto the same menu as defined by the BOOT.INI on thefirst Windows partition.

Unfortunately for us, the Windows XP optionrefused to load, giving the message “NTLDR ismissing”. We didn’t get any complaints or assistancefrom OS Selector throughout this process and thedocumentation is a bit light on troubleshooting.

ConclusionIn general, OS Selector can only be recommended ifyou need the extra Linux filesystem and WindowsServer support, and want to learn lots about theintricacies of partition and boot management.Otherwise we’d recommend Partition Magic and, ifyou’re feeling more frugal with your money or wantget close to the bare metal, look to use existing Linuxtools and freeware Windows tools.

Supplier Acronis

Price £35 to £49

Web www.acronis.com/products/oss50

For Some unique features

Against Non-Free software, bit glitchy

OS Selector 5.0 Deluxe

rating

A unique feature ofOS Selector is thesupport for LinuxExt3 and Reiser FSfilesystems

Page 34: linux magazine uk 20

COMMUNITY

38 LINUX MAGAZINE Issue 20 • 2002

Richard Stallman is one of thepersonalities that every user of Free

Software should know about, for withouthim there might not even be such a thingas Free Software. It was the GNU project,which he started some 20 years ago, thatmade it possible for Free kernels likeLinux to become the Free operatingsystem that we know and love, or at leastread about.

The 240 pages in this book go a longway to uncovering details about the man,giving answers to the question “whatmakes the man tick”, as well as giving an

FREE AS IN FREEDOM:RICHARD STALLMAN & THE FREE SOFTWARE FOUNDATION

Author Sam WiliamsPublisher O’ReillyPrice £15.95ISBN 0-596-00287-4

This is one book that really is a joy toread. It’s amusingly written and well

illustrated with cartoons, some of whichare just begging to be copied and pinnedto the fridge to be read over a morningcoffee. What better way to start the daythan with the warm fuzzy feeling that youare among the righteous and chosen onesin your belief of Linux?

Despite its obvious American bias (thechapter on the pros and cons of majordistributions did not even touch on SuSE)the book gives a very fair overview of thecurrent situation of Linux. An obligatorychapter covers the history anddevelopment of the operating systemfollowed by more interesting anecdotes onusing Linux for the first time, and how tocope. Other chapters cover the internalarguments in the Linux community,security, games, hardware, how to dualboot a machine and women in computing(yes really, this book is very PC in a non-

computing sense). A very comprehensive list of resource

sites and books would be useful to anyoneresearching Linux or needing help instarting to use it and the final appendixcontains the full GNU Public Licenceshould you have a burning desire to read itat any time. The authors do have certainprejudices but they are upfront aboutthem, (If you are a vi user you should skipparts of chapter four) and they areprepared to admit that people hold otherviews. If you want some enjoyable bedtimereading to make you feel good aboutusing Linux then this is the book for you.

THE JOY OF LINUX

Author M Hall & B ProffittPublisher Prima TechPrice £21.99ISBN 0-7615-3151-3

insight into the ethics of the ‘hackingculture’ of the 1970s from which the GNUproject grew.

There is a nine page index allowing youto revisit the passages you’ve found mostinteresting and, even more usefully, the 13chapters in this book have footnotesdetailing reference material used by theauthor, enabling the committed Stallmanresearcher to follow up if they wish. Thebook also explains, and is published under,the GNU Free Documentation Licence,which is only fitting for a book aboutfreedom.

Page 35: linux magazine uk 20

KNOW HOW

39LINUX MAGAZINEIssue 20 • 2002

The Linux daemon on steroids

XINETD

Listing 1: Listing of/etc/xinetd.d/telnetservice telnet{flags= REUSEsocket_type= streamwait= nouser= rootserver= /usr/sbin/in.telnetdlog_on_failure= USERIDdisable= yes

}

If you are already familiar with inetd from UNIXor the earlier versions of Linux, just think ofxinetd as inetd on steroids; it can do what inetd

does plus a whole lot more.

xinetd in a nutshellxinetd is the main TCP/IP server and it controls themajority of network connections to your host,allows connections to be logged, provides generalaccess controls and time-based access control. Italso allows specific services to be bound to aspecified interface to allow balance of networktraffic to the host. It can also be used to forwardservices to another host as a sort of DIY fail-overservice. xinetd’s job though, is mainly to determinewhat daemon should start for each incomingconnection, like Telnet, FTP or rsh. We won’t lookat all these features just yet.

xinetd is shipped with most Linux distributions.Depending on your set-up you could just have onefile, /etc/xinetd.conf, but this configuration can bea bit of a headache to administer. Most vendorsnow split the configuration up into many files, onefile for each service and one main defaultconfiguration file, as shown in Figure 1.

Be advised, if any changes are made to thexinetd configuration files the xinetd daemon mustbe restarted by either:

$ /sbin/service xinetd restart

Or alternately:

$ /etc/rc.d/init.d/xinetd restart

Or alternately:

$ /usr/bin/killall –TERM xinetd

The configuration basicsThe main default file, /etc/xinetd.conf, lets you setthe defaults for logging successful and failedconnections. In Figure 1, the instances is set to 60,this is the number of requests that a service canhandle at a time. If the Linux machine is part of abig network, pump it up to 90. The log_type ishow and where the logging will occur, as this is setto SYSLOG authpriv, then syslog will handle thelogging, which is the default. Being logged as anauthpriv means the content maybe privilegedinformation, like usernames or IP addresses, but notthe passwords. Depending on your Linux flavourthese messages will either be logged into/var/log/messages or more probably to/var/log/secure.

Lets now look at a typical service configurationfile – as Telnet is a commonly used service thismakes it a good choice.

The flags option of REUSE, lets the TCP/IP socket(that’s the protocol Telnet uses) to be well,reusable, in simple terms all this means is that theservice can be restarted on the fly. The socket_typeSTREAM is the type of TCP/IP used, stream is usedfor both Telnet and FTP connections. When aconnection for Telnet is requested xinetd will either

In a previous article

we looked at TCP

Wrappers and how

you can protect

incoming TCP-based

connections, like

FTP and Telnet. In

this month’s article

David Tansley looks

a bit more closely

at securing your

server with xinetd,

or the Extended

Internet Service

Daemon to call it

its proper name

Figure 1: Listing of xinetd.conf and /etc/xinet.d directory

Page 36: linux magazine uk 20

KNOW HOW

40 LINUX MAGAZINE Issue 20 • 2002

operate a multithreaded (unlike MS Windows) orsingle service. The wait option says NO, so for everynew connection a new instance of in.telnetddaemon will be created. If wait had been set toYES, then the incoming Telnet connection wouldwait until the in.telnetd daemon had finishedserving the previous request, before it would servicethe next request. The user is ROOT, this means theservice will run as root User ID. The actual serverwill be the Telnet daemon /USR/SBIN/IN/TELNETD. Itwould be good to log all failures to syslog, solog_on_failure will log the User ID as well as the IPAddress of the failed connection. When xinetd isinitially shipped it comes pretty much secure, withTelnet disabled, so if your machine is on a networkand you cannot connect to your host simply changethe disable entry from YES to NO.

Controlling servicesTo disable a service there is no need to go aroundevery services file located in /etc/xinetd.d and thenedit the particular services file you wish to disable,this can be done globally through the defaults file/etc/xinetd.conf. Here’s how: simply put the serviceyou want disabled on a new line that contains thefollowing:

disabled = <service to disable> <service todisable> <?.>

So, to disable say Telnet and FTP you would create aentry like the following:

disable = telnet ftp

Notice that a space separates the services.Figure 2,shows the defaults file with FTP and Telnet disabled.As mentioned before, for the effect to take placeyou’ll need to restart xinetd.

IP-based control accessYou may want to allow connections to a service fromthe local network, but disallow it from any othernetwork. This is accomplished using the keywordsONLY_FROM by just specifying the IP/Networkaddress. If we want only Telnet to be accessible fromthe network address of 192.168.10.0. Edit the Telnetfile in /etc/xinetd.d directory and insert the following:

only_from = 192.168.10.0/24

The zero at the end of the IP address (192.168.10.0)is a wildcard. The /24 is the netmask.

Normal fully qualified hostnames can also be used,(such as bumper.somedomain.com) as long as theyare resolvable. Let’s now turn our attention to the FTPservice. Imagine we have a local company whodownload extracts from their database and then FTPsit to our system, so that we can import it into ourdatabases. The other company’s host IP address is192.168.8.23; as our company is very securityconscious, we only want this specific IP address touse the FTP service. You are not bound to usenetwork addresses in specifying the entry inONLY_FROM, though it is much easier to. You canjust use the actual IP as in the following:

only_from = 192.168.8.23

The following is an extract from the error log/var/log/secure, informing us that a host with an IPaddress of 192.168.1.12 tried to FTP to our Linuxmachine and failed. It also tells us the date and timeand the process number (PID).

Mar16 12:32:42 bumper xinetd[1380]: START: ftppid=1383 from=192.168.1.12Mar16 12:32:42 bumper xinetd[1383]: FAIL: ftpaddress from=192.168.1.12Mar16 12:32:42 bumper xinetd[1380]: EXIT: ftppid=1383 duration=0(sec)

Being a systems administrator, one of your firsts taskseach day should be to check the logs. To quicklycheck on failed accesses, use egrep. The followingone-liner will print out lines that contain either FAILor Auth* (for Authentication) from files ending in.log.

$ egrep “FAIL | Auth*” *.log

To specify more that one host IP address, the properformat is to enclose the non-network part in curlybrackets, separating them with commas. For examplesuppose we wanted to specify the following hosts:192.168.1.8, 192.168.1.20, 192.168.1.22 and192.168.1.50 on the 192.168.1.0 network. We woulduse the following to include those IP addresses:Figure 2: Listing of /etc/xinetd.conf with FTP and Telnet disabled

Page 37: linux magazine uk 20

KNOW HOW

41LINUX MAGAZINEIssue 20 • 2002

All you need to do is specify the IP address and theport of the forwarding machine. Assume the localhost has an IP address of 192.168.1.10. We wishto forward all FTP connections to a backup FTPserver, which has the IP address of 192.168.1.15,the FTP port number is 21. To see what portnumbers match what service check the/etc/services file out.

Using the redirect entry, our FTP (wu-ftpd) filewould look like Figure 3. Your file may lookslightly different. When a host tries to establishan FTP connection to our host, their screen willdisplay a ‘Trying?192.168.1.10’ message, thenthe re-direction will kick in and a connection willbe established to the backup server(192.168.1.15).

Conclusionxinetd by itself enables you to create a fairly securepolicy from daemons that are launched fromxinetd. We have demonstrated how you cancontrol your daemons, based on access via hostsand IP addresses and how to enable/disable thedaemons, as well as simple time-based accesscontrol. We’ve also shown how you can implementbasic redirection of services to another host. Whatwe’ve shown this month has been without theinvolvement of TCP Wrappers, so if you do nothave TCP Wrappers installed you’re not out on alimb security wise.

Figure 3. Redirect entry in the FTP (wu-ftpd) file

InfoXinted homepagehttp://synack.net/xinetd

The authorDavid has written two Linux-based books andseveral magazine articles and enjoys riding hismotorbike when it’s not raining. David is a SeniorSystems Analyst at ACE Europe, a leadingInsurance company.

only_from = 192.168.1.{8,20,22,50}

Similarly, to specify more that one network address,for instance to allow network addresses 192.168.8.0and 192.168.10.0, use spaces to separate the entries,like the following:

only_from = 192.168.8.0/24 192.168.10.0/24

Time-based control accessYou may have a security policy where FTP must beclosed down when office hours are over. xinetd letsyou specify in a HH:MM format when a service canbe disabled. To disable FTP from 17:30 through to09:30 the following morning, using theACCESS_TIMES entry we could specify the followingin the FTP (wu-ftpd) file:

access_times = 17:30-09:30

Being more adventurous we can also specify that theservice is to be disabled at lunch break times:

access_times = 12:30-14:00 17:30-09:30

Unfortunately this format does not allow for a daynumber or day of week sequence. To disable it over aweekend you’ll have to edit the defaults file andinsert a disable entry, like we have done previously. Abetter solution however, would be to make a coupleof copies of xinetd.conf, one for normal working(xinetd.live) and the other with the daemons youwish disabled (xinetd.disable), then use cron toautomate it.

The following crontab entries would on a Friday at17:30 copy the xinetd.disable over to xinetd.conf,and on Monday at 07:30 copy the original(xinetd.live) back, ready for business.

30 17 * * 5 /bin/cp /etc/xinetd.disable/etc/xinetd.conf >/dev/null 2>&132 17 * * 5 /sbin/service xinetd restart >/dev/null 2>&1

30 7 * * 1 /bin/cp /etc/xinetd.live/etc/xinetd.conf > /dev/null 2>&132 7 * * 1 /sbin/service xinetd restart >/dev/null 2>&1

A bit of redirectionxinetd offers redirection (of sorts). This functionallows you to redirect a service to anothermachine. Why do this? Well suppose your FTPdirectory structure got blitzed or perhaps theperformance of your current machine is under-achieving. You will want a quick solution toredirect all incoming connections to another host.

Page 38: linux magazine uk 20

KNOW HOW

42 LINUX MAGAZINE Issue 20 • 2002

Linux Networking Guide: Part 1

CREATING ACONNECTION

Bruce Richardson

presents the first

part of our guide to

configuring Linux

networks from the

command line. In this

issue we look at how

to connect a

computer running

Linux to a network

Whatever the virtues of the applications thatcan be run on Linux, one of its greateststrengths is its power and flexibility as a

network operating system. Some people (includingme) believe that you haven’t really done grown upcomputing until you’ve done networked computing.

This series of articles is designed to show howLinux networks can be configured using the simplecommand line tools and text configuration filescommon to all Linux systems, using tools that arecommon to kernels from 2.0.x to 2.4.x. Where ofinterest, examples of configuration from specificdistributions will be given but the emphasisthroughout will be on portability. The article willrestrict itself to IPv4 only.

This article describes how to choose and install anetwork card and how to configure and activate anetwork interface. Future articles will build on this toshow how complex networks can be build fromsimple tools.

Network essentialsTo function as part of a network your computerneeds, as a minimum:

● A physical connection to the network. There arequite a few ways to connect to a modern networkbut this article will concentrate on the mostcommon way: the internal Network Interface Card,henceforth referred to as a NIC.

● An address on the network. It’s no use being ableto talk to other computers if they can’t find areturn address to talk back to.

● A way of determining how to reach any givenaddress. That is to say, given an arbitrary addressto connect to, can we find it on this network, canwe reach it through this network or must we findsome other route?

This article covers items one and two. The next articlewill use item three as the basis for a demonstrationof how a Linux box can be turned into a router andgateway for a network.

The physical connectionThere are several ways to connect a PC to a networkbut we’re going to look at internal network cards. Ifyou’re doing this on a budget, maybe with secondhand kit inherited from a kind benefactor, choice maynot come into it. If you do have a choice then thereare several things to consider:

Price You get what you pay for. Cheap generic cardscan be found for as little as £12 but don’t expectthem to perform well at high loads or to auto-negotiate connections reliably (if at all). It may also bedifficult to identify the chipset on a generic card,which will make it difficult to find the correct driver.Personally, I would be sure to buy a reliable, well-known brand and I wouldn’t consider spending lessthan £30 on a card.Network type What kind of network do you wantto connect to or set-up? A BNC/Coax network orRJ45/Cat5 network, 10Mbps or 100Mbps (See the

BNC versus RJ45Older Ethernet networks (and cheap home network starter kits) use cards withBNC connectors, connected together with coaxial cable. BNC NICs can beidentified by the stubby metal cylinder that is the connector. This kind of set-up isslow (maximum theoretical speed of 10Mbps) and fiddly (the cable must beterminated at each end, you may need to cut and crimp the cable yourself).However, it does have the advantage that you can connect more than twocomputers using just one cable: you simply add T-connectors to the cable atappropriate intervals.

Newer networks use cards with RJ45 connectors, connected together with UTPcable. RJ45 nics have sockets which look similar to those on modems. The cardstypically come in 10Mbps or 100Mbps (Fast Ethernet) speeds, 100Mbps being thestandard at the time of writing (Gigabit Ethernet is mostly restricted to the core ofhigh-performance networks). This kind of network is faster but a UTP cable canonly be used to connect two devices. If you want more than two computers onyour network you will need to connect them to a hub or switch.

It is possible to get combo cards, which have both BNC and RJ45 connectors,though I’ve never seen one that was faster than 10Mbps.

Page 39: linux magazine uk 20

KNOW HOW

43LINUX MAGAZINEIssue 20 • 2002

The software connectionBefore we can begin configuring the networkinterface we first have to make sure that we areusing the right driver. Now, I absolutely recommendthat you load NIC drivers as modules. It makestroubleshooting and testing so much easier:

● You can load and unload different modules, or thesame modules with different parameters, as manytimes as you like with no need for a reboot.

● There is no need to recompile the kernel. Even ifthe module(s) you need (or want to test) aren’t inyour current set, you can compile them separatelyfrom the kernel (though you will need the configused to compile the kernel). If the driver iscompiled into the kernel and you want to try adifferent driver or change the parameters passed tothe driver then you will need at least to reboot and(in the former case) to recompile the kernel aswell. This can become tedious very quickly.

Note: Do not panic! The default kernels that areinstalled with most distributions come with aselection of drivers that cover all the commonnetwork cards. You probably won’t have to do morethan load and unload a few modules until you get itright.

There’s not enough space here for a lesson inkernel/module compilation, so I will assume that youhave a system with networking enabled in the kernel(as it is in all the default kernels shipped with anydistribution I ever heard of) and with a selection ofmodules, which hopefully includes the one to matchyour card.

BNC versus RJ45 boxout)? If you have the option,choose a Fast Ethernet set-up. It’s the currentstandard for connecting workstations and theequipment will be easier to configure andtroubleshoot.Support Obviously you want a card that is supportedby Linux but you should also try and find out howwell the card is supported, whether the driver isstable or experimental etc. In this case the Internet isyour friend. Find any identifying information aboutyour network card (the make and model forreference, failing that the FCC ID number, whichshould be printed on the card somewhere, failingthat any identifiable numbers on the card). Go to theGoogle Linux search and type in the information. Youshould find plenty of information to help make yourdecision. You may find it useful to cross-checkwhatever you find with the networkingdocumentation accompanying the kernel source,which can normally be found in/usr/src/linux/documentation/networking.

Installing and testing the cardI’m going to assume you know how to install anextension card into a PC. Once it is in we can dosome basic checks to see if the hardware isfunctioning properly. This is important: there’s nopoint going on to later steps if the card isn’tfunctioning, you’ll only waste a lot of time.

Start the machine and have a look at the card. Anydecent, recent card will have at least one status light,one of which will show if any power is getting to thecard (another reason to avoid cheap or old kit).

If your card seems to be getting power, get a cableand connect the card to another networking device,preferably one that has a connection status light (e.g.a hub or a good quality card in another PC). Don’tforget to use the right kind of cable for theconnection (see the Plugging your network togetherboxout) and be sure that the devices match (i.e. bothoperate at the same speed or at least one is capableof auto-negotiation). A connection light should showon one or both devices.

If you get no power light then either you need toreseat the card in its slot or the card is broken. If youget a power light but no connection light then youmay have the wrong cable, one/both of theconnected devices may not be functioning or the twodevices may be mismatched (i.e. they are at operatingat different speeds and the fast one isn’t auto-negotiating): try changing the cable or the device youconnect to until you get a working connection. If youcan’t get a connection light after trying severaldifferent cables and devices then your card is probablybroken. When troubleshooting a problem connection,it’s important to change one thing at a time. Thatway, if you do finally get a connection, you will beable to identify the problem component conclusively.

Plugging your network together You can build a network out of all kinds of different parts. An IP packet doesn’tcare about the type of cable it travels across or its speed. On your network youmight have a 10Mbps link from your PC to a hub, a 100Mbps link from the hubto a switch further up the line and a Gigabit connection between the switch andthe application servers.

The physical connections are not hard to set up, since most modern networkingkit automatically senses the speed of the device at the other end of the cable andwill slow down to match slower kit (this is called auto-negotiation). There are evenhubs with both RJ45 and BNC connectors. Do remember to use the right kind ofcable. For 100Mbps speeds the UTP cable must be Cat 5 quality or higher. Cat 3UTP is enough for 10Mbps but means you’d have to rewire before upgrading.

The simplest type of network is formed by linking two computers together. Ifusing a UTP cable you will need crossover cable rather than a standard UTP patchcable. You can also connect multiple computers through a hub or switch and canchain hubs and/or switches together to create as large a network as you like. Usecrossover cable to chain hubs and switches but standard patch cable to connectPCs to hubs or to switches.

Page 40: linux magazine uk 20

KNOW HOW

44 LINUX MAGAZINE Issue 20 • 2002

Select a moduleIf you didn’t identify the correct driver when doingyour Google search, now is the time. Compare theinformation you found then with the help in/usr/src/linux/documentation/networking. If you findmore than one match, don’t panic, just repeat theprocess described below until you find one thatworks (you can leave fancy comparison-testing tillyou know more). Be sure to note any specialparameters that may need to be passed to themodule (another good reason not to buy cheap:decent modern cards usually autoconfigure).

Load the moduleSay you want to try the eepro100 module. Load it:

# modprobe eepro100

Now, check the end of /var/log/messages for anymessages from the module. If the module didn’twork then you will see obvious error messages: try

another module or try reloading this one withdifferent parameters. A successful load will giveoutput like this:

Apr 1 20:15:33 localhost kernel: eth0: U

Intel EtherExpress Pro 10/100Apr 1 20:15:33 localhost kernel: Board U

assembly 689661-004Apr 1 20:15:33 localhost kernel: General U

self-test: passedApr 1 20:15:33 localhost kernel: Serial U

sub-system self-test: passedApr 1 20:15:33 localhost kernel: Internal U

registers self-test: passedApr 1 20:15:33 localhost kernel: ROM U

checksum self-test: passedApr 1 20:15:33 localhost kernel: Receiver U

lock-up workaround activated.

Success! Light a cigar (away from the equipment).But note that eth0 in the first line, we need it for thenext step. What does it mean? It’s the interface nameassigned to the card.

Boo-boosIf you compiled the driver into the kernel, smackyourself on the wrist and prepare for multiple reboots.Each time you reboot, check the messages that scrollpast. Too fast? Once it’s finished booting, log in andcheck the contents of /var/log/dmesg. You should findthe output from the driver somewhere in there.

Configuring the network interfaceLoading the correct driver gets us halfway there. Nowwe need to configure and activate the network

Debian network config file# /etc/network/interfaces –– configuration file for ifup(8), ifdown(8)

# The loopback interfaceauto loiface lo inet loopback

auto eth0iface eth0 inet static

address 192.168.10.10netmask 255.255.255.0

An IPv4 address is a 32 bit number, which is usually shown indotted quad notation: four decimal numbers separated by fullstops (e.g. 192.168.10.5). This number is further split into twoparts, one identifying the network on which the host (machine) islocated and one uniquely identifying the host within that network.

You can’t tell which part is which just by looking at the address(some IP addresses are commonly split in particular ways but don’trely on this). To identify the network and host parts of an IPaddress, you need to know the netmask for the network on whichthe IP address is located. The netmask specifies which bits of anaddress are the network address and which are the host address.The 32 bits may be divided in any permutation but it is mostconvenient and least confusing simply to split them into twoblocks, with the high block of bits representing the network andthe low block the host. Network bits have a value of 1 and hostbits a value of 0, so that AND-ing an IP address and its netmaskgive you the network address.

In our example network, the highest 24 bits of the address arethe networkaddress. So the netmask could be represented by the binary

number 11111111111111111111111100000000. This is obviouslynot convenient, so netmasks are usually shown in one of twoways:

● In dotted quad notation. Our example netmask would be255.255.255.0

● A slash and a decimal digit, appended to an IP address, the digitshowing how many high bits comprise the network address. So192.168.10.0/24 would indicate that the first three bytes are thenetwork address and that the final, least significant byte is usedto allocate host addresses. Since one address is reserved as abroadcast address, that leaves 255 host addresses we can use.

So why all this trouble? The answer is that before an IP packet canbe delivered to its destination we need to know if it is on the localnetwork or a remote one.

The network address may be further divided into a networknumber and a subnet number. This distinction will be explored inthe next article: for the purposes of this article no distinction ismade.

IP addresses and netmasks

Page 41: linux magazine uk 20

KNOW HOW

45LINUX MAGAZINEIssue 20 • 2002

connection. For this example, I am going to assumewe are connecting to a network with address192.168.10.0/24 and that this computer will have theaddress 192.168.10.10 on that network. If thismeans nothing to you then you should read theboxout on IP addresses and netmasks.

To do this, we use the ifconfig command, giving asparameters the interface name, the address andnetmask:

# ifconfig eth0 192.168.10.10 netmask U

255.255.255.0

If you get no feedback then in good *nix fashion thismeans that nothing went wrong. So now you shouldlist the interfaces on your computer, by running theifconfig command with no parameters. The outputshould include a record like this:

eth0 Link encap:Ethernet HWaddr U

00:01:02:87:18:ABinet addr:192.168.10.10 U

Bcast:192.168.10.255 Mask:255.255.255.0UP BROADCAST RUNNING MULTICAST MTU:1500 U

Metric:1RX packets:819780 errors:116 dropped:0 U

overruns:0 frame:232TX packets:593233 errors:0 dropped:0 U

overruns:0 carrier:69collisions:230 txqueuelen:100 RX bytes:873172906 (832.7 MiB) TX U

bytes:48467017 (46.2 MiB)Interrupt:9 Base address:0xec00

Before you light yourself another cigar, let’s try pingingthe address of another network host (the pingcommand sends a stream of IP packets to therequested address and reports their progress). On thisexample network, there’s a router at 192.168.10.1, so:

# ping 192.168.10.1PING 192.168.10.1 (192.168.10.1): 56 data bytes64 bytes from 192.168.10.1: icmp_seq=0 U

ttl=255 time=0.2 ms64 bytes from 192.168.10.1: icmp_seq=1 U

ttl=255 time=0.2 ms64 bytes from 192.168.10.1: icmp_seq=2 U

ttl=255 time=0.2 ms64 bytes from 192.168.10.1: icmp_seq=3 U

ttl=255 time=0.2 ms64 bytes from 192.168.10.1: icmp_seq=4 U

ttl=255 time=0.2 ms64 bytes from 192.168.10.1: icmp_seq=5 U

ttl=255 time=0.2 ms64 bytes from 192.168.10.1: icmp_seq=6 U

ttl=255 time=0.2 ms

Success! You managed to connect to a network andtalk to another host on the network – the aim of thisintroductory article. But we’re not finished yet.

Up and downOK, now that you have configured and activated yourinterface, you can deactivate it any time you like. Tobring it down run:

# ifconfig eth0 down

Now run ifconfig with no arguments – you’ll see thatthe eth0 record has disappeared. You can bring theinterface up again by running the above commandbut replacing down with up. Try it and then runifconfig again to see if the interface has come backup with the same settings.

Achieving permanenceWhat we have achieved so far is fair enough, but itwon’t survive a reboot and even Linux boxes have tobe shutdown once in a while (only for hardwaremaintenance, obviously).

So what do you do if you want this interface to beconfigured automatically when the machine restarts?You could create a script to configure the interfaceand add it to the sysvinit scripts. But you don’t haveto: while there is no definitive Linux standard for this,there is a semi-standard. Most distributions enableyou to record the interface’s details in a text configfile, to bring the interfaces so defined up and downwith the ifup and ifdown tools and to specify whichinterfaces should be activated on startup. Exampleconfiguration files for Debian and Red Hat are shownin the two boxouts, Debian network config file andRed Hat interface config script. In both cases, theinterface we created above would be configured andactivated as part of the startup process.

SummaryThis article has shown you how to get a simplenetwork connection up and running. I hope it hasbeen enough to get you interested and experimenting.But there’s still a lot we haven’t covered. The nextarticle will explain subnets and routes, show thedifference between hubs, switches and routers,introduce the IP tool (brought in with the 2.2.x seriesof kernels) and explain how you can turn a Linux boxinto a network router/gateway. See you then.

Red Hat interface config script# /etc/sysconfig/network-scIpts/ifcfg-eth0

DEVICE=eth0USERCTL=noONBOOT=yesBOOTPROTO=BROADCAST=192.168.10.255NETWORK=192.168.10.0NETMASK=255.255.255.0IPADDR=192.168.10.10

Page 42: linux magazine uk 20

KNOW HOW

46 LINUX MAGAZINE Issue 20 • 2002

system, select the one holding the diskette forformatting – either drive A or B – in the drop-downmenu. As well as the usual 3.5in diskettes the old5.25in diskettes are also supported.

In the second drop-down menu, select the memorycapacity of the diskette. This is normally HD – HighDensity (1.44Mb). The older diskettes with DD, DoubleDensity, have more or less disappeared from themarket. They store only 720Kb of data. Which sort ofdiskette you are using is written on the diskette.

When formatting a diskette, a filesystem is createdon the data medium. Under Windows, only FAT isavailable. Kfloppy lets you choose between MS-DOS(thus FAT) and the Linux filesystem ext2. If youformat diskettes in the DOS format, Linux has noproblem accessing these data media – it does notwork the other way round however: Windows cannotread an ext2-formatted diskette.

As formatting methods, you can choose from fastor full formatting. Fast formatting deletes all data onthe diskette, but only works if the diskette wasalready formatted. The full method also deleteshidden files, checks for errors and can also be usedon unformatted diskettes – although these are nolonger available. Once you have selected theappropriate settings, click on Format to begin theprocess – the full formatting can take some time, butyou can check the progress via the blue bar.

Check memory capacityDiskettes are, like hard drives, partitions and CDs,storage media for your system. It is often importantto find out how much total memory space is availableon a storage medium and how much is already taken

Formatting, editing and packing

ODDS AND ENDS

Figure 1: Kfloppy offers many setting options

FAT: FAT stands for FileAllocation Table and refersto the filesystem of MS-DOS and Windows 9x/Me.The table itself representsthe table of contents of adata medium, thus forexample a diskette.ext2: The Second ExtendedFilesystem (ext2) is used byLinux. It is a more modernfilesystem than theWindows FAT system.

Figure 2: Completion message afterfull formatting and error check

Windows collects a

number of useful

applications together

under the heading of

“Accessories”. Anja

M. Wagner shows

you how to find and

use these and other

odds and ends in KDE

The applications of KDE, and here we arereferring to KDE 2.2 from SuSE Linux 7.3, areoften very similar to those of Windows, which

makes it easier to migrate – but some flows do differ.

Formatting diskettesFor example, in Windows you format a diskette viathe desktop and the option Format in the File menu.Try hunting for this option in KDE and you’ll belooking in vain. Instead, you must start a little toolnamed Kfloppy, which you will find underSystem/Tools/KFloppy. The diskette drive must not bemounted before formatting.

Kfloppy offers a number of setting options. Ifyou have a diskette drive, it bears the drive letter“A” and is recognised and selected as such byKfloppy in the drop-down menu. This is aconcession to users who are accustomed toWindows, because in fact there are no drive lettersunder Linux. If you have two diskette drives in your

Page 43: linux magazine uk 20

KNOW HOW

47LINUX MAGAZINEIssue 20 • 2002

up or still free. Under Windows all it takes is a right-click in Windows Explorer on the corresponding drive,and a pie-chart shows the level occupied. InKonqueror, the standard file manager of KDE, thisway does not exist. Instead a small tool comes intouse every time: KDiskFree. You can find this underSystem/Info/Disk Free.

This tool lists all data media on your system clearlyin succession. It shows the drive designation, the type(for example “vfat” for Windows partitions and“ext2” for Linux partitions), the mount location (i.e.the location in the system, at which the device hasbeen mounted in the directory tree), the overallmemory capacity and the free memory space inabsolute numbers, together with occupied space as apercentage. The ratio between free and occupiedspace is also shown in the form of a green bar.

From KDiskFree, by the way, you can easily mountany drive in the system. Click with the right mousebutton in the appropriate line and select Mountdevice in the pop-up menu. The green bar onlyappears for devices or drives mounted in the system.Select Options/Configure KDiskFree to change thedisplay to suit your own requirements. On theGeneral Settings tab the default setting displays alltypes of information – individual fields can be shut

down with one click. Another default setting is thatKDiskFree activates a warning if the memory capacityof a drive is approaching its limit.

The pop-up menu also includes the item Openfilemanager. If you select this option, the filemanager Konqueror opens at the position of themount location. If, for example, there is aWindows partition in the system with the mountlocation /windows/C, Konqueror starts at thispoint, and you have access to your Windowsdirectories and files.

Changing a passwordWindows offers passwords for the various users ofthe system. You change a password there in theControl Panel via the option Passwords. You can do asimilar thing under KDE to change your password.Via Administration/Tools/Change Password you cometo a small tool, which first asks you for the old andthen twice for a new password.

Figure 3: Windows shows the relationbetween occupied and free memory

Figure 4: KdiskFree shows clearly and informativelythe size and occupied space of all drives in the system

Figure 5: Select which informationKDiskFree is to display and which not

Figure 6: With the option “Open filemanager” you quicklyget to the mount location of a drive in the system

Figure 7: Changing your password atregular intervals enhances security

Page 44: linux magazine uk 20

KNOW HOW

48 LINUX MAGAZINE Issue 20 • 2002

Packing and unpacking filesWhen working with data you will often have to unpackcompressed archives. Certainly the most popularcompression program in the Windows world is WinZip.KDE offers a number of alternatives. One of these is theclassic Ark, which is now very similar to WinZip in lookand feel. With this tool, which you will find underSystem/Tools, you can unpack both zipped files (*.zip)and the compressed files which are common in theLinux World with the endings tar.gz and tar.bz2.

At first, the main window of Ark is empty. Clickthe Open button or in the menu list select File/Openand open a file to be unpacked in your system. If it ison a diskette, remember to mount the drive first.After confirming with OK, the files in the archive willnow appear in the main window of Ark. If you wantto unpack the entire contents of the archive into acommon folder, you don’t need to mark anything.Click on Extract and via Browse select the destinationfolder. If the destination folder does not yet exist,click on the cog symbol on the far right in the toolbarand select New Directory.

Activate the All option when all the files are to beunpacked. The Selected Files option is only active if youhave previously marked one or more files in the mainwindow of Ark. Confirm with OK, and straight away thefiles are unpacked.

New archives are created via File/New. In the dialogwindow, specify the directory in which the new archiveis to be stored, for example your home directory. In thetext line, Location, enter the name and the archiveending. With the ending, e.g. .zip or .tar.gz, you aredefining the archive type.

You can fill the new archive with content either viaAction/Add File or Action/Add Directory. Select the filesand directories in the window which opens, which areto be compressed in the archive. You can also drag thefiles and directories, if Konqueror is open, via drag anddrop into the main window of Ark. The procedure endswith File/Close Archive.

The editor KWriteThere is a wealth of editors to choose from in KDE.KWrite is very similar to the Windows editor, but offers afew additional abilities. Start the program viaOffice/Editors/Advanced Editor. The settings of KWriteare set, as in most KDE applications, viaSettings/Configure editor in the menu list.

Here you can change the background colours and thecolour of marked sections of text. Font type and size canbe adapted to your individual requirements. Whenworking with KWrite the text can also be enlarged orreduced with a click on the magnifying glass symbol inthe toolbar.

In the section Setting/Configure Editor/Edit you candefine after how many characters a line should wrap –the default is 80 characters. The wrapping only becomesactive, though, when you invoke Edit/Apply WordWrap.

The width of the tabulator indentation can be varied,as can the number of possible undo steps. One practicalfunction is pre-set in the area Select: all text sectionscopied with the mouse are automatically buffered. Sothis saves you the command Copy and you canimmediately insert the marked material at thecorresponding position in the text. This works the sameas under Windows.

KWrite has a spellchecker. In the section headed

Figure 8: When starting the compressionprogram Ark the main window is still empty

Figure 9: The destination directory, into which filesare to be unpacked, can be created directly with Ark

Figure 10: Packing files means creating anew archive and filling it with content

Figure 11: Very similar to the Windowseditor but easier to use: KWrite

Page 45: linux magazine uk 20

KNOW HOW

49LINUX MAGAZINEIssue 20 • 2002

Settings/Configure Editor/Spelling you can choosebetween Ispell and Aspell.

The Comment tool, which put KWrite close to anoffice program, is not yet implemented. It is easy tojump to a specific line via Edit/Go to Line. Individualwords can be found with Edit/Find, and automaticreplacements are possible, via Edit/Replace.

Activating the wheel function ofthe mouseLinux recognises all the common mice without anyproblem during installation. Unfortunately though, inthe case of a wheel mouse, the wheel often does notwork – a configuration file has to be amended to doso. This is where you can get to know how to workwith the editor KWrite at the same time: Log in as Rootand start the editor via Office/Editors/Advanced Editor.Activate, in the menu list, File/Open. In the directorytree, select the configuration file /etc/X11/XF86Config.

In this file there are two “InputDevice” sections, onefor the keyboard and one for the mouse. In the input

device section with the “mouse” driver, you have toinsert, after the last option, the line:

Option “ZAxisMapping” “4 5”

In the line Option “Device”, for USB mice it must state:/dev/input/mice, for other mice /dev/psaux or/dev/imps/2. In the Option “Protocol” line it must alsosay imps/2.

The effect of the ZaxisMapping entry is that themovements of the mouse wheel are interpreted aspressing the fourth and fifth mouse buttons.

For a current distribution such as SuSE 7.3 theconfiguration work is finished at that point. Start the Xinterface again (log out and then press Ctrl+Alt+Del),and the little wheel on your mouse will work. If you arestill working with XFree86 3.x, you will have to start thetool imwheel in addition to the procedure describedabove. You do this for example when starting the worksession with the fast starter Alt+F2. Enter “imwheel”and press Enter. We will present some more usefulapplications which Windows files under “Accessories” inthe next issue.

Figure 12: Line break and tabulator width can beadjusted, as can the number of undo-commands

Figure 13: Changing the spellcheckers settings

Figure 14: Open the file XF86Config with an editor

One line has to be inserted into thefile for the wheel mouse to work

Page 46: linux magazine uk 20

KNOW HOW

50 LINUX MAGAZINE Issue 20 • 2002

CVS: The Concurrent Versions System

LATEST ANDGREATEST

If you’re interested

in helping to develop

Open Source

software then

getting to know the

Concurrent Versions

System is the logical

first step. Colin

Murphy shows us

how to get started

with CVS

Software development under Linux can be a realjoy, thanks to the free movement of sourcecode. Anyone can get involved in moving a

project forward and you may not even need to haveall that much programming experience to make adifference. In some cases you may not even have tocode at all to get involved; what some projectsdesperately need are graphics designers and peopleto help write documentation.

To get involved, you first need access to the projectand for that you need access to the source code. Partof the beauty of Open Source programming is theopportunity it gives you to look at other people’swork and, if you feel up to it, to change it, possiblyeven to improve on it. What is even more useful isthe chance to see the additions that other peoplehave made to a code base for a project, to see how itgrows and changes over time.

Software bugsDeveloping software and developing bugs in thatsoftware go hand in hand, and bugs are bound toappear in software development. When projects areopen to a wide-ranging ‘team’ of developers, thedanger that bugs will be introduced is increased.More importantly, the nature of these bugs may noteven be noticed until much further along the project’sdevelopment cycle. Such bugs may not even becaused by bad or plain wrong programming – it’smore likely that a previously written piece of codeproves not to tie up well enough to the project now.

So how do program developers get around thismajor problem? What is needed is to keep copies ofall of the old versions of the program development sothat you have something to refer back to if and whensomething appears to be going wrong.

Seeing as though a change to a piece of codecorrecting an error might be only a few bytes long,keeping a back-up of all previous pieces of code wouldresult in a huge archive of very similar data. What isneeded is a system that records just the changes madeto the code base. Thankfully, that’s why we have CVS,or the Concurrent Version System, which maintains acentral repository for people to access and modify.

If you’re only just starting out in programdevelopment you may only have come across CVS verybriefly, when exploring the very latest version of a pieceof software, that cures a bug or adds a much-neededfeature that’s just not present in the stable version.With that must come a warning: you must alwaysremember that this is an unstable version and to treat itas such. By using it, you should also remember yourcontribution to the project – bug reports.

For the most part you will be using CVS in aServer/Client mode, most likely via the Internet. CVSis a command line utility, though there are somegraphical front-ends, which we will round the articleup with in a moment.

Firstly, do you have cvs on your system? You canquickly check this with:

[colin@desk]$ cvs ––version

which should return some details, otherwise you willhave to find your disc set and install it. The currentversion is 1.11.1p1.

You will need to know where the CVS repository isthat you want to access – the project we’re going topick is the CVS project itself, which seems onlyfitting. This lives at cvs.cvshome.org in the /cvsdirectory. It is to here that we need to login, usuallyusing some sort of password server for cover. So:

[colin@desk]$ cvs –d:pserver:[email protected]:/cvs login

will give us access, once we have entered thepassword, which will be prompted for, usually youjust need to hit the Enter key. Almost always,anonymous access is granted for people to downloadthe project’s code, but the exact details of this canvary. Often the login will be anonymous@ (instead ofguest@, as in the example above) and the passwordwill be blank, as above.

Depending on how often you are planning to takecode from this CVS tree, you may want to considersetting the Environmental variable $CVSROOT forthat tree, if you are only going to take code

Page 47: linux magazine uk 20

KNOW HOW

51LINUX MAGAZINEIssue 20 • 2002

like add, remove and commit, diff against therepository or view of the log messages in list form, allof which is of much more use when you are actuallycontributing to the development of the project.

After selection of a start directory, the programenables you to automatically find all CVS projectscontained in sub directories using the “Project-Explorer”, and enables the user to add them anddisplays the corresponding tree on the desktop. Allfeatures can be accessed by pull-down menus or asimple click on the right mouse button and may beapplied to both single and multiple files orcomplete trees.

infrequently, then typing it in each time is not toogreat a burden. You need to save the parameter thatis passed by the ‘–d’ switch, in this case the:pserver:[email protected]:/cvs.

To allow you to download the project, which iscalled ccsv in this case, you use the checkoutcommand

[colin@desk]$ cvs –d U

:pserver:[email protected]:/cvs U

checkout ccvs

If all is going well you will then get to see a listing ofall the files that are now being downloaded, whichget stored in a directory with the project name in thedirectory you ran the cvs command from, in this case/home/colin/ccvs.

[colin@desk]$ cd ccvs[colin@desk]$ ls

will give me a listing of all the files and subsequentdirectories in the ‘cvs’ project.

From here on, you are at the mercy of the projectdevelopers. Hopefully, if it is a good project, you willfind that you now have some documentation thatsomeone new to the project can read andunderstand. The important files to look out for areREADME and INSTALL. If there are not enough cluesin these two files to take you further then you may belooking at a project that has yet to fully develop itsdocumentation, either because it is small, or that noone wants to do the job. You still have the option ofcontacting the project developers by email, to ask foradvice and, if you are let down here, then you at leastknow that the project isn’t worth bothering with.

Sometimes, you may find that the projecthomepage has the option to allow you to ‘browse’the cvs tree. If this is the case, it can sometimes bebetter to download some of the documentation filesfrom this browsing session rather than download thewhole tree only to find out that there is nodocumentation, or that it is in German, or some such.

Graphical front-endsGraphical front-ends are available for CVS, to takeaway some of this command line misery.

LinCVSLinCVS is a German project, but thankfully with mostpages also in English. It acts as a reliable graphicalfront-end for the CVS-client supporting both CVSversions 1.9 and 1.10, perhaps even older ones. Itenables the user to check out, or download, amodule from the CVS tree and import modules to therepository if you have been granted access rights. Youcan also update and retrieve the status of a workingdirectory or single files and use common operations

AccessingCVS treeswith LinCVS

InfoCVS homepage:http://www.cvshome.org/The CVS homepage alsocontains a very goodmanualLinCVS: http://www.lincvs.org/Cervisia: http://cervisia.sourceforge.net/

Cervisia –with aclever treedisplay

CervisiaCervisia is another graphical front-end for CVS client-side actions, which has some really neat features likeretrieving directories and single files and examiningtheir status and a graphical diff utility whichhighlights the differences between different revisionsin the same repository.

Getting involvedAt best, this is supposed to be a two way process.Contributions are a start, but you may want to helpfurther, with the documentation or, if you are up toit, the coding. CVS is used for uploadingcontributions and when you get to know a project’sdevelopment team well enough, they might evengive you your own account and password, but moreof that will have to be left for another article.

Page 48: linux magazine uk 20

FEATURE

52 LINUX MAGAZINE Issue 20 • 2001

In this workshop Tim

Schürmann shows us

how to edit videos

once they’ve been

transferred onto a

Linux system. For this

we’ll be using the

Free video editing

program Broadcast

2000c.

To stave off the boredom that the mere mentionof holiday videos instils, it’s a good idea toenhance your video before inviting the in-laws

round to watch it. Since modern cameras usuallystore films in digital form, it seems like a good idea totransfer them into the computer and edit them there.By making use of the corresponding video editingprograms, videos can also be professionally enhancedby adding a few skilfully placed effects.

Under Linux, there are now two video editing systemscourting the favour of users. One is the relatively simpleto use, commercial program MainActor from thecompany MainConcept (http://www.mainconcept.de).The competing candidate goes by the name ofBroadcast 2000c and is now available in its third version.Unlike MainActor, Broadcast 2000c is in fact availableFree on the Internet. It may not be quite so simple touse, though, which is a good enough reason for a littleworkshop, to help make your first tentative steps intoBroadcast a bit easier.

RequirementsTo be able to use Broadcast you will first need a videosource. This can be a video camera or a videorecorder. Your computer will also need to have asuitable hardware interface. Broadcast can cope withboth TV cards for analogue sources and FireWirecards for digital sources. In either case Linux mustsupport the corresponding hardware.

If you wish to use an analogue camera or a videorecorder, the way to go is to use a TV card. You shouldfind how to operate this under Linux in the manual foryour distribution under the heading of “Installing theTV card”. Incidentally, unlike MainActor, Broadcast isunable to edit video materials read in by dvgrab.

On the software side you will need XFree86, whichshould not be Version 4.0.0. Users of SuSE Linux 7.0will be affected by this problem; the only remedy forthis is to change to a different version (e.g. the olderversion 3.x). Otherwise Broadcast refuses to start. Youmay need to consult the documentation on yourdistribution about this. Furthermore, the

Enlightenment Sound-Daemon (the package esound)must be installed on your system. This softwareshould not only come with all the most commondistributions, but should also be installed as standard.

InstallationProvided Broadcast comes with your distribution, youcan use the corresponding package managementtool. Otherwise you can find a ready-made rpmarchive at http://www.heroinewarrior.com. Make surebefore starting the program that both your selectedinterface card (TV or FireWire card) as well as yoursound card will work under Linux.

StartIf your distribution has no entry for Broadcast in thestart menu, you can call up the program by openinga terminal window, entering bcast and then pressingReturn. If your hardware has been installed correctly,four windows will now open: Bcast: Video out isresponsible for a preview of the edited videomaterial, Bcast: Levels shows the volume of thesound, Console lets you add effects to the video orsound material and the main window takes on thecentral role of the arranger.

A question of attitudeThe basic settings of Broadcast can be found in themain window under the Settings/Preferences... menu

Workshop: Video editing withBroadcast 2000c

THE FINE ARTOF CUTTING

Figure 1: When Broadcast starts forthe first time, four windows open

Page 49: linux magazine uk 20

FEATURE

53LINUX MAGAZINEIssue 20 • 2001

item. Click in the left-hand area on the buttonmarked Audio In. OSS should now be set underRecord Driver. This is the right value if the sound is tobe read in via your sound card. Generally, this is thecase for all analogue sources. If you have a digitalvideo camera, which transfers your data to thecomputer via a FireWire card, at this point you shouldselect the value IEEE1394. Once the sound source hasbeen correctly configured, it’s time for the image:click in the left-hand section on Video and underRecord driver and select the desired recording source.In the case of a TV card this is Video4Linux, and for aFireWire card it’s IEEE1394 (see Figure 2).

If you want to record the contents of the desktop,the selection to make at this point is Screencapture.But this latter only makes sense in very rare cases(e.g. for training videos) and, on the grounds ofspeed, should only be done at low screen resolutions.By the way, LML3 stands for a special video editingcard, which is distributed by the firm Linux MediaLabs (linuxmedialabs.com) on the Internet. Once youhave made all the settings for the recording, close thesettings window with a click on OK.

Quiet, please...Before the video material can be read in, first create anew project via File/New.... In the window whichpops up, enter the values shown in Figure 3.

The dimensions of your video (Track Size, OutputSize) will depend on the material involved or on thesize in which you later wish to output the video. Thestandard PAL resolution is 720x576 pixels. This is alsoused for digital video material. Owners of a digitalcamera should therefore select this resolution. If,during recording or playback, you find there aremisfires or jumps, as an alternative you could also usea resolution of 352x288 pixels. This format is also usedon VideoCDs and because of its smaller size it is a lotless greedy in terms of memory. After clicking on OK,the data entered here will be used as initial values.

To start recording, click on the red symbol at thefar left of the toolbar in the main window. A new

window will then appear, prompting you to enter afilename. The video film which is then recorded willbe saved later in this file.

Under the input box, thereis a button to define thememory format. Quicktimeshould be specified here asstandard. Apple’s memoryformat for video films acts asthe standard format inBroadcast. Please note thatin all other formats offeredhere either only the sound(WAV and PCM) or images(as a series of individualimage files – JPEG list) arerecorded. For our purposes,you should retain the defaultsetting at this point.

The rest of the buttons inside this window can beused to make detailed settings for the recordingactivity. Those working with analogue video materialmay be interested in the Video/Options settings. Hereyou can choose between different compressionmethods, which may have a positive effect on thehard drive space required. However, too powerful acompression will also be detrimental to image quality.If you’ve picked IEEE1394 as the recording sourcethen this item will not be available to you: digitalvideo is already compressed on the video tape in theso-called DV format and is therefore copied byBroadcast directly from the camera onto the harddrive. You should take note though, that one secondof film in DV format takes up 3.5Mb of space.

After clicking on Do it, a window will then openwhich offers symbols similar to those on a videorecorder. If you’re using analogue material, which isplayed into the computer via a TV card, you must firstselect the correct input for the TV card. Click on theChannel button in the Video in window then clickAdd.... Again, a window will open, in which you canset the data of the channel thus created. Under Title,enter any name you like; under Norm select PAL; andunder Frequency table select PAL_EUROPE. Under

Analogue video Theimages in the film arerecorded in the form of anelectromagnetic signal onappropriate storage media,such as a magneticvideotape.

Digital video Unlikeanalogue video, the film’simages are stored as asequence of ones andzeroes. This allows thevideo material to be savedon the hard drive as a fileand edited using thecomputer.

PAL British transmissionstandard for colour TVsignals.

Figure 2: You must set these values when working with adigital camera and a FireWire interface Figure 3: A new project is

created. For the project inthis article, you should

select these values

Figure 4: In the case ofanalogue video material

you have to give details ofthe format in this window

prior to recording

Page 50: linux magazine uk 20

FEATURE

54 LINUX MAGAZINE

Source you should finally set the input or channelfrom which you would like to record the videomaterial.

Which value must be selected here depends onyour TV card and should be described in theassociated instructions. Now click on OK, mark in thewindow Channels the newly created entry and clickSelect – which selects the channel. Close the windowby clicking on OK.

...and action!In order to start recording, first put your camera intoplayback mode and then click on the symbol with thered circle. To stop recording, click on the symbol withthe black box. If you wish to tell Broadcast to only

record for aspecified length oftime, first set theRecording Mode toTimed and underDuration enter theappropriate periodof time. You canthen start therecording by

clicking the recording symbol.Owners of a digital camera, who are reading in

their film via a FireWire card, should take note thatBroadcast doesn’t co-operate perfectly with alldevices. In our test there were some problems withSony Digital 8 cameras: Broadcast flatly refused toread out the video material. Unfortunately thedocumentation has nothing to say about whichcameras work and which don’t – all you can do hereis give it a try.

Before the film is saved, you can watch it with theaid of the other symbols in the preview window. Onlywhen you feel it is satisfactory should you save it witha click on the Save button. Otherwise all you need dois start recording again.

As soon as your film has been saved, it shouldhave been added directly into the main window.Before you start editing there, you should firstly alsorecord a second film. We will be fading these twovideo clips into each other, for practice.

Image for imageIf you’ve already recorded the two films and they’renot shown in the main window, first create a new,

empty project via File/New... and load both videos viaFile/Append.... Contrary to Load, Append adds avideo to the existing ones; Load on the other handcreates a new project, containing the single fileselected by the user. Either way, there should now betwo videos displayed in the main window.

Each film is laid down on a track of its own; theseare provided with the name “Video” and anincremental number. If you’ve added the videos viaAppend you should find two video tracks with thenames Video 1 and Video 2. Similarly, in the mainwindow you will find tracks for the sound (“Audio”),which are incrementally numbered in the same way.You can change the name of a track to suit your ownrequirements: to do this, simply click on the trackname and enter a new one.

Like a proper reel of film, a video also consists ofindividual images or frames. With the PAL standardused in the UK, the speed is 25 frames per second.Broadcast shows videos within the main window likefilm reels playing out. The start time is always shownon the left and the end is on the right. Since it canbecome fairly tedious with long films to get from oneend of a film reels to the other, Broadcast supportsvarious stages of enlargement: you can set these onthe top edge with the triangular symbols (marked X,Y and T). Simply try out all the buttons here to seewhat happens. The time strip under the toolbarserves as an aid to orientation on which you can alsoread off later how long the finished edited film willrun. Finally, one more tip: if you click on the Fitbutton in the toolbar the enlargement factor isautomatically adjusted so that all videos fit easily intothe main window.

Before we come to the actual editing of ourvideos, let’s take another look at the bar at the leftedge of the screen. Not only is the name of a tracklisted here, but there are also four symbols for eachtrack. If the green rectangle is selected, this track willbe picked during playback. In the same way, the redbutton says that an editing or recording function justexecuted should also be applied to this track. You canchange the time bar in the right-hand section via thebutton marked with a D: if this is selected, in thecase of a video track the individual images of thevideo saved there, or in the case of a soundtrack, thefrequencies will be shown. Before selecting thisbutton you should consider the fact that this type ofdisplay, especially on slow computers, can require agreat deal of computing time.

EditingAs already mentioned, both of our videos are to beplayed one after the other in the finished film, with asmall fade leading from the first video into thesecond. There are two ways of doing this. If all youwant is for the first video to slowly disappear and atthe same time for the second one to fade in, you can

Figure 5: By using thesetwo windows, you canstore your video materialon the hard drive: withthe left one you controlthe recording, and theright shows a preview ofthe image just recorded

Figure 6: This is how the two videosadded to the main window should

look before editing

Issue 20 • 2001

Page 51: linux magazine uk 20

FEATURE

55LINUX MAGAZINEIssue 20 • 2001

use a menu function. For this to be applied, bothfilms must be immediately one after the other in thesame track. First, decide on the sequence. On alltracks, except for the track holding the second film,deselect the small red recording symbol alreadymentioned – by doing so you are making sure thatonly the second film will be cut out. On each film thestart and finish should be marked by two small bluerectangles. Double-click between the two bluerectangles on the track of the second film: the lattershould now be marked white.

Alternatively, but a bit less precisely, you can alsoachieve this by first going to the start of the film withthe mouse pointer, pressing the left mouse button,holding it down, dragging the mouse to the end ofthe film and then releasing the mouse button. Nowclick on the Cut button in the toolbar. Since we wishto add it to the track of the first film, deselect the redrecording button again in all tracks, except for thetrack holding the video material for the first film.Now place the white mark, with a single mouse click,immediately behind the blue triangle on the end ofthe first film. Click on the button marked Paste in thetoolbar, and the video which was previously cut outshould now have been added behind the first film.

In order to assign the fade, mark both videos with

the mouse. All you need do is include both videos inthe marking (Figure 9). Now select the menu itemVideo/Feather Edits. A window now opens in whichyou can define the duration of the fade in images.For one second select 25 images. After clicking OKthe fade will be calculated. To look at the film, firstrewind it to the beginning with the video recordersymbols and start it with a click on the green triangle.The preview is outputted in the window of the samename. On slow computers, the result can be a bitjumpy on playback. This is because Broadcastcalculates the fade in real time.

Provided your film has audio tracks, you shouldrepeat the procedure with the corresponding audiotracks. Here, too, you can fade the sound in and out– although the associated command is hidden behindthe menu item Audio/Feather Edits.

The second wayThe fade described above isadequate for simple cases,but special effects cannot bedone like this. In order torealise somewhat moreextravagant fade effects, weneed the film back on twodifferent video tracks again. To do this you can eithercut out the second film again and paste it onto itsown original track, or create a new project andimport both films again.

Again, decide on the sequence of the two videos.You should also ensure that only the recording headof the track for the second film is activated. Mark thevideo, cut it and paste it a little before the end of thefirst film. The videos should now be on two differenttracks, offset from each other slightly (Figure 10). Theentire overlapping area will later act as the fade.Please note that Broadcast has inserted a blank spaceat the start of the now offset second film.

Move the playback to the beginning and start it.You will note that the video on the lower track isalways played back completely, while the one lyingon top of it is only partly played back. This is becauseBroadcast stores the films as if they were in a stack –the same applies to the audio tracks. The sequencecan be altered via the menu items Tracks/Move tracksup or Move tracks down. In the first case all tracksfor which the record button is selected are moved upby one track, and in the second case they movedown. In this menu you can also delete tracks or addthem to each other (Concatenate tracks). For ourexample, make sure that the second film is locatedon a track below that of the first film (Figure 10).

The “console” is responsible for adding effects. Ifyou cannot see this, select Window/Show Console. Inthis you will find precisely one unit for each track withfour green buttons and a slider. Each of the fourbuttons can record one effect, which will be applied

Figure 7: The marked film area (white). Also note thedeselected recording button on the left side for video 1

Figure 8: By cutting and pasting, the second film has beenmoved into the track of the first film

Figure 9: The area marked white states which videos areaffected by the fade function from the menu. We arespecifying 25 images as the duration of the fade

Figure 10: For a morecomplex fade the second

film should be placedoffset with respect to the

first film

Page 52: linux magazine uk 20

FEATURE

56 LINUX MAGAZINE Issue 20 • 2001

to the whole track. Here is anexample: click in the Video 1area on the first button attop left and select Attach....Another window opens, fromwhich you can pick one ofthe effects on offer in theleft-hand list, e.g. Whirl. Clickon Attach to assign the effect

to the track and close the window via Do it. Withsome filters a settings window will now be displayed.Start playback in the main window in order to viewthe results of the effect. You can get rid of the effect

again by clicking in theconsole on the correspondingbutton and selecting Detachfrom the menu.

ConsolidationmeasuresEffects can thus be assignedto individual tracks with theaid of the console.Unfortunately this alwaysaffects the whole track andnot an individual area, whichis what we need for ourfade. We are going to

manage this with what seems at first glance to be asomewhat unusual trick: we divert the video materialonto a third track, on which there is a film which isexactly as long as our fade. Since we are laying the

third track right at thebottom, the fade will thenbe played back in place ofthe other two videos. For ourexample this looks asfollows: use Video/Add trackto create a new, blank track.Make sure that this track isbeneath all other video

tracks and that the recording button is selected onthis track only. Now mark the area in which the fadeis to take place (the area in which the videos overlap).

From the menu, select Video/Paste Transition. Awindow opens in which you can select an effect forthe fade. For our example select from the left-handlist BandWipe, click on Attach and then on Do it. Inthe main window the fade is marked as a green box.

If you were to start playback now, nothing wouldchange compared with the previous situation: theeffect which was laid on the new video track doesnot yet “know” which video material it should use.To tell it, click in the console on the first green button(top left) of the area belonging to the first video andselect Attach.... In the right-hand list mark the Video3 entry, click on Attach under this list and then on Doit (Figure 14). By doing this we are making the track

with the first video send its material to the Video 3track. The effect saved there can then produce thefade from the material received.

Project managementNow save the project via File/Save as.... Please notethat at this point, Broadcast is only saving thearrangement of tracks and/or effects, not the actualvideos. These remain in their original condition andcan also be used several times. Unfortunately this alsohas the drawback that the original films must alwaysstay in their positions on the hard drive.

To create a finished video from the arranged film,use the menu command File/Render. A windowopens which displays the same structure as thewindow shown when recording the video rawmaterial.

If you’ve made all the necessary settings (don’tforget to activate Render audio tracks and/or Rendervideo tracks), you just need to click on Make it so!,and Broadcast calculates the finished film. You canplay this back with an appropriate playback programon any computer. Please bear in mind that thiscomputing process may take quite some time.

Figure 11: The area markedwhite shows how long andat which point our morecomplex fade should occur

Figure 12: For thecomplex fade, selectBandWipe. By clickingon the Attach button,you assign the effect

Figure 13: The BandWipe fade isshown in the main window as asmall green box. It is the samelength as the previous whitemarking

Figure 14: With these settings, you are making track 1 sendthe material saved on it to track 3

Figure 15: This window appears whenrendering the finished video

Page 53: linux magazine uk 20

PROGRAMMING

57LINUX MAGAZINEIssue 20 • 2002

Perl: Part 2

THINKING IN LINE NOISE

Not as loopy as it soundsAll programming languages use flow controlstatements to influence the execution of code. Flowcontrol statements come in two varieties,‘conditional’ and ‘loops’; it may come as no surprisethat Perl has an abundance of each.

The simplest of the conditions is the if statement,which evaluates conditions and executes a branch ofcode dependent on the result.

if ($count == 10) {print “Count is 10\n”;

}

In this example we test to see if ‘$count’ has avalue of 10, if the condition is satisfied(i.e. $count does equal 10) the codeblock within the curly braces isrun, otherwise the code blockis skipped and programflow resumes after theclosing brace ofthe code block.

It is sometimes desirable to execute an alternativecode block if the condition is not met and for thiswe use else:

if ($count != 10) {print “Count is not ten...\n”;

}else {

print “Count is 10\n”;}

The above example tests the value of $count, if$count is not 10, then the message “Count is notten...” is printed and program control is returnedAFTER the last curly brace. If the condition is not met

then the code block defined after the elsestatement is executed,

and the message“Count is 10” is

printed.Making a

condition statementsimple to read is the best

way of ensuring that thelogic tests work as expected. It

is also worth consideringswapping the values in a test

condition where one is an immutablevalue, this means if you mistakenly

code an assignment operator rather thanthe numeric equality test (= instead of ==)

the code will return an error at compile time,rather than creating a time consuming bug.

if (10 == $count) {print “Count is 10\n”;

}else {

print “Count is not ten...\n”;}

Sometimes it is necessary to test for more than onecondition and take an action dependent upon thecondition that is successful. Perl permits this by usingthe elsif statement to test several operations

One of Perl’s tenets

is to make simple

tasks easy. With the

initial hurdle of Perl’s

extensive use of

sigils behind us,

Dean Wilson and

Frank Booth move on

to more practical

aspects of the

language; namely

conditions, looping

and files

Page 54: linux magazine uk 20

PROGRAMMING

58 LINUX MAGAZINE Issue 20 • 2002

expressions are evaluated, it’s not necessary, but itis good practice.

if ( ( exists($tb2{Virgil}) ) && ( $cliff_door eq ‘open’) ) {

print “Lift off!\n”;}

if ( ( exists($music{‘ominous shaky violins’})) ||

( $diary eq ‘Tracy family holiday’) ) {print “Warning, impending catastrophe with

few casualties\n”;}

In situations where the if/unless statement is used toperform a single task, and there is no else or elsifused, the code can be rewritten thus:

print “$count is not 10\n” unless $count == 10;

Note the brackets are not required around thecondition, and that there are no curly braces aroundthe code to be evaluated. This will only work for codethat executes one line of code and does not use elseor elsif (yes unless can use else and elsif too).

Looping structures enable programmers toeliminate a lot of the repeated functionality within aprogram. The most common looping structure is thefor loop, which comes in many guises.

for ($i=0; $i < 5; $i++) {print “The standard C like ‘for’

declaration\n”;}

@array = (1,2,3,4);

foreach $count (@array) {print “$count: To iterate over each item in

an array\n”;}

for $count (1..4) {print “$count: To iterate over a range

operator\n”;}

for (1..4) {print “$_: use \$_, the default variable\n”;

}

print “$_: use \$_, the default variable\n” for1..4;

Each of the above examples is a for loop, which willrepeat four times. It is a matter of preference whichmethod you prefer.

The first method is possibly obscure, if you are newto programming. Don’t worry, it’s only there to keepC programmers happy. The loop declaration is splitinto three parts, any of which may be empty. The firstsection initialises the variables for the loop – this is onthe first pass only so it is traditionally where variables

sequentially, note as soon as one set of conditions aresatisfied only the code block belonging to thatcondition will be executed and the remainingconditions will not be evaluated. else can be added atthe end of if and elsif statements as a catch-all that isexecuted when no other conditions are met.

$traffic_light = ‘blue’;

if (‘red’ == $traffic_light) {print “Stop!\n”;

}elsif (‘amber’ == $traffic_light) {

print “Lights about to go to red\n”;}elsif (‘flashing amber’ == $traffic_light) {

print “Proceed with caution\n”;}elsif (‘green’ == $traffic_light) {

print “Go\n”;}else {print “traffic lights are not

$traffic_light\n”;}

Boolean tests can sometimes become difficult tounderstand if they contain negatives. Perl providesthe condition operator unless to help reduce theconfusion. Compare these statements:

if ( !exists($valid{$user}) ) {print “Hey, you aren\’t allowed here!\n”;

}

# The same thing but easier to readunless ( exists($valid{$user}) ) {print “Hey, you aren’t allowed here!\n”;

The difference between the previous twoconditions may be slight as we’ve not yetencountered compound conditions, which dependon the outcome of a sequence of conditions. Eachcondition is connected by either an && or the ||. Ifan event depends on two conditions being met wecould use &&, in the example below I’ve usedbrackets to force the precedence in which

Don’t worry, it’s

only there tokeep the ‘C’

programmershappy

Page 55: linux magazine uk 20

PROGRAMMING

59LINUX MAGAZINEIssue 20 • 2002

are set to their start value. After the first semi-colonis the condition section, which holds the conditionsrequired to exit the loop. This is tested before eachiteration: if this was empty the loop would beinfinite, standard condition operators are used. Lastlythe modifier section is evaluated after the conditionsection is failed.

Using an array in a for or foreach loop (the twofunctions are interchangeable) is easy, just put thearray in parentheses and the loop will iterate overevery element of the array. A variable can bespecified to hold the current value from the array, orthe default variable ($_) can be used implicitly.

The last example shows that as with the if andunless statements, the syntax of the for statementcan be reversed if only a single action is desired. Therules for dropping the parenthesis and curly bracesare the same as for the if/unless given above.

The last commonly encountered loop is the whileloop. The while loop executes until its conditional testis no longer met.

$count = 0;

while ( $count++ < 4 ) {print “$_: again using a default variable\n”;

}

# This code won’t run as $count is 0 which is‘false’$count = 0;

while ( $count ) {print “$_: again using a default variable\n”;

}

$count = 3;print “$_: again using a default variable\n”while $count––;

There are additional, less used, control statementsthat will be introduced when their unique propertiesmake them applicable.

The truth is rarely pure and neversimpleCondition statements evaluate whatever they’re given,that is the contents of the brackets: variables, strings,numbers and functions. Throughout the discussion ofconditionals you may have noticed the references totruth and wondered what was considered to be ‘true’in Perl. To illustrate the value of truth we will usecomparison operators and some examples.Comparison operators are used to determine the

outcome of conditions. These consist of two types ofcomparison: ‘relational operators’ and ‘equalityoperators’, both compare two values and return anoutcome. The outcome of a comparison operation iscalled ‘true’ or ‘false’.In reality, as with most things, Perl has a wealth of

values to represent ‘true’ or ‘false’. Most things aretrue with the exception of ‘’,undef, \0, 0 and eof(end of file).In the example below it can be seen that the order

for equality operations is irrelevant. Put simply iteither is or isn’t equal.

$value = 4;

# Equality operatorsprint “the value is 4\n” if $value == 4:print “the value is 4\n” if 4 == $value;

For relational operations the value to the left of theoperator is the subject of the comparison, andwhether it is true or false depends upon itscomparison against the right-most value (comparator).

# Relational operatorsprint “the value is greater than 3\n” if $value> 3;

# This will not print as 3 is less than 4print “the value is less than 3\n” if $value <3;

Comparisonoperators

are used todetermine

the outcomeof conditions

String-wise comparisonsThese are the most commonly used comparison operators. The first operator oneach line is used for comparing strings; the second for numeric values.

Equality operatorseq, == True if the values are equalne, != True if the variables don’t match

Relational Operatorslt, < True if the value is less than the comparatorle, <= True if the value is less than or equal to the comparatorgt, > True if the value is greater than the comparatorge, >= True if the value is greater than or equal to the comparator

A simple aide-memoire is: string comparisons consist of letters.

Page 56: linux magazine uk 20

PROGRAMMING

60 LINUX MAGAZINE

Different operators are used to compare strings andnumbers. It’s vital to ensure the right type ofcomparison is used to avoid introducing subtle bugs.When run, the code below shows one way in whichthe wrong comparison may used.

$count = ‘1’;$result =’’;

if ( $count == 1.0 ) {$result =’It is’;

}else {

$result =’It is not’;}print “$result the same as the number 1.0\n”;

if ( $count eq ‘1.0’ ) {$result =’It is’;

}else {

$result =’It is not’;}print “$result the same as the string 1.0\n”;

Numeric comparisons compare the numeric part ofthe value to the numeric part of the comparator. It isperfectly valid to compare the numeric parts of valuesin this fashion.

print “There’ll be no green bottles\n” if$count < ‘1 Green Bottle’;

String comparisons act upon the entire value and usea comparison method called string-wisecomparison. String-wise comparisons use the ASCIIrepresentation for a character to determine whetherit is greater or lesser than the comparator. Anycharacter of a lower ASCII value than its comparatoris said to be greater than the comparator in a string-wise comparison. String comparisons don’t havemagnitudes as numbers do, so ‘byzantine’ is less than‘Roman’, this is because upper case characters occurearlier in ASCII representation.

IO, IO it’s off to work we goIn Unix everything is a file so file handling is a veryimportant part of any language using the Unixplatform. Perl has one of the most comprehensivesets of file manipulation commands. The mostcommon method of interacting with files is byopening a file and retaining what is called a ‘handle’to the file. A file handle is a way of referring to a filewhen you wish to read or write to it.

open (HANDLE, ‘>afile’);

print HANDLE “Hello\n”;

close HANDLE;

This example opens the file afile in the currentdirectory for output (clobbering the existing file ofthat name) it then prints the line “Hello\n” to the fileafile. After printing the line the file is closed and theprogram exits. While this is a simple example thesebasic principles hold true for most of Perl’s commonlyused IO functionality.

In the previous example we opened the file sowe could write out to it. The way we plan to use afile is used is determined by the redirection prefixbefore its name.

‘<’ Read from a file. This is the default if noprefix is given.‘>’ Over-write or create the file.‘>’ Create a file if none exists, append to a fileif it does.

Printing a line to a file is achieved by using the printfunction and specifying the file-handle to be used.The default file-handle is the standard output(STDOUT), usually the screen. The example belowillustrates this:

print STDOUT “I’m on the big screen!\n”;print “I’m on the big screen too!\n”;

When the program has finished executing the file-handle is implicitly closed. However it’s good practice toclose file-handles when you are done with them in casethe file-handle name is reused in the same program.

It’s vital to

ensure theright type

ofcomparisonis used to

avoidintroducing

subtle bugs

File testsCommon file tests include:–T True if file is a text file–e True if file exists–d True if file is directory–r True if file is readable–w True if file is writable.–x True if file is executable.

Issue 20 • 2002

Page 57: linux magazine uk 20

PROGRAMMING

61LINUX MAGAZINEIssue 20 • 2002

In the following example we read the contentsof a file using a while loop to read every line ofthe file. For every line it prints the line number andthe line.

open ( I, ‘<file’ ) || die “file: $!\n”;while (<I>) {

print “$. : $_”;}close I;

The first line of the example uses a common Perlidiom to test whether the open file operation issuccessful. If it fails then the die function is called,exiting the program with an error message definedin the same fashion as a print function and settingthe script’s return code. In the string passed to thedie function we also pass $!, another of Perl’sinternal variables. When used in string context, $!reports the system error string related to the lastcommand.

The $. is yet another of Perl’s internal variables andit contains the current line number of the file beingread. When we concatenate $. and $_ in the printstatement we iterate over every line in the file andprint both the line number and the contents of theline to the screen.

Before you open a file you often wish to determinesome of the attributes of the file (often you want toknow if it already exists) and to aid you in this Perloffers a large selection of file tests (Which are listedfully in perldoc perlfunc).

if (–T $file) {open ( I, ‘<file’ ) || die “file: $!\n”;while (<I>) {

print “$. : $_”;}close I;

}

The previous example has been modified so that weonly enumerate lines in a file if it is a text file;printing binary files to screen is seldom rewarding.

Now that we have covered files and determiningtheir type, let’s move on to a related topic,directories. In essence, working with directories issimilar to opening files:

opendir(DIRHANDLE, $dirpath) || die “Failed toopen current directory: $!\n”;@Files = readdir DIRHANDLE;closedir DIRHANDLE;

We start by calling opendir with the name of thedirectory handle we want to retain and thedirectory we want to open, as with the fileoperation open, opendir returns true if thedirectory was opened successfully. The array @Filesis populated with the name of each file in $dirpathby calling the function readdir. Filenames in @Files

do not have a full path, only the filename itself.Finally, the directory handle is closed. As withclosing file handles, this is done implicitly at theend of the script.

This example is a more practical demonstration ofreading directories:

opendir(CURRENT, “.”) || die “Failed to open current directory:

$!\n”;

@Files = readdir CURRENT;closedir CURRENT;

foreach $filename (@Files) {$linecount = 0;if (–T $filename) {open(TEXTFILE, “$filename”) || die “Failed

to open: $!\n”;while(<TEXTFILE>) {

$linecount++;}close TEXTFILE;print “$filename has $linecount lines.\n”;

}}

The example above illustrates all the principles inthis section. We start by trying to open the currentdirectory and assign it to the handle ‘CURRENT’, ifthis fails we exit the program and display thereason for failure. If everything is fine @Files ispopulated with the name of each file in thedirectory and the directory handle is closed. Theforeach loop is the main body of the program, ititerates through the array and each text-file (–T$filename determines this) the file is opened thenumber of lines it contains counted before closingthe file and printing the total. The line count is notreported if the file is not text or it can’t beopened. If the file cannot be opened we print thefailure message and exit the program. ■

Before you open

a file you oftenwish to

determinesome of the file

attributes

Page 58: linux magazine uk 20

C: Part 7

LANGUAGEOF THE ‘C’

PROGRAMMING

62 LINUX MAGAZINE Issue 20 • 2002

Table 1: ato* functionsFunction Return type Commentsatoi int This also supports the ‘e’ notation, which means the string ‘8e2’

will equate to 800 (8 x 102). However, it doesn’t support thedecimal point in any form, so 1.5e4 becomes 1, not 15000because it terminates at the dot.

atol long This functions as atoi. Under i386-based Linux machines, ints andlongs both use 4 bytes, so are functionally equivalent. However, ifyou are using longs you should use atol, as it describes moreaccurately what you what to do, and makes your code easier toport.

atof double Naturally, this has to accept the ‘.’ as a decimal point for numberslike 3.1415927. However, atof also permits its use with numberslike 1.5e4, which in this case does become 15000.

This month, C

programmer in

residence, Steven

Goodwin, looks at

library functions.

Where they are,

what they do, and

how to use them

One of the benefits of Open Source is that youdon’t have to re-build an entire car (re-inventing the wheel, chassis, engine and full

leather interiors in the process) if you only want to adda cup holder to your dashboard! Libraries perform asimilar function for the programmer. Most languagesare supplied with a set of standard libraries, and C isno different. Our library routines range from basicstring handling (like strcpy and strcmp) to a completequicksort implementation. We have already seen atof(which converts a string into a number), but there aremany others, some of which we shall cover here.

One to anotherWith all data processing applications there is aninput, a process and an output. It is extremely rare forthe data in each stage to be in the same format. Theinput might be a file containing text strings withnumbers; the processing might require floating point;

and the output may go to the screen as text.Converting from strings is done with the

ato* set of functions (see Table 1), for whichyou’ll need to include the stdlib.h header file.

These take a NUL (sometimes called NULL)terminated string and return a single value of a

specific type. There is a different function to returnintegers, floating point numbers and long integrals.Each function reads characters from the string until itfinds one it doesn’t like (a space or a letter, forexample), at which point it stops and returns thenumber it’s worked out so far.

As a side point, if you’re reading existing code, youmight also find an atoll function, which converts textinto a ‘long long’ (aka a QuadWord, or 8 bytes).Similarly, there are also functions like strtof, strtodand strtoq (meaning string to, as opposed to ASCIIto) for converting into floats, doubles andquadwords, respectively. All these functions exist inthe ISO 9x C standard.

Converting back from an integer into a string isquite straightforward. We’ve already seen how printfcan use a format specifier to take an int and output itas individual digits. So what we need is a functionidentical to printf, but which outputs into a string.Guess what? Someone’s already done it!

char szNumberAsText[32];

int iNumber;

sprintf(szNumberAsText, “%d”, iNumber);

Page 59: linux magazine uk 20

PROGRAMMING

63LINUX MAGAZINEIssue 20 • 2002

Listing 11 #include <stdio.h>

2

3 int main(int argc, char *argv[])

4 {

5 int iBigNumber = 76543, iBiggerNumber = U

98765, iBiggestNumber = 196608;

6 short iShorterVariable;

7

8 iShorterVariable = (short) iBigNumber;

9 printf(“(short) %d = %d\n”, iBigNumber,U

iShorterVariable);

10 iShorterVariable = (short) iBiggerNumber;

11 printf(“(short) %d = %d\n”, iBiggerNumber,U

iShorterVariable);

12 iShorterVariable = (short) iBiggestNumber;

13 printf(“(short) %d = %d\n “, U

iBiggestNumber, iShorterVariable);

14

15 return 0;

16 }

Listing 1: Output(short) 76543 = 11007

(short) 98765 = –32307

(short) 196608 = 0

Table 2: Effects of casting bitsLost by casting These are the 16 bits present in a short integer

131072 65536 32768 16384 8192 4096 2048 1024 512 256 128 64 32 16 8 4 2 176543 0 1 0 0 1 0 1 0 1 0 1 1 1 1 1 1 1 198765 0 1 1 0 0 0 0 0 0 1 1 1 0 0 1 1 0 1

1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0196608

As always, make sure you declare a string variablewith enough space to take the largest possibleoutcome. For those of you old enough to rememberBASIC, this is as close to STR$ as C gets.

Beat mamaConverting between variables (such as int and long) isdone through type casting. Here, the compiler looksat the source variable and works out how to storethe same value in the destination variable. Thecompiler will do this automatically when assigningbetween types as an implicit cast. To reducemisunderstandings (and compiler warnings) it isbetter to always use an explicit cast. Casting uses thebracketed type notation we’ve used before:

int iInteger=2002;

short iShort;

iShort = (short)iInteger;

Some conversions cannot work, such as casting astructure into an integer, and some work but withside effects. The latter occurs when one variable (sayan int) is being cast into another (a short) which hasfewer bits in which to store the result.

Listing 1: An explanationAlthough the results may appear unpredictable, theyare not. ‘The casting takes the least significant bitsand copies them.’ as it can from the int to the short,16 in our case. In the first example, 76543, thisequates to 11007 because the difference (65536) isstored in bits above the first 16. This is best visualisedby writing out the number as if it were binary, (seeTable 2).

The same effect can be seen with the lastexample (where 196608 becomes 0). The secondexample, however, has extra bit. Because the shortvariable is signed, the most significant bit (the16th, 32768 one) actually represents minus 32768,producing:

–32768+256+128+64+8+4+1 = –32307

It is possible to check whether a particular numberwill lose precision before casting, but is easier (andgenerally quicker) to cast, cast back and see if thenumbers still match! However, casting betweenintegral types is not something you should do as amatter of course as it produces bugs, induced by thisproblem.

Finally, when casting a float into any integraltype (char, short, int or long) you will loseprecision since the numbers after the decimal pointcannot be stored. Floats are simply truncated,rounding down to the nearest whole number (anoft-used trick). It does this with special code(usually a specific CPU instruction), becausefloating point numbers are stored in IEEE format,not the binary one above. However, once in anintegral format the numbers are subjected to thesame casting rules as above.

Anywhere isOne of the simplest input validating functions youmight write for yourself is ‘IsADigit’, which simplytells you if the character you’ve read in is a digit, ornot. You’d probably write something like this:

The casting

takes theleast

significantbits andcopies them

Page 60: linux magazine uk 20

PROGRAMMING

64 LINUX MAGAZINE Issue 20 • 2002

Table 3: Some ctype.h functionsFunction Comments Successful cases

isupper Upper case letters A-Zislower Lower case letters a-zisalpha All alphabetic characters A-Z, a-zisalnum An alphabetic, or

numeric character A-Z, a-z, 0-9isdigit A decimal digit 0-9isxdigit A hexadecimal digit 0-9, a-f, A-Fisprint Any printable character Most ASCII codes 32-127isspace Whitespace character tab, newline, return & spaceispunct Standard punctuation !, “, #, $, %, &, ‘, etciscntrl Any control code All ASCII code before 32, & after 127isgraph Graphical character All ASCII from 33 to 126 inclusive.

Table 4: More ctype.h functions

Function Comments

toupper Converts a letter from lower case toits upper case equivalent. Non-alphabetic characters remainunchanged.

tolower Converts a letter from upper case toits lower case equivalent. Non-alphabetic characters remainunchanged.

int IsADigit(char c)

{

if (c >= ‘0’ && c <= ‘9’)

return 1;

else

return 0;

}

I will not fault you for it. However, there is a set offunctions that do this already and a lot more besides(see Table 3). Each function below takes a singlecharacter, and returns 0 for failure, and non-0 forsuccess. You must include ctype.h to use them.

The implementation for this is quite interesting,and explains why each returns non-0, as opposed to1. Instead of 11 functions (the GNU extensionsfeature isblank, not covered here) there is one array.Each element in that array refers to a singlecharacter; the contents refer to a set of flags. Theseflags, “isupper”, “islower” and so on, can bechecked individually (with a single bitwise and)eliminating the need for function calls, if statementsand other processor-wasting instructions!

The same idea is used for two other usefulfunctions, also from ctype.h (see Table 4). Thesefunctions actually take an int (not a char) and returnan int (not a char)! This usually has no impact onyour code; it is to allow code like toupper(EOF) toreturn EOF on a system with unsigned chars (whereEOF, being -1, doesn’t fit).

char szName[128], *pName;

int bWasLastWhiteSpace = 1;

strcpy(szName, “capitalise all initial

letters”);

pName = szName;

while(*pName)

{

if (bWasLastWhiteSpace)

*pName = toupper(*pName);

bWasLastWhiteSpace = isspace(*pName);

pName++;

}

3am eternalTime is a many fingered creature: a stealer of days, aravager of youth... and a function in C that returnsthe number of seconds since the January 1 1970!This base function is the root of many others that willwork out the date, day of the week and year. This,and all other time related functions mentioned hererequire the time.h header to be included.

time_t iCurrentTime;

iCurrentTime = time(NULL); /* method 1

*/

time(&iCurrentTime); /* method 2 */

Two points here. The first is that the time functionuses its own type, time_t. It is, however, a disguisedlong integer, so you can add 60 to it to get the time

Time is a manyfingered

creature: astealer of

days, aravager of

youth

Continued...

...continued

Page 61: linux magazine uk 20

PROGRAMMING

65LINUX MAGAZINEIssue 20 • 2002

Table 5: tm structureElement Explanation Comment

tm_sec Secondstm_min Minutestm_hour Hours In 24 hour clock.tm_mday Day of the month The 3rd of February would return 3, heretm_mon Month of the year 0=January, 1=February, etc.tm_year Year Counted from 1900. So 2002 is 102.tm_wday Day of the week 0=Sunday, 1=Monday, etc.tm_yday Day of the year 0=January 1st, 1=Jan 2nd, etc.tm_isdst Is daylight savings time Can be -1, 0 or 1.tm_gmtoff Seconds east of GMT

(a.k.a. UTC) Stored as a long, not an int.tm_zone Time zone description A text string, not an int.

Note: pEasyReadTime refers to some private data of the localtime function. This data gets (re-)written uponeach call to localtime. Therefore, you should copy this data to a local variable if you do not intend to use itimmediately after retrieving it.

Table 6: Time specifiersFormat Output

%a Name of day, abbreviated. Sun, Mon, etc.%A Name of day, in full. Sunday, Monday, etc.%b Name of month, abbreviated. Jan, Feb, etc.%B Name of month, in full. January, February, etc.%T The time in 24 hour format (HH:MM:SS)%Y The year, in full. 2000, 2001, 2002.

Listing 21 #include <stdio.h>

2 #include <stdlib.h> /* this is where U

rand() lives */

3

4 int main(int argc, char *argv[])

5 {

6 int i;

7

8 for(i=0;i<10;i++)

9 printf(“%d “, rand()/(RAND_MAX/100 +

1));

10

11 return 0;

12 }

after one minute. Secondly, both instances of thefunction are identical. It returns the same number asit assigns to the pointer (if supplied). So usewhichever is suitable for your purposes.

Once we have this ‘time_t’ number we can pass itto other functions to make it more user friendly.

time_t iCurrentTime;

struct tm *pEasyReadTime;

iCurrentTime = time(NULL);

pEasyReadTime = localtime(&iCurrentTime);

printf(“The current time is %.2d : %.2d \n”,

pEasyReadTime->tm_hour, pEasyReadTime->tm_min);

The tm structure has a number of useful elements,which can be seen in Table 5.

To make this the date even more readable, itwould be nice to retrieve the names of the month,

or the day. This is amply supported with thestrftime function.

char szTimeString[64];

strftime(szTimeString, 64, “It’s %A

today!!”, pt);

This function works like an sprintf, formatting the textstring given into the variable szTimeString. However,strftime has a special set of specifiers, specific to time.These are the same as those used to set the time usingthe date command (type date –help at the shell for acomplete list). Table 6 has a brief list.The second parameter (64) is the maximum number ofcharacters to write (including the NUL terminator). Ifthe formatted string would exceed this number, nostring is written, and the function returns 0. Otherwise,it returns the number of characters written.

Against all oddsAt some point in your life you’ll need a randomnumber generator and at that point, you’ll need touse rand. This function attempts to defy logic –persuading a completely rigid, logical, structuredsystem to produce an arbitrary number without any

Page 62: linux magazine uk 20

PROGRAMMING

66 LINUX MAGAZINE Issue 20 • 2002

Listing 31 #include <stdio.h>

2 #include <stdlib.h>

3

4 struct sTempElement {

5 float fTemp;

6 int iHour;

7 };

8

9 int qs_CompareTemp(const void *p1, const

void *p2)

10 {

11 struct sTempElement *pT1 = (struct

sTempElement *)p1;

12 struct sTempElement *pT2 = (struct

sTempElement *)p2;

13

14 if (pT2->fTemp < pT1->fTemp) return -1;

15 if (pT2->fTemp > pT1->fTemp) return 1;

16 return 0;

17 }

18

19 int main(int argc, char *argv[])

20 {

21 struct sTempElement TempEachHour[24] = {

22 {20,0}, {18,1}, {17,2}, {16,3}, {15,4},

{17,5}, {18,6}, {19,7},

23 {20,8}, {21,9}, {22,10}, {23,11}, {24,12},

{25,13}, {26,14},

24 {27,15}, {28,16}, {29,17}, {27,18},

{26,19}, {25,20}, {24,21},

25 {23,22}, {22,23},

26 };

27 int i;

28

29 qsort(&TempEachHour[0], 24, sizeof(struct

sTempElement), qs_CompareTemp);

30

31 printf(“Hottest Temperatures Today\n”);

32

33 for(i=0;i<24;i++)

34 printf(“#%.2d : %.1f Centigrade at

%.2d:00\n”, i, TempEachHour[i].fTemp,

TempEachHour[i].iHour);

35

36 return 0;

37 }

patterns. It is a difficult mathematical problem, sothankfully it’s included in the standard libraries.

The function, rand(), produces a random numberbetween 0 and 2,147,483,647, which, for ease of useis defined as RAND_MAX. It is more useful, however, tolimit this range to something with only 10 possibilities,say. Taking the modulus of rand() is highly unrandom(try it and see!), but it can be used effectively thus:

int iRandomNumber;

iRandomNumber = rand() / (RAND_MAX/10 + 1);

This produces numbers between 0 and 9, and is agood second step. I said second step for a reason. Trywriting a program that prints 10 random numbersbetween 0 and 99. For an example see Listing 2.

Run the program and note down the numbers. Forexample, ‘84 39 78 79 91 19 33 76 27 55’. Now runit again and look for any similarities between bothsets of numbers. Confused?

The random numbers, as supplied, are not randomsince they work through the same algorithm in bothcases, starting from a given seed. In order to producea different set of random numbers, we must changethe seed. You can seed the generator with:

srand(0);

However, any constant number will produce the samesequence of numbers, and you can’t seed srand with

a random number (since that’s already beendetermined from the last seed), so what do you do?

Cheat! Have a look at the time! If we use theinclude file time.h, we have access to a functioncalled time, which returns the number of secondssince January 1 1970.

srand(time(0));

That should be random enough for most software.There is one annoying side effect with time seeding,which is that some bugs will only occur with aspecific random sequence. In order to repeat thissequence we can store the result from time(0), anduse it explicitly next time round.

Two divided by zero

The maths library is the only one I’m mentioning herethat requires more than a simple #include <math.h>line – you must also link in the maths library, meaningyou should compile with the –lm option, thus:

gcc mathsprogram.c –lm

There’s a complete set of maths functions, like sin,cos and tan, along with their inverse (asin, acos andatan) and hyperbolic versions (sinh, cosh, and tanh).Each requires the angles to be given in radians as adouble (not a float), and within the correct range(where appropriate). There are also functions like abs

Page 63: linux magazine uk 20

PROGRAMMING

67LINUX MAGAZINEIssue 20 • 2002

you should return -1. If the second appears later,return 1, or if they are identical, return 0 (see theqsort shortcut boxout).

You can actually check any number of criteria youwish. For example, if two temperatures are the same,you could use the time of day as a tie-breaker. In thisexample we are sorting our array for hottesttemperatures. We could sort for coldest by simplyswapping the sign of the return variable.

Lines 21-26 we’ve seen before, while 31-34 issimple code we could probably write in our sleepby now. Line 29, however, is the start ofsomething good!

The parameters of our beloved qsort function are(in order): the pointer to the first element in the arrayto sort, the number of elements in the array, the sizeof each element and finally the callback functiondeclared above. qsort returns when theTempEachHour array has been sorted, element 0holding the ‘greatest’ value; according to our rules inqs_CompareTemp.

Finally, we output our results the screen and marvelat a good project, well done!

The authorSteven Goodwin celebrated(really!) 10 years of Cprogramming last year.Over that time he’s writtencompilers, emulators,quantum superpositionsand four publishedcomputer games.

qsort shortcut(to find the absolute value; ignoring any sign), sqrt(square root of a positive number) and log (fornatural logarithms).

double fAngle, fTheta;

fTheta = M_PI * 180; /* 180 degrees,

converted to radians */

fAngle = sin(fTheta);

printf(“sine(%f) = %f\n”, tTheta, fAngle);

You also get access to a number of mathematicalconstants, such as M_PI, M_LN2 and M_LOG10E.Sneaking a peak into /usr/include/math.h will giveyou full details of these macros and the abovefunctions. A decent maths book will give you fulldetails of how to use them!

Sorted for E’s and WhizzFinally, something that will prevent an army of re-invented wheels – quicksort! The C language includesa fast, flexible version of quicksort that you can useto sort any array based on specific criteria designedby the programmer. To do this, qsort (as it is called)knows nothing about your data; it ‘simply’ shufflesyour data around in memory according the rules laiddown by the quicksort algorithm.

Lines 4-6 define the structure for sorting. We’reincluding the time here because qsort sorts the entirestructure. Meaning we might know that the warmestpoint in the day was 29 degrees centigrade, but notwhat time it was. We knew that informationpreviously only because of its position in the array.Once the data is sorted, its order is lost, so we needto store this information explicitly.

The magic works with lines 9 to 17. This is thecallback function (first introduced in part 4) that qsortuses to arrange each entry. Because qsort can neverknow every type of structure you might want to use,it refers to each element as an anonymous block ofmemory. It does this by using a void * (pronounced‘void pointer’), which describes a pointer, but withoutdescribing which particular type of data is at thatmemory location. The word ‘const’ tells the compiler(and the programmer) that the data to which p1points cannot change (i.e. it remains constant) whilstin the function. We will cover this more fully later.

Lines 11 & 12 perform some type casting, allowingus to refer to the individual elements within thestructure. Casting pointers is the same as casting anyother type, it just looks a little less pretty. pT1 andpT2 can now refer to structures directly, whereas void* can’t because it doesn’t (by definition) point to anyspecific type, and therefore has no knowledge ofhow to reference it.

The callback function required by qsort shouldreturn one of three values, –1, 1 or 0. If, of the twoelements given, the first belongs sooner in the list

In the example given here, I’ve written the codeexplicitly returning –1, 0 or 1. In realityhowever, qsort considers any negative numberto be equivalent to –1, and all positive numbersto be 1. So, in some cases it is possible towrite:

return pT2->iTemp – pT1->iTemp;

In some cases though. Not this one! Why?Because we’re using floats and would haveto cast the result to an integer. This inturn will cause precision errors in ourdata. How? Well, imagine if fTemp1 was12.4, and fTemp2 was 12.2, ourexpression would evaluate to 0.2. This inturn would get truncated to 0 (as we arecasting to an integral value). qsort wouldbelieve them to be equal and continueshuffling data accordingly – certainly not whatwe intended!

If your memory stretches back to part threeyou might remember the strcmp function. Itcompares two strings. If the first string is ‘lessthan’ (i.e. first in the alphabet), it returns –1,and if it is greater (i.e. later), it returns 1. Equalstrings return 0. It’s more than a coincidence Ibring this point to bear at this time! The strcmpfunction is neatly moulded to make sortingstrings very easy. I hope that shortcut saves youre-inventing another wheel!

Page 64: linux magazine uk 20

PROGRAMMING

68 LINUX MAGAZINE

Processing XML documents withTcl and tDOM

FREEDOM

Issue 20 • 2002

Table 1: Document commandsCommand Description

documentElement Returns the root elementcreateElement tagname Creates an element called tagnamecreateTextNode text Creates a text elementcreateCommentText text Creates a commentcreateCDATASection data Creates a CDATA elementcreateProcessingInstruction data Creates a PI element

There’s nothing to

stop Tcl programmers

from processing XML

files with their own

software. Carsten

Zerbst takes a look

at the tDOM

package, which

provides a fast,

streamlined DOM

implementation

XML is fast becoming the lingua franca of fileformats. If you want to use XML withinyour own programs there is no need to

write a parser, as many ready-made solutions areavailable for this purpose, not least for Tcl, whichoffers extensions enabling you to access XMLdocument elements. One of these is tDOM, apackage that is not only powerful but alsounusually lean and fast.

Access to the actual parser is usually via one oftwo types of API. With SAX (Simple API for XML)the parser reads the data and executes commandsas soon as it reaches certain points in the text,even if it has not finished loading the document. Inother words, this is an event-driven API. Thealternative to SAX is DOM (Document ObjectModel). Here, the parser loads the completedocument into memory first and stores itsstructural details in a tree structure. DOM offersmore powerful document retrieval and editingfacilities than SAX. This flexibility comes at theprice of greater memory usage.

Implementations of this API are available invarious programming languages, for example Cand Java. The DOM API basically uses threedifferent classes: one for creating documents, onefor the documents themselves and one class forthe different elements. The idea behind DOM isthat it uses element objects to represent each XMLtag, all attributes and every text section. Theelements have methods that enable them to inheritelements located above, below and next to them.Other methods provide information about theelement.

DOM and XPath in a singlepackageThe two main DOM packages available under Tcl areSteve Ball’s TclDOM and Jochen Löwers tDOM. In thefollowing examples we are using tDOM; this packagehas an impressive functionality range and is very fast.Apart from the DOM specification it contains otheruseful things, such as an XPath implementation and agraphical query tool.

Compiling and installing tDOM is pretty simple:unpack the sources, change to the unix sub-directoryand perform the usual routine (configure, make,make install).

tDOM in actionThe dom command in tDOM creates new documents.dom parse string instructs the package to analyse astring of XML data and to create an XML documentobject from it. New empty documents are createdusing dom createDocument name.

You will frequently come across files which at firstglance appear as though they should be easy toprocess with DOM, but are not pure XML; HTMLbeing a case in point. There is a solution to this. Theoption -html allows tDOM to read many HTML pageswithout requiring any manual intervention.

The tDOM syntax is object-oriented in a similar wayto Tk. The dom command’s return value is a domDocclass object representing the entire document.

% set fd [open filename]% set doc [dom parse [read $fd]]% close $fd

Although this looks simple, it does in fact involve alot of work. The raw data needs to be turned into adata structure with XML tags and attributes. tDOMdoes a pretty quick job of this. On a computer witha Duron processor (800 MHz, 512 Mb RAM) thenormal parser takes only 80 milliseconds to readthe 370Kb Mondial database. The Tcl interpreterand the XML document together take up a mere2.5Mb of memory. By comparison, Java and JDomrequire 1900 milliseconds for the first read and 500milliseconds for each subsequent read on the same

Page 65: linux magazine uk 20

PROGRAMMING

69LINUX MAGAZINEIssue 20 • 2002

address the third element specifically use//TYPENAME[3]. As the query may contain squarebrackets, these must be protected in Tcl (either withbackslashes or curly brackets). Table 3 shows someexamples of XPath queries.

To get a quick overview of the XPath features,Jochen Löwer has written the xe tool, which displaysthe results of XPath queries in graphical format. Theinterface takes a bit of getting used to: the query istyped into to the upper window, highlighted with themouse and submitted with the execute <sel.> button.The xe input consists of the desired file followed bythe XPath query. xe displays the result, including childnodes, in the lower window, the branches of the treecan be expanded using the + symbol (see Figure 1).

Web-grabbingXPath also makes Web-grabbing (the extraction ofdata from HTML files) very easy. The followingexample uses the BBC sports news ticker, from whichwe are going to read a news item. The lastinstalment of this series described how Tcl loads Webpages from the Internet. Here, we are concentratingon processing their HTML contents.

As soon as the page is available, we want tDOM toretrieve the summary of the latest news item and the

Table 2: Element commandsCommand Description

ownerDocument Returns a reference to the document containingthe element

Single nodenodeName Returns the name of the nodenodeType Type of node, e.g. element or attributenodeValue Node content for text nodesAttributesattributes Lists attributesgetAttribute attrName Retrieves single attribute@attrName Short for getAttributesetAttribute attrName attrValue Sets attributeChild nodesparentNode Returns the node one level above in the treechildNodes Lists all child nodesappendChild child Appends element as child nodereplaceChild old new Replaces child elementremoveChild child Deletes child elementgetElementsByTagName Searches the entire sub-tree for elements with a

specific nameXPointerdescendant count type Descendant elements by position and typedescendant all type Descendant elements by typeXPathselectNode query XPath queryOutputting the DOM treeasXML Outputs sub-tree as XMLasHTML Outputs sub-tree as HTML

machine, with the JVM taking up 15Mb of residentmemory.

The tDOM package uses James Clark’s Expat parserand therefore supports Unicode, as is normal for Tcl.However, as technical data, for example, often doesnot require Unicode the ISO-Latin-1 character set willin many cases be sufficient. tDOM contains a second,faster parser for this eventuality, which can beselected using the –simple option. The data nowtakes only 45 milliseconds to read.

The memory requirement also depends on the sizeof the original file. tDOM needs about double to fourtimes the size of the original file, other solutions in Cand Java require up to 30 times.

Step by stepOnce the document has been read, the domcommand returns a domDoc object. Using thiselement’s sub-commands, various element types canbe created or the root element retrieved (see Table 1).The root element represents the top node, like the<html> tag in an HTML document. The type of theroot node is domNode, the same as that of any otherDOM element.

The most important commands for the (domNode)elements are listed in Table 2. Using thesecommands, the program can navigate through thebranches of the DOM tree and retrieve theinformation it contains.

Creating new elements is a little more complicated.The DOM uses a two-step process. First, a documentcommand creates a new element, for instancecreateTextNode creates a new element of the typeTEXT_NODE. In the second step, this is appended toan element of the tree.

% set doc [dom createDocument html]% set root [$doc documentElement]% set node [$doc createTextNode “Hello”]% $root appendChild $node% puts [$root asHTML]

<html>Hello</html>

To the pointThe commands mentioned up to now are prettymuch part of the normal DOM environment butrather unwieldy for addressing XML elements. Shouldyou require the first td in the third table element withan attribute setting of rowspan=2 this will need quitea bit of work. Fortunately there is a far more elegantway in tDOM. The magic word is XPath, whichenables you to search for nodes using a handy querylanguage. This is another W3C specification.

The command selectNodes query can search thesub-tree starting at any node within a document.Depending on the type of query the results arenodes, attributes or their values. To search for allelements of a particular type, use //TYPENAME. To

Page 66: linux magazine uk 20

PROGRAMMING

70 LINUX MAGAZINE Issue 20 • 2002

reference to the complete story. But which element isthe right one? We could either use xe and keeptrying until the desired result appears, or we couldget some help from Mozilla. If you press the rightmouse button over the relevant text and selectInspect from the context menu a new window opens,displaying the DOM viewer (Figure 1 and 2). You canalso reach the DOM inspector via Tasks/Tools/DOMInspector in the SuSE 7.3 supplied Mozilla

A simple count is sufficient in this case. The latesttext is in the seventh table, in the second line, in thesecond column, within a <a href=””> element. It isadvisable to save this page and design the relevantquery in xe. Now you have all the informationrequired for writing Listing 1. This calls the page andextracts the news item using tDOM. The script can beeasily extended, for instance to load the full versionof the news item.

tDOM, the universal XML toolSimple DOM, parser extensions and XPath are by nomeans all that tDOM offers. Recently tDOM has alsolearnt XSLT, confirming its position as the XMLequivalent of the Swiss army knife. XSLT support isalmost complete in the current version 0.7test, andDOM 2 with name spaces is also supported.

Should you be interested in finding out more aboutthe development of tDOM or have specific questionsyou will get to appreciate the tDOM mailing list.Overall, tDOM is a solid base for XML processing.

Table 3: XPATH examplesQuery Description

/option The option element directly below the root node//option All elements in the document called option//option[3] The third option element/table/* All elements below table, where table must be located

directly below the root node//table[1] The first table element in a document//table[last()] The last table element//@colspan All colspan attributes in a document//td[@colspan] All td elements with the attribute colspan//table[@width] All table elements that have a width attribute//table[@width=690] All table elements with a width attribute that has a

value of 690//*[count(tr)=2] All elements with two tr child nodes//tr/td|th All td and th elements contained within a tr element//table//img All img elements contained within a table–element//table[1]//img[2] Second img element in the first table

Figure 1: The BBC sports newspages in a Web browser. TheDOM tree can be displayed viathe context menu, with theselected element on the HTMLpage also highlighted in theDOM viewer

Figure 2: Mozilla shows the document’s DOMstructure. The A element is selected in the lefttree view; on the right the DOM inspector showsthe href attribute with its value (a relative link).

Listing 1: Web-grabbingwith tDOM#!/bin/sh## \exec tclsh8.3 $0 $@

package require tdompackage require http

set server “http://news.bbc.co.uk” set path “sport/”set url “$server/$path”

if {[catch {http::geturl $url –timeout 15000} Utoken]} {

puts stderr “Problem with network: $token”exit 1

}

if {[http::ncode $token] != 200} {puts stderr “Problem with server, U

[http::code $token]”exit 1

}

set doc [dom parse –html [::http::data $token]]set root [$doc documentElement]set node [$root selectNodes U{//table[7]/tr[2]/td[2]/a}]set text [[$node childNode] nodeValue]

puts “Latest news: $text”

InfoTclDOMhttp://tclxml.sourceforge.net/tcldom.htmlTDOMhttp://sdf.lonestar.org/~loewerj/tdom.cgi

Page 67: linux magazine uk 20

BEGINNERS

72 LINUX MAGAZINE Issue 20 • 2002

Dr. LinuxComplicated organisms, which is just what Linuxsystems are, have some little complaints all oftheir own. Dr. Linux observes the patients in theLinux newsgroups, issues prescriptions here forthe latest problems and proposes alternativehealing methods.

Shell/bash The“mediator program”,which accepts yourcommands, processesthem and finally passesthem to the kernel forexecution. Under Unixoperating systems youcan choose betweendiverse shells withvarying functionality andoperating philosophies.As a rule, on Linuxsystems the bash(“Bourne Again SHell”)is used as the standardshell, but other shellssuch as the csh (“C-Shell”) and/or the tcsh(an extended C-shellwith the option ofediting the commandline) are also frequentlyinstalled.

Dr. Linux

TEST CASE

get to know my system better so that I know whatkind of command I have just put in. How do I do this?

Dr. Linux: With the shell function type plus thecommand name, you can see the origin of yourselected program:

perle@maxi:~> type suspendsuspend is a shell builtin

suspend is thus a built-in command of the shell,while...

perle@maxi:~> type dirdir is aliased to ‘ls -l’

... dir is an alias for the command ls -l.

perle@maxi:~> type gimpgimp is /usr/bin/gimp

Do you want to find

out what lies behind

a command or who

has just logged on?

Marianne Wacholz

shows how all this

can be tested with a

few inputs on the

keyboard

Stop root!

QI like to interrupt programs, which I start on ashell, with the key combination Ctrl+Z, in order

to execute other commands in the meantime.Unfortunately this doesn’t work when I edit/configurefiles using su as root. Is there any other command totemporarily deactivate the root shell created by suand to bring it back again later?

Dr. Linux: There is indeed and the command issuspend, which is entered in the bash (or csh/tcsh).suspend is a so-called shell built-in, meaning it is acommand forming part of the scope of performanceof the respective shell. It interrupts the superusermessage with su in the same way as the keycombination Ctrl+Z does with normalprograms/processes, i.e. the root shell is put to sleepand instead you get back your original shell, onwhich you can carry out new commands completelyas normal. First you will see the output Stoppedfollowed by which command has just been stopped:

perle@maxi:~> suPassword: your_root passwordmaxi:/home/perle # suspend[1]+Stopped superle@maxi:~> [input tasks to be performed asPerle user]

To get back to the root shell, enter the command fg(foreground). You leave this in the usual way with thecommand exit:

perle@maxi:~> fgsumaxi:/home/perle # [other commands to beexecuted as root]maxi:/home/perle # exitexitperle@maxi:~>

Knowing what you’re doing

QI start programs on a console by typing in theirnames. But basically, I’m often not clear as to

whether this is a proper, compiled program or forexample a shell script that I’m dealing with. I’d like to

Page 68: linux magazine uk 20

BEGINNERS

73LINUX MAGAZINEIssue 20 • 2002

Alias A new name orelse an abbreviation fora self-definedcommand. You can findout which aliascommands in yoursystem are “pre-defined” if you enterthe command “alias”with no further detailsin the bash.

Hash table: If acommand is executed ina bash, then the shellremembers thiscommand in the formof the path specificationand saves it in the so-called Hash table. If youstart the same programagain, the bash readsthe path specificationfrom the Hash table,instead of first foragingthrough the entiresearch path for thecorrespondingexecutable file. Thisspeeds up the executionof the command.

Variable Manyfunctions in the bash(and thus the wholesystem) are controlledby variables. User-defined and systemvariables can bemodified at any time forthe current shell. On theother hand the user hasread-only access to theso-called “specialvariables”. Thecommand set will tellyou which variables areset in the system (inaddition to otherinformation such as onshell functions) on theoutput screen.

su This command enables you to change to adifferent user ID on the command line. When youdo this, a new shell with the user identification ofthe user specified as argument is created. If thelatter is missing, it allows su to work for a shortperiod as superuser root. Provided you are notalready logged on as root, you will need thepassword for the selected user. You can drop thenew identity again by entering the command“exit” on the command line.

If on the other hand, as in the case of gimp, this is areal file (or a link) in the filesystem, you can researchmore deeply with the command file. In the samesimple way as using type, this identifies anyunknown file types. For example, this means we canfind out that /usr/bin/gimp is a proper binaryprogram, while the command groups is anexecutable shell script:

perle@maxi:~> file /usr/bin/gimp/usr/bin/gimp: ELF 32-bit LSB executable, Intel80386, version 1,dynamically linked (uses shared libs), notstrippedperle@maxi:~> file /usr/bin/groups/usr/bin/groups: Bourne shell script text

When file cannot tell what kind of file a given entry is(or if the file must not be displayed), you will receivein the output the keyword “data”. Separate detailsare provided by type with the output:

command is hashed (Path/to/command)

This means that the corresponding command hasalready been executed in the current session and hastherefore been stored by the bash in the Hash table:

perle@maxi:~> type gimpgimp is hashed (/usr/bin/gimp)

Checked out

QAlthough I do have a bit of experience alreadywith my Linux system, it sometimes happens

that I edit a file in an editor, but when I come to savemy work I discover that I have no write privilege forit. Is there a neat little command, with which I canquery rights in advance, without searching throughthe long directory lists created by ls –l?

Dr. Linux: The command with which you can getrapid and specific information about a file ordirectory is called simply test and is a shell built-in. Itis called up as follows:

test –option filename_or_directoryname

This is how you check, with the following example,whether you have writing rights with your currentidentity (–w stands for write) for the file /etc/fstab:

perle@maxi:~> test –w /etc/fstab

Anyone who is now perplexed and wondering wheretest displays the test result, will probably bedisappointed by the answer: it doesn’t. This built-in isin fact designed to be able to formulate conditions inshell scripts along the lines of “If the writing rightsfor /etc/fstab match, then execute the following”,and hence one needs no verbal outputs on thestandard output. On the other hand, the return valueof the command is interesting.

This is saved for the last respective command in theVariable $?. If it contains the value 0, then the testwas successful; so it is possible to modify the contentof the file. But if the command writes echo $?, withwhich one outputs the content ($) of the variable ?on the command line, a value not equal to 0 on thescreen, then the test was not successful; ergo thereare no writing rights for the corresponding file. Thissounds much more complicated than it is though,just look at the two steps on the command line:

perle@maxi:~> test –w /etc/fstabperle@maxi:~> echo $?1

The output 1 is quite definitely not equal to 0; whichmeans that the user making the query has no writeprivileges for the file with the Filesystem Table.

Further useful options of test are:

● -d: Is the argument file a directory (“directory”)?● -e: Does the file even Exist?● -r: Can I read it?

Queries with test are, by the way, always processedin the following sequence: if you are the owner ofthe file, test checks the rights of the file owner. Fornon-owners on the other hand the built-in firstevaluates the group rights, then the rights for the so-called “rest of the world”. If you want to know moreabout test, call up the corresponding documentationwith man test and/or info test.

Who’s there?

QIn which file can I find details on who haslogged on?

Dr. Linux: Basically, on every Linux system, data iscollected on the system start and the log-in activitiesof the users are kept in various databanks and logfiles. So there is no general answer to this question.Two commands which are simple to use are last andlastlog.

Page 69: linux magazine uk 20

BEGINNERS

74 0LINUX MAGAZINE Issue 20 • 2002

a command line. You will get a multi-column table,which is relatively simple to understand (Listing 1). Inthe first column, you will see the user name (“Who islogged in?”). Details of the terminal in use (tty,terminal type), the host to be used for remote log-ins(From), the date and the time (“Logged on sincewhen?”) and finally the total duration of the log-insession follow. At the bottom of the table you willfind information telling you since when log-ins havebeen being recorded in this file: Usually the systemcaptures and archives /var/log/wtmp from time totime, so that the file does not get too big.

Just as simple and clear is the output of lastlog.Here all the users the system has recorded areincluded in the output. From the point of view ofsecurity special users generated by the system usuallyhave no home directory and are not even allowed tolog in directly. This is the case, for example, with thegames user. Because he has never logged onto thesystem as user, in the column headed “Latest log-in”(Latest) there is the short but sweet comment**Never logged in**.***

You can get your own information from the file/var/log/wtmp, which stores details of successful log-ins and log-outs by system users. But if you try tolook at this file using an editor, you will see nothingbut confusing symbols (see Figure 1).

To coax out your details from the file, enter last on

Listing 1: Sample outputs from last...perle@maxi:~> lastnews tty3 Mon Jan 7 19:04 – 19:04 (00:00)web tty2 Mon Jan 7 19:04 still logged inperle tty5 Mon Jan 7 18:33 – 18:35 (00:02)perle tty1 Mon Jan 7 11:07 still logged intrish pts/7 chekov.linux-mag Mon Jan 7 11:06 still logged inreboot system boot 2.4.10-4GB Mon Jan 7 11:03 (08:00)[...]wtmp begins Wed Jan 2 01:23:54 2002

Listing 2: ...and lastlogroot tty1 Sun Dec 16 22:06:26 +0100 2001[...]lp **Never logged in**games **Never logged in**irc **Never logged in**ftp **Never logged in**firewall **Never logged in**postfix **Never logged in**web tty2 Mon Jan 7 19:04:04 +0100 2002perle tty5 Mon Jan 7 18:33:15 +0100 2002man **Never logged in**[...]cz tty4 Mon Dec 3 03:13:35 +0100 2001

InfoPatricia Jung: “Command Line Juggler”, LinuxMagazine Issue 19. Page 73 provides additionalinformation on shell built-ins and aliases.

Figure 1: /var/log/wtmp in an editor

Page 70: linux magazine uk 20

BEGINNERS

75LINUX MAGAZINEIssue 20 • 2002

PGP This abbreviation stands for PhilipZimmermann’s encryption anddecryption program Pretty GoodPrivacy”. From the point of view of theuser, PGP works as a “Public KeySystem”, which means that twodifferent keys, which go together areused. Number one is the public key,which the user is supposed to circulateamong the population as generously aspossible, while Number Two is a secretkey, which must only be in thepossession of an authorised person,meaning you. With the public key of athird party, one codes messages to thelatter in such a way that only the holder

of the related secret key (which is thethird party) can then decrypt them.

GnuPG A complete and Free substitutefor PGP. Unlike PGP, GnuPG is Freesoftware, which means the program’ssource code is freely available, free frompatents and free from restrictive licenceconditions.Wrapper Wrappers are a type ofsoftware which encapsulates an objectin such a way that it is easier and/ormore secure when in use than theoriginal, unwrapped object. An object inthis case can be, for example, aprogram or a protocol.

EncryptedIf you can hardly wait to finally make your datasecure, you should waste no time in starting theprogram. To do this, enter either a simple geheimnis& in any terminal of your choice. Anyone who isfamiliar with the program from the good old days ofKDE-1.x will be a little disappointed that Geheimnis inthe current version 1.96 cannot yet dock in the panel.So a search for the old familiar menu itemApplications/Geheimnis Dock Menu at present willsadly be in vain. The back-story to this is that themechanism for docking has changed completelybetween KDE 1 and KDE 2, so the correspondingcode will have to be completely rewritten. But don’tworry – according to the developers, the re-implementation of this practical feature is right at thetop of their To-do list.

K-tools:

SIMPLE SECURITY

Keeping a secret to oneself is not always easy –especially in mail traffic. Although many peoplewould prefer not to think about it, emails are

comparable to a postcard. Every intermediate station themail passes can read the message if it really wants to.Maybe that hadn’t occurred to you?

What a good thing there’s Geheimnis (it means“secret” in German). With the aid of this KDE front-endfor the most common encryption programs, all yourdark secrets will be hidden from even the most curiousvirtual postmen. You are even secure from snoopingcolleagues, because in addition to mails, the programcan also be used to make child’s play of encryptingimportant files on your hard disk.

To keep your mails and data secure in future, younow need nothing more than the latest release of thetool, which you will find on the homepage of theauthors Chris Wiegand and Stefan Suchi athttp://geheimnis.sourceforge.net/, plus a functionalencryption program. In the case of the latter, by theway, you have more or less a free choice, sinceGeheimnis gets along with PGP 7.0, PGP 6.5, PGP 5.0,PGP 2.6.x and also GnuPG 1.0.x. Even using differentversions and programs at the same time is no problem,since the tool allows different profiles to be created.

SuSE users are especially lucky, since there is even anrpm package available for them to download. Theowners of other distributions, unfortunately, will have toget their hands, or rather their compiler, dirty and installGeheimis after unpacking the sources (tar –xzvfgeheimnis-1.96.tar.gz) and then:

./configuremakemake install

You should also carry out this Linux three-step in thegeheimniskeepopen subdirectory which is created whenyou unpack. Please do not forget this, becauseGeheimnis needs this auxiliary program. To be specific,this is a simple Wrapper around a shell, which keepsthe shell window open until the user explicitly closes it.This is necessary so that one can read the outputs of theactive command line PGP program during all actions.

K-toolsIn this column we present tools, month by month,which have proven to be especially useful whenworking under KDE, solve a problem whichotherwise is deliberately ignored, or are just someof the nicer things in life, which – once discovered– you wouldn’t want to do without.

Keeping your emails

secure has always

been a fairly tricky

business but

Stefanie Teufel has

the secret to security

success

Page 71: linux magazine uk 20

BEGINNERS

76 LINUX MAGAZINE Issue 20 • 2002

Geheimnis greets you in the first instance by tellingyou that it’s time to create a new profile, preferably aseparate one for each encryption program you use(Figure 1).

Click on the OK button to start. The next window(Figure 2) is also an advisory screen, in which you areprompted to enter the path to the subprogramgeheimniskeepopen. Normally the program is foundunder /usr/local/bin. If you are unable to track itdown there, a which geheimniskeepopen, or ifnecessary a locate geheimniskeepopen will help you.

Enter the result in the window from Figure 3,which your new PGP tool opens for youautomatically. Then tell Geheimnis which encryptionprogram you would like to use. To do this, click inthe section Profiles on the New button. In thewindow which then appears (Figure 4), you can seekout the appropriate program in a pull-down menuand give the baby a name in the box underneath.The name entered there appears, by the way, later inthe profile selection.

The lord of the ringsIt’s now time to think about the key. Click in thestarting window (Figure 5) on menu item KeyManagement. Geheimnis then reads in – if you arealready in possession of a key ring – all the necessaryfiles and presents you with the result in a window as inFigure 6. Once loaded, you can potter about to yourheart’s content with your keys. Move the cursor ontothe key concerned, press the right mouse button, anddecide for yourself if you want to delete, sign orotherwise process the key.

You can easily recognise your own, private key pair bythe fact that firstly it is blue and secondly it consists oftwo keys. Keys marked in grey signal that these havebeen withdrawn by the owner (disabled), so should nolonger be used. The standard setting is red. This colourtells you that you do not classify the key as verifiablygenuine. Verified keys can be recognised, on the otherhand, by their green colour.

PGP newbies select the menu item Keymanagement/Create key pair. In a terminal windowwhich opens automatically you can now usegeheimniskeepopen to track, with no worries, howGeheimnis executes the command which is necessary togenerate a key, pgp –kg. Since PGP is usually highlytalkative, you then only have to follow the instructions,to end up with your own personal key pair.

It is just as simple as key management to encrypt anddecrypt files. Drag the file to be encrypted out of

Figure 1: Show your profile!

which and locate With the locate command, you search for files in yourfilesystem. The command does this by accessing a database (/var/lib/locatedb),which, with the command updatedb, is created (or updated). A list of all thematching files with full path specification is output. The which command on theother hand searches all the directories in the specified path for the specifiedcommand.Sign By signing a (public) key you are ensuring that this key does actually belongto the person whose name is on it. You should therefore only sign such keys as youhave received personally on diskette from its owner, who is known to you, or forwhich the owner has personally provided you with the fingerprint e.g. bytelephone. This “Fingerprint” is a series of characters generated from the key data,which marks the key unequivocally, but does not allow any information to begathered about the key itself. When you sign a text or a file, PGP leaves theoriginal data in clear text and attaches to it a signature also created from the textdata (in 7-bit format for sending emails). When the receiver forms a test fingerprintfrom the data received with the same algorithm, he can then check if the datahave reached him unaltered.

Figure 2: Are you on the right path?

Figure 3: Nice and clear, the secret central control

Figure 4: Which encryption program are you going to use?

Figure 5: The main window

Page 72: linux magazine uk 20

BEGINNERS

77LINUX MAGAZINEIssue 20 • 2002

Konqueror using drag and drop to the box labelled“Drag-n-drop files here” in the main window fromFigure 5.

This is where you then choose the boxEncrypt/sign file. In the next window (Figure 7) youshould then specify the appropriate profile andchoose which public key should be used. Insteadof encryption it is also possible to merely sign thefile with your key. If you do this, people who arenot working with PGP can also read thecorresponding message. But in this case, bear inmind that they cannot check your signature forauthenticity.

If you do not wish to pass on a file, but simplykeep it encrypted on your hard disk, you don’t need

to select a second key. In this case, activate the fieldEncrypt for self.

If you don’t like the file name suggested byGeheimnis, simply change it. It is also possible torename it later without any problem. But do take care toretain, if possible, at least the ending .pgp, since this ishow the file remains linked to the program Geheimnis.In this way you are making sure that your PGP front-endwill later automatically be started for decryption whenyou click on the file in Konqueror. That’s how easycryptography can be.

Figure 6: Your virtual bunch of keys

Figure 7: It’s entirely up to youwho can decrypt the file in future

Page 73: linux magazine uk 20

78 LINUX MAGAZINE Issue 20 • 2002

To make your desktop as cosy and welcoming asyour home there is a wealth of applications whichserve no functional purpose other than to give youreyes something interesting to look at. Xeyes, whichcomes as a part of every distribution, is a classicamongst irrational applications. Once started, via thexeyes command, it will never let your mouse out ofits sight.

Xeyes also includes all kind of options, which youcan add on at the start. For example you can adjustall the colours and determine both position and size.Details on how to do this are revealed by theinstructions, which can be viewed via the commandman xeyes. Every time you make an erroneouscommand you get a short overview, which in linewith tradition, can also be termed xeyes – –help.

BEGINNERS

Desktopia

MOVINGBACKDROPS

Big Brother is watching you

Xearth –pos “fixed –90.00 0.00” – 24hour sunbathing at the South Pole

All work and no play

makes your desktop a

very dull place, so Jo

Moskalewski put aside

more serious matters

this month in favour of

a little fun

When looking for a home, the first thingyou have to consider is whether it fulfilsits basic purpose: a roof over your head,

shelter from the wind and a warm place to sleep.These things alone may make a house, but theydon’t make a home: comfort and cosiness are justas important. Take your own home for example,pictures may embellish the walls, there may beplants adorning the windowsills, and despite theadequate seating capacity at the dining table youprobably also have a sofa, though this takes upmore than a little of your living area. All these itemsare there more for their feelgood factor than fortheir functionality.

The eyes have itThings are no different on your computer: lettersneed writing, emails need answering, andinformation needs to be researched on the Web. Todo this, you need little more than a handful ofapplications; as a Linux user, you don’t even need agraphical user interface – the text console is perfectlyadequate. Since a graphical user interface uses upvaluable system resources, you could manage withoutone and reliably deal with all your tasks with a verymuch cheaper computer. Nevertheless, graphics areusually a must, because only then does the wholething give you something to look at too.

deskTOPiaOnly you can decide how your Linux desktoplooks. With deskTOPia we regularly take you withus on a journey into the land of window managersand desktop environments, presenting the usefuland the colourful, viewers and pretty toys.

Page 74: linux magazine uk 20

BEGINNERS

79LINUX MAGAZINEIssue 20 • 2002

InfoXearth http://www.cs.colorado.edu/~tuna/

xearth/Xmars http://tallyho.bc.nu/~steve/xmars.htmlXglobe http://www.cs.unc.edu/~scheuerm/

xglobe/Xfishtank ftp://sunsite.unc.edu/pub/Linux/X11/

demos/xfishtank-2.1tp.tar.gzXscreensaver http://www.jwz.org/xscreensaver

Mars – helps youwork, rest and play

Reality show XGlobe

Xearth or Xglobe asKDE background fromthe control centre

Fish in space withxfishtank and xglobe

Screensaver Xmatrix asanimated background

The view from hereA somewhat more extravagant moving desktop classicis Xearth. Behind the name there hides a globerotating as a background graphic. Xearth in the shellalso answers to its own name and offers both thelong (man xearth) as well as the short (xearth – –help)instructions and at the same time includes numerousoptions. For example there is the interesting option ofbeing able to define one’s home town via degrees oflongitude and latitude as the centre of the earth. Theauthor’s home is at:

xearth -pos “fixed 48.42 9.00”

Henceforth, the globe is no longer turned to thesunny side, but day and night travel over thecomputer’s home. If on the other hand you misshaving the moon in the firmament, turn the tableswith the parameter –pos moon and look at the earthfrom its satellite. From this point of view you can seewhich part of the blue planet is covered by clouds, orwhere the Moon is extinguished in the light of day.With the parameter –noroot this can also be done inan independent window (and thus independently ofthe desktop background).

Mars attacks!For many people it’s the rocks which are more remotefrom the Sun that are more fascinating than theMoon and Earth, such as Mars for example, which iscurrently very much in fashion. Straight away,someone came up with a cartography of the redplanet, implemented this work in Xearth and namedthe combination Xmars. Anyone who now compilesthis Martian source code will still come up with anearthly program file: rather than an xmars executableout pops a file with the name of its forefather –xearth. It would seem a good idea to rename itmanually when you install it. Although Xmars may notbe up to the current level of the countless Xearthoptions, there are still plenty of them.

Another Xearth offshoot is Xglobe. This, just likeKDE, is built on the Qt library and, being true to itsorigins, also has an adequate command parameter(–kde). This ensures KDE co-operation on all virtualdesktops. Xglobe also offers a more realistic map ofthe world than the original, although it is somewhatmore sparsely documented. The only remedy istedious experimentation and the command xglobe–help | less, if you want to change from the (well-selected throughout) factory default settings.

One –kde parameter is not an adequate argumentto get KDE to co-operate. KDE would much rather bebegged a little, which you can do in the backgroundconfiguration dialog of the control centre: instead ofan image or a colour, select Background Program, andthen mark your preferred heavenly body tool in theSetup dialog.

Sea of tranquillityIt’s not only high in the sky that you can find usefulsuperfluities, a look under water also brings somemovement to your desktop. Aquariums are said to exerta calming effect, and so Xfishtank is surely the Valium ofbackgrounds. Obviously you can define the colour of thewater here, as well as its oxygen content andpopulation. There’s no need to take a healthy mix ratiointo account in the pixel world, although you should dowhen it comes to aesthetic features: With poison-green,de-oxygenated water and just one fish, you’re scarcelylikely to achieve a calming effect. A manual here alsopoints the way to be a successful aquarian once youdepart from the default settings.

One option which does work is –d, with which you ascanned-in coral reef – set in advance, for example, withxsetroot -bitmap korallenriff.xbm as an ordinarybackground graphic – can serve as the backdrop foryour scaly pets. xfishtank makes the fish swim aroundon the desktop painting which you will then find – theheader image shows the fishes in the xglobe universe.Without the option –d your fishes will be confronted bymonotone water without decoration.

Don’t hold backThe xscreensaver presented in Linux Magazine Issue 16,can also be misused for animated backgrounds. Theparameter –root is used for this, which you shouldappend to the direct command for a screensavermodule. The modules are to be found in anxscreensaver directory, reached via the command locate/xscreensaver/. So the following command starts theMatrix screen saver as an animated background:

/usr/lib/xscreensaver/xmatrix –root

You should, however, watch your CPU load becauseXmatrix, like all other Xscreensavers, wasn’t developedwith a view to such a deliberate misuse. So although

/usr/lib/xscreensaver/xmatrix –root –delay 20000U–small –density 40 –trace

may look very nice, it will easily take up more thanhalf of the available CPU capacity even on agenerously-sized computer.

Page 75: linux magazine uk 20

BEGINNERS

80 LINUX MAGAZINE Issue 20 • 2002

Text console Parallel to the graphical user interface (X), there areusually several consoles running on a Linux system in text mode.You can get to these from an active X with Ctrl+Alt+F1 to F6. Youcan get back to X in most distributions with Alt+F7.

tar The “tape archiver”, the standard archiving program underUnix. With this program, whole directory structures are mergedinto a single file, which can be written or compressed e.g. on amagnetic tape (hence the name).

ncurses A library for terminal-dependent output of text andcontrol sequences for cursor positioning, colour changing etc. Itreplaces the older Termcap library.

Header files In header or include-files, there are lists of thefunctions available in a library together with parameters. TheC(++) compiler needs this information for compiling a program.In the most common distributions a header package for alibrary usually includes the addition of “dev” or “devel” in itsname.

Configure script Used for the automatic evaluation of propertiesof the system, on which a source text is to be compiled. So forexample configure finds out on its own which C(++) compiler isinstalled. With the aid of this tool it is possible to compileplatform-overlapping software on different (usually Unix) systems,without having to make changes by hand.

OUT OF THE BOX

GOOD SOUNDWITHOUT X

Have you still got an

old computer with

16Mb RAM and a

Pentium 100 processor

standing in the corner?

Christian Perle explains

how you can turn it

into a lean MP3 player

with the help of a

Linux-compatible

soundcard and

mp3blaster

No matter how great XMMS may be it isnevertheless encumbered by a weight oflibrary dependencies. In addition to the

Xwindow system, a whole lot of additional files needto be installed. For Bram Avontuur’s mp3blaster, onthe other hand, all you need is the text console,which provides an extremely clear display.

ScoreAnyone wanting to compile mp3blaster themselveswill have to get the source text in the form of acompressed tar archive from http://www.stack.nl/~brama/mp3blaster/. You should also have installedthe GNU C++ compiler g++, the ncurses library andthe necessary header files.

Thanks to the configure script there is not muchto do when compiling the mp3blaster sources:

tar xzf mp3blaster-3.0.tar.gzcd mp3blaster-3.0./configuremakesu (enter root password)make install-stripexit

ConductorIf everything has worked, the executable program isnow in the /usr/local/bin directory; in the make install-

strip further files end up in the /usr/local/share/mp3blaster directory. From there you can copy thesample configuration sample.mp3blasterrc_for_x withthe command:

cp /usr/local/share/mp3blaster/sample. U

mp3blasterrc_for_x ~/.mp3blasterrc

into your home directory. The program can beadapted via this file, which is something we willmake use of later. The difference between the sample configurations sample.mp3blasterrc andsample.mp3blasterrc_for_x lies in the fact that thelatter largely does without the use of function keys,which unfortunately work only in the text console,but not in an X terminal.

Now enter mp3blaster as a shell command. Yournew console MP3 player first reports for duty withthe playlist editor. With [ 1 ] Select Files you can

Out of the boxThere are thousands of tools and utilities forLinux. “Out of the box” takes the pick of thebunch and each month suggests a little program,which we feel is either absolutely indispensable orunduly ignored.

Page 76: linux magazine uk 20

BEGINNERS

81LINUX MAGAZINEIssue 20 • 2002

Manpage Like all Unixsystems, Linux has a sortof online reference manualfor the installed programs.This aid is invoked by manprogram name, e.g. manmp3blaster.Home directory Thepersonal home directory ofa user. This is where theuser arrives after asuccessful log-in or withthe command cd (withoutadditional parameters).

ID3 tag A small data suffixfor MP3 files, in whichadditional informationsuch as year of release,musical genre etc. can bestored. Many MP3 playersevaluate this informationand can display it.

init This program is thefirst to be started by thekernel when booting upand takes over the rest ofthe initialisation procedure.

SUID: The “Set User ID”bit. If this is set in therights of an executable file,in principle it will beexecuted with the accessrights of its owner. Onsecurity grounds, the SUIDbit has no effect in shellscripts.

change to file selection mode and also back again tothe playlist.

Both of these modes provide access to all thecontrols of the player. In playlist mode you controlthe playing (keys [p], [s], [4] and [6]) and order([empty], [M] and [m]) of the playlist, while the fileselection mode actually allows you to put togethera playlist.

Regardless of the mode, the display splits verticallyinto four areas. From top to bottom, these are an aidto the key functions, information on the play mode(playlist) or on sorting (file selection), details on thecurrent group (this term refers to a collection ofseveral songs) in playlist mode or of the “workingdirectory” (file selection), plus whichever MP3 file iscurrently running. The column split into three on theright-hand side consists of details on the type of MP3file and the play mode for the current group and asmall mixer.

Tuttimp3blaster also differs from some other MP3 playersby dividing the playlist into groups. The simplestmethod of creating a new playlist is via the selectionitem [ 5 ] Add Dirs As Groups. In this way theprogram creates a separate group for eachsubdirectory of the current file view.

But what’s the point of this grouping? In the firstplace, you can make pre-selection for playing backin a random sequence (Shuffle). With [ 8 ] TogglePlay Mode mp3blaster enables you to change theglobal playing action (Shuffle all songs in allgroups, play a group with subgroups, repeat agroup without subgroups).

FruttiIn playlist mode, using [ 2 ] Add Group you can alsoadd new, blank groups and then fill these in the fileselection mode. The name of each group can bechanged at any time with [ 5 ] Set Group Title, evenwhile MP3 files are being played. Adding songs tothe group is also possible during playback. If youhave created a playlist to your satisfaction, save itwith [ w ] Write Playlist. The corresponding file willautomatically respond to the file ending .lst. At thesame time the Play Mode set will be saved with it.

As the mp3blaster manpage reveals, the programincludes various function toggles, which can bespecified as options when you start the program.The flag –a (autolist) is very useful for playing backstored playlists. The argument file behind this is aplaylist, whose pieces the player will play backwithout pausing. So the command

mp3blaster –a all.lst

automatically plays back the list all.lst, without youhaving to press [ 9 ] Start/Stop Playlist.

Tuning forkYou can make individual adjustments to theappearance and behaviour of mp3blaster via thefile .mp3blasterrc in your home directory. Here,again, a look at the manpage will be helpful. Ifyou specify:

File.ID3Names = yes

in file selection mode the program will additionallyshow the ID3 tags of the songs, when you changethe display with [ f ] Toggle File Display. For settingand viewing these tags, by the way, mp3blastercomes with the independent program mp3tag.

Music on bootSo, you want the boot procedure of your computerto be accompanied by music? Adventurers have theoption of starting mp3blaster directly when the Linuxsystem fires up. To do this we use the file /etc/inittab,which contains the basic configuration of init.

Since the first seven text consoles in the mostcommon distributions are taken up by loginprompts and Xserver, for your MP3 player youshould use the eighth console /dev/tty8. To do this,enter the line:

M8:2345:respawn:/usr/local/bin/mp3blaster</dev/tty8 >/dev/tty8

as root in the /etc/inittab. This ensures the playerstarts during boot-up and after stopping with q isimmediately started up afresh. There is still onecosmetic blemish to spoil things: the program isstarted – worrying in security terms – with rootrights. A rapid remedy for this is to set the SUID bitand transfer the file /usr/local/bin/mp3blaster to theuser “nobody”:

chown nobody.nogroup /usr/local/bin/mp3blasterchmod 6755 /usr/local/bin/mp3blaster

Now mp3blaster is executed with the rights of the(unprivileged) user nobody, which should prevent anyunauthorised writing in system directories.

MP3 tags under control

Page 77: linux magazine uk 20

82 LINUX MAGAZINE Issue 20 • 2002

The best Web sites for Linux users

THE RIGHT PAGESJanet Roebuck takes

her monthly look at

the best sites that

have lit up our

browsers here at the

Linux Magazine offices

Linux Kernel Patch Archivehttp://linux-patches.rock-projects.com/

This is the best central resource for allmanner of Linux kernel patches, from

bugfixes to drivers – arranged by both kernel versionand patch type.

Linux Telephonyhttp://www.linuxtelephony.org/

If you’re interested in telephony underLinux, then this comprehensive site provides

all the info you need on everything from VoiceOverIPto PBX projects.

BEGINNERS

Ext3 Homehttp://beta.redhat.com/index.cgi?action=ext3

The place to findthe latest on Red

Hat’s development of theext3 filesystem.

Linux Chixhttp://www.linuxchix.org/

LinuxChix is agreat place for

women who use Linuxand other Open Sourceoperating systems andprograms to gettogether.

Linux Maxhttp://www.linuxmax.net/

Delivering the latest news, tutorials andopinions on Open Source and Linux to help

users enhance their Linux experience.

Shaolinux templehttp://www.shaolinuxtemple.org/

As the name might suggest, this is ameditation on all things Linux and is

produced by the author between intensive hackingsessions. An excellent read.

LDAP Confighttp://www.terminator.net/ldapconf/

LDAPconf is a plug-in module forlinuxconf, providing configuration dialogs

for OpenLDAP server and client.

Reiser Homehttp://www.namesys.com/

Not to be outdone by Red Hat, theReiser filesystem also has its own

homepage.

Unmaintained Project listhttp://unmaintained.sourceforge.net/

While Open Source programs can flourishunder careful nurture, many promising

projects have no family to call their own. Here youcan get involved in unmaintained projects and give agood home to an orphaned program.

Page 78: linux magazine uk 20

COMMUNITY

83LINUX MAGAZINEIssue 20 • 2002

This year’s Linux Expo will be takeplace in Birmingham on *29 and30 May at the NEC. Following

on from the very successful showsheld in Paris, Amsterdam, Madrid,Montreal, Shanghai and Sao Paulo,this show is something that anyonewith an interest in the developmentand promotion of Linux cannot affordto miss.

Clamouring for the title of ‘PremierUK show for Open Source and GNU/Linux solutions’this is bound to be a popular event, but you can stillregister for free on the show’s Web site:http://www.linuxexpobirmingham.com/EN/home/. Thisevent is split up into two parts, so running alongsidethe expo will be a conference, which is an event init’s own right.

Linux Expo It is at the exposition where you will be able view andgain a better understanding of the Linuxmarketplace, with its wide range of products andservices, and includes offerings from major players inthe information technology arena, like Borland, tosome of the small, niche service providers.

It is thanks to expositions like this one which giverise to the chance to bring together people from awide range of disciplines. Here you’ll get the chanceto mix with hardware and software developers, usersin both corporate and domestic markets and thosewho have wares, services and products to bring tothe market place.

Developers in GNU/Linux and other Free and OpenSource projects, who have fundamentally made Linuxwhat it is, will be able to attend thanks to thegenerosity of the organisers in providing the‘Community Village’, a vital link and a not-to-be-missed chance to make contact with this mostimportant sector of the Linux world.

Companies, like IBM, will be there, offering youthe chance to see their latest related products andallowing you to assess their commitment to the Linuxphenomenon, with stand size being only onereflection of that commitment. Here you get the

opportunity to discuss issues face toface, which will hopefully allow you tobuild your confidence in the companyand their products. Most importantly,there is always the chance to get somefreebies.

Users, especially those who are keento make the migration away fromother platforms now have the chanceto see what is available for them andtheir situation. At this one meeting you

can see and evaluate what products are available, geta good idea as to what is going to be made availablein the future and get the chance to discuss yourproblems and issues with those people who aregoing to make the future. It is here also that you geta unique chance to meet people such as yourself, todiscuss, share, and hopefully, collectively solve theproblems you currently face.

The Expo ConferenceDuring the conference you will be able to hear theviews of some of the people that have made Linuxwhat it is and who are charged with the responsibilityof designing its future.

A cycle of nine conferences will be held, coveringall of the important market topics and highlightingthe major issues affecting the Linux world. This isanother unique chance to meet the top specialistsand hear what they have to say!

For those with more practical needs, you arewelcome to attend the Conference tutorial sessions,which are specially designed to provide technicalinformation on a wide variety of subjects inconvenient two-hour sessions. These include real,interactive, training sessions, which will prove to bepopular, so you should look to make reserve a placeby booking, which, again, can be done through theWeb site.

LINUX EXPO BIRMINGHAM 2002

On *May 29-30 2002,

the Birmingham NEC

will host this event

dedicated to the UK

Open Source, Free

software and

GNU/Linux solutions

market

InfoLinux Expo 2002 Web site:http://www.linuxexpobirmingham.com/EN/home/

*All dates correct at time ofgoing to press. However westrongly recommended youcheck the Web site: www.linuxexpobirmingham.comto ensure you are notdisappointed.

Page 79: linux magazine uk 20

COMMUNITY

90 LINUX MAGAZINE Issue 20 • 2002

Welcome to another

issue of Georg CF

Greve’s Brave GNU

World with a mixture

of projects that

should provide some

inspiration for most

readers. This month

will also begin by

introducing some Free

Software games

The monthly GNU Column

BRAVE GNU WORLD

entertaining afternoon with Trophy, though. If youseek creative relaxation through designing more trackswith GIMP, that’s not a problem. The instructions onhow to do so are on the Trophy homepage.

Should the network option be missed overly much,interested developers are of course welcome toimplement it themselves. Andrew would definitelyappreciate help in this direction.

AdonthellThe Adonthell project is busy creating a Free 2D roleplaying game similar to those on the early consoleslike the SNES, although it is intended to have a muchhigher degree of freedom.

Many games consist of two connected partswhere each part can be understood individually. Theimportance of content like story, graphics, musicand so on is immediately obvious. The technicalcomponent, which does the actual interfacing withthe player, for instance, is commonly referred to asthe “engine”. Usable analogies seem to be therelationship between programs and operatingsystem or scores and musical instruments. Thisseparation allows games to be written in an abstractform with language and possibilities determined bythe engine.

The Adonthell project not only develops a gamewith a fixed story, it also develops an engine for roleplaying games along with stories that are beingChoosing tracks in Trophy

Cornering in Trophy

TrophyAndrew Mustun began developing Trophy in March2000 in order to fill the hole that quitting hiscomputer science studies had left. Trophy is a car-racing game in 2D top-view, in which it’s not onlypassing the finish line first which matters. Morespecifically, it is also about passing the finish line atall, since, in true James Bond style, the cars arearmed and more than willing to make use of theirgadgets.

Thanks to solid graphics and sound, Trophy isalready a fairly complete game that should allowfriends of action-heavy fun to enjoy themselves,although a powerful computer is recommended forsmooth scrolling.

Trophy was written in C++ and Andrew releases itunder the GNU General Public License. Its biggestweakness is probably the lack of a network playoption. Andrew plans to take care of this once hefinds time for it again, since right now his newlytaken up studies keep him quite busy.

It should be noted that whilst preparing this article,Andrew did emphasise that he was a peace-lovingindividual who disapproves of guns in general andwho also considers cars to be dangerous enoughalready without heavy weaponry; although as he stilllacks a driving license at 25, he couldn’t drive a realcar anyway.

That shouldn’t take the fun out of wasting an

Page 80: linux magazine uk 20

COMMUNITY

91LINUX MAGAZINEIssue 20 • 2002

interpreted by this engine. It is planned that allreleases will not only contain code fragments but alsocomplete little games.

Taking the usual fluctuations into account, thepermanent team of Adonthell are Kai Sterker,Alexandre Courbot, James Nash, Benjamin Walther-Franks, Joel Vennin, Joseph Toscano and MikeNieforth. Only three of these are programmers, theothers are musicians, graphic artists or authors.Thanks to this combination and the fact that allmembers insist on meeting in person once a year, thegame has a professional feel to it and gives a goodexample of lively cooperation over the Internet.

The code and graphics of Adonthell are releasedunder the GNU General Public License. Theprogramming language used for the engine is C++.For game control, expansions and in-game scripting,the Python interpreter was embedded into theengine. This makes it possible to write games for theAdonthell engine without ever touching C++. Formusic, OGG Vorbis is being used.

One of the priorities was to be able to packageengine and games separately. You only need to installthe engine and with some help of tools like map anddialogue editors, as well as a little Python, it ispossible to create a complete game. To make thiseven more interesting, the Adonthell group alsoworks on a complete world with its own history,customs and peculiarities.

Alexandre Courbot, who answered the Brave GNU

World questionnaire, said the next step is to rewritebig parts of the code based on experience gathered.The team is also still looking for people willing tohelp with porting the project to other platforms. Thegame is known to run on GNU/Linux, FreeBSD,OpenBSD and BeOS, but in the long term, it is alsoplanned to support proprietary operating systems inorder to give their users a first taste of freedom.

Internally development is moving towards a moreclient/server based architecture to allow networkedplaying. Even though it isn’t planned to support verylarge numbers of players, Adonthell should eventuallybe capable of allowing a medium number of playersto interact in a persistent world.

Since its first steps in 1999, Adonthell has come a fairway already and further development provides hope formore. Those with the right skills who are too impatientto wait are encouraged to help the process along. TheAdonthell team welcomes all kind of support. All otherscan already spend one or two afternoons with “Waste’sEdge”, the first playable release.

XBindKeysPhilippe Brochard wrote the program XBindKeys, whichmakes it possible to assign shell commands to keysunder X11. This way frequently used programs like themailer, browser or xterm can be launched by a singlekey combination without having to take a detour viathe menu. Once you get used to being able to docertain things without having to take the hands off thekeyboard, you won’t want to miss this capability.

Some window managers support keybindingsnatively, but you’ll frequently find that not all of theavailable keys are freely assignable – like special keysonly present on some keyboards. Philippe himselfuses XBindKeys to bring up a shutdown menu whenpressing the “power” key that his keyboard has.

Everyone who tries out new window managers or

Bathtime in Adonthell

Unhelpful help in AdonthellConfig file for XBindKeys

Page 81: linux magazine uk 20

COMMUNITY

92 LINUX MAGAZINE Issue 20 • 2002

hand is to design a system in a way that necessaryusage is possible, while abuse becomes impossible.

Since the conception of such systems is done byhumans there is always a significant potential forerror. Access Road by Patrick Thazard tries to modelthe complex environment of information systems andvisualise it for the administrator. This does not increasesecurity in itself, but it offers help in finding securityproblems that may have gone unnoticed otherwise.

Patrick Thazard himself has been working as acomputer security consultant since 1987 and wroteAccess Road in Java under the GNU General PublicLicense. The documentation is released under theGNU Free Documentation License.

At the moment Access Road supports GNU/Linux-like systems, simple routers and Solaris-like systems.Even though no data update has been made beforethe last release, Patrick is convinced it will alreadyprovide a very useful structure for other developers.

Further plans including adding the interactionbetween GNU/Linux and Apache and then adding theinteractions between operating system and theemployed database management system. In the long-term expansions for modelling systems like CORBA orWindows 2000/XP should complete the system.

Until then there is still quite a bit of work to doand Patrick is looking for other developers willing tosupport his work. Even if the approach of graphicalmodelling in general does have some potentialweaknesses, this project seems to be quite fascinatingand allows exploration in new ways.

GNU ConsGNU Cons offers an alternative to one of the seniorprograms, GNU Make. Anyone who has everdownloaded software as source code, or recompiledthe Linux kernel, has already used GNU Make simplyby entering the command make.

Make was written in a time when it was stillnormal to compile programs by hand or with bashshell scripts and at the time it was a big stepforward. If you’ve ever tried writing a makefileyourself, you will most certainly have found thesyntax to be pretty hard to understand. This is whymost developers copy working makefiles from otherprojects to modify them for their current purpose,or have makefiles automatically generated byprograms like GNU Automake. On top of this,make tries to detect modifications by the time oftheir last modification only, which is problematicand fails for sure when trying to recompile withnew compiler options.

The name GNU Cons was chosen because with itshelp, programs can be “Cons-tructed” and its goal isto do the jobs done by make the way they should bedone. A very central component for this is a goodmechanism to detect whether files have beenmodified. As a result, GNU Cons does not only look at

uses different window managers from time to timeknows the problems associated with teaching the newwindow manager your favourite key combinations.XBindKeys solves both problems, and in combinationwith the mini-program MoveMouse, also written byPhilippe, it can even be used to bring the mouse topreviously specified positions with a single key press.

XBindKeys and MoveMouse were both written in Cand are available under the GNU General PublicLicense, as Philippe feels them to be his contributionto the GNU System. The configuration of XBindKeysis done by directly editing the easily understood plainASCII configuration file, or by using the GTK front-end XBindKeys-Config, written by Laurent Vuibert.

As a side note it should be said that one shouldmake sure XBindKeys gets started before thewindow manager; this ensures key presses reachXBindKeys instead of being intercepted by thewindow manager.

There are no plans for further development sinceXBindKeys is stable and Philippe believes it shouldremain small and useful. This clearly sets a goodexample in the fight against the spread of “featureism.”

Access RoadThe area of IT security is without question complexbut also important. Awareness of the possibility ofbugs in programs is reasonably good by now, but it isalso possible to create security problems by combiningprograms that are working and “bug free.”

Complex environments and tasks sometimesrequire pretty complex and obscure informationsystems. Without access limitations, data could beabused or modified secretly. The problem of thisbecomes immediately apparent when thinking aboutcomputer-based hospitals, for instance. The opposite,a complete limitation of all access, is also not a goodidea since it makes all work impossible. So the task at

Controling access

Page 82: linux magazine uk 20

COMMUNITY

93LINUX MAGAZINEIssue 20 • 2002

access times, but also works with MD5 file signatures,allowing a very good means of identification.

A good example of these capabilities is thebehaviour of GNU Cons in the following scenario: theprogram “test” consists of the object files “test1.o”,“test2.o” and “test3.o”. After the first compilationof the program, the object file “test2.o” isdamaged/corrupted deliberately. The next call of GNUCons will rebuild “test2.o”. This will not re-link theprogram “test” again, since GNU Cons realised thatthe generated version of “test2.o” is identical to theone previously linked-in.

Should GNU Cons be called with differentcomputer options, all parts are recompiled and linked,since not only the results but also the parameters usedto create them are part of the comparison.

GNU Cons was written in Perl by Bob Sidebotham,who has since retired from working on it. RajeshVaidheeswarran and Steven Knight took over asmaintainers of the stable (Rajesh) and development(Steven) versions. Being part of the GNU Project, GNUCons is released under the GNU General Public License.

Thanks to the use of Perl, GNU Cons runs on bothWindows and Unix-derivates and its configurationfiles, the equivalent of the commonly used makefiles,allow the use of very dynamic and complexexpressions to customise a program to a certainsystem as much as possible.

GNU Cons is fully usable although it is rather C/C++heavy. Other programming languages can be accessedwith the Cons::Plus module by Johan Holmberg. Alsoconfiguration files are of course rather Perl-heavy,which is not exactly a plus for many people.

At the end of this feature I would like to expressmy thanks to the GNU Cons team for coming upwith extremely verbose answers to the standard BraveGNU World questions.

Rajesh Vaidheeswarran and Erich Waeldeprovided huge amounts of information with manyexamples, which was very interesting for me even ifI was only able to put small parts of it into theissue. I can only hope some of the most importantadvantages got across well enough to giveinterested developers an idea of why they ought togive Cons a try.

SConsThe obvious similarities in name between GNU Consand SCons are not coincidental. The design of SConsis largely based on GNU Cons and was written inAugust 2000 by Steven Knight, maintainer of theGNU Cons development version, for the SoftwareCarpentry competition.

After being a maintainer of Cons for some timealready, he pursued the goal of combining the ideasof Cons with the power of Python for thecompetition. SCons is based on this work. LikeCons, it provides superior capabilities for detecting

modifications and resolving dependencies, but itsconfiguration files are based on Python. Also SConsalready supports parallel compilation with theability to specify the number of threads by acommand line option.

SCons is still a fairly young project – the first alphawas released on December 13 2001 – which is whyreleases are still happening at very short intervals,often containing additional functions. So eventhough the project has been working with a strongregressive test-infrastructure to maintain backwards-compatibility and quality since day one, one may stillexperience roughness in everyday use.

The list of planned expansions is still rather longand contains not only good support for Java, C# andFortran, but also the ability to generatedocumentation in several formats (PDF, PostScript,TeX and more) and archival.

SCons is being released under an X11-type oflicense, which is known not to protect the freedoms.It is possible that the GPL would have been the betterchoice for the long-term perspective, but SConsclearly qualifies as Free Software and taking a look atit or participating is clearly a good idea.

FinishAlright, so much for the Brave GNU World for thismonth. For the next issue I already have one projectstowed up that I’m already looking forward tointroducing, since it has my life much easier and Ihope it’ll do the same for you.

Until then I wish you all a good time and please don’thold back on suggestions, ideas, comments, feedbackand project introductions; preferrably by email.

Send ideas, comments and [email protected] to Brave GNU World

Homepage of the GNU Project http://www.gnu.orgHomepage of Georg’s Brave GNU World http://brave-gnu-world.org“We run GNU” initiative http://www.gnu.org/brave-gnu-

world/rungnu/rungnu.en.htmlTrophy homepage http://trophy.sourceforge.netAdonthell homepage http://adonthell.linuxgames.comOGG Vorbis homepage http://www.xiph.org/ogg/vorbisJoin Adonthell http://adonthell.linuxgames.com/

development/join.shtmlXbindkeys homepage http://hocwp.free.fr/xbindkeys/

xbindkeys.htmlMoveMouse homepage http://hocwp.free.fr/movemouse.htmlXbindkeys-Config homepage http://www.netchampagne.com/

xbindkeys_configAccess Road homepage http://accessroad.sourceforge.netGNU Cons homepage http://www.gnu.org/software/consGNU Make homepage http://www.gnu.org/software/makeSCons homepage http://www.scons.org

Info

Page 83: linux magazine uk 20

COMMUNITY

94 LINUX MAGAZINE Issue 20 • 2002

Bristol: 5-7 July 2002

UKUUG LINUXDEVELOPERS’

CONFERENCE

Speakers TalksDavid Axmark MySQLMike Banahan Linux Terminal Server ProjectRuediger Berlich GRID computingMarcus Brinkmann The GNU HurdStephen Coast LEGO programmingAaron Crane Using PHP in large Web sitesUlrich Drepper glibc2.3Craig Duffy 10 things to do with a dead

PC in BristolNigel Edwards Securing Linux serversPhilip Hazel Exim 4Christoph Hellwig ABI: support for Non-mative

applicationsJosh Howlett University of Bristol’s

Nomadic networkDave Jones Buried alive in patches – 2.5

kernelLuke Leighton FreeDCEGervase Markham BugzillaMichael Meeks GNOME 2.0Richard J Moore RAS round up from IBM

Technology Centre

Speakers TalksSimon Myers Using RT to track bugs,

ideas and lifeKurt Pfeifle KDEPrintMark Probst MathMap image

manipulation languageStephen Richter Zope 3Alistair Riddoch Technologies for multiplayer & James Turner games

Julian Seward Valgrind – memorydebugger

Sander Striker Subversion – a CVSreplacement

David Sugar Free telephony and GNUBayonne

David Sugar DotGNU and youBo Thorsen Linux on AMD’s x86 – 64

architectureMarcelo Tosatti and others Panel discussion – kernelWookey Embedded systems the easy

way

There’s something for

everyone at this

year’s Linux

Developers’

Conference, where

experts and newbies

alike get to mingle

with the leading

lights of Linux

development

The fifth annual Linux conference is to be heldthis July at the University of Bristol. Prior tothe full conference on the 5-7 July, a one-day

tutorial runs on 4 July. This year’s event starts witha tutorial on how to write shared libraries by UlrichDrepper, who is the glibc maintainer at Red Hat.This is followed by a tutorial on the Linux TerminalServer Project by Jim McQuillan, the project’sfounder.

The conference itself starts proper on the Fridayafternoon but a CUPS and KDEPrint workshop willalso be run in the morning. The main presentations

will then run through until about 2pm on Sunday,7 July.

The delegate fee includes all presentations,tea/coffee breaks and a sandwich lunch on theSaturday. There will be informal discussions on all threedays. A conference banquet is also planned for theSaturday evening on the floating restaurant “Shoots”.

At the time of going to press the talks werecorrect, but please check the Web site athttp://www.ukuug.org/events/linux2002/ forconfirmation and bookings.EARLYBIRD REGISTRATION CLOSES 31 MAY