linux magazine uk 13

86

Upload: -

Post on 26-Mar-2016

260 views

Category:

Documents


7 download

DESCRIPTION

linux magazine uk 13

TRANSCRIPT

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

INTROCOMMENT

13 · 2001 LINUX MAGAZINE 3

General ContactsGeneral Enquiries 01625 855169Fax 01625 855071

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

Editor John [email protected]

CD Editor Richard [email protected]

Contributors Alison Davis, Colin Murphy,Richard Smedley, RichardIbbotson, Jono Bacon, JasonWalsh, Chris Brown, JimCheetham

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

International Contributors Simon Budig, Mirko Dölle,Björn Ganslandt, Georg Greve,Jo Moskalewski, Christian Perle,Stefanie Teufel, Patricia Jung,Oliver Kluge, Ulrich Wolf,Bernhard Röhrig, ThomasDrilling, Anja Wagner, AndreasJung

Design Renate Ettenberger vero-design,Tym Leckey

Production Bernadette Taylor, 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 Ltd

No 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 for publicationor license to third parties on a non-exclusive worldwide basis byLinux 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

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

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

We pride ourselves on the origins of our magazinewhich come from the very start of the Linuxrevolution. We have been involved with Linux

market for six years now through our sister European-based titles Linux Magazine (aimed atprofessionals) 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 ofall the knowledge and technical expertise of all the major Linux professionals and enthusiasts. Noother 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

ONWARDSAND

UPWARDS

Nearly the wholeof my month has

been dedicated to setting up networks anddealing with people who seem to excel inadding new requirements at the last minute –people who want to print to all printers; wantto put all cheap inkjets onto a network; wantto monitor and control users desktops.Admittedly, there haven’t been many requestsfor Linux on the desktop, but for everythingelse there has been great demand.

Corporate-wise, Lotus Notes seems to bevery popular at the moment along with PHPand, surprisingly, Fortran. In each case FreeOpen Source software has coped and in a lotof cases has been better than some of theoutrageously priced commercial options. Theability to change some part so that it suits aclient rather than have a client change to suitthe package is very refreshing.

On the other hand, the big Linuxdistributors have started to releasecommercial packages. Here they are using abase of Open Source and adding all theservices you would expect to let you get a

good night’s sleep without worry. It can rangefrom firewalls to Web-based catalogues. Yeswe can do it all from free packages butsometimes it is nice just to throw in a disc andnot have to run through a mental checklist.

Finally, having more choice gives anypotential IT proposal more flexibility. Theoption of no cost is still the biggest win but, ifneeded, having business products sold withbackup from a third party may also swing the balance

At the end of the day, formulatingproposals simply comes down to a case ofmeeting customer needs. To that end – whena client requires a little more guidance – theintroduction of the subject of Open Sourcesoftware certainly won’t prejudice a proposal.Now where have I put that Fortran primer?

Happy coding!

John Southern, Editor

Page 4: linux magazine uk 13

NEWS

6 LINUX MAGAZINE 13 · 2001

LINUXNEWSRed Hat databasedates releasedRed Hat has launched a new database trainingcourse. This is the first in a planned series ofcourses on Red Hat Database, the database isbased on PostgreSQL. It is an intensive four-daycourse that covers topics ranging frominstallation and SQL fundamentals through tomore advanced topics such as transactions andstored procedures. Scheduled for late Novemberin Europe, it will appeal to database developers, Web and applicationdevelopers and system administrators migrating to Red Hat Databaseor PostgreSQL, as well as current users. The course will provide thefoundation for additional courses, such as database administration,Web development and application development, as well as migrationand co-habitation with Oracle and DB2.

Information regarding Red Hat’s e-business training, coursedescriptions, registration and facility locations is available athttp://www.europe.redhat.com/training/ebusiness/

To find information about the Red Hat database training courseplease visit: http://www.europe.redhat.com/training/ebusiness/rdb147_desc.php3

RedBoot is a standardised embedded debug andbootstrap solution that provides firmware forrunning and debugging embedded Linux, eCos andGNUPro applications.

GNUPro ToolSuite: Red Hat’s commercialsoftware development suite of tools built aroundthe open source GNU standard. GNUPro productsare tested, certified and produced as an integratedtool suite for developers of both desktop andembedded products.

http://www.redhat.com/embedded.

Smaller Red HatRed Hat unveiled the Red Hat Embedded LinuxDeveloper Suite, a packaged offering thatcombines new versions of its embedded Linuxplatform, development tools, runtimetechnologies, and support designed fordevelopers looking for a standardised open sourceplatform for faster creation, deployment andtesting of target software components forembedded devices. Targeting MIPS, SuperH, X86,PowerPC and ARM/StrongARM/ XScalearchitectures. It’s based on Red Hat eCos: An opensource real-time operating system for deeplyembedded applications, supporting µ-Itron andEL/IX APIs.

Borland support Linux on the WebBorland, has launched Web services support for Linux. As Linux continues to make in-roads as thefastest-growing operating system for servers, the benefits of Web services and Apache Web server willhelp to accelerate the adoption of Linux as an e-business server. Borland now plans to provide a RADsolution for Web services that will expand the Internet capabilities of Apache Web servers andapplications for Linux using the Borland Kylix RAD development platform. Borland RAD solutions forWeb services enable companies to create enterprise applications easily and simplify business-to-businessintegration of applications running on any platform with support for emerging industry standards: XML,SOAP and WSDL.

European course datesUK: 20-23 November 2001Germany: 26-29 November 2001France: 4-7 December 2001

Page 5: linux magazine uk 13

NEWS

13 · 2001 LINUX MAGAZINE 7

LynuxWorks Inc has announced a new series ofbundle options to include service and support withenhanced tools for its popular BlueCat Linuxoperating system platform.

At the core of the bundle options is LynuxWorksBlueCat Linux 3.1. BlueCat supports architecturesincluding Intel IA-32 and XScale micro-architecture,MIPS, ARM family (including Thumb extensions),StrongARM, PowerPC (including PowerQUICC) andHitachi SuperH.● BlueCat Standard Bundle: BlueCat 3.1,

commercial license and support package forWindows or Linux host development, pricedat $2,699.

● Professional Trace Bundle: BlueCat 3.1,commercial license, SpyKer kernel trace tool andsupport package for Windows or Linux hostdevelopment, priced at $3,799.

● Professional IDE Bundle: BlueCat 3.1, commerciallicense, LynuxWorks’ VisualLynux IntegratedDevelopment Environment (IDE) or CodeWarriorIDE Edition and support package for Windows orLinux host development, priced at $4,899.

● Developer’s Bundle: BlueCat 3.1, commerciallicense, SpyKer kernel trace tool, VisualLynux IDEor Code Warrior IDE Edition and support packagefor Windows or Linux host development, pricedat $5,999.

MandrakeSoft has started its second version of itsWeb-based support centre called MandrakeExpertV2 support centre and accessed atMandrakeExpert. co. The initial site was launchedin early 2000 to connect enterprises and users toonline Linux experts so as to answer a variety oftechnical questions. The first version wasextremely successful in providing community-oriented free support.

The new “MandrakeExpert V2” allowsMandrakeSoft experts along with 2000MandrakeSoft Affiliates to provide support for a fixedfee with reductions for multiple incidents purchased.

MandrakeExpert.com V2 now offers: · Supportprovided by the Linux community – the free supportthat everybody is used to.

Premium support provided by MandrakeSoft andaffiliate Experts – this paid support channel providesa top level and fast support option.

The pricing starts from $10 when buying aunique incident down to $6.7 per incident whenbuying 10 incidents, for subscribed users.MandrakeExpert currently has 85,000 subscribed users.

http://www.mandrakeexpert.com

Ask Mandrake

Bundling Bluecat

AMD is good for Linux – officialAMD announced that major Linux distributorsCaldera, MandrakeSoft, Red Hat, SuSE, andTurbolinux have certified the AMD Athlon MPprocessor and the AMD-760 MP chipset,AMD’s multiprocessing platform for one andtwo-way workstations and servers. Thiscertification assures end users and computermanufacturers that AMD’s multiprocessingplatform has been thoroughly tested by themajor Linux distributions. The certificationsdemonstrate that business customers can takeadvantage of robust and reliable AMD AthlonMP processor-based workstation and serversolutions running on the Linux operatingsystem. AMD’s multiprocessing platformsupports Double Data Rate (DDR) [email protected]

Exabyte and Ecrix mergeExabyte Corporation, who makes network storage,and Ecrix Corporation, (tape solutions for midrangeservers and high-end workstations), announced anagreement to combine the two companies.

Under the terms of the merger agreement,Exabyte will issue 10 million shares of commonstock in exchange for all of the outstanding equityof Ecrix. Additionally, certain Ecrix investors andpersons related to them will invest $9.4 million innew Exabyte Series H preferred stock at $1.00 pershare at the time of closing. The preferred stock willbe convertible into common stock on a share-for-share basis.

Ecrix announced that Compaq has selectedboth the SCSI and IDE versions of VXA-1 fortheir commercial desktop and workstationproduct lines.

Page 6: linux magazine uk 13

NEWS

8 LINUX MAGAZINE 13 · 2001

NuSphere corporation – creator of thefirst Internet application platform basedopen source components – hasappointed the Logicsoft Group as itsfirst reseller. Logicsoft supplies boxedapplication development, systemssoftware tools and applications todevelopers and small to medium sizedenterprises, as well as largerorganisations. The deal covers all theNuSphere products including MySQLand Advantage, which includes acomprehensive set of editing tools tospeed development of database drivenweb applications using PHP. Demand forthe products led to Logicsoft requestingthe reselling agreement from NuSpherewho were keen to take advantage ofthe offer of local support and servicesfor the growing number of UK users.

Command Prompt Inc launchDocPro. DocPro is a compilation oftools designed to allow technicalwriters to effectively process theirDocBook SGML and XML layout.DocBook itself is a powerful mark uplanguage. Command Prompt, Inc.has created a completely self-contained environment, whichallows for easy upgrading andmaintenance. DocPro Basic includes:DSSSL StyleSheets for SGMLtransformation, XSLT StyleSheets forXML transformation, SGML/XMLprocessor, XSLT Processor. Workswith GhostScript and Latex.

http://www.commandprompt.com/products_DocPro.lxp

Technical Command PromptTechnical Command Prompt

Quadratec has announced that Virgin.Net hasadopted their Time navigator software for enterprisedata protection to protect data assets at thecompany’s Leicester Square headquarters. Virgin.Netsays it’s Solaris focused but also uses MS and Linux platforms where they make sense. Time Navigator’sgraphical user interface, visual file versioning and redundant delta cataloguing are key advantages of theQuadratec product. Time Navigator 3.5 software is now being used by Virgin.Net to maintain anoperational availability level of 99.99% with a maximum allowable downtime window of four hours,excluding system boot time. Backup data is sent to large third party tape arrays with several hundred servertapes fed into it, cycled on a regular basis with a remote, off-site facility. Total storage capacity in use is500G with 160G in modified data being backed up daily.

Virgin data

Compaq trains withRedHatCompaq will be offering its newly announcedAccredited System Engineer and AccreditedPlatform Integrator level Linux certificationprograms in conjunction with Red Hat’s CertifiedEngineer program. These aim to extend thescope of professional training available to Linuxsystems and software professionals and positionthem to take greater advantage of theexpanding Linux marketplace.

The API qualification is designed to provide acertification of basic networking systemintegration and support skills for systemengineers with Compaq customers. The ASEqualification provides a certification of advancednetworking, systems integration and supportskills. The RHCE is now listed as one of thecredentials required for ASE certification.

National gridIBM has been selected to build the world’s mostpowerful computing grid, an interconnectedseries of Linux clusters capable of processing13.6 trillion calculations per second. The gridsystem or distributed terascale facility will enablethousands of scientists across the USA to sharecomputing resources. IBM Global Services willdeploy clusters of IBM eServer Linux systems atthe four DTF sites beginning in the third quarterof 2002. The Linux clusters will be connected toeach other via superfast 40-Gigabit per secondQuest network, creating a single computingsystem able to process 13.6 teraflops makingthe DTF more than a thousand times faster thanIBM’s Deep Blue supercomputer. Using openprotocols the Linux cluster will smoothly connectto a heterogeneous collection of existing highperformance computers at the four labs,creating a giant virtual computer that may beaccessed from any point on the grid.

New sphere for NuSphere

Page 7: linux magazine uk 13

COMMUNITYBRAVE GNU WORLD

13 · 2001 LINUX MAGAZINE 9

Enterprise blasts offSuSE Linux has presented its Enterprise Serverversion, based on the latest 2.4 Linux kernel andoptimised for deployment in high performanceservers. Enterprise Server 7 comprises all serverservices relevant in Linux, enabling theimplementation of email, Internet and applicationservices as well as file and print services inheterogeneous networks. SuSE Linux EnterpriseSever 7 has powerful support of various hardwarearchitectures and a high degree of fail-safety,making it an ideal medium for consolidatingcomplex server structures. It provides professionalLinux users with a unique full service offer withrelease cycles of one year and maintenance periodstuned to meet customer requirements. Since theend of August, SuSE Linux Enterprise Server 7 hasbeen available for AMD and Intel 32-bitarchitecture, 64-bit architecture and IBM’smainframe platform S/390 versions for IBM’s iSeries,pSeries and zSeries are to follow in the late autumn.

Argus systems Group Inc hasannounced that its awardwinning Pitbull LX securitysoftware can now lock downall popular distributions ofLinux and the 2.4 kernel,securing Web facing servers

against malicious attack andCode Red-type threats. With turnkey installation in thirty minutes, Pitbull

provides rapid security for Red Hat (6.2, 7.0, 7.1) SuSE (7.1, 7.2) Mandrake(7.2 8.0) Debian GNU/Linux (2.2) and TurboLinux (6.5). The software also

supports custom installations of the 2.4 Linux kernel. Linux is used in 29% ofpublic Web servers, more than any other non-Windows OS, and has had its share

of attacks in the past. Pitbull LX collects bugs and security flaws which could grant anattacker system-wide access into a single security compartment. It also has the facility

to restrict users to authorised areas, eliminating Superuser vunerabilities.

Pitbull dogs Linux

Mandrake 8MandrakeSoft has announced the availability ofMandrake Linux PPC 8.0 final release, buildingon Mandrake Linux 8.0 release for the x86architecture. It is now availablefor Power PC G3 andG4. Mandrake 8.0features Drakx for anentirely graphicalinstallation, easy andsafe partitioning withDiskDrake, theMandrake control centrefor one placeconfiguration,automatic management of software packagesand supermount for transparent access to CDsand peripherals. Tools have been updated,based on the 2.4 version of the kernel and itnow boots from CD-ROM for most machines.

Realsoft Graphics has released a version of itspopular animation software ‘Realsoft 3D’ forthe Linux operating system. Realsoft3D is a full-featured, high-end 3Dmodelling, rendering andanimation software package. Theproduct offers an impressivecollection of advanced featureswith a price tag that is suitable for alarge part of graphic orientedcomputer users. Realsoft 3D forLinux is currently shipping as acommercial beta version. Thelist price is $300 USD(education price $200). The price includes afree upgrade to the final product release.

Real 3D from Realsoft

Page 8: linux magazine uk 13

NEWS

10 LINUX MAGAZINE 13 · 2001

German textile facility Lauffenmüehle, hasinstalled the first SuSE Linux application onan IBM eServer iSeries to be used forcommercial purposes.

Based in Lauchringer, Germany, the companyuses SuSE version 7.1 running in a partition onan iSeries 820 machine for its stock planningand control system. An initial Linux partitionwas run in a test environment on an AS/400720; once active and stable it was migrated tothe iSeries 820.

The LPAR technology available on the iSeriesnow runs the Linux stock planning and controlapplication in parallel with the test partition,OS/400 and traditional Web applications suchas a firewall. The company will also consolidateits servers using Linux and the iSeries.

The project was implemented in six weeks byIBM Business Partner Fritz and Macziol GmbH.They now aim to create additional applicationsfor Lauffenmühle using the GNU codes providedby SuSE.

Red Hat gets mobileRed Hat and 3G Labs have announced that they arejointly developing a real-time operating system for2.5G and 3G mobile devices. Ecos/M3 will aim togive developers a cheaper and more reliable base todevelop new mobile devices. The hardware andsoftware will be supported at 3G Labs in Cambridge.

Open VistasMonta Vista software is now offering embedded developersusing its flagship product. Hardhat Linux 2.0Professional Edition offers a choice of graphicaldevelopment environments – the first fullgraphics add-on for HardHat. HardHatgraphics and Qt/Embedded graphics toolkitfrom TrollTech Inc are now available fromMontaVista. HardHat graphics is an opensource environment for building graphics-based applications for embedded devicesand provides and extensible multimediaplatform for developing the nextgeneration of digital multimedia devices.Qt/Embedded for HardHat Linux is a packagedesigned to work with HardHat Linux andincludes Qt Designer, a full function GUI builderand Qt Linguist which provides international languagetranslation. Both packages will help developers create anddeliver powerful graphics based applications for HardHat Linux. Both are extensible and modular,provide access to source code and are scalable for embedded devices. Monta Vista has also announcedthe introduction of the High Availability Framework for HardHat Linux 2.0, which is for datacommunications applications with heavy I/O loads.

It provides a standards-based open architecture software platform for building fault resilient systemsbased on the industry standard compactPCI and customer specific hardware. Marketing managerGlenn Seiler said, “With this release, MontaVista continues the trend of moving embeddeddevelopment away from proprietary, closed software and hardware designs toward open, standards-based systems.”

IBM send mail withSendMailSendmail has announced the availability of itscomplete line of products for Linux on the IBMS/390 mainframe Sendmail Switch, Sendmailadvanced message server and Sendmail mobilemessage server on Linux for the mainframeprovide a reliable and manageable emailsystem for business. Joann Duguid, director ofmarketing for Linux on the IBM eServer zSeriessaid “Consolidating the management of criticalapplications, such as email, is a priority for ourcustomers, particularly in today’s economicenvironment. Companies like Sendmail, Inc.and their products and expertise in messagingadd to the benefits of Linux for the mainframe,with a low cost of ownership and the ability togrow with a company’s needs withoutrequiring additional investment.”

SuSE suits you

Page 9: linux magazine uk 13

COMMUNITYBRAVE GNU WORLD

11

Panda protection Panda Software is offering Panda Antivirus for Linuxas freeware. This application ensures effectiveprotection against viruses specifically designed toattack Linux like ‘Ramen’ or ‘Lion’. Allowing forperfect integration with the most common Linuxapplications – Red Hat, Mandrake, Debian andOpenBSD. The system scans both DOS andUNIX/Linux disks. It also offers email protection, as itscans base 64-MIME files.

Panda Antivirus for Linux can be downloaded athttp://www.pandasoftware.com/com/linux/linux.asp

Tivoli Systems Inc has announced an extension of itssupport for Linux to its security and Webmanagement software. Tivoli now offer support forLinux on a number of key products within its e-business infrastructure management solutionsincluding security, storage performance andavailability software. Tivoli plans to extend Linuxsupport to Policy Director 3.8 secure accessmanagement software from October. Risk Manager3.8 from September. Tivoli User Administrationalready supports Linux. Both Web Services Managerand Web Services Analyser, which enable businessesto manage their infrastructures across the Internetwithout compromising security, will support Linuxby the end of the year.

Tivoli Storage Manager and Storage NetworkManager 1.2 will support Linuxfrom September.

Lara underLinuxRemember the Net Yaroze developmentkit for the Sony PlayStation1? Well Sonyis planning on launching a Linuxdevelopment kit for the PayStation2 ifenough interest is shown. Thedevelopment kit is already available inJapan. To show your interest sign up athttp://www.technology.scee.net.

13 · 2001 LINUX MAGAZINE

SuSE Linux has announced the UK availability ofthe SuSE Linux Database Server combining theoperating system platform SuSE LinuxEnterprise Server with IBM’s DB2 database. DB2supports the widest variety of hardwarearchitectures, allowing the implementation ofvery large databases on various hardwarearchitectures, as well as for data exchangebetween the platforms. It allows a scalablearchitecture for customers that want to expandtheir infrastructure as their businesses grow, italso supports smaller PC-based databases and isvery flexible. The workgroup edition of SuSELinux Database Server comes with a multipleworkstation version of the DB2 database forapplications and data that are jointly used by aworkgroup or department over a PC-basedLAN. The Internet edition delivers storedinformation to an unlimited number of usersover the Internet.

SuSE DatabaseHP Introduces Linux Security Software and its FirstPervasive Linux Product for Intelligent DevicesHewlett-Packard strengthened its commitment toopen source with several new offerings for Linux-based systems.

HP Secure OS Software for Linux and its HP Chai-LX embedded Linux software platform, expandingthe company’s comprehensive Linux offerings intotwo key strategic markets where customers aredemanding reliable Linux solutions security andintelligent devices.

HP also announced its intention to open sourceits ChaiServer product, unveiled a broad offering ofmanageability and high availability products forLinux environments, announced its EmbeddedSoftware Developers Network, and unveiled twonew Linux-based workstations in Europe.

Chai-LX is to make Linux pervasive by extending itto intelligent, connected devices. HP developed HPChai-LX to power new HP consumer appliances.Devnet provides a Web-based collaborativedevelopment environment for Chai.

http://devnet.hp.com

HP tee off with Chai

More support from Tivoli

Page 10: linux magazine uk 13

COVER FEATURE FOCUS ON PRINTING

12 LINUX MAGAZINE 13 · 2001

five per cent graduations of the main printingcolours – Cyan, Magenta, Yellow and blacK (CMYK).

The remaining tests are used to try out therastering capabilities of the printer on fine angledlines. The test with yellow text on a blackbackground and vice versa proved very difficult formost printers once the point size was below 4.

A red-brown relief picture permits a good opticalcheck of the overall print quality. The outer limits ofthe page allowed us to calculate printable coverage,colour graduations showed the ability of the tonesto run into one another and the straight lines inyellow, white and black very quickly determinnedthe precision of printing The photographic test wascarefully controlled with the set up taking longerthan the actual shoot, calling on the skills of aprofessional photographer to arrange the still lifeelements. Using a large format camera means wenow have a high resolution image with which wecan test scanners later on.

The Agfa IT8 standard colour chart allows us toaccurately determine ink saturation levels for bothscanners and colour printers. The typewriter has anopen side allowing us to check the colour depth ofrastering, as does the toy Tux, with his image beingreflected in both black and white. Bianca, themodel, is a challenge for printers and scanners. Herfine flyaway hair fails to print if resolution is poor,with the dark shirt also giving a good opticalimpression. The resulting image was printed to thetest subjects via Gimp.

Linux Magazine is breaking new ground with thistest of laser printers, our team developed more than200 tests to examine and assess printers in as aprecise and detailed a way on the Linux platform asWindows users have long become accustomed tofor their reviews. These tests fall into three distinctparts, probing for speed and gauging bothgraphical and photographic resolutions.

To accurately test the speed of the laser printerswe used Star Office and a simple letter allowing usto also do the costing and timing calculations.

To allow us to fully compare the graphicalcapabilities, a complete range of graphic tests hadto be produced. Written by Felix Marcon and OliverKluge, using CorelDRAW, which was the onlypackage that could accurately cope with the finedetail required for such a task. Their effortsincorporate some novel features, putting thesubjects through a most testing time.

As you can see from the sample printed opposite,the first part of the test is a colour saturation test,which mono printers should correctly present inspectacular shades of grey.

The second of these graphical tests is the mosttelling, with coloured lines on white or blackbackgrounds. As the lines become narrower theybreak down in resolution and interference patternsform. The lines begin to merge into a solid block andthe size of the block, which is proportional to theresolution of the printer. Test three shows theshading capabilities of rastered images. Test five is in

The Competence Centre took over three

rooms at Linux Magazine for two weeks

recently. 13 laser printers were put

through their paces in a completely new,

rigorous procedure.

13 Laser printers on Test

CAPTUREDON PAPER

OLIVER KLUGE, MIRKO DOLLE

Page 11: linux magazine uk 13

COVER FEATUREFOCUS ON PRINTING

13 · 2001 LINUX MAGAZINE 13

Kyocera FS-3800One printer proved itsstrengths so convincingly thatthe editors found their choiceeasy. The FS-3800 fromKyocera Mita comes in first.Its permanentphotoconductive drum,made from ceramic insteadof plastic, means the devicehas unbeatably low runningcosts. All this printer needs,practically, is paper and toner,nothing else.

With a smooth print unit,network interface and smartpaper handling (whichaccepts a full 500-sheet stackin the tray and, with the aidof a sensor pin, also preventspaper overflow) this printer isthe best choice in the Linuxoffice. There are goodexpansion possibilities byadding on extra trays andother accessories.

Recommended

2001/13

Printing under Linux is one of the areas that hasbeen running for a long time without any greatproblems. Obviously there are differences – and thepurpose of the test was to work these out. Therange of printers we tried consisted mainly of blackand white laser printers with a print output of atleast twenty pages per minute and built-in networkinterface. This class of printer, which can costanywhere up to £1000, is the typical choice to makein furnishing small to medium sized offices,especially when the printer is likely to be used byseveral people on a network. A colour laser printerwas also examined, for comparative purposes andto give us all a chance to dream.

Office work calls for mastery of as manyemulations as possible (PCL and Postscript) andsmooth data handling. It goes without saying thatprinting should also be fast and produce clean copy,but the weight, speed and quality must be offset bythe costs. The purchasing costs are only part of theTotal Cost of Ownership (the TCO), since over theprinter’s lifetime the cost of consumables, such astoner and drums will amount to more than theoriginal investment. This is why we went to thetrouble of printing a toner cartridge until completelyempty on each printer, using a high capacitycartridge if available. Also, the laser printers weremeasured for electrical power consumption, whichis not insignificant – when a laser printer can drawup to 800 watts in pulses, if the fixing roller has tobe reheated.

PlanningIn planning the installation and location of an officelaser printer, you must remember that smells are givenoff by these devices. Although advertised as such bymany manufacturers, there is no question of thembeing ozone-free. Toner dust and softeners in theplastics that heat up are not exactly pleasant either.

The software-end control of the printers caused noaggravation in the test. All printers could beconfigured on the system using – SuSE Linux 7.2 –with YaST, without any problems. The printers all gotthemselves an IP address from the DHCP server andworked smoothly under it. PCL or Postscript, it madeno difference, apart from a rare exception, all thedevices worked straight off. Both Gimp and StarOffice printed willingly and with good quality on thedevices offered by the system. It was only with Wine(used for CorelDRAW) that there was some initialbother. Wine has problems with over-long printerand alias names in /etc/printcap. Names which aretoo long cause Wine to crash immediately afterstarting. If the name is edited by deleting alias names,which are defined several times, everything works.

Thus configured, there is no longer any obstacleto printing under Linux. But for use in largercompanies, the configuration software, which issometimes also available for Linux, or installation ofthe devices via built-in Web interfaces isrecommended. The use of additional print softwaresuch as CUPS or Turboprint can be a good idea –these are also presented in this issue. ■

Page 12: linux magazine uk 13

Manufacturer

Model

Emulation

Resolution

Date, Time

Print Length

Penguins can see text at 10 pointPenguins can see text at 9.5 pointPenguins can see text at 9 pointPenguins can see text at 8.5 pointPenguins can see text at 8 pointPenguins can see text at 7.5 pointPenguins can see text at 7 pointPenguins can see text at 6.5 pointPenguins can see text at 6 pointPenguins can see text at 5.5 pointPenguins can see text at 5 pointPenguins can see text at 4.5 pointPenguins can see text at 4 pointPenguins can see text at 3.5 pointPenguins can see text at 3 point

Penguins can see text at 10 pointPenguins can see text at 9.5 point

Penguins can see text at 9 pointPenguins can see text at 8.5 point

Penguins can see text at 8 pointPenguins can see text at 7.5 point

Penguins can see text at 7 pointPenguins can see text at 6.5 point

Penguins can see text at 6 pointPenguins can see text at 5.5 point

Penguins can see text at 5 pointPenguins can see text at 4.5 point

Penguins can see text at 4 pointPenguins can see text at 3.5 point

Penguins can see text at 3 point

Printer Test

Cyan 12 PointMagenta 12 Point

Yellow 12 PointRed 12 Point

Green 12 PointBlue 12 Point

Linux Magazine October 2001

Page 13: linux magazine uk 13

COVER FEATUREFOCUS ON PRINTING

13 · 2001 LINUX MAGAZINE 15

Marking systemMarks in this hardware testare awarded out of a possible5, where 5 out of 5represents the lowestpossible award and 1 out of5, the highest.

Brother HL-2460NThe 24-pager from Brother has only 600 dpi printresolution but this doesn’t lead to anydisadvantages. Equipped with 48MB RAM, it caneasily keep up in terms of quality, even whenprinting Bianca, with its 1200 competitors. And yetthe device is speedy – only two devices are faster.

The display looks good, as it uses not only text,but also three types of backlighting to make it clearfrom a long way off what’s going on. Unfortunatelythe printer reports an overfilled paper output tray asa paper jam and thereby misleads the user.

Configuration is practical via the built-in Webinterface, although you have to look very hardfor the password in the CD version of thenetwork manual.

In summary, the Brother is a good and reliableprinter for office use.

Epson EPL-N2050+It’s obvious that Epson is related to the Xeroxprinter, but the innards are not as similar asthe printer engine would lead you to think.The EPL-N2050+ does not offer Postscript,hence the device had to be controlled in thetest with PCL.

A bug prevents resolutions higher than 300dpi. At 600 dpi groups of lines are displaced bya couple of dozen dots to the right, making itimpossible to use this resolution.

This limitation is also responsible for thepoor cut off in the quality test. If Epson correctsthis bug, the device might cut off better, but atthe moment it is in last place for quality.

On the other hand, Epson’s control panel is awinner. With six LEDs and eight buttons theEpson is very nice to use.

Brother HL-2460N

Price £750Output 24 P/min, 600x600 dpiPrint quality 3 out of 5Speed 3 out of 5Cost of printing 2.5 out of 5 (0.97 pence / page)Overall mark 3 out of 5

Genicom Micro Laser 210The printer from Genicom also looks enough likethe Xerox to be mistaken for it, but unlike Epsonthis offers Postscript and 1200 dpi resolution. Thehigh resolution means that four times as muchdata has to be transferred as at 600 dpi.

The extra sharpness in the Genicom gives aclear typeface. The quality of the photoreproduction does not, however, greatlyimprove, and the Microlaser is in the middle ofthe field for this.

It was striking that the device did notautomatically switch into energy-saving mode –to do this it was necessary to re-enter the switchoff time via the printer menu. But even in energy-saving mode, the fans continued to run.

At present the manufacturer only gives twosources of supply, and an Internet presence.

Genicom Micro Laser 210

Price £1028Output 21 P/min, 1200x1200 dpiPrint quality 2.5 out of 5Speed 5 out of 5Cost of printing 3 out of 5 (1.23 pence / page)Overall mark 3.5 out of 5

Epson EPL-N2050+

Price £580Output 20 P/min, 1200x1200 dpiPrint quality 4.5 out of 5Speed 3.5 out of 5Cost of printing 4 out of 5 (1.04 pence / page)Overall mark 3.5 out of 5

Page 14: linux magazine uk 13

COVER FEATURE FOCUS ON PRINTING

16 LINUX MAGAZINE 13 · 2001

HP Laserjet 4100NJust by looking at the HP printer, you can see the longprinter tradition of its American manufacturer. Inmany details it is persuasive because of its solid, well-thought-out quality. This starts with the expansionslot, which can be used without tools and does notstop even with the very well-made Web front-end.

In all test categories the printer deliveredcompletely satisfactory results and thus it winssecond place. When it comes to the costs ofconsumables, you can see that there is particularcommitment. Despite the disposable drum the HP isone of the most economical printers. But the seals onthe toner cartridges could be improved – if thecartridge is shaken just before it comes to the end,some toner trickles out. The HP remains true to itself.Printers from HP have the image of an office workhorse, which this device lives up to.

Kyocera-Mita FS-3800NThe crucial construction criterion that sets thisprinter apart is the almost everlasting photodrum. With it, an impressive page output, aswell as extremely low running costs, is possible.In practical terms, this printer needs only tonerand paper. At 0.33 pence for toner per printedpage it makes even normal copier paper (0.3pence) a dear item in the printing business.

A sensor ensures that the FS-3800 does notoverfill the output tray in its excessive zeal, andthe print out is paused in due course, beforethe papers fly off all over the place. The displaycertainly provides concise but comprehensibleinformation about current status. The Webinterface looks tidy and businesslike. TheKyocera is the ideal printer for small to mediumsized offices.

Lexmark Optra M412nThe smaller of the two Lexmark printers promiseslow-priced output for the office. It ‘s easy tooperate the control panel and the Web interface.We liked the Mark Vision control software. Thepage output, at 17 pages, is fast but the papertray holds only 220 sheets and has no fill levelindicator. The covers rattle or stick out.

The clamp for keeping the sheets in orderkeeps slipping out of the loops. In energy savingmode the device demands 23 watts and the highpulse output causes light bulb flickering on thesame power circuit. After 90% of total outputstripy print outs appear.

In all, both test devices achieve only threequarters of the output claimed by themanufacturer. The result is a cost per page of1.87 pence, the highest in the test field.

2001/13

Lexmark Optra M412n

Price £770Output 17 P/min, 600x600 dpiPrint quality 3.5 out of 5Speed 3 out of 5Cost of printing 5 out of 5 (1.87 pence / page)Overall mark 4 out of 5

Kyocera-Mita FS-3800N

Price £900Output 24 P/min, 1200x1200 dpiPrint quality 3 out of 5Speed 2.5 out of 5Cost of printing 1 out of 5 (0.63 pence / page)Overall mark 2.5 out of 5

HP Laserjet 4100N

Price £980Output 24 P/min, 1200x1200 dpiPrint quality 3.5 out of 5Speed 3 out of 5Cost of printing 3 out of 5 (0.98 pence / page)Overall mark 3 out of 5

Page 15: linux magazine uk 13

COVER FEATUREFOCUS ON PRINTING

13 · 2001 LINUX MAGAZINE 17

Lexmark Optra T620nThe larger of the two Lexmarks is distinguished byits poor quality finish and, as with the OptraM412n, the output tray clamp is shoddy. Instead ofthe claimed 500 sheets, the paper cassette can onlyhold 490, the rest of the sheets get jammedbetween cassette and printer. We’re accustomed tobetter in the £1000+ category.

The Web interface can be described as a success.The super-fast device, at 28 pages per minute, canbe smoothly configured or remote controlled withit. What remained incomprehensible was why thedevice does not recognise the company’s own MarkVision software.

Marks were deducted for the documentation,too, since for a printer in this price class we expectmore than just the installation instructions to be printed.

Minolta-QMS Page Pro 4100 GNThe Minolta-QMS shows that a good device doesnot always come with an impressive appearance.The Minolta is plain, it doesn’t even have adisplay, the printer configuration is possible onlyvia the Web front-end.

Also impractical is the open, small-dimensionedpaper supply and the output flap, which has to beopen before starting printing – otherwise a jamforms and the flap cannot be opened.

It is also the slowest in the test, 18 pages perminute is claimed by the manufacturer – the labresult was 16.5.

The big surprise emerged in the quality test,where it showed the rest of the test field what agood photo print is. Sharp and rich in detail andwell rastered – only the Xerox can match thisquality, but the ‘pages per’ did not quite make it.

Oki Okipage 20 plus/nInitially, the Oki Okipage 20 can scarcely be toldapart from its big brother Okipage 24, even theconsumables for both printers are identical. Tonerchange with an Oki isn’t a very clean affair: Toswap a cartridge, it’s rotated through 90 degreesin the holder, which dirties the drum unit. Whenit is taken out, toner often falls out.

Every 25 pages the printer inserts a short break,giving a comparatively slow print speed. Also, afterthe end of a print job the message “Data loaded”is displayed for about 30 seconds, although nomore data follows. However, the next job can besent without any problem, and this is then startedafter a few seconds.

One good point was that Oki has come upwith the idea of separating toner and drum. Thelatter only has to be replaced after 30,000 sheets.

Oki Okipage 20 plus/n

Price £800Output 20 P/min, 600x600 dpiPrint quality 3 out of 5Speed 4 out of 5Cost of printing 3 out of 5 (1.42 pence / page)Overall mark 3.5 out of 5

Minolta-QMS Page Pro 4100 GN

Price £750Output 18 P/min, 600x600 dpiPrint quality 3 out of 5Speed 3.5 out of 5Cost of printing 5 out of 5 (1.83 pence / page)Overall mark 4 out of 5

Lexmark Optra T620n

Price £1085Output 28 P/min, 1200x1200 dpiPrint quality 3 out of 5Speed 2.5 out of 5Cost of printing 5.0 (1.63 pence / page)Overall mark 3.5 out of 5

Page 16: linux magazine uk 13

COVER FEATURE FOCUS ON PRINTING

18 LINUX MAGAZINE 13 · 2001

Oki Okipage 24 dx/nThe larger of the two Oki printers differs fromthe small one in its mechanism. Unlike theOkipage 20, it has built-in a duplex unit, whichmakes it heavier.

The print unit is also identical to that of itslittle brother, but Bianca clearly showeddifferences in quality between what areactually identical print units. The Okipage 24also prints the image darker, as the colour barsof the graphics test also show. Grey areas arealso crossed by more stripes.

Oki earns praise for the extremelycomprehensive documentation which comeswith both printer models. Apart from themanual, the CD includes films on removingpaper jams and changing toner (see“Laboratory Report”).

Samsung ML-7300NSamsung demonstrates some good solutions. Weliked the backlit display, which can be raised tomake it easier to read. The mains switch is in theonly correct position – at the front.

Unfortunately one equally nice feature is not –at least not yet – useable under Linux: the duplexunit. But Samsung has in fact packed a PPD file inthe collection of accessories, with the aid ofwhich any generic Postscript driver should becapable of controlling Duplex. But even underthe CUPS printing system, which is not exactlyshort of features, it was not possible to printdouble-sided.

But the device is not as fast when it comes toprinting as it is when warmed up. It certainlywakes up speedily, but the page output is at therear of the test field.

Xerox Docuprint N2125The low operating noise is one of the bestfeatures of this device. Apart from the highprint rate, the print quality impresses most.

Only the Minolta-QMS can beat Xerox, noneof the devices of the same type (Epson andGenicom) even comes close to the quality ofthe nice raster of Xerox. Images are printedevenly and with good contrast.

Caution is advised when inserting paper. Ifyou put in a 500-sheet stack, the bottom 50sheets become crimped. Tip: Put in about 100sheets first and then the rest.

The print is almost marginless, fractions of amillimetre are left white.If this print method isused, on one sheet or another something goeswrong with the mechanism, but otherwise thiscauses no problem.

Oki Okipage 24 dx/n

Price £999Output 24 P/min, 600x600 dpiPrint quality 3 out of 5Speed 3.5 out of 5Cost of printing 3.5 out of 5 (1.45 pence / page)Overall mark 3.5 out of 5

Samsung ML-7300N

Price £800Output 20 P/min, 1200x1200 dpiPrint quality 4 out of 5Speed 4.5 out of 5Cost of printing 5 out of 5 (1.61 pence / page)Overall mark 4 out of 5

Xerox Docuprint N2125

Price £990Output 21 P/min, 1200x1200 dpiPrint quality 2.5 out of 5Speed 3 out of 5Cost of printing 4 out of 5 (1.32 pence / page)Overall mark 3.5 out of 5

Page 17: linux magazine uk 13

COVER FEATUREFOCUS ON PRINTING

13 · 2001 LINUX MAGAZINE 19

To finish off, one curiosity: Although Xerox,Epson and Genicom use the same printer engine,we were unable simply to change the tonercartridges. Obviously no manufacturer wants togive up the after sales business. Hence the codeplates illustrated below were placed on theotherwise completely identical cartridges. Theplates can, however, easily be swapped using aknife – so you can always obtain them from themost economical source.

Conclusion

Printing is no problem under Linux. Apart fromminor details such as the Wine stumbling block,laser printers are completely non-critical. But evenunder the aegis of the penguin not all printers areequal. The differences are enormous.

So the Competence Centre Hardware even foundthree printers of identical construction whichdelivered such differing print outs through usingdifferent firmware that in the quality test, one cameout in front, one in the middle field and one as tailend Charlie.

In printers of identical construction themanufacturers like to try to prevent the use ofcompetitors’ toner by the use of lugs. With a littleDIY, it is easy to save a pound or two.

On aspect is still worth pointing out: Mostprinter manufacturers boost their devices as low-ozone or even ozone-free. The test crewdetermined the complete opposite, however. Thepenetrating sharp smell of O3 wafted through thecorridors, and sensitive people could feel it on theirskin. Tester and volunteer fireman Mirko Dolle evenfelt obliged to order a breathing protection devicefrom the industrial safety equipment supplierDrager. Hence the Linux Magazine must issue awarning that office printers are only installed inwell-ventilated places. ■

Minolta-QMS Magi Color 2200 NThe Minolta-QMS Magi Color 2200 was, as anunofficial competitor, the only colour laser printer.Fully equipped with network card, Postscript andPCL module, the price of £1395 appears all themore astonishing. It’s more what you’d expectfrom GDI printers.

The print unit has four large, colour tonercartridges in a carousel. Since only one colour canever print at one time, colour printing takes longerthan monochrome. The print image is good, thecolours on our test image were well reproduced,although with a slight orange tinge.

The printer menu was impressive, almosteverything can be adjusted, right up to colourcorrection. The three-minute warm up phase is toolong. Recalibration every 24 pages is a nuisancewhen printing out longer text documents.

Minolta-QMS Magi Color 2200 N

Price £1395Output 20 P/min, 1200x1200 dpiPrint quality 2 out of 5Speed 3.5 out of 5Cost of printing 3.5 out of 5 (2.02 pence / page)Overall mark 3 out of 5

Laboratory reportThe very different levels of equipment and finish ofthe printers were especially noticeable. Lexmarkfalls out of the frame with the models OptraM412n and Optra T620n, both printers made apoor impression. In particular the manual paperfeed is extremely shoddy, even loaded with 100sheets it sags visibly, and anyone who collides withit in passing is liable to break off a good sizedchunk of it.

In terms of documentation all printermanufacturers can take a leaf out of Oki’s book. Themanual is more than comprehensive, apart from theusual content such as installation, maintenance andexpansion, in the annex there is even the pinconfiguration of all the ports with signaldescription, timing diagram and sometimes evencomponent designation. The documentation CDrounds the whole thing off with films on the mostimportant maintenance tasks of the printer. It couldhardly be better.

The toner cartridges for the printers arerecognised by means of coding plates for Xerox(top), Epson (middle) and Genicom (bottom).The plates can however easily be swapped.

Page 18: linux magazine uk 13

COVER FEATURE FOCUS ON PRINTING

20 LINUX MAGAZINE 13 · 2001

Equipment and resultsRanking 1 2 3 4 5 6

Manufacturer/Name Kyocera-Mita Hewlett-Packard Brother Xerox Docuprint Oki Okipage Lexmark Optra

FS-3800N Laserjet 4100N HL-2460N N2125 24 dx/n T620n

Website www.kyocera. www.hp.com/uk www.brother www.xerox. www.oki.co.uk www.lexmark.

co.uk co.uk co.uk co.uk

Price (approx.) [£] 900 980 750 990 999 1085

Equipment

Resolution [dpi] 1200 x 1200 1200 x 1200 600 x 600 1200 x 1200 600 x 600 1200 x 1200

Pages per minute (manuf) 24 24 24 21 24 28

Memory (stand/max) [MB] 32 /272 32 / 256 16 2/ 272 32 / 192 16 / 80 32 / 384

Emulations PS 2, PCL 6, KPDL 2, PS 3, PCL 6, PS 3,PCL6, FX-850, PS 3, PCL 6, PS 2, PCL 6, Epson FX, PS 3, PCL 6,

XL24E, LQ-850, etc. PCL 5e IBMXL, HPGL PCL 5e IBM Proprinter PPDS

Ports Parallel, Serial, Parallel, Ethernet Parallel, Serial, Parallel, Parallel, Serial, Parallel, Serial,

Ethernet Ethernet, USB Ethernet, USB Ethernet Ethernet, USB

Number of paper feeds (stand/opt) 1 / 2 1 / 2 1 / 3 1 / 2 1 / 2 1 / 2

Total capacity of feeds 500 / 2500 500 / 1000 500 / 3500 550 / 1100 530 / 1060 490 / 3000

Duplex/Sorter optional / optional optional / no optional / optional optional / optional yes /no optional / optional

Web interface yes yes yes yes yes yes

Dimensions (W x H x D) [mm] 358 x 301 x 388 395 x 344 x 515 469 x 423 x 469 428 x 406 x 453 375 x 337 x 461 419 x 399 x 493

Weight (measured) [kg] 13.95 19.10 22.45 26.60 22.45 19.50

Consumables

Price of toner [£] 70 85 95 130 40 315

Lifetime of toner (manuf) 21,000 10,000 11,000 15,000 6,000 30,000

Drum replaceable separately yes - no no no yes

Lifetime of drum [pages] 300,0001 - - - 30,000 -

Price of drum [£] - 1 - - - 130 -

Measured values

Number of pages at 5% 30,034 14,707 16,594 14,060 4,722 25,645

Cost of printing (Incl. paper) [pence] 0.63 0.98 0.97 1.32 1.45 1.63

DTP Quality 4 4.0 5.0 4.0 2.5 2.5 2.5

Graphics quality 4 2.0 3.0 2.52 3.0 3.0 3.0

Photo quality 4 3.0 3.5 3.52 2.0 4.0 3.5

Area quality 4 3.5 5.0 1.5 1.5 4.5 3.0

DTP Speed [secs] 38.4 54.5 55.0 46.2 59.8 36.9

Graphics speed [secs] 418.5 411.8 423.12 422.8 440.2 407.7

Photo speed [secs] 199.5 216.2 222.82 185.4 277.0 119.4

Results

Print quality satisfactory satisfactory satisfactory good satisfactory satisfactory

Print rate good satisfactory satisfactory satisfactory satisfactory good

Cost of printing very good satisfactory good adequate satisfactory poor

Equipment satisfactory satisfactory satisfactory satisfactory adequate satisfactory

Handling satisfactory satisfactory satisfactory satisfactory good adequate

Service satisfactory satisfactory poor adequate adequate satisfactory

Overall rating good satisfactory satisfactory satisfactory satisfactory satisfactory1 Lifetime is in excess of depreciation limit (3 years) 2 Tested with 48MB RAM

Page 19: linux magazine uk 13

COVER FEATUREFOCUS ON PRINTING

13 · 2001 LINUX MAGAZINE 21

7 8 9 10 11 12 (non-official competitor)

Oki Okipage Epson Genicom Micro Lexmark Optra Minolta-QMS Samsung Minolta-QMS

20 plus/n EPL-N2050+ Laser 210 M412n Page Pro 4100 GN ML-7300N Magi Color 2200 N

www.oki.co.uk www.epson. www.genicom- www.lexmark. www.qms.co.uk www.samsung www.qms.co.uk

co.uk international.com co.uk electronics.co.uk

800 580 1028 770 750 800 1395

600 x 600 1200 x 1200 1200 x 1200 600 x 600 600 x 600 1200 x 1200 1200 x 1200

20 20 21 17 18 20 20

16 / 80 16 / 272 16 / 96 8 / 132 8 / 104 16 / 208 64 / 384

PS 2, PCL 6, Epson FX, PCL 6, ESC/P2, HPGL, PS 3, PCL 5e PS 3, PCL 6, PPDS PS 3, PCL 6 PS 3, PCL 6, PS 2, PCL 6, PDF,

IBM Proprinter FX-8800, IBM 239plus PCL 5e HP-GL, TIFF, etc.

Parallel, Serial, Parallel, Serial, Parallel, Parallel, Parallel, Parallel, Parallel, Ethernet

Ethernet Ethernet Ethernet, USB Ethernet, USB Ethernet Ethernet

1 / 2 1 / 2 1 / 2 1 / 1 1 / 2 1 / 1 1 / 1

530 / 1060 550 / 1100 550 / 1000 220 / 500 250 / 1000 500 / 500 500 / 500

optional /no optional / optional optional / optional optional / no optional / no yes /no optional / optional

yes yes yes yes yes no yes

375 x 377 x 461 428 x 406 x 453 428 x 406 x 453 404 x 315 x 429 435 x 394 x 502 424 x 299 x 455 463 x 511 x 522

20.30 26.70 26.55 14.65 13.45 16.90 44.50

40 130 170 163 120 120 50 (black)

6,000 15,000 15,000 15,000 9,000 10,000 6,000

no yes no no no no no yes

30,000 - - - - - 25,000 3

130 - - - - - 275 3

4,949 20,356 20,463 11,078 8,404 9,898 10,371

1.42 1.04 1.23 1.87 1.83 1.61 2.02

2.5 5.0 2.5 2.5 2.5 5.0 3.0

3.0 4.0 2.5 3.0 3.0 3.0 2.0

3.5 5.0 2.5 4.0 3.0 4.5 1.5

4.5 3.0 5.0 4.5 1.5 5.0 4.5

64.5 50.8 49.7 51.1 57.1 67.1 131.3

438.3 406.9 456.7 419.0 451.7 465.8 43.9

269.4 222.2 588.6 126.6 299.4 533.8 198.8

satisfactory adequate good satisfactory satisfactory adequate good

adequate satisfactory poor satisfactory satisfactory adequate satisfactory

satisfactory satisfactory adequate poor poor poor satisfactory

adequate adequate satisfactory adequate poor adequate satisfactory

good satisfactory satisfactory adequate adequate good satisfactory

adequate satisfactory adequate satisfactory satisfactory adequate good

satisfactory satisfactory satisfactory adequate adequate satisfactory satisfactory3 Costs of all consumables averaged over 25,000 pages (drum, fixer, image carrier tape etc.) 4 Low value good – High value bad

Page 20: linux magazine uk 13

COVER FEATURE PRINTING WITH CUPS

24 LINUX MAGAZINE 13 · 2001

Architecture like a webserver

The beating heart of CUPS is the server daemon orscheduler cupsd, which is similar to an ordinarywebserver. It can be addressed with any browser viathe reserved port 631. Clients also communicatewith the server via this port. But the exchange ofdata with the printers connected to the server canoccur in a variety of ways. Ideally these can evencope with IPP, but this is only the case in some 200models. Good laser printers such as the ones in ourtest are more likely to be able to use the Appsocketprotocol, free printers on Windows computers canbe addressed with Samba via SMB. For the rest LPDis used. Communication with the printers via theseprotocols is done by back-ends, which areseparately configured.

CUPS and Postscript

Anyone printing on UNIX systems cannot avoidPostscript; CUPS is no exception to this rule. So thesimplest way is to use Postscript-compatibleprinters. Their integrated processors process PSfiles into raster data in the highly calculation-intensive Raster Image Process (RIP). For printerswhich cannot cope with Postscript, a computerhas to do it.

There are often dedicated RIP servers in thepreliminary print stage. In a company network, werethere are printers which are not Postscript-compatible being used regularly, the print servertakes over these tasks and should therefore havesufficient computing power. CUPS is flexibleenough to allow the preparation of print data onthe client. But then the client obviously needs itsown driver. The characteristics of each printer modelare defined in a Postscript Printer Description (PPD)in ASCII format.

Gimp Print for inkjet printers, auniversal driver with special abilities● About 120 inkjet printers from the companies Epson, HP, Canon and Lexmark are

supported by the latest Alpha version (4.1.99-a2) of the Gimp Print Project (laststable version is the 4.0.5).

● Gimp Print includes a joint code base for three different target projects: GIMP,Ghostscript and CUPS.

● ./configure - -help displays the options. The CUPS system can be expanded using - -with-cups. The option - -with-ghost - -with-foomatic generates the sourcecode files which are merged with the Ghostscript source code. Then Ghostscript isrecompiled. As a new component it now includes stp. The CUPS/Gimp Print filtertogether with the PPDs created and the normal Ghostscript filter, here under thename stp, can be used with CUPS.

The following points are important to remember:● The PPDs must match the filter: the foomatic files belong to stp as can be seen as

GIMPPRINT+foomatic or stp+foomatic● The CUPS form of Gimp Print is called CUPS + gimp-print● Only copy PPDs from other computers with the appropriate conversion filter● Avoid Gimp Print, Foomatic or stp and associated PPDs in PostScript printers

CUPS implements the Internet Printing Protocol(IPP) in Version 1.1. It can completely supersede,both locally as well as on the network, the ageingLine Printer Daemon. A few Linux distributions suchas Mandrake, Caldera, EasyLinux or Connectivahave already stopped installing the LPD. And in thelatest SuSE variants CUPS can now be configuredwith YaST.

On stand-alone workstations CUPS exhausts allthe individual properties of the existing printer, butits real strengths only come into play on thenetwork. This is where, on any free printer, it ispossible to print using all its usual device options,without a driver having been installed on the client.More than that, the client automatically recogniseswhich printers are installed in the network, providedthese are attached to a CUPS server.

CUPS is the printing system of the Internet era.

Our overview shows what can now be done with

it, and what’s going on behind the scenes.

The Common UNIX Printing System

PRINT-O-MATIC

ULRICH WOLF

Page 21: linux magazine uk 13

COVER FEATUREPRINTING WITH CUPS

13 · 2001 LINUX MAGAZINE 25

Printing without Postscriptdevices

CUPS filters, are based on the older Ghostscriptversion 5.5, but have been modified and improved.Some filters are in place after the standardinstallation: for PCL-compatible inkjet and laserprinters from the Deskjet and Laserjet families ofHewlett-Packard, Epson Stylus Color and StylusPhoto and 9-pin and 24-pin printers from Epson.These are usually found, together with the filtersderived from Ghostscript, in the directory/usr/lib/cups/filter.

For other, non-Postscript-compatible printersthere is Cups-O-Matic. This is a version of theFoomatic script collection adapted to CUPS by theLinux Printing HOWTO author Grant Taylor. It coversall Ghostscript filters for use with the CUPS systemand thus requires that Ghostscript is installed on theprint server. On the Cups-O-Matic website, you firstcreate a PPD for the existing printers in combinationwith a Ghostscript filter. From the point of view ofthe user, this is already the printer driver and can beinstalled in the CUPS system by the usual methods(command line, GUI or browser). Internally,however, you will need cupsomatic, a Perl scriptwhich must sit in the filter directory/usr/lib/cups/filter. With the aid of this script theprinter-specific data from the PPD is sent to therelevant Ghostscript filter of the system, which thenprepares the print data accordingly.

CUPS and Ghostscript

Cupsomatic passes the print data out of the usualCUPS environment to the Ghostscript filter specifiedin the Cups-O-Matic-PPD and returns the result toCUPS. With Cups-O-Matic, then, CUPS prints asgood as any other Ghostscript systems, but allnetwork features of CUPS for the printerssupported by Ghostscript are available.Apart from Cups-O-Matic there are other optionsfor integrating filters in CUPS, namely for Turboprintand Gimp-Print.

Big print runs

If there are several printers of the same type in anetwork, or if certain printers are only available fora short time, these can be combined into classes. Ifa print job is sent to a class, the job goes to thenext free device. In this way, it is possible to achieveload balancing.

Configuration of CUPS

The CUPS print system can be monitored andadministered via diverse command line commands.The main ones are lpadmin, lpoptions and lpstat.With lpstat -p -d the available printers are displayed.lpadmin configured printers, printer classes and user

InfoCUPS homepage http://www.cups.orgIPP specification http://www.ietf.org/html.charters/ipp

-charter.htmlLinux printing homepage/Cups-O-Matic http://www.linuxprinting.orgGimp Print http://gimp-print.sourceforge.net/CUPS documentation http://www.cups.org/documentation.html

The graphical front-end Xpp is heavily based on the ESPPrintPro software of the inventor of CUPS, Michael Sweet

In KDE 2.2 the CUPS configuration is integratedseamlessly, thanks to KDEPrint, into the system control

rights. CUPS has its own administrator, so needs noroot rights. With lpoptions all the printercharacteristics, which can be configured via thePPD, can be displayed and altered. But this is verytedious, since they vary from model to model. This iswhy in this case graphical tools like xpp, gtklp, kups,or the Web interface via http://[computername]:631are vital. These read out the respective PPDs andmake them configurable with a mouse.

In KDE 2.2, KDEPrint is an intermediate layerbetween KDE applications and various printingsubsystems. This means CUPS can beadministered more simply in KDE applications.The former configuration tool kups is no longerbeing developed.

General settings for the CUPS print system can befound in /etc/cups/cupsd.conf. This is similar to theApache configuration file httpd.conf. In cupsd.confit is possible to announce printers to the wholenetwork, using Browsing On, define browse relaysfor inter-network printing, options forauthentication and encryption and much more.CUPS is largely ready to use with the defaultsettings as soon as it has been installed. ■

Page 22: linux magazine uk 13

COVER FEATURE NETWORK PRINTING

26 LINUX MAGAZINE 13 · 2001

Thanks to Samba, printing from Linux and Windows machines on

heterogeneous networks is not a problem. Although established printing

systems such as Berkeley and System V have by now got competition they

are still the most commonly used. We are going to tell you how to print on

heterogeneous networks, irrespective of the operating system.

Linux users tend to be quite spoiltwhen it comes to the networkabilityof their system. After all, Linux – as amember of the great UNIX family –

acquired the TCP/IP protocol suite in itsinfancy. These protocols also form thebasis of all Linux printing. These days all

operating systems understand TCP/IP and it istherefore not difficult for a Linux machine to act asprint server or client in any network.

Setting up a server under Linux

First of all, let’s look at the server: the centralelement is the print daemon lpd, which runs as abackground service and administers all of the userapplication’s print jobs (Figure 1). Only lpd needs tobe set up for a Linux print server, while for Windowsworkstations the Samba server is required as well.

Current Linux distributions will install lpd asstandard. The quickest way to find out whether it isactive is with a ps command:

[user@host]$ ps ax | grep lpd

459 ? S 0:00 lpd

725 tty1 S 0:00 grep lpd

[user@host]$

If necessary, the daemon must be started or – veryrarely – installed. Starting and stopping is doneusing a script that has the same name as thedaemon and can be found in the runlevel scriptsdirectory (/etc/init.d, /etc/rc.d or /etc/rc.d/init.d). Ifthere are problems starting the daemon this is alsowhere you can see whether one or more systemvariables need to be set, for instance START_LPD forSuSE Linux or NETWORKING for Red Hat.

A special configuration program for the relevantdistribution will normally help with this. Forinstallation you need the package lprold-*.rpm orlpr-*.rpm, both of which are bound to be includedwith your distribution. Developed at BerkeleyUniversity, it is still the most widespread version ofthe print daemon, its configuration files are in the/etc directory and are listed in the following table.

The most important of the three files is/etc/printcap. Here the capabilities of the printersand queues are specified. The print data aredeposited in a directory below /var/spool/lpd, whilethe actual printing is a background process carriedout by the lpd daemon.

Manual printcap configuration is complicatedand prone to errors. It is therefore advisable to usethe relevant tool from your Linux distributor (YaSTfor SuSE, printtool for Red Hat).

The same is true for the configuration fileapsfilterrc, which normally does not need to beamended. That leaves /etc/hosts.lpd. Because theBerkeley print daemon does not handle userauthentication, access to the server is limited byhost, as a safety measure. The file administratorsimply lists the names or IP addresses of all hosts

Linux printing on heterogeneous networks

EASY PRINTINGON ANY NETWORK

DR BERNHARD RÖHRIG

Configuration files for thelpd print daemonName Contentsapsfilterrc.* Special printer driver

configurationprintcap Configuration of the print

queuehosts.lpd Print server access control by

host

Page 23: linux magazine uk 13

COVER FEATURENETWORK PRINTING

13 · 2001 LINUX MAGAZINE 27

that are permitted access. This type of operationdoes not require the print server to be rebooted.Windows workstations do not have to be includedon this list if the Samba server is running on thesame machine as lpd.

Printing with Linux on Linux

A Linux workstation that’s going to use a remoteBerkeley-type print server must also have lpd set up.The only difference is the configuration of the printqueue. Again, the Linux distributor’s tool can help.The short listing in the box shows an example of aresulting printcap entry.

Remote print queue

lpremote|laser printing on adamix:\

:lp=/dev/null:\

:rp=lp:\

:rm=adamix.paradix.own:\

:sd=/var/spool/lpd/lpremote:\

:lf=/var/spool/printers/lpremote/log:

:bk:sh:mx#0:

The remote printer rp, the remote machine rmand the local spool directory sd are mandatoryentries, and :lp=/dev/null: must always be presentas well. For a local printer the print device will beindicated here.

Filtering of the data to be printed, as is requiredon local printers, is not necessary. The local lpdsimply puts the files into the pigeonhole of hiscolleague on the server, so to speak, who then hasto work out what to do with them. This is why it isso important to choose that print queue on theserver as your remote printer that best ensures thecorrect processing of the selected data.

When selecting the name, it’s always worthhaving a look at the server’s /etc/printcap. In mostcases you will want to use the auto queue, which issimply called lp on almost every system and which –apart from other little luxuries – can also determineautomatically from the file content how it should beprepared for printing.

:sh: suppresses unnecessary banner pages,:mx#0: removes the file size limit. As with localconfiguration it is also possible for network printersto have several entries in /etc/printcap and to labelthem with their own device names, depending onwhat is to be printed in each case and how.If you want the printer lpremote to also act asstandard printer for the client at the same time,prefix the relevant printcap entry with lp as anotheralias name:

lp|lpremote|laser printer on adamix: \ ...

After each creation or amendment of a print queuethe appropriate print daemon needs to be restarted.Calling the startup script with the parameter restart,

or a HUP signal to the running process is normallysufficient. Configuration programs will usually takecare of this step automatically.

From Windows to Linux

The Samba daemon also provides print services anduses the Linux spool system to do this, so setupshouldn’t pose any problems. All that is required is asection in the file /etc/smb.conf that gives access toall print queues set up under Linux and has thefollowing structure:

[printers]

comment = Linux print server

path = /var/spool/smb

print ok = Yes

guest ok = Yes

browseable = No

This section often already exists or can be quicklycreated with SWAT. After restarting the smbd andnmbd daemons the Linux queue is available toWindows machines on the same network.

Whether they will also be visible in the networkenvironment depends on several factors:

● TCP/IP has been set up on the workstation and isbound to the network card.

● The network client on the workstation is boundto TCP/IP.

● Client and server machines are in the sameWindows workgroup or domain.

● If you have not set guest ok in /etc/smb.conf thenyou must be logged on to the Windowsworkstation with a name that also exists as aSamba user on the Linux station.

If the requirements have been met, the result inWindows Explorer should be similar to Figure 2: onthe left you can see the workgroup computers, onthe right – apart from the shared directories (folder

Figure 1: It is simple to print under Linux

Page 24: linux magazine uk 13

COVER FEATURE NETWORK PRINTING

28 LINUX MAGAZINE 13 · 2001

icon) – are the print queues available to theselected machine.

This example, from Windows Me, should besimilar to what you can expect under Windows 95,98 and NT 4. In Windows 2000 the elaboratesecurity system may at first present you with somestumbling blocks. That subject would be enough initself to fill a separate article. Documentation isavailable if you want to find out how to get olderversions of Windows (3.1, 3.11, NT 3.5) to print onLinux print servers.

In order to use a Linux print queue underWindows, click on the required printer icon with theright mouse button – preferably on the Linuxdefault printer, which automatically identifies alldata formats. It can be recognised by thedescription auto, lp, lp2 or similar.

For older versions of Samba or lpd it may benecessary to use the raw queue. In that case theparameter PRINT _RAW_SUPPRESS_FORMFEED inthe server file /etc/apsfilterrc.<Driver name> mustbe set to yes to avoid unnecessary form feedsbetween the individual print jobs.

On the context menu of the print queue useInstall. Windows will inform your workstation that aprinter driver needs to be installed locally. Theprocess is slightly different for each version ofWindows, but it always involves the selection ofmanufacturer and model and the transfer of therequired files to the workstation. Once you havesuccessfully managed all of that, a new networkprinter is available.

From Linux to Windows

Of course, the whole thing also works the otherway. In the simplest case, after a good look at themanual pages on smbclient you can just buildyourself a command line or a script which takes care

of the whole printing process including connectingto the Windows machine and user authentication.

If this seems like too much work to you, don’tdespair – the distributors have come to your rescueagain. Figure 3 shows the configuration of the Linuxqueue lpwin, which establishes a link to a Windowsmachine and the Epson printer connected to it. Weused the Red Hat printtool. The process is verysimilar with SuSE’s YaST: System administration,Configure network, Address printer via Samba.

Most Windows systems require a valid useraccount with password in order to print at all. This isgreat in terms of security, but the Linux machine’sBSD spool system currently stores this informationunencrypted, either in .config in the spool directoryor in the aforementioned /etc/apsfilterrc..

To make matters worse, this file is world readablein some configurations. As a solution it is thereforenormally recommended to set up an additional useron the Windows side specifically for printing, thatdoesn’t own any files. The only possible damagewould then be unauthorised printing.

Conclusions

Printing on heterogeneous networks poses no realproblems these days. lpd and Samba allow mutualutilisation of Linux and Windows printers.Sophisticated configuration tools from thedistributors also play their part in providing simplesolutions in term of the setup. However, there is stillroom for improvement regarding security. ■

Figure 2: Linux printersbecome visible in theWindows environment

InfoNetwork PrintingTodd Radermacher, MatthewGastO’Reilly UKISBN: 0596000383

Linux for Windows NT/2000Administrators: the SecretDecoder RingMark Minasi, York DanSybex InternationalISBN: 0782127304

Figure 3: Configuration of a Windows printer underLinux with Red Hat’s printtool

Dr Bernhard Röhrig writes books on thesubjects of Linux and UNIX and holds seminars,workshops and trainingfor administrators. He can be contacted athttp://www.roehrig.com/.

Page 25: linux magazine uk 13

COVER FEATURETURBO PRINT 1.4

13 · 2001 LINUX MAGAZINE 29

The old print solutions for Linux (lpr, Apsfilter,Ghostscript) suffer primarily from the fact that thissystem is orientated towards outdated printers.The latest colour printers demand specificcontrollers, which seems impossible without theco-operation of the printer manufacturers.

Turboprint from Zedonet is a driver packagefor Linux, which builds on the tried andtrusted Ghostscript-based print standard.Turboprint functions as Magicfilter andthereby replaces, Apsfilter.

With the aid of a Turboprint driver Linuxusers, can use all the features of their printer,such as adaptation to special papers andformats and maximum print resolutions.Equally, brightness, contrast and colourreproduction are adjustable.

The configuration tools of Turboprint work inadministrator or user mode. In administratormode new printers can be added and installed,which are then available to all users. Also, anyuser can individually alter and save settings.

Turboprint and CUPS together

Turboprint (since version 1.2) has the option ofworking with the CUPS printing system. CUPS,apart from using the Internet Printing Protocol (IPP)can make unlimited use of the PPD Files (PostscriptPrinter Definition) from the printer manufacturer.

These files define all the features of therespective devices for Postscript printers. PPDfiles have a simple ASCII format. PPD acts as astandardising programming language for printer

control, occasionallyexpanded by manufacturer-specific commands.

With CUPS it is possible to make full useof the contents of these PPD files without additionalchanges. Owners of Postscript printers can choosefrom a wealth of PPD files on the Adobe homepage.These are self-unpacking EXE archives for Windows,but they can be unpacked under Linux with theappropriate utilities.

While real Postscript printers can already beused without limitation with the availability ofsuch original PPD files, for non PS-compatibleprinters (pseudo) PPD files have to be generatedvia Ghostscript.

PPDs under CUPS and Turboprint

Since the print output is done in the Postscriptformat, such PPD files must be formatted

Professional colour Printing under Linux

SUMPTUOUS COLOURS

THOMAS DRILLING

The driver package Turboprint allows (colour) printers on

Linux PCs to easily produce high quality output. Version

1.42, just out, also works with CUPS.

TurboprintVersion 1.4, Free EditionVersion 1.42, Full version, EUR 19.95Download and info: http://www.turboprint.de/german/index.html

Manufacturer:ZedonetMeinrad-Spiefl-Platz 2D-87660 IrseeTel. 0049 8341 908 3905Fax 0049 8341 120 42Email: [email protected]

Page 26: linux magazine uk 13

COVER FEATURE TURBO PRINT 1.4

30 LINUX MAGAZINE 13 · 2001

commercial software ESP Print Pro fromEasysoftware concentrate on the abilities of the IPP.This makes it easier to manage a large number ofprinters from any location, based on one or moreCUPS servers and to control specific features ofhigh-performance professional printers.

Turboprint is aimed more at the inkjet market. Italso uses its own process, which goes beyond theCUPS-O-Matic method, to prepare PPD files for CUPS.

Installing and starting upTurboprintThe program is in a tar archive, which is unpackedand installed very easily with an installation script.The script also creates the PPD files for co-operationwith CUPS. The software is dynamically linked tothe Gtk library 1.2.

The heart of Turboprint is the command lineprogram /usr/bin/tpprint. Purists can use this tocontrol Turboprint via the shell. The Turboprintconfiguration dialogs are xtpsetup to install thespool system and xtpconfig for configuration ofthe driver.

Keeping order

The Turboprint driver (*.TPP) is found under/usr/share/turboprint/printers. The PPDs are in/usr/share/cups/model/turboprint, if you prefer toprint with Turboprint via CUPS instead of with lpd.Details of the variety of drivers supplied can befound both in the list under/usr/share/turboprint/printers /printer and on theZedonet homepage.

Turboprint uses two configuration files in/etc/turboprint. turboprint.cfg contains the printerdescriptions which had been created in theadministrator mode with tpsetup. system.cfg mainlylists environment variables with paths to the printspooling system in use, such as CUPS.

To use the CUPS filter with Turboprint, version 1.4now includes /usr/share/turboprint/lib/

History

appropriately for the respective printer – a task forthe commercial package Ghostscript fromAladdin. A somewhat older version of Ghostscriptis available for free. In most Linux distributionsthis version serves as the basis for printingwithout Postscript.

PPD files based on the free Ghostscript areavailable for all the usual printers. The Perl scriptCupsomatic prepares the free PPDs for CUPS.

On the linuxprinting.org website, it is possible toclick together your printer features with a fewmouse clicks and then download using CreateCUPS-PPD. The Cupsomatic script is alsodownloaded locally; it provides for the integrationof the dynamically created PPDs in CUPS.

SuSE Linux 7.2 for example combines such PPDfiles in the packet cups-drivers from series n. Afterinstallation they can be found and sorted accordingto manufacturer in /usr/share/cups/model. The filterscript is installed by SuSE under /usr/lib/cups/filter/cupsomatic.

Pure CUPS solutions with CUPS-O-Matic-generated PPDs and front-ends like Til Kamppeter’sfree XPP (X Printing Panel) or Kups and the

Turboprint does not have the typical Linux genesis.The concept goes back to a development at the endof the eighties for the Commodore Amiga. Thedevelopers were – as they still are – somewhatdissatisfied with printing under Linux.

The primary outcome was an image printingprogram, and later on its own printer driversemerged from this, which over the years wereexpanded bit by bit to cover additional printermodels. Right out in front came the Turboprintdevelopment, with support for the first colour inkjetprinters like the legendary HP DeskJet 500 Color.

At that time, many options for image

reproduction and rastering were integrated into theTurboprint driver. Its own algorithms were added toimprove the colour purity.

Because the situation was comparable with thatof the Amiga era, the developers of the Linuxversion were able to channel all their experience ofTurboprint for the Amiga into the newdevelopment. The objective was (and is), toconjure up high quality colour and photo printingfrom modern inkjet printers under Linux which ofat least as good quality as those under Windowswith the original drivers from the printermanufacturers. After two years of development

The Gtk front-end Xtpconfigis used to configure thespecial features and thecolour correction system.CUPS options can also beconfigured from here

Page 27: linux magazine uk 13

COVER FEATURETURBO PRINT 1.4

13 · 2001 LINUX MAGAZINE 31

integrate elegantly via the respective API. The installation script dynamically creates the

PPD files. Turboprint can communicate with theexisting print system in two ways: If Turboprintsets up lpd, then /usr/share/turboprint/ lib/tpfilteracts as a substitute for the default printer filter ofa standard print system like Apsfilter orMagicfilter and performs the Turboprint run withthe classic Ghostscript – but taking account of theTurboprint driver.

The free Ghostscript is then used for the RIPprocess. If on the other hand Turboprint is usedtogether with CUPS, the more powerful versionof Ghostscript integrated in CUPS is used for theRIP process.

rastertoturboprint. The PPD files created in thecourse of the Turboprint setup are in the CUPSdriver directory under /usr/share/cups/model/turboprint.

Any CUPS configuration front-end, such as KUPS,can use the Turboprint PPDs as an alternative to theCUPS printer drivers. The user will also find, in theCUPS printer selection for the respective standardCUPS printer model, Turboprint-specific drivers ormodels listed as <Model>-Turboprint. When Tpprintitself is called up, each individual print job isperformed, by either the filter in/usr/share/turboprint/lib/tpfilter or /usr/share/turboprint/lib/ rastertoturboprint respectively.

The Turboprint installer makesup its own mindOn first installation, Turboprint analyses thecomputer environment. So the print systemcurrently in use is identified. Then Turboprint isadapted to the respective requirements. Sincemodern print systems like CUPS have their own API,the environment variables and paths in system.cfgonly come into use if the print system will not

Turboprint for Linux 1.0 emerged from theAmiga program in the spring.

The Amiga code was written completely inAssembler – for porting onto Linux in C++ it hadto be almost completely re-written. Only a fewalgorithms and the printer database with thecolour profiles were taken over. In this way a few of the new print techniques andimprovements got a look in, so that the Linuxversion of Turboprint will cope admirably withprofessional demands.

In the first versions, Turboprint still integrateditself in the usual way as a classic magic filter in

the LPR/LPRng printer spooling system. There is agraphical Gtk-based configuration menu for theexpanded setting options available with Turboprint,such as brightness and colour saturation.

As it became apparent that lpr would sooneror later replace the powerful CUPS spoolingsystem, the developers modified the latestTurboprint 1.2 in such a way that it workstogether as easily with CUPS as with lpr. TheTurboprint settings menu xtpconfig specificallyadapts itself to the special features of CUPS, butalso offers the original Turboprint-specific settingoptions as well.

To work with CUPS, Turboprint needs its ownintegration into the PPD files. These are createdautomatically during installation and are kept in theCUPS directory under /usr/share/cups/model/turboprint

The printer modelselection list (TPPdrivers) of Turboprintincludes over 100devices.

Page 28: linux magazine uk 13

COVER FEATURE TURBO PRINT 1.4

32 LINUX MAGAZINE 13 · 2001

printers are able to do this.In practice, a process for rastering print colours is

used. Colours are applied in a regular (ordered) orirregular pattern (error-diffusion), so that by placingmore or fewer coloured dots, the viewer gets theimpression of areas of different colour intensity. Todo this, the necessary intensities of the printercomplementary colours for a true colourreproduction of cyan, magenta and yellow must becalculated from the red, green and blue componentsof the screen colours. So much for theory.

One major problem arises in practice. Printermanufacturers each use different colour nuances ofthe basic colours, which never correspond exactly tothe pure complementary colours of the screencolours red, green, blue. So it is also impossible inprinciple to create a pure blue from the screen, suchas by mixing a theoretical 50 per cent magenta and50 per cent cyan.

Depending on the colour cast of the basic printercolours, the proportions of colour are weighteddifferently. Also, there are always slight impurities inthe print colours (for example a small proportion ofyellow in the cyan) due to manufacturing.

To make things harder, paper variation allowsthe inks to flow into each other to varying degreesand the chemical coating of inkjet printer paperslightly alters each colour tone. The result is thatthe colours in a photo printed with the sameprinter and driver will look different on differenttypes of paper.

All in all, the effect on the resulting colour tonedue to ink (colour tone, flow characteristics, mixtureproperties and so on) and paper (chemical coating,absorption behaviour) is so complex that the idealamount of ink to be applied can only be calculatedapproximately, even with a complicated formula,from the screen colours.

A really true colour print result is only achievableif one knows the ideal mixture of printing ink foralmost every screen colour and lays it out in someform – such as a table or a colour profile. This isproduced by doing test prints with various colourpatterns and analysing them using a colourmeasurement device. Separate colour profiles areneeded, for different sorts of paper. The print

If the Turboprint drivers havebeen correctly installed, anyTurboprint printer can beaddressed with Kups

Xtpsetup is an easy-to-use Gtkfront-end for the management and

configuration of the Turboprintenvironment. New printers can

easily be added by theadministrator with Add

True Match – colour processingwith colour profilesMost colour printers produce and print any colourfrom the four basic colours yellow, magenta, cyanand black. In computer terms, yellow, cyan andmagenta are sufficient to represent colours; butblack is still needed since in practice the three basiccolours don’t produce a true black tone. Printingtext would incur high costs.

The question now arises as to how thousands ofcolours should be created for photo-realisticprinting with millions of colour nuances. In principleit would be necessary to print the basic colours invarious levels of brightness, but only a few special

Page 29: linux magazine uk 13

COVER FEATURETURBO PRINT 1.4

13 · 2001 LINUX MAGAZINE 33

quality in this system is critically dependent on thequality of the colour profile.

Colour correction and raster

For Linux, the drivers of Turboprint have so farbeen the only ones to realise a real colour profiletechnique. The True-Match colour correctionsystem developed by Zedonet also containscolour profiles for specialist printer papers, sothat in fact in every situation one can achievehigh-quality colour reproduction in the printouts.

Correct rastering is of almost equal importanceto the appropriate mix proportions of the colours,so that the individual droplets of ink can bediscerned as little as possible and an even, photo-realistic impression is created. Turboprint, whenset to Error-Diffusion, works with a special rasteralgorithm, which distributes the droplets evenlyover the paper and at the same time arrangesthem as far as possible so that none of themproduces a pattern discernible to the eye. Also,light grey tones are not printed using black ink,but mixed from coloured inks so the visibility ofthe print raster is greatly reduced.

A few printer models offer special techniquesfor even application of colour, which Turboprintalso supports. The best known is the six-colour orseven-colour print with special photo cartridges,such as those supplied with the Epson StylusPhoto printers. The process also uses less colour-intensive inks to print lighter colour tones, whichproduces scarcely visible raster dots.

Other processes such as C-Ret III fromHewlett-Packard are based on variable dropletsizes. This technique is found in all moderninkjet printers, as is a process of overlapping theprint lines for stripe-free printing, which Epsoncalls microweaving.

The processes mentioned can only becontrolled and used if the printer driver takesaccount of them right from the start in the colourprocessing. Printers which can use suchtechniques can also be controlled with simplerdrivers, but they do not achieve their maximumprint quality. In the standard setting Turboprintalways tries for a printout which is true to thescreen. Slide controllers available are used to alterthe brightness, contrast, colour saturation orcolour cast.

Handling Turboprint

The core of the Turboprint package is/usr/bin/tpprint. The program can be addressed,using the following syntax

tpprint -ddrivername [Options] \

Input [Output]

from the command line, but it is controlled more

easily via the Turboprint configuration programsXtpsetup and Xtpconfig. Both programs also comein a command line version: Tpsetup and Tpconfig.The tasks of Tpprint and its printer configurationcan also be done by Kups. Turboprint’s own driversthen appear in the printer selection list of Kups withthe addition of Turboprint. Tpprint starts, wheneverany print job is done, from /usr/share/turboprint/lib/tpfilter.

Costs

Originally the manufacturer had intended to makeTurboprint available to the Linux community free ofcharge and to have the driver developmentfinanced by the printer manufacturers. But so far,most manufacturers have not been won over tosuch a commitment to Linux.

At EUR 19.95 (about £13), though, the licencecosts are in a very reasonable. Anyone who shiesaway from spending even this amount can obtainthe free version 1.4 from the Turboprint homepage,which at the maximum resolution and with specialpaper, places an advertising logo of Turboprint onevery printout.

Conclusion

The old Linux print system comes to grief ontoday’s colour printers on the specific control. Thenew CUPS, through its ability to read in WindowsPPD files, is countering the lack of commitment toLinux of the printer manufacturers in asophisticated way. This is also an advantage whenadministering network printers on the basis of theIPP protocol.

But it is only in combination with Turboprint thatthe full extent of its capability unfolds, as Turboprint,with its True Match colour correction system is finallylending colour and photo printing under Linux thesame professionalism as under Windows. And thewhole has an easy configuration.

From the point of view of Turboprint, though,CUPS serves as an easy and welcome vehicle forprinter administration which is the samethroughout the system, even on a network.Excellent print results are also achieved byTurboprint without CUPS on the basis of the oldprint system. Which is why the economicalsoftware should actually be part of the obligatoryinvestment of every Linux user with a moderninkjet printer. ■

InfoTurboprint Homepage http://www.turboprint.dePPD files from Adobe for Postscript printers http://www.adobe.com/products/

printerdrivers/winppd.htmlSite of Grant Taylor with CUPS-O-Matic and Cupsomatic http://www.linuxprinting.orgList of printers supported by Turboprint http://www.turboprint.de/printers.html

Page 30: linux magazine uk 13

KNOW HOW QT

34 LINUX MAGAZINE 13 · 2001

When the KDE project was started by Mathias Ettrich, he needed to decide

on which graphical toolkit to use to base the environment on. There were

some options available, but one of the most capable toolkits was Qt by

Trolltech in Oslo, Norway.

One of the great things about Linux is the sheernumber of available options and choices you canmake. There are often multiple solutions for a singleproblem. An example is in windowing environments;we have KDE, Gnome, fvwm, Afterstep,Enlightenment etc.

One of the most popular windowing environmentson Linux and UNIX-based systems is the K DesktopEnvironment (KDE). KDE has been around forapproximately five years and has developed into amature project with hundreds of developers andsome very competent, stable releases.

A graphical toolkit is a number of buttons,checkboxes, scrollbars etc and other facilities towrite graphical software with. There are a fewtoolkits available but Qt is one of the most capable,if not the most capable.

From those early days five years ago, Qt hasdeveloped into an incredible piece of software withthousands of users using the toolkit around theworld on a number of platforms and operatingsystems. This series of articles is going to look at Qt,what it can do and what kind of software you canwrite with it.

Getting to know Qt

To start with, it is a good idea that we get a grasp ofwhat Qt can do and what facilities are available. Inthis issue we will look at these features and get agood grounding of Qt’s facilities.

Firstly, Qt is a very portable toolkit. Qt has beenmade available and ported to the following platforms:

● Linux (all major distributions)● UNIX (all major UNIXes)● Microsoft Windows● Mac● Embedded Devices (Casiopeia, iPAQ etc)

There are also some other ports, so Qt alwaysremains a portable toolkit.

Not only is Qt portable, it is licensed to yourneeds in a very flexible way. Qt is available inthree versions; Free, Professional and Enterprise.The free version involves Qt for X11, Embedded(and recently Windows). The free versions forX11 are licensed under the GPL and include fullsource code. The free version of Qt/Windows isbinary only and does not contain the sourcecode of the toolkit. For those wishing to writeclosed source or commercial software there isthe Professional and Enterprise editions, whichhave different licensing to enable this. Thislicensing scheme makes Qt a very flexible toolkit,and as it is maintained by a company full time italways remains competent, competitive and, inour case, free.

What can it do?

In these articles I am going to be focusing my effortson the newly available Qt 3.0 version. There areprevious editions such as the 2.x.x series and the1.4.x series that are floating about, but I suggest youuse the most current version available.Although at first glance Qt looks like a number of

ON THE QTJONO BACON

Qt Designermain window

Page 31: linux magazine uk 13

KNOW HOWQT

13 · 2001 LINUX MAGAZINE 35

widgets (controls) that you can use to developsoftware, it is much more than that. Qt not onlyoffers you a number of pre-designed widgets, butalso the capability to roll your own widgets. Qt alsoincludes a number of classes for managing data suchas strings, numbers, vectors, linked lists, stacks, XML,DOM trees etc. On top of this Qt offers a number ofnetworking features, support for multiple imageformats and international text support.

Qt does not stop there, there’s also the following:● Multiple monitor support

Qt allows applications to utilise multiple screens.On UNIX, this will support both Xinerama and thetraditional multi-screen technology.

● New Component modelQt provides a platform-independent API forruntime loading of shared libraries andaccessing of their functionality using a COM-likeinterface concept.

● Support for the latest evolutions in GUIsQt supports the docking/floating windowconcept of modern, complex GUIs. It also adds aGUI control for interactive editing of rich text.

● Regular ExpressionsQt-3.0 features a new and powerful regularexpression engine greatly simplifying complextext manipulation operations. The syntax iscompatible to, and as powerful as, Perl regularexpressions while at the same time including fullsupport for Unicode.

● Accessibility SupportQt controls provide information for accessibilityarchitectures, so that visually or mobile-impairedpeople can use applications written in Qt with thestandard tools provided (eg the WindowsMagnifier and Narrator).

● 64-bit SafetyThe emerging, next generation of 64-bithardware is supported by Qt 3.0.

Database Programming

Qt 3.0 includes a platform and database-independent API for accessing SQL databases. TheAPI has both ODBC support and database-specificdrivers for Oracle, PostgreSQL and MySQLdatabases, and custom drivers may be added.Database-aware controls that provide automaticsynchronisation between GUI and database are

included in Qt 3.0. The Qt Designer has full supportfor these new controls, resulting in a RAD solutionfor database applications.

C++ support

Qt itself is written in and natively supports C++ as alanguage. You don’t need to hunt far on the Net fora raging debate on whether C or C++ is better forGUI development, but it is acknowledged in anumber of places that C++ is inherently better forGUI development. Qt is a good example of a well-crafted toolkit C++ and object orientated paradigms.In the coming months I will be giving tutorials onusing Qt, and some C++ knowledge is assumed. Ifyou are unfamiliar with C++, there are a number oftutorials and good books available on the Net.

Qt Designer

Qt includes a graphical interface building tool calledQt Designer which can be used to build dialogboxes, interfaces and more. Qt Designer is animportant component in your softwaredevelopment with Qt and can save a lot of time increating your software.Qt designer also has support for KDE widgets if

QCAD application written with Qt

cRadio for controlling PCI Radio Cards

Page 32: linux magazine uk 13

desired and can be compiled with this support. I willbe covering installation of Qt in the next issue.

Documentation

One of the great benefits of Qt as a developmenttool is its incredible documentation. Qt includesdocumentation on all of the classes included in it aswell as a tutorial, information on Qt modules andother information. This documentation is essentialwhen coding to look up method names and details.Trolltech has built an application to support thisdocumentation called Qt Assistant. Qt Assistantprovides an interface to the documentationprovided by Qt, and also enables moredocumentation to be added.

Internationalisation

If you want to write software in multiple languages(natural languages, not programming languages),then you are going to need to translate strings oftext across your programs. Trolltech has developedQt Linguist to assist in this process. Qt Linguistprovides a number of features for making yourprograms more internationally aware.

Uses for Qt

For those of you new to Qt, you may be reading thisarticle and wondering just what kind of software youcan write with Qt? Well basically you can write anykind of software that you need to. Qt provides mostof the visual GUI elements that you will need and Qtalso provides the backend and internal facilities.Remember that Qt is a commercial product with afree edition that is not restricted or cut away at. Youare getting an industry-strength toolkit for free.

KDE Integration

Many people are starting use KDE as their standardinterface for Linux. This has been due to a numberof solid KDE releases, an easy to use interface, andgood quality application software.

KDE itself is written in Qt. This is a major benefitas it means that you have a massive wealth of codealready written for KDE that is available for areference. KDE has also developed extensivefeatures on top of the Qt features and making aKDE-aware program out of a Qt program is anominal job.

This means that by learning Qt, you are alsomaking yourself skilled enough to write softwarethat is compatible with one of the most populardesktops for Linux.

Where to now?

Now we have had a brief look at Qt, we will betaking a look at writing some software with it. Thiswill begin in the next issue, but before then, thereare some preparations I suggest you take.Qt is written in C++ and uses C++ as the languageto write Qt software in (although there are otherunofficial bindings). If you are unfamiliar withC++, I suggest you take a look at it and get togrips with it. It is a powerful language and needssome practice to get to use properly. There areplenty of good books and tutorials available to getyou started.

Qt is a powerful, flexible toolkit for professionalgrade software development. Qt has been writtenfrom the ground up as a capable toolkit fordevelopment of free and commercial software,and using it is very satisfying. Next issue we willbegin using Qt to write some software. I willhopefully see you then! ■

KNOW HOW QT

36 LINUX MAGAZINE 13 · 2001

MuX2d music typesetting package for TeX

Qt GUI Designer running in a Solaris environment

Page 33: linux magazine uk 13

INTERVIEWSENDMAIL

13 · 2001 LINUX MAGAZINE 37

Eric Allman wrote sendmail in the early eighties so that he didn’t have to

administer lots of user accounts. Linux Magazine talked to him about this

seminal coding and its development over the last 20 years.

marry the benefits of Open Source – innovation –together with traditional business. This has beenuseful in financing rounds. The general IT downturnhas effected us but less so than lots of companies.LM How do you see email developing?EA It was fairly obvious that email was the killerapplication for the Internet. The Web may pull inpeople, but email keeps them there. Email willcontinue and we will get low cost access for theworld. Digital signatures will become more widelyaccepted, but overall it will become bigger, fasterand there will be more of it.LM Although you support Linux and NT, do you stilluse BSD at home?EA Yes – FreeBSDLM Do you see Lotus Domino and MicrosoftExchange as a serious threat?EA No, they’re complimentary to groupware.Sendmail Inc. is about standards-based email. Manycompanies use Sendmail as their Internet gatewayinto a company and then run groupware. Microsoftsees us as a competitor, less so with Lotus. We havea good partnership with IBM.LM What have been the benefits and downsides ofhaving partnership programs rather than adding thecontent yourself?EA We cannot do everything. We are not a virusfiltering company and never will be. But rather thansay we cannot do this we have partners. IBM is apartner and so we both win. The downside issharing revenues.LM Do you see a market for policy driven contentmanagement such as the removal of spam andInternet blocking?EA Absolutely – this will be one of the biggest areasfor growth. As the Internet has become bigger it isno longer possible to say “tut, tut” to someonewhen they have made a mistake. Filtering ofoutgoing mail for viruses and legal liabilities such assexual harassment and customer lists will becomenecessary. Also the use of encryption for financialand medical matters. ■

Eric Allman

Linux Magazine In 1981 when you first developedSendmail, did you expect email to change the world?Eric Allman Yes and no. I was an email lover fromthe first time I used it and thought it absolutelywonderful. I thought everyone who was in science oracademia and into technology would be using it soyes I did think it was important. But I didn’t predictthat everyone – even my mother – would eventuallybe using it. It’s now at the stage where people go outto buy a computer just so they can use email so no, Ididn’t envisage it becoming that pervasive.LM How is Sendmail the company coping withgiving away the source code that it has spent somuch time developing?EA As a hybrid company we do not give everythingaway. The core technology is Open Source and it isthe right thing to do. There are lots of cases wherecompanies have taken over Open Source and boththe Open Source part and the commercial part die.We are well known and respected and that wouldbe harmed if we were not Open Source.LM Would you agree that giving away the sourceencouraged innovation?EA Absolutely – The OS community of developers issmall and the group that contribute back is smallerbut it is still significant. Even if it is just a bug reportit helps to move the software forward.LM Has the initial business plan that you developedwith Greg Olson worked out well?EA Again, yes and no. The original concept wasmass sale, with the intention of getting one percent of the Open Source over to commercial withbetween one and 10 thousand dollars. That failedbecause of resistance due to the “It already worksso why change?” attitude. What has worked wellis selling to people who have problems. Theywant high-end technical support. They wanteverything including the design of the wholeemail system.LM Is the hybrid business model a goodcommercial success?EA It is, in fact, working very well for us. It seems to

EMAIL ARCHITECT

Page 34: linux magazine uk 13

REPORT BEER HIKE

38 LINUX MAGAZINE 13 · 2001

The Linux Beer Hike

took place at

Bouillon in Belgium

this year. This might

not seem like an

obvious place to go

to but the facilities

and scenery certainly

make up for this.

LINUX BEERHIKE 2001

RICHARD IBBOTSON

Coupled with six days of sun and only twodays of rain it made this year’s event one ofthe best so far. A large crowd of peopleassembled over at the Archeoscope atBouillon. Much beer was consumed andmost were doing their level best to keep upwith everyone else. The 10th anniversaryof Linux was celebrated in some style. Ifonly Linus Torvalds could have been therewith us.

The Friday and Saturday at thebeginning of the week saw a whole armyof geeks arrive in Bouillon from all overthe world. In the seven days that the Beer Hiketook place much of the local area was covered onfoot and much of the local beer was consumed bythe beer-crazed fans of da penguin. The authorhimself was able to find a “leetle more room for zelocal Belgian ospitalite” even after a whole sevendays of partying (mostly with the help of localpeople who did not give in even after midnight). Atthe start of the week we had to assemble anetwork which included the cluster and the

wireless link up to the campsite. The latterproved to be something of a pain to set up

and dragged on into Monday. Peoplewere seen standing around in groupsdiscussing the difficulties and what todo next. As well as this, the clusterkind of clustered on and the rest of usshoved off for more beer which ateight per cent volume was the kind of

thing that shouldn’t be missed out on. Oneof the first social events was over at the barnext to the campsite. Most people turnedup and the first overly large quantity of beer

was consumed. The Beer Hike isn’t only about beer– there are also many events organised foreveryone during the seven days that it runs. WillemKonynberg started this off with his presentationwhich asked how we make Linux better and whydoes it need to be so much like a Microsoft productwhen there’s no real need for it. He says that hewanted to raise a few eyebrows and questioncurrent thinking about computers and software ingeneral. The assembled crowd loved it and gavehim a big round of applause.

On Sunday evening after a successful day ofhacking at the keyboard most of us went on thetorch-lit tour of the castle. This was something of agem from beginning to end. Very touristy but alsowell thought out and not to be missed. It was allabout how the crusade was led from the local castlein ancient times and how the political shape ofEurope was changed as a result. It’s well worthgoing to Bouillon just for this trip alone. The tourwas organised by Juergen Braukman. We would alllike to thank him for his efforts.

On Monday, we had Writing PHP Extensionsfrom Harmutz Holzgraefe and IP Networking fromAndy Fletcher – both proved to be really popular. Atabout the same time the trip round le Caves deHan-sur-Lesse took place. Most people said thatthey enjoyed it. There were more talks andpresentations in the afternoon for those of us whocould just about manage to hold our heads fromthe night before.

On Tuesday Lance Davis from UKLinux.net took

Bouillon, Belgium

Bouillon town

Page 35: linux magazine uk 13

REPORTBEER HIKE

13 · 2001 LINUX MAGAZINE 39

a group of people out for the rail hike. Everyonewho went said it was really good. I saw Lancewhen he came back. He looked about 10 yearsyounger and smiled all the time that I talked tohim. Wednesday turned out to be the Perl andApache day. By now we were all suffering theeffects of the beer and the heat. Some of us justdozed off. Thursday and Friday turned out to bethe rainy days when Brad Knowles took peoplealong to two very famous Abbeys to look at theChimay brewery and some of the others. Brad wasdistracted by others on Thursday morning. Theyleft an hour late and were only able to see thegrounds of the Abbey and not the brewery.Thursday was Trappiste Monasteries, Chimay andFriday was Trappiste Monasteries, Abbaye D’Orval.Everyone said they enjoyed it though and morebeer was consumed on Thursday night. Brad alsogave us an Introduction to Basic DNSAdministration on the last Friday of the weekwhich was fascinating from beginning to end andlead to some well informed discussion afterward.Later on he gave us Design and Implementation ofHighly Scalable Email Systems. He’s giventhis talk in many places and it nevergets to be boring or the samewhenever he presents it. I thinkthat Brad probably did more forthe beer hike than we realised atthe time.

One of the little-noticedhighlights of the week, other thanthe construction of the internal LANand cluster, was the installation ofQPE into an iPAQ Compaq palmtop.

Alban Pearce from Salford University and myselfspent a whole six days installing and configuringhis iPAQ. It was well worth it. The talk that hegave about how to install such a beastie with a cutdown version of Debian GNU/Linux was brilliantand the demo MPEG sent across the LAN to hishandheld iPAQ finished everyone as once again BillGates got the same custard pie in the face. Heeven replayed it a few times due to popularrequest. John Hearns helped him with thepresentation. Together they make a fine team.Have a look on the Net for the familiar project ifyou want to know more.

The final discussion on Saturday afternoon, afterclearing up, was all about where to go next year.There have been many suggestions. The Saturdaynight session can only be described as headbanging. The venue was the Cafe Baratin andmuch piano music was heard while some of usbrowsed some very nice oil paintings that hadbeen produced by a local artist. Excellent food aswell. The locals thought we were great and theywant us back again.

All of us are waiting to find out whatcomes next year. If you want to join in withthe rest of us please do subscribe to the LinuxBeer Hike list. You can join the list by sendingmail to [email protected] the word “subscribe” somewhere inthe message.

We do hope that you will all be able tocome along to the next one. ■Richard is Chairman and Organiser for

Sheffield Linux User’s Group – you can viewtheir website at http://www.sheflug.co.uk

Hacking away

InfoLinux Beer Hikehttp://lbw2001.ynfonatic.de/Webcam sitehttp://killefiz.de/lbw/online/index.htmlThe Familiar Projecthttp://familiar.handhelds.org/UK Linuxhttp://www.uklinux.net

Page 36: linux magazine uk 13

KNOW HOW APPLE MAC

40 LINUX MAGAZINE 13 · 2001

Anyone with an interest in computing, especially in UNIX-based OSs

cannot have failed to have noticed the hype surrounding the release of

Apple’s Mac OS X. OS X is a whole new ball game in Macintosh computing.

For many years Apple have been trying to find asuitable replacement for the sophisticated, butrapidly dating, Mac OS. After a flirtation with JeanLouis Gassee’s BeOS, the return of Apple co-founder Steve Jobs precipitated a focus shift toNeXT technologies.

NeXT was the company formed by Jobs followinghis unceremonious eviction from Apple by the thenCEO, former Pepsi man, John Sculley. NeXTmanufactured the famous 680x0-based Blackhardware, which offered performance beyond thatavailable on Macs and PCs of the time, but neverreally found a commercial base for the machinesand instead opened up their famous NeXTSTEP OS.It is this OS that is the basis of Mac OSX.

Reworked and ported to the PowerPC platform,NeXTSTEP has become Darwin – the open sourcekernel of Mac OS X. Including key UNIXtechnologies such as Mach and having full POSIXcompatibility, Darwin/OS X does for UNIX whatNeXT tried to do in the early 1990s. It combinesextreme power with ease of use.

There is a problem, however. The entry price issteep. You must have at least a G3 processor and128MB of RAM is required to do any serious work.If your Mac is pre-G3, your options for using MacOSX are limited to expensive processor upgrade cardsand even then Apple will not guarantee support.This is where Linux comes in.

There are versions of Linux for nearly every Macmade in the last 10 years, even 680x0-basedmachines. Over the next few years, software for the‘Classic Mac OS’ will dry up as users – even in thepublishing industry, famed for its inertia – switch toOS X. Where does that leave your once-prized Mac?

Many people are now booting up Linux as asecond system on their Macs. Old Power Macs suchas the 7200 make fine firewalls and small officeservers, and if configured properly can actuallymake great desktop machines. iMacs make good,small and inexpensive Linux desktops and ifaesthetics are not a concern for you, you can add asecond IDE hard drive quite easily, though it willhang out of the back of the machine. The G4PowerBook is probably the best Linux-capablelaptop on the market. The problem, as always, isuser level software. Despite the fact that the Macabsolutely dominates the creative industries andsome areas of science computing, it is a minorityplatform. Linux on the Mac, or indeed any PPCsystem is a minority within a minority. However,things may change very soon; let’s look at why.

First off, OS X has an open source core in theform of Darwin. Darwin has even been ported tox86 systems. This has allowed a lot of standardUNIX applications to make their way to OS X andthen PPC/Linux and vice versa. GUI applications maytake a little longer, but work is already underway.There are several X Window servers for OS X,including open source projects and TennonIntersystems’ excellent commercial effort.

Secondly, Apple and Adobe are currently having alovers’ tiff. These two companies have been co-dependent for years, and despite the availability of

Adobe Photoshop on other platforms (notably

RUNNING LINUX ON MAC

JASON WALSH

Mac on Linux

Page 37: linux magazine uk 13

KNOW HOW

13 · 2001 LINUX MAGAZINE 41

Windows and IRIX), it has remained one of three orfour ‘killer apps’ on the Mac. However, recentencroachment by Apple into Adobe’s territory withvideo editing software such as iMovie and Final CutPro has hampered sales of Adobe Premiere. To addinsult to Adobe’s injury, Apple is soon to launch abitmap editing application at the low end of themarket, which will spell problems for Adobe’s recentPhotoshop Elements. Adobe has decided to boycottthe upcoming Macworld Expo in return. Thisdispute is unlikely to go on for long, as bothcompanies’ fates are increasingly tied together, butfor the meantime there is no OS X native version ofPhotoshop. As a result, development of the PPCversion of GIMP has stepped up and promises havebeen made about CMYK support. GIMP on OS X ishowever, a kludge, running it under Linux PPC ismuch more pleasurable.

Linux is free – as in ‘free beer’. Yes, despite thehoo-hah about free meaning open, the fact remainsthat Linux has many more no-cost useable smallapplication programs, such as mp3 players,calendars, PIMs and so on, than any other OS. Thismay seem relatively unimportant, but if money is aconcern for you or your organisation, and let’s faceit, if you’re using a Power Macintosh 7200 ratherthan a G4 it probably is, then a highly configurableOS which you can alter to suit your machines with alarge selection of simple productivity applications islikely to be of interest.

Linux is ugly compared to the Mac OS. ManyLinux users disavow this and can come up with ahundred and one reasons to say otherwise, butfrom the perspective of user interface, Apple haveconsistently got it right, where others, notablyMicrosoft, haven’t. That said, KDE and Gnome havecome on in leaps and bounds and though I stillprefer other GUIs such as those of the Mac OS,BeOS and of course, OS X, they are a pleasure touse compared to their predecessors. Add to this thefact that with the great Mac-On-Linux applicationthe Mac OS can actually be run in an X Window andit’s dream come true time. If you think that thissounds awkward, remember that BeOS users havebeen doing it for years with SheepShaver and thatMac OS X itself uses similar technologies forrunning classic Mac applications. ■

Mac Linux resourcesLinuxPPC site http://www.linxppc.orgMK Linux site http://www.mklinux.orgMac On Linux site http://www.maconlinux.com

Related non-Linux resourcesTennon Intersystems http://www.tennon.comApple’s Mac OS X site http://www.apple.com/macosxApple’s official Darwin site http://www.opensource.apple.comBe Inc http://www.be.comGNUStep http://www.gnustep.org

Page 38: linux magazine uk 13

KNOW HOW GIMP WORKSHOP

42 LINUX MAGAZINE 13 · 2001

Gimpressionist is a flexible plugin by Vidar Madsen which

enables the user to turn ordinary images into works of art.

Linux Magazine takes a closer look at this handy tool.

One of the classic applications in image processingis that of adding a hand-painted touch to photos.Every program has at least one function for makingphotos into oil paintings or suchlike. Gimp is noexception to the rule – the relevant plugin can befound under <Image>/Filters/Artistic/Oilify....

Now you may be wondering why we don’t soundespecially enthusiastic. There is a simple reason forthis: It’s just boring. Great, I can turn my picture intoan oil painting – but anyone can do that with anyold program. The results from Gimp’s filter are notparticularly wonderful either. The true reason for myboredom, though, is that there is something a greatdeal more exciting.

Curtain up for Gimpressionist

In Gimpressionist Vidar Madsen has written a pluginthat can be used very flexibly to turn images intoworks of art. The basic idea is simple: The image isreassembled from small paintbrush images, whichcan adapt to the image.

Gimpressionist is one of the plugins which have somany parameters that it is necessary to save anyespecially effective combinations so as to be able toload them in again later. Start <Image>/Filters/Artistic/GIMPressionist; these delay settings are the

first thing you see (Figure 1). To make use of them,click on the name of the combination – for exampleDotify and then on Apply. Now the default settingsare distributed over the individual index cards.

Since Gimpressionist does not work especiallyquickly, you should ask for a preview, by clickingon Update. In the little box, you can roughlyassess the effect. With a click on OK the image isthen edited.

The default setting Dotify has the effect ofmaking the image look like a confetti mosaic(Figure 2). In order to show which ideas are behindGimpressionist, we will now convert the effectstep by step into a sort of chalk drawing on a wall.

The wall is a sort of structure, onto which thewhole image is to be stamped. The setting for thiscan be found on the tab Paper. Select the “paper”bricks2.pgm. To be able to see the effect (this wasnot required for the confetti), drag the slidingcontroller Relief up to about 70. The structure ofthe wall becomes visible after a click on Updtae.

On the card tab Brush you will now see wherethe round basic pattern for the confetti camefrom. We would rather have chalk strokes, soselect the paintbrush chalk01.pgm. If you have thepreview drawn again, the preview image is blackapart from the structure of the wall. The

Image processing with Gimp: part 6

GIMPRESSIONSSIMON BUDIG

Figure 1: Gimpressionist – the starting place Figure 2: Paper tiger

Page 39: linux magazine uk 13

KNOW HOWGIMP WORKSHOP

13 · 2001 LINUX MAGAZINE 43

paintbrush is drawn a bit too small. So change tothe Size tab and set the minimum and maximumsize to 30. In the preview, the image becomesvisible again. Obviously it is not desirable for all thestrokes to run in the same direction.

In order to make up for this, change to the indexcard Orientation and under Start angle select 360degrees and under Directions about 10. NowGimpressionist can turn the paintbrush from thestarting angle in 10 steps by 360 degrees and adaptthe image. This adaptation can function accordingto various criteria, and one nice option is that ofadapting the rough contours in the image(Adaptative). Obviously Gimpressionist can adaptthe paintbrush strokes all the more precisely, themore Directions there are available.

Now you have probably noticed the large blackmarks, which are due to the Random Placementstrategy. In the case of Evenly distributed, the blackmarks are less common.

And the size can also be adapted to the image. If,on the Size index card you set the minimum size to15, the maximum size to 30 and (similar to thedirections) set the number of sizes to 10,Gimpressionist has various sizes of paintbrush at itsdisposal. Here, too, it is possible to define aselection strategy. Adaptative orientates itself to thestructures in the image.

Be aware that for many directions and many sizesthe computing time rises steeply and the resultcould keep you waiting a long time. You shouldavoid combining the maximum setting of 30 in thesizes with the Adaptative strategy.

Now we have a tiger, which has been painted ontothe wall with chalk (Figure 3). In order to get a feel forthe options, you should try out the various defaultsettings and then see what settings have been madein order to achieve this effect. With a bit of creativityit is possible to turn an image not only into an oilpainting, but also into other – jollier – things.

Animation

In part 3 of the Workshop we asked you to submitsuggested topics for a continuation of the series ([email protected]). The most frequent questionwas how to create GIF animations with Gimp – orsomewhat more generally – how Gimp can copewith films.

To answer the last question first: Gimp is not theright tool for editing films of several minutes inlength. You can certainly read in films using theplugins under <Image>/Video/Split video intoframes, but they are then stored on the hard disk asindividual images uncompressed – anyone whodoesn’t exactly have terabytes of space to spare willvery soon run out.

When it comes to making more complicatedanimations, you will notice that Gimp is not theideal tool. The method of showing individualimages as layers is a fast hack, to enable GIF

animations without overwhelming the internal datastructures. In particular, one now no longer has theoption of working with layers for animations.Especially in animations, where objects are movedback and forth and may thereby overlap each other,this would be very useful, though. This is where theplugins from the domain of <Image>/Video/...come in. But even with the classic methods it ispossible to make GIF animations with lots of effects.

GIF in motion

GIF is still the only format supported by almost allWeb browsers for animations. This is why, despitethe licensing problems concerning the LZWcompression, it is still popular for use in Webdesign. You have to have a licence from Unisys to beable to legally distribute GIF images produced withGimp on the Internet. For this reason, in many Gimppackages the GIF (and TIFF) plugin is not installed asstandard. You must then install another package(gimp1.2-nonfree) to be able to create GIF images.The same applies for the Windows version of Gimp,and you can find out more on this athttp://www.gimp.org/win32/.

Animations are, in reality, nothing more than acollection of images shown one after the other. Tothis extent it seems obvious that Gimp should savethe individual images of an animation in layers. Ifyou load any old animated GIF from the Web intoGimp (you can simply give a URL as filename, Gimpthen downloads the image using wget from theNet), you will see that in the layer dialog theindividual stages of the animation are visible.

How long an individual image is visible, issomething you can determine from the name of alayer. If it is called layer (500ms), the image will beshown for half a second. Bear in mind that only ms(milliseconds) is permitted as a unit. If you do notspecify a period, when the finished image is saved astandard period will be asked for..

Figure 3: Tiger on the wall

Page 40: linux magazine uk 13

A big yawn

One fast method of creating an animation isthe Iwarp plugin, which you will find under

<Image>/Filters/Blur/Iwarp. With thisplugin you can blur images freehand, in asimilar to that of the Goo programs. It isespecially easy to create caricatures out offaces, by exaggerating distinctive facial

features. You can displace imageareas, blow them up, shrink themand turn them clockwise andanticlockwise. With Delete you takean image back to its original

condition. The two slidingcontrols define the size of theaffected area and the intensityof the effect. With the mouseyou can then blur in the

preview image, and youwill get the hang of itafter a few tries.

The Iwarp plugin nowhas the option ofcreating an animationfrom unblurred toblurred image (and backagain if you like). To dothis, simply click on the

index card Animation and select the number of theintermediate steps. With Reverse the animationgoes, not from the original to the blurred image but– surprise – the other way round. With ping-pong,after blurring it animates back to the original image.

Using the tiger image from last month we havemade our tiger yawn using this method (Figure 4).Maybe you can even get your mother-in-law to grin...

You can view the finished work of art using<Image>Filters/Animation/Animation playback. Theplugin is easy to use, but there is also another neattrick here: You can click on the display of theanimation and drag it out of the window. This isespecially practical, if you want to quickly assess

how the finished animation would look in thewebsite, and do not feel like faffing around inHTML code. Simply drag the animation over theWeb browser. It disappears again when thewindow is closed.

Keep the Layers & Channels dialog open all thetime, when you are working with animations. It is avery useful tool, to quickly duplicate a layer, changethe sequence of the layers (thus the order of theindividual images) and to combine two layers witheach other. As a little example we can make a littletext appear.

Fading in text

Create a new image 500x100 in size. Select the texttool and create the text which is to appear, in a layerof its own. Now duplicate the background and thetext layer 10 times each. Using drag and drop youcan now sort the copies of the text layer betweenthe copies of the background layers (Figure 5).

When you play the animation back, you will see aflashing white text against a black background. Butwe would rather have a text which is faded in, soselect values of between 0% and 100% as coveringpower of the text layers, using the slide control inthe layer dialog in 10%-steps. For technical reasons,you cannot see this effect yet in the animationpreview, but in principle it is still a flashing text. Toget rid of this, merge every two sequential layers. Todo this you must click the mouse to activate the textlayers network after another and pressShift+Ctrl+M to trigger the command Combinedownwards (Figure 6). Now our text fades in gently.

We can now save this image as an animated GIF.Simply specify a filename, ending in .gif. The exportdialog will appear automatically (Figure 7), whichinforms you that several layers can be combinedbefore saving – but we don’t want to do that in thiscase. So click on Save as animation. Since the GIFplugin only supports indexed colours, the image isautomatically converted into such a format. Thenclick on Export. In the dialog which will appear, just

KNOW HOW GIMP WORKSHOP

44 LINUX MAGAZINE 13 · 2001

Figure 5: Sorting the layers Figure 6: Merging layers

Figure 4: Giiiiimp!

Page 41: linux magazine uk 13

click on OK, the default settings are reasonable. Ifyou now look at this image in Netscape, you will seethe effect.

Web design

GIF animations are sometimes a nice enhancementfor a website – but if they are used to excess andthere is something flashing and moving whereveryou look, visitors will be put off. Please be sparingwith the use of GIF animations. Sometimes a smalleffect is much more effective than all that flashing.For example on Slashdot after a report on Gimpthere are always astonished comments that theeyes of Wilber (the Gimp mascot) can move – andyet one had never noticed it before. They doactually move by one or two pixels, and that willnever change. But a Wilber who rotates about hisown axis, who changes his colour and at the sametime hops up and down, would never trigger thisAha! affect.

Size matters

The other thing you should bear in mind is the sizeof files. GIF animations can become very large anddrastically increase the loading time for a Web page.If the animation is better designed right from thestart and some effects are made slightly differently,you can save a lot of space. The animation we havejust created (Figure 8), is about 34 KB in size, via anISDN connection it would take five seconds to getonto your home PC. But since it is only one secondlong, it will run too slowly and be jumpy.

In order to reduce the size, you should do twothings: Firstly, index the image by hand (as fewcolours as possible and if possible without colourscanning) and then select the menu item<Image>/Filters/Animation/Animation optimize.This command tries to remove redundancies from

KNOW HOWGIMP WORKSHOP

13 · 2001 LINUX MAGAZINE 45

Figure 8: Fading in text – large files

Figure 9: Fading in text – small files

Figure 7: Therelevant dialogsfor GIF animations

The authorSimon Budig is now battlingwith compiler construction.That’s why there are nophilosophical comments thistime. A parser is an algorithm,formal proof of...

the image andto exploit acouple ofspecial featuresof the GIF format,in order to save a bitmore space. This isespecially worthwhilewhen large areas remain thesame from one image to thenext and therefore do not haveto be saved again. In our case, wehave got it down to about 24KB.

But the main problem with file size ishome-made. Since our text fades in slowly,many pixels change colour from one image tothe next. It would be better if only small areaswere to change each time – and then less imagedata would be transferred, too. As an experiment Ihave redesigned our animation so that it appearsletter by letter. This means that only a small area everchanges from oneimage to the next. Ifyou want to do this,it is worthwhilestarting with the fulltext, making a copy ofthe layer and then deletingone letter. Repeat thisprocess until the text is blank.The result looks something likeFigure 9.

Once the image has been indexedand optimised it is just 4KB in size. So theslight adjustment to the animation hascertainly paid off. Generally it is possible tosay that movements and fading in take up morespace than the appearance of parts of an image.

Obviously there is a lot more to discover, butthat’s enough for this time. Have fun! ■

Page 42: linux magazine uk 13

KNOW HOW INSTALLATION

46 LINUX MAGAZINE 13 · 2001

Sometimes we need to get new programs for the Linux system, but installing

them can be a chore. This month we look at installation from the source.

Installing from source codeThe idea of installing from source code might seemdaunting – all those nasty curly brackets and stuff.Isn’t this option out of the question for the non-programmers amongst us? No, certainly not!Installing from source usually does not require you tomodify, understand, or even look at the actual sourcecode at all. However, since most of the software iswritten in C or C++, it does require that you installthe C/C++ development tools on your system.

Most of the established open-source sites use aformat known as a tarball, (also known as acompressed tar archive) to package source code fordistribution. These files usually have names endingin .tar.gz. As an example, we’re going to take a lookat installing the latest version of the Apache Webserver from source. The process is much the samefor other packages.

As I’m writing this article, the most recent versionof Apache I can find as an RPM is 1.3.20; however Iknow that there’s a beta version of 2.0 available.We’ll try the obvious place – www.apache.org. Sure

enough, after a couple of minutes poking around Ifind a listing of files available for download (seeFigure 1). The tarball I need is called httpd-2_0_16-beta.tar.gz. The file below it in the list is a PGPsignature for the file, so I can be sure it’s authentic. Idecide to download the tarball to my homedirectory, /home/chris.

The next thing to do is to uncompress andunpack the archive. With the right switches, tar cando both of these in one step:

$ cd /home/chris

$ tar xzvf httpd-2_0_16-beta.tar.gz

You’ll see a long list of the files as tar extracts themfrom the archive and puts them into thesubdirectory httpd-2_0_16. If you’ll look in thatdirectory you’ll see some documentation files withnames like INSTALL and README, which you’llprobably want to look at.

Now it’s time to build the software. Not manyyears ago this typically involved quite a bit of fiddlingaround to customise the build process to yourplatform, following instructions in the INSTALL filewhich said lots of intimidating things like “if youdon’t have the library libfoobar.o, add the flag -DNOFOOBAR to the CFLAGS macro definition in themakefile”. Nowadays this customisation is mostlyautomatic thanks to an amazing tool called autoconffrom the Free Software Foundation. Autoconf isused by the package developer to create a scriptcalled configure which is included in the tarball. Theconfigure script performs lots of tests on your systemand builds a makefile depending on what it finds. Bythe way, I do not recommend actually looking at theconfigure script; like most automatically generatedcode, it’s not a pretty sight.

If configure finds that necessary components areabsent from your system, it will tell you what’smissing and abort. In any event, you’ll see a long listof all the tests that the configure script is makingscroll by. If all goes well, you end up with a makefileto control the build of the software.

Installing Open-Source Software on Linux

GOING TO THE SOURCE

CHRIS BROWN

Figure 1: Finding files

Page 43: linux magazine uk 13

KNOW HOWINSTALLATION

13 · 2001 LINUX MAGAZINE 47

There’s not space enough here to talk aboutmakefiles and the make command in depth.Suffice for now to say that the makefile specifieswhat files need to be created, which files theyneed to be created from, and what commands areneeded to do the job. The make programinterprets the makefile and runs the necessarycommands. Usually all you need to do is to runmake with no arguments. This will compile andlink the programs that make up the package, andmay take some time depending on the complexityof the package and the speed of your computer.Time to go and top up the bird feeders withpeanuts perhaps. If configure ran successfully, themake is unlikely to fail.

Now you have the compiled version of thepackage. Note that everything so far has beencontained within the directory you did the build in –in our example, that’s /home/chris/httpd-2_0_16. If Iwere to empty and remove this directory, and deletethe tarball from my home directory, I would removeall traces of the package.

The final step is to install all the pieces into thecorrect places in your system. This might be assimple as putting the program into /usr/bin forexample, but will typically also installdocumentation and maybe some configurationfiles. Because this operation updates system

directories, it must be run as root. This operation isalso automated via entries in the makefile and thecommand is simply ‘make install’.

In most cases, that’s all you’ll need to do. It takeslonger to explain than to actually do. In summary,the sequence of commands is usually:

<download the tarball to /somewhere >

$ cd /somewhere

$ tar xzvf package_name.tar.gz

$ cd package_name

$ ./configure

$ make

su to root ...

# make install

Once the package is installed you can recover somedisk space by deleting the directory you unpackedthe tarball into – for example:

$ rm -rf /somewhere/package_name

Installing new software onto Linux isn’t hard anddoesn’t require any programming skills. It’s anexcellent way of expanding your system andkeeping what you have up to date. And of course,it’s free!Happy hunting! ■

Page 44: linux magazine uk 13

KNOW HOW MIGRATION

48 LINUX MAGAZINE 13 · 2001

Working with a graphical user interface starts being fun once the settings have

been adapted to your own preferences, so that the interface makes working easier.

Under Windows, the principal configuration optionsfor the desktop can be found in the Control Panel.KDE, probably the most commonly used graphicalinterface for Linux, takes a very similar approach.You will find the important options for customisingyour work environment in the KDE Control Center.

In this workshop we will show you in KDE how toadapt the settings which you would access throughthe Display section of the Windows Control Panel.We will be referring to Windows 98 SE and SuSELinux 7.1 with KDE 2.0.1.

The path to the configuration controls is similarfor both desktops. Under Windows it isStart/Settings/Control Panel.

After installing KDE you will see a panel similar tothe Windows taskbar at the bottom of the screen.This is the KDE control panel, often simply calledPanel. If you click on the button with the KDE iconat the far left, a menu opens which contains,among many other things, the Control Center. Clickon this menu item and you will find yourself in atthe heart of the controls.

The Control Center for Gnome (another graphicalinterface) can be reached most quickly via the buttonwith the toolbox on the control panel. You can also

click on the Gnome icon on the left and selectProgram/Configuration/GNOME Control Center.

The Control Centers for Windows and KDE differin terms of their appearance. KDE divides the screeninto two halves. The configuration areas are listedon the left, the relevant dialog window appears onthe right. The elderly gentleman in billowing robeswho welcomes you is called Kandalf, by the way.The categories in the left column can berepresented as a tree structure or an icon view. Youcan change the display mode using the View optionon the menu bar. In the following text we will bereferring to the tree view.

Appearances

The visual aspect of the Windows user interface isadapted mainly through the Display option in theControl Panel. Here you can choose wallpaper andscreensavers, and configure display options fordesktop components such as windows, title bars,icons and menus.

In order to do this in KDE, click on the “+” infront of Look and Feel in the tree view of the KDEControl Center. Further sub-items will appear. Thefirst, Desktop, itself contains four sub-items.Under General you can specify some generaldesktop properties.

Customising the desktop with Control Center

TAILOR-MADEDESKTOP

ANJA M WAGNER

Figure 1: The Windows Control Panel isaccessed via the Start menu

Figure 2: KDE adopts the same routeto its Control Center as Windows Figure 3: Kandalf welcomes you to the Control Center

Page 45: linux magazine uk 13

KNOW HOWMIGRATION

13 · 2001 LINUX MAGAZINE 49

What should happen if you click on a free areaof the desktop with the mouse? If you preset theoption Window List Menu, clicking will open amenu that shows all windows currently open. Youcan display these tiled or cascading, raise them orchange desktops altogether (see below).

The Desktop Menu may be more familiar to youunder the name Context Menu. Here you findbasic actions such as Create new for directories ordocuments, Paste, Help or commands torearrange the icons on the desktop. By default,this menu is opened with a right-click. This is trueof almost all KDE applications. If you like, KDEcould also show the application menu when youclick on any free space on the desktop. Thisnormally appears when you click on the K-Buttonon the panel.

In some cases, such as clicking on the desktop,you will need a middle mouse button to useKDE. For a two-button mouse you normally needto press both buttons together to simulatepressing the middle mouse button. Whicheveroptions you have chosen for each of the threebuttons, confirm the settings with Apply and testthe effect.

On the second tab, Appearance, you can varythe font size for the desktop between small,medium and large, as well as setting the standardfont and normal text colour. If you haveexperimented with lots of different options andwould like to return to the original settings justclick on Standard.

Backgrounds

We continue with the sub-item Background in theleft column. Here you will notice a special feature ofgraphical Linux interfaces. KDE provides fourdesktops as standard. You can set up a maximum of16 desktops (see below). If you want to designdifferent desktops, uncheck Common background.In the lower half you can now select a backgroundfor each desktop.

Select a gradient under Mode if the backgroundis going to have two or more colours. If you wouldlike a pattern, activate the relevant option andclick on Setup. KDE offers seven patterns asstandard. Confirm your selection with OK andcheck the appearance in preview. Use the sameprocedure to activate a program as background.kdeworld displays the Earth’s time zones, updatedevery 10 minutes, xearth shows the globe as itrotates slowly. Activating background programsdoes take up a lot of computing capacity and canslow down machines significantly depending ontheir resources.

Under Wallpaper you can deactivate the presetlogo and specify how an image should be arrangedon the desktop. You can select your own imageusing the Browse button. To have more than onewallpaper display, enable Multiple, select theimages through Setup and determine the order andtime interval of their appearance.

The Advanced tab allows detailed settings suchas blending and limiting the pixmap cache. The

Figure 4: Basic desktop settings are implementedin the Display section of the Control Panel, forinstance the selection of wallpaper

Figure 5: Here you can specify whathappens when you click on the desktopwith the middle mouse button

Figure 6: Rather than having an image, youcan run a program as desktop background

Figure 7: You can decorate the desktop with yourfavourite pictures, tiled, blended or alternating

Page 46: linux magazine uk 13

easiest way to find out how these affect thedesktop is to try them out. Fortunately you cancreate many different desktops rather than havingto settle on one design.

Desktop and window Borders can bemagnetised. This means that windows that aremoved close to another window or to the edge ofthe screen will snap onto these once they have gotwithin a certain distance – the snap zone. Thismakes it very easy to position windows. Use theslider under Magic Borders to specify how large inpixels the zone in which the magnetism effectworks is going to be. Active Desktop Borders arenot yet available.

As mentioned already in the Backgroundsection, KDE starts off by providing fourdesktops. In the Virtual Desktops configurationsection you can define a maximum of 12additional desktops, which you can customiseaccording to taste. To increase the number ofactive desktops, use the slider.

If you would like the desktops to have names,you can write these in the their text boxes, forexample Work, Games, Experiments, etc. Eachdesktop will now appear as a button on the controlpanel. Small boxes indicate which desktop haswindows open.

“Why all this effort?” you may ask yourself. If youwork with many windows open simultaneously youcan arrange these, possibly by subject, on thedifferent desktops. Each individual desktop remainsclear, and by clicking on the panel buttons you canquickly jump between desktops.

Screensavers are selected using the Screensavermenu item in the left column. First, activate theoption Enable screensaver in the dialog window.Set the time in minutes before it starts and apply apassword if required. The Priority slider determineshow much processor performance is madeavailable to the screensaver. You ought to keep thepreset, Low.

Windows combines the screensaverconfiguration with the adaptation of themonitor’s energy-saving features. This is the samein Gnome. KDE gives the energy settings theirown menu item. Select Power Control/Energy inthe left-hand column of the Control Center. Onceyou have enabled the display energy saving mode,use the sliders to set the time after which it shouldbe activated.

More style

You have already been introduced to a number ofconfiguration options for the desktop, but there aremore. Themes allows you to design your desktop’sstyle and icons. KDE offers several different styles.This means that the appearance of windows, icons,buttons, title bars, etc. follow a consistent style. Forexample, if you choose the style Qt Windows theappearance of your desktop will be very similar tothe familiar Windows environment.

Some general settings for KDE program toolbarsare also applied here. Should toolbar buttons berepresented as icons, text or a combination of both,should active buttons indicate when the mousepointer touches them (by being highlighted briefly),and should the toolbar be transparent when it isbeing moved?

KNOW HOW MIGRATION

50 LINUX MAGAZINE 13 · 2001

Figure 10: Screensavers to suit every taste

Figure 9: Each desktopis represented on thepanel by a button Figure 11: Saving energy

Figure 8: Ease-of-use and plenty of space is provided byup to 16 virtual desktops

Page 47: linux magazine uk 13

Some surprising effects can be achieved withColors. You can vary the colours of windows, titlebars and menus. After you click on Apply thedesktop elements are assembled according to thechosen colour scheme and displayed in a preview.Depending on how outrageous your desktop designis you may see unusual things.

Tip: If you have designed very differentbackgrounds for your desktops, there is an easy wayto check the window layout for all desktops. Open awindow in any desktop and right-click on the titlebar. In the context menu, select To desktop/Alldesktops. Now all you have to do is to select alldesktops in turn from the panel and to checkwhether the colour and design suits all backgrounds.

Another very convenient configuration optioncan be found under Window Behaviour. If yourmachine is slow you should disable Display contentin moving windows and Display content in resizingwindows. Only the frame is now displayed whenwindows are moved, as familiar from Windows. Ifthere is more than one window open on thedesktop, KDE can apply a Smart placement policyso that as much as possible is visible of eachwindow on the desktop. Other options are Cascadeor Random.

The windows focus policy is designed to makethings easier; the active window is the one in focus,it receives all keyboard input. You can specify thebehaviour of the window for mouse clicks or mousecontact. The settings could be combined so that awindow is in focus as soon as the mouse movesover it and is raised automatically. Select therelevant option on the Focus Policy drop-downmenu, followed by the option Auto raise which isenabled. The raising of the focus window can bedelayed using the slider.

What should happen when you click on titlebars, frames or windows with one of the threemouse buttons is specified under MouseBehaviour. The default settings are similar to thosein Windows.

A useful feature is the shade facility, which is

started by double-clicking on the title bar of awindow. The open window is reduced to its titlebar. Another double-click causes it to expand backto its full size. This avoids cluttering up of thedesktop when many windows are open at thesame time.

Under Taskbar you can enable the Show allwindows option. This causes all open windows onall desktops to be displayed in the window panel.The window panel is integrated into the controlpanel and is situated to the right of the desktopbuttons. If the option is disabled, only the windowson the current desktop are shown. The secondoption, Position, has not yet been implemented.

The control bar or panel is an essentialcomponent of the desktop and can be arranged in avariety of ways. It can be dragged to the edge of thedesktop using drag and drop as in Windows. Youcan also specify its position under General on themenu item Panel. The panel has a small arrow ateither end. If you click on this, it disappears, apartfrom the button with the small arrow. Another clickcauses the panel to return. It can also be hiddenautomatically. Use the slider to specify after howmany seconds this should happen. The panelreappears when you touch the edge of the screenwhere it is normally placed with the mouse pointer,by default this is at the bottom.

On the Look and Feel tab you will find the

KNOW HOWMIGRATION

13 · 2001 LINUX MAGAZINE 51

Figure 13: The more outrageous the better

Figure 14: The mouse rules over title bars and windows

Figure 12: Change the appearance and style of your desktop

Page 48: linux magazine uk 13

option Fade out applet handles. If such applets arepresent on the panel you will see a small area ontheir left, which looks like it is covered in smallrivets. This is the handle. By right-clicking on it youcan move buttons and applets or delete them fromthe panel.

Gnome panels

If you switch between desktops you will notice thatthe panel remains the same. In Gnome you are ableto use and configure several panels. Right-click on afree space on the control bar and selectPanel/Create Panel. You can insert elements into thenew panel in the same way by choosing Add toPanel and selecting the relevant elements from themenus that follow. You can configure a differentcontrol panel for every area of work, which greatlyreduces the time it takes to access the respectiveapplications. Simply close panels that you do notrequire at present using the small arrows.

Back to KDE: Font type and size for the desktopcomponents are set under Fonts. The Choosebutton leads to a dialog window where font, fontstyle and font size for the specified desktopcomponents are set separately. These options allowyou to differentiate in more detail than underDesktop/General/Appearance.

If the size of the icons on the desktop does notappeal to you Icons is the place to go. Using theexample of the cogwheel application icon, KDE showshow icons will appear in panels and on the desktop.The size can vary over three levels. In addition, pixels

can be displayed double sized. The Effects tabcontains further design options, for examplecolouring the icons and adjusting the saturation.

KDE can keep you informed about the systemactivity of the graphical interface and the windowmanager. Four options are available for each actionunder System Notifications: Log to file, Play sound,Show message box and Standard error output. Ifyou would like to play a sound for a systemnotification tick the relevant option – this willenable the text box Filename. Click on the directoryicon to the right of the box and choose theappropriate sound file.

The last sub-item of the large Look and Feelcomplex lists the valid keyboard shortcuts underKey bindings. Many of these shortcuts such as Cut(Ctrl+X), Copy (Ctrl+C) are identical to theWindows shortcuts. If you would like to change akey combination, click on the relevant action inthe dialog box and select Custom key. As anexample we will change the key combinationAlt+F1, which calls the Start menu, to Alt+F5.Choose this action from the list. If you now clickon Custom key the Alt key remains selected. Clickon the function key icon and press F5. The newsetting appears in the selection window. Actionsthat do not have any keyboard shortcuts yet aredefined in the same way.

The screen resolution and the colour depthcannot be amended through the KDE ControlCenter. You have to start another tool in order to dothis, which is why we will be covering this point in alater workshop. ■

KNOW HOW MIGRATION

52 LINUX MAGAZINE 13 · 2001

Figure 15: Select fonts for different elements of thegraphic interface, like window titles or menu entries

Figure 17: System under control Figure 18: Key shortcuts instead of mouse

Figure 16: Desktop icons can haveboth size and colour customised.

KDE: KDE stands for K DesktopEnvironment and is a graphicaluser interface for Linux.Together with Gnome, KDE isthe most widely used interfaceand these days the mostsophisticated. The number ofprograms and applets for KDEis enormous. The project hasbeen in existence since the endof 1996. KDE consists of themodules login display manager(kdm), the window manager(kwm), the file manager(Konqueror) and the controlpanel (kpanel). Furtherinformation can be foundunder http://www.kde.org.

Gnome: GNU Network ObjectModel Environment, whereGNU stands for GNU is NotUNIX, has been a project of theFree Software Foundation since1997. It consists of the logindisplay manager (gdm), the filemanager (gmc) and the controlpanel (panel). Information iskept at http://www.gnome.org.

Page 49: linux magazine uk 13

PROGRAMMING COMMAND

53 LINUX MAGAZINE 13 · 2001

Locate and Find

COMMANDCOLIN MURPHY

There are many

branches in a UNIX-

type file system, so it

will come as no

surprise to you when

you realise that you

have forgotten on

which twiglet you have

left a now desperately

sought after file.

Crond is the batch daemonwhich starts other processesat predetermined times,which are described in thecontrol file etc/crontab.

Crond

#/.bash_logout is one of thebash shell command files, thisone being run when you exitfrom a bash shell session,usually when you are shuttingthe machine down to turn it off.

Bash logout

Even if you have an infallible memory you maystill have to deal with an unfamiliar landscape,different distributions have different file layouts,which will only frustrate you when you are trying tofind a system file – the XF86Config file is a goodexample of this. Thankfully, there are a number oftools and utilities that can help you find the filesyou need.

Most Linux distributions will come with the locateutility, which will give you the location of any filesthat have the text you are looking for in theirfilenames. So the command:

colin@localhost colin]$ locate XF86Config

will give me

/etc/X11/XF86Config/etc/X11/XF86Config.old/etc/X11/XF86Config.test/usr/X11R6/lib/X11/XF86Config-4.eg/usr/X11R6/man/man5/XF86Config.5x.bz2

showing me all the files that have the text‘XF86Config’ in the filename, some of which Ireally should get around to deleting the next timeI do some tidying up! If you have some idea ofthe filename then locate will help you track downits location.

locate relies upon its own database, which, to beof any use, needs to be updated regularly. If you arein the habit of leaving your machine on overnightthen this usually will happen automatically whenthe nightly crond jobs are run. If your machine isnever on late enough for these jobs to run then youwill need to run the updatedb command yourself atsome point – maybe as you log out, somethingwhich could be automated by adding the commandto your ~/.bash_logout file in your home directory.The advantage of having locate use a databasemeans queries will be answered very quickly, thedisadvantage is the database will be out of date,especially if you have been creating or copying a lotof files in one session, even this can be solved byrunning updatedb from the command line, leavingyou with time to go get a coffee.

find is another command line tool that will helpyou find files, but this time you can search for files

based on other criteria like file size or by the datethe file was last modified. This is a feature-richand powerful command made obvious becausethe manpage is so big. The basic thing toremember when calling ‘find’ is that you need toprovide the search criteria as well as the searchpattern, so the command:

[root@localhost /]$ find /var/log/ -nameU‘*.log’

will give me

/var/log/security.log/var/log/auth.log/var.log/user.log

amongst many other files. Breaking this down – wewill only look in the /var/log directory and anydirectories below it. We are basing our searchcriteria on the names of files only and that we onlywant to know about filenames that end in “.log”.

There are many search criteria other than -name,all of which are listed in the manpages, here arejust some:

● -mmin -n allows you to look for files that weremodified no less that n minutes ago – useful ifyou wanted to see which log files had just beenwritten to. +n would allow you to look for filesthat are older than n minutes.

● -size +n will look for files that are bigger than n in512 byte sized blocks. Put a “c” after the valueto search for byte counts or a “k” to search forkilobyte counts,

● -user name will allow you to look for files thatonly belong to the named user.

The search criteria can by combined to make for amore powerful search, so

[root@localhost /]$ find -mmin -30 -user colin

will only tell me about files that have beenmodified in the last half an hour and only belong tothe user colin. ■

Page 50: linux magazine uk 13

The most important innovations in Python 2.1

PROGRAMMING PYTHON

54 LINUX MAGAZINE 13 · 2001

Object persistence in Python

PYTHON POWER

ANDREAS JUNG

Nested scopes

Until Python 2.0 there were three name spaces, which are searchedfor variables in the following order: local name space, module namespace and built-in name space. This separation is not intuitive if youlook at nested functions:

def f():...def g(value):

...return g(value-1)

Invocation of function g() in the return statement will cause a nameerror exception, because g has not been defined in any of the threename spaces. Python 2.1 removes this shortcoming and allows thenesting of name spaces through importing the new nested_scopesmodule.

__future__ statements

New features are introduced with every version of Python. This maylead to a break in compatibility with existing applications. In order toalleviate this problem, new aspects that will become standard featuresin Python 2.2 can be linked using a __future__ import statement.Nested scopes will become a standard feature of Python from version2.2 onwards. Although their implementation is already finished theyhave not yet been enabled in Python 2.1. To be able to use themanyway, they need to be linked and enabled with

from __future__ import nested_scopes

Warning framework

Over the years many modules have accumulated that are no longersupported, are obsolete or have been replaced by newer ones withimproved functionality. It is difficult for developers to remove modules

In a new series on Python, Linux Magazine will

be reporting on current developments

every other month and introducing the

concepts that make Python unique. Our first

topic is object persistence.

Welcome to Linux Magazine’s newPython series. We will be looking at

topics on all aspects of Python, forbeginners as well as advanced users. This

includes reports on current Python developmentsand solutions, but also basic articles on certainsubjects. The first article deals with thepermanent storage of objects. But first a briefoverview of Python...

Python is a scripting language that wasdeveloped at the beginning of the 90s by Guido

van Rossum and has since evolved into auniversally employed programming language.Today, Python is the most important and mostwidely used scripting language apart from Perl. Asthis description implies, Python is an interpretedlanguage, compilation of Python programs takesplace at runtime.

A magazine article cannot hope to give a fullintroduction to Python, however, we will discusssome of Python’s concepts and advantages. Adetailed introduction can be found in the Python

Page 51: linux magazine uk 13

PROGRAMMINGPYTHON

13 · 2001 LINUX MAGAZINE 55

tutorial at http://www.python.org/doc, but also inthe new Open Source book Dive Into Python(http://www.diveintopython.org).

Python overview

We’d briefly like to mention a few of Python’sadvantages and distinctive features:

Quick to learn and to easy read: Python’s syntax issimple and easy to understand, and its functionalityis clear. Unlike Perl, even very large projects can becreated, maintained and still be intelligible sometime later. Its language range is orthogonal, as arule there is no duplication of functionality. Loopsare realised as for or while constructs, repeat ordo..until loops are unnecessary.

Modular: related functionalities (for examplesockets or graphical options) have been combinedinto modules and are imported when required. Inthe spirit of code reuse, modules can be used bydifferent applications.

Interactive: Python has an interactive mode,which makes familiarisation very easy, particularlyfor beginners.

Compact: Compared to compiled languages likeC or C++ Python programs are very compact.Python’s data types, such as dictionaries, lists andtuples, allow most complex operations to fit ontoone line. Programs are structured into codeblocksby indentation of the source code. The bracketingfamiliar from C is therefore redundant.

Object-oriented: In contrast to otherprogramming languages Python was designedfrom the outset to be object-oriented rather thanbeing extended with object-oriented conceptslater on, like Perl, for example. This unifiedconcept distinguishes Python significantly fromits competitors.

Python’s increasing popularity has one main

reason: the clear and simple language structuremakes it easily accessible. In the meantime, Pythonis used by schools and universities to teachprogramming skills.

However, Python is not only of interest tobeginners, it is the Swiss Army knife ofprogramming. It is used in areas as diverse as Webapplications, string processing, administrative andother applications, numeric calculations andcontrolling complex production environments infactories. Python inherently offers many usefulconcepts that are not found in other languages, forexample object persistence.

What is object persistence?

In every object-oriented programming languageobjects contain methods and attributes. For manyapplications it is desirable to deposit an objectpermanently on a storage medium in order to reuseit after restarting the program. Following a programtermination the latest stored state of the object canthen be accessed.

It is always possible to write application-dependant code for the export of important data,but each modification of the object also requires theexport functionality to be amended accordingly.What is required at this point is transparent objectpersistence, that is, a mechanism that allows objectsto be stored permanently without additional code.This should happen without necessitating theprogrammer or the application to have specialknowledge about persistence.

Python persistence

For a long time Python has contained pickle andcPickle, with which objects can be serialised.Objects are serialised into character streams, which

Tuples: A tuple is a number ofvalues separated by commas

without running the risk that applications won’t work with later versions.The warning framework makes it possible to issue version-

dependant warnings that a module will no longer be contained in thenext version or a functionality will be changed or removed. Forexample, when importing the regex module, Python 2.1 issues the warning:

> import regex__main__:1: Deprecation Warning: the regex module isdeprecated; please usethe re module

Users then have one release cycle to convert their software to thenewer module re for regular expressions.

Function attributes

In Python 2.1 attributes can be assigned to functions:

def func():....

func.author = “Holger Müller”func.security = 1

All attributes are stored in the function’s dictionary __dict__. Untilversion 2.0 it was only possible to hide additional information in thedoc string, which could be read through f.__doc__.

New installation mechanism

From version 2.1 the installation is carried out using the distutilspackage, which is the standard installation tool for Python modules.

It is therefore no longer necessary to go to the trouble ofconfiguring the modules manually, as was the case in older versions.The installation script checks automatically which modules it cancompile (similar to configure), based on the headers and libraries, andthen builds them automatically.

Page 52: linux magazine uk 13

PROGRAMMING PYTHON

56 LINUX MAGAZINE 13 · 2001

can then be in files. This process is called pickling;an object is conserved, as it were, in order to bereused later. Alternatively, Python can read in sucha serialized object and convert it back into anobject (unpickling).

Both modules are identical in their functionality:cPickle is the C reimplementation of the picklemodule written in Python, and is always preferablefor efficiency reasons.

In the example in Listing 1 an object with the twoattributes num=212 and txt=’Python is cool’ iscreated. The object is stored permanently in aninternal format in instClass.p by invokingcPickle.dump(). The subsequent call cPickle.load()loads the files and generates a new instance ofmyClass, which has the same attributes as theoriginal object.

This approach is generally possible for everyPython object, however, there are someexceptions. For example, file objects or socketscannot be serialized, which would not be sensibleanyway. Pickling allows persistent storage of anyobject – even ones with multiple inheritance – butthe programmer still has to implement parts of thecode himself.

Persistence in Python using the ZODBBased on the pickle mechanism, the Zope ObjectData Base (ZODB for short) was created during thedevelopment of the Zope application server. It freesthe developer from the burden of implementationas well. Its use is relatively simple: to the developerthe ZODB appears as a mapping object which isaddressed in the same way as a Python dictionary:

zodb[`instClass’] = instClass

The object is bound to the key ̀ instClass’ in theZODB and stored. In the same way objects can easilybe retrieved from the ZODB:

instClass = zodb[`instClass’]

That looks very elegant, and it is. But before we getto that point, ZODB has to be installed first. ZODB isnot restricted to a specific medium for storingobjects. Normally it deposits objects in a file withinthe file system, however, adapters for databasessuch as Oracle or BerkleyDB exist. The storagemedium is transparent to the application. Onlywhen opening the ZODB does the medium have tobe specified, that is, if applicable, the underlyingactual database layer.

Installation of the ZODB

The ZODB is integrated into Zope and can be used ifZope has already been installed. If you don’t needZope, there is a stand-alone version of the ZODBwhich is being maintained by A M Kuchling.

After unpacking the archive the installation isperformed using the distutils tool (contained inPython 2.0/2.1, for Python 1.5.x the distutils have tobe installed separately):

python setup.py install

That should automatically compile and install allZODB sources and modules. It is advisable to use thecurrent version of Python, 2.1.

Using the ZODB

How to open the ZODB when using a file as thestorage medium can be seen in detail in Listing 2.The FileStorage object in this case represents thestorage medium that is being used for the ZODB.When using a ZODB adapter for a relationaldatabase the call must be amended accordingly. The subsequent calls open the database and createthe actual ̀ root’ object through which the ZODB isaddressed by the application.

Serialisable Python objects can now easily bedeposited in the ZODB:

root[`red’] = ̀ ZODB is cool’root[`blue’] = [`Perl’,’is’,’cool’]

Assignment only stores the objects in the ZODBtemporarily. In order to store them persistently –that is permanently – the transaction must be committed:

get_transaction().commit()

A transaction is an atomic operation and consists of

Listing 1: Pickling an object#Import the pickle moduleimport cPickleclass myClass:

def_init_(self,num,txt):self.num=numself.txt=txt

#Generating a myClass objectinstClass=myClass(212,’Python is cool’)fname=’instClass.p’#Serialising instClass into a filecPickle.dump(instClass,open(fname,’w’))#Open file with pickled object and#create a new objectnewinstClass=cPickle.load(open(fname,’r’))print newinstClass.num,newinstClass.txt

Listing 2: Opening a ZODB databasefrom ZODB import DB, FileStoragefstorage = FileStorage.FileStorage(`Data.fs’)db = DB(fstorage)connection = db.open()root = connection.root()

Page 53: linux magazine uk 13

PROGRAMMINGPYTHON

13 · 2001 LINUX MAGAZINE 57

a sequence of changes within the database. Thetransaction mechanism of the database ensures that either all changes are carried out or none. This guarantees data integrity between two commit calls.

After the data have been stored in the ZODB theycan, of course, be retrieved. Opening the ZODB isdone in the same way as the writing of data.

Reading the data is identical to using a dictionary:

print root[`red’] -> ̀ ZODB is cool’print root[`blue’] -> [`Perl’,’is’,’cool’]

Changes in the ZODB

The ZODB automatically recognises changes toobjects and also stores them, with one exception:changes to lists and dictionaries are not recognisedautomatically. That is true on a general level for allobjects that are described as mutable, orchangeable, in the Python philosophy.

Changes to a list or a dictionary must thereforenot be made using

root[`blue’].append(`a lot’)get_transaction().commit()

but instead require a new assignment of the object:

temp = root[`blue’]temp.insert(2,’not’)root[`blue’] = tempget_transaction().commit()

Persistent classes

Converting classes into persistent classes isparticularly easy. They simply need to be derivedfrom the class Persistence.Persistent. The process indetail is illustrated by the example in Listing 3.

As explained above, changes to mutable datatypes are not automatically recognised by the ZODB.In such cases alterations have to be explicitlyindicated to the database by setting the attribute_p_changed to 1. The ZODB will then update theobject accordingly:

class PLanguage(Persistence.Persistent)....def setAuthor(self,author):

self.authors.append( author )self._p_changed = 1

Outlook

The Zope extension Zope Enterprise Objects (ZEO)can be used to build a distributed ZODB, whichmeans objects can also be stored distributed.

This article shows how easy the ZODB is to useand that it represents a powerful tool for Pythondevelopers, which allows transparent objectpersistence while requiring little effort to learn andonly minor source code amendments.

Listing 3: creating persistent classes

import ZODBimport Persistenceclass PLanguage(Persistence.Persistent)

def __init__(self,lang,easy2learn):self.language = langself.learneffort = easy2learnself.authors = []

....languages = []languages.append( PLanguage(`Python’,’very easy’) )languages.append( PLanguage(`Perl’,’very hard’) )languages.append( PLanguage(`TCL’,’easy’) )zodb[`languages’] = languagesTCL = zodb[`languages][2]TCL.learneffort = ̀ not easy’get_transaction().commit()

InfoPython in practice: http://www.python.org/psa/Users.htmlZODB pages by A. M. Kuchling: http://www.amk.ca/zodb/M. Pelletier: ZODB for Python http://www.zope.org/Documentation/Programmers: Articles/ZODB1Zope Enterprise Objects (ZEO): http://www.zope.org/Products/ZEO

The authorAndreas Jung lives near Washington D.C. andworks for Zope Corporation (formerly DigitalCreations) as a software engineer in the Zopecore team. Email: [email protected]

Page 54: linux magazine uk 13

PROGRAMMING TEMPLATE TOOLKIT

58 LINUX MAGAZINE 13 · 2001

TEMPLATE FILE PROCESSING

JIM CHEETHAM

siteheader.tt2<?xml version=”1.0” encoding=”UTF-8”?><!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “DTD/xhtml1-transitional.dtd”><html>[% DEFAULT

title=”TT example site”papercol=”#ffffff”inkcol=”#000000”

%]<head><title>[% title %]</title></head><body bgcolor=”[% papercol %]” text=”[% inkcol %]”>

The Template Toolkit (TT) provides a metalanguage that can be inserted into otherwise

ordinary data files, allowing you to embed data processing instructions.

TT is a collection of Perl modules, and so you will needto have Perl on your system to use TT. Don’t worry thatyou need to understand Perl in order to use TT, though– the template language has been designed to beuseable by non-Perl hackers, and you can invoke itsimply from the command line.

Scope

TT describes itself as “a fast, flexible, powerful andextensible template processing system”. I won’t dwellon the speed aspect (TT will save you plenty of timeonce you’re using it) nor the full extensibility (which isachieved primarily through the internal use of Perl).

However, flexibility and power are TT’swatchwords. Originally designed for generatingdynamic Web content, TT is applicable to a muchwider range of tasks. For the purposes of examples in

this article, I’ll be describing a system for quicklybuilding a set of static Web pages, using thecommand line tools tpage and ttree.

Installing Template

The current version of Template Toolkit is 2.02, and it isavailable from the main website,http://www.template-toolkit.org.

For those of you used to Perl, it is also available fromthe CPAN archives, http://www.cpan.org. Install withthe normal cpan commands:

$ Perl -MCPAN -e shell cpan> install Template

The example website

Throughout this article, I will be providing examplesfrom a simple website. Because I’m keeping theexamples short, the website might look a littlecontrived, but I hope you can see the widerapplications of TT.

The site will consist of only a few files; initially wewill meet only index.html (which is the homepage)about.html which provides some contact details, andinfo.html, which provides some more informationabout the site.

To go with these files, we’ll use a couple of templatefiles, siteheader.tt2 and sitefooter.tt2. The exact namesof all these files is pretty much unimportant, and theextension (.tt2, .html) is doubly unimportant. I just tendto keep using file name extensions like this to help meorganise my files while I’m working on them, and theyare especially useful if you ever find yourself editingfiles in a Windows environment.

As the examples build up, more files and templateswill be introduced. The example site, and the codeused to produce it, can be found onhttp://tt.gonzul.net

The language

The TT language is embedded into your data files, andby default the TT commands are identified by [% and

index.html[% PROCESS siteheader.tt2 %]<h1>TT Example website</h1><p>Welcome to the example TT website</p><p>Have a look at the other site pages, and don’t forget to look at the source HTML code</p><ul><li><a href=”info.html”>Info</a> about the site</li><li><a href=”about.html”>Contact</a> information for the site</li></ul>[% PROCESS sitefooter.tt2 %]

Page 55: linux magazine uk 13

PROGRAMMINGTEMPLATE TOOLKIT

13 · 2001 LINUX MAGAZINE 59

%]. These can, of course, be changed in case theywould cause a conflict with your data – TT is flexible,after all. Taking the siteheader.tt2 file as our example:

The file is a fragment of HTML code – specifically, it’sthe document declaration, header and beginning ofthe body of an XHTML file. But don’t worry about thatat the moment, because I’m going to that part ofthings in a minute.

The <title> and <body> lines are interesting – theyshow what you will probably recognise as normalHTML lines of code, except that where you wouldexpect to find text (in the case of <title>) or values(<body>) you find a TT code reference to a variable.

Earlier on in the snippet there’s a section calledDEFAULT, which introduces values for the variables thatI’m using below. All the variables look like just plaintext – if you want to use real numbers for something(and potentially do some operations on thosenumbers, like addition or subtraction) you can, trustingthe underlying Perl system to Do The Right Thing andautomatically transform from text to numeric, andback again, according to context.

When this file is processed by TT, everything it findsbetween [% and %] will be replaced with the value TTcomes up with at the time. So, with the variable titleset to “TT example site”, the code

<title>[% title %]</title>

will become

<title>TT example code</title>

Notice here that the quote marks (“”) used to declarethe value of title have not been kept, nor have thespaces within the [% title %] section.

Using templates by name

Now, this siteheader.tt2 file isn’t very useful on it’s own– it won’t produce a valid HTML file, for a start. But Ican include it at the beginning of every “real” HTMLpage in my site, by using the PROCESS directive. Thereare a couple of other variations on this command,called INCLUDE and INSERT, but they don’t do quitewhat I want here. Have a look at the example site’shomepage, index.html.

Here I have a simple HTML file, but it doesn’t startwith <HTML> or even <BODY>, and therefore isn’treally a suitable homepage. Instead, it has a TTdirective at the beginning, [% PROCESS siteheader.tt2%]. Similarly, it doesn’t end with </body></html> asyou might expect, but it does have a TT directive toprocess the file sitefooter.tt2.

The PROCESS directive allows you to includeanother template into the current file, and it will keeptrack of all the variables that you are currently using.This will become clearer in the next example, but forthe time being let’s just see what happens to ourindex.html.

I’ll use the tpage command to actually process the

files. All tpage does is to read in the file you specify,and to run it through a Template instance within Perl,with the results coming out on STDOUT. If you want tosee a practical example of how to use Template fromwithin a Perl environment, start by having a look at theinternals of tpage – however I’m not going to coverthat aspect of Template Toolkit here.

You can see that above and below the actual HTMLcode from index.html, there appears extra HTML code,that is produced by the siteheader.tt2 andsitefooter.tt2 files. This code has been inserted into theoutput, and in the case of siteheader.tt2, the variablename references between [% and %] have beensubstituted for their values. So we now have simpleway to make sure that all our files have a consistentheader and footer, in just one TT command.

Now, if you actually wanted to look at this file in aWeb browser, you’d have to save this output, and putit somewhere sensible, then ask your browser to readthat file. But don’t worry about that just at themoment, because we haven’t met the extremely usefulttree command yet.

tpage$ <span class=”pcode”>tpage</span> index.html<?xml version=”1.0” encoding=”UTF-8”?><!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “DTD/xhtml1-transitional.dtd”><html><head><title>TT example site</title></head><body bgcolor=”#ffffff” text=”#000000”><h1>TT Example website</h1><p>Welcome to the example TT website</p><p>Have a look at the other site pages, and don’t forget to look at the source HTML code</p><ul><li><a href=”info.html”>Info</a> about the site</li><li><a href=”about.html”>Contact</a> information for the site</li></ul><div><p>Example site copyright &copy; 2001 Jim Cheetham</p></div></body></html>

info.html[% PROCESS siteheader.tt2 title=”Site Information”%]<h1>Information about the TT Example website</h1><p>The TT example website has been produced to illustrate the use of<a href=”http://www.template-toolkit.org”>Template Toolkit</a>when building static Web sites.</p><p>Have a look at the other site pages, and don’t forget to look at the source HTML code</p><ul><li><a href=”index.html”>Index</a> page for the site</li><li><a href=”about.html”>Contact</a> information for the site</li></ul>[% PROCESS sitefooter.tt2 %]

Page 56: linux magazine uk 13

PROGRAMMING TEMPLATE TOOLKIT

60 LINUX MAGAZINE 13 · 2001

So far our example hasn’t shown any of TT’s morepowerful features. PROCESS looks useful enough, butyou probably don’t want to have all of your pages withthe same <title> string, for example. Having multiplesiteheader files would defeat the object of using TT in

the first place, so how can we easily ask for variations?For the answer to this, have a look at the info.html file.

This file is almost identical to index.html, and youcan again see the usefulness of having standardPROCESS instructions to keep our site pagesconsistent. But for this page, we want to have adifferent <title>, so in the PROCESS statement wherewe call for the siteheader.tt2 template, we haveincluded the name and value of the title variable.When this gets processed by <spanclass=”pcode”>tpage</span>, we see the results asthe modified listing.

In this case, the <title> declaration in the codenow reads “Site Information”, instead of the default“TT example site”. This flexibility in variabledeclaration is a big feature for TT. The siteheader.tt2file does set it’s own value for title, but we are able tooverride it with the PROCESS line in info.htmlbecause it is defined within a DEFAULT block, whichonly sets values for variables if they have not beenalready specified elsewhere.

Similarly, it would be easy to alter the values ofpapercol and inkcol on a per- page basis, by includingtheir specifications on the relevant PROCESS lines.

Decisions, decisions...

So far the templates we’ve been using have beenpretty straight-forward, just setting and using values.TT starts to get more interesting when you encourageyour templates to make decisions (based on the valuesof variables) and produce different output in response.

Let’s have a look at a new Web page, menu.html,which uses the template menu.tt2 to present twodifferent variations of the same menu – a littlecontrived, perhaps, but you will see what I’mgetting at.

I’m also going to introduce you to some loopingcontrol statements, and list variables. It’ll sound easierwhen you see the examples in the menu.html file:

We’ve seen most of this before, the two PROCESSdirectives at the beginning and end are the same as inthe other HTML files. However, there are a couple ofnew things here. The first is the declaration ofmenuitems as a list of values, in a syntax that Perlpeople will be familiar with, and the second is the useof a PROCESS directive right in the middle of a table,twice. Each time menu.tt2 is called we are selecting adifferent value for dirn, the variable that determineshow the menu items will be presented. Now for a lookat the menu.tt2 template file:

There are a few familiar directives in this file, solet’s deal with them first. The DEFAULT block at thebeginning allows the template to set values for dirnand menuitems, in case the calling program did notspecify them. I’m not so sure how useful it is for atemplate to provide it’s own data, in menuitems. Itmight be better for the template to check to see ifmenuitems has been specified, and if not, to outputsome sort of diagnostic message. It’s a matter oftaste, I guess.

Modified Listing$ <span class=”pcode”>tpage</span> info.html?xml version=”1.0” encoding=”UTF-8”?><!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”“DTD/xhtml1-transitional.dtd”><html><head><title>Site Information</title></head><body bgcolor=”#ffffff” text=”#000000”><h1>Information about the TT Example website</h1><p>The TT example website has been produced to illustrate the use of<a href=”http://www.template-toolkit.org”>Template Toolkit</a>when building static Web sites.</p><p>Have a look at the other site pages, and don’t forget to look at the source HTML code</p><ul><li><a href=”index.html”>Index</a> page for the site</li><li><a href=”about.html”>Contact</a> information for the site</li></ul><div><p>Example site copyright &copy; 2001 Jim Cheetham</p></div></body></html>

menu.html[% PROCESS siteheader.tt2 title=”Menu example” %]<h1>Menu example</h1><p>This is an example of a list of values, used twice by the same templateand presented in two different ways</p>[% menuitems = [ “first”, “second”, “third”, “fourth”, “fifth” ] %]<table border=”1”><tr><th>Vertical Menu</th><th>Horizontal Menu</th></tr><tr><td>[% PROCESS menu.tt2 dirn=”vertical” %]</td>

<td>[% PROCESS menu.tt2 dirn=”horizontal” %]</td></tr></table>[% PROCESS sitefooter.tt2 %]

menu.tt2[% DEFAULT

dirn = “horizontal”menuitems = [ “firstitem”, “middleitem”, “lastitem” ]

%][% itemcount = 0 %][% FOREACH item = menuitems %]

[% item %][% itemcount = itemcount + 1 %][% IF itemcount != menuitems.size %]

[% IF dirn == “horizontal” %],

[% ELSE %],<br />

[% END %][% END %]

[% END %]

Page 57: linux magazine uk 13

PROGRAMMINGTEMPLATE TOOLKIT

13 · 2001 LINUX MAGAZINE 61

LinksThe example website, found athttp://tt.gonzul.netTemplate Toolkithttp://www.template-toolkit.org Perlhttp://www.Perl.orgCPANhttp://www.cpan.org

The ttree command

So far I’ve been running TT by using tpage on one fileat a time, which is fairly awkward and definitely noteasy to keep track of. It is time to move up to the ttreeprogram, which offers far more flexibility, and bydefault will process all of your files correctly.

ttree has a great configuration file, but Iunfortunately don’t have the space here to explain it –instead, try reading the extensive documentation thatcomes with Template Toolkit. When ttree first runs, itwill try to create a suitable config file, in your homedirectory by default, and you can go off and edit this tosuit yourself.

However, for our example we don’t really needanything more complex that the default config file. It isuseful to be able to specify the output directory forttree to be different from the input directory – butdon’t panic, ttree quite sensibly refuses to let them bethe same. So on the ttree command line we’ll specifythe source and destination directories, and we’ll alsomake sure that it doesn’t process the template files wehave, by asking it to ignore all files ending in “.tt2”.See ttree listing

ttree is your friend. I haven’t really been able to do itjustice here, beyond the simplest use, but it is anexcellent way to help you look after your TT source filesand get them built into the right place. It alsounderstands the modification date stamps on yoursource files, and will only process files that haveactually changed, next time you run it. This is bestappreciated when running on under-poweredworkstations, which is pretty much what everyone has.

You might remember from above the commentsabout tpage allowing what may seem like excessiveblank space to appear in your output files. Well, withttree you can request that TT eats up all that blankspace, with a series of options to the command thatlook like this:

$ ttree —pre_chomp —post_chomp —trim(everything else)

Then we set the itemcount variable to be 0. Thisvariable will be used to keep track of how far throughthe list of items we have progressed.

Now we encounter a new directive, FOREACH. Thisstatement sets up a loop construct, which intends tostep through each value in menuitems in turn, settingthe variable item to whatever the next list item is, eachtime. The end of the FOREACH block is indicated bythe [% END %] statement, and I’ve used indenting tomake it easier for the reader to match up the ENDstatement with the relevant beginning.

The first thing we do inside the loop is to output thecurrent list item value. Then we add one to the counteritemcount. Yes, there are lots of other ways of doingthis job, but let’s stick to the simple methods.

Now we have a decision to make. If we havereached the last item in the list, we just want to finish.You haven’t yet seen what we do if we’re in the middleof the list, so it may not be entirely clear why we don’twant to do it at the end of the list, but trust me for themoment, and read on.

The decision is made by the [% IF statement. It looksat the conditional, which is the statement “itemcount!=menuitems.size”, and decides whether it is true ornot. If it is true, in other words, if we are not on the lastitem in the list, then we can carry on down to the nextsection of code, otherwise the test fails and we ENDthe IF block.

There is a handy reversal of the IF statement,known as the UNLESS statement. Sometimes it’seasier to read your template code in a more naturalvoice when the test word is the opposite wayround. Template Toolkit (and Perl!) tries to be easyto use.

So, we’ve decided that we’re not yet at the end ofthe list. We’d like to put something between the itemsin the list, otherwise they’ll run together on the finaloutput. For the horizontal list, we’ll add just a “,”, andfor the vertical list, we’ll add a comma and a line-break, “,<br />” (Note that I’m using XHTMLstatements here, it’s good practice and won’t breakexisting browsers).

I’ll use a simple IF test on the dirn variable, to see ifit is equal to the word “horizontal”. If it is, we’lloutput just a comma, and if it isn’t, we’ll go for thecomma and line-break. Of course, with a test like thiswe’re not being very thorough - if someone had setdirn to a value like “sideways” they’d end up withvertical. You could change the test around to have adifferent default, or even allow a situation where youcould output the list with no delimiters when the dirnis not recognised.

When you get round to running this example, youmight be surprised to see lots and lots of extra, blanklines in the final output. This is a side effect of thedefault behaviour of TT, where it leaves the original fileuntouched outside of the [% ...%] blocks. Thisincludes the line endings after the %] sections, andcan be dealt with - but not with the simple tpageprogram. Hold your horses and wait for the ttreecommand, coming up next.

ttree listing$ ttree -d destdir -s sourcedir —ignore “.tt2$”ttree 2.03 (Template Toolkit version 2.00)

Source: ~/ttexamples/tt-website/source/Destination: ~/ttexamples/tt-website/example/Include Path: [ ./Websrc/templates, /usr/local/templates/lib ]

Ignore: [ \b(CVS|RCS)\b, ̂ #, .tt2$ ]Copy: [ \.png$, \.gif$ ]

Accept: [ * ]+ about.html+ index.html+ info.html+ menu.html- menu.tt2 (ignored, matches /.tt2$/)- sitefooter.tt2 (ignored, matches /.tt2$/)- siteheader.tt2 (ignored, matches /.tt2$/)- sitemap.tt2 (ignored, matches /.tt2$/)

Summary

This has been a brief overviewof the Template Toolkit’scapabilities, introducing basicinvocation methods and somesimple logic and flow-controldirectives. With just thesecommands, however, it ispossible to produce some quitecomplex static websitesrelatively quickly. Many of TT’smore powerful commands aremore suited to dynamic work,or to invocation from within aPerl program – which Idefinitely encourage you toexplore in the future! ■

Page 58: linux magazine uk 13

Are you frustrated by not having thedrivers for a particular piece of hardware?Then write your own! The aim of this bookis to teach you how to write device driversfor Linux. It is aimed at people who wantto experiment with the computer and attechnical programmers who need to dealwith the inner workings of a Linux box. Itcovers kernel hacking rather than quick fixuser-space applications and so is not forthe faint hearted. The main target of thebook is writing for version 2.4 of the Linuxkernel, but each chapter includes a sectionon backward compatibility. The bookcovers modularization; char devices;debugging techniques and advancedfeatures of char devices such as blockingoperations and time and memorymanagement in the kernel. Chapter eightcovers hardware with management of I/O

ports and memory buffers. These chaptersrequire the building of a simple testingdevice. Chapter 10 continues the writingof kernel software and covers portability.

The later sections of the book godeeper into modularization, block devicesand even more advanced aspects ofmemory management. Network interfacesare dealt with in chapter 14. The bookends with a guide to the overall design ofthe kernel source.

There is a good section on furtherinformation so that if your appetite hasbeen whetted by this book you cancontinue to develop your projects. ■

If you are interested in writing cryptographyalgorithms or just want to know how theywork then this is the book for you.Complete with a CD-ROM containing Linuxtested code, the book pulls no puncheswith mathematical formulae, starting withlow level programming of fundamentalmaths operation, the book expands toadvanced mathematical theories. With Cexamples at each step explainingmultiprecision arithmetic, the authorconcludes the opening section with C Linttesting routines.

The second half of the book deals withC++ and error handling. Full explanations ofthe RSA algorithm are used as a workingexample. The book concludes with theRijndael, the new American data encryptionstandard. Comprehensive appendices

separate out directories of functions for Cand C++. Due to the heavy mathematicalnature of the text, this is not a book for lightreading or dipping into, but the step-by-step path provides a rewarding challengefor the committed enthusiast.

The ready-made assembly routinesincluded on the CD, prove to be not justinformative but actually useful, and nowreside on my hard drive. If you werefascinated by “Fermat’s last theorem” andenthralled by tales of Enigma coding thenthis is the next logical step. Overall aworthwhile book for this important topic. ■

BOOKS REVIEWS

62 LINUX MAGAZINE 13 · 2001

ALISON DAVIES

Author: A Rubini & J CorbetPublisher: O’ReillyPrice: £28.50ISBN 0-596-00008-1

CRYPTOGRAPHYIN C AND C++

Author: M WelschenbachPublisher: ApressPrice: £35.50ISBN 1-893115-95-X

LINUX DEVICEDRIVERS

Page 59: linux magazine uk 13

BEGINNERS ANSWER GIRL

64 LINUX MAGAZINE 13 · 2001

In this issue, Answer

Girl gives an

introduction to version

control with CVS

(Concurrent Versions

System). After reading

this, when you see the

phrase check-in you

will no longer think

about air travel.

The Answer Girl

TEAMWORKPATRICIA JUNG

When you work on a source text for a long time,sooner or later the day will dawn when you wishyou could get back that section you deleted lastMonday. But deleted is deleted, and who doesn’tmake up their mind to do better next time?

Version control

Anyone who works alone and has a certain amountof staying power, may start off copying the latestversion (for example classscript-2.tex) at the start ofa session of work in a new file with a serial number(classscript-3.tex). Which version the one from lastMonday was, you can find out from the datedetails, which states ls -l classscript* as lastamendment date.

So then why not just include the date stamp inthe filename? With date a UNIX system supplies thelatest date and time details to your doorstep, afterall, and with the backwards-pointing invertedcommas, you can induce the shell, first to executethe command contained therein and then to usethe result in the complete command:

[trish@lunar answergirl]$ cp classscript.tex.U

classscript`date`.tex

cp: copying multiple files, but last argumU

ent (2001.tex) is not a directory

Try ̀ cp —help’ for more information.

cp is complaining that we want to copy more thanone file and the last argument 2001.tex is not adirectory (because several source files cannot becopied into a single normal file). 2001.tex? Thatlooks like part of the date statement:

[trish@lunar answergirl]$ date

Mon Oct 15 02:24:09 CET 2001

Now the scales fall from our eyes. The spacescount, for the shell, obviously as separatorsbetween arguments, so in cp as filenames. Withdouble inverted commas, though, the bash can bepersuaded that the spaces are part of theargument string:

[trish@lunar answergirl]$ cp classscript.U

tex “classscript`date`.tex”

[trish@lunar answergirl]$ ls -l classscU

ript*

-rw-r—r— 1 trish users 8967 OcU

t 15 02:25 classscript.tex

-rw-r—r— 1 trish users 8967 Oct 15 02:34U

classscriptMon Oct 15 02:34:04

CET 2001.tex

The drawback here: classscriptMon Oct 15 02:34:04CET 2001.tex not only looks ugly, but because ofthe spaces in the filename the file will force us morethan once to place its name in some command lineor other in inverted commas. So we would prefer afilename à la classscript_dd_mm_yy.tex or, in orderthat the files always appear nicely in the sequencefollowed in the calendar in the ls output-classscript_yy_mm_dd.tex.

As a glance at the date manpage shows, thisworks too. We just have to send date on its way withthe desired format placeholder following a plus:

[trish@lunar answergirl]$ mv “classscriptU

Mon Oct 15 02:34:04 CETU

2001.tex” classscript_`date +%y_%m_%d`.tex

-rw-r—r— 1 trish users 8967 Oct 15 02:U

25 classscript.tex

-rw-r—r— 1 trish users 8967 Oct 15 02:U

34 classscript_01_03_12.tex

The fact that the world ofeveryday computing, evenunder Linux, is often goodfor surprises, is a bit of atruism: Time and againthings don’t work, or not asthey are supposed to.Answer Girl shows you howto deal elegantly with suchlittle problems.

Page 60: linux magazine uk 13

BEGINNERSANSWER GIRL

13 · 2001 LINUX MAGAZINE 65

... and for the less conscientious

So you already feel ill at ease with all thiscompulsory thinking? You’re not the only one.And when it comes to working with co-author(s)on a manuscript, it’s not only the discipline thatgets difficult but also corrections. Who canguarantee me, after all, that my co-writer will notquietly remove the typing errors put in yesterdayfrom her version, while I am completelytransposing the sentences in precisely this chapterin my own version?

Not just to simplify the work routine, but also toavoid extra work, there is only one answer: therehas to be professional version management. If youare working with office packages or suchlike, whichstore your work in proprietary binary formats (suchas StarWriter), you will presumably fall back on thebuilt-in version control function. ASCII texts on theother hand can be managed effortlessly withversion managers, as used in large programmingprojects. The source code in a programminglanguage is after all nothing but text.

A search produces astonishingly little choice.While companies would still rather license thecommercial Perforce (http://www.perforce.com/),Open Source projects can ask for a free licence;the fully-functioning evaluation version allowsonly for two-person projects, it is not onlyoccasional version controllers who tend most tofall back on the tried and trusted ConcurrentVersions System cvs.

This also comes with most distributions. Thoseunable to find a suitable package would be bestheading for http://rpmfind.net/linux/rpm2html/search.php?query=cvs or for the source codehttp://download.cyclic.com/pub/.

Added on

So first to the installation- in rpm-based systemssuch as with a

[root@lunar software]# rpm -i cvs-1.10.U

7-1.i386.rpm

There it is then, the great unknown. A timid

[trish@lunar answergirl]$ cvs — —help

does not exactly warm you up with its lovely muddle.But a closer look at the chaos does then help:

Usage: cvs [cvs-options] command [comU

mand-options-and-arguments]

[...]

In order to use cvs, then, we must at least state cvsand then specify a CVS command afterwards. Inaddition, the behaviour of cvs can be altered bymeans of cvs-options, which must be specified

before the CVS command. To increase thecomplexity even more, each CVS command can alsobe followed by its own options and arguments.

After a nice deep breath, one of the next linesalso decrypts itself:

[...]

(specify — —help-commands for a liU

st of commands

[...]

In fact, cvs —help-commands outputs a wholerange of commands and under one or other we caneven get something of an idea:

[...]

init Create a CVS repositoU

ry if it doesn’t exist

[...]

init, that sounds like initialise, and to anyone whohas ever come across the term CVS repositorybefore in some open source project or other, thislooks like just what we want: create a CVS depot, inwhich we can put, or – check in – our files.

[trish@lunar answergirl]$ cvs init

cvs init: No CVSROOT specified! PleaU

se use the ̀ -d’ option

cvs [init aborted]: or set the CVSROU

OT environment variable.

If only it were that simple ... Luckily, the cvs manpageexplains the ominous option -d (“directory”) to us:

CVS OPTIONS

[...]

-d CVS_root_directory

Use CVS_root_directory as the root

directory pathname of the master

source repository. Overrides the

setting of the CVSROOT environment

variable. This value should be

specified as an absolute pathname.

So we are dealing with an option for the cvscommand (unlike an option, which relates to a CVScommand), which will have as argument thedirectory for our Depot. What matters here is: Wemust specify it with full path, for example~/cvs/linuxcourse/coursedocuments.

[trish@lunar answergirl]$ cvs -d ~/cU

vs/linuxcourse/coursedocuments init

cvs [init aborted]: cannot make directoryU

/home/trish/cvs/linuxcourse/coursedocuments:U

No such file or directory

All right, now we’ll just have to create the directory~/cvs/linuxcourse together with a parent directory~/cvs/ and try it again:

ASCII texts: Texts, whosecharacters are saved in the“American Standard Code forInformation Interchange”.This code in the 7-bit versionencompasses only thecharacters which are found onan American keyboard and afew control codes such as CR(Carriage Return) for Enter(originally from a typewriter)or LF (“Line Feed”) for a linebreak. In 8-bit ASCII, mostspecial characters fromlanguages with Latinalphabets can be coded. Butanyone wanting to write withCyrillic or Hebrew characterswill have to use other codingssuch as UTF8. Most of thecommon text editors in thiscountry use ASCII.

Full path: The route to a filestarting from the rootdirectory /. So the full pathleads to the program file/usr/sbin/groupadd via thedirectories /—>usr—>sbin andis therefore written /usr/sbin.Relative paths on the otherhand always start from thecurrent working directory. Ifthe full path to a program isnot listed in the environmentvariable PATH, it is not enoughto call up the name of thecommand. If the shell shouldacknowledge the commandcalls for groupadd, usermodand useradd with a commandnot found in the co-combatants box, thecommand with full path(/usr/sbin/groupadd etc.) willhopefully provide a remedy. Ifnot, the question arises as towhether these commands areeven installed.

Page 61: linux magazine uk 13

66 LINUX MAGAZINE 13 · 2001

BEGINNERS ANSWER GIRL

[trish@lunar answergirl]$ mkdir -p ~/cvsU

/linuxcourse

[trish@lunar answergirl]$ cvs -d ~/cvsU

/linuxcourse/coursedocuments init

No response this time, but in the best UNIX traditionthat should actually mean that everything has gonesmoothly. And so it has, ls ~/cvs/linuxcourse/coursedocuments shows that this directory hasbeen created and also contains anothersubdirectory full of very oddly named files, calledCVSROOT.

Now the started course documents just haveto go in there and there was something else –that’s right, I don’t want to do the workinvolving writing scripts and slides all on myown, so my co-author must also have access tothe depot. So as not to bore those who want touse their repository alone, the work stepsnecessary for this are shown separately in theCo-authors box.

Initial database

The CVS command overview lists, with

[...]

import Import sources into CU

VS, using vendor branches

[...]

a command, with which it appears to be possible toimport our initial database, which is currently in theworking directory ~/course, two directories scriptand slides each with a tex file and an illustration –oour depot:

[trish@lunar answergirl]$ cd ~/course

[trish@lunar course]$ cvs import

cvs import: No CVSROOT specified! PleaU

se use the ̀ -d’ option

cvs [import aborted]: or set the CVSROU

OT environment variable.

Obviously, if the depot is not specified with -d, cvscannot even know where the data from the currentdirectory should be imported to. But since we haveno inclination to keep typing in the endless -d~/cvs/linuxcourse/coursedocuments, we take toheart the last line in the error message and set theenvironment variable CVSROOT:

Co-authors

SecureShell: Safe substitutefor Internet services such asTelnet and RSH (“RemoteShell”), with the aid of whichone can work on remotecomputers as if sitting right infront of them. Datatransmission is encrypted whenyou do so. The SecureShellpackage usually comes with asecure substitute for RCP(Remote Copy) named scp.

Tunnelling: Using a servicevia a connection whichanother service makes. So forexample CVS packages can betransmitted repackaged intoSSH packages.

Anyone who creates a depot in their own home directory doesn’t wantthe co-author/s to be able to poke around in all the files in ~ (rootcould also pack it away somewhere else, for example into /home/cvs).

Classification

So the best thing to do is seize root and make a new group coursewith the Group number 101 not yet assigned in /etc/group:

[trish@lunar answergirl]$ su

Password: root-Password

[root@lunar answergirl]# groupadd -g 101 course

The maintainer of the CVS depot made should of course be includedby root in the new group. This is done by manually editing /etc/groupand obviously also with graphic user management tools. But beforewe start it as root, we’d be faster with a

[root@lunar answergirl]# usermod -G course trish

The capital -G here means: “Add another group to the other Groupsof which the user is a member”. A

[root@lunar answergirl]# groups trish

trish : users course

reveals that trish now, apart from belonging to the group users, is alsoa member of course.

New user[root@lunar answergirl]# useradd fred

then makes an Account for the user fred. If he is only to use this forCVS purposes, this was a little premature, since then he should belongexclusively to the group course.

[root@lunar answergirl]# usermod -g course fred

The small -g swaps the primary Group for fred comes to the rescue,instead of adding an extra group.

Then fred gets another new user password ...

[root@lunar answergirl]# passwd fred

New user password: password_for_fred

Retype new user password: password_for_fred

passwd: all authentication tokens updated successfully

..., the home directory pre-defined by useradd is made ...

[root@lunar answergirl]# mkdir ~fred

... and handed over (with the change-owner command fred becomesthe owner of his home, and course as primary group inherits the grouprights thereto):

[root@lunar answergirl]# chown fred:course ~fred

This means that root can now log out with exit. trish as CVSmaintainer still has however, one more task to do: The CVS groupcourse must be given read, write and in the case of directories,execution (and/or directory change) rights to the depot directory.When a check of the group rights shows that the rights are correct,but the name of the group is wrong, the command chgrp will help tocorrect this.

Page 62: linux magazine uk 13

13 · 2001 LINUX MAGAZINE 67

BEGINNERSANSWER GIRL

[trish@lunar course]$ export CVSROU

OT=~/cvs/linuxcourse/coursedocuments

So on to something new:

[trish@lunar course]$ cvs import

Usage: cvs import [-d] [-k subst] [-I iU

gn] [-m msg] [-b branch]

[-W spec] repository vendor-tag release-U

tags...

-d Use the file’s modification time

as the time of import.

-k sub Set default RCS keyword

substitution mode.

-I ign More files to ignore (! tU

o reset).

-b bra Vendor branch id.

-m msg Log message.

-W spec Wrappers specification line.

(Specify the — —help global option for a lisU

t of other help options)

So it’s not that simple or perhaps with so littleinteraction cvs insists that we tell it explicitly whatto call the depot (“repository”). The two

additionally required arguments vendor-tag andrelease-tags are fortunately not necessary forsimple version management, so that here we canenter any old thing.

The vendor tag, which is a sort ofidentification for the publisher of the data to beimported, then applies when one wishes tocontrol amendments to sources from thirdparties by CVS, which are not themselves to flowback to the publisher (because the latter doesnot feel the amendments are important, corrector general enough). If a new original versioncomes out, the release tag makes it possible todistinguish between the versions.

Whatever the case may be, a

[trish@lunar course]$ cvs import linuxcouU

rse trish v2001

alerts us, by calling up the vi editor (or the writeprogram stored in the environment variablesVISUAL or EDITOR), to the fact that it would like usto give it another short description of the data:

CVS: —————————————————————

tex-file: Text file consists ofcontent and TeX- or LaTeXcommands, which typify thestructure of the content. Usingthe text batch commands texor latex this becomes theactual portrayal of the ready-to-print file.

OwnershipSince files can only be given to groups to which one belongs, trish hasto log in again, only then does

[trish@lunar answergirl]$ chgrp -R courseU

~/cvs/linuxcourse/coursedocuments/

stop issuing error messages, because with the login process themembership data is refreshed. The -R in chgrp (just like chown andchmod) ensures that the owner’s details for~/cvs/linuxcourse/coursedocuments/ and all files/directoriesunderneath are altered recursively in a round-up.

Where there are several CVS user(s) with different primary groupsit’s worth bearing in mind another problem: Since trish belongs to thedepot directory, she can also check in data with her primary groupusers. But this would no longer be accessible for course-onlymembers such as fred.

This problem can be solved by providing the depot directory withthe s-right (“set group ID on execution”) for the group:

[trish@lunar answergirl]$ chmod g+sU

~/cvs/linuxcourse/coursedocuments/

[trish@lunar answergirl]$ ls -al ~/cvs/linuxcouU

rse/coursedocuments/

total 3

drwxrwsr-x 3 trish course 1024 Oct 7 00:31 .

drwxr-xr-x 3 trish users 1024 Oct 7 00:31 ..

drwxrwxr-x 2 trish course 1024 Oct 7 00:31 CVSROOT

This ensures that all data written into the depot directory is partof the group course, even if trish checks in with a differentprimary group.

Distant relationNow fred can log in to lunar, check out and edit the data in hishome directory there, but it is fairly unlikely that he will want to beonline the whole time he is working with the documents. Thewhole point of a revision control system is precisely that of co-ordinating the work of people who are working on severaldifferent computers.

Since fred now has a shell account on the CVS server lunar, he cannow easily tunnel his CVS queries via SecureShell. To do so, on hisInternet computer, he sets the variable CVS_RSH (CVS Remote Shell)on the command ssh (if necessary, also specifying path details):

[fred@fredsbox ~]$ export CVS_RSH=ssh

Naturally, he must also set his CVSROOT variable on the depotdirectory /home/trish/cvs/linuxcourse/coursedocuments. Since this ison the remote computer lunar.answergirl.co.uk, this becomessomewhat more complicated: Using the keyword ext he specifies thatthe depot can be found on an external machine, then follows theaddress of the depot computer with the username first, and finallycomes the destination directory.

To make it quite clear where each component ends, they areseparated from each other by colons. To allow cvs to proceed in thecertainty that the whole monstrosity is not just a somewhat odddirectory name, there must also be an initial colon:

[fred@fredsbox ~]$ exportU

CVSROOT=:ext:[email protected]:/hoU

me/trish/cvs/linuxcourse/coursedocuments

After that, fred can go online and check out the depot linuxcoursemade in the main text with cvs co linuxcourse.

Page 63: linux magazine uk 13

68 LINUX MAGAZINE 13 · 2001

BEGINNERS ANSWER GIRL

CVS: Enter Log. Lines beginning with ̀ CVU

S:’ are removed automatically

CVS:

CVS: —————————————————————

An o brings us in the case of vi to a new line andinto write mode, so that we can enter the text. Bypressing the Escape key we get into thecommand mode of vi and save and end our entrywith the sequence :wq. cvs now acknowledgesthe import with

cvs import: Importing /home/trish/cvs/linuU

xcourse/coursedocuments/linuxcourse/script

N linuxcourse/script/unixcourse.tex

N linuxcourse/script/tree.eps

cvs import: Importing /home/trish/cvs/linuU

xcourse/coursedocuments/linuxcourse/slides

N linuxcourse/slides/unixslide.tex

N linuxcourse/slides/tree.eps

No conflicts created by this importThis means the depot is now filled with data and

the data directory ~/course together withsubdirectories have each been enriched by adirectory named CVS.

In and out

It is now really easy to work with the data which hasbeen checked in. At the start of a work session a

[trish@lunar course]$ cvs update

cvs update: Updating .

cvs update: Updating slides

cvs update: Updating script

brings the data in the data directory up todate; now if you want to update only acertain subdirectory, simply change to itbefore the command.

If you have reached the end of a work unit, checkin the amendments to files in the respectivesubdirectories with (check in).

[trish@lunar course]$ cvs ci

cvs commit: Examining .

cvs commit: Examining slides

cvs commit: Examining script

Here again you will need vi knowledge to describethe amendment. And of course, individual files canbe “committed”:

[trish@lunar course]$ cvs ci slides/uniU

xslide.tex

CVS: —————————————————————

CVS: Enter Log. Lines beginning with ̀ CU

VS:’ are removed automatically

CVS:

CVS: Committing in slides

CVS:

CVS: Modified Files:

CVS: unixslide.tex

CVS: —————————————————————

Qualms? If you quickly want to back out now,simply stop the editor without making anyamendments. :q! in the command mode of vi willthen make cvs start whinging:

Log message unchanged or not specified

a)bort, c)ontinue, e)dit, !)reuse this meU

ssage unchanged for remaining dirs

Action: (continue)

An a confirms that we are serious about stoppingunlike a simple Enter, which checks innevertheless, and e, which brings us back intothe editor.

Fresh Data

New ideas in new subdirectories – sometimes inretrospect it turns out to be quite helpful to give theinitial passion for work some structure ...

[trish@lunar course]$ mkdir concept

[trish@lunar course]$ cd concept

If the concept, concept.tex is in this subdirectory, itshould also be checked in – only how, if it’s not yetin the depot?

[trish@lunar concept]$ cvs add concept.tex

No more variables to set, ever again

Login shell: The commandline interpreter seen afterlogging onto a virtual console,in most cases under Linux theBourne Again Shell bash. Thefact that a Bash becomes alogin shell is defined with theoption -login, so that in X-terminal programs under X11one can also get landed withlogin shells. If an echo$variablename should showthat a variable set in ~/.bashrcdoes not appear in the currentshell, then one is usuallydealing with a login shell,because in the Bash it doesn’tcare about the ~/.bashrc, butabout ~/.bash_profile. If youhave no success there eitherwith the variables set there (aslong as this is not due to thefact that errors slipped induring the setting), this haspresumably been blocked bythe Bash parameter -noprofile.The only remedy for this is todelve even deeper into thesystem or the previouslymentioned sources of thevariables shortly before use.

Setting the variable CVSROOT and in the case ofremote access to the CVS server CVS_RSH is notnecessarily something one wants to do again byhand in every new shell. Those wishing to accessjust one CVS depot have it easy: They enter theexport lines in the ~/.bashrc read out when startingeach bash or if applicable also in the initialisationfile for Login shells, ~/.bash_profile (at least whenthey are actually working with the Bash).

It gets more complicated when you are dealingwith several depots. Then it is advisable to writethe export lines into an otherwise empty text fileand to read these in before the first access to adepot of a specified shell with the command

source file_with_CVS-variable

to sources.

Page 64: linux magazine uk 13

13 · 2001 LINUX MAGAZINE 69

BEGINNERSANSWER GIRL

back no longer matched each other anyway, whilethe previously checked-in unixcourse.tex has beenedited in the script directory by nobody. In short: it isnow time to make a cut and update the system, tooverwrite unixcourse.tex with the content ofconcept.tex and to take concept.tex out of therepository. This is done with:-

cvs add: cannot open CVS/Entries for reU

ading: No such file or directory

cvs [add aborted]: no repository

... so that was not quite the right idea: Ofcourse, cvs is uncertain what to do with the file,since the subdirectory concept does not yetcontain a CVS directory. So it’s back onecommand or one directory ...

[trish@lunar concept]$ cd ..

... and one after the other:

[trish@lunar course]$ cvs add concept

? concept/concept.tex

Directory /home/trish/information/clasU

sscript/concept added to the repository

[trish@lunar course]$ cd concept

[trish@lunar concept]$ cvs add concept.tex

cvs server: scheduling file ̀ concept.teU

x’ for addition

cvs server: use ‘cvs commit’ to add thU

is file permanently

That appears to have worked, except that the file isobviously not inside yet. So we follow theinstruction to commit the new access too. Whetherto do this you use the long cvs command commit orthe short ci, the result is the same:

[trish@lunar concept]$ cvs commit

cvs commit: Examining .

CVS: —————————————————————

CVS: Enter Log. Lines beginning with ̀ CU

VS:’ are removed automatically

CVS:

CVS: Committing in .

CVS:

CVS: Added Files:

CVS: concept.tex

CVS: —————————————————————

oNew concept

ESC:wq

RCS file:

/home/trish/information/classscript/concU

ept/concept.tex,v

done

Checking in concept.tex;

/home/trish/information/classscript/concU

ept/concept.tex,v <— concept.tex

initial revision: 1.1

done

Reconstruction

concept.tex changed back and forth, once thestructure was in place, the file kept changing until itbecame the present course script. After some timeand a few work phases the names at the front andback no longer matched each other anyway, while

Pre-programmed conflicts?If several people are working on one document there is not a CVS server in the worldwhich can prevent amendments which one person checks in colliding withamendments which the other wants to commit somewhat later:

[trish@lunar linuxcourse]$ cvs commit

cvs commit: Examining .

cvs commit: Examining slides

cvs commit: Examining script

cvs commit: Up-to-date check failed for ̀ script/unixcourse.tex’

cvs [commit aborted]: correct above errors first!

Obviously here someone has also tinkered with script/unixcourse.tex, and thedepot contains a version which is newer than trish’s working version. This calls foran update:

[trish@lunar linuxcourse]$ cvs update

cvs update: Updating .

cvs update: Updating slides

cvs update: Updating script

RCS file:U

/home/trish/cvs/linuxcourse/coursedocuments/linuxcourse/script/U

unixcourse.tex,v

retrieving revision 1.2

retrieving revision 1.3

Merging differences between 1.2 and 1.3 into unixcourse.tex

rcsmerge: warning: conflicts during merge

cvs update: conflicts found in script/unixcourse.tex

C script/unixcourse.tex

cvs tries to get the amendment made in the meantime and trish’s new amendmentsunder one roof (to merge). If this works successfully, there is nothing else to worryabout, but if however as here it goes awry, trish must set to work in person and loadthe conflicting file unixcourse.tex into the editor again. This file has now beenamended in the meantime by CVS so that the conflict is visible and easily found formanual editing:

<<<<<<< unixcourse.tex

Summer course Information Oxford Uni

=======

Summer 2001 Oxford University

>>>> 1.3

Above is her own version, and below the current depot version. All that is left to dowith this is to remove the <-, =- and > lines and to merge the contradictory lines intoexactly the text which is now to be checked in, e.g.

Summer course Information Oxford Uni

Then all that remains is to check it in.

Page 65: linux magazine uk 13

70 LINUX MAGAZINE 13 · 2001

BEGINNERS ANSWER GIRL

[trish@lunar course]$ mv concept/concepU

t.tex script/unixcourse.tex

[trish@lunar course]$ cvs remove conceU

pt/concept.tex

cvs remove: scheduling ̀ concept/conceU

pt.tex’ for removal

cvs remove: use ‘cvs commit’ to remove thU

is file permanently

[trish@lunar course]$ cvs ci

There are now two challenges during check-in: Thenew content of unixcourse.tex wants to becommented (for example with concept.tex nowunixslide.tex), and in the documentation of theremoval of concept.tex, cvs kindly specifies thesame comment:

concept.tex now unixslide.tex

CVS: ———————————————————————————————————

CVS: Enter Log. Lines beginning with ̀ CVU

S:’ are removed automatically

CVS:

CVS: Committing in concept

CVS:

CVS: Removed Files:

CVS: concept.tex

CVS: ———————————————————————————————————

Once saved, we want witnesses to the amendmentsin the depot:

cvs commit: Examining .

cvs commit: Examining slides

cvs commit: Examining concept

cvs commit: Examining script

Checking in slides/unixslide.tex;

/home/trish/cvs/linuxcourse/coursedocumeU

nts/linuxcourse/slides/unixslide.teU

x,v <— unixslide.tex

new revision: 1.3; previous revision: 1.2

No Shell Access?

Attic: In directories with thisname CVS stores the contentand the history of files deletedfrom the depot.

PGP: “Pretty Good Privacy”,which is certainly thecommonest program forencryption and signing of emails and other data.

An account on a computer does not mean that it should also be used for all colleagues and friends topoke around in the system, for the use of Internet services or for filing data. On the contrary, there arelots of good reason to limit access to the CVS, without giving up the security offered by theSecureShell.

All the administrator of the CVS server needs to do is to put the public SSH-key of the CVS user ontotheir workstation. In a similar way to PGP these create a key pair on their work account, of which thepublic key can be given out as you like, but the private key must be kept a secret. This is done with thecommand which comes with the SSH packages ssh-keygen and was discussed at length in the Answer-Girl in issue 9.

ssh-keygen places the secret private key in the pre-set under ~/.ssh/identity. This must not bepassed on! What the CVS sysadmin would like is a text file named ~/.ssh/identity.pub and lookssomething like this:

1024 35 1650436685253880075036753018316341259121199915025267000291059581615422698465467725

722291087981529925297580740457070035732730200443808731123567242499042199399958562417180463

886282258629627912928659500834818993325398351812901126113547302151424173769600621465990430

65554089684980963002106747241282736545822186999 [email protected]

This one long line is transferred by the sysadmin into the file .ssh/authorized_keys in the home directoryof the user. fred’s public key thus ends up in ~fred/.ssh/authorized_keys on the CVS server.

The server admin has in the meantime poked around in the manpage on SecureShell servers sshdand, under the heading of AUTHORIZED_KEYS FILE FORMAT has stumbled across the fact that at thestart of a key line, it is possible to specify a command, which instead of a login shell is executedwhenever the corresponding user tries to log in with the appropriate private key via ssh.

So when fred comes via ssh with his cvs request, the CVS server should simply start and grant accessonly to the depot in ~trish/cvs/linuxcourse/coursedocuments. An appropriate CVS server is started withcvs server —allow-root=/home/trish/cvs/linuxcourse/coursedocuments, whereby the sysadmin only hasto place a command=”cvs server —allow-root=/home/trish/cvs/linuxcourse/coursedocuments” at thestart of the key line of fred’s public key:

command=”cvs server —allow-root=/home/trish/cvs/linuxcourse/coursedocuments” 1024 35 16504

366852538800750367530183163412591211999150252670002910595816154226984654677257222910879815

299252975807404570700357327302004438087311235672424990421993999585624171804638862822586296

279129286595008348189933253983518129011261135473021514241737696006214659904306555408968498

0963002106747241282736545822186999 [email protected]

What matters here is that the whole rat’s nest must be kept as a single line.

Page 66: linux magazine uk 13

13 · 2001 LINUX MAGAZINE 71

BEGINNERSANSWER GIRL

done

Removing concept/concept.tex;

/home/trish/cvs/linuxcourse/coursedocuU

ments/linuxcourse/concept/concept.teU

x,v <— concept.tex

new revision: delete; previous revisioU

n: 1.1.1.1

done

Now all that needs to be done is to delete the now-empty concept directory, and this is done for us by a

[trish@lunar course]$ cvs update -P

(“purge” - “cleanse”).

Nothing is forever

So the concept no longer exists. But here comesthe unexpected question: “Have you perhaps got aconcept for me?” We haven’t any more, but cvshas. All we need to do is remember at what pointin time the concept was a concept. Fortunately,CVS keeps painstaking books. And one caninspect these, using cvs log. The best way to dothis is if we don’t let everything rush by us, but bysending less:

[trish@lunar course]$ cvs log | less

With the less search command /concept we findtherein the comment on the renaming:

RCS file:

/home/trish/cvs/linuxcourse/coursedocumeU

nts/linuxcourse/slides/unixslide.tex,v

[...]——————————————

revision 1.3

date: 2001/10/15 21:57:53; author: triU

sh; state: Exp; lines: +1 -1

concept.tex now unixslide.tex

——————————————

Unfortunately, we are given no information as tothe former existence of the file concept.tex itself:Our fault – had we not deleted the empty conceptdirectory with its information in the CVSsubdirectory with the -P flag of update, we wouldnot be so helpless now.

In the worst case, you will now have to riflethrough the file tree of the CVS depot with less andls, until the appropriate Attic file to concept.tex(~/cvs/linuxcourse/coursedocuments/linuxcourse/concept/Attic/concept.tex,v) is found. In any case, weestablish that concept.tex must still have been inexistence on 15.10.2001 at about 21:55.

So if we adapt our database to that which wascurrent at that time:

[trish@lunar course]$ cvs update -D “200U

1-10-15 21:55:53”

cvs update: Updating .

cvs update: Updating slides

U slides/unixslide.tex

cvs update: Updating script

U script/unixcourse.tex

Unfortunately, concept.tex is not there.

[trish@lunar course]$ cvs update — —help

update: invalid option — - —

Usage: cvs update [-APdflRp] [-k kopt] [-U

r rev|-D date] [-j rev]

[-I ign] [-W spec] [files...]

-A Reset any sticky tags/date/kopts.

-P Prune empty directories.

-d Build directories, like checkouU

t does.

[...]

... was not all that wrong: Although there is nosuch option as — —help, cvs spits out precisely whatwe need: aid for the cvs command update. Theoption -d looks promising and that’s also how itturns out: update does in fact normally only updatefiles already checked out, but when one saysupdate -d, it is a bit more willing to co-operate andalso creates directories which are missing from theworking data directory.

[trish@lunar course]$ cvs update -dD “200U

1-10-15 21:55:53”

cvs update: Updating .

cvs update: Updating slides

cvs update: Updating concept

U concept/concept.tex

cvs update: Updating script

Now we have got concept.tex back and canprint out the concept. So that you do not firsthave to consult the CVS book mentioned in thebox “More documentation on cvs”, I can revealto you now that the ominous -A flag in theupdate command is the only option for gettingan up-to-date working copy withoutconcept.tex:

[trish@lunar course]$ cvs update -A

cvs update: Updating .

cvs update: Updating slides

U slides/unixslide.tex

cvs update: Updating concept

cvs update: warning: concept/concept.teU

x is not (any longer) pertinent

cvs update: Updating script

U script/unixcourse.tex

Whether you now wish to delete the conceptdirectory, using -P, is entirely up to you. ■

More about cvsAnyone who is in utter despairwith the documentationsupplied with CVS, should notgive up. At http://cvsbook.red-bean.com/ can be found theGPLed section of Karl Fogel’sCVS book for online browsingor downloading. Since thisAnswer Girl can in no wayprovide exhaustiveinformation on CVS, it isrecommended as furtherreading for all those who’vetasted blood.

Page 67: linux magazine uk 13

BEGINNERS KORNER

72 LINUX MAGAZINE 13 · 2001

Who says there is no place for gossip and scandal in a Linux magazine?

K-splitter broadcasts the latest news from the K-World and noses

around here and there behind the scenes.

FAIRGROUNDSTALL OR

MONK’S CELL?STEFANIE TEUFEL

Up close and personal

Where there are lots of options, there is greatconfusion. The more the KDE project grows, the morecomprehensive the configuration options become.

That does not exactly make life simple for newusers, which is why a new tool is now being workedon feverishly, the so-called Kpersonalizer. This issupposed to start from KDE 2.2 on first login of theuser and accompany them through their first stepsthrough the desktop configuration jungle (Figure 1).

Adaptability with respect to the look and feel ishighly sought after. So should anti-aliasing beused for fonts and icons or not? The user can decideby a mouse click whether KDE should behave likeWindows – whether the desktop responds todouble instead of single clicks, or whether KDEshould take after the good old UNIX type.

What may be even more interesting is the alsointegrated Eyecandy-O-Meter (Figure 2). Here one

will be able in future to choose – depending on thecomputer equipment – between a multicolouredfairground stall or a Spartan monk’s cell; at leastwhen it comes to graphical effects. Simply move theslide controller in the respective direction, the rest isdone by KDE.

But there will be no support for the installation ofprinters and similar inconveniences. Because thedevelopers fear that some distributor or othercould, due to the differences between distributions,quickly and comprehensively deactivate the newconfiguration tool.

Making a facsimile of himself...

... is not something Michael Goffioul has beendoing, although he is making a good few waves inthe KDE Project. First he came up with the printlibrary for KDE 2. Then he expanded this by variousprint back-ends, and lastly he enhanced the KDE 2

K-splitter

Figure 1: Start at the beginning Figure 2: Fairground Stall or Monk’s Cell?

Anti-aliasing: Aliasing refers tothe stair effect at the edges ofgraphics, especially of text orlines, which arises because it isonly possible to display trulystraight lines with pixels if theyare horizontal or vertical. Thesolution – inserting shadingpixels into the steps – is calledanti-aliasing.Library: A file containing acollection of useful C functionsfor specific purposes. So forexample there is libm, whichprovides mathematical functions,or libXt, containing functions forprogramming the X11 windowsystem. Often libraries are utilisedby several programssimultaneously (shared).MIME: This abbreviation standsfor Multipurpose Internet MailExtensions, a method ofspecifying standardised filetypes. Examples of MIME typesare text/plain (pure text filewithout formatting) orvideo/mpeg (MPEG-compressed video stream).MIME is used primarily in mailprograms or Web browsers.Normally this data is stored in afile named mime.types.

Page 68: linux magazine uk 13

BEGINNERSKORNER

13 · 2001 LINUX MAGAZINE 73

printworks by fax and PDF support. But as if thatwere not enough he has now come up with thelittle tool KdeprintFax, with which it is possible tosend a fax directly from any KDE 2 application.

The rather sad background to this gladdevelopment: The program Ksendfax which used toexist has, like so many other small, but usefulprograms, not been ported to KDE 2.

The main features of the new fax maker are EFaxsupport and Hylafax support, and also an in-built filtermechanism, which converts any file type, beforesending, into PostScript format. The usual externalprograms act as filters here, which are freelyconfigurable within the fax utility and can be definedfor every MIME type. One nice side effect:Documents that you want to send by fax need only bedragged into the main window using drag and drop.

Goffioul has already integrated the source codeof the program into the existing CVS tree. Whether,and to what extent, the program will make it intothe next major KDE release (2.2) had not yet beendetermined when we went to press.

A thesaurus for KWord

KWord development is gathering pace. In order tomake it more attractive for users to change overfrom their usual word processing programs suchas Word or StarOffice the developers areconstantly coming up with new ideas. The latestidea stems from Daniel Naber, who presents apatch on the developer list which serves toexpand KWord in the near future by a thesaurusbased on Wordnet.

The substantial, 13MB, size of the downloadfrom http://www.cogsci.princeton.edu/~wn/ andworries about the free distribution of Wordnethave now led to a search for alternatives. Underdiscussion is, among others, Kdict.

All bets are off

KDE games are growing up. This has apparentlybeen noticed by the makers of the GGZ GamingZone, a free alternative to Microsoft’s Gaming Zone,because part of their new release 0.0.4 is for thefirst time a KDE front-end. As on other onlinegaming sites, players can log on to the Gaming

Zone and then play against other users orcomputers. GGZ offers, among other things, variouslevels of difficulty, chat rooms and statistics – and allare available now in the usual KDE look and feelthanks to the new KDE client.

At present there are just three KDE games, but bythe time the next release comes out their numbershould have doubled. In order to avoid duplicates,the makers of the Gaming Zone want to workclosely with the people from the KDE games project.

Further information and the latest gossip fromthe world of GGZ gaming can be found by hobby-gamblers at http://ggz.sourceforge.net/. Andanyone who would like not only to play, but also tomake a real contribution to the further expansion ofthe project, can lay down their suggestions andoffers of assistance at any time at [email protected]

Figure 3: The new miracle weapon in printing

Figure 4: Tic Tac Tux

CVS-Tree: Especially when many developers are working on a software project, itis necessary to have a procedure which prevents anyone overwriting changesmade by their co-programmers by mistake or destroying the only working version.Many projects therefore use a Concurrent Versions System. It is also possible atany time to reconstruct an older development version from a CVS file tree, butobviously it is most often used to hold the latest program code. The Answer Girlin this issue gives an insight into the construction and use of a CVS depot.

Wordnet: Work began on the Wordnet project in 1985 and is still going on.Those working on development are mainly psychologists and linguists from theUniversity of Princeton, USA. Wordnet is a sort of online lexicon. The structure ofthe lexicon is in line with psycholinguistic theories about human memory, unlikethe more usual lexicons, which are organised according to alphabetical order orinto classes of synonyms. Wordnet is not restricted to a specific area and currentlyconsists of over 95,600 different English word forms. One of the most importantcharacteristics of Wordnet is that for any given word, a distinction is madebetween the word form and the meaning of the word. The meaning of the wordis represented here by a number of synonymous word forms. This thesaurus ismainly recommended as an aid to composition when one wishes to write anEnglish text.

Page 69: linux magazine uk 13

BEGINNERS KORNER

74 LINUX MAGAZINE 13 · 2001

In this column we present tools which have proven to be especially useful

under KDE because they solve a problem, or are just some of the nicer

things in life, which – once discovered – you wouldn’t want to do without.

K-tools

RIGHT INTO THE NET

STEFANIE TEUFEL

In this issue, we want to show you an especiallyeasy way to connect to the Internet withQtWvDialer. This is a simple graphical front-end forthe useful tool WvDial.

The charm of the original program lies in the factthat it automatically finds and configures yourmodem, after which, without further ado, it makesa PPP connection to your ISP. All you need is yourusername, password and telephone number – therest is done by your dial-up assistant.

With all these WvDial mechanisms comesQtWvDial – and many features along with it: asummary of the PPP connections that have beenmade for example, or a configuration editor.

Hand it over

You will also need one or two files. Firstly, of course,the latest version of the program itself is required.You can download it from author MatthiasToussaint’s homepage athttp://private.addcom.de/t/toussaint/qtwvdialer.html. You will also need tmake from the Qtdeveloper company Trolltech (at ftp://ftp.trolltech.com/freebies/tmake/) and of course WvDial. Thisshould actually already be on your disk, since mostof the latest distributions come with this handydialler. If you are not sure, you can check, in thecase of rpm-based distributions, with a

stefanie@diabolo[~]> rpm -q wvdial

wvdial-1.41-12

Had no luck finding it? No matter, the necessaryfiles are available at http://www.worldvisions.ca/wvdial/.

If you haven’t installed tmake yet, you shouldmake up for lost time as soon as possible. To do this,all you have to do is unpack the tarball and then seta couple of environment variables. For Bash users itlooks like this:

TMAKEPATH=/path/to/tmake/lib/linux-g++

PATH=$PATH:/path/to/tmake/bin

export TMAKEPATH PATH

Then unpack QtWvdial, and change to the directorythat has been created. Now all you need do is entera ./configure and send a make after it – done.

A little tip for users of an Nvidia chip: If you haveinstalled the Nvidia OpenGL driver and Qt has beencompiled with OpenGL support, there could beproblems. But the author has also made provision forthis. If this happens, call up ./configure with --nvidia.

That’s all there is to it. In the bin subdirectory youshould now find an executable file qtwvdialer,which you can copy into any directory you like inyour search path (say /usr/local/bin).

Getting friendly

After installation, start the program as root byentering a qtwvdialer & in a terminal emulation ofyour choice. You will then be confronted by awindow as in Figure 1, in which your new friend willtell you that he has made a directory for you. Fromnow on you will find the settings and the monthlylog files there.

After clicking OK on your way into the network ofnetworks please make one quick stop over in the mainwindow of QtWvDial because it’s time to enter theInternet. To do this, click on the little screwdriver icon.

Terminal emulation: Themain purpose of a terminalemulation is to act, under agraphical user interface, as asubstitute for the virtualterminals, between which youcan hop merrily back and forthunder Linux by pressing Altand Fx. This consolereplacement allows you to useprograms that were reallyintended for the commandline under X.

■ Figure 1: Informative

Page 70: linux magazine uk 13

BEGINNERSKORNER

12 · 2001 LINUX MAGAZINE 75

You will then be greeted by a window as inFigure 2, which challenges you to turn to themodem configuration. Don’t worry, a click on theOK button automatically opens the necessarywindow (Figure 3).

Click on the button Run wvdialconf. The programthen immediately starts to search for a modem onyour system. This could take a few seconds, but inthe end your patience will be rewarded with aresult, as in Figure 4. Now you have to provide thetool with your access data. To do this, click onAccount and then on the Add account button. Inthe window (Figure 6), which pops open, QtWvDialasks you to give a name to the access. Do as herequires and then click on OK.

Now all you need to do is enter the appropriatedetails in the boxes Phone number, User name andPassword (Figure 5). That’s all there is to it, at leastfor this account.

If you dial up the Net using various providers, you

will have to define additional accesses with differentdata. You can play around with the functionalitiesof the program if you like using the QtWvDial tab.There are preset advisories for making your PPPconnection or logging the duration of a connection.All really useful, so there’s no reason to alter thedefault settings.

There is one other interesting option that wewould like to point out to you. If you have activatedthe Start program after connect box, KDE’s diallerautomatically starts a program of your choice afterdialling. The default is Netscape. If you would rathersurf the Web with Konqueror or Opera, obviouslythis can be changed at any time.

Onto the Net

After all this configuration kerfuffle, at last you’re inbusiness. To dial up the Internet, fish out theappropriate account in the drop-down menu in themain window and then click on Connect. You canthen calmly observe the process of logging-on toyour provider in a window.

Once connected, the graphs in the lower part ofthe connection window (Figure 7) show you thethroughput rate of your current connection. It’sreally interesting to see what’s trickling through thewires. If you want to end the connection, just clickon the Disconnect button, and QtWvDialimmediately cuts you off from the Internet.

Anyone who wants to risk a cautious glance atthe time he has actually spent on the Net, can clickagain on the screwdriver icon after ending the PPPsession and select the Logfile tab. This gives you theactual connections to the network of networksarranged by month and neatly separated intoaccounts (Figure 8). And if the sight of this gives youtoo much of a headache, you can delete all the logfiles by clicking on the Clear logfiles button. ■

Figure 2: We did warn you

Figure 3: Dive in to the joy of configuration!

Figure 4: Sinking the shot

Figure 6: You know best when itcomes to your access data

Figure 5: I who know nothing

Figure 7: Enoughjuice on the line?

Figure 8:Logged andfiled

Page 71: linux magazine uk 13

BEGINNERS DESKTOPIA

76 LINUX MAGAZINE 13 · 2001

At first glance, the XFce desktop might remind the

old UNIX hands amongst you of CDE (Common

Desktop Environment). But XFce’s nippy, easy-to-use

interface also supports some modern features.

XFCEJO MOSKALEWSKI

When it comes to posing almost any question, inthe world of the UNIXes you’re spoilt for choice.There are usually several programs to choose fromthat can solve your problem. The same goes forgraphical user interfaces: All distributors agree thatthis choice must be made easier for the user, andjust install one of the two big desktop environments– often without even asking if they are required. Butas a general rule, the distributions also have a fewother pearls, which have no need to hide behindpowerful interfaces. One of these is XFce.

echo $HOME

If there is no XFce on one of the silver discs from thedistributor, we will be happy to help out: On thecover CD you will find what is, at the time of goingto press, the latest version 3.8.3 – but by the timethis issue hits the streets, this could be out of date,

as the development of XFce is anything but slow. Inthe six weeks it took for these lines to be preparedand typed, four new releases came out. During thisperiod, not only were bugs corrected and detailsimproved, but also all kinds of sensible innovationswere implemented. If you like things up to date,take a look at http://www.xfce.org/. Unlike thepackage jungle of interfaces of a similar type, thepeople at XFce bundle absolutely everything into asingle package, which at 3.4MB is not too big fordownload (for the source texts), just to try thisenvironment out. “Can’t be much in it”, we hearsome of you mumbling. Well, the ready-compiledsource code at 38Mb proves to be an asset, andcomes up with an impressive list of features:

● Modest hardware requirement ● Easy-to-use window manager “xfwm” ● Session management ● Front-ends for all options: No editing of

configuration files necessary (although this ispossible if a simple text format is used)

● Drag and drop ● Panel with program starter and clock ● Integration into KDE and Gnome menus ● Virtual desktops including pager ● Theme-capability including creating themes (also

for general X-applications, especially Gnome andGtk programs)

● XFTree file manager ● System sounds with XFSound ● Manager for background images ● Gnome-compatible ● XFGlob search tool ● Recycling bin ● Tool to mount drives ● 19 languages ● Support for Xinerama (multi-monitor operation)

Jo’s alternative desktop

Figure 1: A first look

Page 72: linux magazine uk 13

BEGINNERSDESKTOPIA

13 · 2001 LINUX MAGAZINE 77

On your marks

Installation means simply playing in the RPMpackage from the cover CD with rpm. If you wouldprefer to use the sources, you will need a few (notvery spectacular) developer packages, which arelisted in the INSTALL file included. Once XFce is onthe hard disk, every user will also need an initialconfiguration. Here again the XFce developers havedone all the work, and a simple xfce_setup (typedon the console or in XTerm) arranges things so thatin future both in the graphical log-in, as well aswhen starting X via startx, XFce will fill the monitor.An xfce_remove can revive any settings which havefallen victim to the set-up. Users with a bit moreexperience might not necessarily entrust their homedirectory, including painstakingly created start files,to a strange set-up tool – so they should simply callup the window manager xfwm, which will also startthe entire environment automatically. XFce will notmake the existing configuration files; but those thatalready exist will not be touched, provided theyweren’t created by Xfce. The Gtk themes inparticular will have only a limited function. XFce isthus very easy and safe to implement – except thatupdating from a version before 3.8 means gettingrid of old configuration files.

If you want to explore the newly-created desktopworld in person and gets stuck, would be welladvised to consult the concise but adequate Users’Guide at /usr/(local/)share/xfce/help/help.html.Unfortunately this has not been updated sinceVersion 3.7, but it is still valid. But let’s slowly feelour way through this desktop environment:

Striking ...

...is the word for the main panel on the bottomedge of the screen. This is not – as is the custom ofmany other desktops – firmly anchored in position,but can be moved anywhere on the striped areas onthe desktop with the mouse. The little button onthe far left ends the X-session in the same way asthe Quit button in the central area. Both do theirduty, but never without first consulting the mouse.The really small button minimises the main panel, asif it were a completely normal program (which isbasically what a panel is). A single mouse click on anicon starts the associated program – and these iconslead to drop-down menus, from which additionalprograms can be started. One nice feature is thelower bar in these drop-down menus: This can beused to separate a menu permanently and positionit freely on the desktop.

New to the panel is the option of selecting thenumber of icons and menus (a maximum of 12 isprovided, which should be enough for any userprofile). Equally, both the size of the icons as well asthe display of the menus can be selected in threestages, making XFce more flexible than ever andmeans a major steps towards the declared objective:

that of being able to work unhindered in a modernenvironment even on less powerful computers.

Set up

Each start entry can be configured by right-clickingon it. If, on the other hand, the main panel itself is tobe configured, the icon with the colour palette helps:This is where the XFce set-up is hiding. Unfortunatelyit is not yet possible to configure the entire desktopfrom here, and so in the menu over the icon for themouse settings a few more tools can be found – suchas for system sounds and background graphics.

Following suit ...

...is allowed in the first tab of the set-up dialog;bearing the title “Palette”, in this case meaningthemes. The Load ... button allows you to chooseone of the 73 themes supplied. Also of interest inthe colour settings is the entry Apply colors to allapplications – this makes basic settings via theXresources, which are used by many X-programs(but not by KDE or Gnome programs, where theGnome solution is also used in XFce). Anyone alsowishing to use the XFce themes for Gtk applications(such as Gnome software), should have created theuser’s own start files (as described above) viaxfce_setup, or deleted or renamed ~/.gtkrc. Thisonly leaves out the KDE applications. The eightcolour zones in the set-up dialog offer an ingenious

Figure 2: The mainpanel – includingripped off menu

Figure 3:Themes onrequest forthe Navigator

Page 73: linux magazine uk 13

BEGINNERS DESKTOPIA

78 LINUX MAGAZINE 13 · 2001

system for displaying your own taste in handling thecolour palette – anyone who has ever tried to maketheir own Gtk theme any other way will certainlyappreciate these splashes of colour.

The second tab concerns XFce itself. If you wantto use your own colour settings for each desktop(and no background graphics), activate the firstmenu item Repaint root Window of Workspace; thecontrol button with the heading Panel Layer ensureson request that the main panel cannot be drownedout by other applications so easily.

Window master

It only starts to get interesting in the third tab,which concerns the behaviour and appearance ofthe window manager xfwm. Both Click to focus andAuto raise are on offer – the latter unfortunatelywithout configurable time delay (which is the onlyfailing of this window manager). Other featuressparkle. So for example there is a choice of threewindow decorations – XFce, Mofit (no typingerrors!) and Trench, which extend from thecompany’s own look via the classic Linux desktop upto the flair of an Apple Macintosh.

When the windows are moved, they dock withother windows and on the edge of the screen. Thismakes it easier to position a window. The handlingof the virtual desktop is also really nice in the

window manager. To toggle between them, thereare several options:

● via the XFPager (by default in the top left corner), ● via the main panel, ● with a click on the middle mouse button, ● or else by deliberately pushing the mouse beyond

the edge of the screen.

If a window is intended to follow the journey of themouse, it can simply be pinned firmly with the circlesymbol in the toolbar. Another nice feature is thateach virtual desktop can be assigned its ownbackground. And if there is a shortage of space, thewindow can be minimised, not just as a traditionalicon, but also onto its toolbar – either via anotherbutton in the toolbar or by a right mouse click on thetoolbar. KDE and Gnome menus can be found withthe left mouse button on the free desktop, while themiddle mouse button always keeps the functions ofthe active toolbar to hand. And if, despiteeverything, an application can no longer be foundon the desktop (or if this has been covered by a hastyAuto raise), the right mouse button can help.

...and its subordinates

The last tab in the set-up dialog integrates theadditional tools of Xfce. If you’d rather be sparingwith resources, you can completely deactivate thesystem sounds there (and if you change your mindabout this in the meantime, simply start these – likeany other tool in XFce - manually in “main panel”).

Things are somewhat trickier when it comes tothe implementation of the Backdrop Manager – bymeans of which graphics instead of colours (orcolour runs) can be set as desktop background.Unfortunately this cannot cope with virtualdesktops, and so it is only possible to set onegraphic for everything. So if you now, whenswapping over to another virtual desktop, suddenlycome across a single colour, the box marked Repaintroot Window of Workspace, in the set-up dialog,should be deactivated.

Figure 4: XFce’s standard window frames Figure 5: Windows in the Mofit design Figure 6: Trench Look

Figure 7: System sounds

Page 74: linux magazine uk 13

BEGINNERSDESKTOPIA

13 · 2001 LINUX MAGAZINE 79

Workhorse

Another important little helper is the file managerXFTree, included as standard. When you start it, youmay be disappointed by its lean appearance, yet atsecond glance this is a distinct advantage: It can dodrag and drop, and this means that not only canyou use the two file lists familiar to numerousNorton Commander clones for this, but also open athird file list in the form of a third window – idealfor tidying up. The concept also corresponds to thelatest trend: Only one directory tree is shown, inwhich the files are incorporated (and not just a filelist with the directories in the current path). Dragand drop does not, however, function between thewindows of the file manager. Instead, a text file canbe dragged onto the editor icon of the main panel,in order to open it. Since XFce likes to use currentstandards, drag and drop also functions from a fewother file managers – such as from GnomeMidnight Commander or KDE’s Konqueror. XFTreedoes not appear to be completely finished whenfiles are opened via the file name extensions: If aprogram other than the preconfigured one is to beused here, this has to be stated manually in theconfiguration file ~/.xfce/xtree.reg.

A good nose

You won’t need Dr Watson in XFce, but once thejourney of adventure does begin through theleftovers from past computer activities, there is ahandy search tool at your disposal with XFGlob.The search can be narrowed down, not only by thepath or via file name filters, but also via the filecontent or the file type, as well as a number ofother options.

Session management

XFce is meant to be an environment – so far we canrecognise the usual features of an environment suchas the consistent look and feel (achieved by the useof GTK and overarching themes), drag and drop (for

which first and foremost the file manager isresponsible), in addition to a well co-ordinatedcollection of tools. There isn’t any sessionmanagement yet, which is always active andunnoticed in XFce. If, when shutting down XFce, anXTerm window is left behind, this is opened again atthe next start in the same place. Everything is stillwhere it was left, making an autostart functionpointless. XFce is a great success – as things standnow, the desktop user lacks for nothing. It has speedand stability combined with clean problem solutionsand a huge dollop of comfort. It’s a long time sinceXFce was a secret tip, even if the installation routinesof many distributions allow you to think so ■

Figure 8: Backdrop Manager

Figure 9:Copying

between twoXFTree windows

Figure 10: XFGloboffers a wide rangeof search functions

Page 75: linux magazine uk 13

BEGINNERS GNOMOGRAM

80 LINUX MAGAZINE 13 · 2001

Each month we sift through Gnome

news and tools and present you

with a digest of all things Gnome.

Gnome News and Programs

GNOMOGRAMBJÖRN GANSLANDT

A Gnome in the Sun

Sun is now offering, Gnome 1.4 packages forits own operating system Solaris. At

present Sun is still presenting thepackages as a preview, buteventually Gnome will supersedethe antiquated CDE. As a member

of the Gnome Advisory Board,however, the activities of Sun are not

limited to porting onto Solaris. Sun isalso heavily involved in making Gnome

accessible to disabled people, and iscollaborating on compilation, documentation,session management and Gconf. Not least, theoffice package Open Office (formerly StarOffice)

from Sun is being adapted to Gnome. Anotherproject involving Sun is the verification of theGnome 2.0 architecture according to Sun’s owncriteria. To this end, the 20 Questions questionnairewill be applied to the individual components of thesystem in order to improve stability and quality.

Gnome 2.0 Schedule

The first schedule for Gnome 2.0 can be found atgnome.org, which should be completed inDecember. But there is some doubt as to whetherthe target date can be met. It doesn’t exactlyinspire confidence when the developers argueamong themselves over Gnome 2 – although itcertainly wouldn’t be the first time a Gnomerelease was delayed.

Ximian and Swarmcast

Miguel de Icaza, co-founder of Ximian, hasannounced that he would be interested inintegrating Swarmcast into the Red Carpet packagemanager. Swarmcast is a system from Opencola,

Lightspeed

Even if it’s not possible to accelerateobjects of more than elementary particlesize to the speed of light, we can stillsimulate the optical effects that wouldarise if it were. Lightspeed (Figure 1) iscapable of importing 3D objects fromLightwave or 3D-Studio and bringingthese to various virtual speeds. Thissometimes gives rise to effects similar tothose with sound – the Doppler effect forexample. The object also shortens alongits axis of motion and becomes veryblurred. This blurring is due to the factthat more distant points are perceived asif they were nearer. These and other effects can be activated individually, and the virtual camera canbe turned and moved at will in space. Since the real-time display is incorrect, especially when it comesto the Doppler effect, Lightspeed also allows the export of scenes for the raytracer Backlight, whichworks with greater precision. To display objects Lightwave needs OpenGL or Mesa and GTKGlarea,which allows it to embed OpenGL as a GTK Widget.

Figure 1: The Enterprise – not yet up to warp one

Page 76: linux magazine uk 13

BEGINEERSGNOMOGRAM

13 · 2001 LINUX MAGAZINE 81

which is famous for its free cola recipe. Swarmcastis not going to be used to supply drinks, but largefiles. In a way similar to the peer-to-peer systemMojonation, this large file will be split up into lots ofsmall pieces, which will then be downloaded.Everyone who owns a piece becomes part of amesh and can obtain the missing parts from theother participants. This takes a considerable loadoff the main distributor, since he does not have tosend the whole file to every individual. As soon asthe file has been completely put together, theparticipant can leave the mesh.

Smoothed Text in Gtk+ 1.2

The fact that anti-aliasing is possible under Gtk+ 1.2was demonstrated recently with the patch atchez.com. But however beautiful the associatedscreenshots may be, the patch is not compatiblewith the internationalisation in Gtk+ 1.2. For thisreason all Gnome users will have to keep strainingtheir eyes until the release of Gnome 2.0 with hardedges. Gnome 2.0 will then be based on Gtk+ 2.0,which contains anti-aliasing and a greatly improvedinternationalisation by means of Pango.

Gnome support

To make it easier for new programmers to get intoGnome, the Gnome-Love Mailing List has been set

URLsSun’s Gnome site www.sun.com/gnome/Twenty Questions developer.gnome.org/dotplan/archreview/

20questions.htmlGnome 2.0 mail.gnome.org/archives/gnome-hackers/2001-

May/msg00221.htmlSwarmcast proposal slashdot.org/articles/01/05/23/2136226.shtmlSwarmcast site www.swarmcast.comMoJo Nation www.mojonation.netAntialiasing patch www.chez.com/alex9858/gtkaa/Gnome Love mailing list mail.gnome.org/mailman/listinfo/gnome-loveGnome To Do list gnome.org/todo/Gnome Bug list bugzilla.gnome.orgGnome Bugsquad list mail.gnome.org/mailman/listinfo/gnome-bugsquadGenealogy gramps.sourceforge.netLightSpeed fox.mit.edu/skunk/soft/lightspeed/BackLight www.anu.edu.au/Physics/Searle/Downloads.htmlMesa www.mesa3d.org/Gtk GL Area www.student.oulu.fi/~jlof/gtkglarea/

up, in which many relatively simple tasks, as well assupport, are offered. The Gnome To-Do-System hasalso been revived, which should fill up rapidly –especially with respect to Gnome 2.0. Another wayof becoming familiar with the architecture ofGnome is the correction of a few bugs: Apart fromBugzilla, a Bugsquad mailing list has been set up tothis end. ■

Gramps

As soon as it encompasses more thana couple of generations, genealogybecomes very complicated, both interms of research and in processingthe data. But processing can besimplified considerably by programssuch as Gramps. Gramps creates agziped XML database, in whichindividuals and their familyrelationships are recorded.Information such family photos andgenealogical sources can also bemanaged. Inside this database it ispossible to search and to classifyaccording to specified criteria – suchas the Soundex codes formerlyapplied by the US government. Butwhat makes the program reallyinteresting are the numerous reports which can be generated from the database.

In addition to a simple family tree and a complex family graph, Gramps can also process thegenealogy as a Web page. The appearance of the Web pages here is partly influenced by templates.Under Tools there are numerous tools for working out the type of relationship between two people. Itis also possible to verify the integrity of the database, though Gramps gives no information of any kindas to where specific errors have occurred. Gramps offers those who would be older than the selectedparents when selecting possible children. This slows the work considerably, especially in the case oflarge databases. Since Gramps also interprets the common GEDCOM format, it’s a good program formedium-sized databases (Figure 2).

Figure 2: A little genealogy

Page 77: linux magazine uk 13

BEGINNERS KIDS

82 LINUX MAGAZINE 13 · 2001

Whilst work to get Free Software into British schools seems stalled, progress is

being made around the world. Here we highlight some projects old and new.

SUMMER ROUND-UPRICHARD SMEDLEY

There is perhaps no need to rehearse the practicalarguments here for stable, economical softwarethat can run on older hardware. It is a sad reflectionon the nation if we need to make the case for opensource code for schools and colleges and thedesirability of immersing young minds in acommunity built on cooperation, never mind theadvantages to taxpayers of avoiding foreignproprietary software.

k12ltsp

The author is currently installing cable around hishouse to upgrade his poorly functioning homenetwork. This will lead to the configuration of thechildrens’ computers as thin clients using packagesfrom the Linux Terminal server Project (ltsp).

The clients (X servers) boot from floppy or a ROMon the network card. They get an IP address from aserver running Bootp or DHCP. Then a TFTP request

is sent to download a kernel from the server. Thekernel takes control, mounts a root filesystem andstarts the init process. An X-server is loaded and alogin prompt is displayed. The principal advantage isin administration – 20 or 200 machines are nowmanaged as one. Other advantages include vastlyreduced hardware requirements (and improvedreliability) and consequent cost and energy savings.

This has prompted some thoughts on current effortsat X terminals for schools, particularly the progressbeing made in the USA by the K12ltsp project. Lookout for a feature in the next couple of months.

Free schoolsThe Free Software Foundation Europe (FSF Europe)has been working with The Organization for FreeSoftware in Education and Teaching (OFSET) topromote Free Software in French schools. TheFrench government now finds itself joiningArgentina and Mexico in considering Linux in itseducational establishments. The other big projectfor FSF Europe is representation at the WorldEducation Forum (WEF), to be held October 24-27,2001, in Porto Alegre, Brazil.

Blue penguins

Matt Jezorek of Blue Linux has boldly proposed topack all the “Educational Software games andsuch for younger students” into a single newdistro, as well as “put together a second versionthat will contain administrative software for theschools.” Take a look at their site to see how theyare progressing.

Meanwhile the developers of Tuxtyping havelaunched Tux4kids to promote “quality educationalsoftware released under Free Software or other OSI-certified licenses.”

Until next month, if you would like aneducational excuse to waste some time, trysimutrans on the cover CD. A freeware RailroadTycoon-type game covering all modes of transportand the resources needed to run them. ■

Linux for Kids The end of the long vacation

InfoKDE edutainment http://edu.kde.org/IRC – server irc.openprojects.net, channel: #kde-eduK12ltsp http://www.riverdale.k12.or.us/linux/k12ltsp.htmlFSF Europe’s pages http://www.fsfeurope.org/education/education.htmlOFSET http://www.ofset.org/information/legal/manifesto.htmlFSF and WEF http://savannah.gnu.org/projects/eduFree in Italy http://www.libresoftware-educ.org/en/carteItalieen.htmlIn France http://www.libresoftware-educ.org/en/carteFranceen.htmlBlue Linux http://www.bluelinux.org/Tux4kids http://www.geekcomix.com/tux4kids/goals/

Letter 11The K Desktop Environment (KDE) is on a roll at the moment with praise for KDE 2.2and KOffice 1.1 and a clear roadmap to KDE 3.x – a port to Qt3. As the projectcontinues to gather momentum it is no surprise that many of the developers haveturned their attentions to the needs of younger users.

The KDE edutainment project will create educational software based around KDE.Recognising that KDE is rather deficient in software for children generally (thoughthere are notable exceptions – see this column in Linux Magazine 10) the project willdevelop KDE educational software for children aged three to 18.

Although just launched, the project has an active mailing list, a newsletter,columns on educational philosophy and diverse applications in developmentincluding, in a firm stance against the dumbing down of education, KLatin.Eventually the KDE Edutainment package will be released with the rest of KDE.

Page 78: linux magazine uk 13

BEGINNERS OUT OF THE BOX

84 LINUX MAGAZINE 13 · 2001

Out of the box takes a look at the best Linux tools around and

recommends programs that we feel are either indispensable or

unduly ignored. This issue, we focus on XnView.

Master of Formats

PRETTYPICTURESCHRISTIAN PERLE

Yet another image viewer? But there’s already xv,gtksee, display and many more. And yet it’s worthtaking a look at XnView by Pierre Gougelet, as thisprogram can handle more image file formats(currently 214 of them) than any other under Linux.Since a few of these formats are not Open Source(CorelDRAW Preview for example), XnView isunfortunately not under the GPL, but is onlyfreeware for non-commercial use.

What’s new

Although XnView has been in existence for a longtime for a whole range of other operating systems –including such exotica as TOS (Atari) and the slowlydying OS/2 – it is a newcomer to the Linux domain.To list all the options of the program would burstthe seams of this column, so we’ll just concentrateon the highlights.

But before XnView graces our screens, we mustfirst install it. The author offers the program fordownload as an RPM package and as tar archive athttp://perso.wanadoo.fr/pierre.g/. Regardless of thepackage format, the lesstif library in version 0.91.4or higher must be installed. The XnView-RPMpacket can be installed (as root) with the commandrpm -Uvh XnView-lesstif.i386.rpm. If you are notusing an RPM-based distribution, it will be slightlymore trouble:

tar xzf XnView-x86-unknown-linux2.x-U

lesstif.tgz

cd XnView-1.17-x86-unknown-linux2.x-lesstif

su

(enter root password)

csh install

exit

If csh is not installed on your computer, there is still

the option of installing the program with the Bashscript instxnv.sh included on the cover CD. Copy thisscript into the XnView-1.17-x86-unknown-linux2.x-lesstif directory and start it with sh instxnv.sh.

Perspectives

Using an xterm, KDE or Gnome terminal, start theprogram with xnview &. At first there is nothing tosee but a little menu bar. After selectingFile/Browse... from the menu, things start to look alittle different. An interface based on the filemanager of a Redmonder software manufactureremerges, the browser.

Figure 1 shows the overview of the/home/chris/pics directory. How directory contentsare presented can be adjusted in the View/View Asmenu. Additional options such as sorting, size oficons and arrangement of the browser elements arealso found in the View menu. All program settingsare stored in the file ~/.xnviewrc.

Not just reading

The program can also write most of the image

Figure 1: Galaxies at a glance

Page 79: linux magazine uk 13

BEGINNERSOUT OF THE BOX

13 · 2001 LINUX MAGAZINE 85

formats known to XnView. When you hold downthe right mouse button over an image file icon, acontext menu appears, from which you selectConvert.... Alternatively, you can press [Ctrl+U]. Inthe following dialog window (Figure 2) you candefine destination format and optional processingsteps (Advanced Operations... button) such asgamma correction, blurring or colour reduction.

Gamma correction (Change Gamma) serves toadapt the brightness distribution in the image fordifferent monitors or other output media. Thebrightest and darkest colours remain the same –only the variation between them changes,depending on the gamma value. If a value of lessthan 1 is selected, the result is darker than theoriginal, and with value of more than 1 it becomesbrighter. In Figure 3 the image has been brightenedwith a gamma value of 1.8.

For blurring (Blur) you can specify a valuebetween 0 and 100. Figure 4 shows an enlargedsection after blurring. The edges of the text havebeen rounded off as a result. An example ofreduction to 16 colours (Convert to Colors) is shownin Figure 5, again as an enlarged section.The conversion function is not restricted toindividual images. As can be seen in Figure 2, youcan turn whole directories of image files intoanother format at a single stroke. So in theexample, all files in the directory/home/chris/samba/galaxies are converted into thePNG format and saved to the directory/home/chris/local.

Automatic for the Web

Another function of XnView worth mentioning isthe automatic creation of Web pages with image

GPL: The GNU General Public License. This is a software licence, allowing the programto be passed on, on condition that the source text always remains available. It is alsopermissible, and expressly desired, that users make their own improvements to thesoftware and publish it again. Linux itself is under the GPL.RPM: Using the Red Hat Packet Manager software packets can be neatly installedand uninstalled.tar: The tape archiver is the standard archiving program in the UNIX world. tararchives are also called tarballs and are usually compressed using gzip – hence the fileending .tar.gz or .tgz.Lesstif: A free (under the GPL) copy of the Motif library, which provides menu anddialog elements for X-window programming.~: The tilde is a shortening symbol for the home directory of the current user. And~user designates the home directory of the user user.PNG: Portable Network Graphics, a graphics format which mainly owes its existencesto the licence problems of the compression procedure used in the popular GIF format.Instead, PNG uses the unpatented compression of gzip.

Figure 2: Automatic conversion

Figure 4: Blurring withBlur factor 100

Figure 5: Atari ST sayshi: 16 colours

Figure 6:Automaticthumbnails forthe Web

Figure 7:Result on theWeb page

overviews (thumbnails) as HTML tables. Thisfunction is reached via Tools/Web Page... on themenu or the key combination [Ctrl+G]. In Figure 6can be seen setting options such as number of linesand columns in the table, size and format of thethumbnails and page title.

Sections from a complete Web page are shown inFigure 7 (Netscape has been used) The file namesunder the thumbnails are links to the original files. Ifone table is not enough, XnView spreads theoverview over several pages, which are connectedto each other by links. ■

Figure 3: Left, the original and right with gammacorrection

Page 80: linux magazine uk 13

COMMUNITY POSIX COMPLIANT

86 LINUX MAGAZINE 13 · 2001

A new GPLed desktop OS

FAITH IN ATHEOSRICHARD SMEDLEY

As mentioned in the

first article in this

series, there are many

UNIX-like OSs out

there, developed for

many purposes. Those

who wish to move

UNIX to the desktop –

and avoid the burden

of the X Window

System – will be

curious to look at

AtheOS, a GUI-based

POSIX-leaning

Operating system

(OS), with modular

kernel and a 64-bit

journaled filesystem.

It is often said that most Free Software projects arewritten to scratch a coder’s particular itch. In thecase of Atheos creator Kurt Skauen, this was tocreate a free desktop OS. Skauen felt thatGNU/Linux and the BSDs, with their mishmash oftoolkits (Gtk, Qt, Motif/Lesstif, Xt, fltk), failed onseveral levels to give the end user a consistent andeasy to use environment.

The GUI has been an integral part of Atheos rightfrom the beginning. Originally written, like thekernel, in C – the GUI was reworked in C++ asSkauen learned it, to meet the projects aims of anObject-Oriented API.

Kernel

Of course, the user interface (UI) is important for theend user but it is the kernel and the API that willinterest the developer. The OS builds on firmfoundations with a pre-emptable, multi-threadkernel coded with SMP in mind, for high-endworkstations. Threads are scheduled independentlyof whether they are inside the kernel, as well asimproving SMP performance, this reducesscheduling latency on all machines and results in theGUI feeling extremely responsive (dare one sayAmiga-like?).

The kernel has been called microkernel-like. It isnot a true microkernel, however construction isextremely modular – there are no device drivers builtin. At boot time required device drivers are loadedby GRUB. Any driver can be loaded during runtime,including block devices or file systems. In keepingwith the AtheOS philosophy drivers are written for awell-defined API, there is no need to learneverything about the kernel before you dive in andhave a go.

File under buzzword

There has been coverage of journalled filesystems inthis publication and elsewhere as the four

A self portrait of the AtheOS server

AtheOS Web browser in action

AtheOS version of XSpringies

Page 81: linux magazine uk 13

COMMUNITYPOSIX COMPLIANT

13 · 2001 LINUX MAGAZINE 87

contenders to replace Linux ext2 (ReiserFS, ext3, JFSand XFS) shape up. AtheOS, like BeOS, wasdesigned to do more than this from conception. The64-bit journalled filesystem supports user attributes(MIME-type specification or a custom data stream –an icon, associated with the file for example).Indexing of file attributes allows extremely fast filelook up. Applications can monitor files anddirectories for changes without any need forpolling, thanks to node watching within the kernel.

History

The three BSDs, GNU/Hurd and Linux and othermajor OSS Operating Systems have developed overtime with the input of a large number of people.Atheos has been largely the spare-time work of onehacker. Kurt Skauen takes pride in preferring codingto talking about how such-and-such feature couldbe implemented. A clear single vision has producedfairly clean code and good APIs at both the devicedriver level and for application programming.

Since putting a TCP/IP stack into the kernel andrunning the www.atheos.cx website on AtheOS theproject has been picked up by many of the geeksites on the Web. Interest is growing and the projectmay now be faced with how to deal with conflictingideas about direction. So far new developers seemhappy to follow Skauen’s lead. TCP/IP stack iscurrently undergoing heavy improvements resultingin better connection for those with high latency.

All the code is licensed under the GNU GPL –indeed a complete set of GNU tools are every bit asuseful for developing AtheOS as they were 10 yearsago for Linux.

No browser conflicts

W3m was a fairly early port (most UNIX commandline applications compile with little or noalteration) but as a graphical environment amodern graphical Web browser was needed.Impressed with the clean design of KHTML – theHTML renderer used in Konqueror – Skauen hasported it to AtheOS.

Calls to port KDE (and Qt) fall on deaf earsthough. Atheos with its high level API and OS-implemented GUI features demands the consistencyof using its native toolkit. KHTML has been portedto use AtheOS native widgets: Each widget(checkbox, radio button et al) either uses a nativeAtheOS widget directly, or is presented with a Qt-like widget by a thin class written to wrap theAtheOS widget.

KHTML is not multithreaded and a total rewritewould have been difficult. Fortunately a workaroundwas available and ABrowse, the browser that usesKHTML, synchronises all browser windows with thesame mutex, giving the impression of a single threadof execution, thus enabling most of the KHTML codeto run unchanged.

Atheos newbie install

Atheos is still at an early development stage andlacks a friendly installer – or indeed the ability toread CD-ROM drives. Nevertheless what has beendone is impressive enough. For the curious we haveincluded it on the cover CD. Some PCs will not becompatible but if you have a video card fromMatrox, nVidia or S3 you will be able to reallyappreciate the graphical environment. On all themachines I tried I had to use the vesa driver so videowas very slow. Do I have to remind you to back upanything important before installing anexperimental OS onto your hard drive?

Unless you already have an Atheos File System(AFS) somewhere on your PC, you will need to createa FAT (DOS) partition and copy across the baseinstallation base-atheos-0.3.xx.tgz to this partition.Take three blank floppy disks and copy thefollowing files to them:

atheos-0.3.x.boot.01atheos-0.3.x.boot.02atheos-0.3.x.data.01

After booting from the floppies AtheOS drops youinto a Bash shell inside a terminal emulator (aterm).Typing help will give you the commands available.

The AtheOS project has found itself welcoming many former BeOS developers,which has lead to some debate on the merits of pervasive multithreading. Theproblem under BeOS, also famous for its multithreading, was that developerswere forced to use multithreading and the BeOS locking mechanism. In itself thiswouldn’t have been so bad but for various bugs and limitations – including thelimited number of threads that an application may spawn. This limit greatlytroubled the BeOS port of Mozilla. Another limitation was the messaging systemwhich BeOS uses (BLoopers), in particular the limits on message queueing –which would also have been problematic even under a single-threaded OS.Under AtheOS threads can communicate through message ports (mostcommon), shared memory, POSIX signals, semaphores, named and anonymouspipes, ptys and TCP/IP – and probably body language as well.

In AtheOS an application may spawn approximately 16.2 million threads,processes, message ports, global-semaphores, memory-areas or any other objectwhich carries a global ID. For threads the task-switching attributes of intel-compatible CPUs which AtheOS uses limits this further to around 8000.However this could easily be removed.

In real world use, multiple threads may slow down processes but they willleave the User Interface feeling more responsive. For a desktop OS this benefitsthe end user.

Multithreading

Atheos boasts a number of desirable features for a geek OS: 64-bit journalledfilesystem; kernel with built-in TCP/IP stack and support for SMP; fair degree of POSIXcompliance – will run most UNIX CLI tools; client-server GUI protocol, using nativemessaging system; fine-grained multithreading. If that doesn’t tempt you to have alook, nothing will.

Buzzword-compliant

Page 82: linux magazine uk 13

COMMUNITY POSIX COMPLIANT

88 LINUX MAGAZINE 13 · 2001

If you have yet to prepare a partition to installAtheOS type

Diskmanager &

at the shell to invoke the AtheOS partitioning tool.If you have a partition set aside you can useDiskmanager in order to modify the partition sizeand change it to AFS the native AtheOS file system.

Now mount the FAT file system where you copiedthe base install package(in the following case hda0):

mkdir dos bash-2.03$ mount /dev/disk/bios/hda/0 dos

note the heirarchical structure of /dev, with diskblock drivers under /dev/disk. AtheOS reads diskdata from BIOS as this is the only disk driver finishedthus far. AtheOS 0.35 is some improvement over0.34 in this driver and seems better with my (oldand flaky) hardware.

Now we come to formatting our AtheOS partition:

bash-2.03$ format /dev/disk/bios/hda/1 afsUMyAtheOSPartitionbash-2.03$ mkdir afsbash-2.03$ mount /dev/disk/bios/hda/1 afs

Please make sure that it is definitely hda1 (forexample) you want to format before typing theabove. Now unpack the base installation

bash-2.03$ cd /afsbash-2.03$ tar -xvpzf /dos/atheos-baseU-0.3.xx.tgz

You will now find yourself with an /atheos directorycontaining the OS and a /boot directory containingGRUB. We must now configure this bootloader toboot AtheOS. It would be a good idea to playaround with GRUB under Linux first if LILO is yournormal bootloader, and to make boot floppies forany other OS that you have installed.

Edit the /afs/boot/grub/menu.lst file – you willfind jed, an emacs-like editor, at the commandline. For the above configuration you need

menu.lst as follows:

title AtheOSroot (hd0,1)kernel /atheos/sys/kernel.so U

root=/dev/disk/bios/hda/1module /atheos/sys/drivers/fs/afsmodule /atheos/sys/drivers/dev/disk/bios

This will tell GRUB to boot partition number 2 onthe first drive through the “root (hd0,1)” commandand where to find the kernel, the boot block-devicedriver and the boot-FS driver on that patition.

Save and exit and you are ready to reboot withthe floppy disk to install the bootloader. BeforeGRUB starts loading up AtheOS hit <ESC> and thentype “C” to enter the GRUB shell from which youcan install GRUB. Type

root (hd0,1)

in order to tell GRUB where to find the config fileand the second-stage loader. To install in the masterboot record (mbr) type

setup (hd0)

to put GRUB on the AtheOS partition. You will needto point your current boot loader there:

setup (hd0,1)

Congratulations. Now reboot to be welcomed bythe login prompt. Default root password is “root”and default user is guest (password=”guest”).Change it in /etc/password.

Once up and running installing software is fairlystraightforward, the binaries each unpack to theirown folders. Emacs is the included editor and portsof Apache, php and Python mean that some willalready find this a usable OS.

The idea of a GUI-based UNIX and the amount ofwork already implemented have generatedconsiderable interest already and lead to a numberof third-party applications appearing. Now check outthe websites for more information and have fun.

The Future

Atheos is a work in progress. It will be sometimebefore it is ready for general use, though it might behitting desktops before the Fresco-based Berlindisplay server reaches maturity for UNIX.

Nevertheless it is a fascinating project in itself andanyone interested in taking their first steps towardskernel hackerdom would be well advised to start withsome much needed device drivers for this OS. At themoment most of the advanced features of Atheosare not fully implemented. If you have an app towrite or port over now would be a good time to getinvolved to grow your project with the OS. One dayyou may be porting AtheOS apps to Gtk on Linux. ■

InfoAtheOS homepage http://www.atheos.cxAtheOS Developer’s mailing list http://lists.sourceforge.net/lists/listinfo/

atheos-developerGRUB http://www.gnu.org/software/grub/grub.htmlBrent Newhall’s site hosts third-party applications http://www.kamidake.orgOther AtheOS sites http://mnemo.nu/Interviews and reviews of AtheOS www.benews.com, www.osnews.com and

www.slashdot.org

Page 83: linux magazine uk 13

COMMUNITY BRAVE GNU WORLD

92 LINUX MAGAZINE 13 · 2001

Georg

The monthly GNU Column

BRAVE GNUWORLD

GEORG CF GREVE

This month, we feature a rather wide variety of

topics, finishing with a semi-experimental item

that has been developed with Bernhard Reiter.

TINYA minimal GNU/Linux distribution is the goal of theTINY project. It was started by Odile Bènassy, theteam also consists of Jean-François Martinez,Mathieu Roy and Roger Dingledine. The acronymTINY stands for “Tis Independence N’Yet,” which isa pun derived from “Independence Linux,” Jean-François Martinez’s main project.

The project goes back to the personal experienceof a relative of Odile, who tried to introduceGNU/Linux in her school, and the idea of givingdeveloping countries the chance to participate inthe information age and letting them profit fromFree Software. Keeping hardware requirements aslow as possible was necessary in order to achievethis. The current minimum is a 386 DX 33 withouthard disk.

Developing countries have many other difficultiesand the missing technical infrastructure poses aproblem. There are no Internet connections andfloppy disks do not survive the climate, very oftenpeople do not even have electricity.

But help programs exist to get electricity andphone lines into remote areas. Odile has talked toscientists and physicists helping with such programson a voluntary basis.

TINY is based on a Slackware 4.0 and uses theglibc2 and kernel 2.2; the license for thedistribution is the GNU General Public License.Other than some minimal distributions, TINY is

completely usable and ready for everyday use. The distribution can be installed successfully as

the messages on the home page (available in sixlanguages) show. But a longer and bettermaintained application list is needed.

The project has been suspended due to the othercommitments of the volunteers. Feedback fromdeveloping countries is also still lacking. So thecurrent team would like to turn over the project toanother group of people, who they would giveevery help and support to.

If you’re interested in helping others to helpthemselves, TINY might provide a good basis. If youare simply looking for a minimal distribution, TINY isworth a glance.

GNU TeXmacs

The GNU TeXmacs project works on a Free Softwarescientific WYSIWYG text editor. As the namesuggests, Joris van der Hoeven, author of GNUTeXmacs, was inspired by GNU EMACS and LaTeX.

TINY is not a LaTeX front end but an independentproject. The inspiration from LaTeX came in theform of typesetting quality and capabilities fortypesetting mathematical expressions – an area inwhich LaTeX undoubtedly offers the best solution.GNU TeXmacs also uses the TeX fonts and hasimport/export filters for TeX/LaTeX documents.

The EMACS inspired TINY’s extensibility. GNU

Page 84: linux magazine uk 13

Coloured formulae fonts

COMMUNITYBRAVE GNU WORLD

13 · 2001 LINUX MAGAZINE 93

TeXmacs is written in C++ with Guile/Scheme asextension language. The user interface and theeditor itself can be customised/extended withGuile commands.

GNU TeXmacs also allows the user to performscientific calculations directly through interfaces toMaxima, Pari GP, GTybalt, Yacas, Macaulay 2,Mupad and Reduce. An interface to Scilab shouldbe usable soon and adding more interfaces isrelatively easy.

Combined with the planned extension towardsbecoming a full XML editor, GNU TeXmacs offersinteresting possibilities for things like interactivemathematical documents on the Internet.

Thanks to professional typesetting quality, goodanti-aliasing of the TeX fonts, the possibility ofstructured documents and the potential for dynamicmacros and style-files, GNU TeXmacs offers a lot ofpossibilities for the scientific user in particular.

The project is heading towards 1.0 version. Jorisvan der Hoeven, Andrey Grozin, Thomas Rohwerand others have been working on it for about fouryears now. Current problems are some incompletelyimplemented features and LaTeX filters that stilloffer some room for improvement. Thedocumentation is still too terse.

The immediate plans are to get rid of theseproblems and get version 1.0 released.Spreadsheet support and the XML/HTMLextensions are the next steps. Long-term plansinvolve porting it to non-UNIX platforms anddeveloping technical drawing capabilities.

Help is welcome in any form; fromdocumentation, translation, filter writing, ports toother platforms and Gnome support, to makingGNU TeXmacs more widely known and used.

CD-ROM Control

Since the small projects have been neglected a bit, itis time to feature one of them here.

CD-ROM Control by Paul Millar is a small appletto control CD-ROMs. It was written in Tcl/Tk (and a

small part in C). Besides a status display it offerseasy possibilities for mounting/unmounting/ejectinga CD-ROM by mouse-click. The GUI canalternatively be Tk or GTK+.

The special feature of CD-ROM control isautostart, which allows the user to automaticallystart their favourite graphical file manager, Webbrowser or audio-application when entering a CD.

Even if the integrated desktops offer part of thisfunctionality, this is not true for all windowmanagers, which is why this project might beinteresting to some.

Saxogram

Saxogram by Matt Dunford is probably the mostunusual project covered this issue. The name isderived from the relatively unknown Danishhistorian Saxo Grammaticus, whose chronicles are afanciful reference to Hamlet by Shakespeare.

Saxogram allows the user to create a vocabularylist for documents in foreign languages in order tomake learning a new language easier. Like so

TeXmacs in Russian showing font sets

TeXmacs showingformulae and

embedded images inthe WYSIWYG display

Page 85: linux magazine uk 13

COMMUNITY BRAVE GNU WORLD

94 LINUX MAGAZINE 13 · 2001

many people before him, Matt learned Latin andGreek, which very often required looking up everythird word. One day, he discovered a Latindictionary on the Web, which inspired him tobegin working on Saxogram.

Saxogram parses a document for words and looksthem up automatically in a dictionary. The outputcollates the words found, together with theirexplanation. Saxogram is quite successful in dealingwith conjugated and declined words correctly.

The accessibility of dictionaries is a sore point:free ones are rare. Although the Internet DictionaryProject concentrates on this problem area, the

dictionaries are not yet stable enough foruse. The LEO online dictionary is of

limited help, as it can onlytranslate between English andGerman. As far as Greek

dictionaries go, Matt hasn’tfound a single one andwould very much appreciatebeing pointed to one.

The program waswritten in Python and is

released under the GNU GeneralPublic License. Its main problem is executionspeed due to many regular expressions and diskaccesses. Execution speed was not considered asa feature when the application was written. Asolution to this oversight is high on the task listfor further developments.

Currently supported are German, Latin and a littleItalian, while the working language is English.Adding further languages is another developmentgoal, as is the creation of a GUI.

Most important for further development are

more testers and dictionaries, so anyone interestedshould get in touch.

GNU libiconv

The GNU libiconv is the character set conversionlibrary of the GNU Project; through the iconv()function it offers programs the functionality ofconverting documents between differentcharacter sets.

A few words about the background: traditionally,the character set contains 256 values, each of whichrepresents a letter. Thinking about Asiatic languagesand local specialties like the umlaute or the eurosign makes it obvious that 256 values are notenough to represent every character on this planet.

So people in the different language areas createdmodified character sets that would contain the localletters. Because of this, the letter for a certain valuehas become ambiguous because it depends on thelanguage. Therefore, the selected language isspecified by the encoding.

In order to internationalise a program properly, theprogram must be capable of transliteration. This is abasic requirement for all text-processing programs.

Ulrich Drepper tried to create a standardsolution for this problem about two years ago forthe glibc, but because of portability problems, thesolution has not made it into the glibc. Thisresulted in a splintering of the character setconversion libraries. Bruno Haible seeks to changethis with libiconv.

Libiconv supplies the iconv() function in the sameway as it is supplied by the glibc 2.2. Libiconv isportable, fast and autonomous, so it can be used tosupply the iconv() functionality on all systems

CD-ROM Control under Gnome

Page 86: linux magazine uk 13

COMMUNITYBRAVE GNU WORLD

13 · 2001 LINUX MAGAZINE 95

without the glibc 2.2.Authors can now use iconv() without fearing for

the portability of their programs. Authors of mailprograms in particular should do this because a lotof the mail clients don’t handle MIME extensionscorrectly yet.

Like the glibc, libiconv is covered by the GNU LesserGeneral Public License, so it can be linked withproprietary programs if need be. This should hopefullysolve the conversion problems for everyone.

The libiconv functionality also has an impressivetransliteration feature. A character that does notexist in the target character set can beapproximated by one or more similar characters ifthe “//TRANSLIT” feature is requested.

Mozart/Oz

Mozart/Oz is a rather interesting developmentplatform. A complete description of all aspectswould be too long to cover in any depth here, sowe’ll merely try to provide an overview to givedevelopers an idea of what it’s all about.

Mozart was started 1991 in the EuropeanACCLAIM project and has been developed withcooperative efforts under an X11-like license.Although the license is certainly not optimal, it doesqualify as Free Software.

Mozart is a development platform for intelligent,distributed applications. Distributed computing inparticular is a great strength of Mozart, as it makesthe network transparent. Additionally, it supportsmultiple paradigms, concurrent programmingthrough lightweight threads (several thousandthreads per application are possible), as well asmobile agents and more.

The Oz virtual machine is portable and runs onalmost all Unix derivates as well as MS Windows.For the user interface it supplies an object-orientedlibrary with a high-level, well integrated interfaceto Tcl/Tk.

The project is usable and the biggest problemnow is developers who need to unlearn bad habits.Some things are still being worked on.

Plans for the future include improving reliability,security and network transparency as well as addingmore tools.

The Mozart Consortium could use some help,they especially need a volunteer for a Windows IDE.The current IDE is based on GNU EMACS, which isnot to everyone’s taste. A port to Macintosh is alsoin the works but this is proceeding rather slowly andhelp would be welcome.

If you are interested in taking a closer look at

Mozart/Oz, a visit to their homepage,http://www.mozart-oz.org, is recommended.

Free Software and 3D

This feature was initiated by Bernhard Reiter. As theGerman representative of the FSF Europe and co-founder of the Intevation GmbH – a company whichworks only with Free Software – he spends a lot oftime on the Free Software project.

3D-modelling is a very interesting and importanttopic, which is also why the last FSF Award has goneto Brian Paul for his work on the Mesa 3D graphicslibrary. But there are still no fully developed FreeSoftware modelling tools available. This is probablydue to two causes: First of all, it was not possible tofind a good overview Web page about Free 3Dsoftware. Very often, not even related projects seemto be aware of each other.

Also, proprietary products that are available at alow price provide an efficient developmentroadblock. Users are attracted by the low price anddo not realise that their choice makes it impossibleto maintain software in the future.

As Bernhard says, “This is a classic example thatpragmatism and compromises in terms of softwarefreedom slow down a whole software area.”

Any non-programmer can use networking tofocus development efforts. Dave Phillips hasdemonstrated this with his Sound and MIDISoftware for UNIX/Linux page. A comparable Webpage for 3D modelling with Free Software would bea substantial contribution to this area.

So much for this Brave GNU World issue. We hopeto have provided some interesting ideas and, asusual, we ask you to mail comments, questions, ideaand interesting projects to the usual address. Maybeeven some Free Software from the 3D area. ■

Info

Send ideas, comments and questions to Brave GNU World [email protected] of the GNU Project http://www.gnu.org/Homepage of Georg’s Brave GNU World http://brave-gnu-world.orgWe run GNU initiative http://www.gnu.org/brave-gnuworld/

rungnu/rungnu.en.htmlTINY GNU/Linux distribution homepage http://tiny.seul.org/de/GNU TeXmacs homepage http://www.texmacs.orgLyX homepage http://www.lyx.orgCD-ROM control homepage http://sourceforge.net/projects/crcontrolSaxogram homepage http://saxogram.sourceforge.net/Online Latin Dictionary http://king.tidbits.com/matt/

LatinDictReadMe.htmlInternet Dictionary Project http://www.june29.com/IDP/LEO English/German Dictionary http://dict.leo.orgGNU libiconv homepage http://clisp.cons.org/~haible/

packages-libiconv.htmlMozart/Oz homepage http://www.mozart-oz.orgSound & MIDI Software for GNU/Linux http://sound.condorow.net