linux magazine 14

Page 1



COMMENT

General Contacts General Enquiries Fax Subscriptions Email Enquiries Letters

01625 855169 01625 855071 www.linux-magazine.co.uk subs@linux-magazine.co.uk edit@linux-magazine.co.uk letters@linux-magazine.co.uk

Editor

John Southern jsouthern@linux-magazine.co.uk

CD Editor

Colin Murphy cd@linux-magazine.co.uk

Contributors

Alison Davis, Colin Murphy, Richard Smedley, Richard Ibbotson, Jono Bacon, Jason Walsh, Kevin D Morgan, Steven Goodwin

International Editors

Harald Milz hmilz@linux-magazin.de Hans-Georg Esser hgesser@linux-user.de Ulrich Wolf uwolf@linux-magazin.de

International Contributors

Simon Budig, Björn Ganslandt, Georg Greve, Jo Moskalewski, Christian Perle, Stefanie Teufel, Mariane Wachholz, Tim Schürman, Anja Wagner, Carsten Zerbest, Frank Wieduwilt

Design

Renate Ettenberger vero-design, Tym Leckey

Production

Stefanie Huber

Operations Manager

Pam Shore

Advertising

01625 855169 Carl Jackson Sales Manager cjackson@linux-magazine.co.uk Verlagsbüro Ohm-Schmidt Osmund@Ohm-Schmidt.de

Publishing Publishing Director

Robin Wilkinson rwilkinson@linux-magazine.co.uk Subscriptions and back issues 01625 850565 Annual Subscription Rate (12 issues) UK: £44.91. Europe (inc Eire) : £73.88 Rest the World: £85.52 Back issues (UK) £6.25

Distributors

COMAG, Tavistock Road, West Drayton, Middlesex England UB7 7QE

Print

R. Oldenbourg

Linux Magazine is published monthly by Linux New Media UK Ltd, Europa House, Adlington Park, Macclesfield, Cheshire, England, SK10 4NP. Company registered in England. Copyright and Trademarks (c) 2001 Linux New Media UK Ltd No material may be reproduced in any form whatsoever in whole or in part without the written permission of the publishers. It is assumed that all correspondence sent, for example, letters, e-mails, faxes, photographs, articles, drawings, are supplied for publication or license to third parties on a non-exclusive worldwide basis by Linux New Media unless otherwise stated in writing. ISSN 14715678

INTRO

CURRENT ISSUES

ANGRY! WHO ME? I am so annoyed. No really I am. Sat at home reading email I suddenly found I was looking at one from a name in my address book list. My own name. Absent minded I may be but not to the extent of writing junk mail to myself. A quick look at the header showed it was from me but the return address was not mine. I do not have any email accounts in China. I had been spoofed. Someone had harvested my name and used it in sending Spam. Like most people I do not like spam but I can live with a little as I realise marketing people need to live. (That is not an invitation!). What annoyed me was that they had used my email address. Most people getting spam will junk it. But what about my close friends who may really think it is from me. They would be slightly peeved at getting junk mail but more worrying is if there is a malicious payload. I try to ensure those I email all use Linux (I would wouldn’t I) but some do not. It is possible for them to receive a virus

easily from a script kiddie. What can be done? Well I need to start using alias on mailing lists, and change all my email addresses. Alter all my passwords and alert anyone who may be at risk. I cannot even block email from China as I contact many friends and companies there. Then we have a US proposed law that all operating systems need to have security features. This is to help prevent terrorists. In an open source world we will be forced to comply or be illegal. I am all in favour of stopping the bad guy but I want to be honest and open not tied to some proprietary system I do not trust. I need to lie down and think of penguins. Code Well!

John Southern, Editor

Linux is a trademark of Linus Torvalds Linux New Media UK Ltd is a division of Linux New Media AG, Munich, Germany Disclaimer Whilst every care has been taken in the content of the magazine, the publishers cannot be held responsible for the accuracy of the information contained within it or any consequences arising from the use of it. The use of the CD provided with the magazine or any material providied on it is at your own risk. The CD is comprehensively checked for any viruses or errors before reproduction. Technical Support Readers can write in with technical queries which may be answered in the magazine in a future issue, however Linux Magazine is unable to directly provide technical help or support services either written or verbal.

We pride ourselves on the origins of our magazine which come from the very start of the Linux revolution. We have been involved with Linux market for six years now through our sister European-based titles Linux Magazine (aimed at professionals) and Linux User (for hobbyists), and through seminars, conferences and events. By purchasing this magazine you are joining an information network that enjoys the benefit of all the knowledge and technical expertise of all the major Linux professionals and enthusiasts. No other UK Linux magazine can offer that pedigree or such close links with the Linux Community. We're not simply reporting on the Linux and open source movement - we're part of it. 14 · 2001 LINUX MAGAZINE 3


NEWS

LINUX NEWS New E-Commerce suite from Red Hat Red Hat, Inc has announced the Red Hat ECommerce Suite. This helps mid-sized businesses build and manage their e-commerce applications more rapidly, more cost effectively and with greater reliability and customisability. “We’ve been extremely pleased with Red Hat’s offerings,” said Aron Benon, CEO of bricks-andclicks retailer, Florist.com. “Red Hat helped us move quickly and cost effectively from a low-end ecommerce platform to a rich, highly customised solution that allowed us to become much more effective in our online efforts.” Benon added, “Red Hat has given us many of the benefits of high end e-commerce platforms, but without the cost or complexity.” Red Hat E-Commerce Suite includes: ● Interchange 4.8, a brand new version of the ecommerce platform. With more than 10,000 developers participating, and thousands of sites using the technology, it delivers robust functionality, reliability, and performance; ● CommerceLauncher, is a Web-based configuration ● Secure Webserver powered by Apache; ● Red Hat Database, based on PostgreSQL 7.1 ● Red Hat Linux Operating System 7.1 ● Red Hat Network, Red Hat’s online subscription service.

Additional added value services in the Suite include: ● 3 hours of developer consulting during the first 30 days. ● 30 days of telephone-based support. ● 12 months of Web-based support. “The Red Hat E-Commerce Suite fills a significant gap between expensive, complex enterprise ecommerce applications and entry-level ecommerce offerings,” said Michele Rosen, research manager for Application Development and Deployment at IDC. “Because it’s based on established open source technologies, the Suite provides functionality and customisability similar to that found in high-end ecommerce applications but at a price within midsized businesses’ budgets.” Red Hat E-Commerce Suite has be available since September http://www.europe.redhat.com/shop/en/software. php3#rhwebserver ■

IBM and Caldera join to boost applications IBM and Caldera announced a joint UK initiative to get even more developers on board with Linux to promote the benefits of developing, porting and enabling applications on Linux to Independent Software Vendors (ISVs). With over 2,400 enterprise-level applications for Linux currently listed in IBM’s Global Solutions Directory - this initiative, the first of many with IBM’s key Linux distributors, is clearly aimed at boosting this figure. ISVs gain by creating applications on Linux developers only have to develop once and port to other platforms. As Linux is a versatile operating system - developers will have the opportunity to share applications across IBM’s four e-Server platforms this gives an increasing the market opportunity for their applications. Potential financial benefits through co-marketing opportunities with IBM Business Partners will also exist. “This joint initiative will give many ISVs an early start on developing enterpriseready applications that businesses are demanding. Linux has proven its reliability and stability – with more and more enterprise customers coming on board ISVs just can’t afford to lose out on the rewards that Linux can bring”, said Carol Stafford, IBM VP eServer Sales EMEA.

6 LINUX MAGAZINE 14 · 2001


NEWS

New SuSE distribution SuSE Linux 7.3 is now available. It offers high-end enterprise and standard desktop users advantages in security, stability and a greatly improved ergonomical user interface with new image, graphics and audio features. As security becomes a higher priority among users both at home and the office, SuSE Linux 7.3 offers the possibility of setting up a “Personal Firewall” straight from the installation stage. A user-friendly graphical front end is now available for configuring the firewall. Thus, making it simple to protect your host or network against unauthorised access. SuSE’s “crypto file system” makes sure that sensitive data is secure even if the entire hardware is stolen. Stored data is only available in unencrypted form if the user has entered the correct password. Other proven security tools included in SuSE Linux 7.3 are the mail scanner AMaViS (A Mail Virus Scanner) and PGP encryption for e-mail. Desktop advances include KDE 2.2.1. The graphical tool Kooka now handles scanning

Borland announces a web services strategy for Java According to Gartner Group, in the next few years, close to half of all new projects will make use of both Java and .NET technologies. Customers therefore need an e-business platform that supports both environments and integrates legacy applications. Borland will provide Web Services development and deployment solutions for the Java 2 Platform, Enterprise Edition (J2EE). It will utilise Borland JBuilder and Borland AppServer technology to support the development and deployment of robust, standards-based Web Services applications. It also plans to provide a web services solution pack for Java to allow developers To create applications using Java and Web Services together. The solution pack, an add-on to Borland JBuilder, is a collection of application programming interfaces (APIs), architectures and additional standards developed by the Java community. The Web Services strategy for Java provides a platform for companies to use existing and emerging Web Services standards, including XML, SOAP, WSDL and UDDI (Universal Description, Discovery, and Integration), to optimise current resources and participate in the development of industry standard concepts and processes.

jobs very quickly and the new print assistant guides the user safely through the protocol jungle of lpr and cups. With Linux Kernel 2.4.10 and glibc 2.2.4, improved memory management increases. Hardware detection has been considerably expanded to include even more components such as CD writers, Scanners and TV cards. Software RAID support provides reliable protection against data losses. Apart from ReiserFS, two additional journaling file systems, JFS and Ext3, can be selected. The Personal version is intended for Linux newcomers, whilst the Professional version offers ambitious home users and IT professionals a comprehensive portfolio of more than 2000 up-todate software packages. SuSE Linux 7.3 Personal (3 CDs, 3 manuals, 60 days of installation support) is £35. SuSE Linux 7.3 Professional (7 CDs, 1 DVD, 5 manuals, 90 days of installation support) is £59.

Rapidly navigate time with Atempo Atempo, Inc., formerly Quadratec Software, announced Time Navigator 3.6, its platform for high performance backup and restore services. Specifically designed for corporate data centres (internal) and Internet data centres (outsourced), Time Navigator gives service providers new management tools for enhancing quality of service and delivering new value-added storage services. With Web-based restore, service providers can give their users fast access to lost or damaged files from anywhere on their network or across the Internet. John Malyevac, senior systems engineer at Dataline, Inc. commented, “As a Managed Storage Services provider, I have been very impressed with the ease of installation and operation of the Time Navigator software platform. Also, its level of functionality in a heterogeneous environment is far superior to the other alternatives in the marketplace.” By intelligently linking all incremental backups to previous full backups, Time Navigator can provide a nearly continuous graphical view of data changes, and immediate pinpoint access to files or database components that need to be restored. Time Navigator 3.6 also offers enhanced support for the latest storage networking architectures, including Network Attached Storage (NAS), Storage Area Networking (SAN) and IP Storage. New features in Time Navigator 3.6 include: Consolidated usage tracking for internal accounting or commercial billing and Web interface for remote monitoring of multiple servers in a SAN environment. Support for network-connected Gigabit Ethernet (GbE) tape libraries for backup and restore over an IP Storage Network (OSN Certified) is included. Pricing for Atempo’s Time Navigator 3.6 begins at US$4,000. Time Navigator 3.6 ships from October and will be available from Atempo’s worldwide network of distributors and VARs. The product runs on Windows NT/2000, UNIX, and Linux platforms, and is compatible with most automated libraries on the data storage market. Customers at more than 2500 sites 14 · 2001 LINUX MAGAZINE 7


NEWS

Technical Command Mandrake Linux 8.1Prompt

MandrakeSoft announced the availability of Mandrake Linux 8.1 for download from http://www.linux-mandrake.com. This new version includes MandrakeOnline which offers alerts on security or package updates according to hardware and software configuration. Email aliases such as name@mandrakeonline.net are included. A userfriendly and powerful solution comprises over 2,500 applications including StarOffice. The 8.1 version KDE 2.2.1, featuring Konqueror which now includes enhanced JavaScript support and better HTML rendering. Kmail and KOffice 1.1 are supported as well as GNOME 1.4.1. Kernel 2.4.8 and XFree86 4.1 ensures a complete Video Cards Support. Enterprise Kernel 2.4.8: This special edition of the Kernel comes with native support for HI Memory (>1024 MB) and SMP (Symetric Multi Processing) Full support for Journalised FileSystems: XFS, Ext3, ReiserFS and JFS come in standard ensuring files integrity. Along with a special version of Samba: Combined with XFS and latest kernel, Samba 2.2.1.a allows Windows file sharing with the same fine-grained permissions as Windows NT. PHP Groupware gives accessible anywhere from a simple web browser with secure connection. Mandrake Linux Standard Edition includes 3 CDs plus detailed Installation Guide. Mandrake Linux PowerPack Edition includes 7 CDs packed with thousands of the latest Linux applications, a comprehensive Installation & User Guide, plus a detailed Reference Manual. Mandrake Linux ProSuite Edition includes 9 CDs (with a special Mandrake Server CD) + 1 DVD packed with thousands of the latest Linux applications and server configuration wizards. Designed for small and medium businesses, Mandrake Linux ProSuite Edition 8.1 has been specifically customised to include all the necessary tools to rapidly and easily build a Linux Server Solution. ProSuite Edition 8.1 will scale easily for large enterprise deployments. Mandrake Linux 8.1 OEM Edition and Masters CD will also be available for desktops & servers at leading wholesalers.

Security components break into a NuSphere NuSphere creates a secure environment for managing web sites based on MySQL, Apache, PHP or Perl. As security breaches over the web increase in sophistication, NuSphere Corporation has responded with the announcement of new Internet security components to provide intrusion prevention and a secure environment for web sites and database servers. NuSphere Advantage, Version 2.3. combines several new security tools with its Apache Access Manager and administers them through the NuSphere Security Console, which helps organisations manage security activities from one central location. In addition the database has been extended to include online backup, a feature in which the entire database is constantly being saved so that system administrators do not have to interrupt data availability or business processes. NuSphere is providing ready-for-business capability to the many users of such open source components as Apache, PHP, MySQL and Perl by strengthening security both inside and outside the firewall for organisations that are building Internetbased applications. Subscribers may then purchase a three-month, unlimited scan service for a single IP address for $100, or an entire year for $299. NuSphere Advantage includes Vulnerability Scan which searches web and Internet servers and their applications to find vulnerabilities. The Apache Access Manager allows developers to control access for different users and control privileges to websites and applications through an Apache web server. Port Scan identifies unnecessary services on a network that might present exposed entry for intruder requests. Weak Password Check provides methods for evaluating weak passwords. NuSphere Security Scan audits the web or Internet presence from outside the firewall to detect Internet network vulnerabilities, assess risk, and provide alerts in a summarised graphical report.

http://www.mandrakesoft.com/products/81

The Root of all Evil AMD charge less for more AMD said that sales for the quarter ended September 30, 2001, at approximately $766 million, declined by 22 per cent from second-quarter sales of $985.3 million. The company also said it expects to report a pro-forma net loss of between $90 million and $110 million for the quarter. Sales of flash memory devices declined by approximately $100 million sequentially, in line with previously reported expectations, reflecting continued weakness in the communication sector and excess inventories in the hands of major customers. AMD also said unit sales of PC processors remained at the record level of the second quarter, when AMD sold more than 7.7 million PC processors. In the face of very aggressive competition, average-selling prices (ASPs) for PC processors declined sharply, which resulted in substantially lower revenues. “Our ability to maintain PC processor unit volumes under current market conditions is a strong testament to the architectural superiority of AMD Athlon(tm) and Duron(tm) processors,” said W.J. Sanders III, chairman and chief executive officer.

8 LINUX MAGAZINE 14 · 2001

The third compilation of the online hit comic, User Friendly, takes readers back to Columbia Internet for the continuing story of the “friendliest, hardestworking and most neurotic little Internet Service Provider in the world”. In “The Root of All Evil” (O’Reilly, £8.95), author J.D. “Illiad” Frazer probes the worldviews of sales staff, execs, and caffeine-fuelled techies whose universe includes the Dust Puppy and Erwin the Artificial Intelligence. Considered one of the most off-beat, original, and funny comic strips to come along in years, User Friendly has captured the attention of the worldwide audience of IT professionals and computer hobbyists alike.


NEWS

Configurable Chips get Linux embedded MontaVista Software Inc., and Tensilica, disclosed a wide-reaching technical and marketing agreement. The pact leads to the porting of MontaVista Software’s Hard Hat Linux to Tensilica’s Xtensa processor architecture. The combination of Hard Hat Linux with the Xtensa architecture will enable development of a broad range of communications and consumer products previously built with proprietary controllers or rigid processors, to exploit the incredible flexibility of Tensilica’s configurable processor core. For the first time SOC developers will be able to harness the enormous array of Linux application software on an application-optimised processor. Utilising Tensilica’s OSKit technology, Hard Hat Linux will be automatically updated to fully support all possible configurations that meet or exceed the minimum requirements. This will enable Hard Hat Linux to run “out of the box” on the customised configurations. Few other embedded processor architectures, fixed or configurable, can match the new advanced memory management capabilities for robust software environments like Linux. The Xtensa processor is targeted at high volume applications including datacom and telecom protocol processing, digital cameras, set top boxes, office automation products, wireless communications devices, and a spectrum of other consumer electronic products. Announced licensees of the Xtensa processor include Broadcom, Cisco Systems, Conexant Systems, Fujitsu Limited, Hughes Network Systems, JNI Corporation, Marvell (Galileo Technology), Mindspeed Technologies, National Semiconductor, NEC Corporation, NTT, ONEX Communications TranSwitch and Zilog.

Rapid development from Omnis Omnis Studio 3.1 is released. You can download the current version of Omnis Studio from the Omnis web site at: www.omnis.net/ downloads/studioeval.html Following the March 2001 release of the Mac OS X version of Studio (3.02), the 3.1 release brings together all the currently supported platforms, and adds Sun Solaris version 8 to the platform mix. Omnis Studio is now one of the few development environments that provides true cross platform development and deployment (both thick and thin) under the all popular platforms, including Windows 95/98, NT/2000, Mac OS X and Classic, Red Hat, SuSE and Caldera OpenLinux, as well as Sun Solaris. The Omnis Studio 3.1 release means you can develop your enterprise solution under your chosen platform and deploy under any other platform, to either your LAN, WAN, Intranet, or via the Internet, and with the Omduit plug-in to all Palm OS supported devices. Omnis Studio is one of the most flexible Rapid Application Development (RAD) tools available today. Omnis Studio allows the independent or team-based developer to create e-business and information management solutions for companies and organisations of any size. Omnis Studio lets you develop and deploy applications under Windows, Linux, and MacOS for such diverse markets as healthcare, human resources, publishing, customer relationship management, e-business, education, government, and more.

Seagate supports Linux Seagate Technology now adds the power and administrative flexibility of the Linux OS to its SeaTools Enterprise Edition system diagnostic software. Seagate’s Enterprise Edition is part of the SeaTools Suite, a group of user-invoked diagnostic applications that provide quick, easy and accurate diagnosis of hard drives within a system. By incorporating both Java-based and commandline mode versions, SeaTools Enterprise Edition for Linux can now be run with either its standard easy-touse, intuitive graphical user interface or remotely via command-line for flexible remote server management. Prior to the introduction of SeaTools, more than 40 percent of returned disc drives were actually discovered to have no problems found. Among those customers using SeaTools, “no problem found” drive returns were reduced by 80 per cent. The Diagnostic “D” in Seagate’s 3D Defense System, Seagate’s SeaTools Suite saves time, data, and money by keeping healthy disc drives in a system and eliminating unnecessary drive returns. The SeaTools Suite includes the Desktop Edition, the quickest and easiest way to diagnose ATA (IDE) and SCSI drives in PCs and workstations, as well as the Enterprise Edition, ideal for workstation and server environments that can benefit from the powerful additional features implemented for the unique needs of Enterprise systems. SeaTools Enterprise Edition can test up to 120 SCSI and Fibre Channel disc drives per session, either simultaneously or sequentially, as well as take advantage of support for Seagate’s Drive Self-Test (DST) firmware capability embedded into every Seagate disc drive. Seagate’s SeaTools Suite is available for download free at http://seatools.seagate.com 14 · 2001 LINUX MAGAZINE 9


INTERVIEW

TED TS’O

It’s Been a Great Ten Years

TED TS’O ON KERNEL HACKING

RICHARD IBBOTSON

Theodore Ts’o is a friendly and modest chap who can tell you everything or just about everything that is to do with GNU/Linux. His passion for open source software is very much in evidence when you have a conversation with him. Theodore is the principal programmer at VA Linux Systems. He says that this allows him to be paid for the kind of things that he used to do for fun. He is currently part of the technical advisory board of Linux International. He is also an MIT graduate, the same place where Richard Stallman did his original work in artificial intelligence and where just about any sort of esoteric project can be funded and put together. Theodore worked on kerberos at MIT as well. His other work involves the internet engineering task force and works with many people that are to do with internet security. He is the author and maintainer of e2fsprog. Recently he visited London and gave a few public lectures which were basically about his work with Linux over the years. He has been something of a prolific worker within the world of Linux and open source software. He understands many things that most of us never will. He explained quite a lot to us over the few days that he was here. He showed us that some very big companies are now taking Linux very seriously. Good examples are IBM with their investment in Linux on a planet wide scale of hundreds of millions of pounds. Other companies he talked about were Compaq and Oracle. He also says that with the present economic downturn other companies such as VA Linux aren’t doing so well just now. His explanation of how the open source business model is taking a long time to work 10 LINUX MAGAZINE 14 · 2001

out was really worth listening to. He went into some simple detail about how Microsoft was attacking open source software which as he did explain was more than slightly sad considering the kind of people who are working on it. In contrast with this there is the extremely rapid development cycle that is a common feature of the open source model. After his somewhat in depth explanation of all that has taken place and just how good things have been, he began to explain some simple facts of life to us about present day issues. The potential problems in intellectual property law are not the least of the problems that may come along next and something that may also be related to this are copyright issues. Perhaps this is only something that affects legal affairs in the States but there is also the consideration that the internet allows for the rapid deployment of information and some of that may not be good. He also spent some time discussing the thorny subject of DMCA which whether we like it or not may well become in integral part of our every day life. Many people from outside the United States have criticised this law and some think that they have every right to do that. He expressed concern about trade secrets and similar problems. Microsoft kerberos PAC was also mentioned as something that could be a woeful subject. He went on to bemoan the only too well known situation to do with patent law and software. Something that even RMS has done some campaigning over himself. As Theodore says there have to be some programmers that are involved in the political process so that the views of


TED TS’O

INTERVIEW

A man for all seasons

The author

Ted Ts’o has a fantastic CV. He is a systems programmer who is working at Information Systems (I/S) at MIT. There he is currently a member of the Integration Team, which is tasked to promote an effective computing infrastructure for MIT. Formerly, a member of the Distributed Computing and Network Services department, until it got reengineered. While the DCNS was in existence, he was a member of the Network Operations Group and the DCNS Development Team. He is currently the team leader for the Kerberos V5 development effort at MIT. Which has recently released version 1.0.5 of Kerberos V5. Kerberos is a network authentication protocol. It is designed to provide strong authentication for client/server applications by using secret-key cryptography. A member of the Internet Engineering Task Force, and currently serving on the Security Area Directorate of the IETF. Serving as a working group co-chair for the ONC RPC and IP Security working groups. He also spend a lot of time working as a member of the Common Authentication Technology working group. He acts as one of the core Linux kernel developers, and serves on the technical board of Linux International. Currently getting around to working on getting the Telnet Encryption Specifications published as RFC’s, after close to a five year hiatus. Graduated from MIT in 1990, with a degree in Computer Science. He is the author and maintainer of the e2fsprogs package, the ext2 filesystem utilities. If all that is not enough he is the author and maintainer of the Rocketport intelligent serial board, which is manufactured by Rocketport intelligent serial board. Comtrol, Inc.

their colleagues can be properly represented. If you feel that you are someone who can be both a political person as well as a programmer then please do join in with the European Free Software Foundation and the campaign to remove software patents from Europe. Make your views known to your own Member of Parliament and your Euro MP. Theodore finished off his lectures with a mention of the fact that Microsoft haven’t rolled out an new technologies for a long time now. The next twelve months will probably see some new technologies from Redmond. He repeated some of the things that Miguel de Icaza has been heard to say in the past few months. Such as can my great Auntie Emma use a Linux desktop and can anyone near you use an open source desktop without being told or shown how to. The companies that produce what is often referred to as proprietary software spend millions of dollars on that kind of thing. Open source developers should be aware of that. Proprietary software will always be with us in the shape of tax and finance packages. If you feel that you disagree with this then please feel free to rise to the challenge of adding to Linux packages like Jalia which is one of the better financial packages that is just becoming available. As an example of something that may not be too good he explained his recent problems with compiling a Debian kernel.

Richard is the Chairman and organiser for Sheffield Linux User’s Group. You can view their web site at http://www.sheflug.co.uk

Theodore is a great fan of the Debian distribution. He said that he thought the man pages were great but it could take weeks to find some basic information from fellow developers and maintainers. We should aspire to a higher standard and above all else please don’t try to mess up the work of the programmers who work on proprietary software. Theodore closed his last lecture in England with the words .... “It’s been a great ten years”. We do hope that he will continue to experience another ten years of enjoyable and creative hacking in spite of his concerns with present day issues. The recent tenth anniversary of the birth of Linux was something that we shouldn’t forget about right away.■

Useful URLs Theodore’s home page Eben Moglen European Free Software Foundation Free Software Foundation Linux International VA Linux Jalia Accounting

http://web.mit.edu/tytso/www/home.html http://web.mit.edu/Kerberos/www/papers.html http://emoglen.law.columbia.edu/ http://fsfeurope.org/ http://www.fsf.org http://www.li.org http://www.valinux.com http://homepages.tesco.net/~cdmediaeuroltd/ html/products/linux_accounting.htm 14 · 2001 LINUX MAGAZINE 11


FEATURE

SANE

Sane Overview

Scanning SUCCESS COLIN MURPHY

SANE, an acronym for “Scanner Access Now Easy” and is an application programming interface (API) that provides standardised access to any raster image scanner hardware. The SANE API is public domain and its discussion and development is open to everybody, which is a mark of its success. The most important thing that this article can do is try and dispel the belief that you can not get scanners to work with Linux. It is very true that very few scanner manufactures offer any support to the Linux community for their products, but this hasn’t stopped a dedicated band of developers produce Sane, a software system that is allowing more and more scanners to be used. It is now becoming much more likely that you will be able to find a scanner that will work with a Linux system and, possibly more important, one that you can afford. Windows systems, and Macs for that matter

If XSane is started as a Gimp plugin, the scanned image is automatically loaded into the Gimp. 12 LINUX MAGAZINE 14 · 2001

often refer to TWAIN as their ‘standard’, but just because a scanner is said to follow this standard doesn’t mean it will work with Linux. This TWAIN standard turns out to be no more than a set of rules, not a very fixed set at that, which defines what a scanner driver should do to be compatible, but not how. The scanner manufacturer provide TWAIN compatible drivers that, in effect, describe how the scanner is working to the application program, the scanning application software that the user sees. This means the driver must be closely linked to the application software.

One of the list of back-ends at the SANE site. Don’t worry, not all the back-ends are alpha release. Note how the Siemens scanner falls under the Agfafocus back-end.


SANE

FEATURE

Capturing data with xscanimage

Gamma table editor

SANE is designed to be more universal, as their web page puts it “The value of such a universal interface is that it allows writing just one driver per image acquisition device rather than one driver for each device and application. So, if you have three applications and four devices, traditionally you’d have had to write 12 different programs. With SANE, this number is reduced to seven: the three applications plus the four drivers. Of course, the savings get even bigger as more and more drivers and/or applications are added.” To do this SANE splits the task of bringing hardware and application program together into two, the Front-end and Back-end. A SANE front-end can either be a scanning application in it’s own right, or a plug-in to another application. It deals with the user side of the scanning operation. A SANE back-end is the nearest we get to having a driver for a specific scanner. It understand how the scanner works and handles the requests that come from the front-end, which talks to the application. The back-end is also responsible for retrieving the scanned image from the scanner, and converting it to the correct format so that the front-end can handle it. The important bit is that to get a specific scanner to work, a SANE back-end must be available for it. This is why the role of the manufacturer is important, if they won’t say how their scanners

works then a back-end can’t easily be written for it. It’s been found that some of the back-ends will support other models of scanner and sometimes even different manufactures. This means that the SANE compatibility list shows scanners listed by back-end rather than by manufacturer. All of this is true, not just for scanners, but for similar devices like hand-held scanner, video- and still-cameras, frame-grabbers. SCSI, Parallel and USB scanners are all dealt with differently by SANE, so they will all have there own back-ends, something to look out for when checking compatibility. SCSI scanners do seem to be the best supported, but with the introduction and improvements with USB support in the Linux kernel, the number of USB scanners is increasing steadily. And this marks the big turn around, SCSI devices will always be the most expensive option, but with the growing availability of USB scanners working with Linux mean that soon, no user will have to do without the privilege of scanning images. Once you have downloaded and installed the Sane package you need to find what device you have connected. Use the command

Will my scanner be supported It’s not practical to give the full list of supported scanners here, because of the reliance on backends and that its changing, growing daily. Some of the better supported scanners are the Epson Perfection range in both SCSI and USB forms, the Plustek OpticPro parallel port range, Umax SCSI and Agfa USB Snapscan range.

scanimage —list-devices This then returns a list of available devices. Your scanner will be listed first but extra devices pnm:1 (Portable aNyMap) will also be listed which act as virtual devices for file manipulation. To start scanning you now need to run xscanimage & Different devices have differing properties that allow us to change the captured data such as gamma adjustment.

Info SANE homepage http://www.mostang.com/s ane/ Supported USB scanners http://www.buzzard.org.uk/ jonathan/scanners-usb.html Supported parallel scanners http://www.buzzard.org.uk/ jonathan/scanners.html

14 · 2001 LINUX MAGAZINE 13


COVER FEATURE

BROWSERS

Browsers

SEEING INTO THE FUTURE COLIN MURPHY

Browser development is moving on a great speed, with something new coming out weekly. The choices here were made to show the type of range that is available, that there is more than the default browser on your desktop. To give you the chance to experiment. The World Wide Web is all around us and you can’t underestimate the value of using the right tool for the job you have. In a world where information is sovereign, getting to that information is vital. More and more of how we see the world develop will be through web browsers, how we see ourselves managing our lives, paying our bills or buying our food will all be reflected in our choice of browser. It is not just down to the functional aspects of browsers, its almost more political, certainly has more to do with esthetics, and of the opinions of those who have developed your chosen browser. Netscape slipped on a banana.

Lynx

Netscape

For the purely minimal. When speed and size are an issue to you, just remember that all the glitz has to go. Maybe everyone, once in a while should fire up a text only web browser, just to soak up the nostalgia. The important key bindings will soon be picked up as will the appreciation for getting more information out of the text, and being more likely to read it looking for links.

So how does Netscape, once considered a saviour for providing an alternative graphical web browser, shape up these day in face of the competition. Version 6 didn’t quite hold the promise that we were all expecting of it, it wasn’t as robust as it should have been, and the advance in bloatware and extra commercial baggage must have put many off. I know I stayed with 4.7. The standard layout is much more modern looking, all very corporate, and when you look deeper you can see it’s created around commercial design factors. Most obvious to this is the Activation screen, which can take an age to complete, leaving you in the lurch while you’ve got urgent things to research, and for what? Is Netscape still a browser or is it now just a front end to a Web portal with pop-up advertising. Instead, what would it have been like had they invested all that time and money into innovation, developing ideas like the full and proper use of the sidebar space to greatly assist with web searches – using a wide range of search

Remember what life was like before colour 14 LINUX MAGAZINE 14 · 2001


COVER FEATURE

BROWSERS

Beonex Beonex is very definitely a work still in progress but it is already in a useable form. The project calls to anyone willing to get involved with its continued development, this is not a bad thing. The browser and the web site have an enthusiastic air to them, all caught up with the freedom that open source code development allows. It is based very heavily on Mozilla and calls on the Gecko layout engine for rendering. The install procedure is unusual but did work first time on a Mandrake 8 system with no complaints about dependencies. Beonex is only supplied as a tarball which, it must be said, doesn’t contain a README file, which left me searching their website for clues. It’s suspiciously easy to install, which is what caught me out, basically unpacking the the tarball and calling the script Beonexcomm. Two version available, for Intel Pentium 2/3/4 or AMD Athlon/Duron or for Intel Pentium or AMD K6. It is fast and has all the features you would expect from a browser plus some . It uses the same Modern Chrome theme of Mozilla, so regular users will feel straight at home. Apart from the browser Communicator, Beonex also come complete with a Mail/News client, a HTML editor similar to Netscape Composer, and an integrated IRC client, not the proprietary AIM instant messenger, which is shunned by the developers. One of the most outstanding features is the Beonex Search. Utilising the Side Bar, this feature will call upon all of the selected search engines and post your query to them, the responses are

grouped together and laid out in one list. The search tool needs to have some idea in advance of the layout of the search engine, so that it can separate all the useful replies from all the other chaff, but Beonex already has support for all the major search engines so this should not be a problem. The advantage with this is that you don’t have to keep returning to the search engine page to select the next link, which speeds the process up considerably. This is definitely one to keep an eye on.

Beonex with with their unique search feature in the side bar.

engines – as Beonex have. It does function well as a browser, with all the tools you would expect, but with a lot of bulk as well, with the inclusion of extra, non browser related features like WebMail and instant messenger utilities . Yes, and you can even waste space by getting themes to take your mind of it all, the example shown here is Toy Factory. 6.1 does seem to be much more solid, but it still has the same failing, it’s size. It is a very profession product, very slick, but then that’s no more than we really should expect. It was a while in coming, which is the problem, I suspect Netscape have lost much of the ground to Mozilla, and what ground is left will slip even quicker to all the other open source browser developments, like Beonex or Galeon. Those that have some need to pay to use the software then there now is Opera.

Star Office. Well, yes, Star Office does have a web browser built in, so it is only right that it does get a mention. Star Office might very well be sitting on peoples desktop, if not taking over the desktop completely, so, for some very basic browsing it will do what’s necessary. The Web browser in Star Office is there, I’m sure, just to facilitate the HTML editor, so you should not expect anything in the way of features. There are no Bookmark facility, though there is nothing to stop you developing a StarOffice database of bookmarks, seeing as you have some excellent 16 LINUX MAGAZINE 12 · 2001

Two Star office windows open open the same desktop.

database software sitting in the same package. Star Office opens up its own desktop and all of its windows must fall on that desktop. There is an advantage here, if you do have the need for multiple browsers to be opened, as in the example here, then having them all fall onto the same desktop can be a neat option. Star Office ships with it own Java runtimes and it has proved to be much more reliable than other browsers when Java support is called for. As shown in the screenshot, the supermarket web page called on some Java, which, unfortunately, would always leave Netscape 4.77 thrashing about, but here the Star Office browser has no problem. Even though the Star Office browser is light on browsing features, it still has its place, if you are a regular Star Office user. The lack of usual browsing tool make it less comfortable to use and would soon be intolerable after a while, but if you happen


BROWSERS

COVER FEATURE

Amaya, the future The W3C, the World Wide Web Consortium have the important task of shaping and developing the way we use the internet today and tomorrow, they decide on the standards that next years browsers will have to adopt. Amaya is next years browser. Amaya is the test tool used by W3C to test the very latest standards and to try out features so new to the internet that the acronyms used to describe them have yet to be pulled from the Scrabble bag. Amaya comes in both RPM and tarball form and doesn’t require very much in the way of extra libraries if you are using a fairly recent system. For your effort you get a very simple web authoring tool and web browser. It’s fast enough, but it does lack many of the bells and whistles that most people have become attached to for their daily browsing, you won’t even find a Bookmark feature, and its user interface is basic, so you won’t be chucking out Mozilla or whatever just yet. But you do get the chance to play with some of the very latest developments in the World Wide Web. There is lots of detailed help and information pages included, as well as information on the older functions and usage, should you need to be reminded of how to use them effectively. These exciting new developments range from the latest in XHTML and the use of HTTP/1.1 with its advantages of built in security and pipelining to save that precious resource of bandwidth. Then there is methyl and Scalable Vector Graphics protocols coming to assist in the presentation of technical subjects but treated with the ease of plain text. I look forward to the release of the annotation protocols,

a system where you can highlight text on a remote web page, anyone’s page, and pass comments on what you have selected, all transparently. So, Amaya isn’t so much a Web Browser, it’s much more a browser into what the Web will be. Great fun for tinkerers and web designers who want to be on the bleeding edge of developments. You will find Amaya at http://www.w3.org/Amaya/

The future of browsers

to have Star Office running then it is still a valuable option to choose from. And should you find that one site that causes your favourite browser to fail you, Star Office may be able to help.

Galeon Galeon is ideally run as a Gnome application, so you will need the GTK+ libraries, probably the latest, and access to the Gecko rendering engine as used by Mozilla 0.9.1. They admit in their README that this is very much a work in progress. As part of its install, Galeon looks to import previous saved Netscape and Mozilla bookmarks and will even try and load a Netscape preference file. This could save you a lot of time and effort. It also sets up Smart bookmarks for easy web searching, offering you some preset choices ranging from the obvious, like Google, to the less than obvious like RPMfind and Debian Package. The next option is hauntingly familiar to a Windows feature of automatically setting Galeon up as your default Web Browser for use with other Gnome applications, but now you get to select if Galeon will also look after services like ftp downloads and local file browsing. The Galeon developers say “A web browser is more than an application, it is a way of thinking”, and their thoughts are that a browser should follow principles of simplicity and standards compliance. Galeon’s user interface is reminiscent of Netscape 4.7, less cluttered and crowded than that of Mozilla. Galeon uses a simple browser interface,

balancing what is a sensible minimum amount of functionality, sensible Bookmark options and alike, against unnecessary features and bloat. Galeon addresses this call for simplicity with a small browser designed for the web, with functions like

Galeons’ browser battle banner - “The web, only the web.”

12 · 2001 LINUX MAGAZINE 17


COVER FEATURE

BROWSERS

mail, newsgroups, file management and instant messaging deliberately not included. The Galeon web site confirms their philosophy of a modular based system and their desire to implement external applications. Integration will be achieved with CORBA, Bonobo, and the ever popular command line. Standards compliance is in the forefront of the developers minds, so you can rely on the browser working as the W3C says it should.

Opera 5 for Linux. Opera is another cross platform browser, along with Netscape 6, but it makes an extra effort in helping those who prefer an alternative OS. Their Web page proudly boasts support for BeOS, Linux, Mac, OS/2, QNX, Symbian OS and last, probably least, Windows. It has a comprehensive hypertext help document, installed locally, which means you can get answers to your Opera query connected or not. Opera sits very comfortably on a KDE desktop, calling on similar widget sets to those supplied by the Qt GUI toolkit libraries. Opera has a multi panelled display similar to many other modern browsers, allowing you a configurable menu of shortcuts. The Opera developers obviously have a good understanding of the needs of a Linux user, so, even if your not a natural KDE user, you don’t need to worry about installing extra libraries, Opera provide versions with statically compiled libraries as well as dynamically compiled. Available as a TAR ball or as a DEB or RPM package – at 2.73MB, the largest package – they seem to have all bases covered. Opera is a commercial product, so the source code is locked and there is some cost to you using it, but not necessarily monetary. Opera ships with a Banner advert section, so some of your browser

18 LINUX MAGAZINE 14 · 2001

screen is given over to the display of adverts. On hearing about this, I was certain I would find would find the adverts intrusive, but on use it didn’t bother me at all. If it bothers you, then there is still the option of paying up to US$39 online, obtaining a registration code and doing away with the banner ads, which would also give you a larger area to view web pages in. The area that these adverts take up is fixed, so the proportion of browser used up depends very much on what screen resolution you are running at. The screen shots were taken on a display set to 1280x1024. Unless you are viewing on a desktop of 800x600 or less then I doubt you would loose too much screen estate. And if you are it doesn’t really matter because you will discover that hitting F11 puts you into full screen display mode, so Opera takes over your entire screen, no buttons, no bars, no advert, just web page. This is further aided by Opera’s positive encouragement to use keyboard shortcuts, which all browsers have to some degree, but here it has been taken to heart. Opera has a spoofing feature so you can redefine the ‘user agent’ perimeter so some web pages servers can be fooled into thinking they are talking to a different breed of browser, most likely MS Internet Explorer. This will then allow you access some sites that have explicitly requirement for viewing access. You also have so much to configure in Opera, if you want to. You can define which email client will start up when you hit that ‘mail me’ button, to specifying the type and range of appeal of banner adverts you would prefer to see, and really usefully, describing the type of css style sheet you would like to use, which could make some unreadable web pages useful again. Other features include indicators to display the speed and size of download and time counter that show you how long you have been waiting for a page and its graphics to arrive. Opera for Linux is fast and robust and easy to use. Opera have concentrated on being a web browser and not some ubiquitous internet tool, so no email clients or composers using up space here. They have managed the balancing act of being feature rich but without the bloat. Though it is worrying to note that their Windows version does seem to be shipping with an integrated ICQ client, we can but hope they resist temptation to take their Linux version down the same route.


XMMS

FEATURE

XMMS plugins

UNPLUGGED – NO WAY STEFANIE TEUFEL AND CHRISTIAN PERLE

Certainly, XMMS gets on like a house on fire with skins from WinAmp, its brother from the Windows world – but when it comes to plugins, they go their separate ways. No matter, because for most expansions of the Windows player there is also an appropriate expansion under Linux. What was once just a simple MP3 player is now known, and rightly so, as “X Multimedia System”, XMMS for short. With hundreds of plugins, the program can be expanded to incorporate new functions. Below, we present both the plugins included in the download as well as third-party plugins.

Noise makers, there right from the start The CD audio player 1.2.5 plugin, an audio-input plugin, for example, makes it possible to play back audio CDs. In the configuration dialog (reached by clicking on the Configure button in the tab audio I/O plugins in the XMMS Preferences menu) specify the Device to which your CD-ROM is connected. After that, add the corresponding device file to the playlist (usually /dev/cdrom) – and that’s it. With the tab CD Info you can persuade XMMS to fetch the display of the title on the CD automatically via one of the free CDDB servers on the Net. This obviously presumes you have a Internet connection running. Another audio input plugin delivered as standard is named MPEG Layer 1/2/3 Player 1.2.5 and looks after everything to do with your mp3 files. It is based on the classic mpg123. If the files are playing back at only half the normal speed, owners of older sound cards should reduce the Resolution from 16 Bit to 8 Bit, then the songs should again sound normal. This plugin is also responsible for the fact that you can use XMMS in connection with the Internet radios from Shoutcast. If you use a Proxy to do so, you can set this (including port, username and

password) in the Streaming tab. If you want to store the streams on your hard drive, ask XMMS to do so in the same tab by selecting the field Save stream to disk. With a few little changes you can get Netscape to use xmms automatically when you select a radio channel at http://www.shoutcast.com/ . In Netscape 4.x select the menu item Edit / Preferences / Navigator / Applications, and make sure the entry xmms %s is assigned to the MIME type audio/x-scpls as the application to be used.

Diversion for the output One of the Output-plugins usually supplied as standard is the Disk Writer plugin. With this not only mp3 files, but all formats for which there is an input plugin, can be converted to the wav format, so you could then, for example, burn them onto an audio CD. The most fundamental standard plugin, though, would be the OSS-Driver. If a computer has several sound cards, after a click on the Configure button, set which of these XMMS ought to use. This is also where you can adjust the size of the data buffer used by XMMS when streaming. If you have installed esd, you can use the ESD plugin. This means other programs can continue to use sound effects while you listen to music in XMMS.

Effects and sequences of images The sound behaviour of the sound output is affected by the Effect plugins. So you can give songs an echo with the Echo plugin 1.2.5, or put a

Device: Under Linux the majority of the hardware is addressed via special device files. These can be found in the directory /dev and have standardised names, for example /dev/hda for the first IDE hard disk or /dev/dsp for the “digital signal processor” of the sound card. CDDB: Abbreviation for “Compact Disk DataBase”, a CD title database on the Internet. This database contains all the information on any audio CD which has gone on sale. CDDBs are either kept locally or you can fetch the data from the Internet. For an audio player which supports the CDDB format, as soon as the CD is inserted a check is made as to whether the CD is already known. If not, the CD player tries to connect to the Internet and to find the data there on a CDDB server. CDDB programs access the TOCs (“Table of Contents”), which is a list contained on every CD.

14 · 2001 LINUX MAGAZINE 19


FEATURE FEATURE

XMMS

whether we like it or not, we shall have to limit ourselves to a few very subjectively selected highlights. For the full plugin pitch with a brief functional description in each case, it’s worth taking a look at http://www.xmms.org/plugins.html.

Shaken and stirred Figure 1: Gorgeously coloured

Proxy: A proxy is a server between the Internet and an internal network / computer, which mediates between the two. The best-known examples are web proxies, which buffer often-required websites and then make these available to the user more quickly than with a direct connection to the Internet. The pages then only have to go down the route to the user and no longer have to be loaded direct from the Internet. OSS: Abbreviation for “Open Sound System”. A distinction is made between OSS/Free (OSS/Lite) and OSS/Linux, the commercial variant. The free version is currently the only sound system which is a direct part of the standard kernel and is available with every current Linux distribution. The essential difference between the two variants lies in the fact that the paid-for version offers buyers support and supports a few additional sound cards. A few Linux distributions come with limited-period demo versions of OSS/Linux.

muzzle on the singer by listening to just the instrumentation, with the aid of the Voice removal plugin 1.2.5. If you feel like visual experiences, let yourself be impressed by the OpenGL plugin from the category of Visualization plugins (Figure 1). It reacts to the same keyboard commands as the xmms main window. Using the keyboard the [z] key is for jumping to the previous track beginning, [x] is the play key, [c] acts as the pause key, [v] is stop and [b] jumps to the next track. Plus, you can use the arrow keys to change the x and z axes or [q] and [w] to change the y axis respectively. The [Return] key resets the values. In the configuration menu, activate the so-called 3DFX fullscreen mode. If you have an XFree installation, in which the DRI is enabled, the plugin will be shown in a window which holds the mouse prisoner. Just press the [Esc] key once, and the so-called full-screen mode disappears. Apart from the standard plugins there are a wide variety of jolly, useful and also pointless expansions for XMMS. To present them all would take up an entire issue of the magazine, so

Box1: JESS practical To install this plugin from its source archive, you will need the libSDL (“Simple DirectMedia Layer”)library together with the development packet in version 1.1.5 or higher and the development packet for XMMS, in particular the tool xmms-config. The “Simple DirectMedia Layer” library can be obtained from http://www.libsdl.org/. To play in the plugin itself, the following steps are necessary:

Even without OpenGL it’s still possible to have colour and an attractive appearance. This is shown by JESS, which also comes under the category of Visualization plugins and can be obtained from http://arquier.free.fr/. Under the influence of the music, JESS conjures up a wide variety of effects such as fading, rotation or zooming onto the screen (Figure 2). If your X-window configuration has a mode for 640x480 pixels, the whole thing also works in full-screen mode. The plugin responds to the keys [F1] to [F5] for fading, [F9] to [F12] for various character modes, [p] to change the colour palette and the spacebar to toggle between window and full-screen mode. Information on installation can be found in Box 1.

Real listening pleasure The Realaudio-plugin from 4Front is brand new (http://www.xmms.org/plugins_search.html?mode =search&query=rmxmms). With its help, real audio streams QSound-iQ- and spatializer streamFX effects can be mixed together. The spatializer upgrades MP3s, in particular those which have been recorded at a low bit rate. These include mainly streaming MP3s, which are played out live during an on-going Internet transfer. The programs in the iQ family convert MP3s and other audio files from XMMS into virtual 3-D stereo. Plus, wav files and other audio data in 3D stereo can be improved by it. The commercial QSound-IQ plugin was previously only available in the Windows version of the RealPlayer. Through the new Realaudio plugin there is now the option of using 3D sound effects and representing the Real audio stream graphically. But anyone wanting to use it must also have installed RealPlayer 8.0 on the hard disk.

tar xzf jess-2.0.0.tar.gz cd jess-2.0.0 make su (enter root password) make install ; exit In order for XMMS to take note of the new plugin, you will have to restart the program. It will then be ready for action under Options / Preferences / Visualization plugins / _JESS_v2.

20 LINUX MAGAZINE 14 · 2001

Figure 2: Digital whirlwind


XMMS

FEATURE

Blender

Figure 3: On the drums, ready, go...

Figure 4: VIP on your desktop

Played for the dance The plugin GDancer also provides graphical highlights, and you can get it from http://figz.com/gdancer/ . After installation you will find the entry GDancer [gdancer.so] in the section Options / Preferences / Visualization plugins. Click on it with the mouse, and then activate the field Enable plugin. Straight away, a little man should appear, as in Figure 3, who will strut his stuff and move rhythmically to the beat of your audio files. So that it does not get too boring, the maker and fans of this plugin also supply additional little figures at http://figz.com/gdancer/themes.php , so that if you like, you can always have new characters moving across your desktop. Unpack the respective theme in the directory ~/.xmms/gdancer_themes/, which is made automatically the first time the plugin is started. You can change the theme by clicking with the right mouse button on the existing figure and selecting the item Configure. In the drop down menu select your desired theme, and immediately you could have, say, Bill Clinton dancing on your desktop (Figure 4).

For many users of the plugin, Crossfade is used purely and simply to blend XMMS titles into each other and play them back uninterrupted. The latest version can be found on the homepage of the author at http://www.netcologne.de/~nc-eisenlpe2/xmmscrossfade/. After installation Crossfade takes its place in the ranks of the Output plugins. Once selected, when working through the playlist, XMMS fades out towards the end of one track and fades in the next song. In the current version a minor cosmetic flaw from the previous versions has been corrected. This means that Crossfade is now also capable of outputting sound via esd. To do this, use the Configure button to open the configuration menu, go to the Output section, and change from the default Builtin OSS Driver to Output plugin. There, select eSound Output plugin 1.2.5 (Figure 5). The tab Gap Killer is also of interest. If you choose this effect, when XMMS is to play titles one after another without cross-fading and without audible gaps – welcome to the endless loop...■

esd: The “Enlightened Sound Daemon” is a server (“utility program”) which mixes together several audio sources prior to output on the sound card. So these can be used by more than one program at the same time. DRI: Abbreviation for “Direct Rendering Infrastructure”. This makes it possible to use 3D functions based on OpenGL with hardware support by the graphics card inside an X window. In practical terms, this means that 3D functions can be used better, more simply and above all more efficiently.

Peaceful coexistence Not quite so much fun, but on the other hand a lot more useful, is the additional plugin xmmsarts. There is something special about this: The KDE Project is producing its own multimedia architecture, based on aRts (“Analog Realtime Synthesizer”). It is actually pretty good, since aRts, like esd, allows several audio or video data streams to play back at the same time. Stupidly, the sound device (say, your sound card) does not agree when both aRts and other programs want to access it simultaneously. This causes problems of co-operation between aRts and XMMS. For all those who don’t want to do without either one, the xmmsarts plugin is an obvious choice, and is available for downloading at http://home.earthlink.net/~bheath/xmms-arts/. This clever little aRts output driver ensures that in future there will be no more clashes between XMMS and aRts, but instead they can live together peacefully. Once installed, under Options / Preferences / audio I/O plugins, select the freshly-added item aRts Driver 0.3 [libartsout.so] (in more recent versions the entry may display a higher version number), and you can now play music with aRts, too.

Figure 5: Crossfade + esd = no problem 14 · 2001 LINUX MAGAZINE 21


FEATURE

FONTS

TrueType fonts

EASY ON THE EYES

COLIN MURPHY

Maybe, just maybe, it’s not your eyes after all. It could be the fonts you are using to view Web pages and other on screen stuff. If you have access to TrueType fonts then you are missing out by not using them.

TrueType fonts in Netscape.

By default, the fonts you get with a Linux distribution can often leave something to be desired, especially when called upon to display Web pages of any detail. It’s a sad indictment of our times, but very many Web pages are written on the assumption that the Web browser that is going to view them will have access to a certain range of fonts, and these fonts are usually the Windows TrueType fonts. This is why some Web pages can look so bad or, at worst, be totally unreadable on a Linux system. There are many different types of fonts available, but the crux of the matter for this article is that Adobe Type 1 font files are supplied with XFree86, while TrueType font are supplied with Windows. If you are running a dual boot machine, then these TrueType fonts might just be languishing in some dark corner of your hard drive – what a waste.

How far down the road are you.

Standard Linux fonts in Netscape.

To confirm for yourself what version of XFree you are running, in your favourite terminal type XFree86 -version to see. If it is less than version 4 you may want to consider upgrading – If you really do want to stick with an older version, because you have hardware that is not supported in the new version for instance, then you will need to insure you have the FreeType Library, XFSFT and TTMKFDIR installed.

FreeType libraries are available from http://www.freetype.org/ and you will need to compile this yourself. While on this site you might also want to take ftjam which is a utility that should help when compiling FreeType. XFSFT is available from http://www.dcs.ed.ac.uk/home/jec/programs/xfsft/ TTMFKFDIR is available from freshmeat.net/projects/ttmkfdir/ 22 LINUX MAGAZINE 14 · 2001

There has been a change in the way fonts have been handled by the XFree package, partly to do with the increasing need for supporting things like TrueType. Previously XFree would cater for its own font needs, so, as part of configuring X on your system, a list of locations would say where all the font files were, usually specified in the FontPath section of /usr/X11/lib/X11/XF86Config. More recently, some systems shipped so that their fonts were better looked after as a resource, and handled separately by a font server, of which XFXFT is just one, which could now deal with extras like TrueType. With systems like this you now have to configure both X – to tell it to use the font server, and also configure the font server so it knows what fonts to serve. Currently, most distributions will now ship with XFree version 4 or greater, which has facilities built in to deal with TrueType fonts. Configuration falls back into the domain of X and its configuration file. Much depends on where your system is in this scheme of things and how you go about configuring it. You need to reconfigure something in your system to tell it where these new TrueType fonts are, but will it be for a font server or X itself? We will have to work through the options.

Getting things ready. You will need a directory that will hold, or at least point to, your TrueType fonts. Different distributions have different file layouts, so, as a SuperUser you should make a directory:# su # mkdir -p /usr/local/share/fonts/ttfonts Copy into this directory your TrueType fonts, so, if


FONTS

you are using your Windows fonts then copy them to this directory:# cp /mnt/win1/windows/fonts/*.ttfU /usr/local/share/fonts/ttfonts/ or download fonts from the internet and extract them to this directory. You will need to change the file permissions of these files and of the directory itself, so:# chmod 775 /usr/local/share/fonts/ttfonts and # chmod 644U /usr/local/share/fonts/ttfonts/*.ttf These font names should all be in lower case which you can do with the accompanying shell script if it looks like to much to do by hand. Some information needs to be collected about these fonts and you need to run a couple of utilities to do this. It’s important to run them while in the directory holding the fonts, so:# cd /usr/local/share/fonts/ttfonts # ttmkfdir -o fonts.scale # mkfontdir The above will create the plain text files fonts.dir and fonts.scale As a precautionary measure, if you use any of the graphical log in tools like xdm, then turn them off – should something go wrong when configuring X then you end up with a much bigger challenge not being able to log in. Use the Mandrake Control Centre or the SuSE YaST tool to turn this feature off.

Configuring font servers or X If you have had to install XFSFT font server yourself, then you will need to add, with an editor, to the XFSFT config file /usr/etc/xfsft.conf the directory we just created holding our TrueType fonts. This is also true if you are using a system that has installed its own font server, Mandrake 8 for example, except that you will be looking for the configuration file in /etc/X11/fs/config. The entry goes under the catalogue section and should look something like the example shown. The order may be different, but since it is worked through sequentially it is best to put the paths that are most important to you at the top. X still needs to know what to do about any fonts it needs to display, so we now need to tell it to call on the services of the font server. This is best done by adding a line by hand to the X server configuration file, which, depending on your system will be in /etc/XF86Config or

FEATURE

Shell script Shell script to change upper case characters to lower case. Call the script while you are in the directory you want to work on. #!/bin/sh # ## ————Changing UPPER to lower case————ls * | while read f do if [ -f $f ]; then if [ “$f” ! = “`echo \”$f\” | tr A-Z a-z`” ]; then #Note that ‘This’ will overwrite ‘this’! mv -iv “$f” “`echo \”$f\” | tr A-Z a-z`” fi fi done

/etc/X11/XF86Config. Under the section “Files” you need to add the line FontPath “unix/:-1”. If you found you had a recent version of XFree installed by your distribution when you looked earlier then you now fall in to one of two categories. RedHat shipped with its own hacked version of XFree from version 6. If this describes your system then you will want to use their chkfontpath facility. # chkfontpath -- addU /usr/local/share/fonts/ttfonts Again, X still needs to know about this so you need to make sure the font server is mentioned in XF86Config with the lines FontPath “unix/:-”. for version of RedHat 6.x or FontPath “unix/:7100” for RedHat 7.x. For other users that are still using a font server, you will have to update your server configuration file to add the new font directory by hand Those using the more recent versions of XFree where we just need to change our XF86Config file, you should add your new font path with the xset utility:# xset +fp /usr/local/share/fonts/ttfonts

Time to go With all this set up all we need to do is reset the server so that it can now take full advantage of the fonts we have added. Have a look at what’s been added by viewing your efforts in one of the font selector utilities.

Further info XFree86 Font De-uglification HOWTO or the FDU HOWTO can be found at http://feenix.burgiss.net/ldp/fdu Font HOWTO can be found at http://pegasus.rutgers.edu/~elflo rd/font_howto Jim’s Linux Pages can be found http://www.hazalthorn.freeserve. co.uk/TrueType.html

Font section of XFSFT. catalogue =

/usr/local/share/fonts/ttfonts, /usr/X11R6/lib/X11/fonts/misc:unscaled, /usr/X11R6/lib/X11/fonts/100dpi:unscaled, /usr/X11R6/lib/X11/fonts/75dpi:unscaled, /usr/X11R6/lib/X11/fonts/Type1, /usr/X11R6/lib/X11/fonts/Speedo

14 · 2001 LINUX MAGAZINE 23


KNOW HOW

STAR OFFICE

DATA TAMING TIM SCHÜRMANN

StarOffice integrates the database software Adabas D. This program can enable you to create database tables, queries etc. in a professional way. You will thereby be able to organise your data more professionally than is possible by, for example, StarOffice’s spread sheet application.

Many StarOffice users administer their data with the help of the integrated spreadsheet application – StarOffice Calc – or even the word processing module – StarOffice Writer. Most people either don’t consider the integrated StarOffice Base software or, due to its large range of functions, think that it is beyond their capabilities. It is our intention, with this detailed, two-piece workshop, to change all that. We will show, with an example of a music CD administration, how fast, easy and effective it is to administer your database with StarOffice Base. There it is in the cupboard, your arduously acquired music CD collection. But you’ve lost all hope of finding the CD you want, thanks to a sorting method that simply wasn’t up to the task. And your inventory list, written in StarOffice Writer, confuses more than it actually helps. On top of all that, you’d gladly hear that long lost (and rare) favourite “TuX Hits 2000” again – if only you could remember whom you lent it to way back then.

If this situation seems familiar to you then StarOffice, with its database StarOffice Base, could be just the thing you need. With it, you’ll not only be able to clearly organise any rare favourites but you’ll also to be able to lead a precise record of whom you lent them to and when. With the following example, we want to make you familiar with the basis of a simple CD admin system, and take you step by step through the modes of operation and concepts of StarOffice Base. You will see that a database is not only something for large computing centres, but that it can also be a true help in many private instances. In contrast to many other workshops, we want to create something real and useful, thereby giving you the tools to work independently on your own projects.

Fundamentals The first thing we have to do, before even starting work with StarOffice, is to give some thought to

Adabas D Adabas D is a professional database from Software AG. Some restrictions apply to the free version, which comes included with StarOffice, or which can be downloaded from the StarOffice homepage. The restrictions apply to size: each database may not exceed 100MB, and users: the number of simultaneous users in the user sharing system is limited to three. Please note that Adabas D can not be used as the user root.

28 LINUX MAGAZINE 14 · 2001

Adabas D operates according to the Client/Server principle, with which a special program, the “Server”, administers all databases as well as receiving and processing inquiries by other programs, the “Clients”. The Adabas D package incorporates both the server program as well as a client program. In the case of StarOffice, the StarOffice Base module controls both components, so that you don’t have to

worry about or learn the cryptic text commands. You can find further information using the StarOffice help function under the key word Adabas, and the Internet on the Adabas D homepage under http://www.adabas.com /. Trouble shooting at start-up: If Adabas D won’t operate, despite being successfully installed, then this problem is most probably caused by either missing or incorrect


STAR OFFICE

how we want to set up our database. Even if you create a new database, you should determine the structure in advance. This is necessary as in most cases, the subsequent modification of a database structure can lead to a not insignificant amount of lost data. Each database consists of one or more tables, in which the individual data is stored. Each column contains data belonging to a certain category such as the author or title of a CD. The rows then contain the complete data record; in our case a row would have all the information about a certain CD (see. figure 7). We will create two tables for our example: the first contains the information of the individual CDs, the second contains all the details about the lending out of CDs. Although this sounds very much like having to enter the data twice, fortunately with a modern database like StarOffice’s Adabas D, this is no longer the case. This program utilises various linking mechanisms to permit the connection of tables containing different types of reference information. In our example, we will create a special database array in the second table, which refers to the appropriate lent CD in the first table. In this way double data entry can be simply bypassed. More information will be given on this in the second part of our workshop. The CD administration presented here is only a small example. The larger the table, i.e. the larger the quantity of the data to be stored, the more difficult it becomes to find the right data allocation (what info one puts in which table). A tip is to try to keep the number of data arrays stored in a table to a minimum, thus keeping the number of columns as small as possible. It is of course also possible to keep all the data in just one, large table. This is advisable however only with smaller volumes of data, since increasing table size will not only make the database access slower, but it also makes it easier to lose a clear overview.

KNOW HOW

additional module, you can also change to a database format built into StarOffice Base, for example dBase. The following steps are more or less identical for all database formats. StarOffice Base takes over the control of the database (which operates in the background) thus making a uniform user interface available for each format. If you want to use Adabas D but have not yet installed it, you should do this now. If you have StarOffice and Adabas D as a part of your distribution, you can install these using the attached set up program. You can refer to your manual, if necessary, for further assistance. If you don’t have StarOffice on a CD ROM, you can download Adabas D free of charge from StarOffice’s homepage http://www.sun.com/staroffice/. Those in possession of a StarOffice CD should put it in, switch to the linux/adabas directory and start the adabas program. After this, simply follow the commands given by the installation program’s graphic interface. After successful installation, you will have to log off and then log on again to the Linux system. The reason for this is because Adabas D changes some environment variables during the

Figure 1: This is the window in which you determine the type of database you want to use. In our example this is Adabas D

Installation In this Workshop, we want to administer the previously mentioned data using the provided database Adabas D. If you don’t want to install this

environment variables. During installation, the set up program automatically tries to complete some of the entries in one of the following hidden files: .bashrc (together with sister file .profile), .cshrc or .tcshr: If none of these files are available in your home directory, you should first check your manual to find out which shell your Linux system uses. (Most Linux distributions use Bash as the standard shell.) When you have

found your shell, you must create an empty configuration file (appropriate to your shell) with a text editor. If you are unsure of your shell, you can also create all four of the files specified above. Then install Adabas D again. Problems during operation: If StarOffice Base gives you an error message, then you can click the “Extras” button to receive a detailed description. In order to be able to

interpret the error description completely, you need both a good knowledge of the English language, as well as a good knowledge of the database language SQL. The StarOffice help unfortunately gives no information about how Adabas D errors can be corrected. For those who encounter running problems, this leaves only a search on the internet or a change over to a dBase based database.

14 · 2001 LINUX MAGAZINE 29


KNOW HOW

STAR OFFICE

installation. The renewed logging on to operating system set these back to their correct values (refer Box “Adabas D “).

Starting up

Figure 2: An Adabas D database needs a password as well as an administrator name

When all the preparations are finished and finalised, StarOffice can be started. You should first open Explorer from the desktop and place this to the far left of the screen (View/Explorer). This enables the only quick and easy access to all databases and their components. Make sure that the content of the group Explorer is visible. If this is not the case then click the button of the same name in the Explorer window. Finally, fix it by pinning it to the Desktop so that the work surface doesn’t disappear under it. Now we can create our music database. To start off, select New/database from the menu. A window appears, on which you must enter some important basic settings. Under the General register, enter a name for your new database, for example MusicDatabase. Next, determine the required database format in the Type register. Adabas D is selected by default. As already mentioned, you also have the possibility of selecting another format, such as dBase. If you have decided to go with Adabas D, then the Server Administration password registration must appear. The absence of this regististration screen is a safe indication that Adabas D either could not be started or could not be reached by StarOffice Base (refer Box 1, Adabas D). In the case of a dBase database, go to the Type register and enter the input path, in which your database is to be stored, into the Directory field. If you use Adabas D, go to the same field (here named Data Source) and enter a name up to a maximum of eight characters long. This could be for

30 LINUX MAGAZINE 14 · 2001

Deleting a database Adabas D: First note the name of your database, how it is denoted in Explorer. Right mouse click on this entry and select Properties? Select the second register Type and make a note of the name in the Data Source field. Leave StarOffice and switch over to the file manager, to the User/Explorer directory in your StarOffice directory. The latter should be located (as a standard) in your home directory. Delete all files that include the name of your database in this directory. After this, go to the sql subdirectory of the Adabas D installation. Delete all files that contain the same character string before the dot, that you previously identified as Data Source in StarOffice. Repeat the above procedure in the config subdirectory. To finish off, delete the subdirectory with the name of the data source in the work directory. Thus is your database finally deleted. dBase: It’s enough here to right mouse click the database name in Explorer and select Delete in the context menu. Your database is completely removed as soon as you confirm this by clicking Delete in the popup dialog window. example musicdb for our CD administration record. Adabas D uses this name for the internal identification of our database. After you’ve done this, go ahead and click New Data Source. You will now see a popup window. StarOffice has already filled in most fields with sensible values for you. Only the database administrator needs to receive a user name and password. This is necessary as Adabas D permits several users simultaneous access to the database. The administrator is in this case a special user with special rights. He or she may unconditionally change (and also delete) all areas of the produced database. The administrator name can, for example, be as the Linux system user name. The name should not contain umlauts or special characters, as this may cause identification problems at a later date. After this, click on Password and enter your secret password into the two data entry fields. Click on OK to close all windows. You will land in a dialog window entitled Properties of Music database. You may need to exercise some patience here (especially those of you with older or slower computers) as, on the one hand Adabas D only loads in the background, and on the other hand the database must be set up and opened. StarOffice will freeze during this time – DON’T PANIC. StarOffice should have automatically filled out all the other registers of the Properties of Music database window. You have the possibility of determining if you want Adabas D to automatically close when you quit out of StarOffice. To do this, open Server Administration register and mark the End Service When Quitting StarOffice switch.


STAR OFFICE

Another click on OK will open the database on the desktop, and at the same time open a new entry in Explorer. The settings dialog, which you have just left, can be called up at any time. This is accessed through the right mouse button context menu. To do this, right mouse click the name of the database in Explorer and select Properties. Have a look at the status bar of the StarOffice desktop (located at the lower edge of window). There beside the clock, you will see a small display light indicating the status of Adabas D (refer Figure 7). A green colour indicates that the database is operational. If you have several databases open, then each database will have its own individual status light. To find out which status light corresponds to which database, activate the Tool Tip assistance (Help/Tip), and position the cursor over a status light for a couple of seconds. A display indicating the name of the corresponding database will pop up.

Creating Tables Four symbols should be now located on the work space of the desktop. These can be used to create new forms, reports, queries or tables, as well as administering those that already exist. If these symbols are not displayed automatically, then double click the database name in the Explorer window. Alternatively, you can do this directly in Explorer. Clicking on the plus symbol in front of the name of the database will bring up the same symbols as those on the desktop. We will first create two new tables for our CD example and then later fill these with relevant information. The first table will be dealt with in this part of the workshop and the next part will deal with the second table. The Autopilot will be used for the first table. This will come in handy later, by providing us with some helpful functions. This small

Figure 3: The database is open. Note that the database can be accessed both via the desktop and via Explorer.

KNOW HOW

aid offers a whole range of ‘ready made’ database items, which we then only have to adapt to our own needs. Right mouse click either the table symbol on the desktop or the appropriate entry in the Explorer window. Select New/Table/Autopilot from the context menu. Now you have to select the Personal line from the drop down menu in the upper selection list of the pop up window. A list will then appear below this, displaying a selection of tables that autopilot has already pre-defined for you. For the purposes of our CD administration, we will want to select the Music Collection choice. Click Next to proceed. The left side of figure 5 shows some suggestions of possible database fields. You can select the fields that are applicable for you by marking a candidate in the left list and then clicking on the single arrow. If you would like to transfer all fields to your database, you merely have to click the double arrow. If you shifted a field on to the right page by mistake and want to remove it, then you can use the arrows in the same way to shift it to the left again. The entries in the right list will then form the columns of the database table. The list entries from top to bottom correspond to the columns from left to the right. This, in particular, means that the entry of data takes place in exactly this order: For example if Author is located in the list above Album Name, then you must first enter the authors and then the album names. For our CD collection, you should transfer the following fields over to the right hand list: Music ID, Artist, Album Name, Music Category and Length. Make sure that they are in this order. These fields are sufficient for our small example database. The first field, Music ID, will help us to later link the two tables together. When you are finished transferring the above fields,

Figure 4: With the help of the autopilot, a selection of preformatted tables is presented. The settings shown in this picture should be selected for our CD administration database. 14 · 2001 LINUX MAGAZINE 31


KNOW HOW

STAR OFFICE

and you can begin with the entry of your CD data. Please note that the name of a dBase table may only be a maximum of eight characters long. StarOffice Base also offers the option of using longer names, however this can lead to problems in the interface with the autopilot.

Data entry

Figure 5: Not all suggested fields will be needed in our example. All fields on the right list are transferred to the table.

Figure 6: Renaming database fields

click Next. In the next step, autopilot will offer you the possibility of renaming both the name of the table and the names of the individual fields. To rename database fields, go to the left list and mark the field, whose name you would like to modify. Then simply change the name in the Field Name data entry field. Click the Confirm button to allow the modified name to be assigned to the selected field. For the purposes of our example, rename the Music ID field CD Number. You can leave the suggested table name unchanged, i.e. Music Collection (or Musicco1 in the case of a dBase database). Click Next, and then Create in the next dialog window to finish setting up this table. The empty table is then opened onto the desktop,

32 LINUX MAGAZINE 14 · 2001

In order to get the hang of the data entry process, go ahead and use the keyboard to enter the information pertaining to a couple of your CDs. You can move between fields either by clicking the mouse or pressing the tab key. As soon as you begin with the entry, StarOffice Base creates a new, empty line, which is marked with an asterisk in the first (nameless) column. As well as this, the line in which you current data entry field is located will be marked with a Pen symbol. Please note that a data line in Adabas D is only then saved, when you either change the line or save the table (by clicking the diskette symbol in the symbol bar or by selecting File/ Save Current Data Record). After finishing the entry for a line, you can navigate within the table using the arrow keys. A small triangle in the nameless column shows thereby, which data record you are currently in. If you want to escape with out saving changes or want to delete the data record you have just created, all you have to do is right mouse click the appropriate line in the nameless column to the left. Then select Delete Row or Undo: Data Entry from the list of functions in the context menu. You will also find, located to the left of the horizontal picture bar at the bottom edge of the screen, all the navigation functions. You can: use the arrows to move between the individual data records, use the asterisk symbol to create new entries, or enter a number into the input field to land directly on the corresponding data record. When entering the data, you will notice that you must always enter a unique value into the first field (in this case CD Number). The reason for this is that this field was defined by the autopilot as the “Primary Key Field “. It is thereby guaranteed not only that for each data record only one CD Number exists, but also that this number is assigned only once. The occurrence of double lines is automatically prevented in this way, and at the same time double CDs (with same name) are able to be differentiated from each other. More information on this will follow in the next section of the workshop. You will have probably observed by now that the entries in the Play Time field are always brought into a uniform format by StarOffice Base. As in all databases, StarOffice Base allows all fields to be assigned with a specific type. In this case, the autopilot determined that the Play Time field contained clock times. During the data entry process, these are automatically brought into an


STAR OFFICE

KNOW HOW

appropriate, uniform format by StarOffice Base. If your CD has for example a playing time of 79 minutes, then you can enter 00:79; this will then be converted to 01:19:00.

Size and Scale Apart from the above, using a StarOffice Base database table is similar to a StarOffice Calc table: Copy and paste, as well as the modification of a cell are all carried out similarly using the appropriate menu functions. The same also applies to the column width, row height and the formatting of a table. If, for example, the name of an author does not fit into the appropriate field, then there are several ways of moving it into the right light: The first possibility is executed by dragging the mouse. Place the cursor in a position between two column inscriptions so that it changes into a double arrow. If you now hold the left mouse button pressed and move the mouse, you will change the size of the left of the two columns. Another method is to first left mouse click the column inscription, thereby marking the entire column. Press the right mouse button and select Column Width? from the context menu. Finally, enter the absolute value for the desired column width into the input field in the popup window, and click OK. Alternatively, you can mark Automatic in the same popup window. The width of the selected column will be thereby adjusted to the width of the column text.

Saving Data As previously mentioned, StarOffice Base saves each row directly after the entry in Adabas D has been completed. For this reason it is not necessary to save the table before closing. – The table is always kept up to date. You can locate all tables in the Explorer window below the appropriate database entry. Click the plus symbol in front of the name in Explorer to expand that part of the tree. Once found, double click the name to open the table. As you will be able to see, three tables already exist for our

example database. The two additional tables are created automatically by Adabas D. They administer running information that the database needs. In addition to this, the user name of the creator is located in front database name. On the basis of this, one can detect who this table belongs to. The first part of our workshop comes to an end here. You shouldn’t however delete the data you have entered, as we will need it for the next part of the workshop. There, we will investigate more of the interesting functions offered by StarOffice Base. We will also complete our example database with the second table.

Figure 7: An empty database table, created with the assistance of the autopilot

Figure 8: A finished database table with some example data. The pen in the unlabelled column to the left shows that the data record in this line is currently being processed.

14 · 2001 LINUX MAGAZINE 33



QT

KNOW HOW

GETTING STARTED WITH QT JONO BACON In this issue we will begin taking a look at Qt, and start to write some programmes using it. Before we get started, we should take a look at some of the concepts of writing Qt software.

On your marks... To get started, lets actually look at what we need. The first thing is fairly obviously Qt itself. You will also need the various compilers, linkers and libraries to build your software. This all usually comes as standard with most modern Linux distributions. If you have any problems, please refer to your distribution manual. The other thing you will need to be familiar with is C++. Qt software is natively written in C++, and although there are bindings for various other languages, I will be focusing on C++ in this series. If you do not know C++, or would like to brush up on it, do a search for c++ on http://www.google.com/ and you should get plenty of documentation. Although you do not need anything in particular to write the code, apart from a text editor of some description, I would suggest using an IDE for your development. For these purposes I will be using KDevelop as it is an excellent IDE for Qt and KDE development (as well as many other types of project also).

inherit features and functions from other classes, so you can build up a comprehensive set of functionality for higher level classes. Qt is primarily a graphical toolkit, and as such provides a number of on screen objects such as scroll bars, buttons, checkboxes etc, called widgets. These widgets are the primary objects you will use for user interaction and for the visual look and feel of your application. Although there are lots of graphical widgets, there are also a number of classes for dealing with behind the scenes processing, network access, data management etc. Qt provides a number of convenience classes written to make things such as stacks, linked lists, tree’s and other such structures easier to use. Qt also includes a clever and sophisticated system for giving your on and off screen objects functionality. This system is called the Signal and Slots system. I will be covering this in more detail later in the series. The basic functionality of the system is connecting desired functionality to your

How Qt works Qt is a powerful and flexible toolkit, and it is important to get to grips with some of the concepts of how Qt works. I will give a quick overview of the concepts here, but I will cover certain concepts in more detail as we continue the series. Qt contains a number of classes. Each class does something specific and provides a lot of functionality. There are a number of classes that

Hello world! 14 · 2001 LINUX MAGAZINE 39


KNOW HOW

QT

objects when you interact with them. An example would be if you click on a button, a dialog box pops up.

Getting going OK, let us get started on our Qt coding expedition and resurrect the traditional Hello World! program. Type in the following program into your editor or IDE and compile it. For a few details on compiling Qt code, see the Compiling Qt Programs box. 1 #include <qapplication.h> 2 #include <qlabel.h> 3 4 int main( int argc, char **argv ) 5 { 6 QApplication a( argc, argv ); 7 8 QLabel lab(“Hello World!”, 0, “label”, 0); 9 10 a.setMainWidget( &lab ); 11 lab.show(); 12 13 return a.exec(); 14 } This simple program simply creates a window and puts Hello World! in it. Let’s take a look at how this program works: Lines 1 and 2 include the relevant header files for the Qt classes we will use. We are using QAppication and QLabel, so we therefore include

these include files. On line 4 main() begins with the command line arguments we could process if we wanted to, we don’t need to on this occasion though). On line 6 we then see the first part of our Qt program. This then creates a QApplication called ‘a’, which accepts the command line arguments from main(). Each Qt application must have one QApplication object created. This class deals with application wide settings and garbage collection. Once we have created our QApplication object, we can then create our text. Line 8 is where we create a QLabel object called ‘lab’, passing it some information that is useful when creating the object. The main two arguments to be familiar with on this line are the “Hello World!” argument which is the text that appears on the label, and the third argument, which is the parent of the label, details in a moment. As we have only one widget, we can set the parent argument (the third argument) to 0, and this puts the label in a new window. The next part of this program is on line 10 where we use the setMainWidget() method to set the main widget of this application. Although this sounds obvious, it is quite important as when the main widget is killed or destroyed, the application exits. It is not essential to set the main widget, but most programs do. The next line in our program is line 11. This line shows the QLabel widget. It is important to remember that Qt widgets are not shown by default, and therefore you must run show() on them, alternatively other classes and methods automatically run show() for you. The final line on line 13 is where you let Qt take over interaction of the widgets and take control.

Parents and children OK, so now we are playing the Qt game, lets discuss what this whole parent and child malarkey is all about. Parent/Child relationships are one of the key aspects to GUI programming, and a concept inherent in Qt. The idea is that you can have a widget that is a parent, and that there is another widget that sits on the parent widget called a child. An example of this would be a window with 4 buttons in it. The window would be the parent, and each button would be a child. This concept of a parent and child relationship is utilised in virtually every graphical widget in the Qt toolkit. At this point it is a good idea to point out that the Qt documentation is wonderful and discusses using the various classes and provides lots of useful information. You can find the documentation by opening up your web browser and looking at $QTDIR/doc/html/index.html. Lets take a look at the various ways we can construct a QLabel like we did in our first program. The QLabel class documentation tells

The QPrintDialog Widget 40 LINUX MAGAZINE 14 · 2001


QT

KNOW HOW

us there are the following constructors available: QLabel ( QWidget * parent, const char * name=0, WFlags f=0 ) QLabel ( const QString & text, QWidget * parent, const char * name=0, WFlags f=0 ) QLabel ( QWidget * buddy, const QString &, QWidget * parent, const char * name=0, WFlags f=0 )

As you can see from the code, I used the second line from this selection of constructors. This allows us set the text of the QLabel instead of using setText() to set it after we create the object. You can see that the second argument with the second constructor is the parent of the type QWidget *. A QWidget is a fundamental class in Qt that can act as a parent for other items. Typically the QWidget is used as an area of screen that can hold other widgets. An example of using a QWidget as a parent would be: 1 #include <qapplication.h> 2 #include <qlabel.h> 3 4 class LabWidget : public QWidget 5 { 6 public: 7 LabWidget( QWidget *parent=0, const char *name=0 ); 8 }; 9 10 LabWidget::LabWidget( QWidget *parent, const char *name ) 11 : QWidget( parent, name ) 12 { 13 setMinimumSize( 200, 120 ); 14 setMaximumSize( 200, 120 ); 15 16 QLabel * lab = new QLabel(“Hello World”, this, “label”, 0); 17 lab->setGeometry( 80, 50, 75, 30 ); 18 } 19 20 int main( int argc, char **argv ) 21 { 22 QApplication a( argc, argv ); 23 24 LabWidget myWidg; 25 myWidg.setGeometry( 200, 100, 200, 120 ); 26 a.setMainWidget( &myWidg ); 27 myWidg.show(); 28 return a.exec(); 29 }

The QTextBrowser Widget displaying a HTML page

create this QLabel on line 16 and use ‘this’ we are using the QWidget as a parent. The only other difference is that I set the geometry of the QLabel on line 17, and I set the Geometry of the LabWidget object (which is QWidget derived) on line 26.

On we go next month... Well that’s all we have time for this month, but next month I will be looking at some of the other widgets and layout managers to make your interfaces more streamlined. Stay tuned folks...

Compiling Qt Programs Compiling Qt programs is similar to compiling other software using libraries on Linux machines. It is suggested that you read the gcc manual and HOWTO’s at http://www.linuxdoc.org/. Typically you need to make sure you link with -lqt and other XFree86 linker flags (these may include -lXext -lX11).

In this example the application basically behaves pretty much the same, although I created a class called LabWidget. This LabWidget class inherits from QWidget on line 4, so therefore when we 14 · 2001 LINUX MAGAZINE 41


KNOW HOW

APPLE MAC

BRING OUT THE

GIMP

The Mac. Graphic Design. These phrases are practically inseparable. Before 1984 there was an entire career option missing, that of ‘Mac Operator’.

JASON WALSH

The next generation UNIX OS, Mac OS X will, no doubt cement Apple’s domination of the creative industries further with its improvements to the system such as the Acrobat based Quartz Display Layer, pre-emptive multi-tasking and protected memory. Graphic Design, however, isn’t always about expensive London based studios. There are many smaller design houses and indeed freelancers using Apple technology and with the great OS X lock-out for pre-G3 machines, powerful and expensive computers are going to become expensive paperweights unless they adopt another strategy. So what has this got to do with Linux, you may be asking? Well, PPC/Linux makes a great operating system for older Power Macs. However, it doesn’t matter how good your OS is if you don’t have the applications, and the titan of graphic design – Adobe Photoshop is not available for any version of Linux. In true open source style, however, there is an alternative.

The GIMP - The GNU Image Manipulation Program GIMP is a bitmap graphics editing application. This in effect means that unlike for example, KIllustrator, which produces graphics according to mathematical principles, GIMP and programs like it give you a blank canvas on which you can slap around virtual paint. This kind of application is ideally suited to photograph manipulation and the creation of website graphics.

Scribus vector drawing

As was stated last month GIMP on Mac OS X is a fudge. This is because it is effectively a quick and dirty port of the PPC/Linux version and requires that Mac users install not only the application, but also the X Window system, a window manager and the GTK+ toolkit, none of which are otherwise required for OS X. With PPC/Linux these are all part of your distribution, as is the GIMP itself. GIMP, a Linux stalwart, is perhaps more important to PPC/Linux users than to their x86 cousins. The Macintosh is a de facto standard in Graphic Design and given Apple’s OS X strategy alienating owners of older Power Macs, a combination of a modern UNIX based OS and a professional level graphics application may well be irresistible to some Mac users. From the perspective of a Mac based designer, the GIMP is a step backwards – but a relatively small one. GIMP is, in terms of look and feel, most like Adobe Photoshop 3.0. With Photoshop now approaching version 6, this may seem like going back too far, but it is important to note that developments in the open source world are surprisingly fast and those willing to try out bleeding edge and experimental releases will see progress soon. Remember that by version 3, Photoshop had become more or less what we’re used to today. Upon booting GIMP you are presented with a screen that is undeniably Photoshop-like, or Macromedia xReslike for that matter. The first thing to do is set the dimensions and resolution of your image. After this tools can be accessed from a palette on the left of the screen. This includes all of the usual tools such as Brush, Airbrush, Pencil, Text, Lasso, Fill, Magnify, Smudge and Clone. In addition, images are built up in layers, as in Photoshop. These layers can then manipulated individually offering the artist total control over the image. GIMP has built-in support for many file formats including GIF, JPEG, PNG, XPM, TIFF, TGA and BMP. This is important to professional designer.

Plug Ins vs Script FU One of the key features of Photoshop’s domination of the graphics market is its extensibility. Through the use of small helper applications, known as Plug Ins, 42 LINUX MAGAZINE 14 · 2001


KNOW HOW

Photoshop can be expanded into a tailor made graphics powerhouse. In fact, Photoshop Plug Ins are so ubiquitous that many other graphics applications support them. GIMP, however, does not. Provided instead is a basic series of effects such as Blur, Motion Blur, Mosaic and so on. Added to this is the impressive Script-Fu system. This is a built in method of scripting the GIMP to create impressive effects time and time again. In essence, Script-Fu allows the user to create scripts that can be invoked within GIMP. For Mac users, the best example is probably Applescript meets Photoshop Plug Ins. The only drawback here is that there is an entire branch of the software industry dedicated to creating Photoshop Plug Ins. With GIMP, the majority of regularly used effects are included or are available.

The Downsides The biggest single drawback of the GIMP is its lack of support for CMYK. CMYK is an acronym for Cyan, Yellow, Magenta and blacK – the four colours used in professional printing scenarios. GIMP developers have pledged support for CMYK separations. So where does this leave an otherwise professional application? Well, despite lack of support for the CMYK process I have described GIMP as a professional application, and such it is. For heavy duty RGB (Red, Green Blue - images designed to be displayed on screen) work, such as JPEG manipulation it works like a dream and the entry requirements aren’t too steep. A 120MHz PowerPC 603e copes admirably. Perhaps more important here is to have a lot of spare RAM and a capacious and speedy hard drive as image size is limited by the amount of available RAM and disk space. I would recommend at least 128MB RAM and a 7,200RPM drive. As any designer will know, this is quite light compared to modern Photoshop requirements. The other main contention is not with GIMP itself, rather it’s what else is available. Photoshop is only one piece of the design puzzle. What is desperately needed for PPC/Linux is a suite of graphics tools. Clones of Quark XPress, Adobe Illustrator & Macromedia Director, Dreamweaver and Flash. These programs form the basis of around 90 per cent of studio work these days. GIMP can be wholeheartedly recommended, but what about the rest? Well, KIllustrator is coming along and though it’s decidedly lower level. Director, however, is another matter. Only Macromedia can provide this. A new open source DTP layout application similar to Quark XPress and Pagemaker is available. It is called Scribus and can be obtained from : http://web2.altmuehlnet.de/fschmid/scri_en.html

Info The GIMP home page: http://www.gimp.org Mac GIMP. OS X GIMP resources: http://www.macgimp.org Adobe’s website: http://www.adobe.com 14 · 2001 LINUX MAGAZINE 43


KNOW HOW

MIGRATION

Desktop customisation: part 2

TAILOR-MADE DESKTOP ANJA M WAGNER

Working with a graphical user interface only really starts being fun once the settings have been adapted to your own preferences. Under Windows, the principal configuration options for the desktop can be found in the Control Panel. KDE, probably the most commonly used Linux graphical interface, takes a very similar approach: you will find the important options for customising your work environment in the KDE Control Center. In this workshop we will show you in KDE how to adapt the settings for mouse and keyboard, date and time, screen resolution and colour depth and other personalised settings you will know from the Windows Control Panel. We will also introduce you to the KDE login manager. We will be referring to Windows 98 SE & Me and SuSE Linux 7.1 with KDE

2.0.1. All but the details describing screen resolution will be relevant to those using Linux distributions other than SuSE. The mouse and the keyboard each have their own section in the Windows Control Panel. The KDE Control Center combines both under the Peripherals menu item. This hides a tempting setting for anyone changing from Windows to Linux/KDE: Linux graphical interfaces are pre-set to allow you to open files and directories and to start programs with a single click. This is convenient, but can almost drive dyed-in-the-wool Windows users mad. So if you cannot live without the double-click,

Figure 1: To single or to doubleclick, that is the question

Figure 3: The folder options are well hidden within Explorer or My Computer

Figure 2: The Windows 98 Control Panel only understands the double-click

Figure 4: How to save thousands of mouse clicks under Windows

44 LINUX MAGAZINE 14 路 2001


MIGRATION

Figure 6: Some things can only be done by the Superuser root

Figure 5: Date and time are concealed within System

disable the option Single click activates/opens on the General tab under Mouse. Now KDE will also expect a double-click. But perhaps you should try it the other way around: after you get used to the single click in KDE, change the setting in Windows. For Windows 2000 this is done via Control Panel/Mouse. On the Keys tab you can enable the option Open with single click (point to select). Windows 98 SE has hidden the single-click facility in the folder options. Open the menu View/Folder Options in My Computer or in Explorer. On the General tab enable the option “Custom, based on settings you choose” and click on Settings. There, in the section “Click items as follows” select the option “Single-click to open an item (point to select)” and confirm with OK. Back to the mouse in the KDE Control Center. The ability to Automatically select icons means that files and directories whose icons come into contact with the mouse pointer are selected without clicking. Use the slider to specify how long the time delay between contact and selection should be. Even if you have enabled single click it is still possible to activate an icon without opening it if you press the Ctrl key at the same time. No need for the left handers out there to despair either, both KDE and Gnome let you swap the

Figure 7: A welcome from Kandalf, the wizard

KNOW HOW

mouse button assignment. Under Advanced you can adjust mouse settings using sliders: pointer acceleration, pointer threshold, double-click interval, as well as start time and start distance for dragging with the mouse.

Timing Just as the mouse is hiding within the Peripherals menu, the date and time settings are concealed under System in the left column of the Control Center. This is where you can change the day, the month, the year and the time. There is nothing for normal users to configure on the Time Zone tab. Only the system administrator root can activate the time zone selection list. If you click on the root button, you are prompted for his password. The same applies for System/Login Manager – this can also only be manipulated by the Superuser root.

Login To work with Linux, whether text-based at the console or using a graphical interface, and irrespective of whether your computer is part of a network or a single machine, you must log on to the system. You can design the appearance of the

root: One of the differences between Windows and Linux that the migrating user is faced with immediately is the system login. The reason: Linux is a multiuser system whether it is implemented as a network with many machines or as a single computer for home use. Only the system administrator “root” possesses all rights and opportunities of amending the operating system. During the installation of Linux at least one normal user must be set up in addition to the system administrator. For day-to-day work with Linux you should always log in as a normal user, because if your rights are limited you cannot damage the system through carelessness or inexperience.

Figure 8: An ample choice of icons 14 · 2001 LINUX MAGAZINE 45


KNOW HOW

MIGRATION

Figure 10: What picture do yu want to be?

Figure 9: Write your own greeting

graphical login using the Login Manager. By default, a clock appears in the left hand part of the login window. Alternatively, this could be an application, action or device icon. In order to change this, select Show KDM logo in the logo section and click on the button with the logo. Choose a logo from the dialog window that is now open, for example Kandalf, the wizard. You can find him under Other icons (Figure 8). Confirm with Apply/OK. The greeting above the small pictures or icons in the login manager can be changed using the Greeting string text box. Since we are talking about the graphical login the individual images for different users should be 48x48 pixel png files. Name them according to the respective users and save the image files in /opt/kde2/share/apps/kdm/pics/users. They will then appear automatically during the next graphical login, and by clicking on the picture the name of the user is inserted into the User text box. The remaining login manager tabs are used to specify the font and size of the greeting and to design the login background. This works in the same way as designing the background for the KDE desktop (see Workshop

Figure 11: Set up new keyboard 46 LINUX MAGAZINE 14 · 2001

part 1, Linux Magazine 13). The tab System/Login Manager/Users allows you to select users who should not appear with a picture or icon during graphical login. All users who do not have an individual login image assigned to them are represented by the default icon of a black head in profile. This can be changed as well. Click on the image and select a different one in the dialog window Select icon. Under Sessions you can specify who is allowed to shut down the computer (alternatively all users or only the system administrator root) or whether shutdown is only possible using the text-based console. Confirm all settings with Apply/OK, log out and have a look at the result of your entries.

Let’s get personal A number of important settings that are contained in the Windows Control Panel are combined under the menu item Personalization in the Control Center: ● The entries under Email refer to the configuration of an email account in Outlook Express or Outlook. We will be dealing with this in

Figure 12: Navigating the mouse pointer via the keyboard


MIGRATION

Figure 13: Changing screen settings via the Windows Control Panel

more detail in a future workshop on the subject of email clients. ● Under Country & Language you are already familiar with changing the settings on the Locale tab. KDE pre-sets meaningful characters and values for Numbers, Currency and Time & Dates according to the country selected. However, these can all be changed. ● Use Passwords to specify, whether, and if so which, characters will be displayed instead of the typed password during password entry. The maximum length of time for which passwords remains active once you have typed it, for example to access a control utility is 1200 minutes (20 hours). After that you would have to retype the password to access the features again. This stops you entering the root password and it always remaining open. ● During the installation you specify model and layout of your keyboard. You can amend these settings under Keyboard Layout. For example, if you have newly acquired a natural keyboard, you can select this in the Keyboard Model drop-down menu. ● By default SSLv2 and SSLv3 (Secure Sockets

Figure 15: Dialog windows make configuration easier

KNOW HOW

Figure 14: The long road to SaX

Layer) are enabled for the encryption of KDE Internet transactions. SSL’s successor, TLS (Transport Layer Security), is also supported by KDE. Which security and encryption standard is used does not depend on the graphical interface or the browser, but on the server on the other side. ● Accessibility allows settings that make things easier for people with physical disabilities. In addition to acoustic warnings it is possible to configure visual warnings. The mouse pointer is meant to be able to be navigated via the number pad keys. This did not work for our USB mouse however.

Changing resolution The Windows Control Panel and the KDE Control Center have similar approaches to many subjects. However, if you want to change the monitor’s screen resolution and colour depth, this is done in Windows under Display on the Settings tab. A dropdown menu and a slider let you change your monitor settings quickly (Figure 13). You will search in vain for this option in the KDE Control Center. In order to make these changes you need to start another tool. If you would like it to also have a graphical interface, choose SaX or SaX2. SaX

Figure 16: Monitor settings at a glance 14 · 2001 LINUX MAGAZINE 47


KNOW HOW

MIGRATION

Figure 17: Everything is neatly sorted in the drop-down menus

stands for SuSE Advanced X Configuration Tool. The window manager (for example KDE) together with the X-Server, which sits directly on the graphics card, is responsible for making the Linux X-Window interface work. If your system uses Xfree86 4.0 you must use SaX2 for the configuration. You will find both of these tools under K/SuSE/Administration/Configuration/SaX or SaX2. If you are not logged in as root, you will be prompted to enter the root password. It takes a while for the tool to start, as it reads in the data of the existing configuration first. As you are going to change an existing configuration, namely the screen resolution and colour depth, select Use/change existing configuration in the first step. SaX or SaX2 can also be used to adjust mouse, keyboard and graphics card settings. Click on Next until you reach the Desktop Settings. There, click on Color or Resolution and then on the Settings button. In the next dialog window you will find the properties you require on the Colors tab. Let’s assume you would like to increase the resolution

X Window System: An X window system, normally abbreviated to X, consists of an X server, X clients and a window manager. These components provide the user with a graphical user interface. Most Linux distributions allow the configuration of the X window system during the installation. An X window system is network enabled, which means the X server does not have to be running on the same machine as the window manager and the clients, thus saving on resources. For Linux on home computers all modules are running on the same machine. The X server administers the hardware and is therefore attached directly to the graphics card. An X client, say a program which wants to display something on the screen, passes its information to the X server, which in turn passes it to the window manager. KDE, Gnome, Windowmaker and others are above all window managers. They control the appearance and behaviour of the windows and allow the creation and design of virtual desktops. from 1024x768 to 1152x864 pixels: first of all, consult your monitor’s manual to see whether it can cope with the resolution that you are planning to use. If you are intending to change the settings for the horizontal and vertical frequency ranges you must comply with the instructions in the manual, otherwise the device can be damaged irrepairably. This is especially true of very old monitors; newer ones tend to simply switch off when receiving wrong signals. Open the resolution drop-down menu and activate the desired one with a mouse click (Figure 16). The textbox now contains the new resolution. Confirm with OK and Finish. Before saving, and thereby setting the new configuration, you ought to test it. Click on Start (Figure 18). The test screen may seem familiar from the installation of the SuSE distribution. Use the small arrows to the right of the text box to select the required resolution. The tool always offers the lowest resolution as well. Move the test graphic to its optimum position using the arrow buttons so that the grey boxes at the corners of the desktop are visible. To finish, click on Save configuration. You can now exit SaX or adjust more settings. The X window system configuration is held in the file /etc/X11/XF86Config. Root is able to change those settings manually there.

More Migration Part 1 of this workshop can be found in Linux Magazine 13, page 48. This series will continued to bring you helpful information on the migration from Windows to Linux on a regular basis. Figure 18: A new configuration should always be tested before it is saved 48 LINUX MAGAZINE 14 · 2001


BEAROPS

SOFTWARE

BEAROPS LINUX DESKTOP OS JOHN SOUTHERN

Designed to give you everything you need for the home and office and all with a graphical desktop. BearOps Linux has tough rivals to compete with.

A new distribution from the Canadian Alta Terra Ventures Corp. Aimed at both the beginner and seasoned computer techie alike the two CD package does quite well. The installation from the first CD is either via a graphical installer if the video card is VESA2 compliant or it forces a frame buffer install if not compliant. Technical support is limited to a free half hour installation call or free email support. After that support is via a premium rate line. Calls are also international to Canada. That said the installation worked first time finding both a USB wheel mouse and a SCSI interface. There are two possible installation routes. The Auto feature assumes that it can destroy the hard drive contents and perform a new installation from scratch. The Manual install route allows you to dual boot the machine or just keep partitions that you want to. You can choose to use the ReiserFS journaling system or the standard ext2 for your linux partitions. The partitioning tool worked well and correctly resized a Windows partition. The installation took eighteen minutes but this was just the first disk to get the standard configuration loaded. The KDE desktop is started and then the additional programs from the second CD can be installed. These include Star Office from Sun, Mozilla and gPhoto (two versions 0.4.3.1 and 2.0.1). The only disappointment was that the disc had only 250MB of programs and so 400MB of packages were missed at the very least. The manual explains how and where to get additional software and for each compression type

Partitioning the hard disk

how to load and install. The only down side is in the manual. Although well written in clear language that explained, but was not patronising, it gave the appearance of being a photocopy and so a cheap product. The online manual had higher resolution images and so I would recommend printing it out first. Printing is via CUPS and the default browser is Netscape 4.77 supplied with Adobe and RealPlayer.. Overall the distribution would have been wonderful a year back and to be fair if you are after a standard Linux with updated packages this would suffice, yet somehow it now feels dated or at least unfinished. The time and effort of the manual is let down by the poor printing and the system overall could have done with someone adding a few more packages. Without local helpline numbers the distribution may fail to appeal to anyone outside Canada.

Konqueror up and running 14 路 2001 LINUX MAGAZINE 49


PROGRAMMING

TCL/TK

User-friendliness through dynamic menus and L10n

TK À LA CARTE CARSTEN ZERBST

If a program wants to be friendly to its users then it ought to be able to speak their language. Localisation comes as part of Tcl/Tk’s basic package and dynamic menus make applications intuitive for their users. Menus are one of the most important components of any graphical interface. Hidden behind them, in most cases, are large chunks of the application logic. This instalment of our Tcl/Tk series describes how menus can be generated and which options the toolkit offers programmers. Another aspect is the internationalisation and localisation of Tk applications. All of this is possible within the standard core of Tcl/Tk, no additional packages are required. The “menu” command in Tk generates all sorts of menus, from entire menu bars to sub-menus or pop-up menus. Like any other widget, menus can be arranged using the layout managers grid, pack or place. However, it is better and simpler to attach the menu bar to a window: . configure -menu .menu This example attaches the menu “.menu” to the

Figure 1: MacOS 9 doesn’t display menus in the respective window, but always at the top of the screen. Tk keeps to this convention; even tear-off menus are implemented. 52 LINUX MAGAZINE 14 · 2001

main window in the form of a menu bar. As shown in figures 1 to 3, Tk arranges the menu bar according to the relevant styleguide, as appropriate to the operating system on which the application is running. For example, the help menu under Linux is aligned to the right, while under Windows it is leftaligned, following the other menus. On the Macintosh the menu bar of the current application is located at the top of the desktop.

Menus within menus A menu bar contains a number of sub-menus. These sub-menus contain the actual entries, such as commands, radio or check buttons or further sub-menus. The entries can be attached and edited with the menu widget methods “add”, “configure” and “delete”. The example in Listing 1 generates a menu bar and then attaches three sub-menus. Menu labels are more important than many programmers realise. The choice of words and terminology requires a great deal of thought. On the one hand there is limited space available (a maximum of two to three words), on the other hand descriptions should be very precise and unambiguous. Instead of text, menus can display images, as in this help menu (see figure 3). Many users want to keep their fingers on the keyboard while they are working, rather than constantly having to switch to using the mouse. They open menus using the [Alt]-key and another letter key, which is often shown as underlined in menus. In our example this method has been implemented for the Edit and the Help menu. The option “-underline position” tells Tk which letter to underline. This letter is also used to access the sub-menu. Tk creates the relevant bindings automatically.

Tearing off menus Some applications use so-called tear-off menus,


TCL/TK

PROGRAMMING

Listing 1: Creating menus with Tk #!/bin/sh # Example of menus with Tk U exec wish $0 $@ # Creating a menu bar menu .menu # ... and linking it with the mainU window . configure -menu .menu # The sub-menus # Simple sub-menu .menu add cascade -label File U -menu .menu.file # Sub-menu with shortcut <ALT-E> .menu add cascade -label Edit U -menu .menu.edit -underline 0 # Sub-menu with shortcut <ALT-H> .menu add cascade -label Help U -menu .menu.help -underline 0 # The File menu

menu .menu.file # ... with entries for commands .menu.file add command -label Open # ... and separation .menu.file add separator .menu.file add command -label Exit U -command “exit” -accelerator “^q” # Binding for Exit bind . <Control-q> exit # The Help menu (not tear-off) menu .menu.help -tearoff 0 .menu.help add command -bitmap info # The (context-sensitive) Edit menu menu .menu.edit -postcommand menuEdit set context normal # The procedure for creating the EditU menu proc menuEdit {} { .menu.edit delete 0 end

that is menus which can be separated from the main application. A prominent example of this is the Gimp. By default tearing off is also possible for Tk menus, however, it can be prevented with the option “-tearoff 0”. Context-sensitive menus can make an application more user-friendly. Depending on the current environment (the context) they only offer those commands whose use would be sensible at the moment. All other commands are only shown by Tk in grey. This tells the user which commands are available and which of those he is currently able to use. The current state of a menu entry is determined by the option “-state”. A command is usually “normal”, but in its “disabled” state it is greyed out and cannot be selected.

Context-sensitive menus But how do menus become context-sensitive? The simplest way is for the program to re-create them every time they are opened. This is where

Figure 2: The menu bar under Windows does not stand out from the rest of the application if the program does not have its own background colour. The underlined letters are used as shortcuts for accessing the menus.

.menu.edit add command U -label “Dependant command” U -state $::context .menu.edit add separator .menu.edit add radiobutton -label On U -value normal -variable ::context .menu.edit add radiobutton -label OffU -value disabled -variable ::context } # Active area with different cursor frame .a grid .a label .a.b -font {Sans 30 bold} U -cursor crosshair -text “Active area” grid .a.b -padx 25 -pady 25 # Binding for opening the pop-up menu bind .a.b <Button-3> { tk_popup .menu.edit %X %Y }

the menu widget option “-postcommand command” is useful: this command is called by Tk before it opens a menu. Generating a menu normally takes less than a millisecond, the delay should therefore not cause any problem. The individual menu entries are simply created by the script in the relevant mode. However, this simple method fails to work with tear-off menus which are always open and only change their state when the menu is re-opened from the menu bar. Pop-up menus can be just as useful as context-sensitive menus. They are normally accessed via the right mouse button and provide the users with important commands in specific areas of the application which are only relevant there. The command “tk_popup menu x y” is used to open a pop-up menu at any point within an application. The example in Listing 1 creates an active area (see also figure 3) in which the right mouse button opens the pop-up menu. No additional menu is required for this, the existing Edit menu is simply re-used.

Figure 3: Tk menus under Linux come in the familiar Motif look – the menu bar has a raised 3-D effect. The help menu is always at the right-hand side of the menu bar. 14· 2001LINUX MAGAZINE

53


PROGRAMMING

TCL/TK

Listing 2: Localisation with Tk #!/bin/sh # Example for the localisation # of Tcl applications U exec wish $0 $@ package require msgcat # Selecting the system settings msgcat::mclocale $env(LANG) # Loading the language catalogs msgcat::mcload [pwd]

Keyboard shortcuts

Listing 3: German messages msgcat::mcset de “Default is %s” U “Systemeinstellung ist %s” msgcat::mcset de date U “Beispieldatum %2\$i.%1\$i (Tag, Monat)” msgcat::mcset de “Exit” “Beenden”

The more frequently you work with an application the more likely you are to start wishing for shortcuts. The pop-up menus we have just described will help a bit. But rather than fighting your way through different menus every time, a shortcut is a much quicker way of getting to where you want to go. In order for users to be able to learn these shortcuts quickly it makes sense to put them next to the relevant menu entry. This can be done using the option “-accelerator shortcut”. Programmers must be careful, however, not to use standard shortcuts for their own purposes. For example, users expect [Ctrl]+[q] to exit an application. Unlike the “-underline” option, the binding for shortcuts has to be specially created using the “bind” command. If you have a number of such commands, it’s also worth having a look at the powerful virtual events.

Tk multilingual Applications don’t only display text in menus but also in many other areas. Since not all users can necessarily be expected to speak English, interfaces should be available in several languages. That is called localisation or L10n. Under Tcl the Msgcat package is the most suitable for this purpose. It is

Figure 4: Another aspect of localisation is that in US English the month comes before the day, but the reverse is true for UK English, where the day comes before the month. 54 LINUX MAGAZINE 14 · 2001

# Assembling the GUIs label .l -text [msgcat::mc “Default is %s”U $env(LANG)] grid .l label .l2 -text [msgcat::mc date 10 15] grid .l2 button .b -text [msgcat::mc “Exit”] -commandU exit grid .b -padx 5 -pady 5 wm geometry . 220x75 wm title . “Deutsch” #wm title . “English”

part of the normal core of Tcl and will also be used for system messages in the forthcoming Tcl 8.4. Msgcat uses catalogues, which contain translations for different labels or outputs. Listing 2 shows a simple example of using the Msgcat package. The translation catalogue for German must be held in the file “de.msg” (see Listing 3), the English messages are contained in “en.msg” (see Listing 4). The example starts off by setting the desired language (locale) with “msgcat::mclocale locale”. Locales are described using country codes according to ISO 639. The user setting is normally found the environment variable “LANG”. The language catalogues have to be loaded next. This is done with the command “msgcat::mcload directory”. The specified directory should contain one file per language with the relevant translation. The file names consist of the country codes and the extension “.msg”. These files contain a number of commands of the type “msgcat::mcset language” original””translation””.

A catalogue for every language These files are very easy to create with the special editor MSGedit. Within the localised application itself every character string for a message or a label simply has to be replaced with a call to


TCL/TK

PROGRAMMING

Info

Listing 4: English catalogue

Country codes according to ISO 639: http://www.oasis-open.org/cover/iso639a.html MSGedit: http://www.tu-harburg.de/~skfcz/tcltk.html Balloon help: http://purl.org/thecliff/tcl/wiki/534.html Tcllib, BWidgets: http://sourceforge.net/projects/tcllib/ OSCON-Tcl-Papers: ftp://ftp.oreilly.com/pub/conference/os2001/tcl_papers Gnocl: http://www.dr-baum.net/gnocl/ Agenda web browser: http://www.psnw.com/~alcald/tiny_tcl_web_browser.html Etlinux: http://www.etlinux.org/

“[msgcat::mc “original”]”. The command returns the translation from the specified catalogue. If no translation is found “msgcat:mc” returns the original character string so that the application remains useable. The catalogue for the original language is therefore almost empty (see Listing 4). However, in many cases this is not enough: messages often consist of a fixed and a dynamic part. Translations can therefore contain formatting commands, even to the point where the order of the dynamic components can differ between languages. In the example this feature is used to output the date in the right order, once as Day, Month and once as Month, Day (see figure 4).

msgcat::mcset en date “DateU %i.%i (month, day)”

Depending on the environment variable “LANG” the application starts with an English (“en”) or a German interface (“de”). In the tcsh this is set using “setenv LANG en”, in bash with “LANG=en”. An export may also be required. The features introduced here allow you to create pretty user-friendly interfaces. In addition, there are, for instance, help balloons, also called tooltips. How to create these is described at the purl.org website, the BWidgets already contain an appropriate widget. After this excursion to the surface the next article in our Tcl/Tk series will describe how you can create visualisations with VTK.

The author Carsten Zerbst is a member of staff at Hamburg-Harburg Technical University. Apart from researching service integration on board ships, he investigates Tcl in all its forms. He is looking for new tasks in a Unix/Linux environment.

News from the Tcl world Despite the summer break, a lot has happened since the last instalment of our Tcl/Tk series. OSCON has just finished. Naturally this conference also had a Tcl track. The papers for the presentations can be found at the O’Reilly FTP site. Among the topics covered was spoken language as application input and output. The focus, however, was the integration of Tcl in applications for ECAD, one of the Tcl domains.

already exist. Another, very controversial discussion deals with the integration of [incr Tcl] into normal Tcl. A further topic under discussion is theming support for Tk; in this respect Tk is well behind Gtk or Qt. Anyone still wanting to use themes with Tcl at the moment can resort to Peter Baum’s Gnocl which allows the use of Gtk and Gnome widgets.

PDA-capable applications Tcl distribution from Active State Just in time for OSCON Active State have published their own Tcl distribution. The package, a full 31MB when unpacked, contains important extensions along with the actual interpreter, for example [incr Tcl], TclX, Expect, Tcllib and Tkcon. Furthermore, the package is supplied with an installation program and is currently likely to be the simplest way to an all-inclusive installation of Tcl/Tk. You can, of course, still get the individual components free on the net. Special mention must go to Tcllib and the BWidgets. Both are available from Sourceforge in a joint project. Tcllib consists of several modules for everyday problems, such as Base64 encoding, MIME handling or POP3 and FTP access. Like the BWidgets, Tcllib is written in Tcl itself and does not require compilation. The BWidgets are a useful collection of widgets that are normally missing in Tk (see figure 5). All new widgets have been built using existing Tk-Widgets (so-called mega-widgets). The package contains, among other things, a combobox, a tree-widget, a notebook widget and a spinbox. It also supports drag & drop.

Alexander Caldwell has written a small browser and an email client especially for the Linux PDA Agenda. Both applications are geared towards the fairly limited capabilities of PDAs. The use of interpreter languages makes a lot of sense especially in this environment: instead of several applications running, just one interpreter at runtime is sufficient. Scripts can also be stored in a compressed format, with scripts normally being able to be compressed significantly more than binary programs. In Etlinux Tcl scripts even control the entire boot process.

Great plans The Tcl core team is currently discussing the integration of new widgets and additional options in Tk. In many cases implementations

Figure 5: BWidgets contain new widgets for Tk. Tree, Paned Window, Combobox, Notebook and Spinbox are standard features of many modern interfaces.

14· 2001LINUX MAGAZINE

55


PROGRAMMING

C

LANGUAGE OF THE ‘C’ STEVEN GOODWIN

A language so synonymous with computing history and Unix it’s very name is the epitome of the elite. These articles for the beginner, teach you the fundamentals of ‘ANSI C’, as well as providing interest snippets from under

When Stephen Hawkin wrote his best-selling work ‘A Brief History of Time’, he remarked that his editor informed him that every equation would cut the sales of his book in half. In a similar fashion, my editor informed me that every paragraph I wrote without a piece of code would lose half my readership. So, in the interests of keeping everyone happy, here is the obligatory ‘Hello,World’ program. 1 #include <stdio.h> 2 3 int main(int argc, char *argv[]) 4 { 5 printf(“Hello, World\n”); 6 return 0; 7 } 8 /* A variation of the standard ‘Hello World’ problem - seen everywhere */

the hood of the Type the above code into your least unfavourite text editor (omitting the line numbers), save it as ‘myfirsttime.c’ and in a shell type,

compiler.

gcc myfirsttime.c ./a.out or, if you prefer, gcc myfirsttime.c -oMyProgram ./MyProgram

Examples of the pre-processor: #include <stdio.h> #include “myprogram.h” #define VERSION_NUM 1.2 #define MAX_TABLE_SIZE 32 #ifdef _WIN32 printf(“I refused to beU compiled under WindowsU !\n”); #endif

Should you have the development environment installed correctly, Linux should pop back with the phrase ‘Hello, World’.

What’s Going On? The simplicity of the example above belies the fact it contains the vital ingredients that make ‘C’, ‘C’. Namely, ● The pre-processor ● The compiler ● The linker

56 LINUX MAGAZINE 14 · 2001

The compilation process is built from three major steps, executed automatically by ‘gcc’ or ‘make’, in the above order. However, the whole process is just called ‘compilation’; it is very rare to explicitly run any specific step (known as a pass). Only when there are problems would you refer to any specific step, e.g. “Help!!!! My program won’t link!”. See BOXOUT: GCC, for more information on the workings of this process.

The Pre-processor Any line in ‘C’ that begins with the hash mark (#) actually belongs to the pre-processor, not the compiler. The common instructions (called directives) are include (as in our example), define (to create macros) and ifdef (which, along with endif, support conditional compilation). It runs immediately before the compiler, and gets to modify, fix, adapt and generally fiddle about with the source text. By including the header file stdio.h (STanDard Input/Output) we may use the contents of that file within our program, as if we’d wrote it ourselves. In this case, we will use ‘printf’ to output text to stdout. i.e. the screen. By including the name in brockets (‘<’ and ‘>’) we indicate that this file is stored (by default) in ‘/usr/include’ with all the other system header files. If the file were stored in the current directory, we would use double quotes (“) for the name. Relative paths can be used with the name (as are absolute paths, but these are not recommended for portability). The pre-processor will also strip out comments from your source code - and like any good programmer you will have several of them in your code to strip out, right? For example, 8 /* A variation of the standard ‘Hello World’ problem - seen everywhere */


C

Comments begin with the ‘/*’ token, and ignore everything up to (and including) the first ‘*/’ it sees, which ends the comment. They can not, therefore, be nested (since the second ‘/*’ will have already been ignored), but the comment may extend over several lines. /* A comment ‘box’ over four lines */

The Compiler The mother! The daddy! This takes our ‘.c’ file (replete with pre-processing modifications, macro substitutions, and so on) and turns it into a binary file. Not an executable elf file, though. A binary. It is called an object file, and has a ‘.o’ extension. When compiling single files (with gcc) it is usually deleted once compilation has finished. With larger projects (using make files), they are kept to improve speed, since only out of date ‘.o’ files will be re-built. Library files are also ‘.o’ files, but (naturally) these are not deleted after use!

The Linker The final hurdle. It combines ‘myfirsttime.o’ and any specified libraries into a single executable. That is, it links them together. By default, the library file /usr/lib/libc.so is also included - since this contains standard C routines (such as printf) - as is the allimportant start-up code: /usr/lib/crt1.o. If you were writing a program using mathematics (with functions like sin or cos), you would use ‘#include <math.h>’ in your source file, and link in the maths library (/usr/lib/libm.so) with, gcc mathscode.c -lm Execution always begins with a function called ‘main’. So, if you haven’t created a ‘main’ function, the linker will complain with an ‘undefined reference to ‘main’’ error. You will also get this error if you use the ‘math.h’ header file (which says ‘I wish to use the ‘sin’ function), but then fail to link the appropriate (libm.so) library (which says ‘here is the code for the ‘sin’ function I told you about earlier’).

A Break From The Old Routine Every ‘C’ program is made up from routines, called functions. Even the library code (like ‘printf’) is implemented as functions. There are no built-in functions with ‘C’ (see BOXOUT: Design Philosophy), and there is no difference in the way we call a library function, compared to one of our own. Listing 2 uses three invocations of a function in ‘C’:

PROGRAMMING

The function name can consist of any combination of alphanumeric characters, or the underscore (‘_’), but must begin with a letter or underscore. The latter is not recommended as some systems use underscored names for their own macros, variables and functions. Case is important, because the two variables ‘count’ and ‘COUNT’ are seen differently by the compiler. They must also be unique (in the first 32 characters), and must not clash with any of ‘C’ reserved words (see BOXOUT: Reserved Words). If functions could only process information they would still be useful. But not very. Like a Von Neumann architecture, it requires input and output. This is achieved with parameters (sometimes called arguments) and a return type, respectively. All functions require that a return type, and parameter list is given. However, as seen in the example above, the word ‘void’ can be used to indicate that nothing comes out of the ‘Banner’ function - and nothing goes in.

Into the Gap When a function is called, data is passed into it with parameters. As many as you like, as long as each is separated by a comma. Each parameter consists of a type (to describe its size and structure) and a name (or identifier, so it can be referenced). All parameters in ‘C’ are passed ‘by value’, so should the identifier get changed within the function (intentionally, or otherwise) then the data held in calling function will not get changed because only the value was passed to the function.

Listing 2 1 #include <stdio.h> 2 3 void Banner(void); 4 void LeaveGap(int U iLines); 5 6 int main(int argc, chU ar *argv[]) 7 { 8 Banner(); 9 LeaveGap(2); 10 return 0; 11 } 12 13 void Banner(void) 14 { 15 printf(“My U program\n”); 16 } 17 18 void LeaveGap(int U iLines) 19 { 20 int i; 21 22 for(i=0 ; i < U 0iLines ; i++) 23 printf(“\n”); 24 }

Listing 3

We Can Work it Out Now to get information out of a function. One of the limits we have to live with for the moment is that we can only return one piece of data. This is because ‘C’ only supports a single return type. We’ll look at ways around this in future articles. Declaring this return type is done by prefixing the function name with the, er, type you want to return. You then indicate what value you want to return by using the ‘C’ instruction, er, return. (This ‘C’ lark’s not as hard as it looks, is it?) In listing 4, line 16 gives the value of ‘100’ back to ‘main’ which then (at line 7) stuffs it into (the more technical term is ‘assigns it to’!) the variable ‘iNum’. Some people will place brackets around the value to return, but this is a hang over from K&R C dialect and no longer necessary. Note that if the function is declared as having a return type you must provide one, otherwise the compiler will generate an error. Should there be a case where an appropriate value could not be returned (e.g. size of a file that doesn’t exist), then allow the return type to include an error code. In cases where there is no return type (e.g. the function begins ‘void’, as with ‘void LeaveGap(int

1 #include <stdio.h> 2 3 void ParamChange(int iNum); 4 5 int main(int argc, chU ar *argv[]) 6 { 7 int iNum; 8 9 iNum=10; 10 printf(“iNum = U %d\n”, iNum); /* iNum=10 */ 11 LeaveGap(iNum); U /* Passes the value of iNU um - 10 - not iNum 12 itself */ 13 printf(“iNum = U %d\n”, iNum); /* iNum=10 */ 14 return 0; 15 } 16 17 void ParamChange(int U iNum) 18 { 19 iNum = 0; 20 }

14· 2001LINUX MAGAZINE

57


PROGRAMMING

C

For Listing 2

and you should see:

3&4

0 : ./a.out 1 : Hello 2 : World

As a Prototype

Tells the compiler that there is going to be a function in the code called ‘Banner’, but it has yet to appear in the source. It gives the compiler enough information allowing it to be used, pending the implementation - which may be in this ‘.c’ file. Another ‘.c’ file. Or a ‘.o’ library file. You should always include prototypes for your functions, and naturally, the parameters should always match, however it is not necessary to include the name (iLines). Sometimes, prototypes are prefixed with the reserved word ‘extern’, meaning that this is the prototype for a function that resides in another file (external to this one). 8&9 As a Function Call Makes a call to the ‘Banner’ code, and once complete continues with the statement immediately following it. All function calls must include brackets, even if there are no parameters to pass. A function name without brackets, although valid, is actually a pointer to the memory location where the function is stored! 13-24 As a Definition The code! The braces indicate the start and end of the function definition. Between them lie the instructions, each ending with a semi-colon. See BOXOUT:Layout. iLines)’) you may still use ‘return’ to leave the function early - you just omit any return data.

GCC gcc allows you (the user) to review the compilation process. Each stage can be processed with it’s own program, and generates its own intermediate output file. Although not particularly useful for the beginner, it is sometimes interesting to see how the path from source to executable occurs. Note: gcc also gives you access to the assemblergenerated output from the compiler; a step I do not explicit consider here. To see these intermediate files, build your code with, gcc save-temps myfirsttime.c Although I refer to ‘libc.so’ as a file used by linker, it is not always (ever?) a binary file. It is, in fact, a linker script indicating the true location of the shared library (or libraries). Usually /lib/libc.so.6’. (*) GCC doesn’t actually use this file for pre-processing. It is included to demonstrate the method.

void Banner2(void) { /* Do stuff here */ return; /* ** Any code here is never called - but being a ** compiled language, must still be valid syntax. */ } Functions that do not return a type are sometimes categorised as procedures. From a stylistic point of view, procedures should be named depending on what they do. Whereas functions should be named by what they return.

Exile On Main Street Earlier, we said that main was just a function like any other. Is that really true? I’m afraid it is! Although we never call it (*), Linux does. Through the shell. It prepares the two parameters for main (argc and argv) from the arguments you type at the prompt. It also takes the return value (Listing 5, line 9) from the program and passes it to the shell as the exit code. The ‘argc’ parameter describes the number of parameters passed to this program on the command line. ‘argv’ is a pointer (you’ll have to be patient to learn about these beauties!) to an array (you’ll have to be less patient to learn about these!) containing each of the arguments. Run listing 5 with: ./a.out Hello World

58 LINUX MAGAZINE 14 · 2001

In addition to the real arguments (which follow the quoting conventions for the shell you are using), there is one surprise. The name of the program as argument zero. Replete with path. And the exit code? When a program completes, this value is returned to the shell indicating its status. Zero (0) is used for ‘completed successfully’, while one (1) indicates a failure. The header file <stdlib.h> creates two text macros, EXIT_SUCCESS and EXIT_FAILURE that indicate this, and they can be returned from ‘main’, instead of the values 0 and 1. There is no good reason for not including an exit code (at least ‘return 0;’) at the end of your ‘main’ function. It is certainly better (and more standards compliant) than declaring your function as ‘void main(void)’, which gcc will warn against, but still allow. There was a case, years ago, when a programmer (writing assembler, not C) created a one line program - with a bug in it! The bug being he didn’t return an exit code, confusing the OS, causing it to take the next number it saw (which he had not placed) and use it. Don’t fall into the same trap! (*) It is technically possible to call main from inside your program (recursively) because it is just a function! However, very few people do. And even fewer in real-world environments.

Wind Of Change Variables: the proverbial lifeblood of a program. They run through the veins (functions) passing information, handling sort data, and holding your frag count in Quake! We have already seen variables used in the example above, but I didn’t dwell on them. Now I will! Variables in ‘C’ have more restrictions than their counterparts in script languages. Notably, they must have a specific type that is declared before they are used. Also, once given a type (say, int) they can not change it. Ever. This allows the compiler to provide a more optimal storage method (say the heap, or a specific register) which in turn produces faster code. int iNumberOfNames; long iMaximumNumberOfNames = 16; float fRadiusOfCircle, fCircumference; unsigned char cMiddleInitial; Above, we have declared five variables. The name given to each is arbitrary; any combination of numbers, letters (either case) and the underscore may be used (as with functions, above). However, for stylist reasons, I prefix each name with a single


C

letter indicating it’s type, be it integral, floating point or a character. When declared, the variable has no value. This doesn’t mean the variable is zero. It means it has no discernible value – i.e. it is filled with garbage and could be anything. It is therefore imperative that all variables are initialised before use, perhaps in the declaration (as shown with ‘iMaximumNumberOfNames’ above), or in a line on its own using the copy-cat syntax of, (also see BOXOUT: Constant Values)

PROGRAMMING

can fit into memory). It is usually an int. However, in an embedded system where the processor is, say, a Z80 (making the natural size for an int, 16 bits) with an extended memory, able to access a megabyte, the size_t type would have to be 32 bits long. Like I said, you should be aware of it, even if it doesn’t make too much sense at the moment.

Not all types are typical ‘C’ may have types, but it is only weakly-typed. So, if you have two variables,

iMaximumNumberOfNames=16; Most types may be considered signed, or unsigned. Signed means it is capable of storing a sign (either + or -) with the number. Unsigned means there is no sign, and therefore always positive. By default, types are signed (except in the case of ‘char’s, which is compiler-specific!) It is generally considered bad practise, however, to write code that relies on all chars being ‘unsigned’ (or vice-versa). This sign/unsigned feature can cause problems. Should you store a character from the input stream (say) in a ‘char’, and the system you are using has ‘unsigned char’s then the end of file token (EOF, which equals -1) can not be correctly identified. FWIW, gcc defaults to ‘signed char’s, so you should have no such problems. But it always best to avoid the possibility altogether, and use a variable with enough space for all possible outcomes – and an error code. Table 1 indicates the range of values possible with each data type to help you choose the appropriate data type for any given occasion. Some programmers will write ‘long int’. Since ‘int’ is considered the default type, this actually means ‘long’. And when a programmer writers ‘short int’ – they mean short. For portability between machines, your code should not rely on the size of any type (although ‘int’ is large enough to be used for most purposes). Since this can be difficult, many programmers will define their own types called ‘WORD’ or ‘int32_t’, implying the variables’ size, with the code. These types area used in exactly the same way as the builtin types like ‘int’ and ‘float’, and are defined with the lines: typedef unsigned short WORD; typedef signed int int32_t; Then, should the platform change, only these ‘typedef’ instructions need to change. There are examples of this in /usr/include/sys/types.h of most distributions. Finally, there is one special type you should be aware of: size_t. Any variable declared with this type has enough bits in it (literally) to reference any address in memory (and consequently any array that

int iNum = 10; float fVal = 12.5f; The compiler will not stop, and not usually warn, you when mixing incompatible data types with code like: iNum = 0.4f; iNum = fVal * 7; fVal = iNum / 3;

Listing 4 1 #include <stdio.h> 2 3 int U GetNumEntries(void); 4 5 int main(int argc,U char *argv[]) 6 { 7 int iNum; 8 9 iNum = U GetNumEntries(); 10 printf(“iNum = U %d\n”, iNum); 11 return 0; 12 } 13 14 int GetNumEntries(void) 15 { 16 return 100; 17 }

It is possible to predict the outcomes of these expressions, since ‘C’ has rules for these things. Am I going to tell you what they are? No! I’m going to tell you not to do it! So there!

You’re not local, are you? Time for another example. Here we have demonstrated two types of variable. Local and global. The variables declared inside the function braces (lines 7 & 14) are termed local, since they only belong to code inside the function; between the braces. This is termed its scope. The variable outside all the functions, at line 3, is termed global. i.e. it has global scope, and as such can be accessed by any of the functions. If a variable is declared at local, and global scope (as in the example above), the local variable will ‘hide’ the global one making is inaccessible. Global variables can be placed anywhere in the file, but since they are generally considered ‘a bad thing’, it is best to keep them together in a coders commune at the top of the file! You might want to adopt a naming convention to distinguish them and prevent the ‘hiding problem’, above. Perhaps by prefixing them with ‘g_’.

Instructions So far, I’ve referred ‘instructions’; the ‘printf instruction’, the ‘if instruction’, the ‘return instruction’ and so on. In truth, they are something more than just instructions. They are statements. Each function comprises of braces, and a list of statements, where a statement can be anything from table 2.

Listing 5 1 #include <stdio.h> 2 3 int main(int argc, chU ar *argv[]) 4 { 5 int i; 6 7 for(i=0;i<argc;i++) 8 printf(“%d : %s\n”, I, U argv[i]); 9 return 0; 10 }

14· 2001LINUX MAGAZINE

59


PROGRAMMING

Listing 6 1 #include <stdio.h> 2 3 int iVar=100; 4 5 void fn(void) 6 { 7 int iVar2=20; 8 9 printf(“fn1 : iU Var = %d, iVar2 = %d\n”, U iVar, iVar2); 10 } 11 12 int main(int argc, U char *argv[]) 13 { 14 int iVar=1, iVar2=2; 15 16 printf(“main : U iVar = %d, iVar2 = %d\n”, U iVar, iVar2); 17 fn(); 18 19 return 0; 20 }

C

Table 2 implies a few things. Let me clarify, with a brief Q & A. Q. When writing an ‘if’, you don’t need braces. True? A. True. So long as you only have one statement, since the second one would be part of normal code, and not the ‘if’. Q. But my ‘one statement’ could be a compound statement; containing lots more statements. Really? A. Yes. It’s like asking a ‘three-wish genie’ for another three wishes. In programming ‘C’, that’s allowed! Q. Do the braces mean I can declare more local variables inside the ‘if’ statement, and not at the beginning of the function? A. Yes! This refers back to the concept ‘scope’. A variable can be declared after the brace, and will remain active until the end brace. So although you can use your newly created variable inside, say, an ‘if’ you can not use it outside. if (iEntriesToSort > 0) { int a=1; /* Look, ma! I created a local variable in a strange place! */ } /* ‘a’ is no longer valid, since it’s gone out of scope */

Reserved Words auto break case char const continue default do double else enum extern float for goto if int long register return short signed sizeof static struct switch typedef union unsigned void volatile while

Q. If you omit all three expressions from a ‘for’, and use the empty statement you can write code like: for(;;); What does that do? A. Nothing. Forever. It sits and spins in an endless loop since there’s no get out clause (exp2 above), and no code to jump out. Q. Is there a use for the empty statement? A. Yes. But be careful. If you were to write:

if (x>0); { /* X is five. Why is this always getting called? */ } you might fail to notice the semi-colon after ‘if’. This counts as an (empty) statement, and therefore the open brace begins a new compound statement that will always execute. Q. Ouch! Could that happen elsewhere? A. Yes, but with slightly different results. while(x>0); { x— —; } This doesn’t exit because the loop executes the empty statement while x is greater than zero, and since it never reaches the post-decrement, is shall always do so. Q. So what’s it good for them? A. A unified syntax. (don’t ask!) And easier to read code, when negative logic would make it less intuitive to the reader. if (?some complicated expression?) ; else DoStuff();

Design Philosophy and History ‘C’ was created in 1972 by Brian W. Kernighan and Denis M. Ritchie on the UNIX operating system,

Table 1 Type char

Size 1

Unsigned Range 0 to 128

Signed Range -128 to 127

short int

2* 4*

0 to 65535 0 to 4294967295

-32768 to 32767 -2147483648 to 2147483647

long float

4* 4

0 to 4294967295 Always signed.

-2147483648 to 2147483647 Using six digit precision

double

8

Always signed. Using ten digit precision

Notes A character. This may be signed, or unsigned, depending on your compiler. A short integer. Integer. Most common for loops and counters. It is also the size most fitting for your machine. A long integer. A floating point number in IEEE format. Numbers in floating point format are usually suffixed with ‘f’, i.e. 3.1415f to distinguish them with doubles. Double precision, again from IEEE. Used when floating point numbers are not accurate enough.

Note: The standards are vague about the exact number of bits used for each type. As long as ‘short’ is larger than ‘char’, and ‘less than or equal’ to the size of ‘int’, it doesn’t matter. It is up to the compiler to choose suitable sizes for the target machine.

60 LINUX MAGAZINE 14 · 2001


C

running on DEC PDP-11 (ask your father about these machines!). It is a portable, general-purpose, programming language (as opposed to Cobol, say, whose use is very much limited to the business sector) with ‘an economy of expression?and a rich set of operators’. It is also a fairly low level language (since it can manipulate individual bits within a byte), mixed with high level features (of control structures, such as ‘while’ and ‘for’ loops) making it appear somewhat of a hybrid. To maintain the generality of the language, much of the functionality, like input/output and file handling, was implemented in libraries - not included as part of the language. This meant the compiler was small, could be re-used easily and the

Pass Program Pre-processor cpp (*) Compiler gcc Assembler as Linker ld *myfirsttime.o/usr/lib/crt1.o/usr/lib/libc.so

PROGRAMMING

Input File(s) myfirsttime.c myfirsttime.i myfirsttime.s *

Output File myfirsttime.i myfirsttime.s myfirsttime.o a.out

language learnt quickly. Most of the libraries could be written in ‘C’ itself, allowing for greater portability. FWIW, when Unix was re-written, it took up just over 13000 lines of system code! Only 800 were assembler. The rest was ‘C’.

Table 2 ; exp; exp; if (exp) stmt if (exp) stmt1 else stmt2 while (exp) stmt do stmt while(exp); for(exp1;exp2;exp3) stmt

switch(exp) stmt return; return exp; goto label; { stmt_list }

An empty statement. Means do nothing. An expression, ending with a semi-colon. Such as ‘a = b*20;’. A function call (with brackets, remember), also ending with a semi-colon. We’ll see shortly why a function is considered an expression. Conditional execute stmt is exp is true (i.e. non-zero) Conditional, with ‘else’ clause Pre-check loop. Continually execute stmt while exp evaluates to true Post-check loop. As the standard ‘while’ loop, but guarantees that stmt will always execute at least once. Equivalent to: exp1; while(exp2) { stmt exp3; } One, two, or all three expressions may be omitted from the ‘for’. See control structures in a later issue Leave a ‘void’ function Leave any non-void function with a value <cough!> <splutter!> A compound statement. You may, optionally, declare variables at the beginning of a compound statement. Each function declaration actually consists of a name and parameter list, followed by a compound statement.

Note: stmt means ‘statement’, any one from the table above. exp means expression.

Constant Values When assigning a value to a variable, with a line like ‘iNum = 3;’ the value is termed a constant, since it can not change. There is more than one way to write it, however, iNum = 1406; iNum = 0x57E; iNum = 02576; iNum = ‘A’; fNum = 0.1f;

fNum = 0.1;

Without any prefixes, the number is in base 10. Decimal. Like wot we used ta, guv! ‘0x’ or ‘0X’ gives us hex. Prefixing with a single ‘0’ gives us octal. Therefore, only numbers 0-7 may be used. Single quotes around a single letter produce the ASCII value of that letter. In this, 65. This constant can be assigned to non-char types. The presence if a decimal point and a suffix of ‘f’ indicates a floating point number. Assigning a floating point number to an integer variable will cause truncation (i.e. it ignores the fractional part). All floating point constants must include the decimal point, otherwise it will interpret ‘12f’ (say) as an integer but report an error when it means the ‘f’ hex digit. Without the ‘f’, the compile treats the constant as a double precision number. Although not a bad thing, handling double precision numbers is more costly in terms of processing and code optimisation.

14· 2001LINUX MAGAZINE

61


FEATURE

VECTOR GRAPHICS

Vector Drawing Programs

POINT, STRAIGHT, CURVE FRANC WIEDUWILT

The drawing of diagrams, flow charts and freely scalable illustrations was, for a long time, the domain of Windows software such as Corel Draw or Micrografx Designer. In the meantime though, a number of Linux based programs have been created that now compete for favour in the creative fraternity. The program normally used to edit photos or to produce pictures with photorealistic appearance is Gimp. This program is however not suitable for the production of accurate drawings or diagrams that need to be worked on in different sizes (scalability). This is where vector drawing programs come in to their own. These programs are used to construct diagrams, assembled from simple geometrical shapes. These shapes or objects can also subsequently be combined, expanded, reduced, rotated, stretched or transformed in a variety of other ways, without suffering any decrease in quality.

Figure 1: XFig

We present six current programs in this article, all with one thing in common: they are all available free of charge. You will find that the differences otherwise outweigh the similarities.

Test Criteria The test candidates were put through the following course: We first checked the installation from Sources and Binary Packages. In the drawing test, the programs had to show how graphic objects were constructed, how these objects could be transformed and filled, whether it

Pixel Graphics and Vector Graphics The difference between how a vector drawing program presents an element, and how a photo (pixel) editing program presents an element, lies in how they save their created picture data. Vector graphics programs save their objects as mathematical descriptions of shapes, which require a small amount of disk and work space. Take for example a circle, the program only has to make a note of the middle point and the radius. Because of this accurate mathematical description, vector diagrams can be scaled at will or deformed geometrically, without any loss 62 LINUX MAGAZINE 14 路 2001

of quality. Photo editing programs use a pixel based file format, in which each individual pixel, with all its characteristics, must be stored. Enlargements and reductions are in most cases only possible with pixel-based pictures, with an associated degradation in quality. Therefore, vector drawing programs are particularly suitable for clear structures and technical illustrations. None of the programs presented here have the picture effects capability of a photo editing program like for example Gimp.


VECTOR GRAPHICS

Figure 2: Figurine’s tool bar

was possible to combine objects into groups and work on them together, and whether it was simple (or possible) to change the sequence of objects. We also tried to find out the level of accuracy with which one can draw in these programs. Those of you who would like to create illustrations or posters must also be able to work with text. We therefore examined how (and whether) the programs edit and transform text. In doing this, we paid special attention to the possibility of being able to transfer drawings to, and read drawings from, other programs (compatibility). Three of the presented programs support the SVG format, which should facilitate the simple export and import of drawings over and above the boundaries of operating system. We then had a look at the user support offered by the programs in the form of on-line help and manuals. At the end of this article, you find a table, which lists and summarizes the most important program functions.

Xfig Xfig is considered the Methuselah of vector drawing programs for X. The program has been around since 1985 and is thereby substantially older than Linux. It is included in almost all Linux distributions. The Xfig user interface seems somewhat antiquated, but is however very functional. All commands can be accessed by the large tool bar at the left side of the program window, whereby it is

FEATURE

Figure 3: Figurine work surface

not clear at first glance which functions the tool bar icons correspond to. You can draw all the important basic geometrical shapes and also input and format text. Objects can be enlarged and reduced at will and then be subsequently shapetransformed. Xfig allows you to arrange objects on different layers. Different line types and object fills are possible. One thing a bit irksome about the program, is that it is not possible to preset your preferential ruler and drawing units. The Xfig file format is very common in the Linux world. Additionally, created drawings can be exported into different pixel formats, so that subsequent alteration work is possible in a whole range of picture editing programs. The program has an outstanding online helpdesk in the HTML format. To display this however, you must have Netscape installed. A manual in the PDF format is in addition provided. Xfig is particularly suitable for the production of pictograms, flow charts, mind maps, overviews or schematic diagrams. Xfig drawings can be comfortably modified in texts using LaTeX.

Figurine Figurine enables you to draw diagrams in the Xfig format with a more modern user interface. You find the program on the Figurine homepage in source text as well as rpm, the installation can be carried out without any problems. Operation is similar to Gimp: There is a small window with drawing tools (refer to figure 2) and at

Pixel: A point on the screen or paper. Binary Package: A binary package is a combination of all the pre-compiled files that a program needs for its execution. This includes other data as well as the actual program, for example assistance files. SVG: “ Scalable Vector Graphics “, a relatively new, non-platform-dependent format for the storage of vector drawing data. HTML: “ HyperText Markup Language “, is a scripting language that specifies how web pages are formatted and displayed on the internet. PDF: “ Portable Document Format “, a file format for the transfer of formatted text. Sources, Source Text: The text that the programmer enters to write a program. The program must be converted, with the help of a compiler, into a machine-readable form so that it can be run by the operating system.

14 · 2001 LINUX MAGAZINE 63


FEATURE

VECTOR GRAPHICS

Netscape is installed. If you do not call up the help via the menu, you can use any browser. Like Xfig, Figurine is particularly suitable for creating drawings that do not have to be produced with exact accuracy. We found it rather difficult to draw objects of a precisely defined size. The program supports the export of files to the same formats as Xfig. Documents created in Figurine can therefore be further modified in other programs or be inserted into LaTeX documents.

Impress

Figure 4: Impress

least one window with a work space for each opened document. Figurine offers all the important drawing tools: Rectangles, ellipses, lines and a text tool. The text tool does not allow the input of umlauts. These are however correctly displayed by figurine if they are contained in a file. Figurine offers a selection of different line shapes and allows drawing objects to be filled with colours and patterns. Objects can be combined into groups and worked on together. Like Xfig, Figurine unfortunately does not allow for the presetting of ruler and drawing units. If you, for example, want to have centimetres as your ruler units, this must be reset each time. Inches are the default unit for drawing and this cannot be changed. Figurine has a detailed on-line help, This however can only be displayed from within the program if

Figure 6: Sodipodi in action Figure 5: Sodipodi’s tool bar 64 LINUX MAGAZINE 14 · 2001

Impress is an illustration program for folios and other screen presentations. It is downloadable as rpm and source text from the Impress homepage. Like Figurine, this program has a tool bar independent of the document window (refer to figure 4). It however only permits one drawing to be open at any one time. Operating this program requires some patience, as it is very slow – particularly with gradients and enlargements. There are even times when one gets the impression that the program has crashed. All the usual basic geometrical shapes are available, there are different line types and fill patterns as well as many different gradient functions. Text entry is not as simple as it could be, it must be entered into a separate window. It is possible to enter several lines of text at once, but this can only be formatted in one style. The program has neither an on-line help service nor a manual. A special feature is the presentation mode, in which several drawings can be displayed one after another. Caution is recommended when quitting out of Impress: The program does not ask you if you want to save before quitting.


VECTOR GRAPHICS

FEATURE

Sodipodi Sodipodi is the youngest program in this comparison and it is taking big steps forward in its development. On the Sodipodi homepage, you will find the program sources and rpms. The rpms however, are not as up to date as the source text packages. Sodipodi uses the most current GNOME libraries, which one must have installed (procurable from http://www.gnome.org/). The software is very similar to Gimp in both appearance and operation. There is a very extensive tool bar (refer to figure 5) and each drawing has its own window. As is the case of Gimp, the tools are accessible either by means of the tool bar or the context menu in the document window, called up by right mouse clicking the drawing. It should be noted here that the program is not fully complete yet. The basic functions for drawing objects and for processing text however work without problem. Objects can have different line types, filling patterns have not yet been included. Sodipodi is the only program in the test which can create transparent objects (refer to figure 6), a capability that otherwise only pixel-based programs have. It is also possible to define your required paper format. There is no on-line help yet, but it is relatively simple to get along with out it – the user interface is very self-explanatory. All in all Sodipodi is an interesting software development which, when it is finished, promises to be a universal graphics solution beside Gimp.

Kontour Known earlier under the name Killustrator, Kontour is part of the KOffice project (http://www.koffice. org/). It was renamed to get around a trademark dispute with Adobe (see also K-splitter in this magazine). We will limit ourselves here to the new

Figure 8: Dissolving

Figure 7: Kontour

features and innovations. You will find all Koffice source texts and binary packages for different Linux distributions on the KOffice homepage. Kontour includes all the important drawing objects. Elements can be given different line types and fillings (patterns and gradients) and manipulated in a whole variety of ways. Kontour can blend two objects into each other (refer to figure 8), and this function can produce really cool effects. Grids and guides help to draw objects precisely. The software is seamlessly integrated in KOffice, and it is therefore possible to embed drawings in KWord and even work on them within this program (refer to figure 9). The whole process also

rpm: “ The Red Hat Packet Manager “ is a program for the installation and removal of programs that takes into account dependencies between different software.

WMF: “Windows Meta File “, a file format for vector drawings.

Figure 9: A Kontour drawing embedded in KWord 14 · 2001 LINUX MAGAZINE 65


FEATURE

VECTOR GRAPHICS

Figure 10: Sketch

works in reverse, so that all text processing functions available in KWord can be used in Kontour drawings. New to Kontour is above all the possibility of creating multi-page documents, the capability to drag guides out of the rulers and faster mouse movement when working in big enlargements. The on-line help in HTML format describes the most important functions of the program. It is possible to read drawings in the Xfig -, WMF -, and SVG formats as well as write drawings in the SVG and various bit-map formats. The program still has some small bugs at present. XML code is occasionally inserted into the drawing when pasting drawing objects. Also, the gradient path is often not saved. Nevertheless, Kontour runs really well – you should just remember to save your drawing frequently.

Sketch Sketch is, similar to Kontour, a Linux based program developed to offer a level of functionality matching Corel Draw. With its latest version 0.6.10, Sketch seems to be well on the way to reaching its mark. The program runs very fast, even on older hardware. You can download Sketch from the Sketch homepage as source or rpm packages for different distributions. The installation is somewhat laborious. As well as Sketch, the following packages must also be installed: python, python-devel, python-imaging, python-tk, python-tkinter, tkdev and blt. You can find all these libraries on the Sketch homepage. The program includes the blend function and 66 LINUX MAGAZINE 14 · 2001

offers different gradients for filled objects. Grids and guides help with the construction of drawing elements. Objects can be arranged on different layers. The text function is at present limited to single lined text elements, which can only be formatted in one style. Unfortunately there is no displayed indication of the size of the selected object in the status bar, so that some mental arithmetic is needed in the creation of exact-sized objects. Sketch only allows single page drawings at present. Sketch was, together with Xfig and Figurine, the most stable program in the test – it didn’t crash once. It lacks an on-line help, but has however a manual in HTML format. Those who have already operated a vector drawing program will have no problems getting acquainted with the application. Sketch reads and writes the Adobe Illustrator format, so that drawings can be imported and exported through operating system boundaries. Furthermore, drawings can be imported from the Xfig format and exported into different formats (also including SVG). Sketch is suitable not only for presentation folios or maps, but also for accurate drawings, for example structural drawings.

Result As always, selection of the “correct” program for you depends on what you want to draw: Figurine and Xfig create charts, sketches and folios that do not need extras such as colour gradients or special accuracy. Impress, Sodipodi, Kontour and Sketch are trying to advance to the class of programs such as Corel Draw, but are however still a way off. Sodipodi could become the perfect supplement for Gimp, as it uses the exact same operating concept and interface. Kontour is particularly user friendly and its integration in the KOffice package is another plus. Sketch has the goal of becoming a universal drawing program for Linux, and we are therefore awaiting its further development with anticipation. It is unfortunately difficult to exchange drawings between the tested programs. Sketch, Sodipodi and Kontour say that they support the SVG data format. The down side is that this is a very complex standard, which is for the most part only partly implemented by the individual programs. As consequence of this, these programs can not read SVG files that were produced by other programs. Sketch and Kontour enable the import of Xfig files and WMF drawings, which are very common in Windows, so that at least the import of existing drawings is possible.

The author: Franc Wieduwilt studied history and lives in Berlin with his wife Sabine and daughter Johanna.


VECTOR GRAPHICS

FEATURE

Table 1: Vector Drawing Programs – Overview Developers

Xfig

Figurine

Impress

Sodipodi

Kontour

Sketch

Supoj Sutanthavibul,

John Levon

Christopher Jay

CoxLauris Kaplinski

Kay-Uwe Sattler

Bernhard Herzog

GPL

Brian V. Smith, Paul King License

Own Open-Source-License

GPL

GPL

GPL

GPL

http://

www.xfig.org

figurine.sourceforge.net

www.ntlug.org/~ccox/impress/ sodipodi.sourceforge.net

www.koffice.org

sketch.sourceforge.net

rpm

-

x

x

x

x

x

Source-tgz

x

x

x

x

x

x

-

libXpm

tcl, tk

gnomelibs, gnomeprint

kdesupport, kdelibs

Installation

Additionally required libraries

python, python-devel, pythonimaging, python-tk, pythontkinter, tkdev and blt

Drawing tools: Poly-line

x

x

x

x

x

x

Bezier line

x

x

-

-

x

x

Freehand line

-

-

-

x

x

x

Rectangle

x

x

x

x

x

x

Ellipse

x

x

x

x

x

x

Text tool

x

x

x

x

x

x

Colour gradients

-

-

x

-(1)

x

x

Transparency

-

-

-

x

-

-

Extra functions:

Effects

-

-

-

-(1)

gradient

gradient

Object grouping

x

x

x

x

x

x

Layers

x

-

-

-(1)

x

x

Freely adjustable sheet size -

-

x

x

x

x

Multi-page documents

-

-

x

-

x

-

Units

cm, inch

cm and inch for the ruler,

mm, cm, inch, pt

mm

cm, mm, pt, inch,

cm, mm, pt, inch

Document formatting:

otherwise inch

pica, diderot, cicero

Drawing assistance: Grid

x

x

x

x

x

Snap to Grid

x

x

x

x

x

x x

Guides

-

-

-

- (1)

x

x

“Cross-Hair” cursor

-

x

-

-

-

x

-

-

Tcl (3)

- (2)

Data exchange: Import

Applixgraphics, XFig,

Adobe Illustrator, Corel Draw,

WMF, SVG,

WMF, XFig, SVG

MS-Office-Drawing Export

gif, hgl, jpeg, latex, pxc, pic, pdf,

gif, hgl, jpeg, latex, pxc, pic,

Tcl (3)

- (2)

SVG, ps, gif, png,jpeg SVG, pdf, Adobe Illustrator

png, ppm, tiff, tk, xbm, xpm, Tcl (3) png, ppm, tiff, xbm, xpm User support: On-line help

HTML

HTML

-

-

HTML

-

Manual

pdf

-

-

-

-

HTML

Therefore, vector drawing programs are particularly suitable for clear structures and technical illustrations. None of the programs presented here have the picture effects capability of a photo editing program like for example Gimp.

LEGEND (1): Planned (2): Sodipodi uses the SVG format for saving drawings (3): This program saves diagrams as Tcl script.

14 · 2001 LINUX MAGAZINE 67


BOOKS

REVIEWS

THE LINUX COOKBOOK ALISON DAVIES

Aimed at providing tips and techniques for everyday use. This soft backed tome is split into seven key areas. Few screenshots are used but the book does cram a wealth of information into its 396 pages. Every page is filled with useful information and with the comprehensive index and contents pages is ideal, not just as a tips book but as a reference book, whenever you need that little bit of help. It explains how to do tasks not just with one tool but with whatever you have. For example using ImageMagick and Gimp on images or Emacs and vi for text. Clear simple examples are given with the results displayed along side. The book is written for a Debian system, meaning that the commands should work with all

distributions rather than just one or just one desktop system. The author’s aim is not to set up a system from scratch but more to find tools and use them to make life easier. He deals with stable open source software so you can be confidant that it will work on your system rather than having to find new libraries for beta downloads. I would have added this to my Christmas list but it is too important to wait. It now resides with my other favourite reference books. ■

Author Publisher Price ISBN

Michael Strutz No Starch Press £20.99 1-886411-48-4

LINUX + STUDY GUIDE A hard backed study manual with CD-Rom. The book is targeted at the CompTIA’s Linux + exam which is an off shoot of the A+ exam system. The exam can be taken at the Prometric centres around the country. Each section of the book starts with an assessment test so you can gauge just how much you need to study. The chapters themselves explain the topics and a short crammer of essential points is just before the review questions. The Linux + exam is geared towards producing technical engineers who could fix any Linux based system and does not rely on just a single distribution. The hardware troubleshooting chapters are quite detailed and explain such issues as forked SCSI chains and evaluating swap space. Showing examples of recent window managers the book is very up to 68 LINUX MAGAZINE 14 · 2001

date. How long this remains relevant depends on how often the exams are updated. The CD contains hundreds of practice questions and flash cards to download onto your Palm Pilot. Within the Windows community the A+ exams are usually seen as a technically competent exam for engineers as opposed to the MSCE and Cisco treadmills. Whether this exam takes off for Linux will depend on whether employers trust those with the qualification or not. If the actual exam is like the test exams supplied then the qualification will be well received as it is so practically based. ■ Author Publisher Price ISBN

Roderick W. Smith Sybex £36.99 0-7821-2939-0


BEGINNERS

DR LINUX

Dr Linux

TELEVISION DOCTOR AND KERNEL PROBLEMS

MARIANNE WACHHOLZ

Dr. Linux Complicated organisms, which is just what Linux systems are, have some little complaints all of their own. Dr. Linux observes the patients in Linux newsgroups, issues prescriptions here for the latest problems and proposes alternative healing methods.

Whenever new Linux distributions are released, the question crops up repeatedly in the newsgroups: “What does charmajor-[1...255] actually mean?” The answer to this and other questions can be found in the following article.

Which library? I wanted to install a new Netscape on my system, but I keep getting error messages about missing Shared Libraries: $ ./netscape-installer error while loading shared libraries: cannot open shared library: cannot load shared object file: No such file or directory

not a dynamic executable So let’s take a more systematic approach. A look into the Installer directory gives the following information:

● You are installing a program version which is so new that the required library version is not (yet) present in the system. ● On the other hand the program could be so outdated that you cannot find the associated library versions on the current system. ● It can also happen that the missing library is not in fact installed.

perlemaxi:~/netscape-installer > ls -l total 172 -rw-r—r— 1 perle users 4725 Nov 22 2000 README -rw-r—r— 1 perle users 7671 Dec 2 2000 config.ini -rw-r—r— 1 perle users 2206 Dec 2 2000 installer.ini -rwxr-xr-x 1 perle users 19308 Nov 22 2000 license.txt -rwxr-xr-x 1 perle users 1521 Nov 22 2000 netscape-installer -rwxr-xr-x 1 perle users 126032 Nov 22 2000 netscape-installer-bin

To find out which libraries are missing, use the command ldd program. When you do so, it is best to specify the program which will not start with path name.

First, all we want to know is what kind of files are involved. For this we need the command file, which identifies file types and immediately outputs the result on the command line. As you can imagine,

How can I find out which libraries are to be used? Dr. Linux: When users have problems with missing shared libraries, the following problem scenarios are possible:

Shared Libraries or jointly used libraries contain standard functions which are used by many programs, such as output to the screen output. They are loaded once, when a binary program needs them, and then they can also be used by other programs.

If you address the ldd query to the file ./netscapeinstaller, however, the result does not lead immediately to the goal:

70 LINUX MAGAZINE 14 · 2001


DR LINUX

BEGINNERS

the call is simple: perlemaxi:~/netscape-installer > fileU netscape-installer netscape-installer: Bourne shell script text So this file is not a binary program, but a shell script, which just starts the actual, compiled Netscape code. This is tucked away in netscape-installer-bin, which the command file confirms: perlemaxi:~/netscape-installer > fileU netscape-installer-bin netscape-installer-bin: ELF 32-bit LSB executable, Intel 80386, version 1, dynamically linked (uses shared libs), stripped The fact that there is a script hiding behind executable files, and that the content of the script can be viewed with any ASCII editor, is a common occurrence. But in the listing of a directory it is not immediately completely clear whether a script or a binary program is involved, since file name extensions such as .bat for Linux scripts, are unusual. It is only sometimes that programs written in the script language Perl are marked with .pl and shell scripts with .sh. It now remains to demonstrate what the command ldd outputs when it is applied to a compiled program: perlemaxi:~ > ldd ~/netscape-U installer/netscape-installer-bin libgtk-1.2.so.0 => /usr/lib/libgtk-1.2.so.0 (0x40025000) libgdk-1.2.so.0 => /usr/lib/libgdk-1.2.so.0 (0x40155000) libgmodule-1.2.so.0 => /usr/lib/libgmodule1.2.so.0 (0x4018c000) libglib-1.2.so.0 => /usr/lib/libglib1.2.so.0 (0x4018f000) libdl.so.2 => /lib/libdl.so.2 (0x401b4000) libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x401b8000) libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x401c6000) libnsl.so.1 => /lib/libnsl.so.1 (0x402a9000) libutil.so.1 => /lib/libutil.so.1 (0x402bf000) libresolv.so.2 => /lib/libresolv.so.2 (0x402c2000) libm.so.6 => /lib/libm.so.6 (0x402d5000) libstdc++-libc6.1-1.so.2 => /usr/lib/libstdc++-libc6.1-1.so.2 (0x402f4000) libpthread.so.0 => /lib/libpthread.so.0 (0x4033c000) libc.so.6 => /lib/libc.so.6 (0x40352000) libXi.so.6 => /usr/X11R6/lib/libXi.so.6 (0x4046f000)

Figure 1: Xawtv in action

/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000) For example, if your system lacks libm.so.6, then ldd issues the message =>not found instead of the path to the library: [...] libresolv.so.2 => /lib/libresolv.so.2 (0x402c2000) libm.so.6 => not found libstdc++-libc6.1-1.so.2 => /usr/lib/libstdc++-libc6.1-1.so.2 (0x402f4000) [...]

Comment out: In scripts and many configuration files there is the option of having lines from the program being read in to be ignored by placing the # symbol at the start of a line. This means you can insert explanations into a file, without affecting its function. This additional information remains visible to humans, but when the file is evaluated by the computer it is ignored.

I’ve got square eyes I am using Xawtv to watch TV on my Linux system. Now I’d like to display the TV programmes in a specific sequence in the channel window. (This is the window which presents the available programmes for selection by mouse click.) Using the

Listing 1: Extract from ~/.xawtv [...] [defaults] norm = PAL input = Television capture = over

# Comments preceded by a # # are ignored. # #[DSF] #channel = S23 [PHOENIX] channel = SE19

[...] [BBC] channel = SE14 [CNN] channel = SE12

[n-tv] channel = SE5 [N24] channel = S25 [...]

14 · 2001 LINUX MAGAZINE 71


BEGINNERS

DR LINUX

Figure 2: Konqueror displays hidden files on the right, but not on the left

Modules: Drivers which are only loaded as necessary into a (modularised) kernel. The advantage of such a kernel compared with the monolithic kernel, which has all drivers embedded, is that only the drivers needed are loaded at run time and do not occupy any memory space when not in use.

channel editor this is a tedious task, as all details such a channels and broadcaster names have to be entered repeatedly. I can’t find a configuration file named Xawtv.config or similar in the system. Dr. Linux: When a Linux user has individually configured some piece of software, the associated configuration file is (almost) always to be found in his home directory. Normally such files and directories are made as dot-files. These are files/directories with a dot in front of their name (.). They are also known as hidden files, as in file managers, but also by ls they are not displayed without a bit more fuss. If you enter on the command line ls (“list”) with the option a as in all, you will also be shown the dot files. The flag l also delivers a long output, providing additional information. perlemaxi:~ > ls -al total 1876 drwx— — 44 perle users 4096 Jul 2 16:25 . drwxr-xr-x 7 root root 4096 Jun 26 14:11 .. [...] -rw-r—r— 1 perle users 1090 Jul 2 15:06 .xawtv [...]

72 LINUX MAGAZINE 14 · 2001

Obviously all file managers have the option for showing the hidden files. In the Konqueror of KDE 2.1.x for example this is done via View / Display hidden files (Figure 2). The configuration file for Xawtv is simply called .xawtv and can be loaded into any editor. Its structure is simple and clear. Following a few configuration instructions are the broadcaster and place of transmission which you have already installed, one under the other. By using editor functions such as Cut and Insert you can very quickly change the programme sequence. And this also gives you the opportunity to comment out all “superfluous” channels (Listing 1 shows an example.) If you want at some point to reactivate it, simply delete the comment symbol (#), and the channel is available, without you having to start a tedious sort process or having to configure Xawtv anew. Sources: Often called source code, source text or just sources. The text written by a programmer (in a programming language such as C++). This text, which is readable by humans, is only turned into a binary program or a file which is executable by computer by “translation programs” called compilers.


DR LINUX

Character-Device: A character device, also known as a character-oriented device is read and written sequentially (in sequence), therefore the inputs and outputs are done bytewise. A serial interface is for example a character device. Byte: Memory is divided into memory locations containing either the value 0 or 1. Such a location and/or the data stored in it is called a bit. Several bits can be combined into units such as a byte, word or

Modular Problems I keep getting the error message modprobe: Couldn’t find module char-major-108 Unfortunately I don’t know how I can correct this error, as I don’t even know what char-major-number means. Is there an explanation of this somewhere? Dr. Linux: This kind of message tends to crop up following a system crash or after a faulty update when booting and in program calls. What it means is that the kernel module for PPP (“Point to Point Protocol”) was not found and therefore was not loaded. The documentation on this can be found in the file /usr/src/linux/Documentation/devices.txt and is part of the kernel documentation. This is only present on your system if you have installed the sources of the kernel on your system. Since these are extremely large, they are not usually automatically included in the system in a standard installation. The kernel sources for your current system can be found, in common distributions, on the installation medium. From there, depending on the system they can be installed later with YaST (SuSE), gnorpm, rpm or apt-get (Debian). On the Internet you will find kernel archives packed as tar.gz or tar.bz2 e.g. at http://www.kernel.org/. Anyone who does not have to worry about time spent online can also look

BEGINNERS

long word: for example, one byte corresponds to eight bits. Block-Device: On this kind of block-oriented device data is written block-wise and/or also read from it, with the device determining how big these blocks are. Hard disks or diskette drives are typical examples of block-oriented devices. You can access these devices by mounting them, with the mount command, in the file tree and later unmount them with umount.

up the latest version of the documentation on the website http://www.kernel.org/pub/linux/docs/devicelist/devices.txt. They can also be downloaded separately by FTP (ftp://ftp.kernel.org/pub/linux/docs/device-list/). The file devices.txt lists which device is hidden behind a certain number. The document is in English, but very clear, because it is in the form of a list. The type is listed after the number in the first column: char stands for Character-Devices and block for the Block-Devices.

Patience is my middle name It happens from time to time that I mistype my password. Then it takes far too long for a new login prompt to appear. Can this waiting period be cut? Dr. Linux: With systems which want to offer a high level of security, the time-out to the next login prompt can certainly be very long. The time an evildoer needs to try out various passwords thereby increases considerably. The Superuser is the one who defines how high the security requirement is for any specified computer. In the file the line FAIL_DELAY number stipulates how many seconds the pause between two attempted logins should last.

Listing 2: Extract from the file devices.txt [...] 108 char

Device-independent PPP-interface 0 = /dev/ppp Device-independent PPP-interface

block Compaq Next Generation Drive Array, fifth controller 0 = /dev/cciss/c4d0 first logic drive, whole diskette 16 = /dev/cciss/c4d1 second logic drive, whole diskette [...] 240 =/dev/cciss/c4d15 16th logic drive, whole diskette The partitions are treated as Mylex DAC960 (see major number 48), if one ignores the upper limit of 105 possible partitions. [...]

14 · 2001 LINUX MAGAZINE 73


BEGINNERS

KORNER

K-splitter

ACTIVATED INSTRUCTED WARNED OFF STEFANIE TEUFEL

Who says there is no place for gossip and scandal in a Linux magazine? K-splitter chats month by month from the KDE sewing box, broadcasting news from the K-World and nosing around here and there behind the scenes.

ActiveX: This technology, developed by Microsoft, is used to add multimedia elements to websites, such as video, audio, animation and “virtual reality”. To do so, the developers use socalled ActiveX-Controls to link and embed objects (“Object Linking and Embedding” OLE). ActiveX has in fact been praised as a cross-platform solution, but is not supported by all operating systems. The danger of ActiveX components lies in the fact that they have executable content. If, for example, this function is activated in Microsoft’s Internet Explorer, when you visit a website, programs can be downloaded onto your PC which allow access to your computer. QuickTime: Standard, defined by Apple, for the transfer of image and audio data. Usually used for smaller films. Flash: A program from the company Macromedia for making vector-based animations for websites. To play back the data format of the same name, you will need the Flash player as a browser-plugin.

Fully active The presentation of reaktivate at this year’s Linuxtag in Stuttgart caused a great deal of excitement. Behind this name lies none other than an ActiveX expansion for KDE’s Konqueror based on the emulator Wine. Not everyone is happy about this, because Microsoft’s ActiveX technology has been under discussion for a long time due to the considerable security concerns. Contrary to many rumours, reaktivate will not therefore be a standard component of future versions of KDE. Anyone who wants to use the software must therefore make a deliberate decision to do so and not have it planted on them on the sly, as with Windows. For all those whose fingers are just itching to try it all out, you’ll have to scratch just a bit longer: The proposed solution, according to the developers, Malte Starostik and Nikolas Zimmermann, is still at a very early stage of development. Theoretically, every ActiveX element should run in Konqueror, but at the moment some components are not yet compatible with reaktivate, such as Microsoft’s Windows Media

Figure 1: Konqueror with Flash-Control 74 LINUX MAGAZINE 14 · 2001

Player. The developers now say they are working even harder at getting the Apple QuickTime plugin up and running. The ActiveX elements Macromedia Shockwave Flash 5 and the Macromedia Shockwave Player 8 have already been successfully tested.

Aethera changes fronts Aethera, the messaging and groupware client for KDE, is not only slowly but surely taking on forms which are ever more stable, but has also changed fronts or, to put it more precisely, the server. Henceforth the new beta versions can no longer be found on the home page of the developer company theKompany.com, but at http://sourceforge.net/projects/aethera/. Aethera (Figure 2) can send and receive emails and manage contacts, notes, tasks, appointments and to-do lists. New to the fourth beta version are primarily the first attempts at Korganizer support for scheduling, markedly improved IMAP support and the complete drag & drop implementation.

Figure 2: One-stop shopping


KORNER

Capitalist...

Instructed Everything you ever wanted to know about KDE programming is now hopefully explained by the new KDE Developer FAQ. Philippe Fremy and David Faure have collected the most important questions to do with KDE development at http://developer.kde.org/documentation/other/develo per-faq.html. Anyone searching for answers to questions such as “What tips are there for creating a new application?” or “How do I access a CVS?”, will find help here. Philippe Fremy will be glad to receive supplements, suggestions and support. An e-mail to pfremy@chez.com is all it takes.

BEGINNERS

... or (K)Monopolist?

the lawyers at first refused to accept Sattler’s offers to rename the open-source software, they now appear to have come round. When this issue went to press Adobe had declared that the company was only concerned with protecting the copyright of the product Adobe Illustrator. There was no desire to hinder the distribution of KIllustrator; the author should merely alter the name of the program. This should not cost the Killustrator developer anything. The University has since commissioned a firm of lawyers to look after their own interests. What reaction there will be to the Adobe offer is something the Magdeburgers want to discuss first with their own lawyers. But it looks as if KIllustrator will just be renamed, by way of precaution, as Kontour. Watch this space...

Client-server architecture: This describes a model where the allocation of tasks and the sharing of responsibilities between programs lies with the server. The server program is a utility program which provides services for the client programs. To transfer to the world of computers, a computer which makes available services, such as application programs, memory space or computing power for other computers on the network, the clients, is also called a server.

Rivals Competition is the spice of business and creates innovations. Convicted capitalists have known this for hundreds of years. So can it be any surprise that Monopoly, the game for this economic system, is competing within KDE itself? Exactly one week after Rob Kaper announced KMonop (http://capsi.com/kmonop/) (now renamed Atlantik) on the KDE-Games-Developer list, he has found himself competing with Daniel Hermann with his Capitalist (http://www.unikarlsruhe.de/~Daniel.Hermann/Capitalist/). Capitalist is, says Hermann, a client-server version, which is intended to be played over a network with several players. But before any misunderstandings arise: Obviously KMonop, too, has a server behind it. Figures 3 and 4 show both versions in use. The best thing to do is to try out both for yourself, to find in which virtual environment you want to build your hotels in Mayfair in the future.

Warned off Recently the University of Magdeburg was warned off by the firm of lawyers Reinhard Skuhra Weise & Partner. Reason: The home page of Uni staff member Kai-Uwe Sattler, where he presents KIllustrator. The lawyers accused the University of infringing the copyright of their client Adobe and said this was also defamatory. In addition to an injunction backed up by the threat of punishment, the warning was accompanied by an invoice for £1500 plus VAT. After

Without words ... or to be more precise, without Word is what one or two prolific writers might be soon, if the development of KOffice, the office suite of the KDE Project, continues at the same pace as in recent months. The developers of the third beta version recently released the coming version 1.1, which will again come up with some innovations. One of the main innovations is the integration of KGhostview for a print preview (but anyone wanting to use this feature must have kdelibs from series 2.2) in addition to a greatly improved display of embedded images etc, in KWord documents. Plus, KWord has now come up with the option of autocorrection, a further improved spelling corrector, a new preview alternative (several pages in a row) and also a greatly reduced loading time for large documents. Despite its beta status this version should run a bit more stably than version 1.0 released with KDE 2.0. IMAP: Short for “Internet Mail Access Protocol”, an access option for e-mail. IMAP not only allows you to collect e-mail from the server, but also to edit it there (deletion, especially useful in these times of ever-bolder spammers, and renaming or sorting into sub-directories). E-mails can also be selectively downloaded. CVS: Especially when several developers are working on a software project, a method is needed to prevent someone unintentionally overwriting changes made by his coprogrammers or destroying the only working version. For this reason, many projects therefore use the “Concurrent Versions System”. An older version can be reconstituted at any time from a CVS file tree, but obviously it is used most often to save the latest program code.

14 · 2001 LINUX MAGAZINE 75


BEGINNERS

KORNER

K-tools

I WATCH THE GOGGLEBOX STEFANIE TEUFEL

Watching television or recording a little video of your favourite programme made easy: kWinTV offers total TV – and all with the familiar KDE look & feel.

K-tools In this column we present tools, month by month, which have proven to be especially useful when working under KDE, solve a problem which otherwise is deliberately ignored, or presenting some of the nicer things in life, which, once discovered, you just couldn’t do without.

Figure 1: The television images are still there

Programming, writing letters or answering emails, without letting go of the mouse to grab the TV remote control – no problem for those with a TV card to call their own. All it takes is a click with the mouse or a tap on the arrow keys, and you can change the station if you’re fed up with the programme. It’s also nice to know that Linux will now no longer thwart you in your plans, so that in a normal case, even with old hardware, you can easily get your virtual goggle box going. With kWinTV, we are presenting you with a piece of software with which watching television is made even simpler. Very few distributions actually install this program as standard, but nevertheless there is an rpm package on most distribution CDs. If this does not apply to your distribution, you will find the necessary files at http://www.mathematik.unikl.de/~wenk/kwintv/download.html . Start kWinTV either via the K menu /Multimedia/kwintv or in a terminal emulation with kwintv &. If you hear a hissing noise, and see an image as in Figure 1, you’re almost there. kWinTV now just needs to find the right transmitter, so that you can watch telly till the cows come home. But if instead a blue or black window appears, unfortunately either the wrong driver has been loaded or the right one has been wrongly configured. Make the necessary changes, as appropriate to the type of TV card you have, in the file /etc/modules. conf. The necessary details can be found, in the case of SuSE, for example, at /usr/share/doc/ packages/bttv/CARDLIST and /usr/share/doc/packages/bttv/ README.SuSE.en or for Red Hat at /usr/src/linux-2.4.3/Documentation/ video4linux/bttv/CARDLIST. Please remember, after making the change, to call up the command depmod -a and then reload the bttv module with the modprobe command.

76 LINUX MAGAZINE 14 · 2001

Channelling But now, back to kWinTV. In order to tune the program the right TV channels, the author Moritz Wenk has developed a Stationscan for you. Go to the menu list and select the item Program / Wizard. You will then be met by a screen as in Figure 2. First of all click on the Next button in order to get started. There is nothing for you to do in this screen, since the television standard is already set to PAL and thus the normal one for the United Kingdom, so simply click again on Next. The following mask is a bit more exciting. This is where you decide whether all available frequencies should be sought for TV stations, or whether the Wizard should limit itself to certain frequencies. The author has made the default a scan of all frequencies. You can easily change this by deselecting the box Scan whole frequency band and specifying, in the pulldown menu below that, Europe West as region. The result in our latitudes is the same, except that the latter setting has the delightful advantage of being much faster. Click once again on the Next button and in the screen which then appears, click on the Start button, which will start the hunt for the television stations available to you. kWinTV will constantly keep you informed about progress and its findings (Figure 3). Finished scanning? With a final click on Next you will find yourself back in a screen as Figure

Figure 2: The ScanWizard says Hello


KORNER

Figure 3: Progressive

Figure 4: If the automatic scan can’t hack it, a bit of manual labour is required

4, in which kWinTV proudly informs you that you are now through with this procedure. Finally, select the Finish button. That’s it – kWinTV now has all it needs to allow you carefree hours of TV. If, against all expectations, the automatic channel search does not work, you have the alternative option of setting the desired channel manually. To do this, select Program / New. Here, by the way, you can also configure the video source. This is necessary when you want to use the Composite or S-Video input of your card instead of the TV tuner (Figure 4).

Channel hopper So. There are your channels. kWinTV thanks you with an image as in Figure 5. For anyone who finds this too small: A full screen image is also possible. You can achieve this either via the menu item TeleVision / Full Screen or by a click with the right mouse button on the kWinTV window. In the popup menu, select TeleVision / Full Screen from the menu. kWinTV then shows its true size (Figure 6). If you want to get back into normal mode – a right mouse click is all it takes, and you can remove the tick next to Full Screen. Apart from the full screen mode the program also offers you other screen sizes, which you can set via the item TeleVision / Set Size / Desired size. Once configured you can switch back and forth between the TV programmes at any time either using

Figure 5: Moving pictures at last

BEGINNERS

Figure 6: kWinTV in full screen mode

the [up arrow] or the [down arrow] keys. You also have the option of changing the station as well as the programme number using the arrow keys. Anyone with an infrared remote control can obviously also use this. It is configured via Options / IR Control Setup. kWinTV brings you the sound of a flute via the menu item Audio and a hardware-dependent input for the mixer such as Mixer Sound Blaster... (Figure 7). But in this case, please make sure that the input to the sound card is either Line in or Microphone and the corresponding connection must be set to loud, so that you don’t just receive silent films. The sound input, by the way, is set using the menu item Options / General Options / Mixer. The default Line in usually ought to be appropriate here.

But kWinTV can do other things, too. Apart from the ability to take screenshots of the TV image which is currently running, you can also record a whole video clip and save it in AVI format. A large, fast hard disk is however a prerequisite. Watch out: The algorithm for AVI recording is not so effective as those of some similar text-based tools (e.g. bttvgrab), so that with slow computers lots of frames get lost and the video can often display horizontal bars. If you want to shoot a screenshot, click either on the little camera icon in the menu list or the menu item TeleVision / Snap Shot. The desired format (jpg or png) can be set under Options / General Options... / Snap Shot. Plus, at this point you also have the option of defining the desired quality, size and the directory in which you want to save the snapshots. Start the video recording via TeleVision / Video Clip. All this should just about cover the total TV requirements of even the squarest eyed geek. ■

Figure 7: A good mix

14 · 2001 LINUX MAGAZINE 77


BEGINNERS

DESKTOPIA

Jo’s alternative desktop

MOUSETRAPS JO MOSKALEWSKI

A desktop without using the mouse, with no clicking and pushing? evilwm is the enemy of all rodents. Are you one of those people who value their wrists too much to want to encourage the computer workers’ disease RSI (“Repetitive Strain Injury”) by simultaneous clicking and pushing with the mouse? Fortunately, under Linux it is still possible to use (almost) any required program primarily with the keyboard and not the mouse. Whether it’s word processing, typing emails, entering commands in a Bash shell or editing files in Midnight Commander – the input device of choice is usually the keyboard. High time for the mouse to throw down the gauntlet.

Pest control No, the mouse is not just going to be done away with. But when your fingers want to stay on the keyboard, why should you move them away, just to move, close or change a window? What would be ideal is a desktop which can cope without a mouse. Anyone who has called up his favourite editor often enough will now scarcely use the mouse to cut out or insert text. This is done much more effectively with a keyboard command. For anyone who tends to work mostly on the keyboard it could make sense to convert the desktop to keyboard operation too, instead of having constantly to switch back and forth between keyboard and rodent. Which is precisely what the window manager evilwm offers.

Mode of operation This miracle weapon can obviously be found on the http://evilwm.sourceforge.net/ site. evilwm is a window manager of the totally Spartan type. It has a one-pixel frame without any form of window decoration, and it is aimed at purely keyboard use. The minimal frame only serves to indicate the focus (although those with fine motor skills could manage to hit it with the mouse and thus destroy the entire concept ...). The bonus is in terms of space-saving and makes its presence positively felt especially at lower resolutions where whatever might have previously slipped outside the visible area will now, hopefully, become visible (and if it still doesn’t, the question will no longer arise any way as to how this is to be moved by means of the mouse to get to the OK button). And yet, even in addition to missing window borders, evilwm still has some dirty tricks in store, or to be more precise, it simply has nothing in its baggage. With it you can neither set a desktop background or change the mouse pointer from the standard X crosshairs into something more sensible (such as an arrow). And you will search in vain, too, for a start menu, a clock, a taskbar or configuration file. Practically nothing indicates that there is even a window manager running the desktop. Other window managers usually come with all

Table 1: Jewels for “poor” window managers Program xsetroot

deskTOPia

Display

Only you can decide how your Linux desktop looks. With deskTOPia we regularly take you with us on a journey into the land of window managers and desktop environments, presenting the useful and the colourful, viewers and pretty toys.

qiv oclock tkgoodstuff panel xosview gkrellm root-tail xnodecor

78 LINUX MAGAZINE 14 · 2001

Function X-Window standard tool for setting a desktop background colour –equally, an XPM graphic can be displayed instead of a colour. Also suitable for changing the cursor. Tool from the ImageMagick package, with which graphics can be positioned on the screen Background graphics incl. fast image viewer Time Program starter/Start bar –can also “swallow” small applications universally usable GNOME start bar System monitor expanded system monitor Logfiles on the desktop background smuggles programs past the window manager


DESKTOPIA

kinds of built-in functions and small extra tools. Anyone who uses evilwm must search out these tools for themselves (but in return gets the opportunity to come closer to his ideal desktop). Table 1 can make the search a little easier.

Preparation Happy is the man who has a captive Debian-based Linux on his hard drive: A simple dpkg -i evilwm_0.3.11-1_i386.deb installs the finished package. Everyone else will have to get hold of the source and compile it. The compilation in this case is almost too unspectacular (only the devel-packet for X is needed, apart from the compiler gcc and its helper make), and this procedure is followed by a bit of manual labour: Like all other window managers, evilwm wants to be started in addition to an already-active X-Server. For this purpose, any user can make an X startfile in his home directory: Usually ~/.xinitrc is used for starting from the console via startx and ~/.xsession in the case of a graphical login. If no such file exists, it is easy to make one and if one already exists, it is advisable to back it up before doing the next bit of tinkering. Such a startfile could now read as follows: xsetroot -solid darkslategrey xsetroot -cursor_name top_left_arrow xclock -digital -fg lightyellowbgU darkslategrey -geometry -0-0 & evilwm In this example, a background colour is first set using xsetroot and then the mouse pointer is changed into an ordinary arrow, at which point a clock takes its place in the right, lower corner of the desktop. Last of all, the window manager starts. evilwm also includes a few options. For example anyone who prefers to issue orders in an aterm rather than in an xterm, can say so with the suffix -term aterm. However, the aterm (just like its related Xterminal programs wterm and rxvt) requires the support of the window manager to fake transparency. In this instance, evilwm does not support this –so the “transparency” feature is not available in aterm. The one-pixel frame is completely configurable via the call. Anyone who wants the active red window in future instead of the default golden one can achieve this with -fg red. In the same way, inactive windows can be changed with -bg black, from the default grey to black. And those finding one measly little pixel is not enough, can multiply the frame thickness by ten with -bg 10.

BEGINNERS

Table 2: Command reference Command [Ctrl-Alt-Enter] [Ctrl-Alt-h] [Ctrl-Alt-j] [Ctrl-Alt-k] [Ctrl-Alt-l] [Ctrl-Alt-y] [Ctrl-Alt-u] [Ctrl-Alt-b] [Ctrl-Alt-n] [Ctrl-Alt-x] [Alt-Tab] [Ctrl-Alt-Insert] [Ctrl-Alt-Esc] [Ctrl-Alt-i] [Ctrl-Alt-f] [Ctrl-Alt-1 to 8] [Ctrl-Alt-Left] [Ctrl-Alt-Right] [Ctrl-Alt-Backspace]

Function open new terminal move left move down move up move right move to top left corner move to top right corner move to bottom left corner move to bottom right corner maximise/normal change active window jump back to window focus list close window window information attach window (take it along to another virtual desktop) switch to virtual desktop 1 to 8 change to the previous virtual desktop change to next virtual desktop end session

remember always to give a program call an & as well, without it the terminal will remain locked until the program is shut down. An & sends a program into the background. If you have now succeeded, with this &, in conjuring a veritable jungle of windows onto the desktop, then you can escape the chaos using the key combination [Ctrl-Alt-Right] and get to the next, still empty, desktop. If you want to take a window there with you, just mark it with [Ctrl-Alt-f]. You can go back to the previous virtual desktop together with all the applications thereon with [Ctrl-Alt-Left]. If you ever get stuck, your mouse can in future still dash to your aid: First press the [Alt] key and using the left mouse button, the window can be moved, with the middle one its size can be altered and with the right one, another window can be focused. Another speciality of evilwm is the shutdown. There is (why are we not surprised) simply no provision for this. The whole X-Server has to be shot down. You can do this using the key combination [Ctrl-AltBackspace], which goes marvellously with the other ones from Table 2.

Application Table 2 shows the evilwm keyboard layout. Of elementary importance is [Ctrl-Alt-Enter] which brings up a terminal from which required programs can be started. What matters most in this case is to

Figure1: Nothing for mice 14 · 2001 LINUX MAGAZINE 79


BEGINNERS

GNOMOGRAM

Gnome News and Programs

GNOMOGRAM BJÖRN GANSLANDT

+++ Ximian Mono +++ GNOME at the LinuxTag +++ One year of Gnomogram +++ GLAME +++ Gnomemeeting +++

Ximian Mono What was already widely suspected after the announcement of SOUP is now official: Under the name of Mono Ximian will be porting some of the standardised parts of Microsoft’s .NET as free software onto Linux. This also includes the programming language C#, which, because of its design, works with both Java and with C++. One of the great strengths of the .NET-framework is that a compiler does not create the usual binary code, but an intermediate language called MSIL (Microsoft Intermediate Language). This intermediate language is then compiled as required by a socalled JIT-compiler (Just In Time). Since it makes no difference from which language the MSIL code has been created, it can access class libraries regardless of language, which could in principle also simplify GNOME programming in various language. Ximian must thus create at least two compilers as well as a .NET-compatible class library. This class library is very

GNOME at the LinuxTag The GNOME Project was once again on show at this years LinuxTag, and hard at work it was too. In addition to the computers, which were provided by SuSE and Sun, there were also some private computers on the stand and during the show it was possible to compile countless programs from diverse CVS archives. The other machines were quickly refitted with Debian Unstable, in order to present visitors with the latest achievements in the world of GNOME software. The concept obviously worked, since the stand was chronically overcrowded, and the trade in both CD-ROMs and T-shirts was roaring. Also of interest to GNOME fans was the Japanese stand: Here AXE presented its Sikigami-GNOME on the iPaq and a handheld from NEC not yet available in this country. Even though the interface was clearly recognisable as GNOME, using it turned out to be somewhat fiddly, since it was designed for the Japanese market. As he did last year, Matthias Warkus gave a talk on GNOME – this time with the emphasis on GNOME 1.4. In the course of the talk, though, he also went into the origins of GNOME and offered a small preview of GNOME 2.0. Also of interest for all Python programmers was the talk by Christian Egli, who presented Methods of Rapid Application Developments with Python and GNOME. For all those who missed out on the LinuxTag, there are numerous photos at the LinuxTag website, some of them portraying the GNOME Team.

80 LINUX MAGAZINE 14 · 2001

.NET also for Linux

large in the original and also contains classes for Windows’ own GUI, which Ximian wants to convert with GTK+. Also, there are plans to use the libraries stemming from the GNOME environment, Libart and Libgda, for Drawing2D or database access. Since the .NET framework is still considerably larger, the Free Software Foundation has also come up with another project named DotGNU. This project, unlike Microsoft’s “Passport”, is intended to allow decentralised and secure authentication and thus give developers and users more freedom.

One year of Gnomogram The first Gnomogram appeared almost exactly one year ago – at that time still under the heading of software. For GNOME fans it was in any case an exciting year, and although many were prophesying the imminent death of the GNOME project following the end of Eazel, GNOME is now livelier than ever, and work is proceeding apace on the next release. And so that GNOME and Gnomogram can become even better in future, we will obviously be glad to receive both praise and constructive criticism (and birthday presents!).

GLAME GLAME, which stands for GNU/Linux Audio Mechanics, is preparing to become the “GIMP of sound” and thus compete with Windows programs such as Soundforge. But that’s a long way off,


GNOMOGRAM

Figure 2: A small filter in GLAME

although, even if the program is still somewhat unstable, you can have already have some fun working with GLAME. On starting, the user first sees a project view, in which samples can be assigned to different groups and projects. Such samples can be recorded or imported via the sound card, where the pop-up menu gives you a choice between Import... and Apply Operation/ImEx/Import. Although both options achieve the same purpose, the latter uses libaudiofile and is thus a bit faster. If you have a few samples together, they can also be roughly arranged in chronological order using Timeline in the pop-up menu, and for each sample an editor-view can be started. In addition to the usual effects such as Cut & Paste, the editor also allows you to create a filter network under Apply Custom.... In this filter network, a large number of filters can be classified between the default source swapfile_in and the output swapfile_out, and GLAME offers not only its own, but also all installed LADSPA filters to choose from. Of course other sources such as an MP3 file or an oscillator can be combined with the specified source. But with all synthetic sound sources you must make sure that they are connected to a repeater, in case you need a longer sound as input. You can of course also create a filter network under Filternetwork/New Filternetwork... independent of the wave editor, which can then be applied to files on the hard disk or even to a source on the sound card. Should you have already networked your own effect, you can save it as normal. You can also re-route ports with a right click on the input or output of the components and register the complete network as a new filter, which can then in turn be used in another network. For anyone finding this is all too graphic, GLAME also offers a scheme front-end named cglame, which is documented on the GLAME website. Even if the front-end is not particularly intuitive, it does offer some interesting options with respect to automation.

Gnomemeeting It’s not only the name of Gnomemeeting which is reminiscent of Microsoft’s Netmeeting, both programs are based on the open standard H323, which makes it possible to exchange video and sound between programs. Gnomemeeting makes use of the

BEGINNERS

OpenH323 library to do this, which in addition to H323 itself, also comes with a few other standards for the transfer of video and/or diverse audio and video codecs. In order to “ring up” a conversational partner, you need their IP, but this is only static for very few users. For this reason, Gnomemeeting can call on ILS databases, in which other users register. In the case of ILS this is mainly LDAP, which is why Gnomemeeting also needs OpenLDAP to compile. A list of such ILS servers can be found at the netmeetings website, while in most cases the ports 389 or 1002 are used. If you have found a potential partner, you can copy him from the ILS window via the button with the thumbsup in the main window. This is not the only place where the interface takes some getting used to – very few users would find out spontaneously that you can get to the video and audio settings with a right click on Remote User Info. Similarly to most instant messengers, the program also comes with an applet for the panel, which reports any calls. If you can overlook the minor weaknesses in the way it is used though, Gnomemeeting is a truly refined program for Internet telephony and represents an interesting – if bandwidth-intensive – alternative to the normal Chat.

The author Bjorn Ganslandt is a student and a passionate bandwidth squanderer. When he is not involved in trying out new programs he is reading books or playing the saxophone.

Figure 3: A picture says more than a thousand words

Info www.ximian.com/mono/ dotgnu.org hydra.linuxtag.uni-kl.de/~daniel/lt2k++/ linuxtag.openit.de/2001/ jadzia.nl.capsi.com/~cap/digicam/2001-07-09-linuxtag/ tigert.gimp.org/photos/ www.hf.vslib.cz/~jimmac/ glame.sourceforge.net www.ladspa.org www.gnomemeeting.org www.openh323.org www.netmeet.net/bestservers.asp

14 · 2001 LINUX MAGAZINE 81


BEGINNERS

OUT OF THE BOX

NEAT THINGS CHRISTIAN PERLE

Unsure whether the HTML on your own web pages is right? Has the HTML export from word processing or the HTML editor produced gobbledegook? With tidy you can clear it up.

HTML: “HyperText Markup Language”, the mark up language originally developed at CERN for sites on the World Wide Web. By using so-called Tags, specified sections of text are marked up as headings, lists, tables and suchlike. WYSIWYG: “What You See Is What You Get”, a concept in popular use in the office domain, in order to see inputs immediately in the formatted representation. Since in the case of HTML the exact appearance of headings and other page elements is not defined, it is not exactly compatible with the WYSIWYG concept.

Out of the box

Perfect nonsense

There are thousands of tools and utilities for Linux. “Out of the box” takes the pick of the bunch and suggests a little program each month which we feel is either absolutely indispensable or unduly ignored.

One often reads, on WWW pages, the phrase “optimised for Netscape Navigator” or “optimised for Internet Explorer”. But in point of fact, this alleged optimisation really means that anyone using a different browser can look forward to incorrectly or incompletely displayed page contents. It’s better to use valid standards supported by the majority of browsers. It’s not without good reason that tidy keep very closely to HTML standards. It is being developed by Dave Raggett in the frame of the WWW Consortium (W3C), which is working out precisely these standards. But before tidy clears up for you, you have to install it.

Anyone putting their own websites onto the Net creates these in one of two ways. Whether with a simple text editor or with an HTML editor, which works according to the WYSIWYG principle, in either case errors can arise. With tidy, there is now a tool available to help you to create “clean” and standardised HTML documents.

Listing 1: HTML with errors <title>Sloppy page <h1>A page full of errors</h2> ... and that means food for <i>tidy</i>! <P> On this page there are <LI> wrong and missing tags, <li>an incomplete list <li>and <i>wrongly <B>nested</i></B> tags.

Listing 2: Tidy has cleared up <!DOCTYPE html PUBLIC “-//W3C//DTD HTML 3.2//EN”> <HTML> <HEAD> <META name=”generator” content=”HTML Tidy, see www.w3.org”> <TITLE>Sloppy page</TITLE> </HEAD> <BODY> <H1>A page full of errors</H1> ...and that means food for <I>tidy</I>! <P>On this page there are</P> <UL class=”noindent”> <LI>wrong and missing tags,</LI>

From a reliable source To do this, get the source archive from the tidy home page (http://www.w3.org/People/ Raggett/tidy/) and install it with the following commands: tar xzf tidy4aug00.tgz cd tidy4aug00 make su (enter root password) make install ; exit If this procedure has gone smoothly, you can subject tidy to a first operational test.

Make it better Using a text editor, create the file sloppy.html (Listing 1). You can now let tidy loose on this HTML catastrophe and divert the improved result into the file better.html: tidy -upper sloppy.html > better.html

<LI>an incomplete list</LI> <LI>and <I>wrongly <B>nested</B></I> tags.</LI> </UL> </BODY> </HTML>

82 LINUX MAGAZINE 14 · 2001

The result can be seen in Listing 2. The program also issues some error messages in addition to the corrected output, so you can understand exactly what it was that tidy did not like and what has been added or replaced. The option -upper ensures


OUT OF THE BOX

BEGINNERS

Listing 3: Structure not recognised... <ol><li>A<ul><li>a<li>fat</ul> <li>oily <li> fish <li>went angling</ol>

Listing 4: ... but now it is

Figure 1: Netscape is confused

that all tags are written out at the same size. The corrections include, among others: ● Completing the page with HTML, HEAD and BODY tags, ● Closing the TITLE tag (a significant difference, as can be seen in Figures 1 and 2), ● Correcting the H1 heading erroneously closed with </H2>, ● Enclosing the list tags with a UL tag, ● Closing each individual list tag with </LI>, ● Swapping the closing tags </I> and </B> for correct nesting and ● Replacing the umlauts with HTML entities. The last point is necessary because of the DOCTYPE comment added by tidy. If DE crops up here instead of EN, then ISO-Latin-1 coded umlauts are permissible. In order to leave such umlauts unchanged in the tidy run, use the option -raw.

Beautiful HTML In order to format computer-created HTML to make it easily legible for manual post-editing, tidy has the indent option, which indents the respective HTML elements according to their depth of nesting. In Listings 3 and 4, the effect of this option is demonstrated. If you allow table elements to indent in the same way, their representation can easily be changed due to errors by some browsers. So it’s better if you control the result. Even the HTML derivative interspersed with proprietary extensions which is created by MS Office 2000 can be put into a clean form which is also more suitable for the WWW by tidy (Option —word-2000 yes). In the test a document 90 KB long was reduced to one tenth(!), without any sacrifice of data content.

<ol> <li> A <ul> <li>fat</li> <li>oily</li> </ul> </li> <li>fish</li> <li>went</li> <li>angling</li> </ol>

Figure 2: tidy works wonders

Fine-tuning If you need certain command line options of tidy again and again, but are tired of constantly typing them in, entries in a configuration file would be a good idea. It’s up to you whether you want to use a system-wide configuration or one which is linked to your user account. To tell tidy where the configuration file is, set the environment variable HTML_TIDY to the corresponding file name, such as /etc/htmltidy.conf. To do this, add to your .bashrc the line export HTML_TIDY=/etc/htmltidy.conf. Now enter your standard options into the configuration file. Listing 5 shows one example. A wide-ranging overview of the options can be found in the file Overview.html in the tidy ource archive. With wrap: 72, lines in the HTML document are broken after 72 characters, indent: auto gives automatic indenting with the exception of tables, char-encoding: latin1 selects the character set coding and uppercase-tags: yes does the same as the option -upper. I can strongly recommend the home page of the program for additional functions and options of tidy.

Listing 5: Example of htmltidy.conf wrap: 72 indent: auto char-encoding: latin1 uppercase-tags: yes

HTML entities: A substitute notation for characters not included in the 7-bit ASCII character set or characters which have a special meaning in HTML. The entity for the umlaut is ü, that for the copyright symbol © or that for the less-than symbol <. ISO-Latin-1: A standard for the coding of country-specific and special characters as extension of the ASCII character set. The latter prescribes only the codings from 0 to 127 and thus leaves out e.g. umlauts. Environment variables: These variables automatically pass certain system settings to processes, for example the search path for programs PATH, the localisation settings LC_LANG and LC_CTYPE or again, the name of a configuration file.

14 · 2001 LINUX MAGAZINE 83


REVIEW

SuSE 7.3

SuSE 7.3

FIRST LOOK SuSE have once again produced a Linux box set with wide appeal, with its incredible range of software packages, split into two forms to give more choice.

SuSE Linux 7.3 Personal is well suited to providing the Linux newcomers with all they would need to develop a full understanding of all the advantages and benefits that a free Unix clone, such as Linux can achieve on a desktop computer. Three CDROMs include the latest stable operating system kernel and enough applications to dominate a computer in areas such as Office productivity, Internet connectivity, multimedia, image processing and games. The manuals have always been a real asset, well laid out, easy-to-understand and informative. The three manuals will lead the user, even one with no previous Linux experience, through the entire installation process and give them an introduction to the main desktop applications. For one of the most complete boxed sets of Linux software, the SuSE 7.3 Professional package offers the ambitious home users and IT professionals alike a comprehensive portfolio of more than 2000 upto-date software packages. For the installation, the user can choose between seven CD-ROMs and one DVD. The scope provides everything needed to set up intranet and Internet solutions as well as for interconnecting and protecting heterogeneous networks. Professional users are provided with all the tools required for implementing file and print

Personal Firewall This effectively protects your computer against intruders. When you are online, this wall blocks everything you don’t explicitly request or send. You can still view web pages, download program files via FTP, update your own web pages, and transmit e-mail. The SuSE Personal Firewall can be activated with a single mouse click.

94 LINUX MAGAZINE 14 · 2001

glibc 2.2.4 The new major version number reflects major changes, several years of work. 1.09.1 was a static library in the style of the 80s; the new version implements the state of the art in C library technology. It follows even the most recent standards (ISO C 99, POSIX.1c, POSIX.1j, POSIX.1d, Unix98). It is also internationalised and might have the most complete internationalisation interface known.

servers as well as WWW, proxy, mail, and news servers under Linux. The 7.3 Professional version contains five comprehensive manuals packed with the latest first-hand Linux know-how – including specific issues such as network configuration and security. Both come with SuSE Personel Firewall. SuSE 7.3 offers the latest stable Linux Kernel 2.4.10 and glibc 2.2.4. This new kernel has improved memory management which increases performance and efficiency, most of all for server side applications. SuSE have always put much effort into their install system which serves them well for users who need some hand holding during the fretful time that an installation can be. Effort has also gone in to ensure the more experienced user can end up with the system that they want, with the choice of ‘Expert Options’ along the way. As usual the Yast2 installation falls into 8 stages, with an advancing Tux penguin keeping tabs on which stage you are up to. The installation screens are always full of context sensitive helpful information, making it most unlikely that you would need to refer to the manual for guidance. Even


SuSE 7.3

REVIEW

Partitioning the hard disk with Windows

though this install system has been simple and easy to use, SuSE have been able to make some improvements in this area though. The system of arranging for a dual boot installation of SuSE Linux together with Windows 95, 98, or ME has been substantially simplified. SuSE Linux 7.3 automatically determines free space on the hard disk and offers a suggestion for the use of this hard disk space. Should you have the need, and the knowledge, then you still have the option of ‘Expert mode’ will allow you partition your hard drives in whatever way you choose, giving you complete control over setting up LVM, RAID and other parameters like setting mount points and alike. ReiserFS now seems to be selected by default, which should allow for faster booting and less disk activity. Software selection has also been improved. During the install you are now offered some preset installation types, available at the click of a radio

button, ranging from minimal all the way to complete – and it could take some time to install all 2000 packages. You also get the option of detailed software selection for those people who just can’t stop themselves tinkering. The ‘Selecting Single Packages’ option shows you all of the packages broken down by group and then allows you to make your selection from within that group. This gives you much more manageable lists to select from. You also get the chance to search for packages by name or by description. Once you have defined the where’s and what’s of your installation, you are then presented with an

ReiserFS This is an alternative file system to ext2fs which has been used by most distributions. Its main benefits:Wastes less space: no static inode space allocation, small files packed together. Much higher performance for large directories, even compared to other balanced tree filesystems. Uses B* balanced trees where other balanced tree filesystem use obsolete B+ trees. See http://www.namesys.com/features.html for more information.

14 · 2001 LINUX MAGAZINE 95

Sound card support


REVIEW

SuSE 7.3

Become a TV station

‘Installation Screen’ to show your progress. Not only does it show you what is currently being installed, you also get to see how much time the install has left to run, as a total and on a CD by CD basis. While these times are fairly approximate, it does give you the chance to do some planning, giving you an idea as to when you will next be called upon to change the CD. Now you will know if you have time to make a cup of tea or cook lunch! The automatic hardware detection feature has been considerably expanded and now includes even more components, with CD writers, Scanners and TV cards amongst them. This then allows the setup tool YaST2 to execute the installation and Internet hook-up almost entirely by itself. Security is becoming more and more of an issue both at home and the office and SuSE 7.3 allows you to set up a “Personal Firewall” during your initial installation. A user-friendly graphical front end is now available for configuring the firewall, making it simple to protect your host or network against unauthorised access. As well as this, SuSE’s “crypto file system” makes sure that sensitive data is secure even if the entire hardware is stolen. Stored data is only available in unencrypted form if the user has entered the correct password. Other proven security tools included in SuSE Linux 7.3 are the mail scanner AMaViS (A Mail Virus Scanner) and PGP encryption for e-mail. Security relies on you having the latest patches available and the SuSE

The important stuff The recommended retail price for: SuSE Linux 7.3 Personal (3 CDs, 3 manuals, 60 days of installation support) is £35. SuSE Linux 7.3 Professional (7 CDs, 1 DVD, 5 manuals, 90 days of installation support) is £59. SuSE Linux 7.3 Professional Update, the boxed version, will be available for £35. SuSE Linux 7.3 is available directly from SuSE Linux UK Ltd. or from bookstores and software retailers. http://devlinux.com/namesys More information from http://www.suse.de/uk/

96 LINUX MAGAZINE 14 · 2001

SuSE desktop

YOU (YaST Online Update) facility makes it easy for you to stay up-to-date. When needed, you simply get SuSE YOU to connect to the SuSE ftp server and it will automatically download and install any of the required security updates and bug fixes available, for no extra charge. The Linux desktop never stands still and SuSE 7.3 shows a lot of these advances, include the latest KDE, version 2.2.1, the highly functional graphical user interface, which is selected by default, as well as the most recent version of other desktop like Gnome and Enlightenment. Some of the KDE highlights include the file manager Konqueror now being set to display its file contents in a thumbnail format, which is especially useful for those dealing a lot with image and graphics archives. There is a graphical tool called Kooka which takes on the responsibility of handling the job of scanning, now making it quick and efficient. There is also the new print assistant which guides the user safely along the tricky and protocol pitfall ridden path using lpr and/or CUPS. Linux professionals have the runlevel editor to look forward to which allows for the selective activation of server services. For the first time, the scope includes YaST2 modules for administering NIS servers as well as NIS and LDAP clients. Apart from ReiserFS, two additional journaling file systems, JFS and Ext3, can be selected.


COVER CD

SuSE

SUSE 7.3 LIVEEVAL Installation Instructions for the SuSE Linux 7.3 (LiveEval version)

The LiveEval CD contains a selection of SuSE Linux software: the Linux kernel, system utilities, numerous network programs, the X Window system with the KDE graphical interface, etc. The LiveEval is distributed without support services. The following information sources are available to you: the handbook in electronic form, the SuSE Linux Support Database, the SuSE Linux mailing lists, as well as info texts in the individual screens (see “Further information”). Since all programs can be started directly from the CD, the entire system is slower than if SuSE linux was installed on to the hard disk and you used your own file systems. You cannot take out the CD whilst the system is running.

Requirements You don’t have to change the partitioning of your hard disk to install SuSE Linux from the LiveEval CD. Your computer should have at least a Pentium processor (or compatible), 96Mb RAM, a bootable CD Rom drive as well as a partitioned and formatted hard drive. You will need about 200mb of free space on the hard drive. Your system BIOS needs to be able to process 2.88MB boot images.

3 Now you can configure your system with the help of the graphical installation program YaST2. First you can set the language, keyboard layout, time zone, user and root passwords. Some time may now pass before you can launch the menu for the monitor and video card settings. This is normal. Complete this phase of the installation process once you have configured the monitor.

4 Apart from the automatic detection of hardware such as printers, sound cards, modems/ISDN/network, you can manually carry out other configurations. 5 After completing the installation process, you can log in via the KDM (KDE Display Manager) and use the programs in the graphical interface KDE ( K Desktop Environment).

Starting the system with the LiveEval 7.3 Once configured the SuSE Linux can be satrted whenever you choose. Boot the computer with the LiveEval CD Rom and wait for the KDM login screen to appear.

Installation.

Caution

As with any new system you are advised to back up all your data before installing so to prevent loss.

Never just switch the computer off! You have to shut it down properly. End the KDE session with “logout” and then, in the KDM screen , with “Exit”. If you want to remove the LiveEval system completely from your computer, simply delete the “suselive.*” files you created. (See point 2 of the Installation instructions above).

1 Once you have backed up your system, insert the CD and restart your computer. SuSE Linux will now be loaded. If the system fails to boot from the CD, you will need to change the boot sequence in your BIOS accordingly. 2 Once loaded the hardware will be detected automatically. Three files will be created on the first FAT partition (Drive C:) when you shut down the computer. These files will be suselive.usr (the working file), suselive.swp (a swap file for the virtual memory system) and suselive.730 (a configuration file).

Further Information README file on the LiveEval CD Rom SuSE Linux mailing lists: http://www.suse.de/en/support/mailinglists/ For any technical issues, please refer to the SuSE Linux Support Database:http://sdb.suse.de/sdb/en/html/index.html

14 · 2001 LINUX MAGAZINE 97


COMMUNITY

FREEWORLD

Make room for the FSF kernel

HURD THE GNUS? RICHARD SMEDLEY

The GNU Hurd is the GNU project’s replacement for the Unix kernel. Most of us are getting by quite nicely with the Linux kernel in this role, but the Hurd will offer several advance features when it reaches release status. Come and discover more. The release, as we near publication, of Debian’s new G1 binary CDs of GNU/Hurd has prompted an expansion of this column’s coverage of the Hurd. We hope to present to you our full report on installing and running this release in the next issue, meanwhile we investigate what makes the Hurd so special.

How’s Trix? Three years after the founding of the Free Software Foundation (FSF), by Richard Stallman, the first GNUsletter identifies TRIX – as the GNU kernel. In 1987, whilst changes continued to be made to TRIX, Stallman and the FSF began negotiating with Professor Rashid of CarnegieMellon University (CMU) about working with them on the development of the Mach kernel. In the February 1988 GNUsletter Stallman spoke about taking Mach and putting the Berkeley Sprite filesystem on top of it, after first removing the Berkeley Unix – specific code. At the end of 1988 the choice is still not settled between Mach, which was not yet Freely licenced, and TRIX. Sprite was even discussed as a full kernel solution. Some work starts on developing the Hurd in 1990 but more work goes into trying to free Mach: “We are still interested in a multi-process kernel running on top of Mach. The CMU lawyers are currently deciding if they can release Mach

with distribution conditions that will enable us to distribute it. If they decide to do so, then we will probably start work. CMU has available under the same terms as Mach a single-server partial Unix emulator named Poe; it is rather slow and provides minimal functionality. We would probably begin by extending Poe to provide full functionality. Later we hope to have a modular emulator divided into multiple processes.” – GNUsletter, January 1991. Eventually Mach 3.0 is released under a GNU GPL-compatible licence and the Hurd is officially announced as a group of servers running on top of the Mach microkernel. It was into this background of a slow start for the GNU kernel that Linus Torvalds announced a kernel of his own. Ten years on we see the Linux

A Unix Tradition. The Free Software world is littered – some would say plagued – with bad puns and self-recursive acronyms. `Hurd’ stands for `Hird of Unix-Replacing Daemons’. And, then, `Hird’ stands for `Hurd of Interfaces Representing Depth’. So we have the first software to be named by a pair of mutually recursive acronyms. Marcus Brinkmann working on the HURD 84 LINUX MAGAZINE 14 · 2001


FREEWORLD

kernel scaling up for enterprise, taking over the embedded sector and slowly marching onto the desktop – particularly where the advantages of thin client solutions are appreciated. GNU/Linux is the success story of the FSF’s project to produce a free Unix-like OS.

Debian and the Hurd During those ten years work on Hurd has occasionally been rather slow. Although the Hurd was booting by 1994, and later that year ran emacs and gcc, progress slowed after the binary release of 1996, which worked with NetBSD boot floppies. Piecemeal development left the Hurd broken. It was in this state when in 1998 Marcus Brinkmann started the Debian GNU/ Hurd port. A keen Free software advocate, Brinkmann was also inspired by the freedoms which a microkernel can give when running a multi-server system such as the Hurd (see Free, Freer, Freest, below). Brinkmann’s lead in bringing the powerful packaging tools of Debian (such as dpkg) and the porting to GNU/Hurd of almost half of the packages currently available for Debian GNU/Linux has helped to revitalise the kernel project. Making GNU/Hurd a Debian port has brought in many more developers and users to contribute bug reports. Debian binary CDs and a not-too-difficult installation procedure have resulted in a more accessible system for those merely curious today, who may be the committed users of tomorrow.

A New Strategy of OS Design OS development in the period up to the mid 1990’s left many with the impression that microkernels were “better in theory but worse in practice.” We will counter-balance that false conclusion with a rehearsal of the differences between microkernels and monolithic kernels and then look at what makes the Hurd (on Mach) so different from other microkernel OS implementations.

Free, Freer, Freest. Linux and BSD give you freedoms to modify, run and copy the OS and applications you need. Hurd gives additional freedoms – particularly to the advance user. Kernel code is no longer something that cannot be touched. Any user, without root privileges, can extend their kernel with their own services, and share their code with other users. Hurd takes ideas of Free Software and of unix modularity to its logical extreme, ultimately benefiting developer and user alike.

COMMUNITY

Why not Linux? You may find that GNU/Linux is the answer to most of your requirements. However the GNU organisation puts forward a powerful case for the Hurd: It’s Free Software – all the benefits and protections of the GPL. It’s compatible – a modern, Unix-like kernel using the GNU C library which closely follows the standards of ANSI/ISO, BSD, POSIX, Single Unix, SVID, and X/Open. It’s built to survive – object-oriented structure. It’s scalable – The Hurd implementation is aggressively multithreaded so that it runs efficiently on both single processors and symmetric multiprocessors. The Hurd interfaces are designed to allow transparent network clusters (collectives), although this feature has not yet been implemented. It’s extensible – every part of the system is designed to be modified and extended. It’s stable – It is possible to develop and test new Hurd kernel components without rebooting the machine (not even accidentally). Running your own kernel components doesn’t interfere with other users, and so no special system privileges are required. The mechanism for kernel extensions is secure by design: it is impossible to impose your changes upon other users unless they authorize them or you are the system administrator.

A monolithic kernel is (relatively) easy to get off the ground, but gradually becomes harder to maintain. All of the services that an OS must perform for programs to share hardware, and for users to share a computer, are implemented in the kernel. The kernel grows as more code is added for device drivers, network protocols, process management, authentication, file systems, POSIX compatible interfaces and more. As all parts of the kernel can access all of the kernel’s data structures, this is a temptation for some coders to make short cuts, instead of programming clean interfaces. In the real world this leads to a faster kernel at the expense of clarity and comprehensibility in the code. A change to one small part of the kernel can break an apparently unrelated part. Of course the monolithic kernel has a very rich set of features and has no need for message passing – components communicate with each other transparently. A system of dynamically loaded modules – as now used in Linux and AtheOS (see Linux Magazine issue 13) – improves the system further. Some features have not made it into Linux as an attempt is made to contain the size and complexity of the kernel. Nevertheless some code bloat is inevitable as core functionality grows with inevitable creeping featurs. A microkernel avoids this by only implementing the infrastructure 14 · 2001 LINUX MAGAZINE 85


COMMUNITY

FREEWORLD

necessary for other tasks to provide the features required of a modern OS. This boils down to resource management (paging policy and scheduling) and message passing, all other services can be run from user space - though basic hardware device support may be needed to bootstrap the system. To recap briefly the advantages of a microkernel. What platform specific code there is, is often limited to the microkernel making porting easy. The modularity of the design has the advantage of making it easier to integrate new features and upgrades into the OS. Most processes can run in user space – if one comes crashing down it will not take the rest of the OS with it, as would be the case if it were in kernel space.

A better service Other designs implemented upon the Mach microkernel have single servers and thus many of the disadvantages of a monolithic kernel. The Hurd is a multi server system. Each server runs as a Mach Task and provides one of the services of the OS. They communicate through Mach message passing. Bugs in a server will not affect the rest of the OS – so overall stability is improved. Indeed if a file system server for a mounted partition crashes it need not take down the whole system. The partition is unmounted and the server can be started again with debugging information (using gdb). Testing new servers means no reboot – nor is there a need to take down any existing servers. Amongst multi-server systems the Hurd is unique for allowing users to replace or add to virtually all of the system dynamically. Authentication servers establish the identity of programs which need to trust each other and the process server establishes control over system components by the superuser. No other server has any special status.

Partition number blues Linux users are familiar with the hd[a-d][1-n] system of referring to disks and partitions. Those making the move from LILO to GRUB find a new system of (hdN,n) with all the disks in order, first the IDE devices, then the SCSI; disks and partitions are zero indexed. For example (hd0,3) refers to the fourth partition on the first drive. (hd1,0) refers to the first partition on the second drive – if there is only one IDE drive then (hd1,0) is on the first SCSI drive, if there are at least two IDE drives then (hd1,0) is the second IDE drive, regardless of whether it is a master or slave disk on the primary or secondary controller (Thus Linux might see, for example, hdc1 for the same disk and partition). This is the way that the BIOS sees the disks. It is important to become comfortable with the different systems to avoid mistakes during installation – particularly as Hurd uses a slightly different system, based upon the BSD slice approach to partitions. In the example of hdc1 (linux) or (hd1,0) (GRUB) above, Hurd calls it as hd1s1 if it is an IDE drive, however SCSI drives are numbered according to their SCSI id. Each system exists for a good reason and anyone wanting to cross-install Hurd from Linux and boot with GRUB will for now, unfortunately, just have to get used to it.

86 LINUX MAGAZINE 14 · 2001

A good Mach Hurd is a set of services which runs upon the Mach microkernel – originally upon Mach 3 – with device drivers from Linux 2.0.x From this was developed GNU Mach, which is what new users will probably try first. However for extra flexibility most developers work with OSKit Mach. Utah’s OSKit for OS construction with Mach sitting on top and handling virtual memory management and messaging.

Make it clean The very modularity of the system – the way it is split up into individual components – calls for clear and consistent interfaces to be written at the start. Responsibilities are clear and the object oriented (OO) nature of the design means that code is easier to maintain and develop and new services easier to write. Inter-process communication in Mach is based on the ports concept. A port is a message queue which can be used as a one-way communication channel. You also need a port right. This can be a send right, receive right, or send-once right. With the appropriate port right, you are allowed to send messages to the server, receive messages from it, or send just one single message. Mach ports are analogous to the ports of socket-based communication. It does not matter if the communicating threads are executing on the same processor, on separate processors in a multiprocessing environment, or on different computers on a network. Mach scales up well for distributed computing.

A fine translation A translator is a Hurd server which provides the basic filesystem interface. It sits between the contents of a file and the user accessing this file. Translators are just another user process – so can be run by any user. The only privileges needed are access rights for the underlying inode to which the translator is attached. The information about translators is stored in the inode – many translators don’t even require an actual file. A translator can be provided for the node /ftp, enabling transparent ftp and such commands as less /ftp/ftp.uu.net/inet/rfc/rfc1097 The flexibility implied by translators can take a while to sink in. Mount points, symbolic links and device files are all translators. A running translator is an Active translator, however powerful handling of devices and files comes from Passive translators. A passive translator is one that has not yet started. As soon as the passive translator is accessed, it is automatically read out of the inode


FREEWORLD

COMMUNITY

Info GNU/Hurd: Grub: Snapshot of Hurd source code: Debian GNU/Hurd: Kernel cousin archives: Easy install: A UK Hurd page:

http://www.gnu.org/software/hurd/ ftp://alpha.gnu.org/gnu/grub ftp://alpha.gnu.org/gnu/cvs/hurd.tgz http://www.debian.org/ports/hurd http://lists.debian.org/ports.html http://kt.zork.net/debian-hurd/back-issues.html http://www.pick.ucam.org/~mcv21/hurd.html http://www.hurd.uklinux.net.html

that many users will get to experiment with features which will never be available under even the best monolithic kernels (read Linux). If you would like to try it out, look out for the report on our experiences with the new Debian GNU/Hurd CDs in future articles, or download it now from debian – there is plenty of good documentation on the site and at http://hurd.gnu.org/

Richard Stallman

and an active translator is started on top of it using the command line that was stored in the inode. If the active translator is lost a new one will be started next time the inode is read (the device is accessed). As it sits on the inode it survives reboots – there is no need to maintain a configuration file for example mount points. For a more comprehensive look at translators and the other Hurd servers I recommend the documentation on the GNU Hurd Web site.

Follow the Hurd Potential kernel hackers may find that there is much less to learn before starting coding, due to the modular construction and cleanly designed interfaces. As described above, services can be dynamically loaded and debugged on a live system without impinging upon other functionality of the OS. In the info box you will find details of mailing lists and other resources. Do not feel that you have to be able to hack C to help. Anyone can get involved maintaining web sites, submitting bug reports or compiling their favourite applications to run on Hurd. The ability to dynamically replace the various system servers may reinforce the impression of a geek OS, nevertheless Debian’s packaging ensures 14 · 2001 LINUX MAGAZINE 87


BRAVE GNU WORLD

COMMUNITY

The monthly GNU Column

BRAVE GNU WORLD GEORG CF GREVE

Welcome to another issue of the Brave GNU World. Since all work and no play makes Jack a dull boy, I’ll introduce a Free Software game this month. But before I do I’d like to say a few words about Free games in general.

Free Games? Because of their small servicing needs and fast-paced market, Free games are a rather problematic area, even if some companies are now port games to GNU/Linux, these games usually remain proprietary. Of course it is true that games are usually not mission-critical and not the most important part of Free Software. But this does not make them insignificant. Games are often the first contact people have with their computers and play a significant role in “befriending” themselves with their computer. And quite often games are the “killer feature” that makes them install a non-free operating system on their machines. Another issue is that the gaming industry seems to be replacing innovative ideas with more and more effects. This may be a quite subjective impression and not hold up to scrutiny, but it very often seems that the first games were significantly more witty. In this area the interaction of a community might open new perspectives for captivating, nonlinear plots. It appears this potential is not yet being used. Very often lacking a user base is a problem for new areas, so I’d like to introduce Free games in the Brave GNU World more often. If you are having fun with a Free game or are working on one yourself, please get in touch. Also information about a

portal that is exclusively dedicated to Free games would be quite useful. Enough introduction for now, let’s get started.

Georg

Freeciv Freeciv is a Free implementation of the well-known game Civilization by Microprose under the GNU General Public License. For those not having experience with the game

Good graphics in Freeciv, a free variant of Civilization. 14 · 2001 LINUX MAGAZINE 91


COMMUNITY

BRAVE GNU WORLD

mentioned above I’d like to say that the game is about becoming the ruler of a civilization and taking care that your people grow and prosper. This involves finding resources, building cities, furthering science and keeping competitors at bay. A major advantage of the game is its nonlinearity and the continuous evolution, which makes it so hard for many to find an end when playing this game. Freeciv is already quite sophisticated and a player can choose between 47 units and 61 nations that can be played in prepared maps and scenarios. The game is also internationalized, so it speaks to the player in his or her mother tongue and has an ingame help. One of the extraordinary thing about Freeciv is the very active and lively community that has evolved around it and communicates through the #freeciv ircnet-channel. One reason for this is surely that Freeciv supports up to 30 players that can either be played by an “artificial intelligence” (ai) or by a networked human player (LAN or internet). Also Freeciv runs on all standard Unices as well as Windows and OS/2, given that the Cygnus Unixenvironment is installed. Originally, Freeciv was started by Peter Joachim Unold, Claus Leth Gregersen and Allan Ove Kjeldbjerg, but by now the administration is done by Thue Janus Kristensen and Tony Stuckey. Besides these people, an impressive number of volunteers have contributed to the versions that routinely come out in three-month cycles. You can find the list online at Freeciv.org. Microsoft-users are currently experiencing the greatest problems, but these could easily be solved by installing GNU/Linux. Other problems are caused by the extreme addictiveness and time-consumption of Freeciv, so if you’re currently working on an important project, you might want to postpone trying out Freeciv until the project has been finished. Stefan Kamphausen, author of the Brave GNU World logo, has tracked down the following project.

XWeb XWeb allows writing content and structure of web pages in XML/XSL in order to generate HTML pages from it. This does not only offer a performance advantage compared to dynamic pages, it also allows switching to a new layout or design with minimal changes. Especially the often quite significant but seldom entertaining work of creating the navigational structure is done for the user by XWeb. XWeb is based on Java & XSLT with Saxon as the XSLT processor. Other than with some projects, 92 LINUX MAGAZINE 14 · 2001

everything is based on XML, even the Makefiles. The HTML-pages created by XWeb are entirely independent from XWeb, so they can be transferred to a web server by FTP, for instance. Other than some XSL-processors, XWeb also allows the automatic generation of buttons, banners and such through an internal renderer or the external generation of “Scalable Vector Graphics” (SVG) by Batik. These features combined with the flexibility through use of XSLT stylesheets are the specific strengths of XWeb. The project is mostly pushed forward by its initiator, Peter Becker, who started the project because he was lacking this functionality in another project. XWeb is Free Software, even if the licensing as “public domain” is not optimal, because it allows anything to putting it under your own copyright. So the freedoms are not protected in any way. Plans for the future are to complete the program and include support for XSL-FO as well as generating templates for the most often used layouts. Later he’d like to add application-specific frontends (for photo- or MP3-albums, for example) and maybe even a WYSIWYG tool. Help is welcome especially in form of authors for templates and frontends as well as feedback from users.

General Server Pages The General Server Pages (GSP) project by Sebastien Devaux is also related directly to the internet, although it is more on the dynamical side. GSP is a preprocessor which allows for extremely easy creation of applications for structured output in different programming languages – which is especially useful for creating CGI applications. Writing CGI applications very often means repeating big amounts of rather trivial code with

The General Server pages – here with a variation in C


BRAVE GNU WORLD

the goal of creating a certain output. Therefore GSP allows specifying the output in a mixture of XML, GSP and the desired programming language in order to be transformed by GSP into a compilable source code or script creating the desired output as HTML, XML, SGML or plain text. This does not only spare time and nerves, it also increases the reusability of code. Programming languages currently supported by GSP are C, C++, Bash, Ksh, Perl and JavaScript; adding other languages is pretty simple. GSP can also create applications containing several pages and link them with each other. GSP was written in C++ and published under the GNU General Public License. It is still a rather young project as it started in February 2001. Problems are still the correct handling of MIME extensions as this requires external libraries, but this choice should be up to the user. The modules for the different languages can also be improved and Sebastien would like to make very sure that the generated code is safe. Help is welcome.

IDX-PKI The IDX-PKI project is the first IETF PKIX standards-compliant “Public Key Infrastructure” available as Free Software. It was developed by the French company IdealX that publishes and maintains it under the GNU General Public License. Since the term PKI is probably not familiar to many readers, I’d like to give a very terse and abstract introduction into the idea behind it. In any “Public Key” implementation, like PGP or the Free OpenPGP implementation GnuPG, every user has a keypair. This keypair consists of one private and one public key. The private key must never leave the users hands, while the public key is spread as far as possible. The private key allows the user to (for instance) sign Emails and everyone can verify the signature with the public key. Signing the mail with the public key is not possible, so the recipient knows that the mail has been signed by the owner of the private key. But anyone can create a key, so there is no guarantee that the private key really belongs to the person it claims to belong to. A solution for this problem is a “Certification Authority” (CA). This is often provided by socalled TrustCenters that make sure the identity of the users has been checked. Providing a Certification Authority is one of the primary jobs for a PKI. The IDX-PKI project allows every company and organization to set up their own CA-structure. This makes it possible to put the exact same amount of trust that you have into the company into every single employee. The tasks of creating and revoking keys is done centrally by the PKI.

COMMUNITY

A PKI does not only allow identification and authentication, it also allows confidential information, integrity of data and nonrepudiation in case of problems. All these things are important to many companies, but banks, insurances or e-commerce markets depend on it. Now these companies have access to a Free Software solution, which is a big contribution to Free Software by IdealX. Originally, the project team tried to get involved in the OpenCA project. But OpenCA is only a CA and not a complete PKI, it only allows for creation of certificates through OpenSSL, but it does not provide certificate management. Therefore IDX-PKI was started in April 2000. The IDX-PKI uses Perl, PHP, C, Shell as well as some GNU utilities and it is now ready for daily use although it is still being improved. Planned are (among other things) a capability for secure communication between different PKIs, full OCSP support and another abstraction layer that will make it possible to choose the backend (database, LDAP, filesystem). Also the administration will become interface-independent. So there are still some things in the queue, but according to Benoit Picaud the customers are very interested in this project and actively support the speedy and interactive development of the IDX-PKI-v2. He is even considering this strong cooperation to be one of the big strengths of the project - along with the RFC-compliance. Since this is a project that is also commercially interesting for many other companies, finding help should not pose a problem.

Enough for this time That’s it for this month, I hope I was able to drive your interests and, as usual, I’m asking for comments, ideas, feedback and project

Info Send ideas, comments and questions to Brave GNU World column@brave-gnu-world.org Home page of the GNU Project http://www.gnu.org/ Home page of Georg’s Brave GNU World http://brave-gnu-world.org “We run GNU” initiative http://www.gnu.org/bravegnu-world/rungnu/rungnu.en.html Freeciv home page http://www.freeciv.org People involved in Freeciv http://www.freeciv.org/people.phtml XWeb home page http://xweb.sf.net Saxon home page http://saxon.sourceforge.net Batik home page http://xml.apache.org/batik General Server Pages (GSP) home page http://gsp.sourceforge.net GNU Classpath Extensions home page http://www.gnu.org/software/classpathx GNU Classpath home page http://www.gnu.org/software/classpath GNU Java home page http://www.gnu.org/software/java IDX-PKI home page http://idx-pki.idealx.org 14 · 2001 LINUX MAGAZINE 93


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.