linux magazine 15

81
COMMENT 3 LINUX MAGAZINE Issue 15 • 2001 General Contacts General Enquiries 01625 855169 Fax 01625 855071 www.linux-magazine.co.uk Subscriptions [email protected] Email Enquiries [email protected] Letters [email protected] CD [email protected] Editor John Southern [email protected] Assistant Editor Colin Murphy [email protected] Contributors Alison Davis, Richard Smedley, Richard Ibbotson, Jono Bacon, Jason Walsh, Jack Owen, Bruce Richardson, Steven Goodwin, Janet Roebuck, Kevin D. Morgan International Editors Harald Milz [email protected] Hans-Georg Esser [email protected] Ulrich Wolf [email protected] International Contributors Simon Budig, Björn Ganslandt, Georg Greve, Jo Moskalewski, Christian Perle, Stefanie Teufel, Oliver Kluge, Mirko Dolle, Andreas Jung, Patricia Jung, Anja Wagner, Carsten Zerbest Design Advanced Design Production Stefanie Huber Operations Manager Pam Shore Advertising 01625 855169 Carl Jackson Sales Manager [email protected] Verlagsbüro Ohm-Schmidt [email protected] Publishing Publishing Director Robin Wilkinson [email protected] Subscriptions and back issues 01625 850565 Annual Subscription Rate (12 issues) UK: £44.91. Europe (inc Eire) : £73.88 Rest the World: £85.52 Back issues (UK) £6.25 Distributors COMAG, Tavistock Road, West Drayton, Middlesex England UB7 7QE Print R. Oldenbourg Linux Magazine is published monthly by Linux New Media UK Ltd, Europa House, Adlington Park, Macclesfield, Cheshire, England, SK10 4NP. Company registered in England. Copyright and Trademarks (c) 2001 Linux New Media UK Ltd No material may be reproduced in any form whatsoever in whole or in part without the written permission of the publishers. It is assumed that all correspondence sent, for example, letters, e- mails, faxes, photographs, articles, drawings, are supplied for publication or license to third parties on a non-exclusive worldwide basis by Linux New Media unless otherwise stated in writing. ISSN 14715678 Linux is a trademark of Linus Torvalds Linux New Media UK Ltd is a division of Linux New Media AG, Munich, Germany Disclaimer Whilst every care has been taken in the content of the magazine, the publishers cannot be held responsible for the accuracy of the information contained within it or any consequences arising from the use of it. The use of the CD provided with the magazine or any material providied on it is at your own risk. The CD is comprehensively checked for any viruses or errors before reproduction. Technical Support Readers can write in with technical queries which may be answered in the magazine in a future issue, however Linux Magazine is unable to directly provide technical help or support services either written or verbal. We pride ourselves on the origins of our magazine which 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 all the knowledge and technical expertise of all the major Linux professionals and enthusiasts. No other UK Linux magazine can offer that pedigree or such close links with the Linux Community. We're not simply reporting on the Linux and open source movement - we're part of it. Current Issues NOT A CD W hen is a CD not a CD? The answer is when it contains the new stealth anti-piracy coding. The system, called Cactus Data Shield, has been trialled by Sony in both Europe and the US. The system adds noise to the data stored on the CD. Copying the disc results in a CD full of noise, which could potentially harm your speakers. The protection system relies on the error correction algorithms within CD players, which treat the extra noise as though it was just a disc covered in fingerprints, whereas a computer CD drive, PS2, MiniDisc or even the new CD/MP3 portable players treat this extra code as read failure errors. This means you could walk into a shop. Buy a CD. Take it home and everything plays fine. Later in your new portable player or on your computer it fails. Put it back in your stereo and all is well. What would you do first? Assume it has draconian copy protection or that you have a faulty drive because you have worn it out. I wouldn’t mind so much if the discs were clearly labelled as such. One does have a warning but this is on the inside cover and my local music shop is unlikely to let me open every CD just to check. With clear notices at least I then get to choose not to buy. A similar system is being trialled by Macromedia called SafeAudio. Both of these copy protection systems can be simply circumvented by hooking your speakers up to your soundcard. Piracy is obviously wrong but should this harm my consumer rights? This is limiting what we can do with a product legally bought. What will they think of next – software that’s not yours but only licensed? Happy coding! John Southern, Editor

description

linux magazine 15

Transcript of linux magazine 15

Page 1: linux magazine 15

COMMENT

3LINUX MAGAZINEIssue 15 • 2001

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]

Contributors Alison Davis, Richard Smedley,Richard Ibbotson, Jono Bacon,Jason Walsh, Jack Owen, Bruce Richardson, StevenGoodwin, Janet Roebuck,Kevin D. Morgan

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

International Contributors Simon Budig, Björn Ganslandt,Georg Greve, Jo Moskalewski,Christian Perle, Stefanie Teufel,Oliver Kluge, Mirko Dolle,Andreas Jung, Patricia Jung,Anja Wagner, Carsten Zerbest

Design Advanced Design

Production Stefanie Huber

Operations Manager Pam Shore

Advertising 01625 855169Carl Jackson 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) :£73.88 Rest the World: £85.52Back 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,the publishers cannot be held responsible for the accuracy of theinformation contained within it or any consequences arising fromthe use of it. The use of the CD provided with the magazine or anymaterial providied on it is at your own risk. The CD iscomprehensively checked for any viruses or errors beforereproduction.

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.

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

NOT A CDWhen is a CD not a CD? The answer is when it

contains the new stealth anti-piracy coding. Thesystem, called Cactus Data Shield, has been

trialled by Sony in both Europe and the US. The system addsnoise to the data stored on the CD. Copying the disc resultsin a CD full of noise, which could potentially harm yourspeakers. The protection system relies on the error correctionalgorithms within CD players, which treat the extra noise asthough it was just a disc covered in fingerprints, whereas acomputer CD drive, PS2, MiniDisc or even the new CD/MP3portable players treat this extra code as read failure errors.This means you could walk into a shop. Buy a CD. Take ithome and everything plays fine. Later in your new portableplayer or on your computer it fails. Put it back in your stereoand all is well.

What would you do first? Assume it has draconian copyprotection or that you have a faulty drive because you haveworn it out. I wouldn’t mind so much if the discs wereclearly labelled as such. One does have a warning but this ison the inside cover and my local music shop is unlikely to letme open every CD just to check. With clear notices at least Ithen get to choose not to buy.

A similar system is being trialled by Macromedia calledSafeAudio. Both of these copy protection systems can besimply circumvented by hooking your speakers up to yoursoundcard. Piracy is obviously wrong but should this harm myconsumer rights?

This is limiting what we can do with a product legallybought. What will they think of next – software that’s notyours but only licensed?

Happy coding!

John Southern, Editor

Page 2: linux magazine 15

NEWS

6 LINUX MAGAZINE Issue 15 • 2001

LINUX NEWSIBM donate Eclipse to open sourceIBM has created a new opensource community, codenamed‘Eclipse’. The Java-based opensource software, derived fromWebSphere Studio Workbench,will enable developers to use software tools frommany suppliers. This will enable developers tocombine business tasks used to create e-businessapplications, such as those for Web services.

With more than 150 software tool suppliersworking together it will be available free-of-charge todevelopers. More than 1,200 individual developersfrom 63 countries have already participated. Thecommunity will be managed by a multi-vendororganisation and will include IBM, Merant, QSSL,Rational, Red Hat, TogetherSoft and others.

By using software tools that easilyplug into the Eclipse software,developers can create higher-qualityapplications in less time and inherittechnology developed by other

vendors. Developers no longer need to create e-business applications in Windows and port them toLinux, since they can work directly on Linux. It willalso enable the abundance of Windows softwaretools to be more easily supported on Linux,accelerating the establishment of Linux as anapplication development environment. Since Eclipse isopen source, Linux developers can participate in thecommunity evolving the software itself, as they dowith Linux.http://www.eclipse.org

Mandraketo workmagic withthe SimsMandrake is to launch agaming edition of itsdistribution. Expected tocost around £70 the Linuxdistribution will containthe 3D-simulation game,The Sims from ElectronicArts. To achieve thisMandrake has used TransGaming Technologies’ innovative and unique portabilitytechnology layer, where cutting edge games operate seamlessly on the Linuxplatform.

The Sims, is a popular virtual simulation game that lets players create aneighbourhood of simulated people known as “Sims” and control every elementof their lives. Linux players will be able to fully interact with the Windows-basedSims world. They will be able to download Sims’ household furnishings, clothesand accessories from the same sites as their Windows counterparts and then posttheir story lines on hundreds of existing fan sites.

TransGaming’s portability technology and subscription services also enableLinux users to play many other popular Windows games. The portabilitytechnology, in collaboration with the Wine community, allows games andbusiness software applications that were originally designed for other platformsto function on Linux in a completely seamless and transparent manner.

The Sims on Mandrake Linux Gaming Edition

SuSE Linux Enterprise Server 7SuSE Linux Enterprise Server 7 for IBM S/390mainframes, has been released. Based on the kernel2.4, it now supports S/390 servers as well as IBMeServer zSeries z900 giving the ideal solution forrunning mission-critical applications such as theadministration of complex e-business transactions.

“By means of the consolidation of large serverfarms, customers enjoy a lower level ofadministration expenses due to uniform serverstructures,” explains Dirk Ott, Head of IBM LinuxMarketing, EMEA Central Region. “This not onlyreduces system administration costs during theintegration of new Linux servers, it also hosts a greatsavings potential for locality and energy costs”.

As the host operating system z/OS also supportsHiperSockets, data exchange between SuSE Linux andz/OS is possible with maximum bandwidth and near-zero latency. The Logical Volume Manager allows theruntime integration of dynamically attached storagedevices into existing virtual volumes of almost arbitrarysize, delivering practically unlimited disk space withoutdowntime. The rail freight company Transtarsuccessfully runs a real-time tracking system on SuSELinux Enterprise Server for S/390, and thus, providesonline freight information to employees and customers.http://www.suse.co.uk/s390

Page 3: linux magazine 15

NEWS

7LINUX MAGAZINEIssue 15 • 2001

da Vinci takes offSouth Coast software development company da Vinciis combining its official launch with theannouncement of significant new business atSouthampton company iInventory. da Vinci will assistiInventory with the next phase of development of itsLANauditor software, due for release in the firstquarter of 2002, as well as a unique rocket directmail piece.

da Vinci, which was formed earlier this year to servethe growing demands for UK-based teams of softwaredevelopers, has had a successful year resulting in a 25per cent increase in development staff. LANauditorautomates hardware and software asset tracking for

networked and standalone computers. “The iInventory project is very exciting for us, as it

allows us to use our skills across several areas ofexpertise”, comments Andy Eakins Managing Directorof da Vinci. “After locating several suitable partnersin the US we were recommended to da Vinci byApple itself and we are very pleased to be able tosource the development expertise required so close tohome. iInventory approached us hoping for aMacintosh solution but, after seeing the experiencethat da Vinci could offer in other areas, extendedtheir requirements to include Linux and Webdevelopment”.

Oil rigsrunning onLinuxVarco International Inc. hasannounced it will standardiseon MontaVista’s Hard HatLinux embedded operatingenvironment, for its full lineof oil rig floor equipmentcontrollers. Varco made theselection after the companyhad exhausted its search foran off-the-shelf nextgeneration industrialcontroller that would meetits complex needs and hadtested several majorembedded operating systemsfor its own custom controllerproduct.

Varco Internationalproduces equipment andautomation systems for theOil and gas drilling industry.Varco’s next generation oilrig controller, its e-Drillproduct, promises equipmentthat has a far higher level ofautomation and functionality(through sophisticatedrobotic algorithms); is simplerto set up and maintain(through thin-client, Webbrowser-based “screens”);and leverages the Internet toallow remote diagnostics,monitoring and control ofthese systems.

The first systems usingMontaVista’s Hard Hat Linuxare operational today in theNorth Sea and the Gulf ofMexico. Many additionalsystems have already beenshipped and will becommissioned later this year.Reliability is critical in theseapplications, with operator’sliability often exceeding aquarter of a million dollars aday for any downtime of thisequipment.http://www.varco.com/

edrill.htmhttp://www.mvista.com

LynuxWorks unveils BlueCat 4.0LynuxWorks Inc. unveiled the latest version of its popular BlueCatLinux distribution. Using the new 2.4 Linux kernel and tool chain,the new distribution empowers developers to select the best-suiteddevelopment platform for their needs by providing support formultiple microprocessors. Offered in professional bundled solutions,BlueCat is packaged with a range of host/target combinations,commercial grade tools, integrated development environments (IDE)and support programmes.

“BlueCat 4.0 professional tools bundles for Intel’s microprocessorplatforms provide developers a comprehensive embeddeddevelopment environment,” said Inder Singh, CEO of LynuxWorks.BlueCat tools benefit developers by providing unique gdb extensionsfor kernel debugging and a simple time-saving graphical interface totrace, debug and tune kernels and application functions forincreased performance. By including simple utilities for controllingboot, flash programs, disk, connectivity and display functions, thisenables the loading and using of tested application components such as boot routines, Web servers,application shells, demo programs and more.

BlueCat 4.0 supports the Intel XScale microarchitecture, Intel IXP1200 Network Processor and EmbeddedIntel Architecture. Other platforms will be available later in the year.http://www.lynuxworks.com/products/whatisbcl.html

Texas Instruments licences HyperTransportAMD announced it has licensed its high-speed interconnect HyperTransport technology to Texas InstrumentsIncorporated (TI). HyperTransport is an innovative solution that moves information faster, enabling the chipsinside of PCs, networking and communications devices to communicate with each other up to 48 timesfaster than some existing bus technologies.

Texas Instruments will use HyperTransport technology in devices in computers, telecommunications andother equipment. HyperTransport technology is a high-speed, low-latency bus that can interface with today’sbuses like AGP, PCI, 1394, USB 2.0, and 1Gbit Ethernet as well as next generation buses including AGP 8x,Infiniband, PCI-X, PCI 3.0, and 10Gbit Ethernet.

“HyperTransport technology is being driven by the HyperTransport Consortium as a free and open industrystandard aimed at removing system design bottlenecks and dramatically increasing the performance of thenext-generation computation and telecommunications systems. The licensing of this technology by anindustry leader like Texas Instruments increases the momentum of HyperTransport as the future connectivitystandard. It is gratifying to see a leader like Texas Instruments join the growing list of companies such asCisco Systems, nVidia, PMC-Sierra, and SGI, who have incorporated HyperTransport technology into theirfuture product plans,” said Gabriele Sartori, president of the HyperTransport Technology Consortium. Moreinformation concerning the HyperTransport Consortium can be found at www.hypertransport.org.

Page 4: linux magazine 15

NEWS

8 LINUX MAGAZINE Issue 15 • 2001

EMC Fastrax gets Time NavigatorAtempo, Inc. (formerly Quadratec Software)announced that its Time Navigator software platformfor high-performance backup and restore servicesnow supports the EMC Fastrax data movementplatform in an Oracle environment. Time Navigatorfor EMC Fastrax is one of the most advancedsolutions on the market for backup of active onlinedata to secondary storage. EMC Fastraxaccomplishes this without LAN or SAN (Storage AreaNetworking) bandwidth or application processorresources to move the data. Time Navigator reducesbackup administration and provides an advancedapproach for restoring Oracle databases. Thecombination of Time Navigator and EMC Fastraxreduces the database backup window to itsminimum, resulting in the optimal solution for largeand critical database backup.

This integration demonstrates EMC’s commitmentto leverage open application programming interfacesand product strengths to deliver infrastructuresolutions that help customers meet current businesschallenges, such as backup and recovery of criticalbusiness information. The product runs on IBM AIX,Sun Solaris and HP-UX. Benefits include server-lessbackup solutions, maximising network performancewith minimal impact to users and applicationperformance. Time Navigator can seamlessly sharethe same library for backup and restore operationsfor maximum hardware and software investmentprotection.

Trend Micronow protectsLinux-basedserversTrend Micro has announcedServerProtect for Linux 1.0, which protectsLinux-based file servers from computer viruses andother malicious code. It offers all the standardServerProtect benefits, such as remote managementvia Web browser, real-time virus detection, time-controlled virus searches and flexible messaging.Trend Micro’s MacroTrap is also an integral part of theantivirus solution, detecting and removing unknownmacro viruses.

The importance of the Linux operating system issteadily increasing in the corporate marketplace, withthe open source environment considered to beparticularly stable and secure. The Linux system isbased on the philosophy that each user contributesto the improvement of the system according to his orher area of expertise. The disclosure of the sourcecode means that errors and omissions can beidentified and resolved by all programmers who areinvolved with the system.

With ServerProtect for Linux 1.0, Trend Micro isnow offering comprehensive protection fromcomputer viruses to organisations that base theirnetworks on Linux servers. As the use and popularityof the Linux platform expands, so too will the needfor Linux-based virus protection. A test version ofTrend Micro’s ServerProtect for Linux 1.0 can bedownloaded from http//www.trendmicro.co.uk for alimited period.

Windowssoftwareon LinuxLindows is a version of Linuxspecifically designed to runWindows applications. Ituses Wine, the open sourceproject that Corel used toport many of its applicationsduring Corel’s Linux venture.PCs running Lindows OSrequire no additionalsoftware to run bothWindows and Linuxsoftware. For moreinformation seehttp://www.lindows.com/.

SNAREcatches themarketSNARE (System iNtrusionAnalysis and ReportingEnvironment) from InterSectAlliance Pty Ltd. is a kernelmodule-based auditingsystem that has a core goalof reducing the “cost ofentry” for host-basedintrusion detection andsystem auditing on Linux.This makes system event logsless of a chore, and more ofa resource.

One of the keycomponents that has beenmissing from the Linuxoperating system, is acomprehensive auditing andevent-logging facility. Thelack of such securityfunctionality, and the factthat it exists in commercialoperating system rivals suchas Windows NT and Solaris,has been reported as asignificant reason whyorganisations andgovernment departmentshave been reticent in takingup Linux, despite thesignificant cost savings thatwould otherwise haveresulted. Hopefully, SNAREwill go a little way toremoving such reluctance.For more information seehttp://www.intersectalliance.

com/.

Red Hat expands its consulting groupsA core team of open source consulting andimplementation experts join Red Hat from VALinux. The consulting professionals joining Red Hatwill operate from locations around the US. “Bysupplementing our high-end networking andsecurity experts with these experienced andtalented open source engineers and consultants,Red Hat is well prepared to meet the needs of ourcurrent and future Global 2000 clients as theymigrate from UNIX to open source computing,”said Kevin Thompson, Executive Vice President andChief Financial Officer of Red Hat.

“In many cases we were already working withRed Hat Linux,” said Marty Larsen, former Vice

President with VA Linux and one of the expertsnow joining Red Hat, “so we know thetremendous benefits this powerful new way ofcomputing can bring to enterprise class companiesin all types of business.”

The expansion of the consulting practiceenhances Red Hat’s ability to offer a full range anddepth of services and support, including theassessment and security analysis, networkinfrastructure analysis, cost-benefit analysis, andcode and application analysis. They also gainadditional expertise in Infrastructure and large-scaleimplementation expertise and open source graphicengineering and consulting

Page 5: linux magazine 15

NEWS

9LINUX MAGAZINEIssue 15 • 2001

EmbeddedLinux apps inthe palm ofyour hand The Sharp SL-5000D is a PDA witha difference; it is the first PDA froma major power in consumerelectronics to ship with the Linuxoperating system. “Sharp believes that consumers arejust waiting for the kind of power and flexibility thisoperating environment brings to palmtopcomputing,” said Steve Petix, Sharp’s Associate VicePresident, Mobile & IT Solutions Group.

Sharp is accepting pre-orders from the developercommunity for the SL-5000D developer unit. The SL-5000D uses the Embedix Plus PDA solution, whichcontains: Lineo’s Embedix Linux; Trolltech’sQt/Embedded and Qt AWT GUI technologies; InsigniaSolution’s Jeode PDA Edition; and Opera Software’sembedded Web browser. Running on top of EmbedixPlus is Trolltech’s Qt Palmtop, an applicationenvironment based on Qt that provides a full rangeof applications for business productivity, handheldgames, personal information management, andsynchronization across multiple desktops. “The SL-5000D shows that when you combine slick hardwarewith a cool application environment, you end up witha product that pushes the limits of what a PDA cando,” said Haavard Nord, Trolltech’s CEO.

Zeus Web Server cuts hardwarerequirements in half.Zeus Technology Limited, announced the launch ofZeus Web Server Version 4.0, which enables twiceas many people to access a Web sitesimultaneously, and over a continued period,compared with competitive products. This isbecause version 4.0 can handle more simultaneousconnections from the Internet, and responds toeach individual connection much faster thancompetitors. This enables the number of hardwareservers to be halved.

Version 4.0 is also the world’s fastest Web serverwhen delivering dynamic content such as PHP – 45per cent faster than the competition. Web serversare traditionally optimised to deliver large volumesof traffic out from the server to the Internet. Theadvent of Web services will require Web servers tohandle huge volumes of inbound traffic. Zeus WebServer Version 4.0 has been optimised for traffictravelling in both directions, making it the onlyWeb server designed for the next generation of theInternet. For a free 30-day evaluation seehttp://www.zeus.com/downloads/.

KeyhavenSystemsTeam withLinuxIT forsupportKeyhaven Systems Ltd, a UKspecialist in networking,Internet and email solutions,has reached an agreementwith LinuxIT for support ofthe Concera range ofsystems. Keyhavenmanufacture the Concera,which is a rack mountableunit, intended to solvecustomers IT problems byproviding a fully featuredserver with secure Internetservices and an easy to useinterface based upon theLinux operating system. TheConcera is designed either tointegrate into an existingnetwork or operate on itsown, providing for all thenetwork needs. Each Concerais pre-configured to meetindividual customersrequirements before delivery.

LinuxIT (http://www.linuxit.com) provideunlimited email, telephoneand remote diagnosticsupport during eitherbusiness hours or 24/7 formission critical systems. TheLinuxIT-Concera support linesare manned by experts in theunderlying Linux operatingsystem and the range ofapplications preinstalled.

Rackspace managed hostingRackspace is launching its managed hosting services in the UK and across Europe.Operating from a new, state-of-the-art data centre outside London, RackspaceManaged Hosting deploys and manages entire Internet hosting platforms, rangingfrom single managed servers to complex managed server clusters that needadvanced firewall security, load balancing and data storage. Rackspace is thesecond largest managed hosting company with over 4,000 managed Web servers.

“Business is booming,” says Dominic Monkhouse, newly appointed ManagingDirector of Rackspace Europe. “Rackspace’s sole business is doing managed,dedicated hosting. They have doubled their business over the past year while mosthosting companies were retrenching or going out of business. I came from thehosting industry and had to compete with Rackspace’s legendary FanaticalCustomer Support”. Monkhouse was previously the Managing Director ofInterliant UK and joined Rackspace in September 2001.

Rackspace boasts a fully redundant, Class A data centre in the UK and in Texas,USA and offers a 99.999 per cent uptime guarantee. Another key to FanaticalSupport is its 24-hour Rapid Deployment guarantee. Further information onRackspace Managed Hosting is available from the company’s Web site, which canbe found at http://www.rackspace.co.uk

Hansa BusinessSolutions launchesnew softwareHansa Business Solutions has launched its next-generation suite of fully integrated CRM, financialand logistics software. Hansa Business Solutions isone of the few companies that can deliver true multi-platform capabilities to its customer base. In additionto the availability of its software on Linux, thecompany is also able to support implementations onApple’s latest OS X operating system, Windows,UNIX, IBM iSeries (formerly AS/400), IBM pSeries(formerly RS-6000) and mixed networks.

In addition to the core financial and logisticsfunctionality of Hansa Version 3.9, the new releaseincorporates a suite of integrated customerrelationship management features, which includes aninteractive task manager and calendar that can sharerelevant data with other employees and othermodules of the software, such as purchase ordering,sales ordering and stock control. Alternatively, ifcompanies do not wish to implement the full suite ofHansa software, they have the option of purchasingFirst Contact, a bundle of CRM modules that is soldas a stand-alone system.

Page 6: linux magazine 15

NEWS

10 LINUX MAGAZINE Issue 15 • 2001

Grumble cornerIf you’ve ever wanted to get rid of an annoyingelement in a KDE application, or know how yourfavourite tool could be made even more useful, you’llnow get the ultimate chance thanks to the revivedKDE Usability Study.

The makers of the KDE project are collecting userreports at their Web site: http://usability.kde.org/,which highlight weak points or especially successfulfeatures of diverse KDE programs. There are alreadysome evaluations on the site of consoles, Kicker,Quanta and the Konqueror.

Anyone wanting to contribute their views ongreater user-friendliness at KDE should not delay.Head straight to http://mail.kde.org/mailman/listinfo/

Who says there’s no

place for gossip and

scandal in a Linux

magazine? K-splitter

broadcasts news from

the K-world and noses

around here and there

behind the scenes.

The new season

holds many a surprise

for all KDE-ers and

Stefanie Teufel is at

hand to introduce

them all

K-splitter

POT-POURRI

kde-usability/ and join the project’s mailing list.Alternatively, the makers will also be glad to receivenew reports of your experiences. The usability listscan be found at http://usability.kde.org/reports/maintainerlist.phtml.

This season’s fashionsThe latest in chic for your KDE desktop ispresented to you this season by Kristof Borrey.Instead of simply clicking together anotherKDE theme, he has a whole collection ofbright, shiny, colourful icons waiting for you.Anyone wanting to give their desktop andKonqueror a whole new look can obtain thepackage Kicons_0.2.1.tar.gz from

http://prdownloads.sourceforge.net/ktemplate/. Open the control centre and select Design/

Symbols. Then click on the folder icon and inthe file browser which then appears selectKicons_0.2.1.tar.gz. All you have to do now ispress OK and click on Install New Design.Select the new entry Kicons in the Design tabto view the works of art, as in Figure 1.

Figure 1: Your country needs new icons

Join up now – your usability study needs you

Page 7: linux magazine 15

NEWS

11LINUX MAGAZINEIssue 15 • 2001

Finding roomNo matter how big your screen may be, once you’veopened a couple of windows the desktop will alreadylook much too small. With the increasing multiplicityof applications space is also getting tighter in theKDE Panel.

Thankfully, the same thing happens to Karl-HeinzZimmer, which is why he’s thought up a little trick forusing dial-in connection and ISDN to get on theInternet, without all that tedious messing about withthe mouse or having to burn up valuable space withthe status indicator. You can now dial in at the pressof a key, and the ISDN status indicator is replaced bya coloured panel.

To do this, download the script created by Karl-Heinz Zimmer (http://bugcops.org/downloads/isdn_on_off) and the background image(http://bugcops.org/downloads/Panel_Online_Background.png) onto your computer. Then copy the fileisdn_on_off into the directory /usr/local/bin orwherever else you store your treasures like this. Asroot, ensure that the script can be executed globally:

chmod a+x /usr/local/bin/isdn_on_off

‘’For safety’s sake, take this opportunity to check

whether, as user, you have execution rights on/usr/sbin/isdnctrl. If not, correct this. Start KDE’s menueditor in the K menu, under Install Control Bar/ MenuEditor and make a new entry under Internet. Enterthe following values here: In the General tab anISDN_On_Off is on offer by name. For a comment,add something like Activate and Deactivate the ISDNconnection. If you’re happy to do without acomment, you can always leave the box empty. Forcommand, enter isdn_on_off (Figure 2).

Now switch to the Extended tab, where you shouldclick on the Change button. In the dialog box, whichwill then appear (Figure 3), set the key combinationto Shift+F12. Now when you press Shift+F12together you can get onto the Network of Networksand, after glancing at your latest telephone bill, youcan hang up again in the same way. ■

All those who were unable to attend theLinuxTag live, now have the option of viewingan HTML version of Michael Goffioul’s talk onthe new KDE print system at http://users.swing.be/kdeprint/www/index.html. As chiefdeveloper of this system, which is being madeaccessible to a broad range of users for thefirst time in the newly published KDE Version2.2, Goffioul has a thing or two to say aboutthe new technology. Further information,including additional screenshots and photos,can be obtained from the KDE Print Web site athttp://users.swing.be/kdeprint/. The author is

also seeking support for the documentation ofthe individual components and will be glad toreceive any offers.

Black on white

Figure 2: A menu item...

Figure 3: ... and a shortcut key for getting on the Net

If you missed the real thing round check out the website

For safety’s

sake, takethis

opportunityto checkwhether, as user,

you haveexecution

rights

Page 8: linux magazine 15

GNOME NEWS

12 LINUX MAGAZINE Issue 15 • 2001

GNOME 2.0With GNOME 2.0 on the horizon, there is hard workgoing on everywhere at GNOME and, to some extent,the first fruits of this labour are ready to be admired.The control centre is set to become a standard part ofNautilus; systems not running Nautilus will still have aseparate control centre window open. Anyone braveenough to compile this so-called shell at this earlystage will be rewarded by an interface which has beengiven a complete facelift, and which, with its big icons,looks more like Windows than the old control centre.

Another new feature enables applets to be startedwith the respective settings in their own windows.There have been a few changes under the bonnet, sonow the control centre makes use of Ximian SetupTools to archive settings and to allow a multi-step

undo. This is also a very simple way to loadspecific local settings, such as those onemight use on a laptop. The applets

themselves have also been revised and somehave been swapped into their own packet,

named Control-Center-Plus.One change that has been long overdue is

Björn Gansladt looks

at GNOME 2.0, Mono

gleanings, Oregano,

Fractal landscapes

with Terraform and a

Usability study of

GNOME

GNOMOGRAM

A GLIMPSE OF THE FUTURE

Ximian’s announcement that parts of Microsoft’s .NET are to beimplemented as freeware under the name of Mono has struck anerve in the Linux community: there followed numerous articles byincensed, and sometimes badly-informed, authors.

The main bone of contention was Microsoft’s Passport, a systemto allow simpler authentication of users. Personal data is managedcentrally and if necessary passed on to sites such as Hotmailwithout the user having to type it in.

It is understandable that not everyone wants their personaldetails to be controlled by Microsoft, but it was never Ximian’s aimto completely clone .NET. In the first instance the programmingenvironment contained in the .NET framework C# will beimplemented. The report that Microsoft will be supporting Ximianin this implementation certainly does not mean that Mono willsupport Passport, and much less that programmers will be forcedto implement this system in their future work.

When it comes to support by Microsoft, this report was followedby another in which it was rumoured that .NET (at least in theUSA) was based on software patents which could make Ximian’sefforts worthless.

In respect to Passport, DotGNU, the second project involved with.NET, is more interesting as this is where the possibility ofdecentralised authentication is being worked on. Since thecooperation with Pocket .NET the project has also included a C#environment. The fact that both projects have been blessed by theFSF is due among other things to bad timing and is not a one-off.

The FSF is also producing Harmony, a free replacement for theGUI library Qt. The Harmony project was launched to make itpossible to include KDE (and any other free programs that weredesigned to use Qt) in wholly free operating systems such as GNUand Debian GNU/Linux. Harmony will be released under the GNULibrary General Public License (LGPL).

the overhaul of the screensaver applet, which hasn’trun smoothly with the available screensavers for sometime. To prevent this situation from repeating itself in afew months time, consideration is being given tocombining the new applet with the officialXscreensaver demo. Even if the lovely gtkhtml-basedinterface is easily fooled by it the control centre is stillhighly unstable. In addition to a new version oflibcapplet, it still needs some fairly exotic packages

Mono gleanings

The GNOME Control Center

Page 9: linux magazine 15

GNOME NEWS

13LINUX MAGAZINEIssue 15 • 2001

such as bonobo-conf and pkgconfig, most of whichcan be found on the GNOME-FTP server.

Another very nice, but alone still completely useless,feature is the new GNOME file selector, which is ofcourse based on Bonobo. This also uses a few widgetsfrom Evolution, which can be found in libgal, andenables the directory view to be grouped according tofile types. All users of Ximian GNOME or Windowsshould find the shortcuts to important directoriesfamiliar. The intuitive file name completion is practicalfor new users and the dialog also notes when a filewas last accessed or saved. By using GNOME-vfs it ispossible to access distant files such as those on adigital camera just as one would access a hard diskwith Nautilus.

Sun report http://developer.gnome.org/projects/gup/ut1_report/report_main.html

Gnome useability http://developer.gnome.org/projects/gup/Mono project http://www.go-mono.comMono news http://www.softwareuncovered.com/news/

cgram-20010716.html#1.NET patent news http://www.zdnet.com/zdnn/stories/news/

0,4586,2801560,00.htmlDotGNU project http://www.dotgnu.orgGnome Control Center http://ftp.gnome.org/pub/GNOME/unstable/

sources/control-center/Pkg-Config libraries http://www.freedesktop.org/software/pkgconfig/Oregano http://oregano.codefactory.se/Circuit Simulator http://metalab.unc.edu/pub/Linux/apps/circuits/Ng-spice http://www.geda.seul.org/tools/ng-spice/Terraform http://terraform.sourceforge.net/Ray tracing http://www.povray.org

Info

OreganoOregano is a program for drafting and simulatingcircuits. To do so, Oregano offers a wide variety ofcircuit elements from resistors to transistor logic,which can, if required, be printed out for copying.What is most interesting for the hobbyist is thepossibility of simulating the circuit anddemonstrating voltage or frequency at specifiedpoints as graphs.

The actual simulation work is done, not byOregano itself, but by Spice. Despite its 30 years,Spice is still one of the best programs for this taskand offers analyses Oregano cannot yet visualise.

Since back in 1971 neither GNU nor Open Sourceyet existed, it’s not surprising that the Spice programhas no free licence by today’s criteria. There are afew projects based on Spice, such as Al’s CircuitSimulator and Ng-spice. These are either not fullycompatible with the original software or not readilyavailable, thus no genuine alternatives exist.

As in so many programs, Terraform’s stated objective is to become the GIMP ofits field – in this case editing fractal landscapes. Fractal landscapes, also knownas heightfields, owe their name to the fact that certain characteristics can befound in a landscape if they are hugely enlarged. To this extent they are similarto fractals, which makes it possible to write algorithms that generate such alandscape.

Terraform offers several algorithms at the same time which each deliversomewhat different results. A few filters can be used on the generatedlandscapes, which depending on what you want, can smooth out thelandscape, provide it with craters or raise the water level.

In addition to the normal preview Terraform provides several three-dimensional views, some of which can be moved around in space. To calculate acompleted image, the program makes use of the raytracer Povray. Theheightfield can also be exported in various formats and thus be inserted intoother programs. Those who want to printout the heightfield, can do so withGNOME-Print through Terraform.

Fractal landscapes with Terraform

A fractal landscape in the wireframe view

Usability study of GNOMESun has been asking users without any GNOME experience toperform certain tasks with the GNOME system and has publishedthe results at http://developer.gnome.org. The value of such astudy is revealed by the fact that many of the suggestedimprovements are simple to implement but make a massivedifference to the user. In order to clarify any questions ofusability before they are wrongly answered, there is also theGNOME Usability Project, which is working on interfaceguidelines.

One problem when creating such guidelines is the largediversity of GNOME users: On the one hand, a few users feltbaffled by the numerous options in the control centre, yet on theother hand these options are what makes the desktop soflexible. Based upon classification by experience, the configuringoptions of Nautilus and Sawfish now appear correct.

Page 10: linux magazine 15

COVER FEATURE

44 LINUX MAGAZINE Issue 15 • 2001

The view from the insideWhat is more valuable, your computer oryour data? No matter how good yourhardware is there is always the risk that itwill stop working, failing and corruptingyour data as it goes. It’s been said before,and it will be said again, make backups ofyour data: Tape drives and WORM drivesand buy hardware support contracts ifneed be. It’s not too hard to make abackup of your /home/ directory toa CD writer either.

Along with the householdinsurance of a data backup, your datais also at risk from theft and malicious corruption.You may think that the theft of data is the mostobvious but corruption could do you just as muchdamage. What is more worrying is that either theft orcorruption could easily happen on an unsecuremachine.

The simplest way for someone to steal your data isto physically take it. A chance thief will make off witha backup tape or removable drive. Even a wholemachine – especially if it’s a nice shiny notebook – isvery attractive to a passing light-fingered Fred. Wecan all remember the MI5 worker who lost his laptopin a Tapas bar this summer. The only answer is lockand key and physical security. Following all the bestpractices and procedures, such as restricting accessand bolting the casing down, we are still left with thepotential of cyber crime over the network as so lovedby fiction writers and hacker/cracker wannabes.

With the growth just starting to appear ofbroadband access in the home, be it ISDN, ASDL orCable modems, it is no longer just a corporatenetwork administrator’s worry. More SmallOffice/Home Office users will also be tempted to takeon these new forms of Internet connection. We allhave to be wary of the potential threats.

If your computer is connected to the outside worldthen there are always risks. Lots of companies make

No computer is ever

completely secure –

there’s always risk.

The type and extent

of that risk can vary.

Colin Murphy

investigates the

dangers

their income by helping youto reduce these risks inwhat is a complex system.Complex or not, it is onlyright that you take someprecautions yourself, which will also give you thechance to discover more about your system.

Keeping up with the Jones’When you install a new distribution on a computer itis reasonable to assume it is almost up to date. Thereis always a delay between the final collection ofpackages, QA testing, manufacture, distribution andfinally sale before you get hold of it. So it’s wise tocheck the Web site for security updates as you installit. This is where the major distributions gain anadvantage. They have invested in their upgradenetworks fix, and some can make this seem almostautomatic. Red Hat uses its Red Hat Network,Mandrake use its local client MandrakeUpdate tolook for updates and bugfixes, and SuSE have itssecurity announcements in its support database. Alldistributions worth their salt, or your money, will also

HACKER/CRACKER Theterm hacker is always usedout of context. Anythinggood can be a hack: fixinga piece of code to makeyour company moreprofitable or producing ameal from leftovers are allgood hacks, and you couldbe proud to be called ahacker. Unfortunately theterm is abused by the pressand is usually taken tomean Cracker – someonewho breaks into computers.Even the term cracker canbe subdivided into someonewho breaks in for themental challenge and thosewhose intent is malicious.

Security: Bolting the door...

OPEN ALL HOURS

Page 11: linux magazine 15

COVER FEATURE

45LINUX MAGAZINEIssue 15 • 2001

run mailing lists to advise you of any security issues.As new development is done, patches are releasedfor your packages and some of these will havesecurity implications.

There is still the risk that a weakness has beenidentified and that the developers for yourdistribution have still to find out about it, whichmeans you are your first line of defence.

Ring of fireOur first port of call is with the firewall, afundamental protection from network intruders. Likea condom, it gives you a sense of security, unlike acondom it will deny someone the penetration. Itenables you to control what types of services youare happy for your machine to handle – not all are assecure as you would want.

Most distributions will let you set up a personalfirewall and configure the type of access you require,usually from their graphical configuration tools. Often

a firewall will have been set up during the initialinstallation, a couple of questions about whether ornot you are running Apache or a Web server. If youare not running those services then the ports tothem will be closed off.

This can range from allowing anything to connect– useful maybe, if you are running a self containednetwork that never has any access to the outsideworld and is only connected to another computer inthe spare room, which you want to pass files aroundwith ease – all the way to blocking all incoming andoutgoing access without direct intervention.

It is at this point we must consider just what isrunning on our systems. As Linux boxes are used toacting as both server and client at the same time wemust be careful about access rights. We also tend tohave helpful system services (daemons) running in thebackground. The daemons wait and when requiredenable connections via ports but unfortunately thisgives huge access holes in the system. You can use

Firewall A firewall isnothing more than a pieceof software that enablesinformation to pass throughit according to simple rules.The rules can be changedand so care must be takento ensure everything isdouble-checked. Firewallscan form part of aworkstation machine, but ifyour network is any morecomplicated it is oftenuseful to have a dedicatedfirewall machine.

Services Data coming intoyour system needs to behandled by the correct typeof software. It would bepointless for your emailclient to be looking at thedata coming in from a timeserver – it would bemeaningless. These types ofdata coming into yourmachine are broken up intoservices.

Ports Ports are the meansby which your computerknows how to handleservices. There is a definedlist of ports together withtheir associated services inthe file /etc/services.

ntopThe first tool to look at is ntop. This programshows the network usage through a simple Webinterface. This is a Unix tool that shows thenetwork usage, similar to what the popular topUnix command does for processes.

ntop contains a powerful and flexibleinterface to the ntop packet sniffer. Since ntophas grown so much in functionality and itcannot be simply considered a network browser,the problem of capturing and showing networkusage has been split. The ntop engine capturespackets, performs traffic analysis andinformation storage.

ntop must be run as root, or at least with rootpermissions. This is best achieved by a user withnormal permissions logging into a superuser modewith the su command. This will mean the user willneed to have access to the root account, but thisshouldn’t be a problem because only systemadministrators should be playing with this anyway.

This is a far more secure method of access thansetting the SUID bit on the executable, whichwould enable anyone to run the program – systemsadministrator or not.

If ntop is started in a terminal you will be showna display of network processes, almost like with top.Here you will see some basic information aboutwhat data is being sent where and how much.

ntop can also present you with much moreinformation via a Web browser. Start ntop with

ntop -i eth0 -w 888

and point your browser to http://localhost:888.With ntop you will be able to sort through the

network traffic by protocol and various criteria,look at network statistics, show the IP traffic andsort that by source or destination and much more.This will enable you to get a feel for the movementof data through your network.

ntop runningin a terminal

ntop viewed through a browser

Page 12: linux magazine 15

● /etc/inetd.config will contain a list of services andtheir ports. You can switch off these services bycommenting out – putting a ‘#’ in front of the line– lines that concern you.

● /etc/xinetd.conf has a more complex configurationfile structure. You still just have to comment outthe service lines that you don’t need.

The above services are not running until some callhas been made to the associated port. inetd or itseXtended daemon cousin will spot this call andthen start the required service if it can see it in itsconfiguration file. Commenting out lines like thismakes them invisible to the daemon, but they aremuch easier to reinstate than if we had justdeleted the line completely. If you have configured by hand you will need to restart inetd by using the command:

killall -HUP inetd

Good daemons to remove are the r* services such asrshd or rlogind as well as those just not used likedaytime. Fingerd is also worth considering removingas it gives out a lot of information to potentialintruders.

From the outside looking in.Now we have removed some daemons we can adduseful software. Not only should you make sure thatyour distribution is up to date with security packages,but that any other third party is also up to date.Browse the Web and make sure you have the latestservers that you want to run such as Apache.

The system is now more secure but all is still notwell. Very often, passwords are still sent in a plaintext format. When you set up a connection across anetwork it is possible for someone to use a password-sniffing tool to listen in to whatever you type. Toovercome this we can use ssh. The sshd is thedaemon that replaces the r* services we removedearlier and adds encryption to all thecommunications.

For ssh you will need the following packages:

● Openssh-.rpm● Openssh-server-.rpm● Openssh-clients-.rpm● Openssl-.rpm

To connect with ssh use the following command:

ssh -1 usename target.computer.com

Copy files by using:

scp /where/the/file/is.txt/where/you/want/it/to/go

COVER FEATURE

46 LINUX MAGAZINE Issue 15 • 2001

the process status utility:

ps -aux |less

to list which are running, but they will only berunning if something has tried to open the portassociated with that service. Another utility, netstat,will show you what is listening in your box:

netstat -l

some of these may not even be wanted, others maybe an outright security risk, telenet and finger are justtwo that spring to mind.

If you are running Red Hat then you can use thechkconfig -list while SuSE users can use YaST and asroot System Administration/ Change Configuration/Services started at boot. If you want a more hands-onapproach you can configure access manually. Theconfiguration takes place in one of two placesdepending on which distribution you are using,inetd.conf or xinetd.conf:

Nmap

The next program is Nmap, which enablesyou to run a port scan yourself. This is mostuseful to highlight what parts of your systemare insecure.

A portscan is what a cracker will use tofind weaknesses in your system, by sendinga stream of data to a range of ports andwaiting to see if any of them reply. If theydo, then they are prone to attack.Portscanning is a sign of attack, so youshould not use this tool against networksthat are not under your control. Should you,you are likely to find yourself barred fromaccessing wherever you scanned and acomplaint being sent to your ISP, whichcould mean them withdrawing their service from you.

Nmap (Network Mapper) is an open source utility for network exploration orsecurity auditing. It was designed to rapidly scan large networks, although itworks fine against single hosts, which is where you’ll probably use it. Nmap usesraw IP packets in novel ways to determine which hosts are available on thenetwork, what services (ports) they are offering, what operating system (and OSversion) they are running, what type of packet filters/firewalls are in use, anddozens of other characteristics. Nmap runs on most types of computers andboth console and graphical versions are available.

With Nmap you also get XNmap, enabling you all of the probing, but fromthe comfort of a graphical user interface.

The primary goals of the Nmap project is to help make the Internet a littlemore secure and to provide administrators/auditors/hackers with an advancedtool for exploring their networks. The NMap project also boasts a wealth oftutorials and help files to make sure you get the best out of its powerfulfeatures.

NMap shows the list of openports on a local machine

Page 13: linux magazine 15

COVER FEATURE

47LINUX MAGAZINEIssue 15 • 2001

Portsentry is the most powerful tool we will mentionhere, running on TCP and UDP sockets to detect portscans against your system. PortSentry is configurableto run on multiple sockets at the same time so youonly need to start one copy to cover dozens oftripwired services.

PortSentry will react to a port scan attempt byblocking the host in real time. This is done through arange of configured options. The most useful is whenPortSentry drops an illegal packet. Because the packetis dropped and forgotten about, noacknowledgement is received by the cracker sendingthe packet, who therefore doesn’t know they havehit anything and so remain none the wiser regardingyou and your machine. PortSentry also takes fulladvantage of either dropping the local route back tothe attacker, using the Linux ipfwadm/ipchainscommand, and/or dropping the attacker host IP intoa TCP Wrappers hosts.deny file automatically, whichwill further strengthen your system.

PortSentry will detect SYN/half-open, FIN, NULL, X-MAS and oddball packet stealth scans. These aremuch more obscure form of port scanning and arenot usually used by the average script-kiddie. Once ascan is detected your system will turn into ablackhole and disappear from the attacker. Thisfeature stops most attacks cold.

PortSentry has an internal state engine toremember hosts that connected previously. This

allows the setting of a trigger value to prevent falsealarms and detect “random” port probing, which canhappen as part of regular Internet life.

PortSentry will report all violations to the local orremote syslog daemons indicating the systemname, time of attack, attacking host IP and theTCP or UDP port a connection attempt was madeto. When used in conjunction with Logcheck itwill provide an alert to administrators via email.Here is your last line of defence, you must regularlycheck for discrepancies. If you have yet to set upsomething like Logcheck then you must go throughthe system log files on a regular basis to make surethat everything is still in order. Without this finaleffort, the whole exercise is worthless.

Ntopwww.ntop.org

Nmapwww.insecure.org/nmap/index.html

TripWirewww.tripwire.org

PortSentrywww.psionic.com/abacus/portsentry

InfoTripwirePrevention of a crack attack is important and youmust treat it with utmost priority. But how will youknow that you have succeeded, or moreimportantly, failed? Should someone sneak pastyour best efforts and manage to make themselvesat home amongst your precious data and computerresources, it’s important to know that yourdefences have been breached.

One of the biggest concerns of a breach isknowing that your data is still accurate andhasn’t been tampered with. This is whereTripwire can help. Tripwire is a tool that checksto see what has changed on your system. Theprogram monitors key attributes of files thatshould not change, including binary signature,size, expected change of size, etc. The hardestpart of doing this is balancing security,maintenance, and functionality.

Tripwire maintains database details of all of thefiles that you have configured for and comparesthese details against what is really in yourdirectories. Should anything be different then

warning bells will sound, or, at least a log file willbe written. The important thing is that you knowthere has been a breach, and you know that youcannot fully rely on all of your data.

The home of Tripwire

PortsentryPortSentry inaction

Page 14: linux magazine 15

A simpleroverYou can spend your

time buildinghardware or you

can concentrate on theprogramming. You caneven do it all virtuallysuch as the Universityof West Florida’s robotmodelling site. Hardwarewise most of the kitsavailable depend on theParallax BasicStamp,which is a PICmicrocontroller. Unfortunately it isWindows controlled but by the timethis is published a new C environmentshould be available. The BasicStamp allows simplecircuits to be built and controlled giving rise to manythird party kits. What I wanted was something readymade so I could play with the software.

A wet Saturday afternoon meant a trip to the localToys’R’Us to see what we could

find to while away theafternoon. Lego

FEATURE

14 LINUX MAGAZINE Issue 15 • 2001

Robotics is a

minefield of a

subject due to the

many different

avenues of

exploration. Despite

limited time and

resources, John

Southern bites the

bullet and plays

with Lego...

Mindstorm cried outbut we werecautious. Lego

released the Mindstorma few years ago inspired by

the MIT programmable brick. Themain programmable block (RCX)based on a Hitachi H8/3292

microcontroller is available in three versions(1.0, 1.5 and 2.0). In the UK you can buy either

the Lego Robotic Invention System 1.5 or 2.0. Thedifference lies not the RCX brick but with the infraredcontroller. In version 2.0 the controller is USB while1.5 is serial. The most recent stock in the shop wasversion 1.5 with a RCX 2.0. The RCX version does notreally matter as it can be upgraded and using LegOScan be replaced.

The first hour was spent just opening lots of bagsof Lego and playing. Finally deciding to build a robotto follow a path we face our first challenge. Withouta Windows machine in the house the suppliedsoftware is of no use. We can spend Saturday nightinstalling Windows or turn to the Web for help.

After just a couple of minutes on the Web wewere faced with an array of choices. We can use theLego RCX built-in software and run a Linux-basedprogramming tool or we can download a newprogramming language into the RCX and againcontrol it from Linux.

Starting with the inbuilt software we can thenchoose from a range of programming languages suchas Forth or NQC (Not Quite C). We opt for NQC asthe Forth primer is somewhere upstairs and lazynesshas taken over.

The NQC is command line based and the latestversion (2.3r1) is a 188K download. The packagecontains a test file to check that the system is

Lego MindstormDreaming of electric sheep

BRICKS AND PIECES

Page 15: linux magazine 15

FEATURE

15LINUX MAGAZINEIssue 15 • 2001

working and you have everything connected. It isprobably worth downloading the NQC package justfor this test as it puts your mind at ease over thehardware.

To control the RCX brick we first write our NQC ina simple text editor. We save the file with a .nqcextension and the command

nqc test.nqc

compiles the code. Now by adding the -d switch wecan send the complied code to the RCX brick.

nqc -d test.nqc

Similar to C or C++ the NQC follows very similarsyntax:

task main() {SetSensor(SENSOR_1, SENSOR_PULSE);while(true) {

if (SENSOR_1 ==2) {PlaySound(SOUND_FAST_UP);ClearSensor(SENSOR_1);

}}

}

As can be seen from the above example no surprisesappear in the coding. The real surprise is that thesensors and output ports (three of each on the RCXbrick) are not just digital on/off but analogue and canbe used to sense a range from 0 to 1023. This meanswith just a few logic gates we could expand thenumber of sensors, but that’s for another weekend.

From the above example we can see that there is asound generator on board. With a little work withthe PlayTone command we can get the brick to sing,so long as we are careful to not let the buffer queueoverflow (every eighth note we have to pause untilthe buffer is empty).

Actually more time was spent on building therobots, due to the huge amount of parts in the boxand the constant hunt for the correct brick shape.The robots can be initially built by using the easy tofollow booklet supplied with the kit – just rememberto allow more time to find all the parts.

Having tested that the Linux box could control theRCX brick and had fun making little models dance,sing and even head towards the light (Warning: Catowners should note that the robot is easily knockedover by an angry feline), we couldn’t resist updatingthe firmware.

Our first choice was the pbFORTH but in practicewe settled for LegOS. Both of these routes enableyou to replace the firmware inside the RCX brick andthus give you far more control over the unit. Toupdate the firmware we need to use a firmware

downloader. One was at hand from the NCQ withthe -firmware switch.

The LegOS gives much more control and we cannow program the tiny LCD screen. We wrote a simpleC text file and complied it. First mistake. You need toset the makefiles TARGET environment variableotherwise you will wonder where the .srec files go.Second mistake. Make sure the serial port is correctlyset, as the default is ttyS0. Third mistake. Getting theerror message “no response from RCX” does notnecessarily mean the RCX brick is faulty or out ofrange. It may be that the IR control unit’s battery hasfinally died.

With the LegOS finally running and afterrecompiling code to remove errors we find all sorts ofextra functions. Motor speeds can be subdivided into255 units. A brake function enables us to lock awheel while the off function lets it freewheel.

The only disappointment with the kit was to dowith the number of pieces included. While it mayhave taken ages to find parts because they are sonumerous, the number of pieces is cleverly limited toonly just build the robots in the supplied booklet.Now serious consideration must be put to askingFather Christmas for more pieces. Who knows maybenext time the smaller Lego Scout module may appear.

Infohttp://www.enteract.com/~dbaum/lego/nqc/http://www.legOS.sourceforge.net/

Seek the lightand avoid the

cat

Page 16: linux magazine 15

FEATURE

16 LINUX MAGAZINE Issue 15 • 2001

EMAIL SERVER

SUSE EMAIL SERVER III

Why me?What is it that the SuSE eMail Server has to offeryou? Apart from the absolute reliability of Linuxsoftware and the present day fact that there are notmany viruses that will attack it, there is also theextremely user friendly Web-based interface that youcan use to perform all of the many tasks requiredfrom a mail server on a daily basis in a busycommercial or academic environment.

The eMail server supports all of the usual Internetstandards such as IMAP, LDAP, POP3, TLS and SASL.All common email clients can be administered fromthe workstation that’s connected to the server, whichprovides a central administration point for acommercial organisation. Dedicated workgroups andall of the things that you might associate withproprietary software are available. Internal andexternal lists can also be set up and administered.

What SuSE Linux UK Ltd has done is take somefree software and written some high quality softwareto compliment it. The end result is that the user onlyhas to click on a Web page and fill in some easy tounderstand values for user and group configurations.

SuSE has also populated the boxed product withsome excellent manuals. The first part of theinstallation manual is easy to understand: If you caninstall a Microsoft product then you can use YasT2and install the eMail server. Many commercial andeven Government organisations that we have spokento have said that they want this kind of commercialproduct and they are willing to pay good money forit. Quite a few of them also say that proprietarysoftware is becoming prohibitively expensive due tothe cost of licences. They also say that Linux is aviable alternative and they want more of it.

The eMail Server III that was reviewed for thismagazine was tested on i386 hardware, which is thekind of hardware you can find in most smallcompanies worldwide. A 450MHz AMD K6-2 CPUand 128Mb of 100MHz RAM was the hardware used

SuSE have recently

produced a very

glossy and highly

desirable range of

commercial products

which neatly undercut

the prices of most

other similar

products. Richard

Ibbotson takes a long

hard look at the latest

SuSE eMail Server

Page 17: linux magazine 15

FEATURE

17LINUX MAGAZINEIssue 15 • 2001

to install the server into the i386 architecture. Theinstallation was over in less than ten minutes andafter fifteen minutes an IBM notebook wasconnected to the networked server so thatadministration and configuration of the new accountscould begin.

Configuration of a single account took only a fewminutes and we noticed that the server and the Webbrowser that we were using both moved likelightning across the screen. This was also testedacross the Internet with an ISDN link and little or noloss of speed was experienced. Most commercialorganisations use digital communications and sothere should not be a problem with remoteadministration and configuration.

Reasons to use?How does it work and what makes it better thansome of the others? To be honest it may not bebetter than some of the others, but there are a lot ofpeople out there who do not want to hack acommand line in the middle of a busy schedule or beinvolved in administering several hundred machinesthat crash all of the time. Let’s face it: we’ve all hadthat problem at one time or another with internal orremote computers that need that demon tweak or anaccount adding/removing on the one day of the yearwhen everything else has gone wrong.

To use the eMail server for the purposes ofconfiguration and administration, all you need is aJava-enabled Web browser on any machine in yourown internal network. You can also connect to thesame machine with SSH if you prefer command line.The eMail server is basically a cut-down version of theordinary SuSE distribution and so any secure sessionthat you might wish to establish over an internalnetwork or across an untrusted network is possiblewith the eMail server. This means that an SSLconnection can be made with Samba as well, if you

Apache configuration. User account control

Configuring Fetchmail from the frontend.

Postfix configuration

Page 18: linux magazine 15

configure those as well. Finally there is a section onhow to use the Arkeia backup software to make acopy of your mail folders so that nothing is lost in theevent of a disaster. Arkeia is the software that isincluded on the installation CD that comes in the boxso that you can make your backups.

As well as the installation manual there is also acut down version of the original SuSE manual. Thoseof us who know about this will be aware that theSuSE manual is one of the best books about Linuxthat has been produced. If you don’t like paper youwill find that you can install the same documents intoyour own local hard drive for further reading fromthe CD. If you are short on disk space you can alsoconnect via the Internet to the SuSE site where youwill find the same documentation as well as the SuSEsupport and hardware database. A second CDcontains the source code for the eMail server. So, ifyou are a developer or if you just want to change theway that the eMail server runs on your network youcan do that.

What about viruses? Amavis is included with the CD. There is a very goodSuSE security team who are paid to look after youand a security list if you wish to discuss any securityissues. You can get the kind of support for virus andother security issues that will make sure that yourserver will run for a very long time withoutinterruptions and without intruders. If you don’t likeAmavis you will find email virus scanners out there onthe Internet, which are commercial in nature and youwill have to pay for them.

If you want a reliable and virus-free mail serverthen the SuSE eMail server is for you. You can findmore info about the eMail server by visiting theuseful links.

FEATURE

18 LINUX MAGAZINE Issue 15 • 2001

want to do that. Apache configuration can be donewith the addition of a CA.

After the initial login the user or admin person ispointed by the graphical interface towards the firsttime configuration of a single user or completegroup. There is also provision for browser-basedconfiguration of postfix, procmail and fetchmail. Ifyou have hacked these on the command line asmuch as I have then you’ll probably prefer a graphicalapproach.

The actual Web forms that you are asked tocomplete vary in complexity and sophistication. If youare confused by first time configuration the manualshould help you out and if that doesn’t work thensupport by fax or email is easily obtained. The firstpart of the manual gives easy to understand graphicalinstructions on how to install. The later pages(starting at chapter five) explain the simple task oflogging in as an administrator and configuration. Thispart also shows pictures of what you can see on thescreen so there shouldn’t be any problems. There arealso complete descriptions of how to use various mailapplications with the eMail server and how to

Creating a new useraccount to receiveemail

Expert mode Postfix configuration

Postfix mail queue

The authorRichard is the Chairman and organiser for SheffieldLinux User’s Group. You can view their web site atwww.sheflug.co.uk

Page 19: linux magazine 15

FEATURE

20 LINUX MAGAZINE Issue 15 • 2001

Agenda VR3 Linux PDA test report

PENGUIN IN YOUR POCKET

Linux has acquired thereputation of being anideal base for PDAs in

the past few years. From themany PDAs announced, thereare only two candidates presentlyavailable: LISA supplies the Compaq’s iPaqwith Linux (Compaq itself only distributes this withthe Windows CE operating system); and the AgendaVR3 – the first genuine Linux PDA, which has beenavailable since July 2001.

Agenda Computing presented the first productionVR3 machines at the Linux Expo. They are marketeddirectly by Agenda at the price of around £200,though this will depend on exchange rates, shippingand local taxes. Included with the PDA you also get acable in order to connect to the serial port of a PC, acradle, a headphone/microphone combination and aleather cover. A CD, which includes software for the

The recently released

Agenda VR3 is the

first of a new

generation of PDAs

based on the Linux

operating system.

Under its chic exterior

lies a solid Linux core,

but is its bite is as

good as its bark?

Carsten Zerbst

investigates

PC as well as clear operatinginstructions, is also included.

Third party software is also nowavailable – the Agenda SoftwareRepository is a good place to look.

First impressionsThe VR3 measures approximately 4.5in by

3in (8cm by 11cm) and thereby fits comfortably inthe hand. The display cover is connected to thehousing and can be folded to the rear. On the onehand, it cannot be lost as easily as the cover of theHandspring or Visor, on the other however it givesa somewhat awkward impression. Only time willtell if this is the optimal solution; in any case thecover can be easily removed. The supplied leathercase provides space for the Agenda (with orwithout display cover), the stylus, as well as a fewbusiness cards.

PDA Personal DigitalAssistant, or in otherwords, an electronicorganiser. The most wellknown PDAs are thosefrom Palm, Handspringand Psion. Handspringbases its Visor on thePalm OS, which islicensed from Palm. Incontrast the PDAs fromPsion have a keyboardand are significantlylarger. Psion howeverrecently announced itsintention to discontinueselling its own devices tothe end user.

Page 20: linux magazine 15

FEATURE

21LINUX MAGAZINEIssue 15 • 2001

The display has a viewable area of 2 1/8in by 31/4in (5.5cm by 8.5cm), which is over half an inch(1.25 cm) longer than the Palm display. The mainreason for this is that the VR3 uses the entire displaysurface for applications. The handwriting recognitionor the keyboard are only displayed when requiredand therefore do not permanently take up thebottom inch (2.5 cm).

The 160 x 240 pixel display represents 16 greyscales and can be easily read in direct sunshine orwith bad lighting. A quick check of the schedule atnight is possible as well due to the internal lighting.

As with all PDAs, the quite strongly reflective glasssurface can be annoying. There is even a programthat turns the display completely black, so that it canbe used as a make-up mirror – perhaps the mirroreffect should be regarded as a marketing feature.

The housing has six keys. Two for up/down, twofor left/right and two shift keys. The two large shiftkeys each operate two micro-keys and couldtherefore theoretically function as toggle keys.Unfortunately both micro switches are wired parallelon the circuit board and thus can’t be differentiatedfrom each other. The arrangement of the buttons onthe Agenda is equally suitable for left and right-handers; however both hands are normally requiredfor operation.

SoftwareWhen switching the machine on for the first time,the Agenda displays its ‘Booting’ messages. An xdmis started for logging on after the touch screen hasbeen calibrated. There are two users ready forselection: default without password and root withthe password agenda. We will no longer have to gothrough this procedure after this as logging onagain is not necessary. There is unfortunately nologging out, so that the data may be read byanyone at any time.

The cornerstone of the user interface is theLaunchpad, which starts all the graphical applications.This includes everything that one would expect on aPDA – available are not only the classic PIMapplications, but also system programs and variousgames. Another practical feature is the status bar,which includes a combination of the time of day anda battery display. The status bar can additionally beused to switch between the different windows.

One should not forget that the number ofapplications run at the same time is restricted by theavailability of CPU and memory. The speed andperformance of the Agenda, in its as-deliveredcondition, is nevertheless very disappointing. In thisrespect, an update to the new SNOW binary(described later in this article) is advised. The Agenda,even after the update, gives a somewhat lethargicimpression – especially when starting applications.While, for instance, the equally expensive Palm PDA

makes its applications immediately available, theAgenda is decidedly more hesitant.

Dates, addresses and moreAgenda did not go in for any major experiments withits main PDA applications; the scope and userinterface of the programs are not dissimilar to thePalm. In the schedule, dates can be entered with thebeginning and end times, and an accompanyingdescription. In no case should this be forgotten, asdates without a description are simply lost.

The Agenda schedule can remind you about yourdates with an alarm that features an adjustablepreset lead-time. An inactive VR3 gives an acousticreminder, otherwise it will give you a message thenext time you switch it on. The reminder can also beset to go off daily, and different repetitions arepossible for different dates. This also works whencarrying out changes, for example altering one datecan automatically alter similar dates.

Contacts – your glorified address book – isorganised with similar functionality: Names areaccompanied by addresses, which can be stored indifferent systems (postal address, telephone, email).

MIPS Spread processor architecture. MIPS processors are produced by differentmanufacturers and used in all sorts of different devices, from high-end servers (forexample Silicone Graphics) all the way to small, power-saving PDAs.

Flash A Flash memory system can be repeatedly written and read almost like normalRAM. The main difference is that it also memorises data when the power is off.Another difference to RAM is that writing is in comparison quite slow and may notbe arbitrarily repeated.

IrDA The abbreviation actually stands for the Infrared Data Association. However italso defines the standard for infrared ports, determined by this organisation.

Under the hoodUnder the hood, we find a 66MHz MIPS processor,as well as 16 Mb Flash memory and 8 Mb RAMcapacity. Internal extensions do not seem to beintended nor planned for. Available on the outside isa serial port, an IrDA port as well as a mini-jack foraudio input and output.

The VR3 lives on two AAA batteries, andtherefore has no spare power to give away freely.With a small tool, the power management settingscan be easily adjusted. This means lights out for thePDA after the pre-set time. The VR3 also has aningenious power saving solution: removing andreplacing the stylus in the PDA also turns it on and off. Nevertheless, the batteriesdo not last particularly long and were run flat after a week’s intensive use. Agendawould have perhaps been better to select the AA size batteries, which are notmuch larger, but have almost three times the capacity.

Page 21: linux magazine 15

applications and displays the appropriate records. Theaudio input and output is not yet used to its fullpotential at present, however Agenda has alreadyannounced that a dictation program is on its way.Additionally, there is a port for the Madplay MP3player. It must be noted here that we could not getthis to work during the test. In view of its monooutput and small memory, the VR3 is in any case notan adequate substitute for an MP3 player.

With stylus and keyboardThe acid test of any PDA is in the operation. Theoperation with a stylus is mostly easier than with amouse. On the other hand, there are times when oneyearns for a real keyboard. There are two availablepossibilities for the entry of text: a virtual keyboardand handwriting recognition. Once the virtualkeyboard is accessed from the icon below the display,you can then start hitting your virtual keys.

As mentioned, the Agenda comes withhandwriting recognition as an alternative to thekeyboard. As with all devices of this type, we cannot speak about a true recognition of the writtenword – these machines only understand certainletters. As with the Palm, four input areas areavailable on the display. Small and capital letters,numbers and special characters are detected. Theletters used here are similar to those used by Palm(in contrast to Windows CE), so that no new writingstyle needs to be learned. The rate of handwritingrecognition is slower than with the Palm, howeverthe VR3 displays the written letters. You thereforedon’t have to write blind.

Looking to the futureThe development of the Agenda is naturally anongoing process. This includes both the kernel andthe programs supplied with the PDA. These can bothbe brought up to date through the serial connection.Before you do this however, you should first saveyour data onto the PC. The kernel and the programs(referred to as the rootdisk) can be downloaded fromthe Agenda homepage.

There are currently two differently types of binariesfor the VR3, and these should not be mixed witheach other. On delivery, Agenda uses normal binarieswith ELF libraries. With this technique, all referenceshave to be calculated and transformed into libraryfunctions – all this costs computing time. This, incontrast to normal desktop computers, is a majorissue on the weaker PDAs. Including libraries into allprograms is, for space reasons, not an alternative.

A SNOW stormJay Carlson has come up with the idea of usinglibraries with fixed, allocated memory spaces and tothis end he created the SNOW ABI. This naturallyrequires more work when compiling, however the

FEATURE

22 LINUX MAGAZINE Issue 15 • 2001

Each case can also be accompanied by remarks andnotes. Addresses can be assigned different categoriesto better manage the entries. The categories can becreated and designated at will. The transfer ofaddresses by infrared (beaming) between the Agendaand a Palm poses no problems and can beaccomplished in both directions. The VR3 howeverreceives the addresses without first asking the user.

These two applications are probably the mostimportant on a PDA. They are flanked by a pocketcalculator, an expense book, a small word processorfor notes, a To Do list and a world clock.

Plus and minusThere are a few points of criticism to mention here.The somewhat tardy behaviour, as mentioned earlier,is rather perturbing. The Mail program is displayed inthe Launchpad, but is not yet installed. Items fromthe to-do list cannot be easily transferred into theschedule as a date, and dates without a descriptiondisappear after entry into Never-Never land.

On the other hand, there are genuine pluses. Thefind program searches the data of the standard

LISA http://www.lisa.de/Agenda Computing http://www.agendacomputing.de/Agenda Software Repository http://www.supermegamulti.com/agenda/

index.aspMirror http://www.newbreedsoftware.com/mirror/PPP-connection and other software http://www.agendacomputing.de/agenda-

e/software-e/index-soft-e.htm>Andrej Cedilnik page http://www.csee.umbc.edu/~acedil1/agendaBusybox http://busybox.lineo.com/Mailing List http://lists.agendacomputing.com/Developer Page http://dev.agendacomputing.com/Community Portal http://www2.math.uni-potsdam.de/agenda/Dawn http://members.home.com/zakharin/

Software/Dawn.htmlvrflash http://www.apex.net/~jeff/agenda-utils/Agenda Wiki http://agendawiki.com/PMON http://www.csee.umbc.edu/~acedil1/

agenda/update.shtmlrsync http://rsync.samba.org/SNOW ABI http://www.desertscenes.net/agenda/snow/

Information

Calibration A touch screen reacts to contact, i.e. with a stylus. During thecalibration, it is determined at which point the program surface responds to such acontact.

xdm The X11 display manager is the graphic log-on program, into which the userenters his user name and password.

PIM Personal Information Manager. Most importantly, this includes the scheduleplanner, contact register and note book.

Page 22: linux magazine 15

FEATURE

23LINUX MAGAZINEIssue 15 • 2001

success comes with the speed. A VR3 with SNOWbinaries starts substantially faster, making this versionthe only really sensible choice for serious use. Theonly catch however is that all programs, including theKernel, have to use SNOW.

Open architecture provides the normal user withthe possibility of independently developing softwarefor this platform. The difference between the Agendaand a normal Linux PC is small (in contrast to thePalm) and development tools are available free ofcharge. For speed reasons, the decision between ELFand SNOW falls in favour SNOW. The Agenda is alsointeresting for the commercial market as a base formobile applications.

Missing at present are the extensions. A modem,Ethernet card and keyboard are apparently on theirway; a dream would be a jacket for PCMCIA cards(as with the iPaq from Compaq). Very nice mobileapplications could be developed with this. On theother hand, the Agenda VR3 is inexpensive enoughthat it represents a genuine alternative to otherembedded solutions. Two things at the top of the hardware wish list unfortunately rule eachother out: longer battery life and higher processing speed.

All in allAltogether, the Agenda VR3 is fun to use and takesgood care of all the normal daily functions of a PDA.With its synchronisation with desktop programs,GNOME users at least can work with a single data basis.There are off course still a few things in this respect thatneed to be improved or corrected, for example moreconsideration needs to be given to the KDE user.

Recommending either Palm or Agenda is difficult.Even the smallest Palm performs normal functionsfaster. Next to its undisputed geek-appeal, theAgenda wins plus points with its seamless integrationinto the Linux landscape. Additionally, it offers(depending on your perspective) more possibilitiesthan the Palm because of its many and varied ports.All in all, it is worth serious consideration if you canlive with the somewhat slow processing speed.

The authorCarsten Zerbst is scientific technician at the TUHH.Apart from researching the service integration onboard ships he is involved with Tcl in all walks of life.He is currently looking for new challenges in theUnix/Linux environment.

ELF The current format forbinary programs andlibraries under Linux.ABI Application BinaryInterface. The generic termfor formats and proceduresthat find and connect thelibraries at program start

Page 23: linux magazine 15

FEATURE

24 LINUX MAGAZINE Issue 15 • 2001

Usenet newsgroups and clients

READ ALL ABOUT IT

In Usenet forums not only will you find discussionsabout food, television, beer and some of my otherfavourite subjects, you will also find technical and

scientific information on nutrition, poor eyesight andalcoholism. Self help groups and self interest groupscan flourish via Usenet. You could have access to asmany as 80,000 different groups.

A group is defined by the topic it deals with andthese topics are nested in an hierarchical structure.For example, uk.comp.sys.sinclair is the Usenet groupprimarily given over to discussing all things related toSinclair, be they C5 trikes, Black watches or ZXSpectrums. This is in the systems group, which in turnis in the computer group, and they all are in the UKgroup, which is also know as the top level domain.

There are seven big top level domains such ascomp, sci and news to name but three. There aremany more top level domains, with country specificdomains like uk, ie and za, company specific domains

Usenet groups

contain a wealth of

information about

subjects so diverse

it can boggle the

mind. Colin Murphy

takes a look at the

weird and

wonderful world of

Usenet and

newsgroupslike demon and blueyonder, and the marvellous altdomain, which stands for alternative and caters for alot of what wouldn’t fit neatly into other domains orindeed into polite society.

You won’t need to be bothered with the vastnumber of groups available, you subscribe only to thegroups you think you will be interested in.

In a group someone will post a message, acomment, a question, or just leave a piece of theirmind. With luck, someone else will post a reply, andothers will post a reply to the replies, and these willhopefully have some relevance to the group subject,although quite often not. Just like email, thesediscussions start off with a subject to give you someclue as to what they might be about.

Usenet is open to all, which is both good and bad.Usenet can be a most valuable source of information,but you cannot rely on the quality of that informationstraight off. It takes a little time, but after a while youlearn whose views are worthwhile.

Usenet is used for more than just messages; youcan also find a wide variety of data files, likesoftware, graphics or audio tracks. These are to befound in binary groups. Often a discussion group willhave a binary group attached, so comp.sys.psion willinclude a comp.sys.psion.binaries group where peoplecan exchange files.

Usenet can be accessed via a specialist client or

Free access NNTP serversSometimes your ISP’s NNTP server may not quite fit your requirements; it may notcarry the groups you are looking for, or it just may not be very well run. There aresome free access NNTP servers, which may offer a solution, one of which isFreeNews (IP address 202.85.164.51).

Paid for NNTP serversShould Usenet becomes a must have facility foryou, but your ISP still doesn’t provide anacceptable server, then you have the optionpaying for access to an NNTP server. There aremany Usenet groups available and the majority ofISPs will only carry a subset of these groups, eitherfor political or financial reasons. If your hunger forUsenet demands a ‘full feed’, then you mightconsider subscribing to one of the subscriptionservices like http://www.supernews.com/ to namebut one.

Page 24: linux magazine 15

FEATURE

25LINUX MAGAZINEIssue 15 • 2001

through Web interfaces, probably the best knownbeing DeJa News, which is now owned by Google. Ifyou were to use a standalone client you would thenneed access to an NNTP server. Luckily, most ISPs runtheir own servers, so this shouldn’t be a problem.You will need to know the IP address, or the serversname at least, which will need to be entered into thisconfiguration file.

How you use Usenet depends very much on whattype of link you have to the Internet. If you have apermanent connection, then you will probably accessthe NNTP servers directly. If you’re not so lucky andyou rely on a dial-up Internet connection, you maywant to consider running your own local NNTP serveras well, using something like Leafnode. Some of theUsenet clients also have support for off-line browsingbuilt in.

MozillaIf you are already using Mozilla as your Web browserand email client, then there is very little you need todo to start using it as your Usenet client as well. Fromthe main window select Edit/ Mail/ News accountsettings, New Account, and select a NewsgroupAccount. All you need is the name of the Usenetserver from which you are going to obtain your news,the rest you can make up. Make sure you are online,click on the server entry in the listing and Subscribeto Newsgroups. If this really is the first time you haveconnected to this news server, then a list ofnewsgroups will now be downloaded, which cantake a few minutes, especially through a dial-upconnection. Once downloaded, you can then start tochoose groups to subscribe to.

You can browse through this list, which could takea while, or you can reduce the list to a moremanageable size by including some keywords.Subscribing to a group will add this to your list. Clickon this group from the list and the latest messageheaders will be downloaded. Click on a header andyou can read the body of the article. Articles thathave follow-ups and replies will usually be nested in atree structure, which is automatically opened if youstart to read a message in that chain. You can reply

and forward messages just like you would with email.You can now read your messages while online, but

this is a time consuming task, tying up the telephoneline and possibly costing you a packet. You canconfigure Mozilla to download the headers andbodies by default. Settings for this can be found inthe offline menus. Should the newsgroup be verybusy, you may not want to download all of it, inwhich case you can flag the message headers you arekeen to see the bodies for and then download thesein one batch. The off-line features in Mozilla areimproved from previous versions and are much betterthan those found in Netscape 4.x.

If you are just interested in finding out aboutUsenet and you already use Mozilla (or Netscape –the functioning of the two is very similar) for emailthen using its News features would be a good placeto start.

KnodeKnode comes with the KDE desktop environment andso would integrate seamlessly if that’s theenvironment you are using. Knode, according to theWeb page, is GNKSA compliant, but hasn’t been

You won’tneed to bebotheredwith the

vast numberof groupsavailable,

yousubscribe

only to thegroups youthink you

will beinterested in

Saving time with LeafnodeMuch of your time with Usenet will be taken up by reading text, which is a slowprocess at best. If you’re using a dial-up Internet connection then this can bewasteful of your telephone resources. Ideally, you want all of the most recenttexts from Usenet downloaded in one batch so that you can read them offline.Leafnode enables you to do just that, by downloading all of the new messages ina group that you have recently shown an interest in. These are then kept locallyso that your client can access them. So, instead of configuring your Newsbrowser to contact the server directly, you ask it to look to your local machine.

Mozilla - subscribing to some Usenet newsgroups.

Subscribing to NewsgroupsTo help you limit the amount of News that you download, you subscribe only tothe Usenet groups of interest to you. The newsgroups have room descriptions, ifyour News server supports them, to help you to further decide if a certain roomis dealing with your subject.

Looking for groups to subscribe toAny self respecting Usenet newsreader client will enable you to search fornewsgroups, either by looking just at the group names, or occasionally by groupdescription as well. On one server, the keyword ‘Linux’ produced a list of 367different groups – not all will be active, not all will be in English and you can’teven rely on all of them to be referring to Linux as we know it, but at least it’s amanageable size. Groups that every self-respecting Linux Usenet reader shouldsubscribe to include: comp.os.linux.announce and uk.comp.os.linux.

Page 25: linux magazine 15

Message headersUsenet messages, much like email messages, come in two parts, the messageheader and the message body. Unlike email, which is, hopefully addressed to youand of relevance to you, a Usenet message often might not be as relevant.Because of this, Usenet clients will usually only download the message headersfirst, you then decide which bodies are worth getting.

words of wisdom are sent out to the world to beviewed by all and sundry, anything that might havebeen hastily said, or even downright wrong, couldhaunt you for some time to come. Here you are giventhe functions needed to send special controlmessages to Usenet which enables you to cancel, orat least update, your previous posts.

PanPan is part of the GNOME project but can be usedwith other desktop environments so long as thecorrect libraries are installed, which in mostdistributions they are. Pan has good support foroffline browsing, so, if you don’t have a permanentconnection to the Internet and are bothered aboutsetting up a local server like Leafnode, then Panmight be the choice for you.

The Pan developers are proud, and rightly so, oftheir 100 per cent mark of approval from the GoodNet-Keeping Seal of Approval evaluations team;making it the only Unix reader that can make thisclaim, at the time of writing.

Pan gives you many choices as to how you want todownload your messages: you can download fullbodies with headers on a per newsgroup basis, orflag messages and download them in a batch formfor offline reading. You are given control of how andwhen Pan will try to make contact to the specifiedUsenet server, which is important if you haveconfigured your system as dial on demand.

Pan also offers a full range of filtering features(Bozo and Spam), with which you can easily avoid themore noisy and bandwidth-wasting participants ofUsenet.

FEATURE

26 LINUX MAGAZINE Issue 15 • 2001

reviewed as yet. It has support for MIME and usefullysupports multiple servers, which enables you toincrease the groups you can access should you beunfortunate enough to have to use an NNTP serverwith restricted content. It will deal with imagesonline, as can be seen in the screenshot, which issomething that Mozilla doesn’t yet support.

Knode is designed to be used as an online browseronly, so you either need a permanent Net connectionor run your own local NNTP server like Leafnode. Ithas the full set of features that you need to take fulladvantage of Usenet.

Knode can sometimes download binaries inmultiple parts, which may make it easier to deal withthan with Mozilla. If you are interested in taking a lotof data files from Usenet then use one of thestandalone programs like bgrab.

You can score articles, which enables you to easilycut through the noise on Usenet groups and followthose articles that are of interest to you. You create aset of rules, which can follow articles, or follow yourfellow posters if they always seem to have pearls ofwisdom. By doing this, these interesting messagescan by highlighted so they are easier to spot.

You are also given access to features such ascancelling and superseding articles. Because your

Knode: Not all thegraphics onUsenet are

unsuitable for afamily magazine.

Pan, with some messages highlightedfor a future batch download

GNSK

The Good Net-Keeping Seal of Approval 2.0 (GNSK for short) is an independentset of criteria, which should be thought of as the minimum requirements to makean NNTP News client useful. A useful source of information.http://www.xs4all.nl/~js/gnksa/gnksa.txt

InfoMozilla: http://www.mozilla.org/releases/Knode: http://knode.sourceforge.net/Bgrab: http://www.student.dtu.dk/~c960941/bgrab/Pan: http://pan.rebelbase.com/

Page 26: linux magazine 15

FEATURE

28 LINUX MAGAZINE Issue 15 • 2001

A little light music

STUDIO TIME

Bored with the usual chart fodder, we decided tomake a fortune with Linux by producing thenext big song at home. Having listened to MTV

we feel we could do better. To make our masterpiecewe could arrange for an ensemble of sessionmusicians to perform the music while we record it.Getting everyone to play perfectly at the same timecan be frustrating, so it is usually better to try andrecord individuals and then layer these tracks on topof one another. This allows finer control of variablessuch as volume and the ability to cut and pastesections. However we want to avoid the expensivestudio costs and session musicians and are going toproduce the sounds ourselves electronically.

We could start by using editors to rearrange .wavfiles, but this would be very tedious. Better still wouldbe to generate our own sounds with an attachedmusic keyboard.

A synthesiser is an electronic device designed toproduce synthetic sounds. We could use frequencymodulation to generate sound waves, as this is usedfor some electronic music. A more popular method isto use sounds of real instruments that have beenrecorded. The use of these samples is referred to aswave table synthesis. Typically we may use a music

Making music with

Linux is now

becoming easier. Soon

we could all be the

next number one. Jack

Owen looks at the

possibilities of MIDI

on Linux

keyboard to act as an input device. The keyboard actsas a controller to the sound generating hardware(your computer). Together the keyboard and thesound generator make up a synthesiser.

We are not limited to just using keyboards,however. With the MIDI protocol we can connectmany devices together to generate the sound output.However we can go one stage further, as thecomputer can act as a sequencer.

The sequencer enables you to take input (from thekeyboard or program file) data and rearrange it inwhatever order you choose. It is usually capable ofediting, rearranging and storing the data. It can thensend the data as a finished arrangement to the soundgenerator to play.

MIDI is a data communications protocol. ThisFigure 1: The

Jazz++ sequencer

Figure 2: PianoWin

Figure 3: Random noise

Page 27: linux magazine 15

FEATURE

29LINUX MAGAZINEIssue 15 • 2001

defines the rules by which electronic musicalinstruments communicate. Examples of these musicalinstruments (devices) are synthesisers, keyboards,effect processors, recording machines andsequencers. The MIDI specification defines the formatof the signals flowing from one device to the other.Such signals are commonly referred to as MIDImessages, each carrying a MIDI event. Theinformation of an event would for example be “playnote A at velocity 75” or “stop note A” or “changesound to acoustic piano”.

First we need to generate some music samples. Wecan connect a music keyboard to a Linux box with astandard MPU-401 port (this is the joystick port onyour soundcard).

By using a program such as Jazz++ (See Figure 1)we can record whatever we play on the keyboard. Ifyou do not own a music keyboard, or do notconsider yourself an accomplished player, all is notlost. You can enter notes one by one with a noteeditor such as pianowin (See Figure 2). This enablesus to choose the note and its start and stop periods.Although this may seem a long process we only haveto enter a few samples as later we will reuse andrepeat the samples to build up the music track. If thisis too much of a chore you could always opt for therandomly generated rhythm feature.

At this stage we have a file that represents a soundtrack in the computer. Once we have made up ourtrack we can change to the sequencer section wherewe can start to lay down the tracks in whatever orderwe choose. We can modify the sound sample so theoutput sounds however we want it to from a highflute sound to a series of screams. We can nowrepeat the process and produce as many of thesetracks as we want.

Using the editor feature we can then layer these

on top of one another. The resultingoutput file will now be ourmasterpiece. An example of the type ofoutput that can be achieved withJazz++ can be found on the CD in themusic directory.

Now we have made our tune wereally need to let everyone know aboutit. Being good Open Source people weobviously want to release it as an OggVorbis file. Ogg Vorbis files are similarto those of MP3 file types except theydo not suffer the copyright restrictions.Until the end of the year the BBC are streamingRadio 1 and occasionally Radio 4 as Ogg Vorbis files.The streamed sound is not CD quality but is excellentfor radio. You will however save your own track witha higher sample rate so it is CD quality.

To convert your tune to Ogg Vorbis you need touse the Oggenc tool from the Vorbis tools package.The command to use the encoding codec is:

oggenc farbettr.wav

To play this use either the Ogg codec built into xmmsor the command:

ogg123 farbettr.ogg

This now brings us to publishing free music. TheElectronic Frontier Foundation has published an OpenAudio License and examples of music released underthis license can be found at the Open Music Registry.

Another free license system is the OpenMusicsystem. This produces two licenses depending on thelevel of use required. Sadly the Web site is currentlydown but on the coverdisc we have included thetrack Penguin Planet by Void Main. The authorDennis Gustafsson is a strong supporter of GNU/Linuxand you can visit his web site athttp://mp3.com/voidmain

So now we have produced a top ten hit, given itaway and everyone is talking about it. A local musicsociety would like to perform it and ask for the score.Again you could write it out by hand or let Linuxcome to the rescue. With plain text input we can usethe music typesetter Lilypond. A more recentprogram is Rosegarden, which also features a MIDIsequencer.

Infohttp://www.gnu.org/software/lilypond/http://www.all-day-breakfast.com/rosegarden/http://www.openmusicregistry.org/http://www.eff.org/IP/Open_licenses/eff_oal.htmlhttp://www.jazzware.com

Figure 4: Streaming Ogg Vorbis encoded BBC Radio 1

Figure 5: Outputfrom Lilypond

Figure 6: Rosegarden scripting

Page 28: linux magazine 15

ON TEST

37LINUX MAGAZINEIssue 15 • 2001

Pooking through the manufacturers’ informationyou notice one thing above all: manufacturersstill haven’t stopped thinking in terms of billions

of bytes instead of actual gigabytes. By now thedifference is a hefty seven per cent, which means so-called 100Gb disks actually provide a capacity of justover 93Gb.

The manufacturers have also cranked up thecaches. One immediate consequence of this is thatwrite access is almost invariably interceptedsuccessfully. Our test results should therefore betaken only as guidelines rather than cast-iron speedvalues. All testing was carried out with defaultcache configurations. For a more reliable indicatorof the speed of each medium you need to look tothe read rates.

100Gb hard disksAt the top of the 100Gbrange, we’ve placed thebrand new disk fromWestern Digital.Although its 100Gbcapacity only equates to93Gb in real terms, thisis still a pretty tidyamount to be getting onwith; enough to store

over 1,000 CDs in MP3 format (more than most usersactually own) or a fair few hours of digital video.

Western Digital’s WD1000 disk is not only big, it’salso fast. A transfer rate of 38.6 Mb/sec is a goodresult for an ATA hard disk, which only few achieve.At 48.1 Mb/sec, writing is not exactly slow either. Theaccess time of 14.6 milliseconds (including operatingsystem overhead and latency) is also among thebetter results in its class.

To wrap things up nicely powerusage is low at an average of only7.5 Watts. All in all, the price of£225 seems perfectly acceptable.

ATA IDE hard disksIBM is the winner in this category.The IC35L060 disk stands outfrom the crowd during testingdue to several characteristics. Forone thing its read rate is good, avery respectable 38.1 Mb/sec.

Although its little 40Gb brother IC35L040 is slightlyfaster, the L060 is more attractively priced. Accesstimes are also well within acceptable limits at 12.7milliseconds, making this hard disk quite enticing,especially with its low power usage of only 6.3 Watts(on average) and a tolerable noise level of 48.5 dB(A).Overall, this hard disk is an attractive mass storagedevice at a reasonable price.

Oliver Kluge and

Mirko Dôlle introduce

21 current hard disks

in three categories:

ATA IDE, SCSI and

Notebook disks

Hard disks

DISK PARADE

Page 29: linux magazine 15

ON TEST

38 LINUX MAGAZINE Issue 15 • 2001

Ultra SCSI hard disksThe ST373405LW hard disk from Seagate is

something of a speeddemon. Its test resultof 53.6 Mb/sec maywell make it a recordbreaker. Include theUltra SCSIconnection into theequation and youcannot help butconclude that thishard disk is almostcrying out fordatabaseapplications, which

demand a lot of powerfrom disks. The write rate is also very good at 41.7Mb/sec, as is the access time at 15.6 milliseconds.

With such a fast disk you’d expect energy usage tobe a little higher, but at 9.7 Watts it’s hardlyexcessive, even if the heat given off is starting to benoticeable. There is also perceptible operationalnoise, which is not exactly loud but somewhatpersistent – hardly a problem in a server, however.

Notebook hard disksPortable computers make their own demands onhard disks. One of the most important is powerusage. At 2.5 Watts IBM’s device is a bit hungrierthan others in the test. However, this hard disk offerssomething few others do: more than 45 Gb ofstorage capacity,which is anawful lot for anotebook. At thissort of size youcan fit more onto a machinethan just anample operatingsystem with lotsof presentationsand videos – youcan take almosthalf a server withyou as well. Onthe other hand, 17.2 milliseconds access time is arather ordinary result for a hard disk in this category.Considering the performance on offer the priceseems justified.

ATA IDE

Western Western Western

Manufacturer IBM IBM Maxtor Maxtor Maxtor Seagate Seagate Digital Digital Digital

Model IC35L040 IC35L060 4W100H6 5T040H4 D540X-4K ST360020A ST380021A WD1000 WD600 WD800

Web site www.ibm.com www.ibm.com www. www. www. www. www. www. www. www.

maxtor.com maxtor.com maxtor.com seagate.com seagate.com wdc.com wdc.com wdc.com

Price† £90.00 £135.00 £260.00 £120.00 £175.00 £120.00 £175.00 £225.00 £140.00 £175.00

Capacity

(manufacturer) 40Gb 60Gb 100Gb 40Gb 80Gb 60Gb 80Gb 100Gb 60Gb 80Gb

Capacity

(laboratory) 38.3 Gb 57.2Gb 93.3Gb 38.1 Gb 74.5Gb 57.2Gb 74.5Gb 93.1Gb 55.8Gb 74.5Gb

Interface ATA-100 ATA-100 ATA-100 ATA-100 ATA-100 ATA-100 ATA-100 ATA-100 ATA-100 ATA-100

Form factor 3.5 inch 3.5 inch 3.5 inch 3.5 inch 3.5 inch 3.5 inch 3.5 inch 3.5 inch 3.5 inch 3.5 inch

Transfer rate read

[Mb/sec] 39.2 38.1 30.3 37.2 32.8 29.1 40.5 38.6 32.2 30.2

Transfer rate write

[MB/sec] †† 36.8 36.8 15.8 17.8 40.3 37.5 47.9 48.1 38.5 38.7

Access time [ms] 12.9 12.7 16.4 13.3 21.5 21.7 15.6 14.6 16.8 4.4

Power [W] 6.3 6.5 5.0 6.2 4.8 5.2 7.0 7.5 6.1 7.5

Noise [dB(A)] 48.3 48.5 35.0 33.0 36.0 38.1 34.9 35.1 38.8 37.1

(†) Prices are as a guide only and are not inclusive of VAT (††) Write cache with default configuration

Technical data

Page 30: linux magazine 15

ON TEST

39LINUX MAGAZINEIssue 15 • 2001

Ultra SCSI Notebook

Fujitsu IBM IBM Seagate Seagate Seagate Hitachi IBM IBM Toshiba Toshiba

MAN3367MP DDS-T18350 DDS-T36950 ST318437LW ST318451LC ST373405LW DK23CA-30 IC25N030 IC25T048 MK2017GAP MK3017GAP

www. www.ibm.com www.ibm.com www. www. www. www. www.ibm.com www.ibm.com www. www.

fujitsu.com seagate.com seagate.com seagate.com hitachi.com toshiba.com toshiba.com

£290 £140.00 £290.00 £195.00 £195.00 £550.00 £225.00 £210.00 £340.00 £105.00 £120.00

36.7Gb 18.4Gb 36.7Gb 18.4Gb 18.4Gb 73.4Gb 30Gb 30Gb 48Gb 20Gb 30Gb

34.2Gb 17.1Gb 36.7Gb 17.1Gb 17.1Gb 68.3Gb 27.9Gb 27.9Gb 44.7Gb 18.6Gb 27.9Gb

Ultra 160 Ultra 160 Ultra 160 Ultra 160 Ultra 160 Ultra 160 ATA-100 ATA-100 ATA-100 ATA-100 ATA-100

3.5 inch 3.5 inch 3.5 inch 3.5 inch 3.5 inch 3.5 inch 2.5 inch 2.5 inch 2.5 inch 2.5 inch 2.5 inch

47.7 34.0 33.2 37.1 39.9 53.6 20.6 19.8 19.9 20.3 20.5

64.8 43.6 40.8 46.7 30.0 41.7 23.4 20.6 23.2 23.5 23.7

8.6 9.8 9.4 13.4 7.4 9.3 20.1 18.8 17.2 21.1 22.3

9.3 11.6 12.2 6.6 12.0 9.7 2.4 1.9 2.5 2.5 2.5

36.1 41.1 43.2 36.1 42.2 39.1 27.8 27.1 27.2 28.4 27.0

IBM IC35L040 12.9

IBM IC35L060 12.7

Maxtor 4W100H6 16.4

Maxtor 5T040H4 13.3

Maxtor D540X-4K 21.5

Seagate ST360020A 21.7

Seagate ST380021A 15.6

Western Digital WD1000 14.6

Western Digital WD600 16.8

Western Digital WD800 14.4

Fujitsu MAN3367MP 8.6

IBM DDYS-T18350 9.8

IBM DDYS-T36950 9.4

Seagate ST318437LW 13.4

Seagate ST318451LC 7.4

Seagate ST373405LW 9.3

Hitachi DK23CA-30 20.1

IBM IC25N030 18.8

IBM IC25T048 17.2

Toshiba MK2017GAP 21.1

Toshiba MK3017GAP 22.3

Diagram: Access times [ms]

IBM IC35L040 39.2

IBM IC35L060 38.1

Maxtor 4W100H6 30.3

Maxtor 5T040H4 37.2

Maxtor D540X-4K 32.8

Seagate ST360020A 29.1

Seagate ST380021A 40.5

Western Digital WD1000 38.6

Western Digital WD600 32.2

Western Digital WD800 30.2

Fujitsu MAN3367MP 47.7

IBM DDYS-T18350 34.0

IBM DDYS-T36950 33.2

Seagate ST318437LW 37.1

Seagate ST318451LC 39.9

Seagate ST373405LW 53.6

Hitachi DK23CA-30 20.6

IBM IC25N030 19.8

IBM IC25T048 19.9

Toshiba MK2017GAP 20.3

Toshiba MK3017GAP 20.5

Diagram: Transfer rate read [Mb/sec]

Page 31: linux magazine 15

ON TEST

32 LINUX MAGAZINE Issue 15 • 2001

The latest offering from Red Hat is based on the2.4.7 kernel. The standard version costs £70.80and comes with seven CD’s. Of these one was

documentation and one had demo versions of twoLoki games (Kohan and Rune). Red Hat itself came onfour discs with the final disc offering StarOffice 5.2 infive differing languages.

The documentation CD again supports lots oflanguages and as well as the expected HOWTOdocuments the two supplied booklets also have a RedHat customisation guide. The only disappointment isthat the Red Hat network guide is only viewableonline, in either HTML or PDF format.

The Professional version of Red Hat 7.2, whichweighs in at £176.40, has four additional CDs and aDVD. The CDs cover two discs of applications, a Webserver CD and a system Admins CD.

Of the 2,000+ packages some big changes havebeen made. KDE 2.2 is shipped along with GNOME1.4. The other big change is XFree86 4.1, whichmakes the most of new graphics card such asGeForce3 and G450 chipsets and adds a 1400x1050resolution. The biggest change, however, is that thenew ext3 journaling system is supported. Althoughother filesystems are available for Linux (XFS, JFS, andReiserFS) Red Hat supports and champions the ext3system. This allows easy conversion without data lossfrom existing ext2 partitions. Transition is straightforward as in reality the new journaling system is anextra layer on top of the ext2 system. The gain inusing journaling systems is most apparent when you

Red Hat is often seen

as synonymous with

Linux, but does the

latest version justify

its position as the

industry standard?

Janet Roebuck takes

a long hard look at

Red Hat 7.2

Red Hat Linux 7.2

STANDARD BEARER

have a crash. Recovery of information is very quick.And although it is not designed for it, the journaledsystem allows for fast restarts on a laptop.Both Netscape 4.78 and Mozilla 0.9.2 are included aswell as a host of KDE application upgrades.

Don’t be put offDocumentation is limited to two small booklets,which means there’s physically not a lot to show forthe cost. But don’t let that put you off. The first 150-page booklet on installation explains the standardinstall, a text install and a system upgrade. A niceappendix on disk partitions is well written in clearlogical English. The 200-page getting started bookletgets any new or intermediate user up and using mostof the tasks very quickly.

Where Red Hat excels is with its support forGNOME. The latest version 1.4 is supplied with theNautilus file manager. This always seems slow to startcompared to the KDE desktop. This is due to theway Nautilus can be used to view files. The filemanager has the ability to show information about afile such as a thumbnail picture of an image or play amusic file. This ability to drill down to information

Figure 1:Firewall

configuration

Page 32: linux magazine 15

ON TEST

33LINUX MAGAZINEIssue 15 • 2001

obviously has a hit on performance speed but withfaster processors this is less of a worry than it was afew months ago.

One of the major reasons for buying the Red Hatdistribution is the Red Hat Network. Through theWeb you can update your system and so always keepahead in the security stakes. By following thegraphical wizard you can register very quickly. Thisallows you to compare your system against the latestpackages at Red Hat and upgrade if necessary. That’sall very well if you are proactive as it allows youcomplete control. You have a choice on how youupdate your system and even location to do so. Whatwe like is the Red Hat Errata Alerts. These now popinto my email account and tell me whatever is ofimportance. They come in little groups and averageabout one a day. An example can be seen in theErrata Alerts boxout.

No problemsThe installation is as expected flawless and we cannothelp but judge all other distributions against Red Hat.That is not necessarily because Red Hat is the bestbut that it is the standard. By being the standard ithas to maintain its reputation. This is done admirably,as Red Hat is a good all round system. The lack ofcute penguin characters does not mean it is not funfor home users. The support and documentationavailable mean that developers will not miss out andthe support packages mean that any business wouldbe happy. As a system to run straight out of the boxwe could not find anything wrong. It found all ourhardware and worked without a flaw. The firewallconfiguration allowed some flexibility as can be seenin Figure 1. We did like the new animated cursorsalthough for how long they will amuse and notbecome an annoyance remains to be seen.

The range of packages that come with moderndistributions is now so large that no review couldever do more than scratch the surface. Fips issupplied to partition hard drives. The KDE has somenice utilities supplied such as Krayon for drawingpictures and Kugar for viewing XML data. I noticed allthe usual packages and some that I had not yet

played with such as the wireless tools and theReiserfs tools.

Some complaints have been voiced that the buyingpublic assume Linux only means Red Hat. This is goodfor Red Hat and means their marketing is reachingpeople. If they then buy Red Hat it is still Linux andbeing a good product will not turn them away. All inall, the product is solid and will encourage a newgeneration of Linux users.

From: Red Hat Network Alert [email protected] 31/10/01 00:51Subject: RHN Errata Alert: New teTeX packages availableTo: me

Red Hat Network has determined that the following advisory is applicable to oneor more of the systems you have registered with the Software Manager service:Security Advisory – RHSA-2001:102-10Summary: New teTeX packages availableDescription: A flaw has been discovered in the temporary file handling of someof the scripts from the teTeX set of packages. This can, under somecircumstances, lead to a compromise of the groups that LPRng runs as. Severalscripts used the current process ID as temporary file names and have now beenaltered to use the ‘mktemp’ program instead.

Additionally, an insecure invocation of the ‘dvips’ program has beendiscovered in the print filter used for handling DVI files. This has been correctedto use the -R option.

The temporary file-handling flaw affects Red Hat Linux 7.1 and earlier. TheDVI print filter problem affects Red Hat Linux 7.0 and earlier. This vulnerabilitywas discovered by zen-parse.Taking ActionYou may address the issues outlined in this advisory in two ways:– log in to Red Hat Network at https://rhn.redhat.com and from the listingshowing under ‘Your RHN’ select the affected servers and download or schedulea package update for that system.– run the Update Agent on the affected machine.There is one affected system registered in ‘Your RHN’ (only systems for whichyou have explicitly enabled Errata Alerts are shown).Release Arch Profile Name7.1 i586 my.system

Errata Alerts

Registering with the Red Hat Network

The KDE desktop and KOffice on Red Hat

Page 33: linux magazine 15

BOOK REVIEWS

68 LINUX MAGAZINE Issue 15 • 2001

The Sair/GNU Linux certificationprogram is aimed as a vendor neutral

exam system to give Linux a morecredible training path. To become acertified engineer you are required topass the core concepts and practicesexam plus three elective exams. Thisbook covers the Apache and Webservers elective exam and is split intoseparate sections, which deal withdistinct topics such as installation orsecurity. Each section is given a chapter,which explains the basic information.There then follows detailed exercises towalk you through all areas you need tocover and practice questions andanswers to prepare for the exam. At theend of the book you’ll find a sampleexam, which is in multichoice format.

The book covers Red Hat, Debian and

Slackware distributions and providesreference data of where to downloadutilities and files. As a study book thechapters cover enough information tocomplete the test exam supplied. As areference book for Apache it doessurprisingly well. As the information isaimed to be a crammer it means allinformation is relevant and so gets youup to speed quickly. Some slightAmericanisation of spelling is noticeablebut a nice glossary at the back is worthreading.

SAIR LINUX AND GNU CERTIFICATION:

Author Sair Development TeamPublisher Wiley Computer PublishingPrice £39.99ISBN 0-471-40537-X

For all the new users of Linux outthere who are looking for a good

introduction to the subject (andanyone else who has not already comeacross it), although it has been aroundsince 1997, there is still nothing betterthan A Practical Guide to Linux byMark Sobell.

The book has a forward by LinusTorvalds and he recommends it toanyone interested in learning aboutLinux.

The first part of the book is perfectfor new users as it features anoverview of Linux and then anextensive tutorial to guide the newuser through starting to use thesystem. The latter part of the book isaimed at the more experienced userand goes into more detail on subjects

such as GUI’s, networking and systemsadministration.

The second section of the bookdescribes various utilities includingexamples to be downloaded from theInternet. There is a very compre-hensive appendix, written as FAQ’s tohelp the new user withtroubleshooting. All in all, this is aclassic textbook, clearly written andwith much to recommend it even toexperienced users, which has retainedits place at the front of the field.

Author Mark G. SobellPublisher Addison-WesleyPrice £32.99ISBN 0-201-89549-8

A PRACTICAL GUIDE TO LINUX

Page 34: linux magazine 15

KNOW HOW

30 LINUX MAGAZINE Issue 15 • 2001

Last month we took a close look at GIMP, theGNU Image Manipulation Program, andsuggested using it instead of Photoshop. This is

fine, but unless you’re in a design studio with manycomputers, you probably use your Mac for a wholelot else besides Photoshop. After you’re finishedtinkering with your photos in GIMP, what next? Youcould reboot into the MacOS, but this begs thequestion why use Linux at all? Why not just stickwith Photoshop on the Mac OS? Well, what elsecan you do in Linux on a PPC machine? This monthwe’ll be taking a very quick look at some greatPPC/Linux applications.

Okay, so you are

using Linux on a

Macintosh. The

chances are that it’s

not a server, so what

do you do with it?

Jason Walsh

investigates

There’s more to PPC/Linux than just GIMP

Web browsingFor all intents and purposes, UNIX is the Internet. Okay, so themajority of professional Web sites are still designed on Macs, butit’s UNIX that does most of the serving thanks to its rock-solidnetworking capabilities. You’d therefore expect that UNIXvariants such as Linux would have plenty of Internet applicationsand you’d be right – even on a minority platform such asPPC/Linux. Here we’ll look at just one of the most popularInternet activities, Web browsing. After all, no matter whatversion of Linux you have installed on your Mac, it has comewith plenty of email applications.

OperaOpera Software have released its popular and light Opera Webbrowser version 5.0 final for the PowerPC in free adware or $25shareware versions. Like its x86/Linux, Mac OS and Windowscounterparts it’s stable, quick and has a decent interface.http://www.opera.com/linux

Netscape Communicator 4.x Netscape is the obvious choice of Web browser, and wasdoubtless included with your distribution. Netscape does have itsdownsides though. It crashes frequently and is rapidly dating, butthat’s not where it ends. The PPC version of Netscape cannot useNetscape plug-ins. Bizarre, but true. Nevertheless, Netscape

Communicator remains a safe choice as it’s familiar, differs littlefrom the Mac and Windows versions and interprets HTML well.http://home.netscape.com/download/0709101/10000-en——_qual.html

Mozilla Mozilla is the open source follow up to Netscape. Abandoning themajority of the old code, Mozilla is a rewrite from the ground upand includes the famous Gecko display engine. It is a veryserviceable browser, though the package size is enormous andyou’ll need a fairly hefty Mac if you want to see good results.Unlike its predecessor, it can thankfully use Netscape plug-ins.GNOME office uses a version of Mozilla named Gaelon as itsstandard Web browser.http://www.linuxppc.org/software/index/developers/mats/RPMS/ppc/mozilla/nightly/mozilla-pre0.9.3/mozilla-pre0.9.3-0.ppc.html

Konqueror Part of the KDE environment, Konqueror is an excellent littlebrowser and unlike Netscape it can use Netscape plug-ins. Hmm.This application is installed by default by most distributions sowhy not give it a try? If nothing else it’s a cut above the previousKDE effort. http://www.kde.org

Apple Mac:Applications for PPC/Linux

FORBIDDEN FRUIT

Page 35: linux magazine 15

Other picks

KNOW HOW

31LINUX MAGAZINEIssue 15 • 2001

The Mac is famed for kick-starting thedesktop publishing boom in the 1980s, andrightly so. The intuitive GUI and applicationssuch as MacPaint, Pagemaker and evenClarisWorks allowed a whole new set ofuses for desktop computers. So what ifyou’re switching your Mac over to Linux,even part time? Do you have to sacrificeyour productivity to play with this newoperating system? Of course not. Whilethere are no direct replacements here forthe behemoths of publishing such as QuarkXPress or Adobe InDesign, there are plentyof alternatives to AppleWorks and MicrosoftOffice, and if you take care you can getexcellent results.

Most Linux users on the Intel platformuse either Sun StarOffice or CorelWordPerfect Office, unfortunately neitheris available for PPC/Linux. Both aredependent on x86 specific code andCorel’s effort even uses WINE emulationso it is unlikely to ever make it toPPC/Linux.

Open Office.orgProgress. Open Office.org is the open sourceversion of StarOffice and thankfully there isa build for the PPC chipset. It is easilycomparable to Microsoft Office in terms ofusability, features, and also, sadly, bloat.However, if you need a professional office

suite for no cost, this is your best bet.However, it is still under heavy development.Open Office.org consists of a wordprocessor (Open Writer), a spreadsheetapplication (Open Calc), a vector illustrationprogram (Open Draw) and a presentationapplication (Impress). The plan for this suiteof applications is to integrate it withGNOME Office.http://www.openoffice.org/dev_docs/source/build_638c/build638c.html

AbiWordThis standalone word processor is thesingle application I use most regularlyunder Linux, and it will most likely remainso unless Nisus Software release a Linuxversion of their excellent Nisus Writer. Itlooks and feels a lot like the Windowsversion of Microsoft Word (though not atall like Word 2001 for the Macintosh) andthough it has less features and virtually nodocumentation, it is perfectly useable andmost importantly, stable. AbiWord is themain word processing component of theGNOME Office suite, which is includedwith most distributions.http://www.abisource.org

GnumericGnumeric is another GNOME Officeapplication built using the GTK toolkit. This

Excel-like spreadsheet is a fairly robustprogram and has the vast majority of thefeatures that normal users would ever want.Accountants may have to look elsewhere forthe time being as, like many open sourceefforts, it’s not quite finished. Smallbusinesses and home users will be right athome though.http://www.gnome.org/gnumeric

KOfficePart of the KDE desktop, KOffice is mostdirectly comparable to AppleWorks. That isto say, whilst very useable it doesn’t have allof the functionality of Microsoft Office. Thisis less of a mixed blessing than it sounds:MS Office is, frankly, overpowered foreveryday use. KOffice, usually installed bydefault, isn’t a resource pig and this is agood enough reason to consider it. It offersword processing, vector illustration andspreadsheet facilities among many otherfeatures, all suitable for SOHO use.http://www.koffice.org

ApplixwareApplixware is a commercial office suite andas such is well supported and easy to use,but if you’re using Linux for budgetaryreasons, forget it. This isn’t free in any senseof the word. http://www.applixware.com

Productivity

BOCHS BOCHS is an x86 emulator which enables you to runDOS, Windows and x86/Linux, should you feel so inclined.http://bochs.sourceforge.net/ http://www.bochs.orgxchat A graphical IRC client, which has reached version 1.8.1.http://www.xchat.org/files/source/1.8/Knapster2 for KDE2 Knapster2 is a clone of the WindowsNapster client and requires KDE. A pre-built RPM is availableonline.http://prdownloads.sourceforge.net/knapster/knapster2-0.3-1.ppc.rpmQCAD This excellent 2D computer-aided design software canbe recompiled to run on PPC/Linux. Instructions are availableonline.http://www.resexcellence.com/linux_icebox/08-01-01.shtmlHotJava Sun’s Java-based browser runs just fine on PPC/Linux,though it does require a working installation of Java(obviously).http://java.sun.com/products/hotjava/3.0/

Anti-productivitysoftware

There are more than a few ways towaste your time on PPC/Linux. TheSNES9x Super Nintendo emulator isavailable in pre-built form for PPC/Linux(http://www.snes9x.com/downloads.asp), as is Civilisation: Call to Power(http://www.lokigames.com/products/civctp/), which isn’t even available on theMacOS. Loki have also ported theexcellent war game Myth 2:Soulbinder(http://www.lokigames.com/products/myth2/). Bungie’s classicMarathon(http://www.uni-mainz.de/~bauec002/A1Main.html;http://source.bungie.org/) is also now opensource and runs on PPC/Linux.

A little bit moreThis short article has reallyonly scratched the surfaceof PPC/Linux software, buthopefully it’s given you ataste of what’s available.You may have to do a bitmore digging than x86users, but the software isavailable. ■

Page 36: linux magazine 15

KNOW HOW

34 LINUX MAGAZINE Issue 15 • 2001

QT

GETTING STARTEDWITH QT

23. main() is much thesame as in the previouscode we have looked at.When you run the programyou get something like inFigure 1. As you can see,the four buttons are linedup vertically in a nice neatfashion and they take upequal space in the window.Try editing out a buttonand recompiling, and youwill see that the space isaccommodated cleanly for each button again. Sohow does this magic work?

Well, if you look at line five, you can see we inheritQVBox. QVBox is a class for arranging widgets in avertical fashion and is very useful when you inheritfrom it as it will automatically arrange child widgetsinto a vertical layout. In this example we added pushbuttons as child widgets, but let’s also look atcombining QVBox with a QHBox (for horizontallayouts):

1 #include <qapplication.h>2 #include <qhbox.h>3 #include <qvbox.h>4 #include <qpushbutton.h>56 class MyClass : public QVBox7 {8 public:9 MyClass();10 ~MyClass();1112 private:13 QHBox * hbox;14 QPushButton * bobButt;15 QPushButton * fredButt;16 QPushButton * frankButt;17 QPushButton * jimButt;18 QPushButton * janButt;19 QPushButton * aprilButt;20 QPushButton * mayButt;2122 };23

Getting organisedTo get us started this month we take a look at someof the layout classes Qt has available for helpingcreate your interfaces. First, type in the followingprogram and compile it:

1 #include <qapplication.h>2 #include <qvbox.h>3 #include <qpushbutton.h>45 class MyClass : public QVBox6 {7 public:8 MyClass();9 ~MyClass();1011 private:12 QPushButton * bobButt;13 QPushButton * fredButt;14 QPushButton * frankButt;15 QPushButton * jimButt;16 };1718 MyClass::MyClass()19 {20 bobButt = new QPushButton(“Bob”, this);21 fredButt = new QPushButton(“Fred”, this);22 frankButt = new QPushButton(“Frank”, this);23 jimButt = new QPushButton(“Jim”, this);24 }2526 MyClass::~MyClass()27 {28 }2930 int main( int argc, char **argv )31 {32 QApplication a( argc, argv );3334 MyClass w;35 a.setMainWidget( &w );36 w.show();37 return a.exec();38 }

In this snippet of code we create four QPushButtonpointers on lines 12 – 15 (making sure to includeqpushbutton.h on line three). The actualQPushButton objects are then created on lines 20 –

Welcome to part three

of our foray into the

interesting world of

Qt application

development by Jono

Bacon. This month we

will take a long hard

look at geometry

classes for creating

interfaces and

examine how Qt deals

with interaction with

our widgets

Figure 1: Four buttonsequally spaced

Page 37: linux magazine 15

KNOW HOW

35LINUX MAGAZINEIssue 15 • 2001

24 MyClass::MyClass()25 {26 hbox = new QHBox(this);27 janButt = new QPushButton(“Jan”, hbox);28 aprilButt = new QPushButton(“April”, hbox);29 mayButt = new QPushButton(“May”, hbox);30 bobButt = new QPushButton(“Bob”, this);31 fredButt = new QPushButton(“Fred”, this);32 frankButt = new QPushButton(“Frank”, this);33 jimButt = new QPushButton(“Jim”, this);34 }3536 MyClass::~MyClass()37 {38 }3940 int main( int argc, char **argv )41 {42 QApplication a( argc, argv );4344 MyClass w;45 a.setMainWidget( &w );46 w.show();47 return a.exec();48 }

In this example I firstly added hbox.h as an includefile on line 2. I then created a pointer to a QHBoxobject on line 13, andcreated the object on line26. On lines 27 – 29 Icreated three moreQPushButton objects (theirpointers being declared onlines 18 – 20), but insteadof setting the parent to‘this’, I set it to ‘hbox’which is the name of theQHBox object. By setting the parent to ‘hbox’ of awidget, it is added to the layout manager specified inthe parent and is organised. So when we create aQHBox object on line 26, it is then housing the newthree push buttons horizontally at the top of thevertical manager. This can all be seen in Figure 2.

Layout management is something integral to Qtinterface design. We will cover more on interfacedesign in the next issue.

Connecting the pieces togetherOK, so we’ve now come quite far. We have discussedwidgets, layout, parent/child relationships and writtena couple of small programs. This is all fine and dandy,but our programs don’t actually do anything yet. Forexample when I click on a button, I want somethingto happen. To do this there is a comprehensiveframework built right into Qt called the Signal/Slotframework. This is a system of connecting widgets tofunctions so that when you do something somefunctionality can be associated with it.

The way signals and slots work is that each widget

(a graphical object on screen like a button) has anumber of signals. A signal is a function that isemitted when you do something with the widget. Forexample, to see the signals that are available forQPushButton’s, we need to look at the QButtondocumentation (as QPushButton is a type of QButtonand inherits it). We can see the following signals:

● void pressed ()● void released ()● void clicked ()● void toggled ( bool )● void stateChanged ( int )

So when a user clicks on a QPushButton, the clicked ()signal is emitted. We can then connect this signal to aslot. A slot is just a normal method that can do whateverneeded in response to the signal being emitted. So howdoes this work, you ask? Well to explain, lets look atsome code to get us started. You will need to usemultiple files for this code. Type the following code in:

myclass.h:1 #include <qapplication.h>2 #include <qhbox.h>3 #include <qvbox.h>4 #include <qpushbutton.h>56 #ifndef MYCLASS_H7 #define MYCLASS_H89 class MyClass : public QVBox10 {11 Q_OBJECT1213 public:14 MyClass();15 ~MyClass();1617 public slots:18 void slotJim();1920 private:21 QHBox * hbox;22 QPushButton * bobButt;23 QPushButton * fredButt;24 QPushButton * frankButt;25 QPushButton * jimButt;26 QPushButton * janButt;27 QPushButton * aprilButt;28 QPushButton * mayButt;2930 };3133 #endif

myclass.cpp:1 #include <qmessagebox.h>2 #include “myclass.h”34 MyClass::MyClass()

A slot isjust a

normalmethod

that can dowhateverneeded in

response tothe signal

beingemitted

‘’

Figure 2: Now with threenew push buttons

Page 38: linux magazine 15

slotname() ) );

We have the following code:

connect( jimButt, SIGNAL( clicked() ), this,SLOT( slotJim() ) );

First of all we do not need the QObject:: prefix as weinherit QVBox which in turn inherits QObject downthe line. We can see that the jimButt object (thebutton with “Jim” written on it) is the object we areconnecting a slot to. We are dealing with theclicked() signal in this connection. We could of courseuse any of the other signals, but clicked() is a goodone to start with. We then connect this signal to theslotJim() slot. We specify ‘this’ as the object whilstMyClass has the slot definition.

You may have seen some of the signals have aparameter such as toggled( bool ). This signal is forwhen the button is a toggle button and you want topass to the slot whether the button is toggled or notas the parameter. To use signals that pass aparameter, your slot MUST accept the sameparameter type. This may sound like a limitation butin practice it really isn’t: this feature is due to Qtbeing type safe which is a good thing. So forexample you could have the following connection:

connect( toggleButt, SIGNAL( toggled( bool ) ),this, SLOT( slotIsToggled( bool ) ) );

You could then use the slotIsToggled( bool ) slot likethis example:

MyClass::slotIsToggled( bool state){if( state == TRUE ){// do something}else{// something else}}

Wrapping things upWell, in this tutorial we have looked at layoutmanagers, signals in widgets, signals and slots and afew others things. We are well on the way now towriting more comprehensive Qt applications. Nextmonth we will build our first application based onthis knowledge and use Qt Designer to develop ourinterfaces. Until then, I suggest you read through theQt documentation and have a play with the differentsignals and methods available for widgets such asQPushButton, QLabel etc. Have fun!

KNOW HOW

36 LINUX MAGAZINE Issue 15 • 2001

5 {6 hbox = new QHBox(this);7 janButt = new QPushButton(“Jan”, hbox);8 aprilButt = new QPushButton(“April”, hbox);9 mayButt = new QPushButton(“May”, hbox);10 bobButt = new QPushButton(“Bob”, this);11 fredButt = new QPushButton(“Fred”, this);12 frankButt = new QPushButton(“Frank”, this);13 jimButt = new QPushButton(“Jim”, this);1415 connect( jimButt, SIGNAL( clicked() ), this,SLOT( slotJim() ) );16 }1718 MyClass::~MyClass()19 {20 }2122 void MyClass::slotJim()23 {24 QMessageBox::information( this, “Woohoo!”,“slotJim() has been called!\n”, “Cancel” );25 }

main.cpp:1 #include <qapplication.h>2 #include “myclass.h”34 int main( int argc, char **argv )5 {6 QApplication a( argc, argv );78 MyClass w;9 a.setMainWidget( &w );10 w.show();11 return a.exec();12 }

You will need to run the moc tool on the header file ifyou are building this by hand. See the Qt documenta-tion for details on this. Before we look at the code,let’s have a quick discussion of what moc actually is.

moc (Meta Object Compiler) is a little tool thatconverts some of the Qt signals and slots syntax intoregular C++ code, and it also does some other niftylittle things. You can see this code for example in theheader file where you see ‘Q_OBJECT’ and publicslots:. The ‘Q_OBJECT’ code indicates you are usingthe Qt object model (the signals/slots framework) inthis header file. Always put this at the top of anyclass that uses signals and slots. The ‘public slots:’part of the code indicates the following methods areslots that will be connected to signals. We have asingle slot slotJim() which is a method like any othernormal method.

Now let’s take a look at line 15. This line is wherethe actual connection between the signal and slotoccurs. It is in this format:

QObject::connect( object_that_emits_the_signal,SLOT( signal() ), object_with_slot, SLOT(

moc (MetaObject

Compiler)is a littletool thatconvertssome ofthe Qt

signals andslots

syntax intoregular

C++ code

Page 39: linux magazine 15

KNOW HOW

40 LINUX MAGAZINE Issue 15 • 2001

Paths enable users to define the outlines ofobjects or simple figures. Gimp’s path tool isbased on so-called Bezier curves, which may also

be familiar from other graphics programs. A Beziercurve is defined by means of two support points andtwo control points. In Figure 1 you can see roughlyhow the various points affect the curve. By placingseveral of these segments behind one another youcan draw more complex figures. Incidentally, if theend point of such a path coincides with its startingpoint this is known as a closed path.

It’s best to quit while

you’re ahead, so they

say, which is why this

is the last part of our

Gimp Workshop by

Simon Budig

GIMP WORKSHOP: Imageprocessing with Gimp: part 8

COLOUR RUNS

them will become visible. You can now drag out thesecond control point. In this way you can very quicklycopy the rough outlines of an image element. Withanother click on the start point, the path is closed.

Depending on where we click in the imagedifferent things will happen. If the path is closed andwe click inside it, the path is converted into aselection. We can now handle this as a normalselection. If we instead click outside, a newcomponent of the path starts. In this way we candefine a path covering several areas. Due to thecrude data structure inside Gimp it is unfortunatelynot possible to have several open components, whichwould be useful for arrows and suchlike.

Be careful when you try to correct an existing path.You can in fact, as is the custom in other programs,drag the control points through the locality with themouse. (Normally Gimp will move two opposingcontrol points symmetrically, but if you hold downthe Shift key they can be moved independently).However, in the case of support points this doesn’twork: instead of moving the point, the support pointsare dragged out again – I have ruined many pathsmyself in this way. To move a support point, you haveto press the Ctrl key at the same time.

With the four buttons in the upper part of thepath dialog (Figure 2), it is possible to toggle the Tool

Figure 1:Various types ofBezier curve

Figure 2: The various path tool buttons

Let’s get one thing out of the way before I start: Idon’t like Gimp’s path tool. I find it counter-intuitivein comparison with other programs and sometimeslimiting, but since it offers an important functionalityI will describe it here in detail.

Start Gimp and open a new image. Open theLayers, Channels & Paths dialog and select the Pathstab. Now activate the Bezier tool (the pen nib with acurve, on which a point sits) and click in the image.In the dialog there will now appear a new entry forthe current path. The first support point has alsoappeared in the image window. If you hold down themouse button you can drag the control point outfrom the support point.

If you click once more in the image area the secondsupport point appears and the Bezier curve between

Page 40: linux magazine 15

KNOW HOW

41LINUX MAGAZINEIssue 15 • 2001

between four operating modes. From left to right,these are the tools to:

● Create or continue a new path● Add nodes to a path● Delete nodes from a path● Modify the nodes of a path

If we click outside the nodes with the last three tools,Gimp automatically switches to the first tool. It ispossible to tell from the shape of the mouse pointerwhat will happen with a mouse click.

With a bit of practice, it is possible to adapt thepaths to a specified form. Click on the start point,drag the control point as appropriate, release themouse button and click on the next support point.Using different combinations of the Shift and Ctrlkeys, the position can now be adjusted and bothcontrol points can be placed independently of eachother. You’ll simply have to forget about trying tocorrect the third to last nodes again – or else you willhave to manually switch to the modify path tool (thefourth button).

What are paths for? I would like to give two smallexamples. For the first we will use an example imageof a bald eagle, the heraldic animal of the USA. Afterloading the image into Gimp we zoom into theimage a little, so we can place the points moreprecisely. Select the path tool and click on the upperedge of the neck, on the left edge of the image. Wehave to do a bit of guesswork here, as the image is

very dark. Now we create the path along the head.At the beginning we will have to place support pointson the tips of the feathers. At the places where theplumage is more close-fitting, fewer support pointsare needed since gentle curves can usually beapproximated nicely using the control points. InFigure 3 you can see the finished path.

As you can see, we have closed the path outsidearound the image. If the path is converted into aselection this guarantees that the selection alsoincludes the left lower corner. Otherwise the startand end point would be directly linked to each other,which would mean leaving out a triangular area.

Now we have the outline of the eagle in ageometric form, we can use it to draw fairly graphics-orientated logos. Create a new layer with a whitebackground and click on the third button under thepath list. The path is now converted into a selection.Using the colour fill tool, which I will describe indetail below, we can now fill the form of the eaglewith a colour fill. Deactivate the selection, select thepaintbrush tool with any paintbrush from thepaintbrush dialog and set red as foreground colour.We have used the calligraphy brush. Using the fifthbutton under the path list, the path will now befollowed by the current tool (Figure 4).

In this way, you can make fairly graphic elements outof photos. You can also export a particularly successfulpath into a file, and later insert it into another image,via the pop-up menu in the path dialog.

A few more comments on paths: Unfortunatelypaths are not scaled when you scale an image as awhole, but there is the option to change paths usingthe transformation tool. Click in the space to the leftof the path preview image and an image of a lockappears. If you now rotate or blur the perspective ofthe image using the transformation tool (rotation,scaling, shearing, perspection) the preview grid also

You canalso

export aparticularlysuccessfulpath into a

file, andlater insert

it intoanotherimage

‘’

Figure 3: Frame the eagle with the path

Figure 4: The eagle turns into a logo

Figure 5:Geometric pathtransformations

Page 41: linux magazine 15

which direction it is oriented. It’s not wildly excitingbut it’s certainly useful.

Now open the tool settings by double-clicking onthe tool icon (see Figure 7). From here you can nowset a multitude of options. Uppermost are the optionswhich are present in all painting tools: the opacity andthe paint mode. You may want to try out the Modesettings with another tool, in order to understand thevarious options, but Normal really is normal; it’s onlyvery rarely that you’ll need other modes.

Under this it then gets a bit more specific. WithOffset you can set the percentage at which the fillreally begins. For normal fills this scarcely matters buthave patience...

With Blend you can define which colours thecolour fill should use. The top two entries overlapbetween the foreground and the background colour,once in RGB mode and once in HSV colour mode.The HSV changes are usually more colourful, as theyrun along the colour wheel (see also Part 1) and socover a broad colour spectrum. You can usually domore with the RGB colour mode. The entry FG toTransparent blends from the foreground colourtowards transparency, for example the colour slowlyfades towards the outside. With the last entry youcan use the user-defined colour fill, which can beseen in the main toolbox at the bottom right. With aclick on this preview (Active Gradient) you can accessa selection dialog. Don’t worry, I’ll explain how youcan define your own gradients.

The gradient entry defines the form of the colour fill:

● Linear we have already met● Bi-Linear reflects the colour fill again on the

opposite side● Radial paints the fill in a circle with the length of

the artificial line as the radius about the start point(the direction of the artificial line does not matter)

● Square is just a square where the end point of theartificial line lies on the outer edge of the square

● Conical arranges the colours of the fill like raysabout the start point, the direction of the artificialline specifying the orientation. In the case ofsymmetrical, the fill only paints over half the angleand is reflected on the artificial line, while withasymmetrical it paints over the whole angle

● The Shapeburst fills adjust their shape to thecurrent selection. While angled treats all coloursequally, spherical favours the first and dimpledfavours the last part of the colour fill.

● The Spiral fills are very useful for hypnotic eyes.These come in clockwise and anticlockwise forms.The artificial line is used to define the width of thespirals and the direction of the ‘nose’ in themidpoint.

In Figure 8 you can see a brief overview of thevarious forms of fills.

KNOW HOW

42 LINUX MAGAZINE Issue 15 • 2001

shows a preview of the path (Figure 5). If thetransformation is then applied, the paths markedwith a lock will then also be adapted (Figure 5).

If you need to move a path as a whole, click anysupport point on the path with the Alt key held anddrag it into position. Like layers, you can also renameand duplicate your paths.

It can sometimes be very useful to convert aselection (to be more precise: its edge, as displayedby the marching ants) into a path. Simply click on thefourth button under the path list and wait a moment.The result is not always ideal but it’s acceptable.

By the way, you can also set the parameters foroptimisation: if you hold down the Shift key andpress the button, a large dialog appears with lots ofparameters. I don’t know exactly all the things youcan set with them but there are probably some imageediting experts out there delighting in this option.

Paths can also be used to construct geometricobjects, in particular polygons. The normal selectiontools are restricted to ellipses and orthogonalrectangles. With paths you can create any polygonyou like with a couple of clicks and convert it into aselection at the touch of a button. In Figure 6 youwill see a box, whose walls have been constructedusing paths then converted into a selection and filledwith a gradient colour fill.

Gradient blendsUntil now I’ve shamefully neglected the gradient tool,as I assume you’ve already tried it out a bit. However,since there are also a few nice touches hidden hereI’d like to cast a bit more light on the subject. If youclick in the image with the activated blend tool, dragthe mouse a little way and release the mouse buttonagain, a gradient fill will be painted from theforeground to the background colour. The artificialline indicates how “soft” the colour fill runs and in

Figure 6: A boxmade frompaths and fills.

Figure 7: The tool settingsfor the blend tool

Page 42: linux magazine 15

KNOW HOW

43LINUX MAGAZINEIssue 15 • 2001

The offset parameter means the colour fill does notbegin immediately at the starting point of theartificial line. The best way to explain this is using aradial fill. If you use the artificial line to define aradius of 100 pixels (this will then reach theoutermost colour of the fill), the change parameterwill define the radius of the innermost colour of thefill. With an offset of 30 per cent the fill would onlystart to run at a distance of 30 pixels from themidpoint. The inner area will be filled with thestarting colour.

In the lower area of the dialog, you can activateAdaptive Supersampling, which essentially boils downto antialiasing at sharp colour transitions. This does,however, increase computing time.

Gimp comes with a whole heap of useful gradientsbut the chances are when it comes down to thatcrucial moment, the right colour won’t be there. Toremedy this, pull up the gradient blend selectiondialog and click on the edit button. In Figure 9 youcan see the dialog which appears, which is dividedinto three areas. At the top left you can see the list ofavailable fills, on the top right are a few basicoperations and at the bottom is the editing window.Under the gradient you will see a bar with black andwhite triangles. A gradient is composed of severalsegments, at whose end points you can define acolour in each case. The black triangles separatethese segments. If you drag the triangles back andforth you will see how the fill changes accordingly.The white triangles can move the focal point of thecolour within a segment. Normally they stand in thecentre between two segment end points.

Segments can be selected by clicking in the area

colour (and transparency) of the left and rightcorners. Frequently-used colours (the adjacent colourof the next segment, foreground colour and thecolour of the other end) are then immediatelyavailable; you can also save up to ten colours forrapid access in the menu.

From this menu you can also access otherfunctions which influence the details of your fill. Youcan define how the transition between the end pointcolours will occur, re-arrange the triangles, split upand delete segments and so on. Every colour can alsobe assigned a transparency. With Gimp there aresome colour fills which come as standard, in the FlareGlow fills you can see how these can be used to besteffect (Figure 10).

That’s it. I hope I have been able to help youunderstand the basics of Gimp. Of course, thisWorkshop could never cover all the functions in Gimp– it’s not without good reason that you’ll find inchthick books dedicated to the program. Have a go andsee what else you can get out of Gimp. I’m invitingyou to send me your tips and tricks ([email protected]) and if a suitable number can be collected,we’ll publish them here in this column.

Happy Gimping! ■

The authorSimon Budig is a mathsstudent at the Uni-GHSiegen. He now usesnothing but Linux, topound Gimp into thesubconscious of innocentvictims. He was incited todo so within Unix-AG,which carelessly allowedhim to make contact withthe developers of Gimp.

Figure 8: Various forms of gradients: top: Linear, Bi-Linear, Radial, Square, Conical (symmetrical), bottom: Conical (asymmetric), Shapeburst (angular),Shapeburst (spherical), Spiral (clockwise), Spiral(anticlockwise)

Figure 9: The dialog for definition of gradient levels

Figure 10: Lighteffects with theFlare Glow fills

between two black triangles. The pop-up menuwhich appears on a right-click always relates to thesegment marked dark grey. You can extend theselection by clicking with the Shift key pressed. If youclick on a triangle you can move it and adapt thegradient accordingly. By clicking in the dark greyregion you can move the whole area; if you hadpressed the Shift key at the start of the click, thewhite triangles to the left and right of the selectedarea would also have been altered.

You can access the pop-up menu via the rightmouse button. As already mentioned, this relates tothe area currently selected. You can now define the

Page 43: linux magazine 15

KNOW HOW

48 LINUX MAGAZINE Issue 15 • 2001

The multi-user approach is already evident duringthe installation of Linux, when the systemadministrator, or superuser “root”, and at least

one additional “normal” user must be created. In thisworkshop we are going to show you how to createadditional users and groups and how to assign accesspermissions to files and directories, in short, how toadminister Linux users. For the purpose of this tutorialwe will be referring to Linux SuSE 7.2 Professionalwith a KDE 2.1.2 desktop.

The philosophy of Windows 98 is fundamentallydifferent from that of Linux. The operating system isprimarily designed for one user on a single-usermachine. However, Windows 98 also offers thefacility to set up multiple users. What is the point ofthat? Even a computer without a network connectioncould potentially be used by several people, forinstance, different members of a family or flatmates.In this case it is useful to be able to create a useraccount for each person. Each user can then createhis or her own individual desktop and My Documentsfolder. However, under Windows 98 this folder is notprotected against access by co-users, as it would bewith Linux.

Under Windows 98, additional users are created inthe Passwords section of the Control Panel. Byenabling this option Users can customise theirpreferences and desktop settings. Windows switchesto your personal settings when you log on via the

Windows 98 was

primarily designed for

single-user machines,

although it is quite

possible to set up

several user accounts.

As Anja M. Wagner

explains, Linux is

basically a multi-user

system, which is why

user administration is

more sophisticated

and user-friendly than

in Windows

Migration: USER ADMINISTRATION

IN GOODCOMPANY

User Profiles tab.If the desktop icons, the Network Neighborhood

contents, the Start menu and the program groups areto be included in the user settings, you also need totick the relevant options on the same tab. Afterconfirming with OK, you then need to open theUsers section, which is also in the control panel. Allexisting users are listed under User Settings.

By clicking on the New User button you can start awizard, which will help you to create additional users.There is no point in setting up a password, by theway, it will not protect against access andmanipulation by other users. In the step Personalized

Figure 1: Under Windows,individual user profiles

have to be enabled

Figure 2: All users happily united on one list

Figure 3: A small selection of itemsfor personalised settings

Page 44: linux magazine 15

KNOW HOW

49LINUX MAGAZINEIssue 15 • 2001

Items Settings you can select to personalisefavourites, downloaded Web pages and the MyDocuments folder. You can also choose betweenstarting off with a copy of the existing desktop orwith new, empty desktop items.

Now every Windows user can log in with their ownname and password at start up. The operating systemwill create the folder Windows/ Profiles/ username, inwhich the individual settings are stored.

Grass rootsUnder Linux, two users exist right from the start, thesystem administrator “root” and a “normal” userwho we shall call “tux”. All users are assigned to agroup by the system and can have differentpermissions. Only the superuser “root” has allpermissions for all files and directories, i.e. read = r,write = w and execute = x. This is the reason whysystem files can only be amended when logged in as“root”, as only this user has the necessarypermissions to make such changes. For directories theexecute permission “x” indicates the ability to accessthe directory at all and “w” means being allowed tocreate new subdirectories and files. If even “root”does not have execute permission for a file then it isnot an executable file, for instance it could be a textor image file.

In SuSE Linux, to start off all normal users belongto the group “users”. Red Hat, however, creates anew group for each user, where the name of thegroup is the same as that of the user account. This isthen the standard group for that user.

If you want to know the permissions for a directoryor file, start the file manager Konqueror by clicking

on your home directory icon in the KDE panel. Yourhome directory under Linux is roughly equivalent tothe My Documents folder under Windows. Activatethe detailed list view under View/ View Mode on theKonqueror menu bar. The Permissions columncontains a nine part combination of the characters“r”, “w”, “x” and “-”.

The first three elements show the permissions forthe owner of a file or directory. The first triple “rwx”on a file created by “tux” and stored in his homedirectory indicates that the owner “tux” has allpermissions for this file. The second triple shows thegroup permissions assigned to the file, in this case forthe group “users”. Permissions for all other users canbe seen in the last triple. The hyphen indicates theabsence of a permission in the “rwx” sequence. Forexample, if “tux” was able to read and execute a file,but not to change it, the triple would be “r-x”.

To display permissions on the command line youfirst need to open a terminal emulator window byclicking on the window and shell icon on the KDEpanel. At the prompt, type “ls -l” and press Enter.

The character in front of the familiar nine bitcombination of r, w and x indicates the file type: ahyphen “-” represents a file, “d” represents adirectory.

Admin or not adminReturning briefly to the system login: the graphicallogin shows all existing users, in this case “root” and“tux”. You have to decide right at the start of asession whether you want to work with Linux as theadministrator or as a normal user. You should onlylog in as “root” if you are intending to make systemchanges and if you know what you are doing;otherwise you might damage the system. Each user isidentified by their username and a password.

We are assuming for this workshop that you haveinstalled Linux on a single-user machine. Even if youare the only user of this machine it still makes senseto create several “normal” users. This will give youmore freedom to experiment with the uses anddesign possibilities of the graphical Linux interface.For instance, “tux1” could use a different KDE themeto “tux”, and “tux2” could default to using GNOMEinstead of KDE.

We discussed how to customise the KDE graphical

Figure 4: The file manager shows thefile permissions for “tux”

Figure 5: Permissions for the systemadministrator “root” are a little more complex

Figure 6: File listing in the terminal window

Page 45: linux magazine 15

Normally this is the “bash” (/bin/bash) – “BourneAgain shell”, but there are others, for instance the Cshell (csh) or the Z shell (zsh).

Equally as important as the specification of thelogin shell is the creation of a home directory for thenewcomer. The user manager creates thisautomatically. It is called “/home/username”, in ourcase /home/Tux01. The user ID (UID) is also assignedautomatically by the system. You should not changethis number, as this is how Linux recognises the user.In order to simplify the configuration task you shouldensure that the options Create home directory andCopy skeleton are ticked. The second option providesthe new home directory with a number of standardconfiguration files that are copied from the skeletondirectory /etc/ skel/.

PasswordsIf you want to set a password for the new account,click on the button Set password and enter it twice.

The groups to which “Tux01” belongs can be seton the Groups tab. More on this later. The primarygroup for a normal user (for SuSE) is logically called“users”. User properties are changed in User/ Edit,and if you want to get rid of an account, select User/Delete. The user manager only saves your entriesafter confirmation once you exit the program.

A new group is created in a similar manner: clickon Group/ Add and specify a meaningful name. The

KNOW HOW

50 LINUX MAGAZINE Issue 15 • 2001

login in the workshop “Tailor-made desktop, part 2” in issue 13of Linux Magazine.In the field containing images forthe different users the systemadministrator is represented by aconductor. This normally needs tobe activated after an installation.Log in as “root” and open theKDE control centre using the K

icon on the panel. Select System/ Login Manager inthe left column and then select the Users tab. Bydefault “root” is set to be one of the users that is notdisplayed during graphical login. This is a securityprecaution to make it harder and less tempting to login as superuser. Click on the entry “root” in the list ofno-show users and then on the button with thedouble left chevron to remove it. The stylisedconductor will now appear at the next graphical loginand you only need to click on it to enter “root” inthe login field.

User administration is one of the classic tasks of asystem administrator. Log in as “root” to create newusers. Click on the K icon in the panel and selectSystem/ User Manager. This starts a tool that makesadministration tasks much easier.

The user manager window is split into two halves.On the left all existing users are listed with their loginand their full names. At the end of the list is the“normal” user “tux” that you created during theinstallation. On the right are all existing groups withtheir group IDs (GID).

New userIn order to create a new user, click on the Add usericon or select User/ Add from the menu bar.

A small window pops up and you are prompted toenter the new username. We are going to use thename “Tux01”.

In the following step you will specify the propertiesof the new user. Enter the full name. Additionalinformation such as the address can be entered in thetext fields Office1, Office2 and Address.

An important part is the selection of the login shell.A shell is basically the interface between the user andthe operating system. It provides a command line onwhich you can enter commands. The login shell is theshell that the respective user is given to work with.

Figure 7: Theadministrator

“conducts” thesystem

Figure 8: This way tothe user manager

igure 9: The user managerclearly lists users and groups

Figure 10: User administrationis accessed by button or menu

Figure 11: A new user is born...

Figure 12: ...and equippedwith vital information

Figure 13: The login shell determines the user’sworking environment on the command line

UID The user ID is a number between 0 and65535, which the system uses to recognise andidentify the user and to administer his or heraccount. The system assigns the UID automaticallywhen a new user is created. This number shouldnot be changed.

GID The group ID is similar to the UID. It is also anumber between 0 and 65535. Each new user isinitially assigned to a primary group, in SuSE it iscalled “users”.

Page 46: linux magazine 15

KNOW HOW

51LINUX MAGAZINEIssue 15 • 2001

system also identifies groups by their group ID (GID).This number is assigned automatically by the system.

We are going to use an example to explain howyou can apply user and group administration:

Big brotherAndrew, Colin and John share a flat. Andrew owns acomputer and since he is a friendly sort of chap hecreates user accounts for both of his flatmates. Eachaccount has a password so that all directories and files inthe respective home directories are protected from thecuriosity of the others. He himself has, of course, allaccess rights, because he is also the systemadministrator “root”. Well, someone’s got to do the job.

However, the three flatmates want to make certainfiles available to everyone. They all need to be able toread the cleaning rota and to enter who did the

cleaning and when. Andrew,alias “root”, therefore createsa group called “Community”with the user manager.

He then amends the usergroups to which Andrew, Colinand John belong. To do this, hefirst clicks on the new group,Community, on the right sideof the user manager and theneither clicks on the Edit icon orselects Group/ Edit from themenu bar. This opens the fieldGroup properties in which heselects his flatmates on the left one by one andassigns them to the Community group by clicking onthe arrow pointing to the right. Finally, “root” alsobecomes a member of the group.

Community To avoid confusion, and to make sure that thecommon files can be accessed, “root” now creates adirectory /home /Community, in which the files anddirectories to which Andrew, Colin and John all haveaccess are going to be placed.

He creates this directory with the file managerKonqueror. Permissions to the directory and itscontents for the three are set by “root” throughright-clicking on the directory and selectingProperties/ Permissions.

At first only the owner has all r, w and xpermissions. So that Colin, John and Andrew can alsoaccess Community, “root” puts three ticks in theGroup line and changes the group from “root” to“Community” in the Ownership section. There is nopoint in ticking the option Apply changes to allsubdirectories and their contents, because KDE willnot save this yet.

If one of the flatmates now puts a file into thedirectory that is meant to be accessible to everyone inthe Community group, they then need to right-clickand select Properties from the context menu and setthe permissions, i.e. give read, write and, dependingon the file type, execute permission to theCommunity group. If a member of the group amendsa file, permissions do not have to be reset.

Figure 14: The final goodbye: deleting a user

Figure 15: A new group called Community is created

Figure 16: Members are assigned to the new group

Figure 17: Toavoid confusionthe “Community”gets its owndirectory

Figure 18: Defining accesspermissions for the group

Page 47: linux magazine 15

KNOW HOW

52 LINUX MAGAZINE Issue 15 • 2001

Up the creek without a packageModern Linux distributions have sophisticatedpackage management tools. Large and complexapplications can be installed or removed with a singlecommand or mouse click. Where you require non-standard options a few tweaks to the source packagewill usually give you what you want. Packagemanagement tools do your housekeeping for youand (when the packages are built to a well-plannedpolicy) ensure that the various components of yoursystem interoperate and function consistently.

Sometimes though, the app you want may not beavailable as a package, the source package may notbe flexible enough or you may want to work with thelatest cvs source. Whatever the reason may be, youfind yourself working with the unpackaged source orbinary files.

For most Linux users, this is not a daunting task.Typically, you unpack the tar-ball into /usr/ local/ srcand run through some variation of the following:

# ./configure --some-option --some-other-option# make# make install

At the end of which the application should be safelyinstalled into the /usr/ local tree.

That is easy enough. At this point, however, youshould ask yourself some questions:

● Where did all those files go? I can’t use a packagetool to get a simple list of what went where.

The /usr/ local tree

can easily become a

tangle, but as Bruce

Richardson explains

this needn’t be the

case. GNU Stow is a

simple application,

which keeps it

organised by allowing

each piece of

software to be

installed into a

separate directory

tree

OrganisationDIY package management in /usr/ local

STOW IT!

Having un-stowed an application, there is no need to delete it. You could, forexample, keep two or more instances of an application in /usr/ local/ stow(different versions, perhaps, or compiled with different options) and switchbetween them at will. Just install them to different target directories.

The fact that Stow keeps applications in their own hierarchies makes themportable. You can quickly copy stowed apps between machines by making atarball of the app’s directory tree and un-tarring it into the Stow directory of thetarget machine.

Stow prevents applications from overwriting each other’s files. Before itcreates any symlinks it checks to see if any proposed links would overwriteexisting files. If a conflict is found, Stow does not proceed.

● Will it be easy to cleanly uninstall the application?Even if I have a list of all the installed files, whatsteps do I need to take to uninstall safely?

● Am I sure the application installed itself nicely anddidn’t break anything? This application wasn’tpackaged for my system and the developers maynot have been as careful as they should have been.

These questions should worry you. The moreapplications you install like this, the harder itbecomes to answer them. With unpackagedapplications you have to do the housekeeping andmaintenance yourself. This can turn into a nightmare.

/usr/local/ – The Land Where The Wild Things Are.

To quote the Filesystem Hierarchy Standard: “The/usr/ local hierarchy is for use by the systemadministrator when installing software locally. Itneeds to be safe from being overwritten when thesystem software is updated”. That is to say, it is theplace to install software, which is not part of thestandard system. In practice this means software thathas not been pre-packaged using your distribution’spackaging tools.

The /usr/ local hierarchy is essentially a twin of the/usr hierarchy, with bin, sbin, lib (and so on)subdirectories. A tar-balled application will usuallyinstall itself entirely within this hierarchy, unless youspecify some other location. Precisely what goeswhere (docs to /usr/ local/ doc or /usr/ local/ share/doc?) varies according to the developer’s whim. If youare lucky, you may be able to place things exactlywhere you want them by passing the correct optionsto the configure script.

A simple solutionStow offers a way to organise the /usr/ localhierarchy, avoiding tangles and breakages. This isdone by installing each application into its owncorralled directory tree, and then creating symlinks tothe application files. To install an application withStow, follow this sequence:

● Create a destination directory for your newapplication. /usr/ local/ stow/ appname is traditional(and logical).

Further advantages

Page 48: linux magazine 15

KNOW HOW

53LINUX MAGAZINEIssue 15 • 2001

● Install the software into this directory in such a waythat files which would normally go into /usr/ local/bin are placed in /usr/ local/ stow/ appname/ bin,files for /usr/ local/ share go into appname/ shareand so on. For tips on how to do this see thesection called Installing to the target directory.

● Then simply do:

# cd /usr/local/stow# stow appname

In the third step Stow moves recursively through theappname/ tree. For each file in appname/ bin asymlink is created in /usr/ local/ bin, for files inappname/ doc links are created in /usr/ local/ doc etc.

What was the point of that, you may ask? It’s morelaborious than the usual method and the installedapplication doesn’t work any faster. The advantagebecomes clear, however, when you come to uninstallthe stowed app. Here’s the entire procedure:

# cd /usr/local/stow# stow -D appname

This removes all symlinks to the application. You arethen free to delete the /usr/ local/ stow/ appname,knowing that you are deleting all the application’sfiles and only those files.

Installing StowStow is a Perl script and Perl is the only prerequisite.It should work with Perl 4 or Perl 5.

A Stow .deb package is available as part of thestandard Debian distribution. Mandrake is the onlyrpm-based distribution for which we could find aStow package. On any other set-up you will need todownload the tar-ball fromftp://ftp.gnu.org/gnu/stow.

For the obsessive compulsives amongst you, it ispossible to install both Perl and Stow as stowedapplications:

● Install Perl into /usr/ local/ stow/ perl● Install Stow into /usr/ local/ stow/ stow● Now simply:

# cd /usr/local/stow# perl/bin/perl stow/bin/stow perl stow

Installing to the target directoryMany source tarballs are designed to be relocatable.This means that you can change the base directory –the “prefix” – into which the application is installed,usually by passing a --prefix=desiredlocation optionto the configure script (/usr/ local is usually thedefault). You might think that this is how youshould install to the Stow target directory, but youwould be wrong.

● The app won’t be run from its target directory. Itwill be run from its apparent location, as createdby the symlinks.

● If the app uses shared resources, it will look for themin the prefix tree. If you set the prefix to be the Stowtarget directory, the app won’t be able to find anyshared resources because the target directorycontains only files belonging to the application itself.

Instead you must let the application think it will beinstalled to /usr /local (which is usually the defaultanyway) but divert the actual installation into thetarget directory. One way is to run

# make install prefix=/usr/local/stow/targetdir

rather than just

# make install

but this will not work for every application. See theCompile-time and install-time section of the Stowdocumentation for a detailed discussion of this issue.

Lastly...My experience has been that while veteran Linuxusers tend to be familiar with Stow, newer users haveusually not discovered it. This is a shame as it makesthe potentially dangerous wilderness of /usr/ local amuch safer place. Properly used, Stow can help youkeep your local hierarchy as tidy and well organisedas the standard parts of your system.

Stow attempts to create as few symlinks as possible. If it can link to a directoryrather than the files within it, it will. So if the target directory contains a lib/ datadirectory but there is no data directory in /usr/ local/ lib, Stow will create asymlink to the data directory, thus importing all its contents with only one link.

If you later use Stow to install another application which also includes a lib/data directory, Stow will resolve the conflict by replacing the symlink with anactual /usr/ local/ lib/ data directory and then populating that with symlinks toboth applications.

Imagine what would happen, however, if you were to install the secondapplication directly, not using Stow. The installation procedure would simplyfollow the symlink and install files directly into the first application’s targetdirectory. If you ever un-stow the first application, some files belonging to thesecond application would be unstowed with it.

To avoid this problem (a) make sure that /usr/ local contains all the standardsetup directories (bin, sbin, share and so on) and (b) use Stow to install all localapplications, if possible.

Another gotcha is that ldconfig ignores symbolic links when scanning forlibraries. If a stowed app includes libraries you may need to add some symlinks ofyour own in /usr/ local/ lib.

Always un-stow an application before making any changes to the contents ofthe target directory. Re-stow after the changes are made. Otherwise you riskbroken links.

Things to watch

Page 49: linux magazine 15

KNOW HOW

54 LINUX MAGAZINE Issue 15 • 2001

Real-time is a term that characterises a particularapplication. Hard real-time means anapplication fails catastrophically if deadline

requirements are not met. Soft real-time means anapplication suffers degradation in quality, but notcatastrophic failure, if deadline requirements are notmet. Both hard and soft real-time are clock timeindependent.

Linux is capable of meeting a wide variety of real-time requirements, in terms of specific timing needs,addressed by specific levels of software (interruptservice routine versus user application level). Interruptservice routine software is delayed by interrupt offperiods in the kernel, and the Linux 2.4 kernel hasvery short interrupt off timings, with none greaterthan 60 microseconds on an 800 MHz Pentium IIIclass system. This level of performance meets the vastmajority of real-time requirements for interrupt levelsoftware. This is particularly true given modernsystem designs, where extremely fast I/O responserequirements tend to be serviced by dedicatedhardware in the form of intelligent I/O controllers,dedicated micro-controllers or custom dedicatedhardware.

In the rare remaining cases where Linux interrupt

Can Linux be a

“real-time operating

system”? Kevin

Morgan investigates

Pre-emptible Linux

A REALITYCHECK

off periods cannot be tolerated, RTLinux and RTAI areavailable. These are sub-kernel technologies thatprovide simple multi-threaded interrupt handlingenvironments for driver level software. Theseenvironments emulate (virtualise) interruptmanagement requests from Linux, and therebyreduce the worst case interrupt off timings for thedriver software written for these environments fromthe 60 microsecond level down to approximately 10microseconds.

Modern real-time environments typically involvesubstantial control and monitoring software in thereal-time control path. Such software resides at theuser application level. For example, consider real-timecontrol software written in Java, running on a JVM,an increasingly common design choice. Such a systemwould never be structured as driver level software.Response requirements for applications are directlytied to the kernel’s ability to pre-empt a runningprocess and switch to a higher priority process (newlyawoken) very quickly. The lack of kernel pre-emptionin Linux means that long system calls can delay highpriority user process execution for relatively longperiods, running into the tens of milliseconds in a 2.4kernel. There is now a kernel pre-emption patch thattoday reduces this time down to one to twomilliseconds, with further improvements planned forthe future.

Whether an operating system capable of theselevels of responsiveness guarantees is considered real-time or not is a positioning rather than a technicalissue. This level of improvement in Linux moves itfrom “problematic” to “very acceptable” for the vastmajority of applications that have real-timerequirements (soft or hard).

Maintenance cost and longevityAll of the changes for the pre-emptible kernel patchdirectly leverage the SMP spinlocks, which arethemselves fundamental in Linux for symmetricmultiprocessing. The code modifications in the pre-emptible kernel patch are thereby limited to the fourareas (see The Patch Specifics). New kernel code thatfunctions correctly in an SMP kernel requiresabsolutely no additional changes in the pre-emptible

The pre-emptible kernel patch modifies the definition (implementation) of aspinlock, changing it from its symmetric multiprocessing (SMP) specificimplementation to a pre-emption lock. In both cases, the locking function acts asa control on re-entrancy to a critical section of kernel software. Additionally, thepre-emptible kernel patch modifies the interrupt handling software to allowrescheduling on return from interrupt if a higher priority process has becomeexecutable, even if the interrupted process was running in kernel mode (providedthe process is not in a critical pre-emption locked region). Spin unlocks areredefined to return the system to a pre-emptible state, and check if an immediatecontext switch is needed. Lastly, the kernel build definition for a uniprocessortarget system is modified to include the spinlocks (implemented as pre-emptionlocks). Through these four basic changes, the Linux kernel becomes generally pre-emptible (with short non-pre-emptible regions corresponding to the spinlockedregions in an SMP kernel). Process level responsiveness is dramatically improved,both on average and in the worst cases.

The patch specifics

Page 50: linux magazine 15

KNOW HOW

55LINUX MAGAZINEIssue 15 • 2001

kernel patch. Thus, maintenance of the patch againstthe evolving Linux base is low cost.

Improvement in Linux process level responsivenessis a must requirement for many embedded systemdesigners considering the use of Linux as an OSplatform. Embedded developers have a simple choice:enable kernel pre-emption if needed by the demandsof their responsiveness requirement, or continue touse non-pre-emptible Linux if sufficient as is.

Audio processing under loadIn order to achieve over 20x improvements in processlevel responsiveness, what level of throughput loss isacceptable? If throughput loss is less than two tothree per cent, the cost is outweighed by theimprovement in system responsiveness. This trade offdoes not have to be made if every ounce ofthroughput is critical, and process levelresponsiveness is not. Users can select pre-emption ornot, as they see fit.

Official Linux kernel sourcePre-emptible kernel technology (as a build option,similar to SMP) should be included in the Linux sourcecode, as provided at kernel.org, starting with the 2.5kernel base. It is a fundamental improvement inLinux, which has value to all Linux user communities(desktop, server and embedded), and should beprovided with this central distribution.

However, continued development anddeployment of pre-emption technology in Linux willnot slow down if the technology is not integratedinto the official source tree. Many Linuxtechnologies are available and in widespread usetoday that are not part of the source code, and maynever be included. This is one of the key benefits ofopen source; new and innovative technologies canbe developed and provided when necessary, withthe best getting extensive usage and support.Independent of Linux 2.5 and beyond, Linux kernelpre-emption technology is available today as anopen source patch and there will continue to beenhancements to this technology.

In any case, certain embedded Linux companies arecommitted to the long-term availability and supportof this capability and committed to providing thisleading edge advancement across all major targetplatforms. Providing an alternative semaphoreimplementation that utilises priority inheritance is animprovement under design. Continuing to refine longspinlock held regions is an ongoing effort.Characterising throughput impacts (positively andnegatively) on a number of workloads is underprogress and will be shortly available. A number ofapplication success stories will become public overthe course of the next year as this technology iswidely designed in and deployed by embeddedsystem product organizations.

Throughput concernsSome oppose a pre-emptible kernel because ofthroughput concerns. Others oppose pre-emptibilitybecause of concerns about growing complexity in thekernel. This argument is specious, because the pre-emption approach takes advantage of alreadyrequired and in-place SMP locking. No additionalcomplexity is created. All Linux kernel engineeringmust already take into account SMP requirements.Some oppose continued refinement of SMP lockingto achieve better SMP scaling (on higher way SMPsystems); such refinement has the beneficial sideeffect of also reducing pre-emption off periods in apre-emptible kernel.

Pre-emptibility on 2.4 already provides dramaticimprovements in user process responsiveness, andwhile further improvement would be beneficial, thecurrent level of improvement is already oftremendous value. Hence, the pros and cons ofimproving SMP scaling in Linux can be debatedrelatively independently of pre-emptibilityimprovement opportunities.

Responsibility to the communityEmbedded Linux companies have responsibilities tothe open source and Linux communities, as well asto the embedded system product developmentcommunities. They have a responsibility toinnovate and release innovations early and often,for public comment and contribution. They have acorporate responsibility to do their best to enableLinux to be a viable operating system platform forembedded system design and implementation.Their customers will also find significant value inthe exercise of that responsibility, through thedelivery of such product technologies as a pre-emptible Linux kernel.

The Linux kernel community is large and diverse. Inevery technical area, there is lively discussion anddebate. Pre-emptible kernel technology is nodifferent. The embedded systems marketplace, andthe Linux community itself, will eventually decide therelative merits of pre-emptible kernel technology.

At a simplistic level, changing a uniprocessor kernel to add internal re-entrancymanagement means “more code” and hence “more time.” Superficially, a pre-emptible kernel will have reduced throughput.

At the heart of the throughput issue is the question of a balanced systemdesign, and the overall design objectives. How important is a responsive Linux? Ina world of streaming media, responsiveness is quite important. A demonstrationof the pre-emptible kernel doing simple audio processing shows that even atrivial load on non-pre-emptible Linux causes user process delays that exceed thethreshold of the human ear, and audio glitches are heard. With pre-emptionenabled, these delays are vastly reduced, and no audible glitches are heard.

The impact of throughput

The authorKevin Morgan is VicePresident of Engineering atMontaVista Software. Hehas 20 years of experiencedeveloping embedded andreal-time computer systemsfor Hewlett-Packard Co.Experienced in operatingsystems and development.Kevin was a member ofthe HP 1,000 computersoftware design team.While at Hewlett-Packard,he worked as an engineer,project manager andsection manager spanningthe development of fiveoperating systems. Mostrecently serving as HP-UXOperating SystemLaboratory Manager, Kevinwas responsible for overallHP-UX release planning,execution and delivery forHewlett-Packard servercomputers.

Page 51: linux magazine 15

INTERVIEW

56 LINUX MAGAZINE Issue 15 • 2001

Linux Magazine What drives you to do all thisgood work?Alan Cox I enjoy it!LM How do you find the time to do it all?AC Large amounts of sleep. I work US hours sosometimes I don’t get up until midday.LM What do you consider to be the most vitalpieces of software that are missing from Linux?AC Better calendaring software, certaingroupware programs. The big ones are nowstarting to fall into place – office suites likeStarOffice and the KOfficework. Especially withStarOffice going to OpenOffice. The Ximian guysare working with Evolution to create a completeclone of Outlook with all the features and thensome. A pure mailer program is Sylpheed – Itmeans “Wind Spirit” in Japanese.LM Are the software support models forcompanies correctly set up?AC Support costs real money. You can pay largeamounts of money for complete enterprise-widesupport or just the back-end part. It depends onwhat you negotiate. All the support is there in theory.The Red Hat guys think they are doing a wonderfuljob but you should really ask the customers.LM Development of the kernel does not use theCVS model. Why not? AC The kernel proper does not use CVS but somedevelopers use some for their parts. The big problemwith CVS is that it is not a good way for a singleperson to have an overview of everything going inand the right kind of quality control and auditing thatwe require. I believe that Linus is using CVS as hewants to see everything in his CVS tree.LM How does the kernel grow and develop?AC A directed explosion is the best answer.Development goes off at all kinds of angles from ahuge number of people for a large number ofreasons. Sometimes it is because they see a financialadvantage – if we pay someone to do this, then wecan sell that. Other times people do it because theylike a piece of hardware or they have bought a USBdevice that is not supported and think that “this iscool and I want to use it under Linux”. Some peopledo it out of academic interest, researching a giventopic to improve a piece of software.LM Does it come about that features are lefthanging because everyone wants the feature

Linux Magazine

talked to him about

his views on kernel

development and

what might be in

store in the future

but no one gets around to doing it? How is thisco-ordinated?AC It’s not coordinated. It does sometimes happen,but eventually it irritates someone enough that theyfix the problem. It is not uncommon that we have apiece of hardware that someone has written a driverfor, but it is not really being maintained or the personwho wrote it did not care about certain machinesthat it did not work on. If there are enough peopleusing it then someone will sit down and say “okay Ineed to fix this” and then do it. Sometimes it’s thevendors, because when they run their QA test thereis a problem. Often it is the end users. For example,those people with very old Soundblaster CD drives, ifwe break something then they still fix the driver.LM Do you get much in the way of requestsfrom users who are unable to contribute directlyto the kernel development?AC We certainly get feedback saying it would be niceif Linux did this or if Linux did that. The vendors arevery good at getting feedback - “we would install fivehundred machines but...”. It can be very useful.LM Do you think that there are good lines ofcommunication from end users to coders?AC Yes. To the extent that what matters is that theend user is prepared to do the work or that they areprepared to pay someone to do the work, and that ishow things come around.LM With the continued growth of Linux, do yousee any downsides?AC Having a larger mailbox is the biggest potentialdownside. In the early days the Linux kernel wouldget two or three messages a day. It has continuedto grow with more people becoming involved andmore happening in the kernel. I do not know howmuch longer that will continue to happen -essentially we are running out of things that areimportant to add to the kernel. Most of the reallycritical things are now in user space. For example,the world of KDE and GNOME, 3D graphics and allthose kind of things.LM What is in the next version of the Linuxkernel? Is that the type of question that’s evenpolite to ask?AC It’s the type of question we don’t know theanswer to! There are things people are contributingwhich look like obvious candidates: An improvedinput layer; the ability to have multiple monitors and

ALAN COX

NUT-CRACKER

Page 52: linux magazine 15

INTERVIEW

57LINUX MAGAZINEIssue 15 • 2001

multiple consoles used more sensibly; plug two mice,two keyboards and two monitors into one Linux box;various pieces of filesystem stuff – XFS, JFS. Compaqare donating clustering code, which is a veryinteresting and exciting area. You would be able tohave a room full of Linux boxes acting as one system,but on top of that, if you lose specific machines thenthe system continues without a glitch. This is veryimportant for a lot of business applications.LM Filesystems, then. Do you have a favouritefilesystem?AC Journaled filesystems are useful for lots ofapplications. It really depends on what kind of thingwe’re trying to do. So, we have things like ext2which migrated into ext3 – a journaled filesystem,which does exactly what every standard genericfilesystems has done over a period of time. Reiser FShas done a lot of work on small files, on fasterdirectory handling. IBM’s JFS is looking extremely fast– it is interesting for that. We will see, I think, overtime, which one will work out for the best. It’s a bitmuddy at the moment for some of them.LM In what way will that muddy water clear?Who will be the victor?AC I don’t actually think there will be a victor.Before, we had competing filesystems – ext fs, xiafs– that was a long time ago, then ext2 came along.Pretty much everyone ended up running the samefilesystem after six to nine months, simply because itwas the natural one to use. It was the one everyoneelse used and it seemed to work. I think the vendorswill ship the filesystems that work. They do a lot ofQA testing on that. In some cases we have specialistfilesystems: JFFS for Flash devices is very useful forthe iPAQ, but completely useless for your averagehard disk user.LM What hardware do you recommend and doyou get involved with hardware concerns?AC I try to pick devices with free drivers which work.Like everyone else, I’m trying to build myself amachine that works at a sensible speed or uses aslittle power of whatever. I play with a fair amount ofstuff. I build machines that are all Athlon becausethat gives me the best build performance. Fordesktop machines I’ve been playing with the new VIAC3 chip – it doesn’t need a fan and is so muchquieter, but it’s not a speed demon. I’ve not reallyplayed with the Pentium 4, some benchmarks butthat’s as far as I’ve got. It’s the first generation of thechip and I think the real question is not how the P4performs now but in twelve months time.LM The support from hardware manufacturers isgrowing but do you think anything can be doneto encourage them more?AC Most of them make the openness decision basedon business risk, or financial reward. So, for example,a lot of small USB vendors have no secrets. Some

hardware vendors like SIS, who are working veryclosely with the Linux community, are keen to givegood support. We also have people like nVidia whoare more worried about not giving away secrets torivals. They are worried that if they release theirsoftware technology then someone is going to use itand make the ATI Radeon run even faster than theircard. You talk to these people and sometimes itmakes sense, sometimes it doesn’t, but at least youunderstand their point of view.

The other thing that has really helped is whenpeople like Compaq and particularly Dell and IBM getinvolved because when they are building a serverthey think Linux is going to be one of the supportedsystems. It means that they go to the hardwarevendor they buy from and say “If you have Linuxsupport for this board then we will buy them in largenumbers and sell them in our servers”. For manymore conservative businesses the fact that you canactually say: “Well, if we will do this piece of work forthis approximate cost, we will get this money back”.It obviously makes it easier for them. Many of themare generally uneasy about giving out documentationto you, as they are more used to a traditionalbusiness relationship.LM We were talking to someone at the Systemsshow, they offer the service of a manager/coderinterface. Is this common?AC It’s one of the jobs that LinuxCare have beendoing. It is to a certain extent, part of what Red Hatoffer in doing direct device driver work. We will writeyou a driver, we will help you commit it to themainstream kernel, if that’s the way you want to go,and we will convert the things the techies say to thethings the management need to hear about “timescales and pricing”. It’s no good asking your averageprogrammer, “How long will this driver take?”, theanswer is always far too short, so the project willoverrun, and they are often far too vague.LM Do you use a desktop or are you a console man?AC Well, I mostly use X, I tend to use XFce for mydesktop most of the time, then run mostly GNOMEapplications, sometimes KDE. You can set bothGNOME and KDE up to look the same. In thedesktop world, I am very much an end user and asfar as I am concerned it all looks the same. OK, somebits are QT, some bits are GTK, but, who cares?LM You have a very good line of communicationto the community, tell us more about your diary.AC Well, the diary was originally set up pretty muchfor that purpose because when I joined Red Hat oneof the things Eric wanted, as my then manager, wasa monthly summary of what I was doing. So Ifigured out seeing as this was open source themonthly summary probably ought to be, so thatbecame the diary.

It’s no good asking

youraverage

programmer, “How long

will thisdriver

take?”, theanswer is

always far too short

Page 53: linux magazine 15

INTERVIEW

61LINUX MAGAZINEIssue 15 • 2001

Linux Magazine What is SmoothWall?Richard Morrell SmoothWall is a specialist version ofLinux, which has been carefully designed, securedand optimised in order to provide a network with allthe functionality of a secure router and firewall, butat a fraction of the normal cost.

It started out as a personal project. I didn’t wantto, and couldn’t afford to, buy a watchguard box(£1600 – £1800). That’s a lot of money and I have ayoung family so couldn’t afford it. I was involved withuser groups in the Bay area and Silicon Valley, where Iwas working with VA. I also discovered a young chapcalled Lawrence Manning and we spent more andmore time together. In the end what we wanted todo was try and do the development all by the Web.

It all sort of snowballed from there, we said,hmmm this works, maybe we can elaborate on thisand see if anyone else is interested. We decided thatmaybe we could make it into a project, because atthe time I was involved in deploying Sourceforge inthe US. It was really quite an exciting time to be partof VA Linux. There was plenty of money about, plentyof bandwidth and maybe some of that excitementrubbed off and we came up with SmoothWall. Fromthere we came up with a logo and decided that if wewere going to do this properly as a project that weshould come up with a brand before we came upwith the product. With properly designed logos,proper domain names, proper architecture, we wereready to roll, should the project ever to take off.

SmoothWall was available on July 15 2000, onSourceforge initially, and I still remember the first 16people to download it. It then grew from there, afterthe first three or four weeks we had four and a halfthousand users and I thought that I was completelyout of my depth. At this point, I was spending a lotof my work time with SmoothWall.

A lot of VA corporate customers in the UK startedto use it. That was because VA would send me tocustomers and they would end up talking aboutSmoothWall instead of VA. Then it appeared on LinuxMagazine in the States and in Linux Journal. All thebig magazines carried it as a coverdisc and we gotprime billing because at the time there wasn’t a hugeamount of stuff going on in the UK. We were theonly Linux project in Britain going apart from woffle.

As we started growing we began using more andmore bandwidth, and costs started increasing. I’vehad to put the best part of £35,000 in just to keep it

afloat, which is a lot of money when you have ayoung family. Unfortunately, open source doesn’t paythe bills and geeks expect stuff for nothing. If you tryand turn commercial, then they attack you andthey’ve attacked my like I’ve never been attackedbefore. I’ve received nasty mail, and even my son hassuffered part of a death threat: some guy in Americathreatened to burn my house down, and told my sonthat. This is all because I want to take part of theproject and make it non-GPL because part of it willuse non-GPL code that we couldn’t GPL even if wewanted to.

The Linux community is full of wonderful people,but it also has its fare share of morons who haven’tgot a clue. They sit in their bedrooms developingcode and think that anything that involves a GUI or abrowser is not suitable for public consumption. Theytake the GPL to its extreme and I know most of theLinux luminaries because of my time at LinuxCare andVA. I’ve been around long enough, I [email protected]. One of the biggest voices wehave is Alan Cox, and if I have a problem withSmoothWall at one o’clock in the morning and I needkernel advice I know I can phone up Ted Searle, oranyone, and get advice.

There aren’t many other projects that have thebreadth of friends that we do. If I need bandwidth ortesting I phone up Larry Augustine and it happens.Last night we were working on licensing issues and itwas Chris di Bona and Joe Ruiner and you can’t getmuch higher than that, without going to Linus, andthat’s an advantage we have that other Linux projectsin the UK just don’t. A lot of it is built on cronyismsand that certainly helps. It’s hard graft and when youare putting, very often 21-hour days into opensource, you can’t be a family man as well.

So far, so good though, we are up to 740,000installs worldwide since 2000 We know this becauseeach individual Smoothie calls home to register – weare very open about that fact – we now have tosupport users in 107 countries.LM Is that the best way to describe how big theSmoothWall project is, by the number ofinstalls?RM I prefer to use financial figures. We have over70,000 SmoothWall installs that manage systemswith more than 300 clients behind them. So, if youimagine that company would have had to buy aCisco pixie box for $15,000 to $18,000 and instead

Richard Morrell

tells us about

SmoothWall, it’s

development and

shares with us his

views on Open

Source software

Richard Morrell and SmoothWall

SMOOTHWALL

‘ ’We are upto 740,000

installsworldwide

Page 54: linux magazine 15

INTERVIEW

62 LINUX MAGAZINE Issue 15 • 2001

they have replaced it with something open source.They don’t necessarily know it’s Linux and they don’treally care, it does the job. Now if each of those PCshas an inert value the SmoothWall protectssomething in the region of $3.1 billion worth ofhardware worldwide and that’s just the corporateclients, that doesn’t include home use. That alsodoesn’t include the cable users. In the UK alone wehave over 24,000 installs. Now each one of thoseSmoothWalls calls home, and you can’t argue withthe figures, they are in black and white, and wemake those figures public.

In the UK, we’ve been logging since April thisyear, prior to that we didn’t bother because it wasstill just us having fun. We then realised that thiscould be commercial and we could be acquired. Ifyou are acquired you need to be very adult andgrown up and you need to be able to prove topeople what you’ve actually done. You can say I’vegot 50,000 users, but unless you can prove it, itdoesn’t mean a thing.

Now if you look at the Web site you’ll see aboutthree or four thousand people who have writtenback to say “Hey, we like this” and “Hey, we don’tlike that”, but you will also see some really nicequotes. This is what really makes it worthwhile. It’snot the money – because we don’t get paid. It’sthings like the government of Peru, they arerunning SmoothWall instead of Cisco. Colleges inthe UK, they are ditching Cisco and being able touse that money on teaching budgets, hospitals inAustralia, schools in China. You think “Cool!”,that’s the nice thing.

You get the gimps and the gits who haven’t got aclue. They read part of the GPL and don’t understandwhat it means. If Richard Stallman says I’m GPL, I’mGPL and we regularly go to battle with the FreeSoftware Foundation, who are a paper tiger with noteeth at the moment.LM How do you see the SmoothWall projectdeveloping?RM As of mid-November we became a limitedcompany. We’ve put too much money intoSmoothWall to keep it as a project. Just to keep italive costs me around £4,000 a month. We usesomething like 1.4 terabytes of bandwidth a monthon the Web site. We get 16.1 million Web page hits

a month that’s a lot of hits and unfortunately that’sgot to be paid for, you can’t get sponsorship for that.We are currently located in Raleigh, North Carolina,alongside Red Hat: same ISP, different boxes. We payour bills, we have some sponsorship by High SpeedWeb.net, a dubious ISP in North Carolina, but I don’tcare what their money is like, they pay for ourhosting. And then we have Tucows mirror sites in 11or 12 countries.

We based the way that we’ve grown on whatJeremy Allison has done with Samba. We havelearned to sit back and watched the failing ofother projects. We are quite aggressive and I thinkwe are seen as quite rude and arrogant, but thenthere’s a reason for that – we’re not a Linuxproject. Over 70 per cent of our users don’t useLinux for their systems. Once SmoothWall is up, it’sup – it’s just a box. You could paint it pink and puta bow on it, it doesn’t matter, no keyboard, nomouse – it’s a device.

SmoothWall enables someone to take some oldhardware, P133 or P100 and turn it into a box thatwould have cost them thousands of dollars. Nowwe’ve got our knockers that say that the LinuxRouter project does this, and yes it does, but they doit for the Linux community. How many Windowsusers use that project? None. There are hundreds ofcomments on the Web site from people that say“This is the first time I’ve used Linux, I didn’t knowabout it, thank you for making it so easy”. I go onwhat people tell me.LM What are the disadvantages with the waythe project has grown, did it grow too fast?RM It didn’t grow too fast, it’s always been managed,the trick with an open source project is ‘plan theteam’. It’s not different from building a sales team ora management team. You’ve got to understand thestrengths and weaknesses of the people involved. Asproject manager you’ve also got to be able to standback and let people stand on their own two feet,without standing on their toes – too much.

My gut feeling with SmoothWall is that we,deliberately, didn’t grow too fast. We could havegrown to 50 or 60 developers by opening up a CVStree and we didn’t. A CVS tree is all well and good ifyou are running something like Gimp, or if you aredeveloping a multimedia application, or a theme forKDE, where you need the input from designers andgraphics bods, and people with a knowledge of Xand KDE, from all over the world. SmoothWall is asecure system, whether it’s based on Linux or BSD orMac, who gives a monkeys it’s secure. When werelease the product we release the source – that isour definition of open source. If we used open sourceways of working, open source methodologies wewould be dead 13 months ago.LM It’s obvious that you do spend a lot of timeon this project.

Smoothwallon a chip.

‘’

Thegovernment

of Peru,they arerunning

Smoothwallinstead of

Cisco

Page 55: linux magazine 15

INTERVIEW

63LINUX MAGAZINEIssue 15 • 2001

RM A huge amount of time. I’m still on the IRCchannels at 2am kicking and banning people who aremoaning about the product, people say why are youhorrible to them, and I say it’s because they are notcustomers. If they are going to be customers thenthat is great but don’t come in here moaningbecause you want a print server on SmoothWall.

Linux gives people an opportunity we never had asdevelopers six years ago. What SmoothWall shouldshow people is that you can take a Linux distributionand all we did was take one CD. We cut it from 650Mb down to 40Mb. Now, with a Linux distribution,you have all the ingredients you need.

People make demands, they will say they wantSmoothWall to handle multiple IP aliasing. Theydemand! Now to me demand means I delete, I’mnot interested. If people want to shout at me that’sfine, they’re not paying me. I do give people wantthey want, but I give it to them in a controlledmanner. We have our updates programme, whichworks very well. You would expect the same of acommercial software organisation. The productworks, it looks clean, it does what it says. Thedocumentation is OK, it’s not brilliant, but then it isnot a commercial product. Our commercial productdoes have brilliant documentation, everything youwould expect of a professional product. But with theGPL, we try to give people value, but for no money.With the project we have given people theopportunity to go away and think, if the SmoothWallteam can do it, as a hobby, imagine what reallycould be done if someone really tried.

SmoothWall has done a lot of good, we haveraised a huge amount of money for charity. We havebeen earning money for a year now for somethingcalled the Dorothy Miles cultural centre in Fleet,Hampshire. We read about them in the papers andwhat we do is provide them facilities, they need acopy of software or hardware, we will buy it forthem. We have always encouraged people who wantto give to charity on our behalf to give to DorothyMiles, I think we’ve raised about £5,000 for them,which really makes me made up with happiness. Wesponsor a junior football team, which keeps you atground level.

What a lot of Linux companies have done issponsor beer fests and geek get-togethers.LM Do you agree that there is a place for that?RM Oh, yeah, it’s very necessary. I was doing it acouple of nights back, I was geeking until 6am. But,we’re having to move on.

The Linux industry in the UK doesn’t realise thatthere is a demand for people with Linux skills, thereare not enough Linux consultants, spending enoughtime in reality to address that skill shortage. They areshooting themselves in the foot.

SmoothWall is about trying to be good at one littlething. Don’t always try and be good at everything.

‘’

SmoothWall is about making something secure,keeping it secure. Not trying to be too big for yourboots. Take the product and polish it, if you polish itenough it shines. Were not shiny yet, but we aregetting there. It’s taken a long time. We are on ourninth release.LM With your aspiration towards a morecommercial project, what complication does thatgive you with the GPL?RM Very few!

My personal viewpoint for the necessity for the FSFto remain a fighting political force is marred by thefact that they are a force no more. They shout abouthow the GPL has never been challenged in court. Ithink they are probably quite thankful, because theywouldn’t have the money to defend it.LM Do you think the FSF could do more orshould have done more in the past?RM I had an article in SmoothWall last week. I wassaying “We want to take SmoothWall commercial.What can the FSF do to help us?”. Unfortunately theFSF are not interested in helping good GPL projectsgo commercial.LM Why is that?RM A very honest answer is that they don’t have anymoney. To help people like this costs money. Now, if Iwanted advice from the FSF I would be happy to payfor it, just like I would be happy to pay for aconsultant from the bank. The problem is they don’thave the advice, they don’t have the finances todevelop advice.

Georg Greve works damn hard to give what helphe can. But there are differences between Europeand America. He stands up for Richard Stallamn, whosometimes can be a bit of a liability. Richard is a manwith ideologies and I admire him for his persistence.There are people who are put on this planet to makea difference, Richard is one of them.LM How do you see online.smoothwall.orgdeveloping?RM That’s going to be a commercial subscription-based support service, for people who download thefree software. They can use that or they can still usethe more traditional forms of support likenewsgroups and IRC. It costs money to run, but it isimportant because it puts people in touch and it willfoster new customers for us commercially. For us, it isa move away from mailing lists that are becomingunmanageable. We’re getting 5,500 posts to some ofthe mailing list, and I can’t cope with that, and if Ican’t cope with that then God knows what kind ofmessage it is sending to our customers. Flame warsare far too easy to start on mailing lists as well, andflame wars are so nineties!

Smoothwallis about

trying to begood at onelittle thing

SmoothWall: www.smoothwall.org

Page 56: linux magazine 15

C: Part 2

LANGUAGE OF THE C

PROGRAMMING

64 LINUX MAGAZINE Issue 15 • 2001

First a correction from last months article. In table 1we said a character has size 1 with a signed rangeof -128 to +127 and an unsigned range of 0 to

128. The unsigned range should have read 0 to 255

Switched on BachThe switch statement is a polite way of writing twenty‘if-else if’ statements. It will evaluate its givenexpression and, depending on the result, will executea single specific case statement. Should none of givencases match our result we can (optionally) supply adefault case. If the result does not match, and there isno default case, nothing happens and code continuesexecuting the next line after the switch statement.Before this paragraph, you may have written:

if (iNumber == 0)printf(“zero”);

A language so

synonymous with

computing history and

Unix it’s very name is

the epitome of the elite.

These articles for the

beginner by Steven

Godwin, teach you the

fundamentals of ‘ANSI

C’, as well as providing

interest snippets from

under the hood of the

compiler.

else if (iNumber == 1)printf(“one”);

elseprintf(“Not a binary digit”);

But don’t write that! Write this!

switch(iNumber){case 0:

printf(“zero”);break;

case 1:printf(“one”);break;

default:printf(“Not a binary digit”);break;

}

In all cases (pun intended!) the same expression

Express Yourself

One of Denis Richie’s tenets for ‘C’, was an ‘economy ofexpression’. Whilst this is true, the ‘rich set of operators’ he alsoendowed it with can provide hours of fun for the boredprogrammer!

An expression consists of a number of terms that are evaluatedwhen the program is run. Each term should be of the same type (intor float, say), but can originate from anywhere – there is nodistinction between an integer variable or an integer constant. Or,for that matter, a function which returns an integer! So while anexpression like,

a = b * c;

is both valid and usual, ‘b’ could be a function that returns an ‘int’,allowing:

a = GetNumEntries() * c;

Saving temporary variables for you, and reduced processing for thecomputer at run-time.

Also, remember the function ‘LeaveGap’? The input parameterwas an ‘int’. So an expression of type ‘int’ would work in the placeof an integer constant. This allows code like,

LeaveGap(b*c);

Or

LeaveGap(GetNumEntries() * c);

And, as if to complicate matters further,

LeaveGap(a = GetNumEntries() * c);

If the function returns a void, it doesn’t actually return anything, soyou can not assign it to a variable.

a = Banner(); /* ERROR: Banner returns a void */

Banner(); /* CORRECT: void functions can

only be called like this */

Table below presents the basic of set of expressions used in C. Thisis not a complete list, just enough to get you out of trouble; but notso many as to get you in! The term ‘ident’ indicates where avariable should be, whereas ‘exp’ can be replaced by a variable, aconstant number, a function (with the appropriate return type) or(recursively speaking) another expression. It is this recursive natureof applying expressions in code that can make ‘C’ very – how shall Iput politely – illegible!

It is very possible, and easy, to include expressions inside expressionsinside expressions. For example, to make sure the compiler generatescode to evaluate them in the correct order, you should use thebrackets ‘(‘ and ‘)’. In future articles we’ll look at how ‘C’ decideswhich order in to evaluate the expressions in. It is called precedence,and helps remove the unwanted clutter of brackets. However, if youneed to know the precedence before you can understand the code it’stoo complex, and needs simplifying with brackets or separate lines!

Page 57: linux magazine 15

-exp Unary minus Turns 4, into -4.++ident Pre-increment. Increments the variable by 1, then uses that value

as the expression. a=1;b=++a;/* Here, a=2, and b=2 */

ident++ Post-increment. Uses the value of the variable, and then incrementsit.a=1;b=a++;/* Here, a=2, and b=1 */

- - ident Pre-decrement. As pre-increment, but subtracts one. ident- - Post-decrement. Got the idea yet?!!exp Logical not Turns a zero into a one, and any non-zero into a

zero. ‘C’ concept of true, is anything non-zero,which is why code like,if (x != 0)is often writtenif (x)

~exp Bitwise not. (Ones Flips each bit, turning 12 (1100) into -13 complement) (1111111111110011)

exp * exp Multiplication Despite ‘C’ low-level tedendancy’s, there is no carryand no overflow with any mathematical operation.

exp / exp Divisionexp % exp Modulus 10%3 is 1, for example.

(remainder)exp + exp Additionexp - exp Subtractionexp >> exp Bitshift to right. Only makes sense for integers. 8>>1 = 4.

Traditional a fast way of performing a divide by 2(or multiple), although most modern compilers willoptimise to this automatically.

exp << exp Bitshift to left. Similar to bitshift right, except this is akin tomultiple. One interesting use is ‘1<<x’, where ‘x’ isa bit number (0 to 31). The result is a number withonly bit ‘x’ set. 1<<10 = 1024

exp < exp Less than Evaluates to a 1 or 0 (like all similar operations)exp > exp Greater thanexp <= exp Less than,

or equalexp >= exp Greater than,

or equalexp == exp Is equal to Evaluates to a 1 or 0 . ‘C’ uses the double equals

to differentiate between equality and assignmentsince both can occur in places marked for‘expressions’. As this is one of the more commontypos in ‘C’ it is preferable to write ‘if (0 == iNum)’instead of ‘if (iNum == 0)’. This way, should youaccidentally omit one of equals signs, the case of‘if (0 = iNum)’ will become invalid since zero cannever be assigned to anything. On the other hand,‘if (iNum = 0)’ means assign 0 to iNum, andevaluate (to 0 - i.e. false). Therefore the ‘if’ branchnever gets called.

exp != exp Not equal to Evaluates to a 1 or 0exp & exp Bitwise And Compare each bit, and only set the equivalent bit

should both be set. E.g.. 1&2=0. 3&1=1. Used formasking flags to see which are set.

exp ^ exp Bitwise Exclusive Compare each bit, and only set the equivalent bit

Or if both differ. From the truth table:0 ^ 0 = 00 ^ 1 = 11 ^ 0 = 11 ^ 1 = 0Very useful for flipping bits; x^1 (swaps the leastsignificant bit). It is also bi-directional. y=x^73.y^73=x

exp | exp Bitwise Or Compare each bit, and set the equivalent bit ifeither is set. E.g.. 1 | 2=3. 3 | 1=3. Used for settingflags.

exp && exp Logical And Evaluates to a 1 if both expressions are non-zero.Otherwise, it’s a 0.

exp || exp Logical Or Evaluates to a 1 if either expression is non-zero.exp1 ? exp2 Ternary, or Evaluates to exp2 if exp1 is non-zero, otherwise its: exp3 conditional exp3. Similar to an ‘if’. But because this is an

expression it can used in places where the ‘if’ (astatement) can not (i.e. as a parameter to afunction), and since it gets evaluated you can writecode such as:

a = x==0 ? 1 : 2;instead of

if (x==0)a=1;

elsea=2;

ident=exp Assignment Copy the value of exp into the variable. You canalso link assignments, e.g. x=y=z. This is because‘y=z’ is an ‘exp’, and ‘x=exp’.

See also ‘Is equal to’ident+=exp Add, then assign The ‘? then assign’ expressions are a very usable

feature of ‘C’. From the programmers point ofview, it saves typingiCount = iCount + iNum;since you only need to typeiCount += iNum;From the computer’s point of view, it only needs tofind the memory location of ‘iCount’ once. Notmuch saving here, you might say, but if ‘iCount’was a complex expression the savings wouldcertainly mount up.Note:

iCount += 1;is equivalent to

++icount; not iCount++;Since the latter must retain the original value ofiCount to evalue the expression correctly.

exp1,exp2 Multiple evaluation This evaluates both expressions, but does so asseparate entities. It this is used recursively withinanother expression (i.e. x = exp1,exp2), then x isassigned with the value of exp1.

sizeof(ident) Size of type Calculates the size of the variable given, in bytes.Can be used to validate the sizes of variablesshown in table 1. The evaluation of this expressionis done at compile-time.

PROGRAMMING

65LINUX MAGAZINEIssue 15 • 2001

ident-=exp Subtract, then assign

ident*=exp Multiple, then assign

ident/=exp Divide, then assignident%=exp Modulus,

then assignident>>=exp Bitshift right,

then assignident<<=exp Bitshift left,

then assignident&=exp Bitwise And,

then assignident^=exp Exclusive Or,

then assignident |= exp Bitwise Or,

then assign

Page 58: linux magazine 15

PROGRAMMING

66 LINUX MAGAZINE Issue 15 • 2001

(iNumber) is compared, allowing the compiler to domore optimisations, the reader to gain a greaterunderstanding, and the programmer less chance ofmaking a mistake!

In this example, the order in which the casesappear is of no consequence. The default need notappear at the bottom, either, it’s just a convention.However, this is not always the case (no punintended!).

Break On ThroughThe break statement above appears innocuouslyenough. It has a simple property, but with some nastyside effects (which we will come to later). Basically, itcauses the execution to jump out of the currentstatement, in this case the switch statement. If breakis omitted, execution continues with the nextstatement in the switch – even if it is not part of thesame case.

switch(iNumber){case 0:

printf(“zero”);case 1:

printf(“one or zero”);break;

case 2:case 3:

printf(“two or three”);break;

}

As you see, case 0 ‘drops through’ to case 1 becausethere is no break to stop it. Similarly, case 2 dropsthrough to case 3 for the same reason (it is notnecessary to have any code associated with aparticular case).

So, what is the price to pay for this rather groovystatement? Well, it can only switch on constantcases. That is, the value after the word ‘case’ must beconstant: a number or a single character (representedwith ‘A’, remember). A case such as:

case iNumber2:printf(“Both numbers are the same!”);

is illegal! iNumber2 is a variable, and therefore notconstant. The other problem is that strings can not becompared with a switch (and we’ll find out whywhen we cover strings).

Hello NastyThe word break can be used anywhere a statementcan. It jumps out of the current block (i.e. the switch)and continues with the next instruction. Someprogrammers introduce unwitting bugs by notrealising what block it will jump out of. A break willonly jump out of statement blocks created with:

Layout

C DialectsFor a language that is intended to be portable, there are a number of differentversions. It is useful to know they exist, especially if you plan on writing code formore than one platform.

K&RThe original. Rarely used nowadays.ANSI CThe most common, and focus of this article. GCC is largely complaint with ANSIC.C99A recently ratified update to ANSI C. This version supports single comments (a laC++) and dynamically sized arrays.Small CA subset of ANSI C.Objective CA superset of ANSI C, incorporating object orientation and message passing.

This article (and most code in circulation) conforms to the ANSI C standard.However, depending on the application, some code will use specific libraries thatare not covered here in any depth. Examples of the more common libraries arecurses, sockets and X. None of the functions used are part of the ANSI Cstandard, but because of the design of the language, such libraries can be addedat any time (even after the compiler has been written and shipped) withoutbreaking existing code. These extensions usually ship with (at least) one headerfile, and one library file.

Also (as if to complicate matters), most compilers implement a number ofextensions. These are features of the language that are not included in thestandard, but added because the compiler programmers thought it was ‘a goodidea’. I, personally, disagree with them. They encourage non-standard, non-portable, code and tempt the unwary into bad habits, since the feature may notbe implemented on the next platform (or even version of the compiler) they use.GCC, for example, supports nested .

‘C’ is a free-form language, meaning that the layout is fairly unimportant.Whitespace (tabs, spaces and newlines) can appear anywhere within the source(except strings) and compiler will blissfully continue without giving it a second look!

Both pieces of code that follow compile identically.

iAverage=iTotal/iElements;

iAverage = iTotal/ iElements

This allows you to indent your code in a manner that is meaningful to you. Thereare a number of styles and guidelines available on the web. None of them are‘right’, in the same way there is no ‘right’ text editor! Avoid holy wars - find astyle you like and stick to it. If you are working in a code shop, it is likely they willdictate style guidelines for you to follow. If you are maintaining code, then adoptthe style of the original author.

Page 59: linux magazine 15

PROGRAMMING

67LINUX MAGAZINEIssue 15 • 2001

switchwhiledo...whilefor

For example,

iVal =0;@l = while(iVal < 100){iVal++;if (iVal == 10)

{printf(“Limit reached...”);break;}

}

This while loop only iterates 10 times, because of thebreak statement. What is subtle is that the statementattached to ‘if’ does not get considered as a block (itis not in the list above, note).

Also, the break will only jump out of one block. To bespecific - the current block. So if you have nested twoloops, and issued a break command inside the innerone, only it would terminate. This is most obviouswhen using for:

for(y=0;y<20;y++){for(x=0;x<32;x++)

{printf(“X”);if (x == y)

break;}

/* break causes the code to jump here, andcontinue with the next value of y */printf(“\n”);}

Layout (Case)‘C’ is case sensitive. All the reserved words (like ‘if’and ‘while’) must be written in lower case, as mustthe type names (‘int’, ‘float’, ‘char’ and so on).

Variable names, on the other hand, do not need tobe in lower case, but you should be consistent whennaming and using them. ‘Num’ and ‘num’ aredifferent variable names, and often cause problems,especially for non-Linux users who are used to thecase-insensitivities of DOS and Windows. It is best toestablish a style, perhaps using underscores instead ofspaces, or capital letters to indicate new words.

The authorSteven Goodwin celebrates (really!) 10 years of C programming.Over that time he’s written compilers, emulators, quantumsuperpositions, and four published computer games.

Page 60: linux magazine 15

PROGRAMMING

58 LINUX MAGAZINE Issue 15 • 2001

Python: Distributed applications with XML-RPC

PUPPET OBJECTSThese days many applications exist in a

distributed environment. This meansapplications are running on several machines

that communicate with each other and exchangedata. There are two basic setups: on the one handthere are message-oriented processes for inter-process communications, like Named Pipes; and onthe other hand are Remote Procedure Call processes(RPC). RPC processes are used in Unix, for example,to implement various daemons and services such asPortmapper or NFS.

The first standardised processes for providingservices across the boundaries of individual machineswere created in the 90s. The most important of theseprocesses are CORBA (Common Object Request

XML-RPC is a portable

XML-based process for

Remote Procedure

Calls. In conjunction

with Python it can be

used for quick access

to distributed

applications. Andreas

Jung explains how

Broker Architecture) and its proprietary Microsoftcounterpart DCOM. Both standards are very complexand therefore more suitable for large enterprisesolutions. For the Java environment there is the RMImechanism (Remote Method Invocation), whichallows remote procedure calls between Javaprograms. Unfortunately RMI is not portable andcannot therefore be used from other programminglanguages.

XML-RPC bridges this gap by offering thefollowing two advantages: one, it is portable, i.e. it isindependent of any particular programming languageor operating system and can therefore be applieduniversally; two, it is simple to implement becauseXML-RPC is based on the established standards XMLand HTTP.

How XML-RPC worksCommunication between a client and an XML-RPCserver always takes place via HTTP. The advantage ofthis is that it allows the use of existing components.Using HTTP also simplifies communication acrossfirewalls and proxies. The client’s request to the serverand the server’s response are encoded in XML. Listing1 contains an example of this, showing a simplearithmetic calculation using integer data types. Table1 shows all data types that can be passed betweenclient and server.

XML-RPC for PythonAt the moment there are two XML-RPCimplementations for Python. One is the xmlrpclibpackage by Frederik Lundh, currently maintained byPythonware. This package supports XML-RPC forserver as well as client applications. The client-sidecomponents of the package are going to beintegrated into Python and should make their firstappearance in version 2.2. All examples in thefollowing text relate to this package.

The other implementation is the py-xmlrpc project,which is more recent. Its authors, Chris Jensen andShilad Sen, have re-implemented time-critical parts inC with very good performance results. Unfortunatelythe documentation is still on the sparse side.

XML-RPC clients with PythonThe xmlrpclib server object makes it easy to addressXML-RPC servers from Python:

import xmlrpclib

Listing 1: Client-Servercommunication with RPCClient request to calculate the sum of 17 and 15:

<methodCall><methodName>example.sum</methodName><params>

<param><value><int>17</int></value></param><param><value><int>15</int></value></param>

</params></methodCall>

Server response:

<methodResponse><params>

<param><value><int>42</int></value></param></params>

</methodResponse>

Table 1: Data types in XML-RPCType Descriptionint whole number with sign, 32 bits in lengthstring character string (typically with Unicode support, since XML

explicitly demands Unicode support)boolean truth values, true or falsedouble double-precision floating-point numberdatetime.iso8601 date and timebase64 base64-encoded raw dataarray one-dimensional array, in which the individual array values can be

of any typestruct A set of key value pairs; keys must be character strings, values

can be of any type

Page 61: linux magazine 15

PROGRAMMING

59LINUX MAGAZINEIssue 15 • 2001

server = xmlrpclib.SERVER(“http://localhost:9000”)print server.example.sum(17,15)

The constructor links the passed HTTP-URLs to theserver object. In our example the XML-RPC server isrunning on a local machine on port 9000. The actualRPC call of the sum() method in the example class issimilar to a local function call – with the restrictionthat keyword parameters such as sum(a=17,b=15)are not allowed.

Some XML-RPCs support something calledIntrospection API, which clients can use to obtaininformation about a server’s method calls. Allmethods of this API can be addressed via the systemobject of the server instance (see Table 2).

XML-RPC server in PythonCreating an XML-RPC server with Python also involveslittle effort. The module xmlrpcserver provides all theimportant functions required. Listing 2 shows thebody of such a server.

The call() method of xmlrpcHandler is called by theunderlying socket server for each incoming call andreceives the name of a method to be called and thearguments for the function call. The call getattr()checks whether the xmlrpcHandler class contains amethod of that name, and returns a reference to thismethod if successful. The method is then started withthe appropriate arguments by s_method() and returnsa result. Some methods, like in the example, arelinked as xmlrpcHandler class methods.

Authentication for XML-RPCThe XML-RPC standard does not define anyauthentication processes. Instead, this is left to thetransport protocol HTTP. The most common methodis basic authentication, in which the user name andpassword are transferred in the authorisation sectionof the HTTP header. Cookie-based authenticationworks in a similar way, but the information is storedin a cookie and then transferred. Unlike basicauthentication this method is not standardised. If youwant to be able to use basic authentication via XML-RPC you will need to extend the internal transportclass, as shown in Listing 3.

The new transport class BasicAuthTransportextends the HTTP header with the appropriateauthorisation at each request. This is done byredefining the request() function of the basic class.Applications can use the new transport class bypassing an instance to the constructor of the XML-RPC server object (Listing 4).

ConclusionApplying an XML-RPC interface to Pythonapplications does not involve much effort. Theessential part of the XML-RPC infrastructure remains

Listing 2: Server body01 import SocketServer02 import xmlrpcserver03 import xmlrpclib0405 class xmlrpcHandler(xmlrpcserver.RequestHandler):0607 def call(self, method, args):0809 try:10 s_method = getattr(self, method)11 except:12 raise AttributeError, \13 “Server does not have XML-RPC “ \14 “procedure %s” % method15 return s_method(method, args)16 17 def sum(self,a,b):18 print ‘Arguments:’,a,b19 return a+b20 21 if __name__ == ‘__main__’:22 server = SocketServer.TCPServer((‘’, 8000), xmlrpcHandler)23 server.serve_forever()

Listing 3: Authentication with XML-RPC01 import string, xmlrpclib, httplib02 from base64 import encodestring03 04 class BasicAuthTransport(xmlrpclib.Transport):05 def __init__(self, username=None, password=None):06 self.username=username07 self.password=password08 09 def request(self, host, handler, request_body):10 h = httplib.HTTP(host)11 h.putrequest(“POST”, handler)12 13 # required by HTTP/1.114 h.putheader(“Host”, host)15 16 # required by XML-RPC17 h.putheader(“User-Agent”, self.user_agent)18 h.putheader(“Content-Type”, “text/xml”)19 h.putheader(“Content-Length”, str(len(request_body)))20 21 # basic auth22 if self.username is not None and self.password is not None:23 h.putheader(“AUTHORIZATION”, “Basic %s” % string.replace(24 encodestring(“%s:%s” % (self.username,self.password)),25 “\012”, “”))26 h.endheaders()27 28 if request_body:29 h.send(request_body)30 31 errcode, errmsg, headers = h.getreply()32 33 if errcode != 200:34 raise xmlrpclib.ProtocolError(35 host + handler,36 errcode, errmsg,37 headers38 )39 return self.parse_response(h.getfile())

Page 62: linux magazine 15

PROGRAMMING

60 LINUX MAGAZINE Issue 15 • 2001

hidden from the developer. This has contributedgreatly to XML-RPC’s popularity, which has practicallybecome the de-facto standard.

New features in Python 2.2Guido van Rossum and his team are currentlyworking on Python 2.2, due for release at the end ofthe year. The second alpha release already offerssome new features.

New division operator: //The present division operator always returns aninteger value. This is inadequate for genuine floating-point arithmetic. From version 3.0 the standardoperator / will return results as floating-point values,while the new operator // will be responsible forinteger division. You can already use this newfunctionality by linking from __future__ importdivision into your programs.

Unification of built-in types andclassesUntil now it has been impossible to derive your ownclasses from built-in types (lists or dictionaries forexample). This limitation ends with 2.2. User-defineddictionary classes can now be derived as follows:

class MyDictionary(dictionary):def __getitem__(self,key): ...

IteratorsIterators are closely connected to for loops. Sequencetypes (character strings, lists, tuples) used to be theonly types through which iteration was possiblewithin a loop. From 2.2 all objects can be used foriteration with for if they have implemented the newiterator interface. For example:

01 class count:02 03 def __init__(self):04 self.data = range(0,100)05 self.n = 006 07 def __iter__(self):08 return self09 10 11 def next(self):12 try:13 num = self.data[self.n]14 except:15 raise StopIteration1617 self.n+=218 return num19 20 obj = count()21 iter_obj = iter(obj)22 23 for item in iter_obj:24 print item

In order to be able to do this, classes must implementthe method __iter__(). An iterator object is createdwith the new function iter(). This calls __iter__() forthe object and returns a reference to an iterator(normally the object itself). The for loop calls thenext() function of the iterator until it raises aStopIteration exception.

GeneratorsThe concept behind generators is closely related tothat of iterators. They are basically functions whichreturn a generator object when called and whichprovide data via the next() method. For instance:

01 from __future__ import generators02 03 def numerator(N):04 for n in range(N):05 yield n06 07 gen = numerator(100)08 09 while 1:10 print gen.next()

The new command yield returns a value with eachnext() call. However, the local variables of thegenerator function are frozen and processingcontinues in the same place at the following next().

Table 2: Introspection API methodsMethod Descriptionserver.system.listMethods() returns a list of all methods of the XML-RPC server

server.system.methodSignature(methodname) returns a list of signatures for a method name, for

example server.system.methodSignature(‘sum’)returns [(‘int’,’int’)]

server.system.methodHelp(methodname) returns method documentation; in Python this is

typically the documentation string for the function

Listing 4: Calling the new transport classimport xmlrpclibserver = xmlrpclib.SERVER(“http://localhost:9000”, \

BasicAuthTransport(‘jim’,’mypassword’))print server.example.sum(17,15)

InfoXML-RPC http://www.xmlrpc.org/xmlrpclib http://www.pythonware.com/products/

xmlrpc/py-xmlrpc http://sourceforge.net/projects/

py-xmlrpc/

The authorPython expert AndreasJung currently lives nearWashington D.C. andworks for ZopeCorporation (formerlyDigital Creations) as asoftware engineer in theZope core team.

Page 63: linux magazine 15

BEGINNERS

70 LINUX MAGAZINE Issue 15 • 2001

The Answer Girl

EGALITARIANISM

must be emphasised at this point that the use of aspecific tool for a specific task always depends onone’s personal tastes. If you prefer Python or Tcl,that’s perfectly all right.

Unfortunately, Perl also has some drawbacks.Although, or more precisely because, there is massesof documentation – with manpages and tutorials onthe Web as well as paper books – finding help on aspecific task is a highly time-consuming job. SincePerl also wants to be “human”, by allowing severalnotations for a syntax that is normally fixed in otherprogramming languages, writing Perl code lookssimpler at first glance, but the reading is then mademore difficult if a Perl script originates from peoplewith different Perl customs. Of course this versatilitydoes not make learning Perl any easier.

Perls in actionAll this lamentation is useless if the release date forthe new Web site is imminent. So turn to your

The Answer GirlThe fact that the world of everyday computing,even under Linux, is often good for surprises, is abit of a truism: Time and again things don’t work,or at least not as they’re supposed to. TheAnswer-Girl in Linux Magazine shows how to dealelegantly with such little problems.

At last, the commissioned Web site is finished.A sigh of relief in the office is closely followedby the sobering realisation that the Web

designer has been working under Windows and hasnot been all that careful with upper and lower casenotation of filenames, because on her Microsoft testcomputer index.html, Index.html and INDEX.HTMLare all identical notations for a single file. Unix filesystems on the other hand, such as the ones mainlyused under Linux, ext2fs and ReiserFS, insist that acapital A and a lower case a are completely differentthings – even in file names.

The site’s relaunch site still has to take place ontime, and who wants to sit down and correct all thewrong A HREF details by hand across several dozenfiles? So the question arises, as to how the wholedeal can be dealt with automatically?

Defining the taskThe task is by no means trivial because there is quitea bit to do. The first thing is to find all the references,search out all those which relate to local files, extractthe corresponding filenames together with path andcheck whether there is a file of this name at theappropriate place in the file system.

If the designations of the file in the link and in thefile system match, we need do nothing. If they arecompletely different, the best thing to do is to add acomment, to the effect that this point will need re-processing by hand. If the details differ only in theupper and lower case lettering, we can adapt thefilename in the link details.

This does not look like something that can besolved simply with a couple of command line toolsand a few pipes. Instead we will have to stick outour necks, do it properly and write a little script.

A shell script, a sed-script, an awk-script... – thereare a number of options – but so that this articledoes not become overlong, let’s agree on a Perlscript. This is a good idea anyway as Perl’s regularexpressions lighten the load a bit when it comes tosearch and replace operations. This would also workwith sed, but since we have to check the presence ofthe files in the file system, sed could only cope withthe aid of other shell tools. Perl has advantages here,since as a “real” programming language it also hasfunctions for accessing the file system and is fasterthan a shell script.

Awk comes into its own especially when workingwith columns, which in this case we do not want. It

Have your Web links

got split ends, simply

because upper and

lower case notation

was ignored when

they were produced?

Patricia Jung shows

us how to resolve

this problem using a

Perl script

Page 64: linux magazine 15

BEGINNERS

71LINUX MAGAZINEIssue 15 • 2001

What does perl -w do?-w prints warnings about dubious constructs, such as variable names that arementioned only once; scalar variables that are used before being set; redefinedsubroutines; references to undefined file handles or file handles opened read-only that you are attempting to write on; values used as numbers that don’tlook like numbers; using an array as though it were a scalar; if your subroutinesare nested more than 100 deep; and innumerable other things.

favourite editor and create a new file. Let’s call it,cgks as an abbreviation for “change upper to lowercase notation” – who would want to call up aprogram starting with an “A” – as in “Alter”?.

As in every script, the first line comes easily: Itconsists of a special comment, stating whichinterpreter is to do its job here. Using which perl, wecan find out in which path the Perl interpreter islocated (provided it is installed and the correspondingdirectory is entered in the search path).Then we should have

#!/usr/bin/perl

sitting there. When developing programs it makes lifeeasier if the interpreter points out the snares a bitmore, rather than merely griping about real syntaxerrors. The manpage should come up with someinformation on this. First, though, man perl explainsto us that the Perl Manual “is split up to makeaccessing individual sections easier”, which arereached as special manpages.

man perlrun # Perl execution and options manpage

looks for the section we need, in order to find outmore about options which make debugging easier.As a matter of fact, man perlrun explains an option -w (as in “warn”), which appears suitable for ourprotection.

Simply take everythingNow we want to edit lots of files, ideally, all those inthe current directory. Yet this is something someoneelse should have done before us at some point. Thereare many Perl scripts in this world and on the Webbut those with comprehensible documentation, onthe other hand, are much scarcer. Searching the Webwe find a script that converts international characterentities in all HTML files in the current directory intoreal ISO characters (Figure 1) and with

$^I = “.bak”;

in front, it even makes a backup file with the ending.bak.

This last feature is one we first mark with a # atthe start of the line so that the interpreter ignores it.By decommenting the line, this produces the niceside effect that in the meantime we are not evenwriting any files, but are being shown the result onthe standard output. In any case, it’s much better fortesting!

In Perl, simple (scalar) variables always begin with adollar symbol, and a funny variable such as $^I mustsimply be something pre-defined. As a matter of factman perlvar explains that this means the Inplace

editing, thus the editing of a file which is currentlybeing edited is switched on or off.And the next line,

@ARGV = <*.html>;

looks like a pre-defined variable and an array becauseof the preceding @, thus a one-dimensional ormultidimensional value field. @ARGV, the “Argumentvector”, is one-dimensional and according to theperlvar manpage contains the command linearguments of the script. We can use this to definewithin the program which arguments it shouldactually be called up with – obviously with all filesending in .html.

Perl makes provisions for the argument files to beopened and to enable access, via the handle <>, tothe data contained therein. So all we have to do ismeasure off the content line by line, until there areno more lines:

while( $line = <> ) { }

This is clearly a loop, which will run continuously aslong as the condition in the round brackets applies. InPerl, it makes no difference whether we declare thevariable $line needed for buffering $line first, withthe my() function, or only allow it to arise where weneed it. It’s only in connection with object-orientedPerl programming that my() really becomesimportant, although it does no harm to get used tothis right from the start. If we again output thecontent of $line inside the curly brackets with

print $line;

our script should simply output the content of the.html files in the current directory line by line. We cantest this in a directory that contains (not too many)HTML files. Since cgks does not presumably lie in thesearch path, we also state the path (perhaps with thedot as an abbreviation for the current directory).

pjung@chekov:~/answergirl$ ./cgksbash: ./cgks: No such file or directory

No file or directory of this name? There’s something

Page 65: linux magazine 15

BEGINNERS

72 LINUX MAGAZINE Issue 15 • 2001

A small Perl script

fishy going on here. We have in fact forgotten toassign ourselves executability rights with chmodu+x cgks.

Pattern recognitionSince the script outputs the file content so nicely forus, we can now look for the links. Perl has the niceconstruct of “data to be edited by default”, the datahiding behind the variable $_ . When you are lookingfor something, there is no need even to state whereto look, as long as you mean the content of $_ . Wewant to edit the content of $line and therefore file itwith

$_ = $line;

in the default. Are there links in this line? If so, followthem to an <A HREF= within double quotes (“). Theend is shown by a >. (So as not to complicate thescript unnecessarily, we shall assume that there areno line breaks in a character string). As a regularexpression this looks as follows:

<A HREF=\”(.*)\”>

We have to escape the double quotes with thebackslash, since Perl uses these to delimit stringcontents. In round brackets, we note the reference(either a URL or a local file specification), which is asequence of characters of any length or .* for short.

Unfortunately, regular expressions have the habitof wanting to cover as much as possible. If, after theHREF, several “> appear on the line, the above regexpwill save everything in the round brackets until thelast occurrence. We wean it off this greedy habit byplacing the one-time or no-times character ? after .*:

<A HREF=\”(.*?)\”>

In order to look for it in the content of $_ , we makeuse of the ‘match’ operator m/pattern/. We can tellthat an href can also be written in lower case(“case-insensitive search”) by the i-flag. We also wantto collect all the links occurring on the line and to doso we use the flag g (global):

@files = m/<A HREF=\”(.*?)\”>/ gi;

We store whatever ends up in the round brackets inan array variable named @files and go through it stepby step:

foreach $file ( @files ){ }

To do this we file the respective current reference inthe variable $file, which as “run variable” of theforeach loop lands automatically in $_ . In order tochange something solely when it is a reference to a

local file, we check that its content does not beginwith a protocol such as ftp or http (other protocolssuch as gopher can be ignored):

if ( ! /(ftp|http):\/\//i ){ }

The m of Match operator can be left out, and “ftp://or http://” can be shortened to (ftp|http)://. In thiscase, the pipe symbol | serves as a logical Or. Sincethe forward slashes are already framing the pattern,we must escape them, and in order to ignore upperand lower case notation, we make use of the i-flag ofthe match operator. Lastly, the exclamation markensures that the condition is met precisely when nomatch is found.

Local only

If there is no protocol hiding in the reference, we tryto open the file:

open( FILE, $file );

The first argument, FILE, is a so-called handle, so is astand-in for the file whose name is hiding in $file. Ifwe get the file open, we have nothing to correct forthis link and can close the file again:

close FILE;

If, on the other hand, the opening goes wrong...

if ( ! open( FILE, $file ) ){ }

...we must try to find out the right file name. If that

Page 66: linux magazine 15

BEGINNERS

73LINUX MAGAZINEIssue 15 • 2001

A HREF In order to use a hyperlink on a Web site to point to another file orInternet resource, you have to write an anchor into the text. This is supplementedby the hyperreference, which states where the link is pointing, for example AHREF=”http://www.linux-magazine.co.uk/”. To prevent the reader of the pagefrom seeing this specification in the text, it is placed in pointed brackets (<AHREF=”http://www.linux-magazine.co.uk/”>). This is followed by the text, whichshould be clicked on in order to get to the reference. Last of all comes the endtag </A>, with which the anchor is completed: <A HREF=”http://www.linux-magazine.co.uk/”>Linux Magazine</A>.

Path The road that paves the way, along directories, to a file. Absolute pathsbegin at the root point of the file system indicated by /.

Pipe A pipe through which the output of a command line program istransmitted. The end of the pipe serves as input for a second tool. Symbolised bya vertical stroke | : command1 | command2.

Regular expressions Option used by various standard Unix tools to expresspatterns. A dot stands for any symbol you like or a letter for itself. If an asteriskfollows, whatever is covered by the preceding pattern can occur any number oftimes, or even not at all. A question mark on the other hand means thatwhatever it relates to occurs precisely no times, or once.

Python An object-oriented script language.

Script language Programs written in script languages do not have to beseparately compiled, but can be executed with an interpreter direct from thesource code. Often (in Perl for example) the interpreter compiles an internalbinary program to increase the speed of execution, although users will notusually notice anything in normal circumstances. Since there is no need to call upa compiler, interpreted languages are especially suitable for small programs,which are quickly jotted down to solve a problem and are not intended to beused by third parties.

Tcl A script language which is usually used in connection with the GUI toolkit Tkfor writing graphical applications. It can also be used without Tk.

Search path If one enters a command, the shell searches in the directories savedin the environment variable PATH, in sequence, for an executable file of the samename. The first find is used; if the shell finds nothing, it outputs the errormessage command not found, even if the command exists elsewhere in the filesystem.

in the link specification starts with a / , as absolutepathname it does not relate to the root directory ofthe file system but to the corresponding documentroot on the Web server. We must first pin down thedirectory in a variable, which serves as the startdirectory for the files on the Web site:

$rootDir = “/home/pjung/LM/LM1001/answergirl”;

This circumstance makes our task a bit harder: To finda file specified in the link, which begins with /, it’sbest to look for it, not in /, but in $rootDir. If there isanything to correct though, $rootDir/corrected_namemust not be written back into the link, but only/corrected_name.

So what could be more obvious than saving thecorrected name and the prefix we need to find thefile in the file system separately?

If one combines the contents of both variables,$prefix and $corrfil with the dot operator . , weobtain the file details made to measure for the filesystem. If we take only $corrfil, we have thespecification matching the link. So we first write a / inthe variable intended to contain the corrected link:

$corrfil = “/”;

We also note the root directory as prefix:

$prefix = $rootdir;

Using this preparation for the later combination inthe corrected file name, we can do without the slashat the beginning (^) of the link details save in $file. Inorder to formulate the condition under which the$corrfil and $prefix, as just written, should be set wetherefore do not use the match but the substituteoperator s. We simply tell the script: “If, at the startof $file, you can replace a / by nothing, set $prefixand $corrfil as just discussed”.

Unfortunately, / is another case for the escapecharacter. Luckily there is also an option ofseparating the patterns to be searched for andreplaced from each other, not only by /, but also byother special characters. For example, take thedollar sign. This turns “Search / at start of string,and replace it with nothing” into not so much anescape orgy, but rather a simple s$^/$$. In orderto make this replacement directly in the variable$file, we say

$file =~ s$^/$$;

Formulated as a condition, this looks as follows:

if ( $file =~ s$^/$$ ){ }

If the link was not an absolute one, $corrfil remains

empty. In the prefix the dot is saved as a stand-in forthe current directory, together with separator slash:

else {$prefix = “./”;}

Bit by bitIf the link is ever broken, this can be due to the filename itself or else to a directory specified in the path.Consequently, we must swallow the bitter pill andcheck every component separated by / from root totip. To do this, we divide the content of $file, which

Page 67: linux magazine 15

BEGINNERS

74 LINUX MAGAZINE Issue 15 • 2001

cgks as a whole#!/usr/bin/perl -w

$^I = “.bak”;@ARGV = <*.html>;

$rootDir = “/home/pjung/LM/LM1001/answergirl”;

while ( $line = <> ){$_ = $line;@files = m/<A HREF=\”(.*)\”>/ig;foreach $file ( @files ){$corrfil = “”;if ( ! /(ftp|http):\/\//i ){if ( ! open( FILE, $file ) ){if ( $file =~ s$^/$$ ){$prefix = $rootDir;$corrfil = “/”;

} else {$prefix = “./”;

}@parts = split( /\//, $file );foreach $part ( @parts ){

if ( $part eq “.” || $part eq “..” ){$corrfil .= $part . “/” ;

} else {opendir (DIR, $prefix . $corrfil ) || last ;@selection = grep ( /^$part$/i , readdir( DIR ) );closedir( DIR );if ( $#selection < 0 ){$corrfil = (“<!-- “ . $file . “ not found! -->” );last;

} elsif ( $#selection > 0 ){$corrfil = (“<!-- “ . $file . “ not clear! -->” );last;

} else {$corrfil .= $selection[0];

}$corrfil .= “/”;

}}$corrfil =~ s+/$++;$line =~ s+$file+$corrfil+;

}close FILE;

}}print $line;}

may have been robbed of a leading slash, at the /points into little bits and save them in the array@parts:

@parts = split( /\//, $file );

The split() function needs two arguments: whichstring it should chop up, and the separator. Instead ofsimply specifying a delimiter, the match operatorcomes into play at this point. Between its two /wings, we set the slash / separating the directories,

and so that this cannot be confused with the rightwing / , a \ comes before it.

We now take a close look at each particle insuccession:

foreach $part ( @parts ){ }

If the path component in $part is a dot for thecurrent or (||) double dots for the superior directory,we do not need to check any notation and add thecontent of $part to the string already in $corrfil:

if ( $part eq “.” || $part eq ”..” ){$corrfil .= $part . “/” ;}

Perl has two equality operators: one for numericvalues and one for character strings. The latter iscalled eq (“equal”). $corrfil .= $part;

$corrfil = $corrfil . $part;

With the appendix operator for character strings, thedot, we also insert a slash as directory separator.

On the other hand if we have a real file ordirectory name sitting in $part, there is more to bedone. First, we try to verify what has been in $corrfiluntil now: With $prefix in front, we are dealing witha directory which needs to be opened:

opendir (DIR, $prefix . $corrfil );

We will close it later using closedir( DIR );. But if wedo not manage to open it, we can give upimmediately and the stop processing the @parts:

opendir (DIR, $prefix . $corrfil ) || last ;

last leaves the active loop, so that we can continuewith processing the next $file. If, on the other hand,we did open the directory $prefix . $corrfil and wereable to “install” the handler DIR, it is best to use

readdir( DIR );

to read out all the files in it. Is there a file or directoryin there with the name which is saved in $part? Onthe shell we would use the grep command for this –and neatly enough, it’s the same in Perl:

grep ( /$part/i , readdir( DIR ) );

The pattern here is surrounded by the matchoperator – and of course the i-option must be theretoo, since the upper/lower case notation of the actualfile can be completely different from $part.

However, we have left one thing out: grep alsofinds matches in this version when the content of

Page 68: linux magazine 15

BEGINNERS

75LINUX MAGAZINEIssue 15 • 2001

DebriefingThere are always more elegant ways of knockingtogether a script. For example a quicker variant forlarge quantities of data could be written whichremembers each directory checked, so that it doesnot have to look at each directory for each linkagain.

Far more critical for deployment is the fact thatthe proposed program then gives up if the HTMLanchor A HREF and the link source are on differentlines. The alternative was to either take thishandicap in stride or build in even more complexity,especially in the regular expressions.

Those who are only occasional users of Perl,however, will not be familiar with the fact that inthe Comprehensive Perl Archive Network (or CPAN),there are any number of modules stored which, likesimilar libraries to those for C, C++ or Java, containuntold amounts of functions for all possible andimpossible areas of use.

In the case of our script, we could have savedourselves the work with the regular expressions, forthe tedious recognition of links, if we had used theHTML::Parser-Module which is already installed bydefault in many distributions (in SuSE in the packetperl-HTML-Parser; in Caldera in perl-modules).

The major drawback with this module is that weare moving in object-oriented Perl areas and couldthus be struggling with the problem of what aparser is. For Perl novices and programmingbeginners this is presumably too ambitious a project.

$corrfil =~ s+/$++;

Uh oh, we nearly forgot to correct the $line read outfrom the file, by replacing the old link $file by thecorrected output $corrfil...

$line =~ s+$file+$corrfil+;

... and last of all, of course, print it:

print $line;

Now the great moment approaches: Off to the testdirectory and let the script loose on the files in therewithout additional parameters, but perhaps better“piped” by less. Looking good? Then we’ll justquickly remove the comment symbol from the line

# $^I = “.bak”;

and already cgks is filing the converted files undertheir old names, with the original version as a backupfile with the ending .bak to allow for a comparison.

$part is only a component of an existing file name ordirectory name. In this case the match must bespecified precisely: We state it inclusive of beginning(^) and end ($) and save the result in an auxiliaryarray:

@selection = grep ( /^$part$/i , readdirU( DIR ) );

If @selection now contains nothing – not even azeroed element – we cannot create a correctedversion of the link and are misusing $corrfil for anHTML comment which says that $file could not befound. It continues, with the aid of last at the start ofthe loop, with any subsequent element of @files:

if ( $#selection < 0 ){$corrfil = (“<!-- “ . $file . “ not found!U-->” );last;}

Perl is endowed with a wealth of funny specialcharacter combinations, which provide you withsome involuntary memory training. If one pinches the@ from an array and replaces it with a $#, oneobtains ($) a scalar variable, in which (#) the numberof array members is saved.

If the yield saved in @selection was a bit toosuccessful (we recall that directory and Directory canexist side by side on Unix systems without anyproblem), we add $corrfil to a comment which saysthat there are several options:

elsif ( $#selection > 0 ){$corrfil = (“<!— “ . $file . “ not clear!U—>” );last;}

Only if we find precisely one variant can we attachthe zeroed element from @selection to $corrfil:

else {$corrfil .= $selection[0];}

There is still a trailing slash to be attached, in order toprepare $corrfil for new sub-directory levels. To blsd –if $part now contained the filename, this too has aslash at the end, although it goes no further now.Nevertheless, despite how far as we have come withour script it’s still only a script for ironing out a fewupper/lower case notation errors – so we are going totake the liberty of an evil hack: We replace the slashat the end of $corrfil with nothing. And because it’sso nice, we use the plus as separator for thesubstitute operator:

Page 69: linux magazine 15

BEGINNERS

76 LINUX MAGAZINE Issue 15 • 2001

Anyone who thinks that only little old ladiesand their friends gossip, has certainly neverlooked in on a refined chat in IRC. Moreover,

KDE wouldn’t be KDE if it didn’t send you on yourway with the IRC client KSirc, an easy-to-use tool,which makes the virtual coffee morning twice thefun. The best thing is that KSirc is part of theNetwork package, so you don’t even have to installthe program specially.

A smart suitIf you’ve called up your IRC client in the K menu viaInternet/ Chat Program (KSirc) or alternatively,entered ksirc & in a terminal window, the programswitchboard immediately recommends a controlserver. Should this fail to occur then just select aserver from the Connections menu.

If you’ve read the title to this section then it shouldcome as no surprise that you can smarten up theappearance of your IRC client. Under Options/ Coloursetting, there will be a range of colours to choosefrom, and in Options/ Universal Character Set, youcan look for your favourite font.

For those you who are colour-mad, KSirc evensupports background images. To use this featuresimply activate the field background image under themenu item Options/ Colour Preferences, and locatethe appropriate wallpaper.

Fancy a bit of

gossip? Stefanie

Teufel shows you

how, with the IRC

client KSirc, you’ll

be kitted out for

hour-long chats.

K-tools

SCANDALMONGERS

More important than all this graphical chitchat isthe fact that you should now make up a nicknamefor the IRC, if you have not already done so. UnlikeUsenet, it is in fact the done thing in IRC to giveoneself a pseudonym, by which one can beaddressed by others. As soon as you click into an IRCnetwork where someone is already using thispseudonym – known as a nick, in the jargon – youwill get an error message and will have to selectanother nickname.

Enter your desired name in the tab Options/Preferences/ StartUpmenu under nick, (Figure 1).Under your real name, you can enter your true name,should you want to publicise it. But take care – evenif you hide your real name here, finding it out wouldscarcely pose a problem to another IRCer, unless youhave provided your computer with firewalls in such away that, even using utilities such as Finger, not aword about you will be able to escape it.

If this is not the first time you have knockedaround in IRC and you already know some otherIRCers, and you want to be kept up to date on wherethey’ve got to, then enter their IRC nicks in thereporting list underneath. When later on you go ontoIRC and the person concerned (or another person,who is already claiming this nick for himself) is alsothere or joins it, you will be informed of this by aNotify message. If you wish to underline this with ableep, you can set this in the General tab undersignal tone for messages.

Off to the Net!KSirc presents you with a selection of the best-knownIRC servers of the day, via Connections/ New server orthe F2 key. These servers are all neatly ordered

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.

Figure 1: Anick needs to

be givensome thought

Page 70: linux magazine 15

BEGINNERS

77LINUX MAGAZINEIssue 15 • 2001

according to the various IRC networks so you can, forexample, settle simply for an IRC server in the largestIRC network, IRCNet (Figure 2). Since almost all IRCservers can usually be addressed via port 6667, youcan leave this setting as it is, although you may alsofind settings of 6665 to 7000.

Now make sure you are connected to the Internet,so that when you click on the connect button aconnection can be made to your selected server andall of the users thereon.

A new window immediately pops up, in which youwill firstly be overpowered by the welcome messagefrom the server (Figure 3). It’s worth reading this andcomplying with any codes of conduct includedtherein, so as not to attract the wrath of the IRC ops– the operators responsible for the IRC server.Repeated violations of the rules can make you apersona non grata, and in the worst case you can bedenied access to the corresponding IRC network.

Now you are in the big wide world of IRC, whichyou can clearly recognise by the fact that the windowhas filled server controls with new life: A list of all IRC

servers can be seen showing you which you havemade contact with; whether any of your favouritefriends and enemies from the Notify list are rompingaround in the same IRC network; and indicating thechannel into which you have clicked (Figure 4).

If you enter a channel by clicking on its name in thisdrop-down menu, you get a main window divided into

IRC The acronym IRC stands for Internet Relay Chat and refers to a loosecollection of servers, which enables its users to meet in so-called channels, inorder to talk via text and in real time. All those who have clicked into a channelcan see everything other people there are saying. The serious drawback of IRC isthat your can’t exactly use it offline, so all too often it leads to your becomingBT’s best customer. So remember your phone bill and do your chatting off-peakin the evenings...

Port A dock for network connections. Ports are numbered and many of thesenumbers have already been assigned a fixed service (well-known ports). Forexample FTP uses Port 21, SSH Port 22, TALK Port 517 and so on.

Figure 2: Click on in!

Figure 3: Sometimes welcome greetings are a bit sad

Figure 4: Where am I?

Page 71: linux magazine 15

BEGINNERS

78 LINUX MAGAZINE Issue 15 • 2001

three different areas (Figure 5). In the biggest of theseyou will see, apart from the messages from the server,the conversations of your co-chatters. If the exchangeof words is rushing past you too quickly, you can looklater at any snatches of conversation which you havemissed by sliding the right roll bar. If the pre-set 200line buffer is not enough for you, adjust the number inthe server control window under Options/ Personalsettings/ General with the aid of the field marked Sizeof the buffer.

The right-hand window shows all the users whoare in the channel. The most important area is theinconspicuous line on the bottom edge: This is thecommand line, on which you type in all your actionsand send them off with the [Enter] key. Please do notforget: IRC commands are always started with aforward slash: /.

For anyone who is a little uncertain, typing /helpshows you all the available commands. Anything youdon’t mark with a / at the start of the line is visible toall channel occupants. Your own actions, and the

public actions by the other channel inmates, are shownin the main KSirc window in various colours andmarked with icons at the start of the line (Figure 6).

Since life can be grey enough, KSirc allows you todip into the paint pot to highlight your conversationalcontributions. For example, if you express yourenthusiasm for KSirc with the exclamation: [Ctrl+B]Ksirc[Ctrl+B] is [Ctrl+K][7] [Ctrl+U] dead cool[Ctrl+U][Ctrl+K][7], you will see a bold ‘Ksirc’, ‘is’ in thenormal font and an underlined, orange ‘dead cool’.

The control codes, with which you can encloseemphasised words are listed in Table 1. Nests areallowed here (as our example with [Ctrl+K][7] fororange and [Ctrl+U] for underlining shows). You caneven change the foreground and background colourof your text at the same time.

So that you don’t have to remember the wholerange of colour codes, as soon as you press [Ctrl+K] acolour selection window pops up, in which you needonly seek out the foreground (top) and backgroundcolour (lower row) by mouse clicks.

Cyber stalkingIf you want to get a more detailed impression of yourco-chatter, click on the respective user in the right-hand window and in the menu list select User/Whois. You can check his or her availability via User/Ping, and uncover the IRC client of your oppositenumber with User/ Version.

If someone has particularly piqued your interest,you can avoid missing any of their utterances byfollowing them inconspicuously with User/ Follow.KSirc then makes his or her actions stand from thegrey mass for your benefit. You can immediatelycancel this snooping with User/ unFollow.

Some are more equalBy now you have been wondering why some channelinmates are more equal than others, namely thosewhose nicks are marked out in bright red. This is howKSirc marks out the channel operators, or ops forshort. The person who breathes life into a channelautomatically gets more rights than all the otherusers who arrive later.

As a channel op one can, for example, throwpeople out of the channel (User/ Kick in the channelwindow); ban them completely (User/ Ban); grantother channel users op rights (User/ Op); andwithdraw this privilege (User/ Deop). There are alsoactions in the user menu which only an op canperform: see the little box For OP only on the usermenu tab under Options/ Personal settings. ■

Table 1: Colour codes[Ctrl+B]text[Ctrl+B] bold text [Ctrl+U]text[Ctrl+U] underlines text [Ctrl+R]text[Ctrl+R] text in which foreground and background colour

are reversed[Ctrl+O]text[Ctrl+O] normal text [Ctrl+K][0]text[Ctrl+K][0] white text [Ctrl+K][1]text[Ctrl+K][1] black text [Ctrl+K][2]text[Ctrl+K][2] blue text [Ctrl+K][3]text[Ctrl+K][3] green text [Ctrl+K][4]text[Ctrl+K][4] red text [Ctrl+K][5]text[Ctrl+K][5] brown text [Ctrl+K][6]text[Ctrl+K][6] violet text [Ctrl+K][7]text[Ctrl+K][7] orange text [Ctrl+K][8]text[Ctrl+K][8] yellow text [Ctrl+K][9]text[Ctrl+K][9] pale green text [Ctrl+K][10]text[Ctrl+K][10] cyan text [Ctrl+K][11]text[Ctrl+K][11] light cyan text [Ctrl+K][12]text[Ctrl+K][12] light blue text [Ctrl+K][13]text[Ctrl+K][13] pink text [Ctrl+K][14]text[Ctrl+K][14] grey text [Ctrl+K][15]text[Ctrl+K][15] pale grey text

Figure 5: In theIRC it can get

pretty wild

Figure 6: Go wild with colour

Page 72: linux magazine 15

BEGINNERS

79LINUX MAGAZINEIssue 15 • 2001

Timely plea for helpAs a Linux user, who doesn’t even haveaccess to a Windows machine at home, I

sometimes feel like a second class citizen. With thePC world being so dominated by Windows, technicalsupport for anything else is usually unavailable.

I would very much like to upgrade my Internetconnection – I am currently using a 56K modem, butI am unsure what will be compatible with my desktopsystem: ADSL, cable modem or whatever. It wouldhelp very much if you could do a roundup of what isavailable to me as a Linux user,D Gates, London

More people are taking an interest in what Linux hasto offer, and with this the need for mainstreamsupport must also increase. We can only hope thatthis happens sooner rather than later.

High speed Internet access is going to be tackled infull next month. As it stands, most cable modeminstallations seem to work without addedcomplications, so long as you are familiar withaccessing a network on your machine. ADSL useshardware that is less than fully compatible with Linuxsystems, but drivers are available. Exactly what youneed for ADSL depends on who your supplier will be.

SuSE LiveEval 7.3 coverdiscI haven’t had any success with the LiveEval ofthe SuSE 7.3 OS. I get at far as part six:

“Finishing basic installation ...updating configuration(10 per cent)” and that’s it. TheAbort button doesn’t work so I’mleft to turn the machine off, go intoWindows where I find one file(suselive) to be deleted. I’m runningWindows 98SE, 600MHz AthlonProcessor, 700Mb+ RAM and I washoping that a Linux platform would bemore enjoyable to work with than aWindows system which has somethingof a mind of its own. The evaluationCD would have given me a taster ofwhat to expect from Linux. It’sunfortunate, and more than a littleannoying, that the CD does not deliverwhat it offers.A Beattie via email

We have had similar comments from Windows 98and Me users. Apologies to all those that have

suffered disappointment.We have been in contactwith SuSE and you’ll bepleased to know that thereis a work around for thisproblem.

Should YaST2 hangwhile writing the configfiles at ‘10per cent’, youshould press theAlt+SysRq+S keys (allthree keyssimultaneously) TheSysRq key may be

marked as Print Screen on some keyboards. This willget YaST2 running again, the Alt+SysRq+S keypresses synchronises the mounted filesystems again.Full details of this problem can now be found on theSuSE Web site at: http://sdb.suse.de/en/sdb/html/cndegen_yast2_error_diagnosis.html

WRITE ACCESS

Contact usYou can write to us atLinux Magazine, Linux NewMedia UK Ltd, EuropaHouse, Adlington Park,Macclesfield, Cheshire,England, SK10 4NP.Alternatively you can email us at [email protected]

Star letterFrom word of mouth of a friend I tried installing SuSE 6.4. I installed iton a spare Celeron 300MHz machine in my home, and just as a test I

decided to see how long it would be before the system crashed. I’ve only hadto switch the machine off once in one year and two months, and that was toswitch off power to install a new socket in my house.

The installation was every bit as easy as a Microsoft Windows install and Iwould say the OS is much more configurable and fun to use. I have had anapplication crash on me once on Linux but it never affected the OS.

It has been quoted that “ Window Millennium Edition is actually thecheapest OS, coming in at £147.04”. Linux is free if you could be bothered todownload it. A standard distribution should never cost more than £80 from anydistributor, and that comes with more software you can shake a stick at. Theonly downside about Linux I would say is the lack of good games. So you see Iam not a Linux fanatic!Nicholas Herriot via email

The ease and simplicity of a Windows install is often quoted as one of itsfeatures. As far as we’ve found this just isn’t the case. Once you’ve run the riskof the installation itself – holding it in check from overwriting partitions thatyou want to keep – you still have to gather together all of the driver disks toget the full support out of your peripherals. You don’t suffer this with a Linuxinstall.

The ability to download a distribution is no stumbling block either. If you arelooking to get yourself set up at a rock bottom price and the option ofdownloading 650Mb is not an option, then contacting your local Linux usergroup is bound to bring results.

Page 73: linux magazine 15

BEGINNERS

80 LINUX MAGAZINE Issue 15 • 2001

Unfortunately the

age of Star Trek is

still a long way off.

If your computer

doesn’t recognise

you, either by voice

or fingerprint, then

xdm could be a

timely interim

solution. Jo

Moskalewski

explains how

DESKTOPIA: Jo’s alternative desktop

ENTRANCEDOOR

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.

Even Ali Baba and his 40 thieves knew thatwithout a password, there is no open sesame.Since then a lot of water has flowed under the

bridge, and it’s been a long time since a single magicphrase was enough to open the gates of ourcomputers: Every visitor is unique and has his ownpassword – we certainly don’t want to admit all 40thieves at once, after all. Now, there are various waysinto our own kingdom – a classic route finder for thisis xdm, the X Display Manager.

Stone age flairMany people might feel like biting into theirkeyboard in view of the fact that this is definitely thebedrock xdm being presented. Considering KDE’skdm offers more features and runs well, what wouldanyone want with xdm?

With equal justification, users of alternativeinterfaces (like XFce) may ask why they should wastedisk space just for kdm, when in fact xdm startsquicker and as a standard X tool, does not requireany additional disk space. Apart from nibbling awayat resources, the apparently practical features of kdmare debatable: On a system with, for example, 50 ormore users, clickable user selection does not reallymake sense. Anyone wanting to log in will have tolook longer for their icon, than they would take totype in their name. They can still type afterwardsanyway, but by the time you get to the password therodent will have come to a sticky end. A systemwhich does not even reveal the existing users isclearly more secure than one which simply lists themall in the first place.

Distribution sovereigntyAnyone who now reaches happily for their cover CDexpecting a brand-new xdm is going to be bitterlydisappointed. No, we haven’t forgotten to tie up alittle packet, it’s rather that the good part does notcome on its own. xdm is a component of XFree itself,so you will either find it has long since been installedon your system, or it’s slumbering in a free-standing

xdm packet taken from stock by your distributor, onyour distribution CD. In any case you’ve owned the XDisplay Manager, which goes with your graphical userinterface, for a long time. Whether or not xdm isalready installed or not, the simplest way to find outis via entering:

locate bin/xdm

at an input prompt. If there is an output, xdm isalready there. If only the prompt appears again, thepackage manager including the CDs will help withthe distribution.

Open, sesame!If xdm is installed, it should also show itself whenyou start the system. If it doesn’t, then yourdistributor has presumably intended it for a differentrun level than the one in which you are booting.Each run level is a compilation of services that arestarted or stopped. Run levels 2 to 5 are intendedfor ordinary working (0 provides for a shutdown, 6for a reboot, and the single user mode alias runlevel 1 serves unfortunate admins as a safety rope).You can change the run level with the tool init: forrun level 3 it’s the input prompt with the commandinit 3 (important: only root is authorised and able touse init).

Once you have found the run level which servesfor a graphical login by means of xdm, you can enterit as default in the file /etc/ inittab. To do this, youneed only alter the line

id:2:initdefault:

accordingly. SuSE users are better off using YaST forthis, in which the graphical login can be activated.

Page 74: linux magazine 15

BEGINNERS

81LINUX MAGAZINEIssue 15 • 2001

Figure 1: Simple,proven and yetmodern - xdm

Figure 2: Small expansion in Tcl/Tk

manager by adding a clock or the penguins aspresented in previous “out of the box” articles –your imagination has no limits. By the time you login for the first time you will find everything youstart here will be taken over onto the userdesktop.

And so there is a file which is run through whenleaving xdm: Xstartup. Since this (as with xdm) isexecuted by root, it cannot be used to defineindividual user settings. Instead of this, there is asuitable way to sweep tkshutdown off the desktop:in Xstartup, enter a

killall wish

and the shutdown button is done away with whenyou leave xdm. Why is wish sacrificed, when in factthe program is called tkshutdown? Well, the programis a simple script, which wish starts as interpreter. Therug has to be pulled away from under wish, as it is infact the active program.

LabyrinthIt gets more confusing if one looks at the user-equivalent of Xsetup, called Xsession. This file iscalled up after the user has logged in. What youenter here affects all users; if on the other handyou want only to grant special settings to just onespecific user (so that he can use a different windowmanager than the system default, for example),then you should create for them an executable filenamed .xsession in their home directory.

Settings which you have previously activated in~/.bash_profile, are better cancelled in the graphicallogin in this file. Your tried and trusted~/.bash_profile no longer has any effect when youlogin via xdm, because no bash is needed frombooting the kernel to the start of your X session.

Manual labour...... is required, if you want to configure xdm (but youdon’t have to do this – it’s preconfigured in any case).The configuration files are usually to be found under/etc /x11 /xdm/ or /usr/ X11R6/ lib/ X11/ xdm/. It’sworthwhile casting a glance into each of the files inthere – the distributors often cook their ownindividual soups here, so it’s only possible to givegeneral indications. It may be that you have optionsnot available to other users.

The most exciting thing for the home desktoptinkerer may be the file Xresources, which isresponsible for the display. Here among other things,the pixel width of the frame, the colours, fonts andthe greetings text can be altered to your heart’scontent.

No less exciting is Xsetup. This bash script is runthrough as soon as xdm becomes active. It’s thereforepossible in here to provide xdm with a backgroundimage or a background colour or to change thestandard mouse pointer into an arrow. In the simplestcase the first lines of this file could look like this:

#!/bin/shxsetroot -cursor_name left_ptr &xsetroot -solid black &

But it’s not only the simple settings that can bealtered here: When you also start applications, newand interesting options open up.

Down with the mouseIf you run a minimal Linux installation you’ll certainlymiss having a shutdown button with xdm. Thecomputer boots up independently until login, butthere is no option of shutting it down from there justas simply. Just typing in shutdown -h now will afterall scarcely allow just anyone to log in as root.

Attentive readers of this column have long knownthat Ctrl+Alt+Backspace easily does away with the X-Server (and thus, too, xdm, where the latter is betterstopped by Ctrl+R), yet an X-Server armed with xdmhas several lives. On a smart system it has acceptedits death after three attempts at resurrection, but onsome installations he would not spread his heavenlywings even after several weeks. Those of a lesspatient nature therefore find a plain and easilyadaptable Tcl/Tk script on the cover CD, whichsupplements xdm by a shutdown and reboot button.The buttons place themselves automatically at thebottom right corner of the screen.

Installation is pretty simple: Just copy tkshutdownto /usr/ X11R6/ bin/, and add the following line toXsetup:

/usr/X11R6/bin/tkshutdown &

In this way, you can also expand your display

Page 75: linux magazine 15

BEGINNERS

82 LINUX MAGAZINE Issue 15 • 2001

Do you get irritated

by “dear colleague”

emails laden with

Word attachments?

Christian Perle

shows you how you

can take a peek at

the document

without sacrificing

memory to Word

OUT OF THE BOX

AGAINST IT!Out of the boxThere are thousands of tools and utilities forLinux. “Out of the box” takes the pick of thebunch and suggests a little program each monthwhich we feel is either absolutely indispensable orunduly ignored.

Figure 1: Original display in Word 8.0

It’s not always that easy to shake off the world ofWindows. Or is it? With Antiword from Adri J. vanOs it is possible – even in the text console – to

display Word documents so they’re easy to read.

ClearAlthough Antiword can cope with a great manyWord formats, it’s still a very compact program atonly about 100Kb. For the latest version (0.31), youcan get the packed source text from http://www.winfield.demon.nl/index.html.

To install Antiword you need to unpack the sourceand compile the program. You then need to copy thefiles into your home directory and into the /usr/localbranch of the filesystem.

Word for WordTo test Antiword, I have put my head into the lion’smouth and created a brief Word document(tex_is_best.doc) with Microsoft Word 8.0. Thisincludes headings at various levels, a list and a table.The original display can be seen in Figure 1.

In order to feed Antiword with this Worddocument, enter in the shell:

antiword tex_is_best.doc > tex_is_best.txt

The > symbol causes the shell to divert the output ofthe program into the file tex_is_best.txt, otherwise itwould just sail through to the console. Manydocuments can be converted with a simple shellscript.

In Listing 1 you can see the text output created by

Antiword. What stands out is that the programidentifies the headings as such and creates anappropriate numbering. The justified formatting ofthe first paragraph is also retained. The tablerepresentation could be better though – this is wherethe text-based Web browser w3m could be put togood use.

Pure text data can obviously be better edited withstandard Unix tools such as grep than cumbersome.doc files. In order to filter out all the lines containingthe word TeX, you need only pass the Antiwordoutput on to grep. In this case the pipe character |links the two programs:

antiword tex_is_best.doc | grep -w TeX

Apart from pure text, Antiword can also create datain the page description language PostScript, whichcan then be displayed or printed out using gv. Theinvocation looks like this:

antiword -p a4 tex_is_best.doc > tex_is_best.ps

This output format offers more options for textdisplay – for example, font colours are retained(Figure 2).

With filtersIf you’ve tried out all the different text-based mailprograms, you should have finally found your way tothe best – which is mutt – and you’ll certainly wantto call up Antiword directly from this program. In the.mailcap file (which you may have to create fromscratch) in your home directory enter:

application/msword; antiword %s

Straight away mutt displays in the internal viewer allattachments with the MIME type application/msword, without you having to worry about

Page 76: linux magazine 15

BEGINNERS

83LINUX MAGAZINEIssue 15 • 2001

leaves enough space for the quote characters.Text which has been made “invisible” by the

Word function of hiding text, is shown by theprogram when you use the option -s. Whateverelse is still hidden in Antiword will be revealed toyou by the manpage.

Text console In addition to the graphicaluser interface X there are usually severalconsoles running on a Linux system intext mode. These are reached fromrunning X using Ctrl+Alt+F1 to F6. Youcan get back to X with Alt+F7.

Source text The form of a softwarepackage which can be read by humans.By translating it (“compiling”) with acompiler this is turned into an executableprogram.

Shell script A text file with shellcommands, which are executedautomatically one after the other.

Home directory The personal homedirectory of a user. This is where he or

she ends up after a successful log in orwith the command cd with no otherparameters.

Attachment The optional file attachedto an email. This cannot be transferred inbinary form, because non-printingcharacters would get lost. Base64 hasbecome the most frequently usedtransfer format for binary attachments.

MIME Multipurpose Internet MailExtensions. A method for specifyingstandardised file types. Some examples ofMIME types are text/plain (pure text filewithout formatting) or video/mpeg(MPEG-compressed video stream). MIMEis used mostly in mail programs and Webbrowsers.

Quotes If one replies to an email usingthe reply function, the cited mail text isdistinguished by the mail program byplacing quotation marks at the start ofthe line of the text which you arewriting. Most mail programs comply withcommon sense on the Net, whichprescribes the character string “> “(greater-than and space). Neverthelessmany graphical mail programs do notprovide these characters and mark outthe quote by using a different colour or adifferent font.

Manpage Linux, like all Unix systems,has a sort of online reference manual forthe installed programs. This aid is calledup using man program name, e.g. manantiword.

Listing 1: Text output from Antiword1 Why TeX is better than Word

This document describes in a few bullet points the advantages of TeX/LaTeXover Word and WYSIWYG word processors in general.Obviously potential disadvantages are also pointed out. This document alsoserves as a demonstration of antiword, a Word filter for Linux and other Unixes.

1.1 The advantages

Lower hardware requirements

Input can be done using any text editor

Document format portable over operating system boundaries

Professional setting to book printing rules...

1.3 Systems supported

| |Linux/Unix |TOS (Atari |MacOS |Windows || | |ST) | | ||TeX/LaTeX |+ |+ |+ |+ ||Word |- |- |+ |+ |

Figure 2: PostScript display with gv

macroviruses. The file manager Midnight Commander(mc) can be extended in a similar way. Select from itsmenu Command/ Edit suffix data, or use an editor toopen the file ~/.mc/bindings. Now enter thefollowing lines there, and save the change:

shell/.docOpen=antiword -p a4 %f | gv -View=%view{ascii} antiword %f

If you press F3 display, when mc’s bar cursor is over aWord file, the internal viewer shows the text outputof Antiword. If instead you use the Return key, thefile will be converted into the PostScript format andpassed straight on to gv.

SpecialitiesA few of Antiword’s useful options should not gounmentioned. With -L, the program creates thePostScript output in sideways format (“landscape”).This can make wide tables easier to read.

The option -w col is relevant for the text outputand limits the line length to col symbols. If you wantto quote the content of the document in a mailsomething like -w 75 would be advisable, as this

Page 77: linux magazine 15

COMMUNITY

93LINUX MAGAZINEIssue 15 • 2001

Linux Printinghttp://www.linuxprinting.org

As the name suggests, at Linuxprinting.orgyou’ll find all the information that you could

require for printing under Linux. The site includes theHOWTO for printing along with a database ofsupported printers. There’s a suggested printer helppage if you are considering a new purchase as well asa vendor scorecard. The Foomatic section will alsohelp you get your printer up and running.

Humorixhttp://i-want-a-website.com/about-linux/

Humorix offers the latest ‘news’ with anever-so-slight Linux bias. Funny stories of

Microsoft’s supposed antics cosy up to the latestconspiracy theories (usually about Microsoft aswell). Never fails to raise a laugh.

Newshttp://slashdot.orghttp://www.kuro5hin.org

Along with Slashdot, Kuro5hin has beenhelping us keep news topics in focus. Both

systems use a moderator who sorts out news storiesand posts them onto the Web site. Here readers canmake comments that then spawn their owncomments.

SlickPenguinhttp://slickpenguin.com

This site is devoted tohelping out Linux users

through sharing their experiences.It’s worth checking out to saveyou time and it’s also worthposting your own commentsto help out others.

Programming siteshttp://leapster.org/linoleum ***internet5.png

The best programming site we’ve found isLinoleum. Here you can pick up all those

little tips and tricks to make your code smoother. Thealgorithm section saves you reinventing the wheel,while the widget sets get you going quicker.

Linux Onlinehttp://www.linux.org

Internet

THE RIGHT PAGESWhen we’re not hard

at work producing the

magazine, we like to

spend our time

searching out

software and news on

the Internet. In the

office we all have our

favourite bookmarks.

Janet Roebuck sifts

through some of the

latest finds that we

feel are important

and useful.

Doomhttp://jcomm.uoregon.edu/~stevev/Linux-DOOM-FAQ.html

The Doom FAQfor Linux. A

quick guide to gettingand setting up Doomunder Linux.

The most popular site for Linux users.Designed to act as a central source of

Linux information and as a voice for thepromotion and advocacy of the Linux operatingsystem.

Linuxcarehttp://linuxcare.com/

A professional company that helps othersgain the most from Open Source

technology. It’s worth downloading the LinuxcareBootable Toolbox if you have a CD writer as this disccould save your system one day.

Linux Voodoohttp://www.linuxvoodoo.com/

Another essential resource site. Theviewlets feature leads you to some nicely

written tutorials.

Beowulfhttp://extremelinux.esd.ornl.gov/

The Oak Ridge Extreme pages are a resourcefor clustering projects, with a builder’s forum

and whitepapers on building your ownsupercomputer. Well, we can all dream, can’t we?

Tipshttp://portico.org

This site has to be the best-kept secreton the Web. Its simple text layout means

there’s nothing to get in the way of the tips.

Linux PDAshttp://www.zaurux.com

If you run Linux on a PDA then this onlinecommunity is a must visit. Includes news,

information and forums on mobile Linux devices.

Page 78: linux magazine 15

COMMUNITY

94 LINUX MAGAZINE Issue 15 • 2001

Ganesha’s ProjectGanesha’s Project, namedafter the Hindu god ofwisdom and prosperity, hasbeen set up to helpchildren of the Shree BachhauliSecondary School in Nepalset up and administrate aGNU/Linux network usingdonated computers. Theidea for the project evolvedduring a two-month staywith Kuma Raj Subedi, whoteaches at the Nepalese school.

The situation for children inNepal is quite problematic. Having towork, they often cannot attend schoolregularly. However, without education theylack a perspective for their future and so theirchildren will also end up having to work.Ganesha’s Project tries to break this circle by teachingchildren how to use computers in order to enablethem to participate in the information age and keepthem in school.

The first stage is to raise the required finances andcomputers in order to transport them to Nepal,where the network will be set up and the softwareinstalled. The first class of children will then be taughthow to use the machines, so they can subsequentlyhelp other children use the computer pool. Besideselementary computer use Web programming,

Welcome to

another issue of

Georg’s CF Greve’s

Brave GNU World.

The monthly GNU Column

BRAVE GNU WORLD

databases, networks andgraphics will also be covered.

Besides financial aid, theproject also needs network

cables, computers, network cards,a video-projector, printers and so on.

English books about PHP, networking,MySQL, shell scripting and more would also

be very useful.In our richer countries, computers are quickly

outdated and get thrown away. Using them insteadto give children anywhere in the world a betteroutlook for their future seems like a much better useto me. Of course similar problems exist in manyplaces, because of this Ganesha’s Project seeks to bea Free Software project in the sense of trying toinspire others to copy the concept and participate.

It might be useful to collect all experience,operation procedures, and ideas in a kind of projectrepository under the GNU FDL in order to create ahow to that will enable others to start similar projectsin order to help people help themselves.

Ganesha’s Project aims to helpNepalese children set up a

GNU/Linux network

Page 79: linux magazine 15

COMMUNITY

95LINUX MAGAZINEIssue 15 • 2001

HTMLDOCHTMLDOC bears some similarities to the Logideeproject, because it also tries to make documentswidely available. It is also released under the GPL andhas been developed by a company; in this case EasySoftware Products (ESP).

HTMLDOC uses HTML as the source format forwriting documents. These can be used to generateindexed HTML, PDF or PostScript (Level 1, 2 or 3)files. Kurt Pfeifle considers the killer feature to be thatlinks present in HTML are preserved in PDFdocuments as hyperlinks. People who want to makeuse of this don’t have to use the proprietary AcrobatReader, they can also use the Free project xpdf. Thereis justified hope that more Free projects will beavailable soon.

The “Linux Documentation Project” has been usingHTMLDOC to convert their HOWTOs into PDF formatfor quite some time now, replacing the formerly usedSGML-Tools. This seems to prove, it’s safe to say,HTMLDOC is ready for everyday use.

The recently released version 1.8.14 added supportfor Acrobat 5.0 compatible files (PDF 1.4), whichallows 128-bit encryption of documents. It also usesless memory and some problems regarding displayingtables have been resolved.

In terms of speed, HTMLDOC can convert itscurrent handbook (with 102 pages and 17screenshots) in 4.0 seconds to PostScript and 6.2seconds to PDF with maximum compression on KurtPfeifle’s 500MHz Pentium III.

Another option available with HTMLDOC is

Logidee-toolsAnother project this month is Logidee-tools, authored by Raphaël Hertzogand Stéphane Casset. The project’sgoal is to simplify the writing ofcourses and their conversion into print-ready documents and Web pages.

The courses are written as XMLdocuments, which are converted intopresentations or complete training documents. In order to do so, Logidee-toolsuses a XML DTD with some XSL- and Makefiles. For XSLT processing, the projectmakes use of the xsltproc of the GNOME project.

Logidee-tools’ typical users could be anyone teaching courses or giving lessons.Professional trainers in particular should give this project a look, as it wasspecifically written to fit their needs.

The project was originally created by the French company Logidee, whichspecialises in professional training for Free Software. When they realised that thismight also be useful to others, Logidee-tools were released under the GNU GeneralPublic License and the GNU Free Documentation License.

The documentation is still is a weak point as yet, however, as it is only availablein French. An English translation is desired but is not yet planned.

remote-access throughproxies or secure/encryptedconnections in order toconvert Web pages intoPDF. Thanks to bindings toShell, Perl, PHP, C and Java,it can do this even as a“portal” that gets Webpage addresses as input andreturns ready-made PDFdocuments of the page. Anexample of this can befound on the Easy SoftwareProducts home page.

When using HTMLDOCon a local machine, it canbe controlled through a GUI based on the “Fast LightToolkit” (FLTK) or via the command line. The latteralso allows using it in batch jobs in order to automatethe process, should this be desired.

These are just some of HTMLDOC’s features inorder to convey an impression of what the projectcan do. The project is already very mature and allowsnot only defining special effects when turning pagesin PDF presentations, but also definition of titlepages, background images or the creation of “PDFbooks” from randomly chosen Web pages.

On top of this, HTMLDOC is also remarkablyportable. Not only does it run on GNU/Linux, but alsoon IBM-AIX, Digital UNIX, HP-UX, *BSD, OS/2, Solaris,SGI-IRIX, MacOS X and MS Windows95/98/ME/NT4/2000. Further plans for developmentinclude XHTML and an extended stylesheet support.

HTMLDOC inall its

splendour

FLTK widgets in action

Page 80: linux magazine 15

COMMUNITY

96 LINUX MAGAZINE Issue 15 • 2001

SketchIt is no exaggeration to callSketch the currently mostadvanced Free Softwarevector-drawing program. Theproject was started in 1996 byBernhard Herzog, who hasbeen the central developerever since.

Sketch is now rather stableand supports several advancedfeatures like gradient-filling,fading from one picture toanother, transition andmasking. It is also possible toconvert all vector objects,including text, into curves.

Another fascinating feature is the ability to usepretty much any object as a “magnetic” guideline by

moving it to the guideline layer. Ofcourse this isadditional to thehorizontal and

vertical guidelines andthe standard grid.

Sketch is already being used as the GIMP pinbadges on the last GNU/LinuxTag prove. These werecreated by Simon Budig with Sketch, as was theposter of the first Libre Software Meeting inBordeaux.

Sketch can easily be extended with the help ofPython scripts and plug-ins and since Sketch itself iswritten in Python, all user scripts have full access toSketch objects. New object types and import/exportfilters can also be added through plug-ins.

Python was the language of choice for BernhardHerzog as the object-oriented approach is a verynatural choice for vector drawing programs andPython’s flexibility makes experimenting with newconcepts much easier than it would be in C or C++.Therefore Sketch relies almost exclusively on Python,with only a few modules written in C.

Among Sketch’s weaknesses are the limited textsupport and the lack of a possibility to directly entercoordinates and the size of objects by hand, althoughthese problems will probably be solved in theforeseeable future. Right now Sketch is beingmigrated from Tkinter to GTK. The completion of thismigration is the primary goal for the next stableversion (0.8).

The long-term goal is to make Sketch a completevector drawing program, which is able to competewith proprietary solutions. In order to achieve this,the import/export filters still need to be completedand expanded, and the aforementioned text supportneeds to be improved. New features like transparencyeffects, vector filling patterns, CMYK and colour

GNU Passwords On CardThe GNU Passwords On Card (POC) project is a rather young addition to the GNUProject by Henning Koester. This program, under the GNU General Public License,offers the capability to administrate passwords via smartcards. The use should berather obvious for every reader with more than five passwords – especially if someof the passwords are only used once or twice a year.

Until now, many people either wrote down their passwords on pieces of paper,saved them on their hard disk or reused passwords in several places. Everyoneknows these are things you shouldn’t do, but what they don’t know is how tosolve the problem of memorising many passwords reliably. GNU POC offers asolution to this by saving the passwords and short descriptions of them on asmartcard in encrypted form.

Currently GNU POC only supports I2C memory cards, but it is planned tosupport as many cards as possible. One way of helping GNU POC is providing othercards, so their support can be included.

The next project has been on my Brave GNU World wishlist for some time nowand I’m glad it finally worked out.

Just a few examplesof what you canachieve with Sketch

Page 81: linux magazine 15

COMMUNITY

97LINUX MAGAZINEIssue 15 • 2001

management are also planned.So there’s still quite a bit waiting to be done and

Bernhard welcomes any help. In his eyes, the filters inparticular are a good way to get into Sketchdevelopment, as they don’t require completeknowledge about the Sketch internals.

Furthermore there is documentation in French,which should be translated into English and help withthe Web page is equally welcome.

However, it’s not only possible to support thedevelopment of Sketch through voluntary work,which is more or less the classical way. BernhardHerzog works for Intevation, a German companyspecialising in Free Software. Even if Intevation triesto give Bernhard as much time as possible to work onSketch during his regular hours at work, they cannotafford having him work on Sketch full-time.

Therefore Intevation has created an online accountthat can be found via the Sketch home page, whichmakes it possible to buy time for Sketch developmentin US$10 steps. These should not be understood asdonations, but rather an investment in futurepossibilities gained through Sketch.

Similar approaches are very often designated as“tipping culture,” so we are talking about voluntarypayment of an acceptable amount triggered by theunderstanding that this service should still beavailable tomorrow. So if you lack the time or theknow-how to get actively involved in developingSketch, you can let Bernhard Herzog do it for you bybuying him time that he can spend on Sketch.

Should you ask for special things to be includes inSketch as a feature, Bernhard has requested that youalso mention any possible patent problems.

Adobe holds some US software patents regardingtransparency features of PDF 1.4 and some otherparts for PDF >= 1.3. At the moment, Adobe doesnot ask for patent fees, given that the algorithms arebeing used for PDF processing. But this may meanthat Sketch cannot implement these features as itsmain purpose is not PDF processing.

It’s also not clear whether the “Scalable VectorGraphics” (SVG) format poses patent-related problemsfor Free Software. So it may be that at least somefeatures of Sketch may not be used for commercial

purposes in the USA. The same will be true for Europeshould these patents become valid here.

If you haven’t signed the Eurolinux-Petition yet,you should do this as soon as possible in order tosupport the movement against software patents inEurope.

Enough for todaySince the question is raised repeatedly, I’d like topoint out that the Brave GNU World features all FreeSoftware, whether it is part of the GNU Project ornot. Every type of Free Software project can getfeatured.

Alright, that’s enough for today and as usual I’dlike to ask for comments, questions, ideas and newproject introduction by mail to the usual address. ■

Send ideas, comments and questions to Brave GNU World [email protected]

Homepage of the GNU Project http://www.gnu.org/Homepage 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.htmlGanesha’s Project homepage www.ganeshas-project.orgLogidee-tools homepage http://www.logidee.com/toolsHTMLDOC homepage http://www.easysw.com/htmldoc/HTMLDOC PDF-O-Matic http://www.easysw.com/htmldoc/

pdf-o-matic.phpFast Light ToolKit homepage http://www.fltk.orgGNU Passwords On Card homepage http://www.gnu.org/software/poc/

poc.htmlGNU software directory http://www.gnu.org/software/Sketch homepage http://sketch.sourceforge.netIntevation homepage http://www.intevation.deEurolinux Petition http://petition.eurolinux.org

Info