Debian GNU Linux
Debian GNU Linux
Graham Williams
ii
The procedures and applications presented in this book have been included
for their instructional value. They have been tested but are not guaranteed
for any particular purpose. The publisher does not offer any warranties or
representations, nor does it accept any liabilities with respect to the programs
and applications.
This book is a work in progress (and probably will always be so!). Please
send me comments, suggestions, updates, criticisms.
Contents
Preface
xxix
1 Advocacy
1.1
Linux Adopters . . . . . . . . . . . . . . . . . . . . . . . . . .
1
5
2.1
Unix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2
GNU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.3
Linux
2.4
Gnome . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.5
2.6
Free Documentation . . . . . . . . . . . . . . . . . . . . . . . 15
2.7
Freedom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.8
General Resources
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
. . . . . . . . . . . . . . . . . . . . . . . . 16
2.8.1
Books . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.8.2
Internet . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3 Distributions
19
3.1
3.2
iv
CONTENTS
3.3
Debian Distributions . . . . . . . . . . . . . . . . . . . . . . . 23
3.4
Debian Packages . . . . . . . . . . . . . . . . . . . . . . . . . 25
3.5
Debian Releases . . . . . . . . . . . . . . . . . . . . . . . . . . 25
3.5.1
3.5.2
3.5.3
Other Flavours . . . . . . . . . . . . . . . . . . . . . . 27
3.5.4
Package Basics . . . . . . . . . . . . . . . . . . . . . . 27
3.6
Using dselect . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
3.7
Debian on CD . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
3.8
3.7.1
3.7.2
3.7.3
3.7.4
3.7.5
Other Distributions . . . . . . . . . . . . . . . . . . . . . . . . 33
3.8.1
4 Installation
4.1
35
Quick Start . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
4.1.1
LiveCD Install
. . . . . . . . . . . . . . . . . . . . . . 36
4.1.2
4.2
Hardware Compatibility . . . . . . . . . . . . . . . . . . . . . 39
4.3
Floppy Distribution . . . . . . . . . . . . . . . . . . . . 40
4.3.2
CD-ROM Distribution . . . . . . . . . . . . . . . . . . 41
4.3.3
LiveCD Distributions . . . . . . . . . . . . . . . . . . . 41
CONTENTS
4.4
4.5
4.6
4.7
Boot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
4.4.1
SPARCStation Boot . . . . . . . . . . . . . . . . . . . 42
4.4.2
Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
4.5.1
Debian Install . . . . . . . . . . . . . . . . . . . . . . . 43
4.5.2
PGI Install . . . . . . . . . . . . . . . . . . . . . . . . 43
Base Install . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
4.6.1
Keyboard . . . . . . . . . . . . . . . . . . . . . . . . . 44
4.6.2
Partitions . . . . . . . . . . . . . . . . . . . . . . . . . 44
4.6.3
Configure Devices . . . . . . . . . . . . . . . . . . . . . 45
4.6.4
Networking . . . . . . . . . . . . . . . . . . . . . . . . 45
4.6.5
Time Zone . . . . . . . . . . . . . . . . . . . . . . . . . 46
4.6.6
4.6.7
4.6.8
Package Selections . . . . . . . . . . . . . . . . . . . . 46
4.6.9
Installing Packages . . . . . . . . . . . . . . . . . . . . . . . . 47
4.7.1
4.7.2
Upgrade . . . . . . . . . . . . . . . . . . . . . . . . . . 48
4.7.3
New Packages . . . . . . . . . . . . . . . . . . . . . . . 48
4.8
4.9
Initial Configurations . . . . . . . . . . . . . . . . . . . . . . . 51
. . . . . . . . . . . . . . . . . . . . . . . . . 51
vi
CONTENTS
4.10.4 Dell Latitude C600 (Inci)
. . . . . . . . . . . . . . . . 63
CONTENTS
vii
5.2
135
5.1.2
137
6.0.1
6.0.2
6.0.3
6.0.4
6.0.5
6.0.6
6.0.7
6.0.8
6.0.9
. . . . . . . . . . . . . . . . . 149
viii
CONTENTS
6.0.17 Reconfigure Packages . . . . . . . . . . . . . . . . . . . 149
6.0.18 Setting Default Applications . . . . . . . . . . . . . . . 149
6.0.19 Bugs . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
6.0.20 Managing Daemons or Services . . . . . . . . . . . . . 150
6.1
6.1.2
6.2
6.3
6.4
6.5
6.5.2
6.5.3
6.5.4
6.5.5
7 Audio
163
7.1
7.2
7.3
165
167
CONTENTS
10 Backup
ix
171
. . . . . . . . . . . . . . . . . . . . . . . . 173
177
12 Booting
179
189
191
CONTENTS
14.2 CD Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
14.2.1 cdrdao . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
14.2.2 gcdmaster . . . . . . . . . . . . . . . . . . . . . . . . . 198
14.2.3 xcdroast . . . . . . . . . . . . . . . . . . . . . . . . . . 199
14.2.4 MP3 Encoders
. . . . . . . . . . . . . . . . . . . . . . 199
. . . . . . . . . . . 199
. . . . . . . . . . 201
211
213
17 Clock: An Explanation
215
CONTENTS
xi
221
223
225
227
xii
CONTENTS
22 Desktop
235
237
CONTENTS
xiii
23.6.5 FS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
23.6.6 GRAFCET . . . . . . . . . . . . . . . . . . . . . . . . 252
23.6.7 Ladder . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
23.6.8 Networks
. . . . . . . . . . . . . . . . . . . . . . . . . 253
261
263
267
xiv
CONTENTS
27 Email
269
. . . . . . . . . . . . . . . . . . . . . . . . . . 274
. . . . . . . . . . . . 276
279
281
CONTENTS
xv
283
31 Firewalls
285
289
293
297
299
303
xvi
CONTENTS
36.2.1 Building the GUI . . . . . . . . . . . . . . . . . . . . . 305
36.2.2 Building the C Code . . . . . . . . . . . . . . . . . . . 313
36.2.3 Using Libglade C . . . . . . . . . . . . . . . . . . . . . 315
36.2.4 Using Libglade with Python . . . . . . . . . . . . . . . 315
36.2.5 Using Libglade with Perl . . . . . . . . . . . . . . . . . 316
36.3 Glade Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 317
36.3.1 Writing Your Code . . . . . . . . . . . . . . . . . . . . 317
36.3.2 Command Line Options . . . . . . . . . . . . . . . . . 318
36.3.3 The Menus and Toolbar . . . . . . . . . . . . . . . . . 319
36.3.4 Project Options . . . . . . . . . . . . . . . . . . . . . . 323
36.3.5 Widget Properties . . . . . . . . . . . . . . . . . . . . 326
36.3.6 Widget Palettes . . . . . . . . . . . . . . . . . . . . . . 326
36.3.7 The Glade Save Format . . . . . . . . . . . . . . . . . 327
36.4 Glade Resources . . . . . . . . . . . . . . . . . . . . . . . . . . 327
36.5 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 328
36.6 Using Napster . . . . . . . . . . . . . . . . . . . . . . . . . . . 328
36.7 Gnome Hack . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332
333
CONTENTS
xvii
343
39 Gnumeric: Spreadsheet
345
351
41 Graphics
353
. . . . . . . . . . . . . . 354
xviii
CONTENTS
41.2.3 Thumbnails . . . . . . . . . . . . . . . . . . . . . . . . 357
41.2.4 Transparent PNG Images . . . . . . . . . . . . . . . . 357
359
43 HTML Editors
363
365
45 Initialisations on Booting
367
373
377
379
381
CONTENTS
xix
391
393
52 LaTeX
395
. . . . . . . . . . . . . . . . . 396
399
. . . . . . . . . . . . . . . . . . . . . . . . 399
xx
CONTENTS
53.3 Midnight Commander . . . . . . . . . . . . . . . . . . . . . . 401
53.4 Gnome Memory Blocks . . . . . . . . . . . . . . . . . . . . . . 401
403
55 Modems
405
407
411
58 MySQL
413
421
CONTENTS
xxi
425
437
441
63 OpenOffice
443
. . . . . . . . . . . . . . . . . . . . . . . . 443
xxii
CONTENTS
447
449
455
459
461
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 462
69 Printing
69.1 CUPS - Common Unix Printing System
463
. . . . . . . . . . . . 463
CONTENTS
xxiii
469
475
481
483
74 Scanning
485
487
xxiv
76 Security
CONTENTS
489
503
78 Sound Recording
505
511
513
81 Spruce: Email
515
CONTENTS
xxv
517
527
84 Swap
529
85 Themes
531
533
xxvi
CONTENTS
539
549
CONTENTS
xxvii
557
559
571
xxviii
CONTENTS
Preface
Welcome to the world of GNU/Linux, liberating the computing desktop from
the shackles of proprietary interests.
The aim of this book is to get you up to speed with GNU/Linux and to
deliver a fun and productive environment. It guides you through the many
different regions of a GNU/Linux system with a focus on getting your desktop environment to do what you want it to do. It is comprehensive with
basic support for the user who installs and maintains the system themselves
(whether in the home, office, club, or school). It provides insights and stepby-step procedures that deal with specific tasks in setting your system up and
maintaining it. The book covers many of the core features of a GNU/Linux
system and you will gain the knowledge to enjoy and use one of the most
comprehensive and useful developments in the history of computing.
The details in this book are presented in the context of Debian GNU/Linux
the most open of the GNU/Linux distributions and the distribution setting
the standards for free software and collaborative developments. In general
the details translate directly to RedHat and other standard distributions
of GNU/Linux. A growing number of the applications (including StarOffice,
AbiWord, The Gimp, Dia and gPhoto, to name just a few) are cross-platform
developments and run also under MS-Windows. The chapters that cover
these applications in this book will also generally apply to those versions.
The structure of this on-line version of the book is basically alphabetical.
Each individual chapter aims to be a standalone reference. The book includes
an overview of GNU/Linux and its history, a guide to installing GNU/Linux,
introductions to the suite of GNU/Linux desktop productivity tools, and
recipes for tuning specific parts of a GNU/Linux system.
The book begins with an introduction to the world of GNU/Linux, Free Software, and the Open Source Software movement. Free software equals, and
often surpasses, the commercial offerings for the same or equivalent functionxxix
xxx
Preface
xxxi
The phrase Microsoft Windows (and less informatively just Windows) usually refers to the whole of the popular operating systems, irrespective of which
version of Microsoft Windows is being run, unless the version is important.
But Microsoft Windows is just one of many windowing systems available,
and indeed, Microsoft Windows came on to the screen rather later than the
pioneering Apple Macintosh windowing system and the Unix windowing systems. We will simply refer to all varieties of Microsofts windowing systems
(Windows 95/98/NT/2000/XP) as MS-Windows. If the particular version
is important it will be referred to as MS-Windows/XP, for example.
We use the phrase GNU/Linux to refer to the GNU environment and the
GNU and other applications running in that environment on top of the Linux
operating system kernel. Similarly, GNU/Hurd refers to the GNU environment and the GNU and other applications running in that environment on
top of the GNU Hurd operating system kernel.
Debian is a complete distribution which includes many applications based
around a particular choice of operating system kernel (usually either GNU/Linux
or GNU/Hurd). Where the particular kernel is not important we will refer
to whole system as Debian.
The common windowing system used in Debian is a separate, but integral,
component that we will refer to as the X Window System.
Screen Shots
Through out the document screen shots are presented using a variety of
Gnome and KDE themes. The theme specifies what things look like inside
the windows that an application displays, and now also tend to specify what
the window frame looks likethat is, the area immediately surrounding the
applications window. There is an endless variety of themes to suit your
own preferences. Some favourites include the E-efm-GTK+ Gnome theme and
the QN-X11 and Crux Sawfish themes. Refer to the discussion of themes in
Chapter 85 for details, if interested.
About This Book
The book is copyright by the author (
but released under a license which allows it to be available somewhat freely.
You are welcome to read it on-line and even to download and print the whole
book yourself. You can also download the book (either PDF or HTML) to
have a local copy of the book on your system and make it available for others to access either locally or even globally. However, you are required to
xxxii
Preface
retain the copyright attributions and you are required to give appropriate
attribution for any material you use from the book.
Also, by taking a copy, or even simply using the book, you should feel obliged
to contribute to the book in some way, by sending corrections, comments, updates, suggestions, or even whole new chapters, to me at
Citations
Debian Weekly News pointed to this book in their 8th July 2003 edition.
Chapter 1
Advocacy
Why bother with open source software when Microsoft has the market sewn
up? The cost of GNU/Linux (it is freely available to whoever wants it) is not
always the primary issue! Usability, reliability, security, and developerability
are often just as, and for different users even more, important issues.
GNU/Linux offers a value proposition that money can not buy.
vestment in GNU/Linux is really an investment in human beings
to bring a better and coordinated solution to the organisation. A
that in the long run delivers more for less, without the traditional
proprietary systems.
The inworking
solution
tie-in of
1.1
Linux Adopters
The Swiss taxation office distribute a CDROM with the open source office
suite called Open Office. On the CDROM is an Open Office version of the
Tax form. Tax payers fill in the form and lodge their returns electronically.
In June 2003, at the Net World Order conference, held at the CeBIT trade
show in New York City, and sponsored by the Business Council for the United
Nations, Bruno Lanvin from the World Bank said
These countries need cheap and efficient technology to make the
giant leaps necessary to catch up with the rest of the world. Many
1
Advocacy
are now using Linux, which looks to become the No. 1 operating
system in China and India soon.
As of October, 2003, many local governments in Germany are taking the step
toward GNU/Linux
Usability
Usability has been a problem for GNU/Linux for a long time. It has not
been comparable to the ease of use of the MS-Windows system in terms
of being a common desktop environment. As we demonstrate in this book
though this issue has been well addressed and the time is now right for Debian
GNU/Linux on the desktop.
Reliability
GNU/Linux is a very stable operating system and system crashes are virtually unknown. GNU/Linux, like Unix before it, is designed to be a multi-user,
shared system. Simply because one user of the system runs an application
that crashes, other users of the same system should not be affected. Also,
most GNU/Linux applications have been in open development for many years
with many developers working on and looking over the code. Bugs of course
are not unknown, but they are usually quickly fixed within GNU/Linux,
leading to a very reliable system.
Security
The issue of security is crucial and will continue to grow as an important
concern for users.
An article in the 27 August 2001 issue of Interactive Week by Rob Fixmer
recalls a 1998 interview with then Symantec CEO Gordon Eubanks:
Everybody can see whats under the hood, so were on equal
footing with hackers. With proprietary systems intruders often
Developerability
MS-Windows provides many good environments for the development of software. However, GNU/Linux, and Unix before it, has a long tradition of
providing powerful environments for software development. Sophisticated
graphical interactive development environments (IDEs) were developed on
1
Advocacy
Chapter 2
History: Unix, GNU, Gnome
A brief review of the history of Unix will place in context much of the terminology and philosophy of this operating system. Terms like Linux, GNU,
Unix, Gnome, Free Software, and Open Source Software get bandied around,
often with little understanding and usually with much misunderstanding.
A fundamental misunderstanding is the relationship between Linux and operating systems. Linux is the low level code that interacts with and controls
the hardware of the computer (whether it is an Intel 486, Pentium, Sun
Sparc, or a Merced). This is the kernel of the operating system, providing
routines to help applications talk to each other, allowing many applications
to share the CPU at the same time, and managing the use of memory, allowing many different applications to run at the same time without interfering
with other applications. Linus Torvalds wrote the first Linux kernel in 1991
and it continues to be actively developed today by Linus and a core team of
international developers.
While the kernel is crucial, it is the larger suite of software that sits on top
of the kernel that provides the functional operating system. Most of the
software applications at this level come from the GNU Project. These tools
include the command line utilities like ls, cp, find, bash, and the compilers like gcc. This collection of applications is usually considered to be
the actual operating system and hence we refer to the operating system as
GNU/Linux in recognition of the GNU software coupled with the Linux kernel. GNU/HURD is an alternative operating system using the GNU software
with the HURD kernel being developed by the GNU Project.
Sitting on top of this command-line level of the operating system is what we
5
might refer to as the end user level of the operating system. This is typically
a graphical user interface (GUI) aiming to provide an intuitive, easy to use
system for both the general, non-technical user and the power user. Such an
interface is typically an application that sits on top of and makes considerable
use of the operating system. For GNU/Linux this is the X Window System.
The Window System provides a platform for GUI-based applications. Other
applications sit on top of the Window System to provide integrated platforms
with a common look and feel. Gnome, another GNU project, is one such
popular platform. All Gnome applications have a similar look and share
many components and can communicate with each other. KDE is a popular
alternative to Gnome and while it is not one I use, I will try to include
information about it whenever I can.
In this chapter we briefly review the history of Unix, GNU Software, the
GNU/Linux Operating System, Gnome, and Free and Open Source Software
and Documentation.
2.1
Unix
GNU/Linux is fashioned on Unix. Unix dates from 1969 when Ken Thompson at Bell Telephone Laboratories initiated work on this new operating
system. Others involved in the project included Dennis Ritchie and Brian
Kernighan. The name Unix is a pun on an alternative operating system
of the time called MULTICS (MULTiplexed Information and Computing
Service). MULTICS was developed by The Massachusetts Institute of Technology, General Electric and Bell Labs. Unix was originally spelt UNICS, an
acronym for UNiplexed Information and Computing Service!
Some of the basic ideas introduced by Multics and then Unix were the tree
structured file system, a program for command interpretation (called the
shell), the structure and nature of text files and the semantics of I/O operations. Some of the philosophy that rose with the development of Unix
included the desire to write programs that performed one task and to do it
well, to write programs that worked together to perform larger tasks, and
to write programs that communicated with each other using text from one
program to the other.
The advantages of Unix were quickly identified by many and quite a few varieties of Unix emerged over time. Sun Microsystems have pioneered many of
2.1 Unix
the developments in Unix, followed by such greats as the old Digital Equipment Corporation (DEC, which was swallowed by Compaq, which was swallowed by Hewlett-Packard), Silicon Graphics Incorporated (SGI), International Business Machines (IBM), and Hewlett-Packard (HP). A variety of
flavours have existed, including SunOS, Solaris, Ultrix, Irix, BSD, System V,
HPUX, and so on. Although computer programs written for one version of
Unix could sometimes be ported to other versions, it was not always an easy
task. The diversity of Unix implementations (more so than the proprietary
nature of most of them) made it difficult for Unix to become a commodity
operating system. The GNU project worked hard to free software development from nuances of each of the different Unix versions through providing a
common programming language environment (GNU C) and a sophisticated
packaging tool (autoconf and automake) to carefully hide the differences.
GNU/Linux has now become the most popular Unix variant and all the major Unix players support GNU/Linux in some way.
A particularly touted feature of Unix comes from a tools philosophy where
complex tasks are performed by bringing together a collection of simpler
tools. This is contrasted with the philosophy of providing monolithic applications that in one fell swoop solve all your problems, supposedly. The
reality is often different.
Most operating systems supply a collection of basic utility programs for managing your files (things like arranging your files into folders, trashing files,
and copying files from one place to another). Large applications then provide
the word processing, spreadsheet, and web browsing functionality.
Unix places less emphasis on the monolithic applications. Instead, tools
provide simple functionality, focusing on doing well what they are designed
to do. They simply pass their results on to another tool once theyre done.
Unix pipes provide the mechanism for doing this: one tool pipes its output
on to another tool. This allows complex actions to be performed by piping
together a collection of simpler commands.
A typical example is to determine the number of users logged on to your
system:
> who | wc -l
The who command will list, one per line, each user logged on. The wc
command will count the number of characters, words, and lines that it comes
across, with the -l option only counting the number of lines. (GNU tools,
like Unix, introduce options with the minus sign.)
For various reasons though this tools philosophy was often overlooked when
large monolithic applications arose that did not adhere to the philosophy
they did not share components. Common tools such as Netscape, ghostview,
Acrobat, FrameMaker, and Star Office essentially share very little. Compare
that with the Microsoft community where, for example, an application like
Internet Explorer is component-based. This is now changing in the GNU
world with the operating system software and the Gnome project encouraging
component-based architectures.
Another feature of Unix is that Unix applications tend to use open file formats
allowing a variety of tools to collaborate to work on those open formats.
Indeed, this has been a key in recent developments to remove the stranglehold of Microsoft proprietary formats. Rather than electronic document
storage providing a longer term solution to the archival of documents, it
is delivering an even shorter lifetime than paper-based archives! How can
that be so? The formats created by proprietary software are often binary
and not fully publicly specified. How many packages today can read old
Word Perfect and Microsoft Word documents? The standardisation on open
formats, often text-based formats like XML that allow anyone to read them,
provides a solution to this problem.
So why Unix? It is a conceptually simple operating system facilitating creativity by not restricting the developer. Many have found it to be a fun
operating system to work with allowing many innovative developments to be
combined in new and even more innovative ways to deliver powerful ideas.
A very large world wide group of people willingly provide excellent, free support over the Internet. Anyone can learn more about the operating system
by studying the code itself. Anyone can contribute to porting the operating
system to their favourite computer.
And finally, the much touted stability. There is very little doubt that GNU
and Linux are extremely stable. The habit of rebooting your computer every time you come back to it is something Microsoft seems to encourage
because of its notorious instability and tendency for the operating system
not to carefully manage its use of memory. Also, install a new package under MS-Windows and chances are you need to reboot the computer. Most
Unix users rarely need to reboot their machine. Check the uptime and you
will generally find the machine has not been rebooted for months or years.
Installing packages invariably does not require rebooting. Indeed, the only
2.2 GNU
2.2
GNU
The GNU Project1 was begun in 1984 by Richard Stallman of MIT with
the aim to develop a complete free (meaning free for everyone to look at, to
learn from, and to build upon) software operating system. In 1989 he codified
the terms under which this free software was released, producing the GNU
Public License (GPL) which is the basis on which much of the GNU/Linux
operating system is released. The license is often referred to as the copyleft
license in contrast to the restrictive practise of copyright.
By 1991 when Linus Torvalds wrote his Linux kernel GNU provided the
operating system. By combining the GNU operating system with the Linux
kernel the seeds for this most popular free operating system were sown.
Many users installed the GNU tools on many different computers as replacements for vendor supplied tools. This provided these users with a consistency
across the many different platforms they used. The tools even eventually appeared under MS-Windows, providing a Unix-like environment on a very
different operating system.2
The tools developed by the GNU project include such essential utilities as
the GNU file management utilities and the GNU text file processing utilities.
The GNU file management utilities include fundamental command line tools
like ls (to list information about files/documents), mkdir (to create new
directories/folders), mv (to move directories and files around), rm (to remove
files), and many more. The GNU text file processing commands include cat
(to concatenate files together), head (to preview the top few lines of a file),
sort (to sort the contents of a file), and wc (to count the number of lines,
words, and bytes in a file).
The toolkits developed by the GNU project are comprehensive. The following
table lists just some of the 200 or more packages that you can obtain freely
from http://www.gnu.org/software/software.html:
Package
aspell
1
2
Description
An interactive spell checker that suggests near misses to replace unrecognised words.
10
Package
awk
bash
binutils
chess
cvs
emacs
enscript
fileutils
findutils
gcc
gdb
ghostscript
gimp
gnome
gnumeric
gphoto
gnupg
gtk+
gzip
2.3 Linux
Package
kde
less
mtools
r
shellutils
tar
textutils
time
wget
11
Description
An alternative, and very popular desktop which provides a
consistent graphical user interface for common applications
including everything from spreadsheets to mail clients, and
more.
A display paginator similar to more and pg, but with various features (such as the ability to scroll backwards) that
most pagers lack.
Programs to allow Unix systems to read, write, and manipulate files on a DOS file system (typically a diskette).
A system for statistical computation and graphics.
Useful command line utilities including basename, date,
dirname, echo, groups, hostname, printf, pwd, uname, uptime, users, who, and whoami.
An archive utility.
A set of utilities for manipulating text.
A utility to report on the time taken to execute other programs.
A non-interactive web browser to retrieve files from the Internet using HTTP and FTP. See Chapter 88.3 for details.
Many of these GNU tools are command line tools but a growing number
of them are now also GUI-based, including Gnome, KDE, The Gimp, and
Gnumeric.
2.3
Linux
Unix was popular because, originally, the source code was practically free.
For various reasons the Unix license began to forbid the Universities from
using the source code in their teaching. This lead Andy Tannenbaum to
write MINIX which then inspired Linus Torvalds to write the Linux kernel
for his Intel 386.
Unix has a long heritage and the new GNU/Linux has the luxury of learning
from the success and failings of both Unix and MS-Windows. Of particular
importance is the component-based architecture that facilitates the sharing of
components among many applications. These are the focus of much modern
development for GNU/Linux. Gnome, for example, uses Bonobo (built on
12
2.4
Gnome
Unix lead to the development of the GNU Project which needed a kernel
that was supplied by Linux to produce the GNU/Linux Operating System.
GNU/Linux and Unix are generally criticised for being hard to use for the
common userall those command line tools and all that fiddling with configurations placed them back in the MS-DOS days. The demand is for modern
intuitive interfaces similar to those pioneered by the Macintosh back in 1984.
Unix has had graphical user interfaces for a long time. The problem was that
Unix was provided by multiple vendors and those vendors had difficulty agreeing on a common way of doing things in the graphical user interface. There
were systems like NeWS, OpenWindows, Display PostScript, and the X Window System. There was also a multitude of windowing systems available for
the X Window System, including CDE, Motif, OpenLook, etc. They offered
tremendous flexibility which lead to great diversity! And great confusion.
Developers could chose different toolkits and get very different behaviours.
Different ways of interacting with applications lead to much confusion and
certainly no consistency: different ways of moving to the next text field;
different defaults for keyboard shortcuts; different mechanisms for cut and
paste between applications; etc. Apple, with the Macintosh, had a lot of control on how things should be done and developed guidelines for developers to
do things the right way. Later, Microsoft with MS-Windows/95 and beyond
also dictated standards for others to follow. This meant that once the user
had learnt the nuances of the interface they were set for life.
13
2.5
There is much confusion over the terms free software and open source. They
are not the same thing. Open source software is not necessarily free software.
Indeed, some open source software places considerable restrictions on what
you can do with the source code, thus rendering it non-free. GNU software is
open source software that is also free in the sense of freedom. This software
allows everyone to redistribute and modify the software, without restriction.
We contrast open and free software with proprietary software that we have
become familiar withthe software that we buy on trust from a vendor, trust
that it will work, but for which the vendor disowns any responsibility. When
you find it has bugs and is not fit for purpose you must buy the next version
to get something that works for you.
Proprietary applications for word processing, spreadsheets, presentations,
Web browsing and so on abound. In general they work pretty well today,
providing sophisticated functionality. However, probably because of their
proprietary nature, they generally do not work well together, particularly
products from different vendors. There is little motivation for vendors to
14
make it easy for you to move away from their product to a competitors
product.
What makes this situation rather sad is that each of these proprietary applications have a lot of functionality in common. Today we have a pretty good
understanding of the common features we require in a product: open and
save files, cut and paste, spell checking, etc. They all provide this, often over
and over again. There will always be opportunity to innovate and do things
in different and possibly better ways, but why are we wasting resources on
the most basic of operations instead of innovating with new functionality?
This has been addressed on the major modern platforms by sharing toolkits.
But sharing of more substantial functionality has been slower to develop.
Another aspect is that open source software makes development cheaper
because more people are involved, the work load is shared, people with very
different skill levels can collaborate and help increase the overall skill level of
the whole community, bugs are caught quicker because there are more people
looking over the source and bugs are fixed quicker because of this.
Free software demands that the user be granted four kinds of freedom: freedom to run the program, for any purpose; freedom to study how the program
works, and adapt it to your own needs; freedom to redistribute copies so you
can help your neighbour; and freedom to improve the program, and release
your improvements to the public, so that the whole community benefits. A
pre-condition for this is the availability of the entire source code, so that
along with the freedom comes the responsibility to share your discoveries
with others.
Free software open source projects still need to be structured. Usually they
are conducted under the watchful eye of a project leader, commonly referred
to as the maintainer. Anyone can contribute to the project and decisions
are often discussed openly and decided by consensus after discussion of the
technical merits. Sometimes the project leader will need to cast the deciding
vote.
Finally, in addition to founding the GNU Project Richard Stallman founded
the Free Software Foundation to pioneer the cause of free softwarefree
software that gives individuals the opportunity to share their innovations
and through this to allow others to learn and to contribute their discoveries.
2.6
15
Free Documentation
2.7
Freedom
The free software world aims to share their knowledge and software in order
for all to gain towards a common goal. The proprietary software world aims
to hoard their software, to hide their discoveries, to let others go through the
discovery process themselves rather than to innovate from the shoulders of
those who went before them.
Stallman characterises the view of the proprietary vendors as: If you share
with your neighbour, you are a pirate. If you want any changes, beg us to
make them.. If I enjoyed a piece of music or a novel, should I be inhibited
from lending the CD or the book to my neighbour?
Eric Raymond, in his Musings on Linux and Open Source in the book
The Cathedral and the Bazaar makes compelling arguments for Free and
16
2.8
2.8.1
General Resources
Books
17
excellent guide to many aspects of the Linux operating system. Also available
from http://www.icon.co.za/~psheer/book/.
18
2.8.2
Internet
For the GNU perspective on many of the issues mentioned here refer to http:
//www.gnu.org/philosophy/free-software-for-freedom.html. This article, titled Why Free Software is better than Open Source is written by
Richard Stallman and is an essential read on the topic. It explains why the
use of the term Open Source is not strong enough in the context of Free
Software.
Freshmeat (http://freshmeat.net/) is an index of a large collection of
GNU/Linux packages with up-to-date information on their status and links
to their home pages and related locations. The index can be searched or
browsed. Most of the GNU/Linux tools are included.
Gnome (http://gnome.org/) is the framework and associated toolkit used
by many of the graphical applications introduced in this book. The Gnome
web site includes a list of many of the major Gnome applications.
Linux Today (http://linuxtoday.org/) is a news service providing updates
on developments related to GNU/Linux. It has a good selection of articles
usually updated several times a day, and does not overwhelm the reader
with news. Summaries are presented with links to slightly more detailed
summaries, with links to the complete articles, wherever they appear on the
Internet. Slashdot (http://slashdot.org/) is another news service with a
Linux bent.
Chapter 3
Distributions
When you purchase a computer the chances are that it comes with MSWindows pre-installed. The version of MS-Windows has been tuned and set
up by the manufacturer or retailer to run well on the particular configuration
you have purchased. Drivers for the particular devices, such as audio, video,
and CD-ROM, will have been included in the installation. The computer is
ready to turn on and get started in MS-Windows. It will just work (usually)!
To run GNU/Linux instead of MS-Windows (or in addition to MS-Windows)
you need to install the system yourself. This entails obtaining a distribution
of GNU/Linux, installing it, and configuring the device drivers to suit your
particular setup. So some extra effort is usually required to get GNU/Linux
up and running.
The GNU/Linux Operating System is built upon the foundation that is the
Linux kernel. To install GNU/Linux on your PC you could start with installing the Linux kernel and then compiling and installing the GNU tools
and other essential software that you need. But this approach is not for the
light hearted. Luckily this is not the usual manner of installing a GNU/Linux
system!
Many people have put a lot of effort into packaging things together into distributions so that installing GNU/Linux is a more straightforward exercise.
GNU/Linux distributions typically provide the whole system as a collection
of packages from which you choose those that you want install. Some packages are mandatory, and form the base installation. Other packages are then
installed as you need them.
Until pre-installed GNU/Linux systems become more common chances are
19
20
Distributions
you will need to install a distribution yourself. The process is not trivial
but it is straightforward. In Chapter 4 we will highlight the steps with just
enough detail to get you through the installation process. In this chapter
we review the options available in selecting a distribution of GNU/Linux to
install.
3.1
21
Linex A Debian-based distribution being developed by the regional government of Extremadura (Spain) with the goal of migrating all the
computer systems, from government offices, to businesses to schools
into Linux.
Morphix Morphix is a modular LiveCD derived from Knoppix, with install
images for Games, Gnome, KDE, and LightGUI. It is available from
http://www.morphix.org.
Stormix Storm Linux is built around Debian GNU/Linux, the most stable
and secure distribution available. See http://www.stormix.com/.
ThinkNIC This is a $200 new Internet computer (NIC) which runs from a
CD-ROM using Debian GNU/Linux. See http://www.thinknic.com.
TuxTops This distributor of laptops pre-installs Debian GNU/Linux on
their laptops. See http://www.tuxtops.com/.
Related distributions include Amirix (http://www.amirixlinux.com/), Embedded Debian (http://www.emdebian.org/), TimeSys for real time GNU/Linux
(http://timesys.com/products/linux.html) and the VA Linux Systems,
OReilly and SGI collaboration (http://www.oreilly.com/catalog/debian/
index.html).
3.2
22
Distributions
currently over 870 active Debian developers. New work developed for
Debian is available for all of the other Linux distributions to copy as
soon as its uploaded to the Debian servers.
The Debian Free Software Guidelines are a critical component from a
business standpoint. They specify the requirements for licenses of any
package that is to be included with Debian. Debian conforms to the
official GNU version of free software which means that every package
included in Debian can be redistributed freely.
Debian is driven by policy. The formal and publicly available Debian
policies have been developed over many years and are a mature response
to dealing with the large task of maintaining such a distribution in a
distributed manner. Various Debian tools (such as dpkg, apt-get, and
lintian) effectively implement the policy and provide a guarantee of
quality in the packaging.
Debian is an excellent choice for the development of software for all
distributions of GNU/Linux. Because Debians processes, in terms of
policies and packaging, are fair and visible and open standards conforming, Debian is a very clean and very carefully constructed distribution. Developments that occur on a Debian platform can thus easily
be delivered or transferred to other GNU/Linux (and Unix) platforms.
It is difficult to upgrade a system from one RedHat release to another.
Debian provides simple migration paths that are well trodden. No more
re-installing the operating system just to upgrade to the new release.
Debians tools have the ability to do recursive upgrades of systems.
Debian deals with dependencies and will identify the required packages
and install them and then install the package you want.
Debian packages can Suggest other packages to be installed, and it is
left to the user whether to follow the suggestions or not.
Multiple packages can Provide the same functionality (e.g., email, web
server, editor). A package might thus specify that it depends on a web
server, but not which particular web server (assuming it works with
any web server).
Debian has a utility to install RedHat packages if you are desperate!
23
Debian does not overwrite your config files nor does the packaging system touch /usr/local except perhaps to ensure appropriate directories
exist for local (non-Debian) installed data and utilities.
RedHat uses a binary database for its package data while Debian (dpkg)
uses text files. Debian is more robust (if a single file gets corrupted its
less of a problem) and it is possible to fix or modify things by hand
using a normal text editor if needed. (Debians apt-get uses a mixed
approach: it uses the same text files as dpkg but uses a binary cache
to also get the advantages of a binary database.
RedHat packages rarely fix upstream (i.e., original source of packages)
file locations to be standards compliant but instead just place files
whereever the upstream package happens to put them. Many upstream
developers do not know about or conform to the standards. A minor
example, the openssh rpms create /usr/libexec for the sftpd daemons,
but libexec is a BSD standard and the Linux standard1 says such things
should go in /usr/lib/program or /usr/sbin.
Generally speaking, Debian packages must be created by qualified
developers (and there are thousands of them) who are committed to
following Debians strict policies requiring such things as FHS compliance and never overwriting config files without permission. Only
packages from these developers become part of the Debian archives.
Debian runs on more hardware platforms than any other distribution.
The Debian packaging philosophy is to keep packages in small chunks
so that the user can choose what to install with a little more control.
See also http://www.infodrom.org/Debian/doc/advantages.html.
3.3
Debian Distributions
Debian provides a rock solid, stable, distribution which is highly recommended for those running servers that must be reliable. This distribution
1
The Filesystem Hierarchy Standard (FHS) is described at http://www.pathname.
com/fhs/. It consists of, to quote the site, a set of requirements and guidelines for file and
directory placement under UNIX-like operating systems. They thus encourage the interoperability of applications, system administration tools, development tools, and scripts as
well as greater uniformity of documentation for these systems. More GNU/Linux specific
is the Linux Standard Base (LSB) with information at http://www.linuxbase.org/.
24
Distributions
3.4
25
Debian Packages
Debian has a carefully planned and controlled release program and has a
number of releases available at any time. The releases have code names
(originally from the Toy Story movies), release names, and versions. This
may sound complicated, but it is actually quite simple and effective. The
officially released and current version of Debian is referred to as the stable
release. This release is regularly highlighted as the most stable GNU/Linux
distribution available.
3.5
3.5.1
Debian Releases
Naming The Releases
There are three ways of referring to a particular release: name (e.g., woody),
state (e.g., stable), and number (e.g., 2.2). The name and number refer to
the same static release with a number only being issued when the release
is finalised (i.e., it becomes stable). The state (stable, testing, or unstable)
shifts from release to release, and a given release will cycle through these
states. The special name sid always refers to unstable.
The release names come from the Toy Story movies (bo, hamm, slink, potato,
woody, sid, . . . ).
The states are stable, unstable, testing, and frozen.
The unstable release is where new packages and updates to old packages
appear. You access this distribution if you want the latest and greatest, and
are comfortable with the occasional glitch.
For those who want the latest and greatest but not the risk the testing release
lags behind the unstable release by a few weeks to include only packages that
dont appear to have any problems.
When a new release is being prepared it evolves from the unstable release
through the testing release onto the frozen release. A frozen release goes
through a thorough testing phase to ensure all packages in the distribution
work together and there are no outstanding bug reports. This process can
take six months or more.
26
Distributions
Once this testing is complete the release is then renamed as stable and may
remain the current stable for up to eighteen months. The stable release is
just that, stable. It is often regarded as the most stable distribution of
GNU/Linux available. Packages in this release are not the most recently
available and sometimes thought to be quite out of date, but that is the cost
of rock solid stability.
In summary, the stable release is best suited to production servers, while the
adventurous power user can run unstable on a desktop with only the rare
mess up.
An advantage of this system is that a user can track either a specific release
(slink, potato, woody, sid) or a state (stable, testing, unstable) simply by
specifying the appropriate name in /etc/apt/sources.list.
The fact that the states can change quite dramatically (e.g., when a new stable release is made) is a little problematical as people may suddenly find that
their system wants to upgrade everything to a new release. One suggestion
is to choose the release name and stay with that until you decide yourself to
upgrade.
Thus, to stay with a given release use the release name. To keep up-to-date
with a stable system then use the stable release. To be at the bleeding edge
and relatively stable then use testing. To live at the absolute bleeding edge
use unstable.
Version
2.0
2.1
2.2
3.0
Name Testing
bo
hamm
slink
potato
woody 2001/08
sid
Frozen
Stable
1998/11/03
2000/01/16
1999/03/10
2000/08/22
3.5.2
There are over 75 Debian mirrors world-wide and over 7300 packages available
for unstable which you can browse at http://www.debian.org/Packages/
unstable/allpackages.html. Check for a mirror near you by trying http:
27
(If you are familiar with Debian slink or earlier, you will notice that the
format of the non-US entry changed starting with potato.)
Finally, if you want to go the commercial (and sometimes less hassle) CDROM distribution path a nice looking one based on Debian is Libranet.
The apt-setup command will run a simple interface to help set up your
/etc/apt/sources.list.
3.5.3
Other Flavours
Another key benefit of Debian is that the distribution is packaged for multiple
architectures, including Alpha, ARM, HP PA-RISC, Intel x86, Intel IA-64,
Motorola 680x0, MIPS, MIPS (DEC), PowerPC, IBM S/390, and SPARC!
Thats quite a choice.
And even more interestingly, Debian is not tied to the Linux kernel! Theres
also a Linux-free Debian called Debian/Hurd (hurd-i386) and, surprisingly
there is even discussion of a Debian/Cygwin which runs Debian packages on
legacy MS-Windows platforms via the Cygwin compatibility toolkit. Now
that will be something to see!
3.5.4
Package Basics
Debian distributions are based on over 4400 packages. Your task is to select
those you wish to install! This is made easier with task packages which are
virtual packages that depend on a collection of other packages. Selecting
one of these task packages results in that collection of other packages being
28
Distributions
installed. An example is the task-tex package that will install the TEX and
LATEX packages and related utilities.
Task packages are presented to the user on an initial install. As the name
indicates a task package is intended to deliniate a specific task you might
use a computer for, like a web server, an X workstation, or perhaps an X
workstation using Gnome or KDE.
Individual packages are installed and updated using http://www.debian.
org/Packages/stable/base/dpkg.html dselect (with a basic GUI), or http:
//www.debian.org/Packages/stable/base/dpkg.html dpkg (for manual
installation of deb files), or http://www.debian.org/Packages/stable/
admin/apt.html apt-get (for automatic download and install, including installation of other required packages).
Using dselect is at first confusing but allows you to easily update and install
new packages with an ease that leaves you confident that all difficulties have
been carefully hidden through extensive dependency and consistency checking. If network connection is interrupted, the downloads will be resumed from
where they got to. The dselect learning curve will pay dividends. My installation has always been left in a consistent and stable state after installing
packages from the Debian archives on the Internet.
As you gain confidence and know what you are after, move on to apt-get if
you prefer a command-line interface. This takes care of dependency checking
automatically (unlike dpkg) and will retrieve the required packages from the
Debian archives.
Each individual package can Suggest, Recommend, and Depend on other
packages. A subtle difference between dselect and apt-get is that the latter
ignores Suggest and Recommend dependencies whereas dselect will offer
Suggested packages for the users attention and will select Recommended
packages automatically.
3.6
Using dselect
3.7 Debian on CD
29
3.7
Debian on CD
You dont need to install Debian GNU/Linux from CD-ROM. You can obtain
all of the Debian packages from the international network of Debian mirrors
by simply using the Debian package tools (often based around the apt-get
package and including those that provide more user-friendly interfaces to
apt-get including capt, gnome-apt, and aptitude).
Of course, if you do not have ready access to the Internet you may want
to burn your own CD image of the distribution (assuming you have enough
30
Distributions
3.7.1
3.7 Debian on CD
31
Then burn the image to CD using whatever tools you have at your disposal.
For release 3 there are 7 CDs. The NONUS alternative (which contains items
that can not be exported directly from the US) is only relevant to the first
CD.
3.7.2
If you dont have good access to a well connected CD image host then it
is best to follow the following recipe to build the CD images. It is quite
straightforward.
The first step is to obtain the appropriate Debian tools to build the CD image.
Again, recall that the scenario here is to build the image on a Solaris machine,
but the procedure should be similar for any GNU/Linux or Unix machine.
The pseudo-image-kit package can be obtained from a number of locations
listed at http://cdimage.debian.org/~costar/pseudo-image-kit/. We
use one of these locations here:
>
>
>
>
wget http://panic.et.tudelft.nl/~costar/pseudo-image-kit/pseudo-image-kit-2.0.tar.gz
tar zxvf pseudo-image-kit-2.0.tar.gz
cd pseudo-image-kit-2.0
perl -pi -e s|^#! /bin/sh|#! /usr/local/bin/bash| make-pseudo-image
The last operation here changes the location at which the script makepseudo-image expects to find the installed version of the bash shell. Under
GNU/Linux it is /bin/sh but under Solaris it may be installed in /usr/
local/bin/bash.
3.7.3
The next step is to obtain a list of files that will make up the contents of the
CD. This is obtained from an appropriate CD image archive. For the binary
distribution of Debian (2.2) there are three CDs. We download the list of
contents for each:
32
Distributions
3.7.4
Now download from a local server the actual packages that will make up the
contents of the CD-ROM:
> ./make-pseudo-image binary-i386-1.list ftp://ftp.au.debian.org/debian
This takes quite a while! The end product is a file called pseudo-image. All
the other pseudo-image* files can be removed (theyre used to keep track of
where things were up to in case the download is interrupted).
This download is called the pseudo image because its an approximation of
the real image! Its pretty close, but not yet guaranteed perfect. It is a
simple process to now turn it into an official image:
> mv pseudo-image binary-i386-1.iso
> rsync --verbose --progress --stats --block-size=8192 \
mirror.aarnet.edu.au::debian-cd/2.1_r4/i386/binary-i386-1.iso .
This uses rsync to synchronise your CD-ROM image with the official one.
When this is complete you can burn this CD-ROM image directly to CDROM. Most CD-ROM burning software supports burning iso images directly.
Some other useful rsync commands allow you to hunt around the directory
structure of an rsync server. Some useful commands are:
List contents of the rsync servers root directory
> rsync mirror.aarnet.edu.au::
33
3.7.5
You can tell apt-get to obtain packages from a selection of CD-ROMs with
the following:
# apt-cdrom add
3.8
Other Distributions
3.8.1
When converting from RedHat to Debian all of the configuration files in /etc
should be kept (e.g., burn them to CD-RW). Both distributions use many of
the same configuration files, although sometimes they are in slightly different
places.
Another approach is to create a parted boot disk (or use a Knoppix CD
knoppix has parted installed) and then create a new partition on your machine onto which you install Debian. This allows you to keep a functioning
RedHat install while you set up Debian. Once you have the Debian installation up to scratch you can wipe the RedHat partition and reclaim it for
34
Distributions
use in Debian (perhaps as /var, /usr). Otherwise delete the partition with
parted and enlarge your Debian partition.
Chapter 4
Installation
Installation of GNU/Linux is generally straight forward except when you hit
some new or obscure hardware. In comparison, MS-Windows generally comes
pre-installed when a PC is purchased, hiding the effort that went into fine
tuning the installation of the operating system for that particular hardware.
Until GNU/Linux is commonly available pre-installed we will continue to be
faced with issues relating to installation by novices (and experts!). Nonetheless, the situation is improving dramatically with the introduction of LiveCDs
running Debian GNU/Linux. These allow a user to boot GNU/Linux from
CD and to actually run GNU/Linux without installing anything! The user
can then have the option to install if they like what they see.
For Debian GNU/Linux, installation instructions are provided by the Debian Installation Guide available from http://www.debian.org/releases/
stable/i386/install. An alternative guide is available from http://www.
polaris.net/~dwarf/. These provide considerable detail and are well worth
the effort. Be familiar with the installation processtry it out once or
twiceit doesnt hurt to practise!
In this chapter we review the installation process through examples using a
number of platforms. These include common desktops, laptops, and even a
different type of CPU (Sun SPARC). The aim is to install a minimal stable 1
release from CD-ROM and then to upgrade to the unstable 2 release. If you
1
The stable release of Debian GNU/Linux is a solid distribution which has been very
extensively tested. It generally contains older releases of software that have proven to be
quite stable.
2
While the unstable release sounds, well, unstable, it contains the most recent versions
of all packages and is usually quite a stable product. Occasionally it suffers from a buggy
35
36
Installation
are not connected to the Internet then you will be installing a full system
from CD-ROM. This will leave you with a complete system ready for most
tasks.
4.1
Quick Start
It is quite reasonable to want to skip all the details and to simply get started
with GNU/Linux. In this section we will get you up and running with
GNU/Linux real soon! There are two alternatives. The first will use a
LiveCD and is good for a quick test that things will work on your system.
The second, recommended, approach will do a standard Debian install.
4.1.1
LiveCD Install
4.1.2
Booting from CD
First, download (or otherwise obtain) the ISO disk image and burn it to a
blank CD:
package or two but are usually quickly fixed.
37
Place the CD into the CD drive and turn the computer on. Ensure your
computer has booting from CD-ROM enabled (this is a function of the BIOS
so you made need to go into the BIOS setup program at boot time). You
will be asked to press Enter to boot Debiando so.
Booting from Floppy with USB
First, download (or otherwise obtain) the floppy disk boot image and write
it to a floppy disk:
> wget http://http.us.debian.org/debian/dists/testing/main/\
installer-i386/current/images/floppy/boot.img
> dd if=boot.img of=/dev/fd0 bs=1024 conv=sync ; sync
Place the Floppy into the Floppy drive and turn the computer on. Ensure
your computer has booting from Floppy enabled (this is a function of the
BIOS so you made need to go into the BIOS setup program at boot time).
You will be asked to press Enter to boot Debiando so. This will stop with
a request for a root floppy or a USB stick.
Now obtain the USB image and the CD ISO image to be placed on the USB
stick (see http://d-i.pascal.at/ for further information):
> wget http://http.us.debian.org/debian/dists/testing/main/\
installer-i386/current/images/hd-media/boot.img.gz
> zcat boot.img.gz > /dev/sda1
> wget http://gluck.debian.org/cdimage/testing/sarge_d-i/i386/beta3/\
sarge-i386-netinst.iso
> mount /dev/sda1 /flash
> cp sarge-i386-netinst.iso /flash
> umount /flash
Then plug the USB stick into the new machine and press Enter to continue.
System Install
Choose, for example, English (USA). If there is no DHCP on the local network set up a static network (e.g., IP=105.229.8.158, NetMask=255.255.255.192,
38
Installation
Gateway=105.229.8.190, DNS=125.83.72.15 125.83.72.1). Choose the defaults for all options unless you know better. There should only be one or
two questions. You will eventually be asked to remove the CD and reboot.
Configure the time zone (e.g., Australia/ACT). Add Root and User accounts.
Dont do any task selection for now. For the email set up choose local delivery.
Note that to reconfigure, run the base-config program.
And that is it. The system is ready to use! The user account is quite spartan
and there arent many applications installed, so these are the next steps.
Account Configuration
Set up a basic system with ssh, wajig, emacs21, less, most, zile:
#
#
#
#
cp /etc/apt/sources.list /etc/apt/sources.list.original
scp ktw:/etc/apt/sources.list /etc/apt/sources.list
wajig update
wajig dist-upgrade
Set up, for the user account, ssh for access to remote accounts if you like, to
avoid repeatedly typing a password:
39
4.2
Hardware Compatibility
40
Installation
made available by the manufacture available and open source drivers may
be hard to come by. This is only likely though for very recent new cards
or very specialised cards (like Gigabit Ethernet). Any PCI Ethernet or Fast
Ethernet NIC should work out of the box with GNU/Linux.
Modems that indentify themselves as Windows only or designed for Windows
are so-called software modems which rely on the CPU doing some of the
work for them. Some of these will not work with GNU/Linux. However, all
external modems work with GNU/Linux.
For graphics cards, avoid the absolute latest releases until youve checked
their driver status under GNU/Linux (check with the retailer or vendor).
For example, for nvidia graphics cards the NVidia Gnu/Linux binary driver
web site has a README that lists the supported cards, which generally includes
everything but the absolute latest top-of-the-line cards (support for which is
generally only a matter of time).
There is an excellent web site for checking GNU/Linux compatibility for
printers (http://www.linuxprinting.org). Generally, most Epson and HP
inkjet printers are well supported.
There is a similar web site to check for CD recorder compatibility. In general,
any ATA CD-RW and DVD-RW/-RAM/+RW drive should work just fine
with GNU/Linux since they are controlled by the ATAPI driver.
4.3
4.3.1
Floppy Distribution
A collection of floppy disks (sixteen for Debian 2.2, for example) is required to begin the floppy-disk installation. The raw floppy disk images can
be retrieved from http://ftp.debian.org/debian/dists/stable/main/
41
4.3.2
CD-ROM Distribution
4.3.3
LiveCD Distributions
Morphix is a modular distribution of Debian GNU/Linux with LiveCD support. Thus, you simply burn the CD image onto a CD-ROM and boot from
3
The netinst, or network install, distributions are Debian CDs with a bare installer.
The base OS and any additional packages you choose to install are downloaded from a
Debian mirror.
42
Installation
4.4
Boot
Boot from the suitable bootable CD-ROM. This might be one of the network installer single CD-ROMs from Progeny or Debian, or disk 1 of the Debian CD-ROM set (e.g., it might be called the Debian GNU/Linux Binary1
(nonUS) CD-ROM) or even the Rescue floppy disk. For different hardware
boot from the appropriate mediafor example for a SPARCStation boot
from the Sparc CD-ROM.
4.4.1
SPARCStation Boot
ok boot cdrom
At the boot prompt choose s (SCSI) and the system then boots from the
CD-ROM. To boot single user simply use boot -s.
4.5 Installation
4.4.2
43
On some older machines, like Prefect (Section 4.10.17), the BIOS cannot boot
direct from CD-ROM so the machine needs to be booted from floppy disk
using MS-Windows Millenium Startup floppy. This recognises the CD-ROM
drive as drive D:. So simply run the BOOT command on the CD-ROM:
DOS> D:
> CD INSTALL
> BOOT
4.5
4.5.1
Installation
Debian Install
For Debian 3.0 choose to install the 2.4.18 kernel, at the boot prompt enter:
boot: bf24
4.5.2
PGI Install
Some advantages:
Much simpler than the laborious Debian install.
Uses the newer grub boot loader.
Uses discover to find hardware and to configure the hardware.
Some caveats:
Cant think of any yet.
Install of base takes about 1 hour, depending on network connection. Install
of all additional packages can take quite some time, depending on network
connection. Connected to a local Debian mirror with high throughput took
1 hour.
44
Installation
The default for PGI is to use DHCP (an automated mechanism for obtaining
an IP address from a DHCP server) to automatically obtain network information. If you dont have a DHCP server available then tell the installer
using the nodhcp option:
The PGI install process proceeds to running gnome-tasksel. You can choose
not to run this, or else select the tasks you would like installed and leave it
to do so from the Progeny archive.
Once completed update the installation with defaults for gdm.conf and apts
/etc/apt/sources.list. Your are then ready to ensure all appropriate
packages are installed. Install synaptic to select further packages (after a
dist-upgrade).
The configuration figlets used by PGI include:
dexlet
etherconf
4.6
4.6.1
X Server configuration
Configure the network: wajig reconfigure etherconf
Base Install
Keyboard
Choose qwerty/us.
4.6.2
Partitions
Partitioning of hard drive(s) can be tricky for the new user. The Debian
Installer provides options to partition your disk in a number of ways. It
recommends a simple, single partition, which is a good choice, unless you
know what you are doing. For a fuller discussion of Disk Partitioning see
Chapter 65.
4.6.3
45
Configure Devices
This section of the install essentially identifies modules that you want to
be loaded whenever the machine is booted. The modules you identify will
be listed in /etc/modules. You can always add the modules there yourself
later. If using a pre-3.0 Debian install be sure to add a network module (or
else ppp if you are connected via a modem through an ISP) so that Debian
knows to set up the network.
4.6.4
Networking
During an install you will be asked whether to try DHCP to obtain your
network information from a DHCP server. This (usually) requires that you
identify your host as a host that your DHCP server knows or relies on the
DHCP server allocating the next available IP address. Do so just to see if
there is a DHCP server available to you.
If a DHCP server is not available then you will be prompted for appropriate
network information.
Generally you need the following, where some sample addresses are supplied:
IP
Netmask
Gateway
Domain
DNS
155.229.8.165
255.255.255.192
155.229.8.190
ktware.com
183.44.72.1
# netstat -n
# ifconfig -a
46
4.6.5
Installation
Time Zone
Generally choose GMT for a GNU/Linux only machine and NO GMT for
dual boot machines.
4.6.6
4.6.7
Once the base system is installed you are asked to reboot the system. Remove
the floppy disk and CD-ROM and reboot the machine. Keep the floppy in
if this is how you plan to boot into Linux (otherwise you are probably using
LILO to book directly into Linux).
You will be asked to enter a password for the root account and to create a
user account. Do so. In general it is best to log in as a user then use the
su command to set the user to be root as needed (e.g., to install packages or
modify files in /etc).
4.6.8
Package Selections
4.6.9
The default email server for Debian is exim. This can be set up in one
of several ways, depending on how you will access your email. The exim
configurator will list the options.
47
Generally, for a networked machine (e.g., Altrop (Section 4.10.20)) that is not
acting as a mail server, but using a remote smarthost (SMTP server) to send
email, yet still delivering email locally (which is obtained using fetchmail, for
example, from an IMAP server), you will choose option 2.
The information you then supply is:
visible name
other names
domain rely
network relay
smarthost
root email sent to
altrop.ktware.com
none
none
none
mailhost.ktware.com
kayon
This means that mailhost.ktware.com is used for sending email. Any email
sent from Altrop (Section 4.10.20) to an unqualified address (i.e., no @) will
have altrop.ktware.com appended to it and delivered locally.
4.7
Installing Packages
4.7.1
Add the local server (I add a local mirror plus an Australian mirror at aarnet)
and the US server to /etc/apt/sources.list:
deb
deb
deb
deb
deb
deb
48
4.7.2
Installation
Upgrade
4.7.3
New Packages
49
50
Installation
vim
wajig wget whiptail whois
x-window-system x-window-system-core xclip xdaliclock xearth xfig
xfishtank xfonts-cyrillic xfonts-pex xfree86-common xfsprogs xfstt
xgalaga xine-ui xletters xloadimage xmeter xmh xmms xmms-alarm
xmms-bumpscope xmms-cdread xmms-crossfade xmms-dev xmms-flac
xmms-fmradio xmms-goodnight xmms-goom xmms-infinity xmms-jess
xmms-lirc xmms-liveice xmms-modplug xmms-msa xmms-osd-plugin
xmms-qbble xmms-shell xmms-sid xmms-singit xmms-status-plugin
xmms-synaesthesia xmms-volnorm xmms-wmdiscotux xmmsarts xmountains
xpdf xpdf-common xpdf-reader xpdf-utils xplanet xplanet-images
xscreensaver-gl xscreensaver-gnome xsltproc xsnow
4.8
You are reminded of this on each upgrade. This message can be turned off
by adding the following line to /etc/kernel-img.conf:
do_initrd=Yes
The default boot loader for a Debian install is lilo, but a PGI install uses grub so no
need to fiddle here.
4.9
51
Initial Configurations
My initial configuration involves making the gdm login screen looking nicer
by adding my own graphic, turning off the title bar, editing the welcome
message, and adding the System menu. The relevant lines in /etc/gdm/
gdm.conf are:
TitleBar=false
Logo=/usr/local/share/pixmaps/tux.jpg
SystemMenu=true
Welcome=Togaware Australia\n\nWelcome to %n\n\nDebian GNU/%s %r %m
4.10
/home
/usr/local
/var/lib/cvs
/ktwnet/altrop
nfs
nfs
nfs
nfs
defaults
defaults
defaults
defaults
0
0
0
0
0
0
0
0
Target Machines
4.10.1
Bartok (Section 4.10.1) is a custom built dual processor server with an inexpensive 20GB IDE hard disk (for Debian GNU/Linux install) and a 136GB
SCSI RAID disk (made up of 4 disks).
Debian GNU/Linux 2.2r2 was originally installed (kernel-image-2.2.18pre21)
from CD-ROM (4 December 2001). The SCSI RAID disk (Adaptec 2100s)
was not supported by the installed kernel thus Debian was first installed
on the IDE drive. A driver for the SCSI RAID was then obtained from
52
Installation
Adaptec (dpt i2o.o) and installed after Debian was upgraded to unstable and
running with kernel-image-2.2.19. A compile of kernel-source-2.4.16 produced
a dpt i2o.o suitable for use with kernel-image-2.4.16-686-smp. On 26 March
2003 a standard kernel-image-2.4.20-686-smp was installed to provide up to
date support for USB, adding a USB Printer. This was upgraded to kernelimage-2.4.25-1-686-smp on 23 March 2004. The SMP kernels supports the
dual processors and 4GB high memory.
Originally there were occasional I/O errors with the dpt i2o driver for the
Adaptec. Others (e.g., Ian Millsom) reported that the driver in the earlier
2.4 kernels were buggy and indeed Ian had a 2.2.19pre17 kernel patched
for the driver. However, running under kernel versions 2.4.16, 2.4.20, and
2.4.25 there have been no further problems. (The 2.4.16 kernel was compiled
with options p3, high memory, and SMP and the later kernels were standard
Debian kernels with SMP and HIMEM).
Original partitioning was 4GB for / and the rest for /home. After a couple
of years of use the 4GB for / became inadequate and things like /usr/share
started moving to other places!
A new install was performed (24 March 2004) with the beta3 Debian Installer
booting from CD-ROM. A default boot froze very quickly just after:
Bartok Specifications
From the lspci and lshw commands and /proc/cpuinfo:
53
54
Installation
loading of modules that are required for particular devices that are otherwise
not provided in the kernel.
So the first attempt at installing Linux obtained the appropriate module/driver
from Adaptec by downloading dptdriver-2.4.tgz from linux.adaptec.
com. This gzipped tape archive generates /usr/adaptec/i2o_driver/:
> tar zxvf dptdriver-2.4.tgz
> cd usr/adaptec/i2o_driver/
The drivers for various versions of the kernel are then contained in dpt i2o prebuilt.cgz.
This is a gzipped cpio archive. To extract the archive:
$ mkdir tmp
$ cd tmp
$ gunzip < ../dpt_i2o_prebuilt.cgz | cpio --extract
The kernel installed was 2.2.18pre21 but there is not a corresponding dpt i2o.
The 2.2.18 version had undefined symbols and the machine froze. The 2.2.19
version worked. This was then copied onto a floppy for Debian to load:
$
$
$
$
mount /floppy
mkdir /floppy/boot
cp dpt_i2o.2.2.19 /floppy/boot/dpt_i2o.o
umount /floppy
Once dpt_i2o is installed you can create and initialise the disk partitions on
the RAID:
# cfdisk /dev/sda
# mke2fs /dev/sda1
Later when configuring drivers and devices you can also add modules from
floppy, but they must now be in /floppy/lib/modules/scsi/dpt_i2o.o,
for example.
Now we come unstuck because we create a boot floppy yet there is no way
to install the RAID driver on the kernel on this boot floppy, so next reboot
the RAID is no longer available and the boot hangs with a Kernel Panic and
a message about block-major-8 and not being able to mount the root fs.
55
/raid ext2
defaults,errors=remount-ro
0 0
Also add dpt i2o to /etc/modules so that the RAID is available when the
machine boots.
Kernel Compiles to Support HIGHMEM and SMP
Eventually the standard package kernel-image-2.4.20-1-686-smp was installed,
providing both SMP and HIMEM support.
Previous kernel compiles are outlined here.
56
Installation
#
#
#
#
#
#
Note also that with the dual processor card in this machine (ASUS CUV4XDLS) the noapic option was required, otherwise there is a problem with
running out of IRQs and the boot hangs after the following message:
ENABLING IO-APIC IRQs
Setting 2 in the phys_id_present_map
...changing IO-APIC physical ID to 2 ... ok.
..TIMER: vector=0x31 pin1=2 pin2=0
57
58
4.10.2
Installation
ASL (Cargo)
Cargo Specification
From the lspci and lshw commands and /proc/cpuinfo:
Machine:
Motherboard:
CPU:
Bogomips:
Memory:
Network:
Disk:
Video:
Audio:
CDRW:
Hostname:
Domainname:
IP Address:
Netmask:
Broadcast:
Gateway:
DNS
Boot:
Kernel:
59
configured.
Configure the time zone as Australia/ACT. Add Root and User accounts.
For apt choose HTTP. Dont do any task selection for now. No specific
exim4 options need be selected - set up as a local system.
Install ssh and then copy a master sources.list file, followed by apt-get
update (the CD is no longer required) and then apt-get install wajig to
get things going:
#
#
>
>
>
>
mv /etc/apt-get/sources.list /etc/apt-get/sources.list.orig
scp ktw:/etc/apt-get/sources.list /etc/apt-get/sources.list
apt-get update
apt-get install wajig
wajig update
wajig dist-upgrade
60
4.10.3
Installation
Custom (Wayfare)
This is a purpose built desktop used for development. It has a 1GHz Pentium
3 processors, 512MB memory, 20GB of disk and Rage M3 video.
A test run used Gnoppix to test basic Linux functionality. All was okay with
X running at 1152x864 75Hz.
The base install (2 Mar 2004) was with the beta2 Debian Installer, which
was under development for the next stable release of Debian. A partition of
12GB was used for / and 1GB for swap. (The rest was for a pre-installed
Windows2000 system, drives C and D using about 7GB there.)
Wayfare Specification
From the lspci and lshw commands and /proc/cpuinfo:
Machine:
CPU:
Bogomips:
Memory:
Network:
Disk:
Video:
Audio:
CDRW:
Hostname:
Domainname:
IP Address:
Netmask:
Broadcast:
Gateway:
DNS
Boot:
Kernel:
61
Install ssh and then copy a master sources.list file, followed by apt-get
update (the CD is no longer required) and then apt-get install wajig to
get things going:
#
#
>
>
>
>
mv /etc/apt-get/sources.list /etc/apt-get/sources.list.orig
scp ktw:/etc/apt-get/sources.list /etc/apt-get/sources.list
apt-get update
apt-get install wajig
wajig update
wajig dist-upgrade
62
Installation
The configuration should be fine (finding /dev/hda3 as the Linux boot). For
convenience, add the following to /etc/kernel-img.conf:
postinst_hook = /sbin/update-grub
postrm_hook = /sbin/update-grub
Install kernel-image-2.4.25-1-686.
Install ntpdate to set the system clock accurately from a reliable server (e.g.,
ntp.ktware.com).
Get X Windows working with the Rage card by installing x-window-system
gnome gdm gdm-themes cinepaint xine-ui. Ive chosen a 1280x1024 resolution
for display on a Dell flat panel.
Install openoffice.org xmms apache
Run tasksel to install groups of packages.
Install vrms! And any other packages as appropriate.
4.10.4
63
This is a laptop used for developing and delivering presentations and for note
taking and working whilst travelling. It has a 1GHz Pentium 3 processors,
512MB memory, 18GB of disk and Rage M3 video.
The base install (27 Feb 2004) was with the beta2 Debian Installer, which
was under development for the next stable release of Debian. A partition of
12GB was used for / and 1GB for swap. (The rest was for a pre-installed
Windows2000 system, drives C and D using about 7GB there.)
Inci Specification
From the lspci and lshw commands and /proc/cpuinfo:
Machine:
CPU:
Bogomips:
Memory:
Network:
Disk:
Video:
Audio:
CDRW/DVD:
Hostname:
Domainname:
IP Address:
Netmask:
Broadcast:
Gateway:
DNS
Boot:
Kernel:
64
Installation
mv /etc/apt-get/sources.list /etc/apt-get/sources.list.orig
scp ktw:/etc/apt-get/sources.list /etc/apt-get/sources.list
apt-get update
apt-get install wajig
wajig update
wajig dist-upgrade
Now the setup begins. Install emacs21 less most zile python-glade2 pythongnome2.
The resolv.conf didnt include my usual search line so it was added:
search ktware.com
Set up, for the user account, ssh for access to remote accounts if you like, to
avoid repeatedly typing a password:
> mkdir .ssh
> scp ktw:.ssh/id_dsa .ssh/
> scp ktw:.ssh/authorized_keys2 .ssh/authorized_keys
> ssh-agent bash
> ssh-add
Enter passphrase for /home/kayon/.ssh/id_dsa:
Identity added: /home/kayon/.ssh/id_dsa (/home/kayon/.ssh/id_dsa)
65
Install kernel-image-2.4.24-1-686.
Install ntpdate to set the system clock accurately from a reliable server (e.g.,
ntp.ktware.com).
Get X Windows working with the Rage card by installing x-window-system
gnome gdm gdm-themes cinepaint xine-ui.
Install openoffice.org xmms apache
Run tasksel to install groups of packages.
Install vrms.
Ive chosen a 1024x768 resolution. This is not so nice since it can handle
1400x1050, but it does make plugging into data projectors easier. However, the screen goes into a funny mode which can be fixed by Fn-F7 (compress/uncompress). The chosen ranges are 30-100 kHz for hsync and 50-160
Hz for vsync. Simply use wajig reconfigure xserver-xfree86 to force choice of
1024x768 when required.
66
4.10.5
Installation
This is a web server with 2GHz Pentium 4 processor, 256MB memory, 80GB
of disk and 64MB NVIVIA GeFOrce2 with TV-OUT.
The base install was with the beta 3 Debian Installer (15 March 2004), which
was under development for the next stable release of Debian. A partition of
10GB was used for /, and 70GB for /home and 1GB for swap.
Friends Specification
From the lspci and lshw commands and /proc/cpuinfo:
Machine:
CPU:
Bogomips:
Memory:
Network:
(e100)
Disk:
Video:
nVidia
Audio:
CD/DVD:
Hostname:
friends
Domainname: ktware.com.au
IP Address:
105.229.8.165
Netmask:
255.255.255.192
Broadcast:
105.229.255.255
Gateway:
105.229.8.190
DNS
125.83.72.15 125.83.72.1
Boot:
Grub
67
Set up, for the user account, ssh for access to remote accounts if you like, to
avoid repeatedly typing a password:
> scp ktw:.ssh/id_dsa .ssh/
> scp ktw:.ssh/authorized_keys2 .ssh/authorized_keys
> ssh-agent bash
> ssh-add
Enter passphrase for /home/kayon/.ssh/id_dsa:
Identity added: /home/kayon/.ssh/id_dsa (/home/kayon/.ssh/id_dsa)
mv /etc/apt-get/sources.list /etc/apt-get/sources.list.orig
scp ktw:/etc/apt-get/sources.list /etc/apt-get/sources.list
wajig update
wajig dist-upgrade
Use visudo to set up wajig usage for a user. Install grub. Install kernelimage-2.4.24-1-686.
68
Installation
Install ntpdate to set the system clock accurately from a reliable server (e.g.,
ntp.ktware.com).
Get X Windows working with the nVidia card by installing x-window-system
gnome gdm gdm-themes cinepaint xine-ui.
Install openoffice.org xmms apache
Run tasksel to install groups of packages.
Install vrms
4.10.6
69
This is a server with dual processors, 4GB memory, SCSI disk with a PERC
320/DC Adaptec controller with 440GB of disk (4 110GB drives).
The base install was with the beta Debian Installer (12 Nov 2003), which was
under development for the next stable release of Debian. The SCSI controller
was not recognised (although Knoppix had no problem with it, loading the
percraid module and identifying it as scsi2) but going to tty2 (C-A-F2) and
doing a modprobe aacraid (there was no percraid module) then a detect
hardware did the trick. A partition of 10GB was used for /, and 420GB for
/dmrnet and 10GB (far too much) for swap.
Caravan Specification
From the lspci and lshw commands and /proc/cpuinfo:
Machine:
CPU:
Bogomips:
Memory:
Network:
Disk:
Video:
Audio:
CD/DVD:
Hostname:
Domainname:
IP Address:
Netmask:
Broadcast:
Gateway:
DNS
Boot:
70
Installation
Booting from CD-ROM was arranged from the BIOS by going into the boot
device menu (F12) and choosing CD-ROM. For the Debian install choose
English (USA)choosing Australia results in a bad keyboard amp. There is
no DHCP on the local network so a static network was configured. Create
partitions: 9GB ext3 for /, 70GB ext3 for /home, and 1GB for swap. Sarge
was chosen as the mirror. The driver for the SCSI RAID was loaded by
going to another virtual terminal (C-A-F2) and loading it with modprobe
aacraid. Then C-A-F1 and Choose Detect Hardware. Now partition the
(420GB) into 10GB ext3 for /, 390GB ext3 for /home and 10GB for swap.
This is too much for swap - seems to only recognise 2GB. Choose to install
GRUB (on hd0), then reboot.
Configure the clock as GMT (although it might not be GMT at present, it is
the usual set up) and the time zone is Australia/ACT. Choose to use Shadow
Passwords. Add Root and User accounts. For apt choose http with the US
mirrors.kernel.org. Dont do any task selection for now. No specific exim4
options need be selected - set up as a satellite system.
Note that the hostname remained as localhost. I had to change this as below.
Now the setup begins. Install wajig ssh emacs21 less most. Use visudo to set
up wajig usage for a user. Install kernel-image-2.4.22-1-686.
Correct the host name with the command hostname caravan then emacs
/etc/hostname and emacs /etc/hosts.
Install ntpdate to set the system clock accurately from a reliable server (e.g.,
ntp.ktware.com). Install ntp-simple to regularly update the clock.
Set up ssh from remote accounts if you like:
> scp ktw:.ssh/id_dsa .ssh/
> scp ktw:.ssh/authorized_keys2 .ssh/authorized_keys
71
72
4.10.7
Installation
This is a desktop machine with modem access, a flat screen (with 4 USB
sockets), and a USB mouse.
Base install was with the beta Debian Installer (12 Nov 2003), which was
under development for the next stable release of Debian. A partition of 9GB
was used for /, 65GB from /home and 5GB for swap.
With a HP PS2210 all-in-one printer connected through USB the machines
BIOS (A02) stops for about 5 minutes trying to boot from the printer (presumably because it has a card reader and is being seen as a mass storage
device from which it might be able to bootbut without a memory card inserted). This can be turned off by entering BIOS setup (F2 at boot), choosing
Integrated Device (LegacySelect Options) and changing the USB Emulation
to No Boot.
With xfree86 4.3.0 multiple virtual terminals are not (always) supported for
the intel 865G graphics card. With kernel-image-2.4.22-1-686 multiple virtual
terminals are just fine. With kernel-image-2.4.23-1-686, starting a second X
server freezes the system with a black screen. There have been problems with
switching virtual terminals in that there is a 30 second delay after switching.
There is also a 30 second delay on start up. Clearly something is timing
out, and the suspicion is that it is something to do with USB. When hotplug
was installed and the module usb-uhci was removed from /etc/modules
the delay disappeared.
Modern Specification
73
OptiPlex GX270
Intel(R) Pentium(R) 4 CPU 2.80GHz
5570
512MB
82540EM Gigabit Ethernet Controller (e1000)
ATA Disk 74GB /dev/hda (9G/60G/5G)
Intel 82865G Integrated Graphics Device (i810)
Intel 82801EB AC97 Audio Controller (intel810 audio)
SAMSUNG CDRW/DVD SM-348B
modern
ktware.com.au
105.229.8.170
255.255.255.192
105.229.255.255
105.229.8.190
125.83.72.15 125.83.72.1
74
#
#
#
#
Installation
grub-install /dev/hda
update-grub
wajig remove lilo
reboot
75
76
4.10.8
Installation
A trial run of Debian GNU/Linux 3.0 using the GNOPPIX GNU/Linux live
CD was attempted (25 Sep 2003). Booted just fine but the install to hard
disk is still under development. Also trialled both the sarge (testing) netinst
and the sid (unstable) install CD-1, but both failed. So used Debian 3.0r1
to install and upgraded immediately to unstable.
GNOPPIX 0.5.4-1
GNOPPIX version 0.5.4-1 was downloaded:
wget ftp://source.rfc822.org/pub/local/gnoppix/gnoppix-0.5.5-2.iso
Works just fine. Choose to install to hard disk from the icon. This allowed
the disk to be partitioned and configured, but there were problems on reboot
with the tty1 printing / as -. So use a traditional install.
wget http://gluck.debian.org/cdimage/testing/netinst/i386/sarge-i386-netinst.iso
Simply boot then choose English (Australia), us keyboard, cdrom, load kernel
modules, installer modules (none chosen), skip PCMCIA, find network and
configure, configure static network: fairmont, act.cmis.csiro.au, 125.83.72.15
125.83.72.1, 105.229.8.169, 255.255.255.192, 105.229.8.190, mirror http US
ftp.us.debian.org sarge, hardware and kernel drivers, partition (/dev/hda1 /
36GB ext2, Swap 1GB), create filesystems, base install, ERRORS....
77
78
Hostname fairmond
Address
105.229.8.169
Netmask
255.255.255.192
Broadcast 105.229.255.255
Gateway
105.229.8.190
DNS
125.83.72.15,125.83.72.1
Domain
ktware.com
Installation
4.10.9
79
Debian GNU/Linux 2.2r2 was installed from a Debian CD-ROM (2002) and
then upgraded to unstable 6 August 2003.
Bigdaddy Specification
80
Hostname bigdaddy
Address
105.229.9.9
Netmask
255.255.255.192
Broadcast 105.229.255.255
Gateway
105.229.8.190
DNS
125.83.72.15 125.83.72.1
Domain
ktware.com
Installation
4.10.10
81
Debian GNU/Linux 3.0 was installed from a Debian CD-ROM (15 Apr 2003).
This desktop machine is considered a production machine and so needs to
stay with the stable release. However this machine requires XFree 4.3. The
XFree86 documentation said the video chipset (Intel i845) was only supported
in version 4.3.0, which is only available in Debian packaged for the unstable
distribution.
The vesa driver in XFree86-4.1.0 is an option but has serious problems. Even
with the Debian testing release there were problems with the vesa driver.
The solution was better kernel support of the devices. But before considering
this option think about buying an extra video card or at least have a read of
http://support.intel.com/support/graphics/intel845g/screen.htm to
decide if the features on offer are going to be worth the trouble.
A first attempt was to install XFree86 4.3.0 from the tar files provided by
xfree86.org. This works but it lives outside the Debian package system and
might break your package management system at some stage down the track,
although this is usually easily managed.
Intel does provide some information from http://support.intel.com/support/
graphics/linux/index.htm Intel indicates that xfree86-4.2.0 is required,
which means using Debians testing distribution at the moment. See the Debian Reference for how to upgrade your distribution from stable to testing.
Some BIOS changes:
Video DAC Snoop
= ON
Legacy Video Memory = 8Mb
AGP window max
= 256Mb (the maximum available)
82
Installation
# cd /usr/src
# ln -s kernel-build-2.4.20/686 linux
The install script prompts you for the information it needs, and keeps a log
of what it does. You need to run it as root.
The compilation can fail if the /usr/src/linux link is not pointing to the right
place (see above), or the kernel version is too old (less than 2.4.11).
As part of the install script, the newly built files are installed at the locations
shown below. Any preexisting files are moved to a file of the same name with
a .dri-old suffix.
dripkg/i830/i810_drv.o /usr/X11R6/lib/modules/drivers/i810_drv.o
dripkg/i830/i830_dri.so /usr/X11R6/lib/modules/dri/i830_dri.so
dripkg/drm/i830.o
/lib/modules/2.4.20-686/kernel/drivers/char/drm/i830.o
dripkg/agpgart/agpgart.o
/lib/modules/2.4.20-686/kernel/drivers/char/agp/agpgart.o
dripkg/core/libdri.a /usr/X11R6/lib/modules/extensions/libdri.a
dripkg/core/libdrm.a /usr/X11R6/lib/modules/linux/libdrm.a
dripkg/core/libpcidata.a /usr/X11R6/lib/modules/libpcidata.a
dripkg/core/libscanpci.a /usr/X11R6/lib/modules/libscanpci.a
(Note that the set of files and the locations will likely be different on your
system.)
The fact these modules replace ones provided by the packaging system may
break the packaging system to some extent, but to a far smaller extent than
installing XFree86-4.3 from a tarball or from source.
Configure your X server
83
This is quite simple once you have the correct hardware support. All you
really need is the line Driver i810 in the Device section. In the Screen
section, start with a default graphics depth of 16. This is what Intel recommend. It may help to specify a VideoRam size, but its not required.
Resolutions 1024x768 and 1280x1024 work at 16 and 24 bits and seems to
do the 3D graphics things (running glxinfo and glxgears to verify this).
VESA driver
Messing around with VESA modes in XFree86 4.2.1 did not help with this
chipset. The drivers only work for a little while. The failure was that once
you switch VTs or restart the X server, the screen goes black. Sometimes
the card seems to go into the correct video mode (verify this using the menu
buttons on the monitor) but when the screen is a uniform black you cant do
much useful work. There was one other mode of failure, where the screen had
strange colours. This may have been an incorrect pixmap depth problem, or
possibly a bad video modeline (though I find it hard to accept the latter, I
let vbe/ddc do its thing.)
The upgrade described in this note makes no real difference to these problems
with the vesa driver. Presumably this is because the upgrade doesnt affect
the relevant bits of the system.
84
4.10.11
Installation
Debian GNU/Linux 3.0 was installed from a Debian CD-ROM (29 Nov 2002).
This desktop machine is used for data analysis and desktop environment.
Lilo was replaced by grub.
The NIC (e1000) was not supported in the default 2.4.18 kernel. A kernelimage-2.4.19 was installed but again did not support the NIC. A kernelimage-2.4.20-pre11 was compiled for the machine (at the time the 2.4.20
was not released) and worked just fine. When it was released kernel-image2.4.20 was installed and worked just fine (and the NIC worked after insmod
e1000add e1000 to /etc/modules).
Installed ssh to get things started with standard configs, startup files and
passwd/group files copied from the server (Altrop (Section 4.10.20)). Installed
gdm and then run a simple script to place the standard setup files in the
appropriate locations. Installed wajig to get the show on the road!
The on-board video was at first run using vesa because XFree86 4.2.1 does
not have a driver for the 82845G AGP. It is supported in XFree86 4.3 (the i810
driver) which at the time was not released. The video works just fine. Until
4.3 is officially released you can add the following to /etc/apt/sources.
list:
deb http://www.penguinppc.org/~daniels/sid/\$(ARCH) ./
85
Festival Specification
CPU
BogoMIPS
RAM
Disk
00:00.0
00:02.0
00:1d.0
00:1d.1
00:1d.2
00:1d.7
00:1e.0
00:1f.0
00:1f.1
00:1f.3
00:1f.5
01:0c.0
Festival Install
Hostname uramys1
Address
125.83.88.13
Netmask
255.255.255.0
Broadcast optional
Gateway
125.83.88.177
DNS
183.44.72.1
Domain
ktware.com
86
Installation
#
#
#
#
cd /usr/src
wget http://www.kernel.org/pub/linux/kernel/v2.4/linux-2.4.19.tar.gz
wget http://www.kernel.org/pub/linux/kernel/v2.4/testing/patch-2.4.20-pre11.gz
tar zxvf linux-2.4.19.tar.gz
cd linux-2.4.19
gzip -dc ../patch-2.4.20-pre11.gz | patch -p1 -N -F4
make menuconfig
Processor type and features
Processor family
CONFIG_MPENTIUM4=y
#General: Seem to get Cant get display ID errors
#
CONFIG_APM=y
#
CONFIG_APM_DO_ENABLE=y
#
CONFIG_APM_CPU_IDLE=y
#
CONFIG_APM_DISPLAY_BLANK=y
#
CONFIG_APM_RTC_IS_GMT=y
Block devices
RAM disk support
CONFIG_BLK_DEV_RAM=y
Initial RAM disk (initrd) support
CONFIG_BLK_DEV_INITRD=y
Network device support
Ethernet (1000 Mbit)
CONFIG_E1000=y
Sound
CONFIG_SOUND_ICH=y
make-kpkg clean
make-kpkg --append-to-version -gjw --revision edm01
--initrd kernel_image
cd ..
wajig install kernel-image-2.4.19-gjw_edm01_i386.deb
This works just fine and all standard drivers (CDROM and NFS) were included by default and the e1000 support included in the kernal. The result-
87
ing kernel is quite a bit smaller that the kernels supporting lots of hardware
(700K initrd cf 2.4MB and 56K modules cf 20MB)!
88
Installation
4.10.12
Debian GNU/Linux 3.0 was installed from a Debian CD-ROM (28 Nov 2002).
This desktop machine is to be used as a server for CVS, apache, and other
services. The NIC (e1000) was not supported in the default 2.4.18 kernel. A
kernel-image-2.4.20-pre11 was compiled for the machine. Lilo was replaced
by grub and
The on-board video is run using vesa because XFree86 4.2.1 does not have a
driver for the 82845G AGP. See Festival (Section 4.10.11) for further details.
Uramys1 Specification
CPU
BogoMIPS
RAM
Disk
00:00.0
00:02.0
00:1d.0
00:1d.1
00:1d.2
00:1d.7
00:1e.0
00:1f.0
00:1f.1
00:1f.3
00:1f.5
01:0c.0
89
Uramys1 Install
Hostname uramys1
Address
125.83.88.13
Netmask
255.255.255.0
Broadcast optional
Gateway
125.83.88.177
DNS
183.44.72.1
Domain
ktware.com
Install Kernel 2.4.20
At the time of installing the NIC card (e10000) was not supported by the
available Debian kernels. Kernel 2.4.20 fixed this. A kernel was compiled
from source and patched up to 2.4.20-pre11. The default .config (i.e.,
starting from no .config file) was the starting point. Below is recorded
the specific configurations added.
#
#
#
#
#
#
#
cd /usr/src
wget http://www.kernel.org/pub/linux/kernel/v2.4/linux-2.4.19.tar.gz
wget http://www.kernel.org/pub/linux/kernel/v2.4/testing/patch-2.4.20-pre11.gz
tar zxvf linux-2.4.19.tar.gz
cd linux-2.4.19
gzip -dc ../patch-2.4.20-pre11.gz | patch -p1 -N -F4
make menuconfig
Processor type and features
Processor family
CONFIG_MPENTIUM4=y
General
CONFIG_APM=y
CONFIG_APM_DO_ENABLE=y
CONFIG_APM_CPU_IDLE=y
CONFIG_APM_DISPLAY_BLANK=y
CONFIG_APM_RTC_IS_GMT=y
Block devices
RAM disk support
CONFIG_BLK_DEV_RAM=y
Initial RAM disk (initrd) support
CONFIG_BLK_DEV_INITRD=y
Network device support
Ethernet (1000 Mbit)
90
Installation
CONFIG_E1000=y
Sound
CONFIG_SOUND_ICH=y
# make-kpkg clean
# make-kpkg --append-to-version -gjw --revision sis01
--initrd kernel_image
# cd ..
# wajig install kernel-image-2.4.19-gjw_sis01_i386.deb
This works just fine and all standard drivers (CDROM and NFS) were included by default and the e1000 support included in the kernal. The resulting kernel is quite a bit smaller that the kernels supporting lots of hardware
(700K initrd cf 2.4MB and 56K modules cf 20MB)!
4.10.13
91
Optima (Vivaldi)
root (hd0,0)
Filesystem type is ext2fs, partition type 0x83
kernel /Vmlinuz-2.4.20-pre11-p4 ro root=
[Linux-bzImage, setup=0x1400, size=0x10ea0d]
Error 28: Selected item cannot fit into memory
Reverting to lilo fixed the problem! However, at a later stage (27 June 2003)
a new kernel was installed (kernel-image-2.4.21-1-686) and the next reboot
stopped at LIL. To recover the system it was booted from a Debian CD
using a rescue kernel:
92
Installation
Lilo could not be fixed easily so instead grub was again installed, and worked
just fine.
Another problem is that on occasions the power up gets no further than
checking the first IDE and reporting Primary master disk fails. This is
well before Linux even comes in to play and seems to indicate some serious
hardware problem.
Vivaldi Specification
CPU
BogoMIPS
RAM
Disk
CD-ROM
NIC
Video
Audio
00:00.0
00:02.0
00:1d.0
00:1d.1
00:1d.2
00:1d.7
00:1e.0
00:1f.0
00:1f.1
00:1f.5
01:08.0
01:09.0
01:0b.0
93
Vivaldi Install
Hostname vivaldi
Address
155.229.8.158
Netmask
255.255.255.192
Broadcast optional
Gateway
155.229.8.190
DNS
125.83.72.1
Domain
ktware.com
For information on the AGP see http://www.intel.com/support/graphics/
intel845g/linux.htm and http://www.xfree86.org/~dawes/845driver.
html.
cd /usr/src
wget http://www.kernel.org/pub/linux/kernel/v2.4/linux-2.4.19.tar.gz
wget http://www.kernel.org/pub/linux/kernel/v2.4/testing/patch-2.4.20-pre11.gz
tar zxvf linux-2.4.19.tar.gz
cd linux-2.4.19
gzip -dc ../patch-2.4.20-pre11.gz | patch -p1 -N -F4
make menuconfig
Processor type and features
Processor family
CONFIG_MPENTIUM4=y
General
CONFIG_APM=y
CONFIG_APM_DO_ENABLE=y
CONFIG_APM_CPU_IDLE=y
CONFIG_APM_DISPLAY_BLANK=y
94
#
#
#
#
Installation
CONFIG_APM_RTC_IS_GMT=y
Block devices
RAM disk support
CONFIG_BLK_DEV_RAM=y
Initial RAM disk (initrd) support
CONFIG_BLK_DEV_INITRD=y
ATA/IDE/MFM/RLL support
IDE, ATA and ATAPI Block devices
CONFIG_BLK_DEV_CMD64X=y
CONFIG_BLK_DEV_CMD680=y
Sound
CONFIG_SOUND_ICH=y
make-kpkg clean
make-kpkg --append-to-version -p4 --revision dha01
--initrd kernel_image
cd ..
wajig install kernel-image-2.4.19-p4_dha01_i386.deb
This works just fine and all standard drivers (CDROM and NFS and EEPRO100)
were included by default. The resulting kernel is quite a bit smaller that the
kernels supporting lots of hardware (700K initrd cf 2.4MB and 56K modules
cf 20MB)!
4.10.14
95
Debian GNU/Linux 3.0 was installed from a Debian netinst PGI CD-ROM
(2 October 2002). This machine is used as a database server.
Brick Specification
CPU
BogoMIPS
RAM
Disk
DVD-ROM
CD-RW
NIC
3c905C-TX/TX-M [Tornado] (3c59x)
Video
nVidia Corporation NV10 (GeForce 256)
Audio
Crystal 4280/46xx + AC97 Audio (cs46xx)
The lspci command gives:
00:00.0 Host bridge: Intel Corp. 82840 840 (Carmel)
Chipset Host Bridge (Hub A) (rev 01)
00:01.0 PCI bridge: Intel Corp. 82840 840 (Carmel)
Chipset AGP Bridge (rev 01)
00:02.0 PCI bridge: Intel Corp. 82840 840 (Carmel)
Chipset PCI Bridge (Hub B) (rev 01)
00:1e.0 PCI bridge: Intel Corp. 82801AA PCI Bridge (rev 02)
00:1f.0 ISA bridge: Intel Corp. 82801AA ISA Bridge (LPC) (rev 02)
00:1f.1 IDE interface: Intel Corp. 82801AA IDE (rev 02)
00:1f.2 USB Controller: Intel Corp. 82801AA USB (rev 02)
00:1f.3 SMBus: Intel Corp. 82801AA SMBus (rev 02)
01:00.0 VGA compatible controller: nVidia Corporation NV10
[GeForce 256 SDR] (rev 10)02:1f.0 PCI bridge:
Intel Corp. 82806AA PCI64 Hub PCI Bridge (rev 03)
03:00.0 PIC: Intel Corp. 82806AA PCI64 Hub Advanced
Programmable Interrupt Controller (rev 01)
04:04.0 Multimedia audio controller: Cirrus Logic
CS 4614/22/24 [CrystalClear SoundFusion Audio Accelerator] (rev 01)
04:05.0 SCSI storage controller:
Adaptec AIC-7899P U160/m (rev 01)
04:05.1 SCSI storage controller:
96
Installation
Brick Install
Hostname brick
Address
155.229.8.165
Netmask
255.255.255.192
Broadcast optional
Gateway
155.229.8.190
DNS
183.44.72.1
Domain
ktware.com
4.10.15
97
Debian GNU/Linux 3.0 was installed from a Debian netinst PGI CD-ROM
(2 October 2002). This machine is used as a database server.
Atom Specification
CPU
BogoMIPS
RAM
Disk
DVD-ROM
CD-RW
NIC
3c905C-TX/TX-M [Tornado] (3c59x)
Video
nVidia Corporation NV10 (GeForce 256)
Audio
Crystal 4280/46xx + AC97 Audio (cs46xx)
The lspci command gives:
00:00.0 Host bridge: Intel Corp. 82840 840 (Carmel)
Chipset Host Bridge (Hub A) (rev 01)
00:01.0 PCI bridge: Intel Corp. 82840 840 (Carmel)
Chipset AGP Bridge (rev 01)
00:02.0 PCI bridge: Intel Corp. 82840 840 (Carmel)
Chipset PCI Bridge (Hub B) (rev 01)
00:1e.0 PCI bridge: Intel Corp. 82801AA PCI Bridge (rev 02)
00:1f.0 ISA bridge: Intel Corp. 82801AA ISA Bridge (LPC) (rev 02)
00:1f.1 IDE interface: Intel Corp. 82801AA IDE (rev 02)
00:1f.2 USB Controller: Intel Corp. 82801AA USB (rev 02)
00:1f.3 SMBus: Intel Corp. 82801AA SMBus (rev 02)
01:00.0 VGA compatible controller: nVidia Corporation NV10
[GeForce 256 SDR] (rev 10)02:1f.0 PCI bridge:
Intel Corp. 82806AA PCI64 Hub PCI Bridge (rev 03)
03:00.0 PIC: Intel Corp. 82806AA PCI64 Hub Advanced
Programmable Interrupt Controller (rev 01)
04:04.0 Multimedia audio controller: Cirrus Logic
CS 4614/22/24 [CrystalClear SoundFusion Audio Accelerator] (rev 01)
04:05.0 SCSI storage controller:
Adaptec AIC-7899P U160/m (rev 01)
04:05.1 SCSI storage controller:
98
Installation
Atom Install
Hostname atom
Address
155.229.8.164
Netmask
255.255.255.192
Broadcast optional
Gateway
155.229.8.190
DNS
183.44.72.1
Domain
ktware.com
4.10.16
99
Debian GNU/Linux 3.0 was installed from a Progeny netinst CD-ROM (28
June 2002). This desktop machine is to be used for data analysis by a
government department.
After installation a new IDE card was installed (CMD680) with two IDE
60GB hard drives. This required at least version 2.4.19 of the kernel. I have
also had feedback from another user at the University of London who has
three cards running on a machine with kernel 2.4.19.
Bach Specification
CPU
BogoMIPS
RAM
Disk
00:00.0
00:01.0
00:1e.0
00:1f.0
00:1f.1
00:1f.2
00:1f.4
00:1f.5
01:00.0
02:08.0
Host bridge: Intel Corp. 82845 845 (Brookdale) Chipset Host Bridge (rev 04)
PCI bridge: Intel Corp. 82845 845 (Brookdale) Chipset AGP Bridge (rev 04)
PCI bridge: Intel Corp. 82801BA/CA PCI Bridge (rev 05)
ISA bridge: Intel Corp. 82801BA ISA Bridge (LPC) (rev 05)
IDE interface: Intel Corp. 82801BA IDE U100 (rev 05)
USB Controller: Intel Corp. 82801BA/BAM USB (Hub #1) (rev 05)
USB Controller: Intel Corp. 82801BA/BAM USB (Hub #2) (rev 05)
Multimedia audio controller: Intel Corp. 82801BA/BAM AC97 Audio (rev 05)
VGA compatible controller: nVidia Corporation NV6 [Vanta] (rev 15)
Ethernet controller: Intel Corp. 82801BA/BAM/CA/CAM Ethernet Controller (rev 03)
100
Installation
Bach Install
Hostname bach
Address
155.229.8.158
Netmask
255.255.255.192
Broadcast optional
Gateway
155.229.8.190
DNS
183.44.72.1
Domain
ktware.com
Passwords using MD5 was turned off (DES instead used) as I think this is
the same as the server of the network into which this host will connect.
The second IDE disk was formatted:
# cfdisk /dev/hdb ; mkfs.ext2 /dev/hdb1
After installing Debian a serious performance hit was noticed every time the
disks were busy. In the X Window System, for example, the mouse would
be extremely sluggish (for several seconds or more) and there was no hope of
typing. It turned out that the parameters for the hard disk required tuning.
Installing hdparm allowed the tuning to happen. Running hdparm with
/dev/hda showed the current parameters:
# hdparm /dev/hda
/dev/hda:
multcount
I/O support
unmaskirq
using_dma
keepsettings
nowerr
readonly
readahead
geometry
busstate
= 0 (off)
= 0 (default 16-bit)
= 0 (off)
= 0 (off)
= 0 (off)
= 0 (off)
= 0 (off)
= 8 (on)
= 7297/255/63, sectors = 117231408, start = 0
= 1 (on)
101
It turns out that the following fixes the problem. It turns on DMA (-d1), 16
multiple sectors (-m16), and 32 bit I/O support (-c1):
# hdparm -d1 -m16 -c1 /dev/hda
# hdparm -d1 -m16 -c1 /dev/hdb
To ensure these new settings are saved for each reboot install the package
hwtools and edit /etc/init.d/hwtools:
if command -v hdparm >/dev/null 2>&1; then
hdparm -q -d1 -m16 -c1 /dev/hda
hdparm -q -d1 -m16 -c1 /dev/hdb
fi
cd /usr/src
wget http://www.kernel.org/pub/linux/kernel/v2.4/linux-2.4.19.tar.gz
tar zxvf linux-2.4.19.tar.gz
cd linux-2.4.19
make menuconfig
Processor type and features
Processor family
CONFIG_MPENTIUM4=y
Block devices
RAM disk support
CONFIG_BLK_DEV_RAM=y
102
#
#
#
#
Installation
Initial RAM disk (initrd) support
CONFIG_BLK_DEV_INITRD=y
ATA/IDE/MFM/RLL support
IDE, ATA and ATAPI Block devices
CONFIG_BLK_DEV_CMD64X=y
CONFIG_BLK_DEV_CMD680=y
Sound
CONFIG_SOUND_ICH=y
make-kpkg clean
make-kpkg --append-to-version -p4 --revision dha01
--initrd kernel_image
cd ..
wajig install kernel-image-2.4.19-p4_dha01_i386.deb
This works just fine and all standard drivers (CDROM and NFS) were included by default. The resulting kernel is quite a bit smaller that the kernels supporting lots of hardware (700K initrd cf 2.4MB and 56K modules cf
20MB)!
4.10.17
103
This desktop machine is used primarily for testing new installations and new
software updates. Also serves as a spare desktop workstation when required.
Installed Debian GNU/Linux 3.0 from the Debian 3.0 beta netinst CD-ROM
of 14 May 2002 (26 June 2002).
Originally installed Debian GNU/Linux 2.2r2 from CD-ROM (July 2001).
After the install the system was immediately upgraded to unstable and other
packages from unstable were installed as required.
Prefect Specifications
CPU
RAM
Disk
Disk
CD-ROM
NIC
Video
Audio
104
Installation
Prefect Install
For the Debian 2.2 install be sure to identify the network card when configuring devices. It is a 3c59x. This is not required for Debian 3.0. For the
Debian 3.0 install the Debian netinst was used since the PGI netinst did not
include INSTALL/BOOT nor LOADLIN.
4.10.18
105
Cleveland Install
The network information for this host is:
Hostname
Address
Netmask
Broadcast
Gateway
DNS
Domain
cleveland
155.229.8.161
255.255.255.192
optional
155.229.8.190
183.44.72.1
ktware.com
For this dual processor a new kernel was installed (kernel-image-2.4.18-686smp). Since this was a PGI install the boot loader is grub and no further
action is required. On the next book a menu of alternative kernels was
presented.
106
4.10.19
Installation
Debian GNU/Linux 2.2r2 was installed from CD-ROM (22 May 2002). The
network card was not recognised and so the kernel was upgraded to 2.4.6
which was available on a CDROM, requiring moving to the use of initrd and
resulting lilo configuration changes (see Sections 4.8 and 4.10.1). This kernel supported the ethernet card so that the installation could be upgraded
immediately to unstable. The graphics chip (ATI Rage 128 Pro TF) though
was not supported by the current XFree86 (4.1.0). An upgrade to the experimental XFree86 (4.2) fixed that.
Cultus Specifications
CPU
Intel(R) Pentium(R) 4 CPU 1.70GHz
BogoMIPS
3381
RAM
512MB
Disk
MAXTOR 6L040L2, ATA DISK drive 40GB IDE
CD-RW/DVD ATAPI 32X DVD-ROM CD-R/RW drive
NIC
3Com PCI 3c905C Tornado
Video
ATI Rage 128 Pro TF
Audio
Intel Corp. 82801BA/BAM AC97 Audio
The lspci command gives:
107
kernel-image-2.2.19
The networking began working just fine. In moving to the unstable release
(after a dist-upgrade) kernel-image-2.4.18-686 was installed without effort
(except for initrd addition to lilosee Sections 4.8 and 4.10.1)
Sound card support from the kernel required adding the following line to
/etc/modules.conf (by adding it to /etc/modutils/sndconfig then running update-modules:
alias sound-slot-0 i810_audio
108
4.10.20
Installation
109
Altrop Install
There were no particular issues in the install except for the lack of support in
the 2.2.18pre21 kernel for the Ethernet card (3c905C-TX) in this machine.
The disk was partitioned into two: one for swap (2GB as /dev/sda2) and
the rest for everything else (65GB as /dev/sda1).
The NIC (ethernet card) driver (3c59x) in this release (kernel 2.2.18pre21)
does not appear to support the 3Com 3c905C-TX card. The kernel needed
to be upgraded to a 2.2.19 kernel on a more recent release (e.g., Debian 3.0
woody betasee Section 3.7.5 for details of making a CD-ROM available to
apt-get):
# apt-get install
kernel-image-2.2.19
The networking began working just fine. In moving to the unstable release
(after a dist-upgrade) kernel-image-2.4.14-686-smp was installed without effort (except for initrd addition to lilo)
Sound card support from the kernel required adding the following line to
/etc/modules.conf (by adding it to /etc/modutils/sndconfig then running update-modules:
alias sound-slot-0 i810_audio
110
Installation
To ensure the module is loaded at boot time add i810 audio to /etc/
modules.
4.10.21
111
112
4.10.22
Installation
HAX is a dual boot laptop used for development. Debian GNU/Linux 2.2r2
was installed (kernel-image-2.2.18pre21) from CD-ROM 12 December 2001. It
was immediately upgraded to unstable and running with kernel-image-2.4.16.
HAX Specifications
CPU
Intel Pentium III (Coppermine)
BogoMIPS 1697
RAM
196MB
Disk
14GB TOSHIBA MK1517GAP, ATA DISK
DVD-ROM DV-28E-B, ATAPI 24x CDROM
NIC
Integrated Intel PRO/100+ Intel 82559
Video
Trident CyberBlade/DSTN/Ai1
Audio
Acer Laboratories Inc. [ALi] M5451 PCI South Bridge Audio (rev 01)
The lspci command gives:
00:00.0 Host bridge: Acer Laboratories Inc. [ALi]:
Unknown device 1632 (rev 01)
00:01.0 PCI bridge: Acer Laboratories Inc. [ALi]
M5247 (rev 01)
00:02.0 USB Controller: Acer Laboratories Inc. [ALi]
M5237 USB (rev 03)
00:04.0 IDE interface: Acer Laboratories Inc. [ALi]
M5229 IDE (rev c3)
00:06.0 Multimedia audio controller: Acer Laboratories Inc.
[ALi] M5451 PCI South Bridge Audio (rev 01)
00:07.0 ISA bridge: Acer Laboratories Inc. [ALi] M1533
PCI to ISA Bridge [Aladdin IV]
00:08.0 Bridge: Acer Laboratories Inc. [ALi]
M7101 PMU
00:0a.0 Ethernet controller: Intel Corp. 82557
[Ethernet Pro 100] (rev 08)
00:11.0 CardBus bridge: Toshiba America Info Systems
ToPIC95 PCI to Cardbus Bridge with ZV Support (rev 32)
00:11.1 CardBus bridge: Toshiba America Info Systems
ToPIC95 PCI to Cardbus Bridge with ZV Support (rev 32)
01:00.0 VGA compatible controller: Trident Microsystems:
Unknown device 8620 (rev 5d)
113
114
Installation
4.10.23
HUKZ Specifications
CPU
Intel Pentium III (Coppermine) 500MHz
BogoMIPS 993
RAM
132MB
Disk
HITACHI DK23AA-12B, 11509MB w/512kB Cache
DVD-ROM TOSHIBA 24X DVD-ROM SD-C2302, ATAPI CDROM
NIC
3Com 3CCFE575CT Tornado CardBus
Video
Neomagic Corporation NM2360
Audio
Cirrus Logic CS 4614/22/24
The lspci command gives:
00:00.0
00:01.0
00:02.0
00:02.1
00:03.0
00:06.0
00:07.0
00:07.1
00:07.2
00:07.3
01:00.0
05:00.0
Host bridge: Intel Corp. 440BX/ZX - 82443BX/ZX Host bridge (rev 03)
PCI bridge: Intel Corp. 440BX/ZX - 82443BX/ZX AGP bridge (rev 03)
CardBus bridge: Texas Instruments PCI1450 (rev 03)
CardBus bridge: Texas Instruments PCI1450 (rev 03)
Communication controller: Lucent Microelectronics WinModem 56k (rev 01)
Multimedia audio controller: Cirrus Logic CS 4614/22/24
[CrystalClear SoundFusion Audio Accelerator] (rev 01)
Bridge: Intel Corp. 82371AB PIIX4 ISA (rev 02)
IDE interface: Intel Corp. 82371AB PIIX4 IDE (rev 01)
USB Controller: Intel Corp. 82371AB PIIX4 USB (rev 01)
Bridge: Intel Corp. 82371AB PIIX4 ACPI (rev 03)
VGA compatible controller: Neomagic Corporation NM2360
[MagicMedia 256ZX]
Ethernet controller: 3Com Corporation 3CCFE575CT Cyclone
CardBus (rev 10)
qwerty/us
partition
1GB
Linux hda6
Swap hda7
115
116
4.10.24
Installation
Inco Specifications
117
Machine:
CPU:
Bogomips:
Memory:
Network:
inco
ktware.com.au
105.229.8.156
255.255.255.192
105.229.255.255
105.229.8.190
125.83.72.15 125.83.72.1
Grub
2.4.22-1-686
118
Installation
a CPU temperature in the Gnome-Panel. You may need to load the module
i8k. (By the way, i8k stands for Insperion 8000.) The command line i8kctl
lists the current status of the fans.
Lilo was configured to boot MS-Windows/2000 by pointing it to /dev/hda1.
Later, lilo was replace with grub for booting.
Sound card support from the kernel required adding the following line to
/etc/modules.conf (by adding it to /etc/modutils/sndconfig then running update-modules:
alias sound-slot-0 maestro3
which tells it to use whatever the BIOS recognises as connected (either CRT
or FP).
At one time I had a problem playing videos with xine. Starting xine on Inco
(Section 4.10.24) displayed just a blue screen, even when the video is playing.
If I choose the video driver to be xshm it works acceptably. Ogle fails to start
also, although mplayer coped. The problem was running with 16 rather than
24 bpp X server!
4.10.25
119
Plymouth Specifications
CPU
RAM 256MB
Disk
10GB
CD-R
NIC
3COM Ethernet Card 3C905B
Video ATI Technologies Inc 3D Rage Pro AGP 1X/2X (rev 5c)
Audio
The lspci command gives:
120
Plymouth Install
Nothing particularly special in the install.
Installation
4.10.26
121
Installed Debian GNU/Linux 2.2r2 from CD-ROM (15 December 2000). Upgraded to unstable and installed packages from unstable as required.
Velox (Section 4.10.26) is a dual boot machine with the first partition kept as
NTFS (C: Drive). During the Debian install the second partition (originally
the D: Drive) was deleted and partitioned as:
Partition 8.2GB as linux ext2 /dev/sda2
Partition 500MB as linux swap /dev/sda3
Write partition table
Velox Specifications
CPU
122
Installation
Velox Install
No particular trouble with the install. This is a dual boot machine with
MS-Windows/NT so do not install a boot loader - use NTs boot loader.
4.10.27
123
Debian GNU/Linux 2.2r2 was installed from CD-ROM (15 December 2000)
and immediately upgraded to unstable. This is a desktop machine with an
external modem for network connection and acts as the Internet gateway for
a small network.
Mint is a dual boot machine with the first partition as NTFS (C: Drive).
The second partition (originally a D: Drive) was deleted during the Debian
install and partitioned as:
Partition 8.5GB as linux ext2 /dev/hda2
Partition 200MB as linux swap /dev/hda3
Mint Specifications
The lshw command was used to obtain the following:
mint.act.cmis.csiro.au
CPU Pentium III (Coppermine) version: 6.8.6 730MHz
capabilities: fpu fpu_exception wp vme de pse tsc msr
pae mce cx8 apic sep mtrr pge mca cmov pat pse36 mmx
fxsr sse
Memory 254MB
PCI VGA NV5M64 [RIVA TNT2 Model 64/Model 64 Pro]
capabilities: vga bus_master cap_list irq=9
PCI Network Ethernet controller 3c905C-TX/TX-M [Tornado]
capabilities: bus_master cap_list
configuration: driver=3c59x irq=5
IDE IBM-DTLA-307015 /dev/hda 13GB
IDE NEC DV-5700A /dev/hdc 1023GB
IDE LG CD-RW CED-8080B /dev/hdd 1023GB
Multimedia 82801AA AC97 Audio
capabilities: bus_master
configuration: driver=intel810_audio irq=10
Mint Install
kb
disks
qwerty/us
partition
124
Installation
swap
linux
root
mount
kernel from cd-rom
devices fs/ntfs net/3c59x
network host = inx
base
from cd-rom
config timezone
Australia ACT
GMT no
(skip the "Make Linux boot directly from hard disk")
Make boot floppy
Custom Boot
Reboot
IP
Netmask
Gateway
DNS
183.44.70.89
255.255.255.192
BLANK
183.44.72.1
4.10.28
125
Inka is a laptop used essentially as a stand-alone machine with modem connectivity. A docking station provided a 19inch monitor and external keyboard
and mouse. Debian GNU/Linux 2.1 was installed from floppies, 15 March
1999. It was upgraded to unstable sometime later.
Inka Specifications
CPU
RAM
Disk
Disk
Floppy
CD-ROM
NIC
Modem
Video
Audio
126
Installation
qwerty/us
partition
6GB
Linux N P 6063 B T 83 B hdc1
128MB
Swap N P 125 T 82
hdc2
scan
scan
/dev/hdc1
Rescue Disk
Drivers Disk
psaux
ppp
W Q
/dev/hdc2
/dev/hdc1
mount
from /dev/fd0
misc
net
network host = debian
connected = no
base
from /dev/fd0
Base Disks 1-7
config timezone
Australia ACT
GMT no
(skip the "Make Linux boot directly from hard disk")
Make boot floppy
Custom Boot
Reboot
With the initial boot the extra internal bay hard disk drive had to be mentioned to the kernel with the following command line when the boot prompt
is displayed (you have about 10 seconds to begin typing):
boot: linux hdc=13424,15,63
(the numbers were eventually figured out one time when the drive was eventually auto-detected after a kernel upgrade).
ALSA Sound Configuration
Lindsay Haisley supplied the following configuration file for alsa:
# ALSA portion
alias char-major-116 snd
alias snd-card-0 snd-cs4236
alias char-major-14 soundcore
alias sound-slot-0 snd-card-0
# OSS/Free portion - card #1
127
sound-service-0-0 snd-mixer-oss
sound-service-0-1 snd-seq-oss
sound-service-0-3 snd-pcm-oss
sound-service-0-8 snd-seq-oss
sound-service-0-12 snd-pcm-oss
# Options for the Crystal sound card in the Dell Latitude CPi D300XT
options snd-cs4236 index=0 id=CARD_0 port=0x530 cport=0x210 mpu_port=0x330 fm_port=0x388 i
# OSS/Free portion
alias char-major-14 soundcore
alias /dev/mixer snd-mixer-oss
alias /dev/dsp snd-pcm-oss
alias /dev/midi snd-seq-oss
XF86 Configuration
Lindsay Haisley supplied the following configuration file (/etc/X11/XF86Config-4)
for xserver-xfree86. It is specific to the Dell CPi D300XT laptop with the
standard Neomagic Chipset and the example here is a combination of the
XF86Config-4 example provided with Gentoo Linux and Dell CPi D300XT
laptop details.
For the Dell CPi with the NeoMagic video we do not need to specify a specific
ModeLine settingthe X server determines that the VESA standard default
video mode for the Neomagic video system in the Dell Latitude CPi D300XT
should be as follows:
(**) NEOMAGIC(0): *Default mode "1024x768": 65.0 MHz, 48.4 kHz, 60.0 Hz
(II) NEOMAGIC(0): Modeline "1024x768"
65.00 \
1024 1048 1184 1344 768 771 777 806 -hsync -vsync
If you are using version 3 of the XFree86 server then the following modeline
might help out:
Modeline
"1024x768" 65 1024 1032 1176 1344 768 771 777 806 -hsync -vsync
128
Installation
The video system in this computer seems to be sufficiently flexible to accomodate either setting without apparent video alignment errors, however if
your display appears to be misaligned, use the older Modeline setting to see
if it solves your problem.
The options for the neomagic driver allow docked and external displays.
Internal and external displays dont work together so you need to manually
edit the XF86Config-4 file each time you change between the external and
internal display. It is reported that having both enabled can destroy the
internal display. It certainly makes it go pretty ugly momentarily.
Section "Files"
RgbPath
"/usr/X11R6/lib/X11/rgb"
FontPath
"unix/:7100"
FontPath
"/usr/X11R6/lib/X11/fonts/local/"
FontPath
"/usr/X11R6/lib/X11/fonts/misc/"
FontPath
"/usr/X11R6/lib/X11/fonts/75dpi/:unscaled"
FontPath
"/usr/X11R6/lib/X11/fonts/100dpi/:unscaled"
FontPath
"/usr/X11R6/lib/X11/fonts/Type1/"
FontPath
"/usr/X11R6/lib/X11/fonts/CID/"
FontPath
"/usr/X11R6/lib/X11/fonts/Speedo/"
FontPath
"/usr/X11R6/lib/X11/fonts/75dpi/"
FontPath
"/usr/X11R6/lib/X11/fonts/100dpi/"
ModulePath "/usr/X11R6/lib/modules"
EndSection
Section "Module"
Load
"dbe"
SubSection "extmod"
Option "omit xfree86-dga"
EndSubSection
Load "dbe"
# Double-buffering
Load "GLcore"
# OpenGL support
Load "dri"
# Direct rendering infrastructure
Load "glx"
# OpenGL X protocol interface
Load "extmod"
# Misc. required extensions
Load "v4l"
# Video4Linux
EndSection
Section "ServerFlags"
Option
"blank time"
"10"
# 10 minutes
EndSection
Section "InputDevice"
Identifier "Keyboard0"
Driver
"keyboard"
129
Option
"AutoRepeat"
"500 20"
Option
"Xleds" "1 2 3"
Option
"XkbModel"
"pc105"
EndSection
Section "InputDevice"
Identifier "Mouse0"
Driver
"mouse"
Option
"Protocol"
"PS/2"
Option
"Device"
"/dev/mouse"
Option
"Emulate3Buttons"
Option
"Emulate3Timeout"
"50"
EndSection
Section "Monitor"
Identifier "Dell SyncMaster 17GLi"
HorizSync
31.5 - 48.5
# multisync
VertRefresh 55-65
EndSection
Section "Device"
Identifier "NeoMagic"
Driver "neomagic"
BoardName "Unknown"
#
Option
"Rotate"
#
Option
"pciBurst"
#
Option
"ShadowFB"
#
Option
"NoStretch"
#
Option
"LcdCenter"
#
Option
"externDisp"
# Uncomment this for external video
Option
"internDisp"
# Uncomment this for internal video
Option
"overrideValidateMode"
#
Option
"noMMIO"
#
Option
"SWcursor"
#
Option
"NoAccel"
#
Option
"NoLinear"
#
Option
"XaaNoScanlineImageWriteRect"
#
Option
"XaaNoScanlineCPUToScreenColorExpandFill"
EndSection
Section "Screen"
Identifier "Screen0"
Device
"NeoMagic"
Monitor
"Dell SyncMaster 17GLi"
DefaultColorDepth 16
Subsection "Display"
Depth
16
130
Modes
"1024x768" "800x600" "640x480"
EndSubsection
EndSection
Section "ServerLayout"
Identifier
"XFree86 Dell CPi D300XT"
Screen
0 "Screen0" 0 0
InputDevice
"Mouse0" "CorePointer"
InputDevice
"Keyboard0" "CoreKeyboard"
EndSection
Installation
4.10.29
131
This older notebook PC has limited resources but works quite well with
a basic installation and on a network with a more powerfull server. At
the time the XWindows driver for the NeoMagic chip was not part of the
XFree86 distribution (it has been since version 3.3.3). This Dell Lattitude
XPi P133ST has a NeoMagic NM2070 chipset. The machine has 24MB of
memory and a 1.2 GB hard disk, using a PCMCIA modem card with PPP.
The 1.2GB hard disk was partitioned into two equal partitions, the first for
Windows95, the second for Linux. Windows95 offers less functionality, is
slower, has more bugs, and consumes considerably more disk space than the
Linux installation which includes X, TeX, and much more!
Originally installed Debian GNU/Linux 1.1 with individual package updates
as needed.
Checking NeoMagics web pages at the time found that NeoMagic does
not support Unix drivers, and cannot provide device/programming information to end-users, protecting their intellectual property rights. So for the
NeoMagic chipset there was no SVGA driver (800x600x8bpp 256 colors) in
XFree86 prior to version 3.3.3only the simple VGA16 driver (800x600x4bpp
16 colours) could be used. There was a RedHat rpm with a driver for this
chip with XFree86 versions prior to 3.3.3 available and a commercial (approximately US$250) X11 server from Xi Graphics with a NeoMagic driver
for Linux, with many positive reports.
Running an older version of XFree86 and of the kernel, you will find that the
VGA16 server from XFree86 version 3.1 works with the NM2070, giving just
16 colours. A trick is required to get the server to use the whole screen
(800x600) rather than the 640x480 default or the split screen effect. This
requires putting the monitor into 800x600 mode on bootup. A consequence
of this is that the normal console is turned off, and you will need to go directly
into XWindows, via xdm. This is not usually a problem.
Note that using the Neomagic 2070 xserver provided with XFree86 version
4 works fine with both 8bit and 16bit on 640x480 and 800x600 but causes
a corrupted screen (vanishing window content etc.) in all x-applications if
used with default settings. To fix the problem append both Xaa-options in
the screen-section of the x86config:
Option "XaaNoPixmapCache"
Option "XaaNoScreenToScreenCopy"
132
Installation
bx,ax
ah,#0xff
setalias
To:
mode_set:
mov
mov
cmp
jz
ax,#0x0302
bx,ax
ah,#0xff
setalias
The Compaq Presario 1020 notebook (which also uses a NeoMagic NM2070
chip) requires no LILO switches nor kernel patches. Similarly the NEC Versa
4200 also uses the NeoMagic and no hacks are required to get it to run in
800x600x4bpp mode.
Rose Specifications
CPU
BogoMIPS
RAM
Disk
NIC
Video
Audio
4.11 Resources
4.10.30
133
This much older machine demonstrates a basic install with limited resources.
The machine is networked and provides a limited but useful interface to
applications running on a more powerful server. Some basic applications
installed included emacs, ssh, and lynx.
Roast Specifications
CPU
486/DX66
BogoMIPS
RAM
12MB
Disk
420MB
NIC
Video
Audio
4.11
Resources
4.11.1
Books
There are many books that deal with the installation of Debian or RedHat.
Some of the Debian books include:
Debian GNU/Linux: A Guide to Installation and Usage by John
Goerzen and Ossama. 158 pages, published July 1999 by New Riders, ISBN
0735709149.
Learning Debian GNU/Linux by Bill McCarty. 360 pages, published
October 1999 by OReilly & Associates, ISBN 1565927052.
Debian GNU/Linux 2.1 Unleashed by Mario Camou, Aaron Von Cowenberghe, Aaron Van Couwenberghe. 1119 pages, published December 1999 by
Sams, ISBN 0672317001.
134
Installation
Chapter 5
Basic Survival
5.1
5.1.1
Basic Linux
File and Directory Protections
5.1.2
Background Jobs
135
136
5.2
Basic Survival
System Information
Chapter 6
Wajig: Administering Debian
Wajig is an interface to many Debian administrative tasks. The name has no
particular meaning (sorry!). Written in Python, it uses traditional Debian
administration and user tools including apt-get, dpkg, apt-cache, wget, and
others. It is intended to unify and simplify common administrative tasks.
Wajig has evolved over many years and theres a small band of users. It
has some of the same aims as the feta package and I thought to wrap the
extra wajig features into feta, but a number of users suggested that wajig
should stay. So it was rewritten recently from being a shell script to a python
program. It is available under the GPL.
As wajig is simply my frontend to various other commands the goal of this
section is more than simply demonstrating how to manage your system with
wajig. Wajig may not be the answer you are looking for and that is fine.
So, where ever I illustrate a procedure with wajig I will also indicate the
underlying commands that are being used to effect the wajig command. You
can then use these underlying commands directly if you prefer.
6.0.1
If youve tried to remember all the different commands to get different information about different aspects of Debian package management and then
used other commands to install and remove packages then youll know that
it can become a little too much.
Swaping between dselect, deity, deity-gtk, aptitutde, apt-get, dpkg, gnome137
138
6.0.2
Installing Wajig
6.0.3
139
6.0.4
Wajig Overview
wajig
wajig
wajig
wajig
wajig
wajig
wajig
wajig
wajig
wajig
update
install less
new
newupgrades
updatealts editor
restart apache
listfiles less
whichpkg stdio.h
whatis rats
orphans
(= apt-get update)
(= apt-get install less)
(list new packages since last update)
(list packages upgraded since last update)
(update the default "editor")
(restart the apache daemon)
(list the files supplied by the "less" pkg)
(what package supplies this header file)
(one line description of the package "rats")
(list libraries not required by other pkgs)
140
install
integrity
lastupdate
list
listalts
listfiles
listnames
new
newupgrades
orphans
purge
reconfigure
reinstall
remove
repackage
reset
search
source
status
toupgrade
update
updatealts
upgrade
whatis
whichpkg
6.0.5
141
password frequently. If sudo is installed but not set up for you to access
the appropriate APT commands you will see a permission denied message.
Installing sudo is straight forward. As root run the command visudo to edit
the configration file. Add the lines:
Cmnd_Alias
and
kayon
ALL=(ALL) APT
in the appropriate places. Then user kayon can run the APT and related
commands as the super user.
If you prefer user kayon not to need to enter their password every time you
could instead add the following:
kayon
6.0.6
Available Packages
The Debian packaging system relies on your local system having some idea of
what packages are available. This is initialised when you install your system.
You will generally need to update this list of packages with what is currently
available from the Debian archives for downloading. If you are staying with
the stable release you generally only need to update the list of available
packages once. The following command is used to update the information
about what is available for downloading:
$ wajig update
(dpkg update)
142
(In brackets after the wajig command is the underlying command that wajig
calls upon to perform the operation.)
This uses entries in the file /etc/apt/sources.list to know where to get
the list of available packages from and which release of Debian you wish to
follow. You can edit this file with:
$ wajig editsources
(editor /etc/apt/sources.list)
This will use the systems default editor, but you can change which editor is
the default with the command:
$ wajig updatealts editor
(Use the command wajig listalts for a list of things for which alternatives
exist, and hence can be updated.)
You need to understand the format of the file /etc/apt/sources.list as
explained in the manual page:
$ man sources.list
6.0.7
Finding Packages
Once the list of available packages is updated you can see what new packages
have recently been added to Debian with the command:
$ wajig new
Note that after the first time you use wajig update all packages will be
considered new! But after the next update the new packages are those that
were not in the available list from the previous update.
Some (and often many) of the packages that you already have installed on
your Debian system may have been upgraded in the archive since the last time
you performed an update. The following command will list these packages:
143
$ wajig newupgrades
For a complete list of the packages you have installed but for which there are
newer versions available on the archive use:
$ wajig toupgrade
To check the version of any installed package and also the version available
from the archive previously (last time, but one, you performed an upgrade)
and now (based on the last time you performed an update), and to also see
the so called Desired and Status flags of the package, use:
$ wajig status <package names>
(apt-cache pkgnames)
Without the string argument all known package names will be listed.
Each package installs some collection of files in different places on your system
(e.g., in /usr/bin/, /usr/man/man1/ and usr/doc/). Sometimes you like
to see where those files go or even just view the list of files installed. The
command to use is:
$ wajig listfiles <package name>
(dpkg --listfiles )
144
6.0.8
Installing Packages
To install a new package (or even to update an already installed package) all
you need do is:
$ wajig install <package name>
(apt-get install)
(dpkg -i)
The .deb file will be searched for in both the current directory and in the apt
archive at /var/cache/apt/archive/.
You can list multiple .deb files to install.
If the .deb package file you wish to install is available on the internet you
can give its address and wajig will download then install it:
$ wajig install http://samfundet.no/debian/dists/woody/css/xine-dvd-css.deb
Sometimes you may want to install many packages by listing them in a file,
one per line. You can do this with:
$ wajig fileinstall <filename>
(apt-get install)
The file of packages to install can conveniently be created from the list of
installed packages on another system with:
$ wajig listinstalled > <filename>
(dpkg --get-selections)
145
$ wajig upgrade
(apt-get -u upgrade)
And you can upgrade all installed packages, remove those packages that need
to be removed (for various reasons, including issues to do with dependencies)
and install all newly required packages in the distribution with:
$ wajig dist-upgrade
(apt-get -u dist-upgrade)
(apt-get remove)
Once again, you can list multiple packages to remove with the one command.
A remove will not remove configuration files (in case you have done some
configuration of the package and later re-install the package). To get rid of
the configuation files as well use:
$ wajig purge <package name>
6.0.9
6.0.10
146
6.0.11
Occasionally, and particularly if you are following the unstable release, some
packages are broken for various reasons. This was the case with the package
cdrecord in unstable. This package was compiled with kernel 2.4.n and had
some kernel specific issues that were done differently with kernel 2.2.n. At
compile time one or the other options was chosen (but not both!). Thus the
newer binary versions of cdrecord would not run on a system using kernel
2.2.n. One solution is to build a Debian package of cdrecord using the wajig
build command. Another is to reinstall an older version that worked and
then place the package on hold with:
$ wajig hold cdrecord
6.0.12
Building Packages
Generally you can add the -src to copies of pre-existing deb lines.
To retrieve and unpack a source Debian package use:
$ wajig source <package names>
(apt-get source)
147
Note that you can list several packages and grab all of their sources.
The source command downloads a .tar.gz file and a .dsc file for the package. The .tar.gz file contains the source code and associated files. The
.dsc file contains test information that is used by the packaging system.
The source command will also extract the contents of the .tar.gz archive
into a subdirectory consisting of the package name and version.
To go one step further and also configure, compile and generate a default
Debian .deb package from source code (useful if you need to compile a package
for your setup specifically) then use instead:
$ wajig build <package names>
But, if you need to modify the source in some way and rebuild a package:
$
$
$
$
$
wajig update
wajig build ncftp
dpkg-source -x ncftp_3.0.2-3.dsc
cd ncftp-3.0.2
fakeroot dpkg-buildpackage -b -u
6.0.13
When packages are installed the corresponding .deb files are stored in /var/cache/apt/archive.
This can become quite populated with older versions of packages and we can
clean out these older versions with:
$ wajig autoclean
(apt-get autoclean)
148
$ wajig clean
(apt-get clean)
To remove files immediately after they have been installed edit /etc/apt/
apt.conf:
6.0.14
6.0.15
Pinning Distributions
With the Debian packaging system you can specify that your packages come
by default from one distribution but you can override this with packages
from other distributions. The concept is called pinning and after it is set up
you can have, for example, testing as your default release and then include
unstable in /etc/apt/sources.list and install cdrecord from unstable with:
Package: *
Pin: release a=testing
Pin-Priority: 900
Package: *
Pin: release o=Debian
Pin-Priority: -10
149
6.0.16
To set up a local debian cache of deb files that youve created or downloaded
separately:
#
#
#
#
>
mkdir -p /usr/local/cache/dists/local/local/binary-i386
cp *.deb /usr/local/cache/dists/local/local/binary-i386
cd /usr/local/cache
dpkg-scanpackages dists/local/local/binary-i386 /dev/null \
dists/local/local/binary-i386/Packages
6.0.17
Reconfigure Packages
(dpkg-reconfigure
debconf)
An alternative where you can specify a particular front end to use for the
configurator is:
# dpkg-reconfigure --frontend=dialog debconf
6.0.18
(ls /etc/alternatives/)
150
6.0.19
Bugs
If you find a problem with your system and think it might be a bug, use the
reportbug package to check it out. This package will allow you to view bugs
recorded against packages and also allow you to add a new bug report to the
Debian bug reporting system.
Otherwise visit the Debian email lists at http://lists.debian.org/ and
search for the problem there. The advice one gets here is generally of high
quality.
In the following sections I identify a number problems or issues that Ive not
yet resolved for some of my installations.
6.0.20
In addition to managing the installed packages wajig also allows you to start,
stop, reload , and restart services (which are often provided by so called
daemonsprocesses that run on your computer in the background performing various functions on an on-going basis). The commands all follow the
same pattern:
(/etc/init.d/<service> restart)
The start and stop commands are obvious. The restart command generally
performs a stop followed by a start. The reload command will ask the daemon
to reload its configuration files generally without stopping the daemon, if
this is possible. The services you can specifiy here depend on what you have
installed. Common services include:
apache
cron
exim
gdm
ssh
Web server
Regular task scheduler
Email delivery system
The Gnome Windows Display Manager (for logging on)
The Secure Shell daemon
6.1
151
Other Commands
In this way you are able to leave the download unattended and when you are
ready you can monitor the unpacking and setup.
If things go wrong somewhere the apt may be able to help. The apt-get
fix-broken will do its best:
# apt-get --fix-broken dist-upgrade
but if things still dont work, you may need to use dpkg directly to remove
and isntall packages.
6.1.1
The apt method within dselect and the apt-get command (which the apt
mathod uses) place all downloaded files into /var/cache/apt/archive. You
can then use the apt-move command to move the archived files into a local
hierarchy that mirrors a standard distribution hierarchy. Then you can point
apt-get to this local archive by pointing to it from /etc/apt/sources.list
using the file:// format. You can also give the option apt-getdownloadonly to apt-get to download but not unpack nor install the package.
To set up a local machine as a local (partial) mirror of the Debian archive,
first install apt-move:
$ wajig install apt-move
152
APTSITES="mirror.aarnet.edu.au_pub_debian
ftp.debian.org_debian
non-US.debian.org
security.debian.org"
Then remove all architectures not of interest from the ARCHS variable and
DIST:
ARCHS="i386 sparc"
DIST=unstable
The apt-move command is then used to install any packages in your /var/
cache/apt/archives into the Debian mirror being created:
# apt-move update
These commands place the mirror into /mirrors/debian. To make it available on your web server simply:
# cd /var/www
# ln -s /mirrors pub
All of this might happen on your server, yet your server is not likely to be the
most up to date machine. Suppose your experimental machine (always kept
up to date) is Inco (Section 4.10.24). You can rsync all packages in /var/
cache/apt/archives on Inco (Section 4.10.24) to your sever (e.g., Altrop),
then on Altrop run apt-move (and also remove the original files from the
archive on Inco (Section 4.10.24)):
153
6.1.2
The package system maintains a list of all packages installed (and de-installed).
You can access this list, save it to a file, and use it to mark those same packages for installation (or deinstallation) on anther machine:
# dpkg --get-selections > dpkg-selections
# dpkg --set-selections < dpkg-selections
# apt-get dselect-upgrade
6.2
Package Information
The dpkg and apt-get commands are pretty useful and provide a lot of functionality. Heres some common things that you may want to do:
Search for the package that installed the file diff.info.gz
$ dpkg --search diff.info.gz
[alternative is -S]
[alternative is -l]
List the information for any package with diff in its name
$ dpkg --list *diff*
154
6.3
Alternative Applications
Debian has a mechanism for dealing with applications that provide the same
functionality. We describe here how this mechanism works and how you can
use it to tune your installation.
If you have more than one variant of emacs installed (e.g., emacs19, emacs20,
and xemacs) then you can configure which one you get by default with:
$ wajig updatealts emacs
Suppose the window-manager you want to use as the default is not listed as
available. You can install it with:
# update-alternatives --install /usr/bin/x-window-manager \
x-window-manager /usr/bin/mywm PRIORITY
155
Where PRIORITY is a number higher than the highest existing priority for
the x-window-manager alternative. You can get a list of priorities with:
6.4
156
6.5
Ive packaged up a tool Ive written called wajig which is a simplified front
end to the APT and DPKG suite of tools. It is a python program. I use
autoconf to manage the configuration.
I turned the tool into a Debian package using the steps outlined below.
A useful resource for this is the Debian Policy Manual at http://www.
debian.org/doc/debian-policy/
6.5.1
157
Next time you ./configure the new Makefiles and source code will contain
the updated information.
$ ./configure
configure.in
dnl Process this file with autoconf to produce a configure script.
AC_INIT(src/wajig.py)
PACKAGE=wajig
VERSION=0.1.1
158
AC_PATH_PROG(PYTHON, python)
AC_SUBST(PYTHON)
AC_SUBST(PACKAGE)
AC_SUBST(VERSION)
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_PROG_CC
AC_OUTPUT(Makefile src/Makefile src/const.py wajig.sh)
6.5.2
The first task is to set up the information required for the Debian packaging
system. Extract the distribution:
to create the wajig-0.1.1 subdirectory. Change into this directory and then
run dh make to set things up for Debian:
$ cd wajig-0.1.1
$ dh_make -e [email protected] -f ../wajig-0.1.1.tar.gz
You will be asked what kind of package to create and since wajig is a single
binary package we choose s.
This has now created a debian subdirectory and copy of the original distribution in ../wajig-0.1.1.orig.
Now edit the files in the debian subdirectory to tell Debian the appropriate
information about the package.
159
control
copyright
changelog
rules
docs
Other Files
6.5.3
Now you are ready to build and check the new package:
$ dpkg-buildpackage -rfakeroot
$ cd ..
$ lintian -i wajig_0.1.1-1_i386.changes
6.5.4
Once the package is correctly built load it onto your Debian archive to provide
it for others to access:
$
$
$
$
$
$
$
cp wajig_0.1.1* /var/www/debian/
cd /var/www/debian/
chmod go+r wajig_0.1.1*
apt-ftparchive packages . > Packages
apt-ftparchive sources . > Sources
gzip -c Packages > Packages.gz
gzip -c Sources > Sources.gz
160
If you are a Debian developer you would upload the package directly to the
Debian archives using the dupload tool instead of onto your own archive.
6.5.5
cd ../wajig-0.1.2
dpkg-buildpackage -rfakeroot
cd ..
lintian -i wajig_0.1.2-1_i386.changes
cp wajig_0.1.2* /var/www/debian/
cd /var/www/debian/
chmod go+r wajig_0.1.2*
apt-ftparchive packages . > Packages
apt-ftparchive sources . > Sources
gzip -c Packages > Packages.gz
gzip -c Sources > Sources.gz
161
dch -i
dpkg-buildpackage -rfakeroot
cd ..
lintian -i wajig_0.1.2-2_i386.changes
cp wajig_0.1.2* /var/www/debian/
cd /var/www/debian/
chmod go+r wajig_0.1.2*
apt-ftparchive packages . > Packages
apt-ftparchive sources . > Sources
gzip -c Packages > Packages.gz
gzip -c Sources > Sources.gz
162
Chapter 7
Audio
GNU/Linux provides tools for listening to, recording, and modifying audio.
Recording audio CDs is discussed in Section 14.3. Making sound recordings
and mixing is covered in Chapter 78. To extract audio from your DVD see
Section 87.2.3.
In this chapter we talk about setting up of audio chips under GNU/Linux,
and tools for manipulating audio files.
7.1
Use the Debian package sndconfig to automatically identify your audio chip
and to add this information to /etc/modutils/sndconfig.
If the audio device is not supported then you will probably need to get a
newer kernel. Suppose you has an i810 audio chip (82801DB AC97). Get
this information from the lspci command:
> lspci
...
00:1f.5 Multimedia audio controller: Intel Corp. 82801DB AC97
...
164
7.2
Audio
If you notice that a user starts up Gnome and receives a message about Audio
not working the likely cause is that the user is not in group audio (as no users
are in group audio by default). You need to:
# adduser kayon audio
Next time user kayon logs on they will be able to use the audio device.
7.3
Information about an audio file can be stored as part of the audio file itself
(at least in OGG or MP3 format). This can include track titles, artists,
album titles, genre, and more. You can view the information using the
vorbiscomment command:
> vorbiscomment -l track05.ogg
title=Mother
artist=Roger Waters
album=In The Flesh - Live
tracknumber=5
genre=Rock
Other useful tools for editting the audio information includes the terminalbased orpheus (not currently packaged for Debian as of 11 March 2004).
Chapter 8
AbiWord: Word Processor
Debian Pacakges: abiword
The Gnome Office Suite offers AbiWord for word processing. AbiWord can
import and export Micorsoft Word documents with quite a respectable degree
of compatibility. But for starting new documents it is a very good choice.
AbiWord is lightweight in terms of features when compared to Microsoft
Word but it has the features that 90% of the users need!
AbiWord is also distinguished by the fact that it runs on very many platforms,
including MS-Windows, BeOS (for both PPC and Intel hardware), Linux
(Intel, PPC and Alpha), FreeBSD, Solaris, AIX, SGI Irix, NetBSD, and
QNX. Because of its light weight use of computer resources (compared to
Microsoft Word) AbiWord is even popular on the MS-Windows platform.
The AbiWord user interface is very intuitive and in no time you will be
producing the documents you want. If you are familiar with Microsoft Word
then the AbiWord interface will be very familiar.
8.1
Export to LaTeX
A very useful feature of AbiWord is its export to LATEX. It does quite a good
job in generating a representation in LATEX.
165
166
Chapter 9
APM: Power Management
Advanced power management (APM) is supported by the kernel1 but because some older machines have problems with it some Debian kernels have
it turned off by default. Thus, when you poweroff your machine (e.g., by
poweroff) the machine does not automatically power down.
To turn on apm, if apm is compiled into the kernel (i.e., not a module) then
simply add the following to the kernel configuration (often in /etc/lilo/
conf, assuming you are using lilo to boot your machine):
append="apm=on apm=power-off"
If you have apm as a module then use the following when you load the
module:
# modprobe apm power_off=1
Current Debian kernels have CONFIG APM as a module but CONFIG APM DO ENABLE is not set.
167
168
CONFIG_APM=y
CONFIG_APM_DO_ENABLE=y
CONFIG_APM_CPU_IDLE=y
CONFIG_APM_DISPLAY_BLANK=y
CONFIG_APM_RTC_IS_GMT=y
CONFIG_APM_IGNORE_MULTIPLE_SUSPEND=y
CONFIG_APM_IGNORE_SUSPEND_BOUNCE=y
A suspend while connected to power within a docking station does not seem
to suspend the machine completely. It sends it to sleep but it does not beep
and power down.
Some useful commands related to rebooting are:
# poweroff
# reboot
After installing the apmd package the suspend maintains the clock correctly
between a suspend and a resume. (Although I seem to be losing a few seconds
each time.)
Note that a suspend will disconnect your modem!
169
PROBLEMS When you eject the laptop from a docking station while running an X session it does not come back properly when the laptop is reinserted
into a docking station. Sometimes the display is half off the screen. Sometimes simply get streaks across the screen. If this happens, you can go back
to a console as usual with CTRL-ALT-F1, or exit from the X session with
CTRL-ALT-BACKSPACE. If you eject while running an X session and open the
laptop lid you will not get the proper display, and may damage the display.
It can also freeze the laptop.
Suspend maintains RAM with the battery. Hibernate saves everything to
disk. Standby powers down disks and the lcd display.
170
Chapter 10
Backup
Computers crash, disks become corrupt, data is lost, security is compromised.
Today computers are pretty reliable and it is rare to lose data but it can
happen and usually when it is most inconvenient! Important work should
always be backed up.
In this chapter we review approaches to backup. We begin with a simple approach which uses another backed up host on a network that you can access.
In this approach you simply copy files across to that other host. This is useful
in an environment where you often work from home and have a good backup
system in the office. The second approach uses the commercial backup system called Legato NetWorker (also known as the Solstice NetWorker).
10.1
171
172
Backup
LOGFILE="/root/BACKUP.log"
RSYNC="/usr/bin/rsync"
DEST="[email protected]:backup/$(/bin/hostname)"
OPTS="--rsh=ssh --cvs-exclude --archive --compress "
OPTS=${OPTS}"--delete --delete-excluded --verbose"
INCFILE="/etc/backup.include"
echo "===================================================" >> ${LOGFILE}
date >> ${LOGFILE}
echo "$RSYNC $OPTS --include-from ${INCFILE} / ${DEST}" >> ${LOGFILE}
$RSYNC ${TESTING} $OPTS --include-from ${INCFILE} / ${DEST} >> ${LOGFILE}
date >> ${LOGFILE}
echo "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^" >> ${LOGFILE}
173
/home
/root
/usr/local
/var/mail
/var/backups
And exclude everything else
/*
Since this is using ssh (OpenSSH, ssh protocol 2) and it is a cron job (i.e.,
you can not supply a password or passphrase), create a ssh public key for
adding to kayon@caravans authorized keys file:
modena# ssh-keygen -t dsa -N ""
Generating public/private dsa key pair.
Enter file in which to save the key (/root/.ssh/id_dsa):
Your identification has been saved in /root/.ssh/id_dsa.
Your public key has been saved in /root/.ssh/id_dsa.pub.
The key fingerprint is:
ce:b3:e5:82:ab:72:3d:50:2e:96:65:e0:15:a3:4e:de root@velox
modena# scp .ssh/id_dsa.pub [email protected]:.ssh/authorized_keys.n
modena# ssh kayon@caravan
caravan$
caravan$
caravan$
caravan$
cd .ssh
cat authorized_keys.n >> authorized_keys
rm authorized_keys.n
exit
10.2
Legato NetWorker
174
Backup
To install the client software and the manual pages (available as Red Hat
packages) on your Debian workstation mount the supplied CD-ROM (which
might be called the Solstice Backup 6.1: Servers, Clients and Storage Nodes,
Volume 1 ) and then:
$ wajig rpminstall /cdrom/LINUX86/LGTOclnt/lgtoclnt-6.1-1.i386.rpm
$ wajig rpminstall /cdrom/LINUX86/LGTOman/lgtoman-6.1-1.i386.rpm
175
;;
*)
echo "usage: basename $0 {start|stop|restart|force-reload}"
exit 1
;;
esac
exit 0
Make sure it is executable:
# chmod a+rx /etc/init.d/networker
Now you can start the daemon and check that it is running (you will get 2
nsrexecds running):
> wajig start networker
> ps uaxxc | grep nsr
root 3275 0.0 0.0 2356 564 ? S Oct10 0:00 nsrexecd
root 3285 0.0 0.0 2496 1020 ? S Oct10 0:00 nsrexecd
To have the daemon start and stop at boot and shutdown time create the
following symbolic links:
#
#
#
#
cd
ln
cd
ln
/etc/rc2.d
-s ../init.d/networker S95networker
/etc/rc0.d
-s ../init.d/networker K05networker
Note that in the init script above reference is made to nsrhost. This is the
host name of the backup server (on the local network it might actually be
called nsrhost). Replace this with the host name of your own backup server.
Now to recover a file run the graphical interface nwrecover.
176
Backup
Chapter 11
Command Line: Bash
When Bash is invoked as an interactive login shell it first reads and executes
commands from the file /etc/profile, if that file exists. After reading that
file, it looks for ~/.bash\_profile, ~/.bash\_login, and ~/.profile, in
that order, and reads and executes commands from the first one that exists
and is readable. When a login shell exits Bash reads and executes commands
from the file ~/.bash\_logout, if it exists.
177
178
Chapter 12
Booting
Booting is simply the process of starting up the system when the computer is
powered on. The computers BIOS (the Basic Input/Output System which
is programmed into the hardware of the computer) takes charge and decides
what is to be done. Usually the BIOS first runs a Power-On-Self-Test (POST)
and then looks for boot information which typically resides in the Master
Boot Record (MBR) of the hard drive (or in general the boot sector of any
available device).
For a GNU/Linux system the MBR contains a boot loader like lilo of grub.
These will give you choices of operating systems to boot whenever you reboot
your computer. To install a boot loader you will either overwrite the master
boot record with one that will start up lilo, or, for MS-Windows/NT, you will
add extra information in a configuration file to identify, for MS-Windows/NT,
how to boot into GNU/Linux. The grub boot loader is quite a bit more
flexible than LILO and is often a good choice.
Lilo is the traditional GNU/Linux boot manager (and silo is the boot manager for Sparc GNU/Linux). A newer alternative that may replace lilo is the
GNU grub (GRand Unified Bootloader). Grub can be set up to automatically identify newly installed kernels, making the installation of new kernels
quite straightforward. Another emerging alternative is xosl, the extended OS
loader.
If you are using a GNU/Linux boot loader such as Grub then the Grub
code will be loaded into memory and executed. Grub takes on the task of
then loading an operating system, such as the GNU/Linux kernel. More
information about the process is available from http://www.tldp.org/LDP/
179
180
Booting
sag/index.html.
In this chapter we also explore issues around dual booting. See Chapter 45
for what happens once the Linux kernel starts booting.
12.1
Lilo
Lilo can be installed into the Master Boot Record (MBR) or as the first
part of some other disk partition. That is, you have the choice of the BIOS
starting up lilo or some other program in your MBR. The MBR program that
cames with Debian is installed when you run the command install-mbr. To
overwrite the part of lilo that is installed on the MBR you simply install
something else in the MBR!
When lilo overwrites the MBR it keeps a copy of the old MBR in case you
find you need to restore it for any reason.
12.1.1
Large Disks
On Velox (Section 4.10.26) lilo fails because the disk is too big. Use lilo
-L (or add lba32 to /etc/lilo.conf), then:
# lilo -L
Added 2.2.18pre21 *
# dd if=/dev/sda of=/root/bootsect.lnx bs=512 count=1
# mcopy /root/bootsect.lnx a:
# lilo -u /dev/sda
# reboot (into NT)
12.1.2
Kernel Images
Note that new kernel images go into /boot/vmlinux. The old is put into
/boot/vmlinux.old. Thus you can have a /etc/lilo.conf like:
181
image=/vmlinuz
label=linux
root=/dev/hda2
image=/vmlinuz.old
label=linux.old
root=/dev/hda2
Note also that /vmlinux is a symbolic link into the actual file stored in /boot.
12.2
This creates a /boot/grub/menu.lst file which you might like to review just
to make sure it looks okay. For most simple situations it should be fine.
For a dual boot with MS-Windows/NT on the first partition and Linux on the
second (like Mint), you may need to change the default locations of Linux.
Look at /boot/grub/menu.lst to see if the following two lines have been
changed:
182
Booting
# kopt=root=/dev/hda1 ro
# groot=(hd0,0)
to
# kopt=root=/dev/hda2 ro
# groot=(hd0,1)
Windows NT
(hd0,0)
+1
If you start having problems booting, at the grub menu type c to get the
command line. Try:
root (hd0,4)
(/dev/hda5)
kernel /boot/vmlinuz-2.4.18-bf2.4 root=/dev/hda5 ro
boot
12.3
183
Secure Boot
12.4
Some operating systems, including MS-Windows, provide limited and sometimes inflexible support for multiple choices at boot time. GNU/Linux, on
the other-hand, is well-equipped for booting multiple operating systems as
is its philosophy of not restricting what one can do and encouraging choice
and freedom.
If you want to include MS-Windows on your system it is generally best to
install it first. MS-Windows/NT, for example, has a boot loader that likes to
be in control and MS-Windows/98 is not so clever with multiple operating
systems. Installing them first allows them to have the control they sometimes
demand.
GNU/Linux provides a variety of tools for maintaining multiple operating
systems on your one computer. There are plenty of options. In particular
you can keep MS-Windows and install GNU/Linux as well. This will give
you some sense of security in case GNU/Linux does not meet your needs.
If GNU/Linux becomes your choice you can later remove MS-Windows and
use the recovered disk space for GNU/Linux.
Dual boot is a little misleading since theres really no inherent limit (except
for available resources) to the number of operating systems you might install
on your PC. Generally its two or sometimes three, but could be four or more!
These might include MS-Windows/2000, MS-Windows/XP, and one or two
versions of GNU/Linux!
12.4.1
MS-Windows/NT has its own boot loader that likes to be in charge. Thats
okay. One solution is to simply tell the MS-Windows/NT boot loader what to
do if you want to boot into GNU/Linux. This means copying the GNU/Linux
boot code into a file, transferring that file to a MS-Windows/NT partition,
and then adding a menu item for the MS-Windows/NT boot loader to select
the GNU/Linux boot if required. Using grub we dont need to do this as
184
Booting
grub supports chain loaders that allows you to choose to load up the MSWindows/NT boot loader.
If you wish MS-Windows/NT to remain in control, the do the following:
Boot from floppy disk into GNU/Linux. Log in as the root user. Check
where the boot sector of your GNU/Linux partition is:
# rdev /vmlinuz Root device /dev/hdc1
So on this particular machine the boot sector is on the second hard drive
(/dev/hdc).
When installing dont let lilo install a boot loader over the existing master
boot record on your hard drive (usually /dev/hda) unless you wish to wipe
out the original NT For dual boot using the MS-Windows/NT boot loader
see the http://www.tldp.org/HOWTO/Linux+NT-Loader.html Linux with
NT Loader mini HOWTO, but I detail the steps below. Use LILO You then
copy the Linux boot sector to floppy disk, reboot to NT, and copy the Linux
boot sector onto the NT hard disk. The NT boot loader is then told where
to find the file (edit C:\boot.ini). It is all very clearly documented in the
above mini HOWTO. On bootup you can then choose between GNU/Linux
and Windows NT.
# editor /etc/lilo.conf
root=/dev/hdc
boot=/dev/hdc
append="hdc=13424,15,63"
# /sbin/lilo
Warning: /dev/hdc1 is not on the first disk
Added Linux *
# dd if=/dev/hdc1 of=/root/bootsect.lnx bs=512 count=1
# mcopy /root/bootsect.lnx a:
# reboot (into NT)
C:\>copy a:\bootsect.lnx c:\bootsect.lnx
C:\>attrib -s -r c:\boot.ini
C:\>notepad c:\boot.ini
[boot loader]
timeout=30
default=C:\bootsect.lnx
[operating systems]
C:\bootsect.lnx="Linux"
multi(0)disk(0)rdisk(0)partition(1)\WINNT="Windows NT Workstation ...
multi(0)disk(0)rdisk(0)partition(1)\WINNT="Windows NT Workstation ...
185
C:\>attrib +s +r c:\boot.ini
C:\>reboot (into Linux)
Note the inclusion of the append line above in my lilo.conf. This ensures
/dev/hdc is found. Otherwise, sometimes it is not.
After you install a new kernel under Linux (either from a kernel-image package on the Debian archive or else your own compiled kernel-image) you will
need to rerun LILO. By default lilo.conf identifies the image to boot as /vmlinuz. This is a symbolic link to, for example, /boot/vmlinuz-2.0.36.
12.4.2
12.5
MS-Windows/NT or MS-Windows/2000
186
Booting
boot=/dev/hda
root=/dev/hda2
Run lilo:
# lilo
Added 2.2.18 *
After running lilo (if you overwrite the master boot recordMBR) you can
no longer boot into MS-Windows/NT immediately. But, lilo stores a backup
MBR in /boot/boot.0300, so dont despair. Copy the lilo boot sector to file
then restore the MS-Windows/NT MBR using lilo -u.
The recipe is:
# dd if=/dev/hda of=/root/bootsect.lnx bs=512 count=1
# mcopy /root/bootsect.lnx a:
# lilo -u /dev/hda
# reboot (into NT)
C:\>copy a:\bootsect.lnx c:\bootsect.lnx
C:\>attrib -s -r c:\boot.ini
C:\>notepad c:\boot.ini
[boot loader]
timeout=5
default=C:\bootsect.lnx
[operating systems]
C:\bootsect.lnx="Debian GNU/Linux"
multi(0)disk(0)rdisk(0)partition(1)\WINNT="Windows..."
multi(0)disk(0)rdisk(0)partition(1)\WINNT="Windows..."
C:\>attrib +s +r c:\boot.ini
C:\>reboot (into Linux)
12.6
You dont need to use any special boot programs if you are not comfortable
with the process of using a boot loader and modifying the computers master
boot record. Instead, all you need is to boot GNU/Linux from a boot floopy
that will be created when you install GNU/Linux. You simply insert the
187
floppy whenever you boot your computer into GNU/Linux and make sure it
is not inserted if you want to boot into the original operating system. Booting
from floppy is a little slower than booting from hard disk but otherwise
functionally equivalent.
188
Booting
Chapter 13
Cameras
Debian Pacakges: gphoto2
13.1
See Section 86.1.1 for information on setting up the camera through a USB
connection.
One time after deleting photos from the camera after mounting the camera
as a USB Mass Storage Device and deleting all photos the camera thought
it had no memory left and yet knew that it had no photos! Had to reformat
the memory!
13.2
Accessing Photos
Use gphoto2:
# gphoto2 --get-all-files
189
190
Cameras
Chapter 14
CD-ROM
A clean install of Debian GNU/Linux is most likely to find your CD-R, CDRW, and DVD drives without the need for you to do anything. If not, then
see Section 14.1. The simplest way to burn a CD is with the Naultilus CD
Creator described in Section 59.3. Other approaches are details below.
14.1
Setup
To make use of a CD-ROM device you need to know what device it is mapped
to. Lets assume it is /dev/hde (but look through the output of the dmesg
command to see which it is). If the device /dev/hde does not exist (for
modern versions of Debian it usually does exist as the devices where identified
at boot) you will need to create it with MAKEDEV as root:
# cd /dev
# ./MAKEDEV hde
192
CD-ROM
If users can not mount the CD-ROM device then they probably dont have the
right permissions. To allow general access to the CD-ROM edit /etc/fstab
to add the following line.
/dev/cdrom
/cdrom
auto
defaults,noauto,users,ro,nohide
0 0
Any user can then mount and unmount /cdrom, irrespective of who mounted
it. Also note that the standard CD-ROM format is iso9660 and the auto in
the above could have been this. However, as DVDs become more common
using auto allows the udf format to also be recognised with no extra effort.
The Gnome mount applets allow a user to mount and unmount the CDROM. Make sure you unmount the CD-ROM before you physically remove
the media. (For most drives the eject button is disabled while the CD is
mounted.)
The various options in the /etc/fstab line above are: ro which mounts the
file system as read-only; users which lets all users mount and unmount the
file-system; noauto which means that the file-system is not automatically
mounted at boot time; and nohide which shows hidden and associated files.
With the above entry in /etc/fstab the command line mounting of the
partition becomes:
# mount /cdrom
By default the CD-ROM device belongs to group disk. For audio CD access
the user will need to be a member of the group to which the device belongs.
But do not add users to the group disk because this will give them read/write
access to raw devices for all disks meaning that they can directly read the
bits off the hard disk and effectively ignore file system permissions. Instead
change the Unix group of /dev/hde from disk to cdrom and add users who
need access to the drive to the group cdrom:
# chgrp cdrom /dev/hde
# adduser kayon cdrom
14.1 Setup
193
Next time user kayon logs on they will be in group cdrom in addition to
the other groups they were already in. They will then have access to the
CD-ROM device.
14.1.1
CD writing software for GNU/Linux (prior to kernel 2.6) targets SCSI devices, so you will need to install appropriate drivers so that your ATAPI IDE
CD-RW (and your CD-R/DVD if you wish) pretends to be a SCSI device.
It will then be identified as /dev/scd0 rather than /dev/hdd.
Turning a IDE CD-RW into a SCSI CD-RW is pretty straightforward. First
ensure the appropriate kernel modules are loaded (you need sg and ide-scsi ).
Use the command lsmod to list the modules currently loaded in the kernel,
and the commands modconf or insmod to load the modules. If you already
have the drive under the control of ide-cd then you need to get rid of it (as
below).
You can ensure these happen at boot time, and the appropriate dependencies
between kernel modules are identified, by creating /etc/modutils/cdrw:
#
# As suggested in CD Writing HOWTO
#
# This assumes IDE-CD is a module rather than copmiled into kernel.
#
options ide-cd ignore="hdc hdd"
alias scd0 sr_mode
pre-install sg
modprobe ide-scsi
pre-install sr_mod
modprobe ide-scsi
pre-install ide-scsi
modprobe ide-cd
Note here that we are telling the IDE CD module to ignore the disk which
we want the ide-scsi module to handle. The ide-scsi module wont touch any
disks already being driven. Change the hdd to the appropriate one of hda,
hdb, hdc, or hdd. To check which one to ignore look through the output of
the dmesg command for the CD-RW line which identifies the driver, which
on Altrop (Section 4.10.20) is:
hdd: ATAPI 40X CD-ROM CD-R/RW drive, 2048kB Cache
194
CD-ROM
Thus ide-cd should ignore hdd. If you want all CD drives to be SCSI (useful
for some cases like cdrdao when asked to copy a disk) then dont include
either of the lines that mention ide-cd!
Now update the modules.conf file with:
# update-modules
Finally, tell the kernel to load the modules at boot time by adding the following to /etc/modules
sr_mod
sg
ide-cd
You will now probably need to reboot to have the new configuration take
effect. Also, dont include ide-cd if you want all your drives recognised as
SCSI.
Once set up cdrecord can be used to identify the SCSI device on which the
CD writer sits:
For example, on Mint (Section 4.10.27) the device is 0,1,0. The LG CD-RW
CED-8080B 1.04 on this host is identified using:
# cdrecord -scanbus
scsibus0:
0,0,0 0) _NEC
DV-5700A
3.07 Removable CD-ROM
0,1,0 1) LG
CD-RW CED-8080B 1.04 Removable CD-ROM
On Velox (Section 4.10.26) the device is 2,0,0. The SONY CD-RW CRX140E
on this host is identified using:
# cdrecord -scanbus
scsibus0:
0,0,0
0) QUANTUM ATLAS10K2-TY184L DA40 Disk
scsibus2:
2,0,0 200) SONY CD-RW CRX140E 1.0n Removable CD-ROM
14.1 Setup
195
Altrop (Section 4.10.20) and Velox (Section 4.10.26) have DVD drives (which
remain as IDE devices as /dev/hdc) and a CD-RW writer (which with the
above set up becomes /dev/scd0). Mint (Section 4.10.27) also has two drives
but both are run as SCSI devices.
If you are having problems with CD drives being found try adding ide-probe-modbefore
ide-scsi in /etc/modules.
A line that someone suggested to be added to lilo.conf:
append = "apm=on apm=power-of idebus=N hdc=ide-scsi hdd=ide-scsi max_scsi_luns=1"
14.1.2
Incx (Section ??), a laptop, has a CD-ROM located in the Docking Station.
You will need a recent version of the kernel (at least post 2.2.15) so that it
will be recognised on boot, displaying the following message:
CMD646: IDE controller on PCI bus 01 dev 28
CMD646: chipset revision 0x03, MultiWord DMA Force Limited
CMD646: 100% native mode on irq 10
ide2: BM-DMA at 0xfcc0-0xfcc7, BIOS settings: hde:pio, hdf:pio
ide3: BM-DMA at 0xfcc8-0xfccf, BIOS settings: hdg:pio, hdh:pio
...
hde: TOSHIBA CD-ROM XM-1802B, ATAPI CDROM drive
...
ide2 at 0xfcf8-0xfcff,0xfcf2 on irq 10
..
hde: ATAPI 24X CD-ROM drive, 128kB Cache
Uniform CDROM driver Revision: 2.56
14.1.3
LG CED-8080B Problems
On Mint (Section 4.10.27) this hardware seems to have some bad firmware.
Others report a similar problem and yet others say they have no problem at
all. If I knew how to obtain an update to the firmware and how to install
it, no doubt it would all work! The problem is only for writing TAO. DAO
seems just fine.
196
CD-ROM
Bill Unruh ([email protected]), posting on comp.os.linux.misc in January 2001, had the same problem with a 8080B compatible and mentioned
that it works okay in DAO mode but not TAO. This is expected to be a
transient problem as the driver catches up with the drive.
14.1.4
Under Debian, cdrecord version 1.10a18 was compiled with kernel version
2.4.x which has some incompatibilities with kernel version 2.2.x, resulting in
an error in trying to mmap on /dev/zero.
The typical scenario is:
# cdrecord -dummy -v dev=2,0,0 -data test.iso
Cdrecord 1.10a18 (i686-pc-linux-gnu)
Copyright (C) 1995-2001 Jorg Schilling
TOC Type: 1 = CD-ROM
cdrecord: Invalid argument.
Cannot get mmap for 4198400 Bytes on /dev/zero.
and again:
14.2 CD Software
197
# mkisofs -r cdr/ | cdrecord speed=8 dev =0,1,0 tsize=281056s -data Cdrecord 1.10a18 (i686-pc-linux-gnu) Copyright (C) 1995-2001 Jorg Schilling
cdrecord: Invalid argument. Cannot get mmap for 4198400 Bytes on /dev/zero.
or
$ wajig build cdrtools
14.2
CD Software
Once you have set up your CD-R, CD-RW, or DVD driver you may be
interested in packages like cdrecord, cdrdao, mkisofs, cdmaster, and videodvdrip.
14.2.1
cdrdao
The cdrdao package provides, by far, the simplest interface for burning CDs.
By default cdrdao must be run as root, which is best set up for users through
the use of sudo. If you trust all with access to your machine the you may
want to allow anyone to run the program:
# chmod u+s /usr/bin/cdrdao
The first step is then to find out where on the scsi bus your CD writer is and
cdrdao does this with:
198
CD-ROM
$ cdrdao scanbus
Then create /home/kayon/.cdrdao, or /etc/default/cdrdao, with the following contents (replacing the 0,0,0 with your SCSI device address as identified by cdrdao scanbus, and the driver with the appropriate one for your
CD writer - see the cdrdao man pages):
write_device: "0,0,0"
write_driver: "generic-mmc"
The following cdrdao commands can be specified on the command line without the need to identify the device each time:
show-toc
toc-info
toc-size
read-toc
read-cd
read-cddb
show-data
read-test
disk-info
msinfo
unlock
blank
scanbus
simulate
write
copy
14.2.2
gcdmaster
Gcdmaster provides a Gnome GUI for cdrdao. For cdrdao be sure to create
the following link:
# cd /dev
# ln -s cdrw cdrecorder
But gcdmaster failed for some reason (after cdrdao read the CD and then
requested a RETURN!) and so why not just use the command line to copy
a CD as described below!
14.3 CD Audio
14.2.3
199
xcdroast
14.2.4
MP3 Encoders
MP3 encoders are entwined in legal issues that are too complex to get into
here. Recording your personal CDs to listen to the music youve already paid
for appears reasonable.
The encoder of choice is call lame. The Debian package is available at
http://hive.me.gu.edu.au/ and the source is also at http://www.sulaco.
org/mp3/.
The issue with MP3 is that the MP3 codec is patented by Fraunhofer in
Germany, and a license is required to use it. To address this a free audio
format has been developed called Ogg Vorbis. There are many utilities that
will rip CDs to Ogg Vorbis format.
14.3
CD Audio
14.3.1
Because Mint (Section 4.10.27) has no working cdrecord (at least for recording
audio) we need to use cdrdao. The cdrdao package can be used to duplicate
both data and audio CD-ROMs.
To directly record an audio CD (or a data CD) from the SCSI device then
burn it on the same device using cdrdao, add the following to /home/kayon/.cdrdao
200
CD-ROM
(replace the 0,1,0 with your SCSI device address as identified by cdrecord
-scanbus, and the driver with the appropriate one for your CD writer):
write_device: "0,1,0"
write_driver: "generic-mmc"
Then:
$ cdrdao copy
Youll be asked to insert a new CD-R once the reading is complete and it is
ready to write.
The use of the .cdrdao file is simply to avoid having to specify the command
line options of cdrdao which require --device and --driver.
If you have both a CD drive (or perhaps a DVD drive) and a CD writer both
as SCSI devices (see Section 14.1) then you can use cdrdao to record direct
from the reader to the writer:
$ cdrdao copy
The read-cddb will look up the CDDB web database to find track information for the audio CD and generates a suitable table of contents that will be
written to the CD-R if the CD writer supports CD-TEXT.
To just create a table of contents for an audio disk:
$ cdrdao read-toc --device 0,1,0 --driver generic-mmc audiocd.toc
14.3 CD Audio
201
14.3.2
On Altrop (Section 4.10.20) and Festival (Section 4.10.11) we can use cdrecord
(which fails on Mint (Section 4.10.27)) to duplicate an audio CD in Disk
At Once mode. The SCSI device for the CD-RW is 1,1,0 on Altrop (Section 4.10.20) and 0,0,0 and Festival (Section 4.10.11).
First extract the audio from the source CD into individual WAV files:
# cdda2wav -v255 -D /dev/hdc -B -Owav
Using cdrecord to record Track At Once mode (with a resulting 2 second gap
between each track)
# cdrecord -v speed=4 dev=0,1,0 -pad -audio -dummy *.wav
14.3.3
202
CD-ROM
#!/bin/sh
for i in *.mp3; do
if [ ! -e $(basename $i .mp3).cdr ]; then
mpg123 --cdr - $i > $(basename $i .mp3).cdr;
fi
done
printf "CD_DA\n" > disk.toc
for i in *.cdr; do
printf "TRACK AUDIO\nFILE \"$i\" 0\n" >> disk.toc
done
printf "\n========== disk.toc ==================\n"
cat disk.toc
printf "========================================\n"
printf "\n>>>>>>>> Now run \"cdrdao write disk.toc\" <<<<<<<<<<\n"
Then the following two steps will convert all mp3 files in the current directory
to cdr, then burn them to a CD-R or CD-RW. If you want to change the
order of the tracks, simply edit disk.toc.
> mkcdrtoc
> cdrdao write disk.toc
14.4
203
204
CD-ROM
Figure 14.2: Here grip is configured to query the Free CD database server to
find information about the CD. If this query fails then the non-free database
is searched. If the CD information is found in the non-free database and
not in the free database you will given the opportunity to update the free
database with the information.
205
Now we are ready to rip and encode an audio CD. Insert your CD into the
CD-ROM drive.
The Tracks tab should list the available tracks. If what you get is a list
like that in Figure 14.4 then for some reason the information is not available
(probably because you are not connected to the internet or the CD is not
know to the databases). In this case, enter the information yourself. This is
useful because the information is then recorded in the MP3 file as the ID3
tag. This is used by various MP3 players to display track information. To
enter the information yourself click on the Toggle disk editor button (the
pencil icon along the bottom row of buttons). This will open up an area
for you to enter the relevant information (see Figure 14.4). Once you have
enetered the information be sure to share it by clicking on the Submit disc
info button with the letter icon.
Figure 14.4: Grip is unable to find the information for this disk.
Next select the tracks you wish to encode. Click in the Rip column heading
to select all tracks. Go to the Rip tab and click on the Rip+Encode button.
Sit back and wait. This process takes quite a while and is quite resource
206
CD-ROM
intensive (so your games may be slow while you wait). The progress bars on
the Rip tab show how things are going.
For each CD a playlist is created in ~/mp3 and for each track two files are
created, usually somehwhere in ~/mp3 as well, depending on the settings
in Figure 14.3. You set the location of the playlist in the Config tab under MP3 Options (where you can also tell grip to automatically delete the
temporary WAV files). The playlist is identified as an M3U file. The example configuration places both the temporary WAV file and the MP3 file
in ~/mp3/\%a/\%d/\%t.\%n.wav and ~/mp3/\%a/\%d/\%t.\%n.mp3 respectively. That is, a folder is created having the same name as the artist (%a),
and a sub-folder of this having the disc name (%d). Into this sub-folder all of
the tracks are stored with names consisting of track number (%t) and track
name (%n). So, for example, you might have:
~/mp3/pink_floyd/a_saucerful_of_secrets/04.corporal_clegg.mp3
This scheme works quite nicely but of course use whatever scheme suits you.
If there are problems accessing the CD make sure /dev/sg0 has the correct
permissions:
# ls -l /dev/sg0
crw------1 root
root
21,
0 Mar 15
# chgrp cdrom /dev/sg0
changed group of /dev/sg0 to cdrom
# chmod g+rw /dev/sg0
mode of /dev/sg0 changed to 0660 (rw-rw----)
14.5
2002 sg0
14.6
CD Data
Nautilus provides by far the simplest approach to burning data CDs. See
Section 59.3 for details.
14.6 CD Data
14.6.1
207
Intermediate Image
14.6.2
Altrop
Mint
Festival
No Intermediate Image
The output of mkisofs can be fed directly into cdrecord if the CPU is fast
enough (better than 400MHz). Note that the default installation requires
cdrecord to be run as root.
The first step is to determine the image size:
208
14.6.3
CD-ROM
This works for Altrop (Section 4.10.20), Mint (Section 4.10.27) and Festival
(Section 4.10.11) and only for root (unless cdrecord is configured to install
setuid ), by default.
# cdrecord -v dev=1,1,0 speed=8 -isosize /dev/cdrom
# cdrecord -v dev=0,1,0 speed=8 -isosize /dev/cdrom
# cdrecord -v dev=0,0,0 speed=16 -isosize /dev/cdrom
14.6.4
(Altrop)
(Mint)
(Festival)
Copy Video CD
14.7
was able to write a CD with 2 tracks, the first being data and the second
being audio. The audio can be played on a CD. The CD can be mounted to
read data. Swapping order on Mint (Section 4.10.27) did not allow the CD
to be mounted? Perhaps need newer kernel? But first audio track could be
played okay.
14.8 CD-RW
14.8
209
CD-RW
Although the command returns quite quickly the blanking process continues
for quite some time while it performs a long write (you can instead do a minimal blank with the option --blank-mode minimal. After this has completed
you can burn to the CD-RW as if it were a new blank CD-R.
14.9
First burn:
> mkisofs -r -o cdimage.raw files
> cdrecord --scanbus
> cdrecord -v -multi speed=4 dev=0,0,0 -data cdimage.raw
You may want to add some other options to mkisofs. Check out:
> mkisofs
Second burn:
$ NEXTTRACK=cdrecord -msinfo dev=0,0,0
$ mkisofs -r -o cdimage.raw -C $NEXTTRACK -M /dev/cdrom files
$ cdrecord -v -multi speed=4 dev=0,0,0 -data cdimage.raw
210
14.10
CD-ROM
CD Labels
The package cdlabelgen provides a useful tool to quickly put together covers
for CD:
$ cdlabelgen -c "Debian GNU/Linux" -s "Version 2.2r2 (potato) netinst" \
-D -e openlogo-nd.eps -S 0.8 -f contents.list | gv -
The main title is Debian GNU/Linux with subtitle Version 2.2r2 (potato)
netinst. No date will be written, but the front cover will include the image
from the file openlogo-nd.eps, scaled by 0.8. The back cover will contain
the text from contents.list. Once it looks okay in Ghostview (gv) replace
the gv - with lpr.
Chapter 15
Chinese
Get chinese fonts showing up in Epiphany: install ttf-arphic-bsmi00lp ttfarphic-bkai00mp ttf-arphic-gbsn00lp ttf-arphic-gkai00mp x-ttcidfont-conf
Then restart xserver!
211
212
Chinese
Chapter 16
ChRoot: Multiple Distributions
The chroot allows multiple installs on the one machine without rebooting! In
this way you can then keep an older stable release that some applications
might require, and run those applications as in:
sudo chroot /path/to/chroot /bin/sh
Set it up with (from http://www.debian.org/doc/manuals/reference/
ch-tips.en.html#s-chroot):
# cd /
# mkdir /sid-root
# debootstrap sid /sid-root http://ftp.debian.org/debian/
... watch it download the whole system
# echo "proc-sid /sid-root/proc proc none 0 0" >> /etc/fstab
# mount proc-sid /sid-root/proc -t proc
# cp /etc/hosts /sid-root/etc/hosts
# chroot /sid-root /bin/bash
# apt-setup # set-up /etc/apt/sources.list
# vi /etc/apt/sources.list # point the source to unstable
# dselect # you may use aptitude, install mc and vim :-)
213
214
Chapter 17
Clock: An Explanation
There are two clocks in your computer: a system clock and a hardware
clock. The system clock is maintained by the running operating system
(Debian). It is also said to be maintained by the kernel. The date command
talks to the system clock. The hardware clock is part of the actual hardware
of the computer and is usually battery backed up. The hwclock command
talks to the hardware clock.
17.0.1
Timezones
With a dual boot system it is often best to set the clock to local time. If, on
the otherhand, GNU/Linux is the only operating system installed then using
GMT (Greenwich Mean Time) is recommended as the standard approach for
Unix.
To change the timezone use the tzconfig command. You also have to change
the line in /etc/default/rcS which states the CMOS clock configuration.
17.0.2
Some system clocks do not run all that accurately. Some hints on dealing
with clock problems can be found in the Clock mini HOWTO at http://
www.tldp.org/HOWTO/Clock.html, but the hwclock and adjtimex manual
pages tend to be an easier read!
Be warned though, the Debian suggestion is not to fiddle with hwclock. It is
215
216
Clock: An Explanation
highly recommended that you install the ntp-simple package (to run a daemon
that checks regularly to keep your clock in sync) and/or ntpdate (to update
your clock at each boot or to manually run a command to update your clock)
to keep your clock accurate. These are discussed in more detail below.
If you install both ntp-simple and ntpdate and you manually set up cron to
run ntpdate every hour then you will probably receive email every hour to
tell you that ntpdate cant get the ntp socket (because the ntpd daemon
from ntp-simple is probably using it!):
Using NTP
The Network Time Protocol (NTP) daemon provided by the ntp-simple package is by far the easiest way to manage the accuracy of your clock, particularly
if you are connected to the internet (even if only intermittently).
The ntp-simple daemon (ntpd) effectively sets the cock by speeding it up or
slowing it down depending on its natural drift so that it gets in sync and
stays there. This avoids a sudden shock to the system with a dramatic
change to the time, although mostly the system can handle it.
The primary configuration required is to identify an NTP server. Look at
the lists at http://www.eecis.udel.edu/~ntp/, for example.
After running ntpd for a little while your clock will be set to an accurate time
and will maintain an accurate time. However, if the amount of difference is
too great then ntpd will not modify the clock. After setting up ntp-simple
you can install ntpdate and on install (and reboot) the clock will be updated
to the correct time according to the server you have chosen for ntp-simple.
With ntp-simple installed on one of your hosts, Velox (Section 4.10.26) for
example, on the local network you can now use Velox (Section 4.10.26) as a
ntp server simply by installing ntp on each machine and pointing them to
Velox (Section 4.10.26) as the server.
217
ntpdate
If you only have irregular access to the Internet then ntpdate is useful. The
package provides the ntpdate command to query an NTP server and to
update your clock. You can do this manually as you see fit with:
$ ntpdate ntp.ktware.com
The advantage is that you will not have regular net transmissions as with
the NTP server. This could save you up to 4MB per day. This could also be
done as a cron job, for example.
For irregular access through a modem using PPP though, a good idea is to
create a script file in /etc/ppp/ip-up.d called ntpdate containing:
#!/bin/sh
#invoke ntpdate to set time from system clock
if [ -x /usr/sbin/ntpdate ]; then
/usr/sbin/ntpdate -s -t 5 ntp.ktware.com
/sbin/hwclock --systohc
fi
Then each time you connect the local clock will be synchronised with the
NTP server.
17.0.3
chrony
For dialup connections the suggestion is to use the chrony package. This does
the same thing as ntp but works well with a dialup. The default installation
installs the necessary script and the default configuration works out of the
box (but you should change the default timeserver to one near you).
218
Clock: An Explanation
Using adjtimex
The adjtimex command can be used to counter systematic drift in the system
clock. It is tricky to fine tune, and it is recommended that you use ntp
instead if you can.
To set the system clock do:
# date -s "13 Jun 2001 10:10:00"
Then monitor how the system (and hardware) clock varies over 24 hours.
The adjtimex command communicates with the kernel to change the number
of ticks in a day (default is 10000 which corresponds to about 8.64 seconds
per tick) and the frequency (default is 0) of the system clock. In Debian
you can use the command adjtimexconfig to automatically tune the tick
and frequency to match the accuracy of the hardware clock (assumed to be
accurate) and so that the change has effect on each boot. Alternatively,
override the automatic settings by editting /etc/adjtimex.conf.
INDY The system clock was losing (very) roughly 1 second per hour. (The
hardware clock seemed to lose nearly one second each day.) Not too much
on the face of it but considering the machine is rarely rebooted this can
become a significant drift. For this machine a tick of 10002 and a frequency
of 4000000 set the clock accurately:
# adjtimex --tick 10002 --freq 4000000
Velox (Section 4.10.26) The system clock was losing about 1 second every
hour (16 seconds in 24 hours). The hardware clock was very accurate as best
I could tell. I Installed adjtimex then:
# adjtimexconfig
219
This claims to adjust the ticks for the system clock against the hardware clock
which is assumed to be, and generally is, accurate. However, after 24 hours
the system clock was still about 5 seconds slow. I noticed the hwclock was
also a few seconds out after a weekend (fix that another time). I decided to
set the parameters myself by editting /etc/adjtimex.conf. Before I started
it contained:
TICK=10000
FREQ=1653461
At 2pm, 6 Jun (22 hours later) the clock was 9 seconds too fast. So lets half
the freq and see where that gets us. Really need to set things back to base
(tick 10000 and freq 0) and do the actual calculations for the value.
# adjtimex --tick 10002 --freq 2000000
17.0.4
The hwclock command provides the interface to the hardware clock. If you
are wanting to ensure the correct time then with a default Debian set up it
is recommended that you use ntp instead if you can. When you reboot the
system will save the current correct time to the hardware clock.
Anyhow, the --adjust option of the hwclock command checks information
stored in the configuration file /etc/adjtime and makes an actual correction
to the time stored in the hardware clock to account for the drift that it (the
220
Clock: An Explanation
hwclock utility) has been monitoring. (Each time you set the hardware clock
with the hwclock command the current time is compared to the previous
time it was corrected to determine the amount of drift.) Thus, when setting
the system clock from the hardware clock it is advisable to do the following:
# hwclock --adjust
# hwclock --hctosys
When updating the hardware clock from an accurate system clock do:
# hwclock --systohc
Chapter 18
Commercial
While the focus is on free systems in this book it would be unfair not to
include some great commercial software. Free open source software may not
always serve your needs. You have two options: implement (or pay someone
to implement) what you need yourself on top of the base already provided by
the open source software; or buy an off-the-shelf solution. The former will
give you plenty of kudos in the GNU/Linux world, but the latter might be
more practical.
Here we do not delve into the individual products, but rather catalogue what
is available.
18.1
GNU/Linux thrives on the idea of independent, yet collaborative, tools. Micorsoft Office, on the other-hand is an integrated monolithic offering. Such
tools are also available for Linux, commercially, and the premier offering is
Corels WPO.
221
222
Commercial
Chapter 19
Configuration
19.1
/etc/debian\_version
Contains the debian version.
/etc/exports
This file contains information to tell NFS (Network File Systems) which
partitions are to be shared with other systems.
/etc/fstab
This file lists filesystems, possibly spread over multiple drives, partitions, and
remote hosts, that can be mounted. At boot time, partitions identifed as auto
mount will be auto mounted. Other convenient mount rules for CD-ROMS,
DVDs, Floppy drives, etc., are usually also included.
/etc/hosts.allow
This file, and its companion /etc/hosts.deny control access to your computer. The file /etc/hosts.allow lists hosts that are allowed to access the
system. If empty then no restrictions apply. Similarly, /etc/hosts.deny is
a list of hosts that are not allowed to access the system.
/etc/inetd.conf
This file is the internet server configuration database and is used to identify
services like ftp and ssh which should be started. As a security measure it is
223
224
Configuration
Chapter 20
CRON: Regular Tasks
All Unix systems have a mechanism for running certain applications regularly.
The mechanism is through a daemon called crond.
Debian uses cron in a very neat and stylised fashion. Scripts to be run
regularly are maintained in one of /etc/cron.daily/, /etc/cron.weekly/,
or /etc/cron.monthly/. The entries in /etc/crontab then simply run any
scripts in these directories on a regular basis. The daily scripts, by default,
are run at 6:25am each day. The weekly scripts are run each Sunday at
6:47am and the monthly scripts are run at 6:52am on the first day of each
month. The default /etc/crontab essentially contains just the following
lines:
25 6
47 6
52 6
* * *
* * 7
1 * *
root
root
root
The first line is read as: 25 minutes past 6am on every day of the month and
every month of the year and every day of the week as user root run the rest of
the line. The rest of the line tests to see whether anacron is installed and
if not runs the scripts found in /etc/cron.daily/. If anacron is installed
then it is used instead to ensure the scripts are run. The anacron package is
a replacement for cron that does not assume the local host is always powered
on (Unix and GNU/Linux systems rarely require rebooting and are happy to
remain powered on indefinitely) and will ensure the regular scripts still get
run appropriately when the local host is powered on.
If the default times for cron dont suit (e.g., you like to work early in the
225
226
morning and get annoyed by the sudden disk whirling each morning at 6:25
am) then simply change the times in /etc/crontab. Unlike traditional versions of cron, the newer versions do not require the running of the crontab
command to install the new version when you edit /etc/crontab.
Chapter 21
CVS: Concurrent Versioning
Debian Pacakges: cvs cvs-doc viewcvs
CVS (Concurrent Versioning System) is the standard tool for allowing several
developers or authors to work together on a shared set of documents. CVS
maintains a central repository of all files associated with a project, including
a history of all changes made to each file. Users checkout copies of the central
repository (either on to a local machine or else any machine on the network),
edit documents locally, then commit changes back to the repository. Multiple
users can be working on the same project concurrently. All older versions of
the documents can be retrieved, if required.
21.1
Managing a Project
21.1.1
You can create a CVS repository for yourself . Simply create a directory to
hold the repository then initialise it:
$ mkdir /home/kayon/cvs
$ cvs -d /home/kayon/cvs init
You can then create new projects within this repository with
$ cvs -d /home/kayon/cvs import wajig kayon start
227
228
You can check out projects from there with either of the following, the first
for local hosts (which mount the file system via NFS perhaps) and the second
for network hosts:
21.1.2
To create a new project consisting of all files in the current working directory
use:
No commit is required after an import. Note that the files and subdirectories
in the current directory will then be recognised as src/docs/spec. You can
now remove the directory and use CVS to create a new one for you, with the
new one now under CVS control:
cvs co src/docs/spec
This will create the whole directory hierarchy as well so be sure to be at the
root of the hierarchy where you want this new hierarchy to live.
To checkout a project from a remote host use:
This will use rsh (set CVS RSH to ssh to use ssh instead) to access the CVS
server and checkout the src/docs directory.
To check out a project and give it a different local name:
21.1.3
229
You mark files to be added to the CVS repository with, for example:
cvs add <filename>.py
The files will be added to the repository when you next commit.
If you are adding binary files then you probably dont want keyword expansion and youll want to let the repository know that they are binary files:
cvs add -kb <filename>.png
21.1.4
You can edit the files you have checked out. It is useful to regularly ensure
you are working on the latest copies by doing:
cvs update
This will update your copy of the files from the archive. Any updates made
to the archive by others will appear in your copy. If there are any conflicts
you will be warned about them and will need to find and resolve them in the
files updated. CVS will tell you of conflicts:
Merging differences between 1.42 and 1.43 into main.py
rcsmerge: warning: conflicts during merge
cvs update: conflicts found in main.py
CVS will actually modify your file which ends up with both versions of the
conflict:
<<<<<<< main.py
def detect_outlier(limit, score)
=======
def detect_outlier(maximum, score)
>>>>>>> 1.43
230
Here I added a limit variable to the method whereas someone else added
maximum. I need to choose one or the other.
To add any new directories that have been added to the repository to your
local checked out copy, and to prune any directories that are empty from the
local checked out copy, use:
cvs update -dP
21.1.5
Identifying Changes
To see the differences between a file you are working on and the current
version in the archive use:
cvs diff -c0 main.py
21.1.6
To remove a file from the repository first remove it from your directory then
use:
cvs remove stubs.py
21.2 Tuning
231
21.1.7
Committing Changes
Once you are happy with your changes (and youve made sure the program
still works or the document is still printable) then it is time to update the
repository with all changes you have made. You need to give a short message
to describe briefly what has changed:
cvs commit -m "Describe the changes you made"
21.1.8
Tagging a Release
You can tag a collection of files in a repository so that you can later restore
all of the current versions of the files together. This is useful when you have
a stable release of your software. Tag all the files and then start breaking
the code again! To tag all files in the current directory and below simply:
$ cvs tag release-0-2
21.2
Tuning
21.2.1
Location of Repository
232
about the repository (so you wont need the CVSROOT environment variable
or the -d option for any other cvs commands within this project).
It may be convenient (but not necessary) to have a default CVSROOT defined in your /home/kayon/.bashrc:
export CVSROOT=/var/lib/cvs
21.2.2
Set the environment variable CVS RSH to ssh to use ssh instead:
$ setenv CVS_RSH ssh
$ export CVS_RSH=ssh
21.2.3
if using csh
if using sh or bash
21.2.4
Ignoring Files
233
*.out
*.pdf
*.cut
.thumbnails
tmp_*.png
21.3
CVS for NT
234
Chapter 22
Desktop
gnome (http://www.gnome.org/) is a Desktop and Session Manager. sawfish
(http://sawmill.sourceforge.org/) is a Window Manager. kde (http:
//www.kde.org/) is a gnome alternative and windowmaker and enlightenment
are alternatives to sawfish.
Both gnome and kde provide a desktop environment and an application development framework. A desktop environment usually consists of a window
manager, task bar, and perhaps a file manager and documentation browser.
A development framework provides libraries and a GUI toolkit for application
development.
Applications like windowmaker, and enlightenment are desktop environments
which tend not to provide development frameworks. They do, however, tend
to provide session management. While you can use these with desktop environments like gnome and kde their functionality sometimes overlap, and may
even conflict.
XFCE provides a simple and very small desktop requiring minimal resources
but providing a sufficient feature set for the genral user. XFCE is actually
based on the GTK+ toolkit as is the Gnome desktop.
235
236
Desktop
Chapter 23
DIA: Charts and Diagrams
Dia is a vector-based drawing tool similar to Win32 OS Visio. It is suitable for graphical languages such as dataflow diagrams, entity-relationship
diagrams, organisation flow charts, universal modelling language (UML) diagrams, electronic circuit diagrams and much more. It is ideal when the
diagram has shapes that recur and are connected by lines.
Dia is extensible through the use of sheets which contain collections of shapes
for use in diagrams. The ER sheet, for example, has shapes for different types
of entities, attributes and relationships as required when drawing entityrelationship diagrams for database design.
Dia also runs under Win32 OS (see http://hans.breuer.org/dia) providing a free cross platform tool. Storing its diagrams natively as XML documents means that they are accessible on multiple platforms and from other
applications. You could even edit the dia XML diagrams by hand. Some
applications also generate dia diagrams.
In this chapter we begin with some basics and then a walkthrough that should
get you started with dia. We then review the functionality of dia. And we
end with a walkthrough creating your own shape library.
237
238
23.1
Basic Operation
The main dia tools window allows you to create new canvases, select the
tools you wish to use, and set your preferences. The application preferences
are accessed through FilePreferences. Options include compression of saved
files, the default size of new canvases, and characteristics of the grid displayed
on the canvas (including its visibility and whether objects snap to the grid).
These choices take effect from the next canvas that is opened (but not for
currently opened canvases) and are saved in ~/.dia/diarc.
The first step in drawing is to start a new canvas with FileNew Diagram.
You then select objects, lay them out on the canvas, add the lines to connect
the objects, and add relevant text.
The tools available on the main dia window fall into four distinct areas. The
Pointer and Standard Shapes generally occupy the top half of the window.
The Sheets area is next with an option menu that may be showing UML as
the currently selected sheet. Below this (in a scrollable window if required)
are the actual shapes provided by this sheet. The next area selects the pen
colour and type. Finally, line types are selected with the final row of buttons.
If you are unsure of the purpose or intent of a shape or button simply move
the mouse pointer to hover over the corresponding button and a tooltip will
remind you. Click the left mouse button on the tool button to activate the
tool.
23.2
239
Figure 23.1: The default new canvas ready for a new diagram. The right
mouse button clicked over the canvas contains a menu of all the operations.
240
place the Attribute. Double click this to edit the Object properties to change
the Name of the attribute to Title. This attribute is also going to be the
attribute by which we uniquely identify every movie in the database. This
is called Key, so select the Key checkbox. Click on the OK or Apply button
for this change to take effect.
Another diagram (Figure 23.3) uses UML shapes although it is not itself a
formal UML diagram.
23.3
Before we get into the details it is useful to review the dia command line options. Dia supports all of the usual Gnome, GTK+ and Session Management
options which are listed with the --help option. In addition dia has just a
single option, --export, abbreviated as -e. This will generate an exported
241
Figure 23.4: Sample diagram saved as a graphic and imported into this book.
graphic of the supplied dia diagram in one of the supported export formats.
The particular export format is determined from the supplied filename extension. Thus,
dia --export survey-chart.eps survey-chart.dia
23.4
23.4.1
The top section of the main dia window contains the pointer and a collection
of standard shapes. The pointer (the top left icon with the arrow) allows you
to select objects on the dia canvas.
Next to the pointer are the zoom and scroll buttons. The zoom tool will
enlarge (zoom in on) the diagram each time you click the left mouse button
somewhere within the diagram. By holding down the Shift key when using
the zoom tool the diagram will be zoomed out. The scroll tool will scroll
the diagram when you hold the left mouse button down within the diagram.
This mimics moving the scroll bars. By holding down the Shift key when
242
using the scroll tool you can grab (as with a hand) the diagram and scroll
the diagram around in this way.
The fourth button selects the Create Text tool allowing text to be added to
your diagram.
23.4.2
Standard Shapes
The second collection of four buttons on the main window consist of the
standard shapes of a Box, Ellipse, Polygon, and a Beziergon.
The next group of five buttons are line drawing tools consisting of a Line,
Arc, Zigzagline, Polyline and Bezierline.
The final button allows you to import graphics from other applications.
Double click the left mouse button on the tool button to set the object
defaults for that object (not all objects have defaults). For example, double
clicking the Create Text tool button will bring up a window to set defaults for
the alignment of the text, the font, and the font size. The Box object defaults
include whether the background is drawn and how the corners are rounded.
The Ellipse, Polygon, and Beziergon object defaults allow for turning off of
the drawing of the background. The only other standard shape with object
defaults is the Image tool which can identify a default image file, whether
a resize of the image should keep the aspect ratio, and whether to show a
border around the image. Objects from the various sheets may also offer
object defaults.
23.4.3
All objects have handles that generally allow the object to be resized. The
usual handles are small boxes with a green fill. You can move these handles
by dragging them with the mouse. This will resize the object. If the handles
have a dark blue fill instead then the object can not be resized. This is typical
of boxes that resize automatically as you enter text into the box.
Lines have handles at each end that are also green (but also have a small
internal cross identifying it as a connection pointsee below). Once again
you can resize the line simply by grabbing these handles with the left mouse
button and moving the handle around.
243
Some lines (e.g., a polyline) have internal handles that are coloured orange.
These handles have restricted movement and may also move as you move the
line end-points.
Most objects also have connection points that identify locations on the shape
to which lines can be snapped. (An Arc, for example, does not have any
connection points.) They are identified as the small blue crosses on the
edges of the objects. The handles on the end of lines also have crosses
identifying connection points. A lines connection point becomes attached
to the connection point of an object, as indicated by the lines green handle
becoming red. Moving the object will also move all of the attached lines.
The Line shape can have extra connection points added to it through the
middle mouse button menu. Each new connection point is added to evenly
space all of the connection points along the line.
23.4.4
Sheets
The next section of the main dia window begins with a choice of sheets (i.e.,
shape libraries). Many are included by default and new ones can be added
(see Section 23.7). Selecting one of the available sheets (by choosing from the
pull-down menu that is labelled UML for the Universal Modelling Language
in the above sample window) will display a collection of shapes associated
with the particular sheet. (The sample window includes the shapes useful
for drawing UML diagrams.) Some shapes, when selected and placed onto
the canvas, have text associated with them and will grow in size depending
on the text you type. An example is the Text box button.
Increasing the height of the main dia window will often allow you to see all
of the available shapes of any of the sheets at one time.
23.4.5
Pen
The lower section of the window contains the pen colour chooser.
23.4.6
Lines
The line thickness and line types. These affect the standard shapes rather
than shapes from the sheets. The smallest line width is 0pt (hairline).
244
A variety of lines are supported. You can add arrows to the lines by clicking
on the button at the bottom right (or bottom left for backwards pointing
arrows) of the Dia control window. Figure 23.5 shows the button before and
after selecting an arrow.
Figure 23.5: Selecting the arrow and line type for the various line drawing
tools. The first shows the default Dia window with undecorated lines (as
indicated by the bottom three buttons being straight lines). We have chosen
the straight line tool in the top half of the window. An arrow is added in
the second, a backward arrow with a hollow head in the third, and the line
is changed to a dotted line in the fourth.
23.5
The right mouse button anywhere on a canvas will bring up a diagram specific
menu. From here all of the operations are available, including those to save,
print and export the file, to cut and paste, to select various objects or regions,
to group objects and to layer objects, to operate on objects with various tools,
and to edit the object properties and layout.
The middle mouse button will bring up an object-specific menu. Double
clicking an object will bring up the properties editor for that object.
23.5.1
The File menu provides the usual New diagram, Open..., Save, and Save As
operations. Once again F3 (open) is the keyboard shortcut to open a dia-
245
gram from a file and Ctl+S (save) is the shortcut to save a diagram to a
file.
Preferences
With the Preferences... menu item you set the various options allowed by dia
(this is the same as selecting FilePreferences from the main dia window.
These options affect new diagrams only, not currently open diagrams. To
change options like Snap To Grid for a currently open diagram, use the right
mouse button View menu.
The three categories of preferences for new dia diagrams are shown in Figure 23.6.
Under the User Interface the first option indicates whether the tools in the
main window are reset to their defaults after creating a new canvas. The
native dia save format uses XML which can be quite verbose. As with many
Gnome applications it is common to compress the saved document (using the
gzip format) and you can control this behaviour here. dia supports only a
limited number of undo levels which can also be set here. Finally, reverse
dragging, when enabled here, allows you to drag-select from the right to
the left (unlike normal dragging which usually goes left to right) to have a
different effect. It selects all objects that intersects the dragged rectangle
rather than just those that are fully contained in the dragged rectangle.
View Defaults controls the size and initial magnification of the new window
when you create a new canvas. You can also control whether the connection
points (the blue crosses) are visible.
246
Grid Lines can be turned on and off. Objects can be made to snap to the
grid (i.e., when you place or move objects they will move automatically to
the nearest grid when placed). The size of the grid (both along the x and
y axes) can be changed as can the colour and style of the grid lines. Page
borders can be displayed on the grid using different colours and line styles.
Export
Export... is used to generate output suitable for other applications with a
variety of formats supported. The format is either specified using the option
menu or else determined by the filename extension:
Computer Graphics Metafile
Native Dia Diagram
Drawing Interchange File: This format is used by other vector graphics applications such as the computer aided design
packages like AutoCAD and QCad.
eps
Encapsulated PostScript
hpgl Hewlett-Packard Graphics Language
png
Portable Network Graphics: This is the standard free graphic
format for the Internet.
svg
Scalable Vector Graphics
tex
TeX PSTricks macros: Diagrams in this format can be used
directly in TEX and LATEX documents.
wpg
WordPerfect Graphics
cgm
dia
dxf
247
Depending on the version of LATEX and PStricks you are using, you may need
to uncomment some macro definitions in the diagram file. If LATEX gives you
the error something like:
! Undefined control sequence.
<recently read> \setfont
You will need to remove the initial percent sign (LATEXs comment command)
from the definitions in diagram.tex and it is best to rename the newcommand
to providecommand in all three cases (to avoid problems when including more
than a single diagram in the one LATEX document:
\newcommand{\setlinejoinmode}[1]{}
\newcommand{\setlinecaps}[1]{}
\newcommand{\setfont}[2]{}
23.5.2
The Edit menu allows you to Copy, Cut, Paste and Delete objects with the
common keyboard shortcuts of Ctl+C (copy), Ctl+X (cut), Ctl+V (paste),
248
and Ctl+D (delete), respectively. Edit operations can be undone and redone. The number of undo levels is controlled by an option in FilePreferences
as we saw in Section 23.5.1. The default is 15. That is, you can recover from
the last 15 actions!
23.5.3
The View menu affects how you view the diagram. Zoom In enlarges the
viewed diagram and Zoom Out contracts the viewed diagram. Particular
scales can be chosen with the Zoom submenu. The Diagram Properties. . .
menu allows the background colour to be changed and the grid characteristics
(spacing and visibility) to be modified. These changes affect the current
diagram only and are saved with the diagram.
Various features can be turned on or off with the following option items.
New View pops up a new canvas showing the same objects. Editing any
object in any of the views will affect that object in all of the views.
Show All zooms the diagram to fill the viewable area of the canvas.
23.5.4
The Select menu provides shortcuts for selecting objects. All objects can be
selected or None. Those currently not selected can be selected in place of
those that are selected (Invert). For any selected objects you can cause those
objects directly connected to them to also be selected (Connected). Doing
this repetitively results in all connected objects being selected, which is the
same as selecting Transitive. Finally, you can select all objects that are of the
same type as the currently selected object.
Selecting same type actually works even if objects of different types are selected.
The following five check buttons modify how new objects are selected. Usually a new selection replaces the old selection as the final set of selected objects. With Union the final set of selected objects consists of the previously
selected object plus the newly selected objects. Intersection results in those
object that were previously selected and now selected again to be in the final
selection, but no others. Remove removes from the old set of selected objects
249
those that are newly selected. And Invert causes those objects newly selected
to have their state of selection invertedthat is, those previously selected
and now newly selected be no longer be selected, and those not previously
selected but included in the new selection will become selected.
23.5.5
The Objects menu allows you to layer objects and to group and align objects.
Objects can be selected individually with the left mouse button by clicking
on the object. This allows a single object to be selected at a time. To select
multiple objects you can hold down the Shift key while you click the left
mouse button. Selecting with the left mouse button actually toggles the
selected state of the object. You can also select a group of objects simply
by dragging the left mouse button (hold the left mouse button down and
move the mouse around) on the canvas to define a rectangular area. When
you release the left mouse button all objects in the rectangular region will
be selected. Of course, you can also use the Select menu described above to
select objects.
Once you have objects selected the menu items in the Objects menu become
available. Send to Back and Bring to Front have the obvious meaning. Figure 23.7 shows the effect of selecting a Text object which is on top of a Box
object and sending it to the back. The Box object ends up occluding the
Text object.
250
23.5.6
The Tools menu simply provides menu access to all of the tools located on the
upper area of the main window. You will find the pointer (Modify), Magnify,
and Scroll tools. Remember, Shift with Magnify or Scroll changes their behaviour. See Section 23.4.1 for details. Next comes the four standard shapes
(Box, Ellipse, Polygon, and Beziergon) followed by the five lines (Line, Arc,
Zigzagline, Polyline, and Bezierline). Finally Image objects can be selected.
There is a significant reason for repeating the Tools here: keyboard shortcuts
can be easily assigned to each of the tools through this menu. Simply move
the mouse to highlight one of the menu items and type the keystrokes you
which to associate with that tool (e.g., Ctl+Alt+E for the Ellipse). The
shortcut should appear on the menu.
23.5.7
The Dialogs menu allows the Properties of the selected object to be modified
(if it has modifiable properties). For shape objects you can, for example,
select line width, colour, and style and a fill colour. The fill can be made
transparent (by specifying that the background should not be drawn).
You can also edit the Layers.
23.6
We describe some of the sheets that are supplied with dia. For each we
list the collection of shapes (objects) provided and give an example diagram
made from the shapes. The specification of each sheet is an XML document
usually located in /usr/share/dia/sheets/.
23.6.1
Chronogram
The Chronogram sheet contains just two shapes, but with functionality that
allows a considerable variety. XXXX Check samples/chronograms.dia for a
trailer and require a lot of explanations to be usable.
23.6.2
251
Circuit
The Circuit sheet contains shapes useful for drawing electrical and electronic
circuit diagrams. The sheet includes, in order, a Vertical Resistor, Horizontal
Inductor, Vertical Inductor, and a Horizontal Resistor as the first row with
their European counterparts as the second row. Then Horizontal and Vertical Capacitors, npn and pnp Bipolar Transistors, Horizontal and Vertical
Diodes and Zener Diodes, Ground Point, Operational Amplifier, Horizontal
and Vertical Fuses and Power Sources, Lamp, Speaker, Horizontal and Vertical LEDs, NMOS and PMOS Transistors, and a Horizontal Jumper. All
objects have object defaults accessible by double clicking the left mouse button on the corresponding object within the sheet. In general you can set the
default text padding, alignment, font, and font size for each object.
23.6.3
ER
23.6.4
Flowchart
The Flowchart sheet provides the diagram elements usually associated with
drawing flowcharts of all types. All elements allow text to be included and
the object properties can be used to set the fonts and for boxes to set the
corner rounding. The elements supplied are a Box, Parallelogram, Diamond,
Ellipse, Display, Transaction File, Off Page Connector, Document, Manual
Operation, Preparation, Manual Input, Predefined Process, Terminal, Magnetic Disk, Magnetic Drum, Magnetic Tape, Internal Storage, Merge, Extract, Delay, Summing Junction, Collate, Sort, Or, Punched Card, Punched
Tape, Transmittal Tape, and Offline Storage.
23.6.5
FS
The FS sheet provides support for Function Structure Diagrams. There are
three shapes: A Flow, an Orthogonal Polyline Flow, and a Function.
252
The Flows have object defaults where default labels (text) and flow types
can be identified. These can also be changed by double clicking a Flow or
Orthogonal Polyline Flow object on your canvas. The different flow types
(Energy, Material, and Signal) change the properties (colour and type) of the
line. The text label can be grabbed by the mouse and moved around.
The Function object is a box with a text label. It has object properties
with which the Function can be identified as a Wish Function and/or a User
Function. A Wish Function has a dotted box and a User Function has a
double box.
Figure 23.8: A sample of the Function Structure (FS) Diagram sheet objects.
This is not a true function structure diagram, but does illustrate the variety
of shapes.
23.6.6
GRAFCET
23.6.7
253
Ladder
23.6.8
Networks
Network diagrams include local area networks (LANs) and wide area networks (WANs). The Network sheet provides a collection of shapes often used
in network diagrams. The sheet includes, in order, a Computer, Monitor,
Storage, Ethernet Bus, Printer, WAN Connection, Hub, Modular Switch,
RJ45 Wall-Plug, scEAD Wall-Plug, Modem, Antenna (for wireless transmission), Network Cloud, Router Symbol, Switch Symbol, and an ATM Switch
Symbol.
23.6.9
Pneumatic/Hydraulic
The Pneumatic/Hydraulic sheet provides tools to draw pneumatic and hydraulic schematics. Its a very incomplete sheet, and there are some tricks
to using distributors properly.
23.6.10
SADT
SADT stands for Structured Analysis and Design Technique which is a trademarked and copyrighted by Softech Inc. A SADT model is a collection of
diagrams organised in a tree structure. Each SADT diagram is composed
of Boxes (representing activities) connected by Flows (arrows) representing
flows of materials, data or information.
The SADT sheet provides the three basic components required for drawing
SADT diagrams: Activity/Data Flow, Activity/Data box, and Flow Annotation. The activity/data flow can be one of several styles, including Normal,
Import Resource, Imply Resource, Dotted Arrow, or with Disabled Arrows.
The default is Normal but can be changed in the Object Defaults window
(double click the Activity/Data Flow button).
254
Flows have different roles in relation to the activities. The middle mouse
button (or control right click on Windows) is used to add or remove segments.
The default flow is Vertical-Horizontal-Vertical. It is sometimes useful to
do a bit of middle mouse button clicking to build a Horizontal-VerticalHorizontal variant which can then serve for copy-and-paste in your diagram.
A non Vertical-Horizontal-Vertical flow will be shown in black instead of the
default grey. While this is not in the original SADT specification it is often
handy to untangle a heavily loaded sheet (with more than 4 or 5 functions
though these sheets should be avoided).
Connections points can be added to or removed from the sides of an SADT
box by clicking the middle mouse button. Function identifier (A0, A1, etc.)
can be changed by opening the box properties. The associated function (the
contents of the box) is changed by simply selecting the box and typing any
text.
23.6.11
Sybase
The Sybase sheet provides various objects for the design of Sybase replication
domain diagrams. The sheet includes a Dataserver, Replication Server, Log
Transfer Manager or Rep Agent, Stable Storage Device, Client Application,
and a Replication Server Manager.
23.6.12
255
UML
Support for the Universal Modelling Language (UML) includes all of the
static structure diagram elements specified in the UML specifications. The
sheet includes, in order, a Class, Template Class, Note, Dependency, Realization (implements a specific interface), Generalisation (class inheritance),
Association, Aggregation (one class is part of another), Implements (class
implements a specific interface), Constraint, Small Package, Large Package,
Actor, Usecase, Lifeline, Object, Message, Component, Node, Class Stereotype Icon, State Machine, and a Branch.
23.7
You can create your own shapes and include them in your own sheet simply
be defining the shapes in XML (using a subset of SVG, the scalable vector
graphics format based on XML). Installing a new shape is simply a matter
of installing it into ~/.dia/shapes.
23.7.1
Simple Example
A shape consists of at least a name and a SVG element. That is, every shape,
at a minimum, has a name and a description:
<?xml version="1.0"?>
<shape xmlns="http://www.daa.com.au/~james/dia-shape-ns"
xmlns:svg="http://www.w3.org/TR/2000/03/WD-SVG20000303/DTD/svg-20000303-stylable.dtd">
<name>Sample - Minimal Shape</name>
<svg:svg width="10" height="10">
<svg:polygon points="0,0 10,0 5,10"/>
</svg:svg>
</shape>
You can place this in a subdirectory of your own dia shapes directory, perhaps
called Sample as in ~/.dia/shapes/Sample/minimal.shape. The actual
filename in which the shape is stored (minimal.shape) is not so important
dia will find the file.
256
Now you need to create a sheet into which this shape is placed. Again, a
sheet is specified using XML. This example is placed in the file ~/.dia/
sheets/Sample.sheet:
<?xml version="1.0" encoding="iso-8859-1"?>
<sheet xmlns="http://www.lysator.liu.se/~alla/dia/dia-sheet-ns">
<name>Sample</name>
<description>A collection of sample shapes.</description>
<contents>
<object name="Sample - Minimal Shape">
<description>The most minimal of shapes</description>
</object>
</contents>
</sheet>
Now start up dia and you should see this new sheet, called Sample, containing
a single button with a default icon.
You can now create a new canvas and add this shape to your canvas. Note
that dia takes care of the resizing of the shape and the other characteristics.
The XML describing the shape begins with the usual xml meta element
followed the actual shape element, identifying the appropriate XML namespaces (xmlns). The shape has a unique name used to identify the shape by
dia. Next we have the actual SVG description of the shape which is 10 by
10 in size (actually these are ignored by dia but are required by the SVG
format), and consisting of a single polygon. The shape is a simple triangle (a
polygon with three points) pointing downwards. The polygon is drawn from
the top left corner (0,0) to the top right (10,0) then to the bottom middle
(5,10) and then back to the top left to finish off the polygon.
The XML for the sheet then identifies this shape as belonging to the Sample
sheet, which contains just one object, the Sample - Minimal Shape shape. The
description for the object is used as the tooltip for the resulting button.
23.7.2
Shape Elements
An icon can be associated with the shape through the icon element. An
example is:
257
<icon>minimal.xpm</icon>
which comes after the name element. The specified X pixmap file is used
as the icon in the dia toolbox. The filename can be relative to the shape
file (e.g., icons/minimal.xpm or ../icons/minimal.xpm). When no icon is
specified a default icon is used.
Connection points can be added to the shape with the connections element
which allows any number of point elements. For example you can add two
connection points to the above Minimal Shape by inserting the following after
the icon element (or after the name element if there is no icon element):
<connections>
<point x="5" y="0"/>
<point x="5" y="10"/>
</connections>
This adds a connection point to the top and another to the bottom of the
triangle. The coordinate system used for connection points is the same as
for the shape itself.
Next an aspectratio element can be specified to indicate how the shape is
to be distorted. The default is as if the following was specified:
<aspectratio type="free"/>
This indicates that there is no restriction on the aspect ratio (i.e., you can
stretch the shape arbitrarily in the X and Y directions independently). A
fixed aspect ratio requires Y to change in the same proportion as X, and
vice versa. A range can be specified, with two attributes, min and max,
identifying a range of allowable amounts of distortion. For example,
<aspectratio type="range" min="4" max="8"/>
A textbox element can appear next. This is used to provide a box that
automatically adjusts the size of the shape to fit the supplied text. The
location of the text box is specified using the same coordinate system:
<textbox x1="2" y1="1" x2="8" y2="5"/>
258
23.7.3
SVG Support
From SVG the supported elements are: line, polyline, polygon, rect, circle,
ellipse, path and g. For the path element only the M, m, L, l, H, h, V,
v, C, c, S, s, Z, and z commands are supported. User units are supported
but not CSS units (only a limited set of the CSS attributes are supported).
Transformations are not supported.
23.7.4
Sheet Elements
23.7.5
Sheets are often distributed as compressed tar files (having the filename extension of .tar.gz). To install the sheet (assuming the tar file has been
created properly) open the tar file in the Gnome archive tool (guitar). Select
all files in the archive (Ctl+A or ArchiveSelect all) then click the Extract
button. You will be asked where to extract the files tochoose the .dia
folder in your home directory.
Next time you start up dia the new sheet will be available.
23.8
23.9
Acknowledgements
dia was written by Alexander Larsson. It is being actively developed by further by James Henstridge and Lars R. Clausen with significant contributions
from Fredrik Hallenberg, Emmanuel Briot, Francis J. Lacoste, Alejandro
Aguilar Sierra, Jerome Abela, Cyrille Chepelov, Henk Jan Priester, Jacek
Pliszka, Steffen Macke, and Hans Breuer.
Cyrille Chepelov implemented the Ladder, Pneumatic/Hydraulic, Chronograms, and Grafcet sheets and provided the descriptions included in this
chapter.
The dia home page (http://www.lysator.liu.se/~alla/dia/) provides
background information, a features list, and a pointer to Harry Georges
on-line tutorial introduction.
23.9 Acknowledgements
Lars R. Clausen has provided valuable commentary on this document.
259
260
Chapter 24
Directories: Linux Folders
A basic user operation expected from a computer is to be able to manage
documents, to place them into folders, open them to view, edit, or print
them, and to share the documents with others. While the Apple Macintosh
had Finder Unix has had a variety of File Managers. MS-Windows of course
has the MS-Windows Explorer. Linux shares the Unix file managers and
more. But the crowning glory of GNU/Linux is Nautilus, a file manager that
builds on many of the great ideas that have been demonstrated in previous
file browsers.
Before introducing Nautilus we begin with a review of the standard GNU/Linux
directory structure. Having a basic understanding of how GNU/Linux organises directories (also commonly known as folders) will uncover some of
the basic concepts of Unix and GNU/Linux.
24.1
Debian can install files almost anywhere within the filesystem, except for
/usr/local. The Debian Policy Manual and the FSB (Filesystem Base)
definition provide guidelines on what goes where.
/usr/local contains programs and data files that have been added
locally to the system, independently of the particular GNU/Linux distribution. These are intended to be kept separate from the main system
directories that are managed by the distribution.
261
262
/var contains administrative files (such as system logs) and data that
changes frequently (such as spool directories and caches like incoming
mail and news).
Other file managers for GNU/Linux are also available, including the KDE
offering, Konqueror, and the Midnight Commander which has a long history
and provides both a Gnome interface and a terminal interface (for those not
into GUIs).
Chapter 25
Disks
25.1
25.2
Ext2 to Ext3
25.3
Disk Parameters
264
Disks
hard disk parameters could be set and with hwtools we could ensure the
parameters were set on each reboot. See Section 4.10.16 for an example.
To test your current performance (this one shows results after tuning):
# hdparm -Tt /dev/hda
/dev/hda:
Timing buffer-cache reads:
Timing buffered disk reads:
265
Be careful though as some settings may cause the disk to stop responding!
This may require a hard reboot after which the default settings are returned.
For example, on Bach an additional IDE controller (a CMD680 from Silicon
Image) with 2 ST360021A disks, identical to the disk on the PIIX4 IDE
controller, but setting the parameter -d1 hangs the shell on a test with -Tt.
Also see http://linux.oreillynet.com/pub/a/linux/2000/06/29/hdparm.html
for further introductory explanations.
266
Disks
Chapter 26
Documentation
Documentation for Linux abounds but finding it is sometimes a little challenging. Sometimes you find it as a man page, sometimes as an infotex
document, sometimes as a html document, and sometimes as a Gnome
document. And thats just on your local systemsearching the Internet for
documentation is often very fruitful.
To read documentation see dhelp or browse
http://localhost/doc/HTML/index.html file://localhost/usr/share/doc/HTML/index.html
26.1
Debian doc-central
Debian has a central utility to view all locally installed documentation, called
doc-central. Other Debian packages for browsing Debian documentation include dwww and dhelp. The newer doc-central has several improvements over
the previous tools, with an improved interface and requiring no further effort
than installing the doc-base package.
Doc-Central is a collection of scripts that give you a convenient way to browse
the documentation installed on your Debian system.
Doc-Central uses a local http server (like apache) to present a list of all registered documents. Depending on the type of document other tools are used to
view the document: for info files we use info2www. All other types are currently linked to directly. To get the list of installed documentation the docbase registration entries as used. For more information on doc-base please
267
268
Documentation
Chapter 27
Email
Numerous tools work together to set you up with email.
Fetchmail can retrieve email from multiple POP/IMAP servers and deliver it
to your (possibly local) MTA. Exim, postfix, qmail, and sendmail are MTAs
they will dispatch email to users. Procmail can sort incoming email into
different mailboxes for a user.
27.1
Setting up EMail
Suppose your local machine is called misty. In /etc/hosts you will see:
127.0.0.1 misty
localhost
misty
270
This will ensure all outgoing mail appears to come from [email protected].
Local mail is delivered locally without leaving rose. All incoming mail is
collected by fetchmail, detected by Exim and delivered.
27.1.1
Exim
The default email server for Debian is exim. This can be set up in one
of several ways, depending on how you will access your email. The exim
configurator will list the options. The newer exim4 will become the default
at some time and its configuration is somewhat simpler. To configure it:
> wajig reconfigure exim4-config
The file /etc/exim4/update-exim4.conf.conf contains the simple configuration information which is used to generate the more complex exim4 configuration files.
The file /etc/email-addresses can be used to generate a From: address for
each user (so that the From address will not be the default of the user@host).
27.2
27.2.1
The fetchmail package will retrieve email from remote hosts (via POP or
IMAP, for example) and have it delivered locally.
The following scenario for user kayon with the following .fetchmailrc will
use ssh to tunnel to POP to avoid sending clear text passwords, and to also
encrypt all the communications.
poll localhost with proto POP3 and port 5110:
user kayon there with password XXXX is kayon here
271
This gives user kayon access from their desktop Linux machine to the host
lynx (Section ??) which might be inside the company firewall and which has
access to the mail server imaphost (Section ??). Kayons email comes from
an MS Exchange server (called imaphost (Section ??)) on the same company
network with IMAP enabled. But for security reasons the company network
does not allow IMAP access externally.
Then start fetchmail with one of the following:
> fetchmail
> fetchmail -v
> fetchmail -d30
The -N indicates that no command should be run on the remote host, which
is suited to tunnelling where the connection is required to simply sit there.
This will link localhost:5143 to mailhost:143. You can confirm connection by
trying:
> telnet localhost 5143
Trying ::1...
272
Trying 127.0.0.1...
Connected to localhost.
Escape character is ^].
* OK Microsoft Exchange IMAP4rev1 server version 5.5.2655.37
(saab-bt.ktware.com) ready
27.2.2
A sample .procmailrc:
# DEBIAN
:0:
* ^Resent-Sender.*[email protected]
lists/debian-devel
:0:
* ^Resent-Sender.*[email protected]
lists/debian-user
The :0 begins a recipe. The following : ensures the mail file is locked. A line
beginning with * begins a condition. You can have multiple conditions within
a recipe. The condition ^Resent-Sender.*[email protected]
captures email sent to the debian-devel mailing list. This matches messages
that include Resent-Sender: [email protected]
in their header. The final line of a recipe is the mailbox into which procmail
will send the mail.
27.2.3
273
27.2.4
You can manually interact with a POP server to perhaps manually delete an
email that your mail too is having trouble downloading, or simply to check
things out. Heres a sample manual session:
> telnet pop.ktware.com 110
Trying 203.95.38.50...
Connected to pop.ktware.com.
Escape character is ^].
+OK Hello there.
USER kayon
+OK Password required.
PASS Secret
+OK logged in.
LIST
+OK POP3 clients that break here, they violate STD53.
1 2269
2 1498
3 2816
4 2113
.
RETR 1
+OK 2269 octets follow.
Return-Path: <[email protected]>
Delivered-To: [email protected]
274
...
.
DELE 1
+OK Deleted.
QUIT
+OK Bye-bye.
Connection closed by foreign host.
27.3
Reading Email
27.3.1
Mutt
27.3.2
Gnus
275
27.4
Email Tools
27.4.1
Grepmail searches mailboxes to build a new mailbox with all emails containing the results, so that they can be reviewed with your favourite mail tool.
The default is to search for the pattern in both the head and body of the
email. Only email headers are searched if you specify -h; search is restricted
to email bodies with -b. To be case insensitive use -i and to ignore MIMEencoded blocks use -M. Date searches are effected with -d which allows a date
string in a variety of formats, including -d yesterday, -d "5/18/2001" for
email since 18 May 2001.
The basic use is:
$ grepmail <string> [<mbox>] > <newmbox>
So, for example, you might search for the email containing that meeting:
$ grepmail -RMi "that meeting" ~/mail > meeting.mbox
276
27.4.2
EMail Attachments
27.4.3
MS-TNEF attachments
27.4.4
You may want to do this in a temporary directory to deal with the potential
of uuencode overwritting pre-existing files.
27.4.5
Mailing Lists
27.5
Spam
27.6 Viruses
277
Now tell evolution to filter you email with this script. So, create a new
filter with ToolsFilter and click on Add. Call the new filter something
like SpamAssassin. Select Pipe Message to Shell Command as the first
part of the criteria. Then fill in /home/kayon/bin/spam-filter.sh as the
command to run. Set Does Not Return and 0 for the other fields. For
the action choose a folder into which the identified spam should be placed
(rather than deleting it, just in case spamassassin gets it wrong). Click OK
to close the filter and then OK to close the filter editor. You are now done!
27.6
Viruses
278
:0fw
| clamfilter.pl
:0:
* ^X-Virus-Found: yes
clam-date +%Y-%m
27.7
SMTP Direct
You can talk directly to an SMTP server, for example to test that it actually
works for you. Heres a sample interaction.
> telnet mailhost.act.ktware.com.au 25
Trying 105.83.2.11...
Connected to mailhost.act.ktware.com.au.
Escape character is ^].
220 mailhost.act.ktware.com.au ESMTP Postfix
helo modern.act.ktware.com.au
250 mailhost.act.ktware.com.au
mail from: [email protected]
250 Ok
RCPT TO: [email protected]
250 Ok
data
354 End data with <CR><LF>.<CR><LF>
Subject: Testing manually through telnet to mailhost
This is the body
.
250 Ok: queued as 42DDE139919
quit
221 Bye
Connection closed by foreign host.
Chapter 28
Eye of Gnome: Image Viewer
The Eye of Gnome is an image viewing and cataloging program. It can deal
with large images, and zoom and scroll while keeping memory usage constant.
You can drag a collection of filenames into a window and EOG will open
each of them.
279
280
Chapter 29
Evolution: GNU Personal
Information Manager
Personal Information Managers (PIMs) provide address books, calendars,
to-do lists, and email readers. Evolution, from Helix Code, is the Gnome allin-one PIM similar to Microsofts Outlook. Evolution provides an integrated
desktop environment providing a mail client, address book, and calendar.
29.1
Managing Email
29.1.1
282
Figure 29.1: The Evolution Welcome Screen showing some email from the
Evolution development team at Helix Code.
29.2
29.3
29.4
Chapter 30
File Systems
The default GNU/Linux file system (which defines how data is stored on
a storage device like a hard disk) is call the ext2fs. Ext2fs is an inode
(information node) based filesystem. Inode based file systems store pertinent
file data in inodes. Such file systems have been around since the early days
of Unix. Other inode-based file systems include XFS and BSDs UFS.
Ext3fs extends ext2fs with journaling. Thus, when you reboot without properly shutting down the machine, for example, no more messages about non
clean un-mounts of the file system.
ReiserFS is a very different file system based on fast-balanced trees. It was
proposed by Hans Reiser who took the theoretical concept of AVL-trees to
the task of a filesystem.
283
284
File Systems
Chapter 31
Firewalls
THIS IS OLD. USE IPTABLES NOW.
Debian Pacakges: bastille
A firewall can be set up on a machine connected to the Internet and can then
relay network traffic to machines connected on a local network.
The bastille package provides both a firewall and Network Address Translation (NATalso referred to as IP Masquerading). When installing the
package use the defaults and all should be just fine.
31.1
IPMASQ
31.2
IPCHAINS
With a update to the klogd package (or perhaps it was an update to the
netbase package which contains ipchains, I started getting the following log
285
286
Firewalls
These packets are coming from actdial.ktware.com (125.83.4.1my connection to the internet) and their CISCO router sending regular EIGRP (PROTO=88)
packets. Nothing untoward about this but for some reason the log messages
were appearing on the consoles! Every 4 seconds!
Looking at the current ipchains rules we see rule 11 is the default catch-all:
DENY
all
----l-
anywhere
anywhere
n/a
With the following ipchains command the log messages are stopped:
# ipchains -I input 11 -i ppp0 -d 224.0.0.10 -j DENY
all
all
---------l-
anywhere
anywhere
IGRP-ROUTERS.MCAST.NET n/a
anywhere
n/a
which places the saved rules into /etc/ipchains.save. Load them in again
with:
# /etc/init.d/ipchains load
31.2 IPCHAINS
287
KLOGD=""
to
KLOGD="-c 5"
The messages are now gone from the console, but still remain in dmesg and
/var/log/syslog. Indeed, /var/log/syslog gets filled with these so it still
may be best to turn them off with the ipchains rule.
288
Firewalls
Chapter 32
Floppy Disks
The floppy disk device (i.e., the code that knows how to deal with the floppy
disk drive) is usually /dev/fd0. Under MS-Windows this would be referred
to as drive a:.
In this chapter we cover topics relating to using floppy disks on a GNU/Linux
system.
32.1
In some installations users might not, by default, have access to the floppy
drive. Generally the floppy device (/dev/fd0) belongs to group floppy and
the administrator may need to add a user to this group to grant them access.
This can be done simply with the Gnome interface from ApplicationsSystem
ToolsUsers and Groups. Refer to Chapter 42 for details on managing groups.
Alternatively, from the command line the following has the same effect:
# adduser kayon floppy
32.2
Format a Floppy
The Gnome tool to format a floppy disk is gfloppy, as shown in Figure 32.1.
This can be accessed from ApplicationsSystem ToolsFloppy Formatter.
289
290
Floppy Disks
From the command line there are several options. You can format the floppy
with:
$ superformat /dev/fd0
will also format a floppy, but does not create an file system. A file system can
be created with mkdosfs. You could put, instead of a MS-DOS file system
on the floppy, a Linux file system with:
$ mkfs -t ext2 /dev/fd0
32.3
This user, guest, can then use the mtools commands to access the floppy
disk. These are tools that mimic the Microsoft DOS commands: mdir, mcd,
mcopy, mdel.
32.4
Edit /etc/fstab to add the following line to allow any user to mount /mnt/
floppy which is particularly convenient from the Gnome mount applets which
291
you can click on to cause a mount or unmount. Or create symbolic links for
Gnome from your ~/.gnome-desktop directory to /floppy. Then Gnome
seems to magically do the mounting for you when you open them (they
will appear on your Gnome desktop and you can change the icons to more
appropriate symbols such as a floppy). I guess you better make sure you
unmount the floppy before you physically remove the media.
/dev/fd0
/mnt/floppy
auto
defaults,noauto,users,rw
292
Floppy Disks
Chapter 33
Fonts: X Window System
33.1
Setting Up Fonts in X
"/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
"/usr/lib/X11/fonts/Type1"
293
294
"/usr/lib/X11/fonts/100dpi:unscaled"
"/usr/lib/X11/fonts/75dpi:unscaled"
Now that its all setup, install some font packages. ttf-bitstream-vera
is a rather nice set of fonts, and is Free
(http://www.debian.org/intro/free) enough to go into Debian itself.
Its not in woody yet, but you can download the .deb from
http://http.us.debian.org/debian/pool/main/t/ttf-bitstream-vera/ttf-bitstream-vera_
(or your local mirror) and install it with "dpkg -i
ttf-bitstream-vera_1.10-3_all.deb" (as root). sid and sarge users are
just an "apt-get install ttf-bitstream-vera" away from it. Another
option is ttf-freefont, which is in all three current versions of
Debian.
For Japanese and other non-roman languages, you might want to try these
fonts: tfm-arphic-bsmi00lp, tfm-arphic-bkai00mp, tfm-arphic-gbsn00lp,
tfm-arphic-gkai00mp, hbf-jfs56, hbf-cns40-b5, hbf-kanji48, ttf-baekmuk
and ttf-thryomanes.
Another alternative is to install Microsofts Corefonts. They removed
the fonts from their website, but the msttcorefonts package will
download them for you from a mirror. Note that these are NOT Free (in
the Debian sense), but youre permitted to at least use and download
them.
Both of these packages (and the other ttf-* packages in Debian) should
now Just Work, and appear available to all X programs that use the
regular "core" font system. This includes things like xterm, emacs and
most other non-KDE and non-GNOME applications.
Now, run "xfontsel" and select either "Microsoft" or "Bitstream" in the
fndry menu (click on the word "fndry"). Now look at the ungrayed out
entries in the "fmly" menu. You should have a bunch of either Microsoft
fonts (Verdana, Trebuchet, etc) or some Bitstream ones (or both).
For KDE2.2 and GNOME1.4 (with libgdkxft0, which is a hack to get GTK
295
33.2
Depending on your setup you might find that the default fonts used by the
X Window System are too big. Generally, the default setup is good for
1024x768 resolution but on laptops and older hardware that only support
800x600, for example, it is best to use smaller fonts. To achieve this simply
edit your /etc/X11/XF86Config file so taht the 75dpi (dots per inch) fonts
come before the 100dpi fonts. A snippet from a typical installation is:
Section "Files"
296
RgbPath
FontPath
FontPath
FontPath
FontPath
FontPath
FontPath
FontPath
FontPath
FontPath
FontPath
FontPath
EndSection
Chapter 34
Ghemical: Chemical Modelling
Ghemical is a package for computational chemistry being developed at the
Department of Chemistry, University of Kuopio, Finland. The package supports all-atoms molecular mechanics and reduced protein models. Geometry optimisation, molecular dynamics, and visualisation tools are available.
Ghemical can be directly linked into the quantum chemistry program MPQC
for quantum-mechanical calculations, effectively serving as a graphical frontend for the MPQC program, thus providing various 3D-plots for electron
densities, molecular orbitals, and molecular orbital densities.
297
298
Chapter 35
GIMP: Image and Photo
Manipulation
The GNU Image Manipulation Program (the GIMP) is the open source image and photo manipulator which gives Adobes very popular and powerful
Photoshop a serious run for its money. GIMP is a very powerful tool for
editing images and creating impressive graphics. It is one of the highlights of
all open source software, and demonstrates the quality that can be achieved
through open source development.
This chapter provides a number of recipes for some common tasks using the
GIMP. Many excellent books that unleash the full power of the GIMP are
available and some are mentioned in Section 35.3.
35.1
Use the lasso selection tool to select the red eye region (zoom in first). Then
bring up the Channels dialogue and de-select Green and Blue. Then from
the menus choose Desaturate a few times. That should fix it.
35.2
Image Quality
Image resolution (dots per inch or just dpi) is an indication of the quality
of an image. It is less important for screen images but more so for print299
300
301
ing. Common image resolutions include 72, 120, 300 and 600 dpi (dots per
inch). When producing graphics for web pages or for viewing on the screen
then 72dpi is generally the more popular resolution (and keep the images to
less than about 30K). For scanning and printing, 400dpi is a good quality
resolution.
For printing 100dpi is generally exactly 100 dots per inch. On screen however
this is not always so, as it depends on the resolution of the monitor (so a 72
pixel wide image on a 17 monitor at 640x480 might come out at about an
inch but at 1280x1024 it will be half the size, and so about 144dpi).
When scanning or printing dpi is something that becomes important.
For images meant for display on a screen, as in web design it is the pixel dimension that is more important. Consider two images that are both 100x100
pixels, but one is say 100dpi and the another is 300dpi. They will be exactly
the same size on your monitor but when printed the first image will be 3
times larger then the second.
The GIF format doesnt store any dpi informationonly the pixel dimensions
so when the GIMP saves to GIF you lose your printer settings! When
opening a GIF the resolution will be set to 72dpi.
When designing for screen display of images consider what monitor size will
you want to design for (640x480, 800x600, 1024x768, etc). Then ensure your
final image is not any larger then your screen. You will also need to take into
account that the actual area of your browser is smaller then the screen and
so you should keep images as small as possible.
35.3
Gimp Resources
302
Chapter 36
Glade: GUI Builder
Glade is a graphical user interface (GUI) builder for creating applications
using the GTK+ and Gnome toolkits. It provides a visual tool (c.f. Visual
Basic) to interactively create the GUI on a canvas from components (widgets)
provided by the toolkits. Interfaces can be rapidly developed and source
code in a variety of languages can be automatically generated. Glade directly
generates C source code with support for C++, Ada95, Python, Perl, and
Eiffel available within Glade via external tools. Alternatively, LibGlade can
be used to dynamically create the user interface directly from the XML data
at run time.
As with many Gnome products Glades native save format is XML (gzip
compressed) allowing the interface to be modified, transformed, and viewed
by many other XML tools (or even edited manually in your favourite text
editor if desired). Independent applications that allow differently structured
C source code to be generated directly from the XML data, for example,
exist.
In this chapter we begin with an overview of using Glade. We then proceed through the development of a sample Glade application by way of a
walk-through that will build the interface. This is followed by walk-throughs
that will turn this interface into a fully functional application. These walkthroughs begin with a C implementation and include packaging the application for distribution using the GNU packaging tools (automake, autoconf, and
tar). We then walk through the use of the LibGlade library as an alternative
for C. Versions of the application in Python and C++ are also presented.
We complete this chapter with reference sections covering all aspects of Glade
and some basics of the Gtk+ and Gnome toolkits.
303
304
36.1
Using Glade
36.2
Glade Walkthroughs
36.2.1
305
The left most window above is the main Glade window which will list the
windows and dialogs of your own project. Currently it is empty. The middle window is the Palette window from where you choose the user interface
widgets to include in your interface. The right window is the Properties
window where you can edit the properties of each widget such as its size,
behaviour, and signals it responds to. There are two other Glade windows
not shown but which can be displayed by selecting them from the main windows ViewShow Widget Tree and ViewShow Clipboard menus. We will
see them later.
306
Project Options
Our first task is to start a
project by editing the Project Options through the Options button of the main Glade window
(or else through the FileProject
Options menu).
By default
the Project Directory listed is
set to /home/guest/Projects/
project1 (where guest is the
current usernameit will be your
username in your case). In the
figure on the right the user has
edited this to replace the default project1 sub-directory with gwordsa
more descriptive name for this application. Note that the Project Name, Program Name and Project File have automatically changed to reflect the change
in the Project Directory. We will leave these defaults as they are since they
represent good choices. See Section 36.3.4 for details.
The remaining options we wont change either. Again they are generally
good choices. Note in particular though that we have the Enable Gnome
Support option turned on. You can take a look at the other two option tabs,
C Options and LibGlade Options, to get an idea of what else you can configure
(see the Reference sections later for details). When satisfied simply click the
OK button. The main Glade windows title will have changed to be Gwords,
the name of our application, replacing the previous <untitled>.
307
dialog boxes, message boxes, a standard Gnome About Dialog, file entry field
with a browse button, a pixmap entry field with built-in preview, and a druid.
Well see some of these later and all of them in the reference sections. For
now we simply create the Gnome Application Window.
You will be presented with a new window that has many of the characteristics
of a Gnome application window. There
is the menu bar along the top with the
usual File, Edit, View, Settings, and Help
menus, most including standard menu
items within them. This is followed by
the default toolbar with the New, Open,
and Save buttons. Below this is the canvas area where you will construct your interface. At the bottom is the status bar
and a progress monitor. Note that not all
menus and toolbar buttons will be useful for your application and you will
have others in mind that you may wish to add. Feel free to click around the
window and see the menus by clicking the menu twiceonce to select the
menu itself then once to open up the menu to show its sub-items. Also note
how widgets are identified in the Properties window as you select the widgets.
Adding Widgets
For now lets ignore the excess of decoration. Instead we will build the
basic interface components. Theres not much that we need in the interface.
Certainly we need to identify the file to be word counted. Also we want to
identify whether to just count the words or also the lines and bytes.
We go back to the GTK+ Basic palette for one of the layout widgets. These
are towards the bottom of the palettethird row from the bottom in fact.
Hover the mouse over each of them to find the Horizontal Box, Vertical Box,
Table, and Fixed Positions. Click on the Vertical Box layout. Now on the
central canvas area of your Gwords interface click the left mouse button. You
will be asked for the number of rows for your boxthe default of 3 will do
for now so just click on the OK button. Your canvas will be divided into 3
rows. Each one of the 3 rows can now be constructed independentlyeach
can contain a different widget, including further layout widgets.
We will use the first row to identify the name of the file whose contents we
308
will be counting. We will use a file entry box to allow for the entry of the
filename. We will also add a label so that we know what the file entry box
is for. That means two widgets and all we have is a single rowso we need
to add a Horizontal Box with two columns. Find the Horizontal Box on the
GTK+ Basic palette, click it with the left mouse button and then click in the
top row of the three rows of our canvas. When prompted select just 2 (rather
than the default 3) columns for this Horizontal Box.
Labels should probably go to the left of the entry
box so we will place the label first. Select the
Label widget from the GTK+ Basic palettethe
first item on the second row. Now click in the
top left box of our canvas (this is the left most of
the two cells we have just created). A GtkLabel
widget should now appear with the label label1
(and some resizing of the cell might occur). This
is now our first real widget. Of course we dont
want the label to read label1 (even though we
might leave its nameas distinct from its label
textas label1 for now). We can change the label text through the Properties window where you
will find the fields relevant to this widget (assuming it is still the selected widget). Change the Label field to be File: (replacing label1). For good measure set the X Pad field to be 10 (so that the
widgets wont look so cramped). You will see the effect of these immediately.
To summarise so far. A basic Gnome Application
Window has been created with the default menu
bar and toolbar and a Gnome Application Bar at
the bottom. We have added a 3 row Vertical Box
and in the top row of this a 2 column Horizontal
Box. In the resulting top left cell we have added a
Label widget and changed the text to be File:.
It also has its X Padding set to 10 to give a less
cramped layout.
Removing Widgets
You can remove widgets easily through the menu on the right mouse button.
First click on a widget with the left mouse button to select it. The right
mouse button will then list the actions you can perform on this widget,
309
including cut and delete. Note also the list of parent widgets all the way
up to the root widget which is called app1. Before proceeding lets explore
this widget pathway in a little more detail.
310
311
Check Buttons
We will now add a label and 3 check buttons to the next row of our canvas.
This will be used to indicate what we want counted: words, lines, and bytes.
So we need space for 4 widgets which we achieve with the Horizontal Box
widget of the GTK+ Basic palette. When prompted change the default 3
columns to 4 columns.
Add a Label to the first cell of this row and change the text of the label to
What to count:. This label is called label2 in our collection of widgets.
You may like to set the X Pad field to 10.
Now add a check button for Words in the next cell of this row. The
check button widget is the third widget of the third row of the GTK+ Basic
palettethe third row contains 4 different types of buttons. Select the Check
Button from the palette with the left mouse button then click the left mouse
button in the second cell of the second row of your canvas. This creates a new
widget called checkbutton1. Change the Label: text field in the Properties
window for this new checkbutton to read Words. Similarly add check buttons for Lines and Bytes. That is, select the Check Button on the palette
again then click in the next cell of your canvas. Note that after you place
a widget on your canvas the selected widget button on the palette becomes
in-active and the left mouse button reverts to being used for selection.
By default we will only count
words so the Words button should
be on by default. This is easily achieved by editing the widget
properties. Select the Words button on your canvas. Then in the
Properties window under the Widget tab click on the button that
says No alongside the Initially On
label. This will change this propertys button to be indented and to read Yes
and the corresponding check button on your canvas is now also turned on.
Also add tooltips for each check button, selecting each of the check buttons,
in turn, and adding text to the Tooltips field of the Basic tab of the Properties
window.
312
Removing a Row
We now realise that we didnt really need 3 rows for vbox1. Two are sufficient.
Select the third row. You may notice that the Properties window goes blank
and from the right mouse button menu this row of our canvas is nothing
more than a Placeholder. The right mouse button menu Delete will remove
it for us. You could put it back anytime (or indeed place any row within
vbox1) through the right mouse button menu. Select any widget within
vbox1 (e.g., the Words check button checkbutton1) and then with the right
mouse button traverse the menu to select vbox1Insert After.
Editing Menus
We will now tidy up the menus, removing those that dont apply, and adding
a new one to perform the actual word count.
36.2.2
313
Once you have your basic user interface constructed tell Glade to save the
project (using the Save buttonthis updates the file that contains the XML
description of the interface) and then to build the project (using the Build
button).
Start up a terminal window, such as the gnome-terminal, and change to the
project directory. There you should see an executable file called autogen.
sh. This shell script takes care of the initial configuration of your package,
running automake to automatically generate the appropriate support files for
the configuration. It also runs the appropriate automake components leaving
you with a collection of Makefiles.
$ cd Projects/gword
$ ./autogen.sh
**Warning**: I am going to run configure with no arguments.
If you wish to pass any to it, please specify them on the
./autogen.sh command line.
processing .
deletefiles is
Creating ./aclocal.m4 ...
Running gettextize... Ignore non-fatal messages.
You should update your own aclocal.m4 by adding the necessary
macro packages gettext.m4, lcmessage.m4 and progtest.m4 from
the directory /aclocal
Making ./aclocal.m4 writable ...
Running aclocal -I macros ...
Running autoheader...
...
creating
creating
creating
creating
creating
creating
Now type
Makefile
macros/Makefile
src/Makefile
intl/Makefile
po/Makefile.in
config.h
make to compile the package.
You can now simply run the make command to perform the compilation
314
(making use of the generated Makefiles). Once completed, run the command
src/gword to start up your application.
$ make
$ src/gword
315
To recompile we simply run make again, either directly in the src directory
or else in the gword directory.
Packaging For Distribution
Describe the make dist and make dist-check functionality.
36.2.3
Using Libglade C
36.2.4
Using LibGlade with python is an excellent option for rapid prototyping and
even build full strength applications. Like the use of LibGlade in C there
is never any need for you to convert the .glade file (containing the XML
description of the interface) into Python code. Instead, LibGlade reads the
XML and directly builds the interface using the LibGlade library (written in
C but with an interface for Python).
The basic code is:
#! /usr/bin/env python
import gtk
import libglade
import gnome.ui
def init_app ():
"Initialise the application."
global wTree
wTree = libglade.GladeXML ("gwords.glade", "app1")
dic = {"on_quit_button_clicked"
: gtk.mainquit,
"on_exit1_activate"
: gtk.mainquit}
wTree.signal_autoconnect (dic)
def main ():
init_app ()
gtk.mainloop ()
316
Here we have linked the interface callback on exit1 activate to the library
callback gtk.mainquit. The on exit1 activate is associated through Glade
with the Exit menu item and is supplied by default by the Gnome Application
Window.
Save this code into a file called gwords.py in your /home/guest/Projects/
gwords directory. Make the file executable with chmod u+x gwords.py.
Then run the program with ./gwords.py. Your interface should come to
life.
Problems arise if you dont have the appropriate packages installed. At a minimum make sure you have python-gnome installed (this package will depend
on various other python and gnome packages which should be automatically
installed by choosing to install python-gnome if you are using Debian).
You may also need to ensure that the PYTHONPATH environment variable
includes the gnome and gtk modules, but check this only if you have problems
running your Python program.
36.2.5
In this section we cover some of the commonly used functions and concepts
you need to know about when writing code to add functionality to your
interface.
36.3
Glade Reference
36.3.1
317
void
on_button1_clicked
(GtkButton
gpointer
*button,
user_data)
{
GtkWidget *entry1;
entry1 = lookup_widget (GTK_WIDGET (button), "entry1");
...
}
Internally Glade uses gtk object set data() for storing pointers to all the
widgets in a window using the names set in the property editor as the key.
Then, inside lookup widget(), gtk object get data() is used to retrieve
the pointer indexed by this key. These two functions are also available to the
developer for their own purposes.
318
Using Libglade If you are using LibGlade to create the interface for you
dynamically you will make use of glade xml get widget() to access you
widgets. The LibGlade approach stores its widget pointers differently.
Using the GTKExtra Libraries
To make use of these libraries you will need to add the appropriate libraries to
your src/Makefile.in and make appropriate modifications to autogen.sh
and configure.in. Or perhaps you ONLY need to add to the appropriate
LIBS line in src/Makefile.am. This seems more likely.
Global and Local Pointers
An eternal issue in GUI development is how to get hold of the pointer to the
individual widgets when you need them. Should they be accessed from global
pointers that then restrict you to a single instance (or a known number of
instances) of the widgets a priori, or is there a better mechanism?
Global Top Level Widgets One solution is to have the top level widgets
global. This then allows all child widgets to be accessed using lookup widget()
provided by Glade.
Nothing Should be Global This is a pretty fundamental goal in programming and should be followed whenever possible. Here we identify how
to avoid having globals.
36.3.2
Normally you construct your GUI interactively with Glade and then choose
to build the C code for the interface with the Build button. It is sometime
inconvenient to fire up Glade just to build the C source code from the Glade
XML file. Instead you can do the conversion from the command line with:
$ glade --write-source <gladefile>
36.3.3
319
New Project The New Project returns the project options to their default
values (the same as when you start Glade without providing it a project file
name). You will be asked to confirm that you wish to start a new project.
Be sure you have saved the current project (if there is one) before you start a
new project. Click the Cancel button on the popup if you have not yet saved
the current project and wish to do so. Then choose New Project again. Click
on the OK button to proceed.
Open If you have an existing Glade project you can Open it through this
menu item, or through the Open button of the toolbar, or through the F3
shortcut, or else on the command line if you start glade from a gnometerminal. Via the menu, button, or keyboard shortcut you will be presented
with a File Selection Dialog to choose the Glade project file.
Like all Gnome (actually all Gtk+) applications tab-completion is active in
the File Selection Dialog. Thus you can type Pr<tab> and it will be completed to Project/gwords if that is the unique completion. For non-unique
completions you will see a list of possible completions in the File list.
320
Save Glade currently does not keep tabs of whether you have saved your
project. Be sure to do so with the Save menu item or the Save button or
the Ctl+S keyboard shortcut. You can do this anytime and it is useful to
be in the habit of saving your project regularly. Saving the project writes
the current interface to a Glade project file which stores the interface in a
compressed (gzip) XML format. See Section 36.3.7 for details of the save
format.
The first time a project is saved (when no project file already exists) Glade
will present the Project Options dialog. This gives you an option to set the
location of the project files and to set various source code options.
Each time Glade saves the project the previous version is saved into a backup
file (e.g. gwords.glade.bak). Only the most recent backup is kept.
Build Source Code The FileBuild Source Code menu item (and the
Build button and the Ctl+W keyboard shortcut) will generate the source code
that implements the interface.
The language code generated is chosen from the Project Options dialog under
the General options tab (see section 36.3.4). The default is C source code
which is supported natively by Glade. Generation of C++, Ada95, Perl,
and Eiffel is effected through helper applications from the packages glademm
(for the glade program), gate, glade2perl, and eglade respectively. These
need to be available on your system if you are to build the interface in these
languages. If Glade can not find the appropriate helper application it will pop
up an explanatory window and show the message Error writing source
in the main window status bar.
See Section 36.3.3 for a description of the files generated by a build for C.
When you select to build your project source code if you have not previously
saved the project the Project Options dialog will be displayed allowing you
to set the project paths and other options. Otherwise Glade will silently
generate the source code.
Project Options The FileProject Options... item will bring up the Project
Options dialog. See Section 36.3.4 for details.
Exit To exit Glade choose the FileExit menu or else the Ctl+Q keyboard
shortcut. Glade will ask for confirmation (but it has no indication of whether
321
you have saved the projectmake sure you have saved your project).
Cut The EditCut menu item (and its Ctl+X keyboard shortcut) will remove the selected widget (and all of its children widgets) from the canvas.
The widget (together with its children) will be placed on the clipboard as a
single item. Later on you can select this widget on the clipboard and paste
it onto your canvas.
Copy The EditCopy menu item (and its Ctl+C keyboard shortcut) is
similar to Cut in placing the widget (and its children) on the clipboard,
except that the widget is not removed from the canvas.
Paste After cutting or copying a widget the EditPaste menu item (and its
Ctl+V keyboard shortcut) will place that widget onto the canvas to replace
whatever is currently selected. This may mean that a currently selected
widget will be replaced by the pasted widget. To avoid this ensure that what
is currently selected is an empty place holder.
What is actually pasted at any time depends on what is selected in the
clipboard. By default the most recently cut or copied widget is selected in
the clipboard. You can change the selected widget in the clipboard simply
by clicking on it.
Clear The EditClear menu item will delete the selected widget from the
canvas. The widget is not saved on the clipboardit is removed permanently.
322
323
36.3.4
Project Options
The Project Options dialog allows you to tune many aspects of the project
you are developing with Glade. The types of options fall under three tabs:
General, C Options, and LibGlade Options.
General
The General options cover the
project location, project names,
programming language, and if to
support Gnome.
324
When you save or build a project the directories will be silently created as
needed.
The Project Name is the name of your project. This will be used as the title
of the main application window you create (the Gnome Application Window).
The name can have spaces and other characters. As you change the name
of the project the Program Name, and Project File fields also change to reflect your project name (with spaces and other non-alphanumeric characters
converted to dashes).
The Program Name is the name by which the final executable program will
be known. This is used by Glade to name the output executable file in the
Makefile it generates. Once again, as you change this field the following field
(Project File) automatically changes to be the same. The previous fields do
not change.
The Project File is then the file located in the Project Directory in which the
interface is saved. This file has the extension .glade and is a gziped XML
document that records all of the project information. See Section 36.3.7 for
details.
Gnome The Enable Gnome Support check button causes Glade to generate
the appropriate calls to initialise a Gnome application (rather than a Gtk+
application). For a Gnome project this should always be enabled.
C Options
325
326
36.3.5
Widget Properties
36.3.6
Widget Palettes
List all of the widgets provided by each palette and basic description and
functionality.
The GnomeDruid
The GnomeDruid is the Wizardlike widget that has a sequence of
windows with Next and Back buttons and a Finish button on the final window of the sequence. The
GnomeDruid widget has a stylised
start page (GnomeDruidPageStart
327
36.3.7
36.4
Glade Resources
Once you get into writing code you will need the GTK+/Gnome API documentation and might find the tutorial at http://www.gtk.org/tutorial/
and the API documentation at http://developer.gnome.org/doc/API/
api-toc.html useful.
You can find an introductory article on using LibGlade with Python at http:
//www.linuxfocus.org/English/July2000/article160.shtml.
Some useful books include:
Beginning GTK+ and Gnome Programming by Peter Wright. 613
pages, published May 2000 by Wrox Press, ISBN 1861003811. Covers glib,
Gtk+, and Gnome. Also covers Glade but rather skimpily. Suitable for the
beginner.
GTK+/Gnome Application Development by Havoc Pennington. 492
pages, published August 1999 by New Riders, ISBN 0735700788. Provides
extensive coverage of the GTK+/Gnome APIs and is a good guide to getting
up and started with Gtk+/Gnome.
Developing Linux Applications with GTK+ and GDK by Eric Harlow. 512 pages, published February 1999 by MacMillan, ISBN 0735700214.
Provides a basic introduction to using the GDK and GTK+ toolkits, but not
the Gnome toolkit.
Teach Yourself Gtk+ Programming in 21 Days by Donna Martin, et
328
al.
GTK+/Gnome Application Development by Havoc Pennington.
Gnome/Gtk+ Programming Bible by Arthur Griffith.
Linux Application Development by Michael K. Johnson, Erik W. Troan.
36.5
Acknowledgements
36.6
Using Napster
FROM http://www.funky-penguin.co.uk/index.php
Multimedia : Napster on Linux
If you havent heard of Napster then you have been sitting in from of your
Linux box staring at Emacs/vi (no arguments please). Napster is a file
sharing system which can be used for pointing users towards other users
who have the file the first user was looking for. The client that the user runs
contacts the server and sends it a list of the files available for download, when
a user does a search for a file the server searches through its database of users
and files and gives the user a list of other users the file could be downloaded
from. No files are stored on the server, it just acts a matchmaking system.
The Napster system started as a client for Wintel systems, but the protocol
was reversed engineer and many new clients and servers have been coded,
many are open source.
329
330
MOTD (Message Of The Day). Goto the seach tab and enter a search phrase,
shortly a list of files matching your search will be displayed. Right click over
the file you wish to download and select Dowload File. You will notice that
the text of the download tab goes white, this indicates something has changed
whilst you are not looking at it. The download tab shows the files you are
downloading and and the upload tab shows the files people are downloading
from you. There are many cool features available in the download and upload
sections which are beyond the scope of this document, have a fiddle and find
out for yourself what they do.
One area where I will go into detail is the console/chat section of the client.
If you havent changed the default settings then when you connect you will
automagically be dropped into the channel gnapster (shown below). You can
join a channel using /join channel-name and leave a channel /part channelname. You can have multiple channel windows open and even chat with a
person 1 to 1 using the /query username command. The chat system is very
close to IRC and some other IRC commands are also supported /help gives
you a full list.
If the official Napster network has been closed down when you read this then
dont worry as a network of interconnected Opennap servers is available for
your use, your client will most likely provide you with a list of these.
331
332
36.7
Gnome Hack
Gnome hack is a game that lets you have an adventure. First you choose
who you want to be. You can be any character like an elf, wizard, caveman,
knight etc. Then you read the history and your mission. Then you use the
arrow keys to move your character. If you find something on the ground you
go to the tool bar and then go to action and click on get.
Sometimes jackal and bugs and gobiens can atak so you go to action if you
dont have any thing to throw go to kick if you do have something to throw
then you go to throw/shoot and then it will say in which direction [ when
you pick up something it will have letter when you want to use your item
press the letter after you click on what you want to do with it]
Chapter 37
Gnome: The Desktop
Gnome is desktop for Unix and GNU/Linux delivering a high level of usability and interoperability. The Gnome Foundation, initiated in August 2000,
brought together many of the major Unix vendors, including Sun Microsystems, IBM, HP and Compaq, to support the further development of Gnome.
Sun, for example, has identified the Gnome desktop as the standard for Solaris, one of the most popular commercial versions of Unix.
Gnome, an abbreviation for the GNU Network Object Model Environment, is a
component-based system built around standards such as XML and CORBA.
It offers a standard for look-and-feel and provides a platform for applications to share resources (like including graphics generated using the Guppi
application in a spreadsheet within Gnumeric).
While we refer to a common look-and-feel for Gnome there is much more.
While all Gnome applications have the same look-and-feel, you can choose
the look-and-feel (usually referred to as the theme) to suit your own style.
The variety of different themes is extensive and includes themes that can
make your desktop appear like MS-Windows or Apples Macintosh, to name
just two. Once you choose a theme all of the Gnome applications will use
that theme immediately. You can change themes (using the Toolbox) at any
time. The theme used in this book is the Default theme that is similar to
the HeliX theme but using a lighter grey in the background (and hence more
suitable for the screen images used here).
In this chapter we begin with the basics of the Gnome desktop and walk you
though interacting with Gnome applications, including menus, toolbars and
dialogs. This is followed by reference sections identifying Gnome applications.
333
334
37.1
Using Menus
Menus in Gnome applications work in much the same way as other applications. The left mouse button is used to select a menu. You can either click
the mouse button on the menu or else hold the mouse button down over the
menu. In both situations the menu will stay until you make a choice or else
click somewhere else on the window.
Generally there are four types of menu items. The first have a right pointing
arrow and lead to further sub-menus. The second type may have a small icon
and some text followed by three dots. These items lead to dialogues that ask
for further information. The third type also may have a small icon followed
by some text but no dots. These items perform their action immediately on
selection. Finally, some menu items represent options that can be turned on
and off.
All Gnome applications have at least a File menu and a Help menu. The
File menu contains at least an Exit with keyboard shortcut to Ctl+Q. The
Help menu contains an About item which opens a dialogue that identifies the
application, author, version and date.
37.1.1
Tear-Off Menus
335
menus this fact is lost and you will need to tear them off again.
37.1.2
Shortcuts
Menus will often have combinations of keys that can be used as a shortcut.
These keyboard shortcuts will usually appear to the right within the menu
itself as a reminder. The associated keyboard shortcut is usually a combination of keys beginning with Control or Alt. Pressing the specified key
combinations has the same result as choosing the menu item. For example,
if the Edit menu has a Cut choice with a keyboard shortcut of Ctl+X then
holding down the Control key while you type the X key has the same effect
as choosing the Cut menu item.
Many shortcuts are in common usage amongst Gnome applications and will
be familiar to users of the Win32 OS. These include:
New
Open
Save
Print
Close
Quit
Ctl+N
Cut
Ctl+O or F3 Copy
Ctl+S
Paste
Ctl+P
Select All
Ctl+W
Undo
Ctl+Q
Redo
Ctl+X
Ctl+C
Ctl+V
Ctl+A
Ctl+Z
Ctl+R
Find
Replace
F6
F7
A powerful feature is that you can choose your own shortcuts whenever you
wish. To do this, simply move the mouse over the menu item whose shortcut
you wish to redefine (or to define if it currently does not have one) and
type the keyboard shortcut you wish to associate with that menu item. For
example, to map Cut to Shft+Ctl+Alt+X simple move the mouse to the Cut
menu item and press all four keys at the same time. This is probably not
a very useful binding, but its unlikely to be used for anything else, so its
a save choice to play with! Note that if the new shortcut previously was
associated with another menu item, the previous binding is lost.
If you use Shft+X as a shortcut it will be accepted but may not be useful. If
the context is a text editor then Shft+X will be captured to capitalise the x
rather than passed on as a shortcut. Other combinations involving the Shft
key work just fine, such as Shft+Alt+X and Shft+Ctl+X. Some applications
(e.g., nautilus) automatically save your shortcuts so that next time they will
appear. Others (e.g., bluefish) provide an option for you to save them if you
decide they are suitable.
Finally, some shortcuts might be identified by the applications as immutable
336
37.2
Toolbars
37.2.1
Floating Toolbars
Toolbars (and menubars) can float. The left end of each toolbar and menubar
contains a raised dotted image like that above. By placing the mouse over it
and holding the left mouse button down you can drag the toolbar to wherever
you like before releasing the mouse button.
Unlike floating (or tear-off) menus a floating toolbar or menubar does not
remain in the main window. You will have at most just a single instance of
a toolbar.
A toolbar or menubar can be returned to the parent window simply by dragging it back there. You can even drag the toolbars to the bottom of the
parent window if thats where you like them to be.
37.3
Dialogues
37.3.1
When prompted to load or to save files the dialog does not show any hidden
directories (those beginning with a period). To get them displayed, simply
enter a period in the Selection text field and press TAB.
37.4
Gnome Applications
There are many Gnome applications freely available either from the Internet
or else available for purchase from distributors. We identify here a selection
337
Figure 37.1: Toolbars and menubars can often be torn away from the main
window or even located elsewhere within the main menu. Here, the dia
application menubar is moved to the bottom of the main window and then
out of the window altogether.
File Managers
nautilus: See Chapter 59.
mc
HTML Editors
See Chapter 43.
bluefish: See Section 43.1.
quanta.
screem.
338
37.4.1
Other Applications
339
340
Games
gnomehack
memblocks
Educational
gperiodic
ghemical
37.5
Desktop Managers
37.6
Window Managers
37.7
Other Desktops
341
37.7.1
KDE
The one thing that significantly held back the wide acceptance of the excellent
KDE desktop was the fact that it used the QT+ toolkit for its graphical
user interface development. For many years this toolkit did not meet the
requirements of the General Public License (GPL) and so could not legally
be included in many distributions. Indeed, because of this the Gnome project
was begun. By September 2000 when it was announced that the new version
of QT+ (2.2) would be released under the GPL Gnome was already catching
up to KDE in its development and many of the major Unix players had
decided to adopt Gnome.
Nonetheless, KDE remains a good alternative to Gnome providing a collection of well developed applications. It should be noted though that all of
these applications can run under any desktop, including Gnome (but perhaps
losing some functionality such as drag-and-drop between applications). And,
conversely, Gnome applications can also run under KDE. The significance of
the desktop is the look and feel of the associated applications and underneath how they inter-operate. Otherwise they are simple X Window System
applications and can run whether you are running the corresponding desktop
application or not.
We will review some of the KDE applications as alternatives to the related
Gnome application in the relevant chapters of this book.
37.7.2
XFCE
The aim of XFCE is to provide a simple and very small desktop requiring
minimal resources but providing a sufficient feature set for the genral user.
Xfce is actually based on the GTK+ toolkit as is the Gnome desktop.
342
37.8
Troubleshooting
37.8.1
Locked File
If you have your home directory NFS mounted and log onto Gnome multiple times, make sure ORBIT can talk TCP/IP to communicate with your
other gconf daemons. To enable this uncomment the following line in /etc/
orbitrc:
ORBIIOPIPv4=1
37.9
Gnome Resources
37.9.1
Gnome Books
Chapter 38
GnuCash: Finances
This software might be useful for running a business.
343
344
GnuCash: Finances
Chapter 39
Gnumeric: Spreadsheet
From humble beginnings the spreadsheet has become one of the most useful
tools on the computer desktop. Serving very many different purposes, all
essentially dealing with numbers, spreadsheets provide a platform for tabulating numbers and automatically peforming operations on those numbers.
Spreadsheets today provide a comprehensive array of functions for all kinds
of purposes, together with impressive graphical reporting facilities.
The Gnome desktop supplies the gnumeric spreadsheet modeled on Excel.
When you start gnumeric for the first time you will get an empty spreadsheet
ready for your to work with, as in Figure 39.1.
346
Gnumeric: Spreadsheet
The spreadsheet acts as a simple timesheet to monitor time spent on particular tasks and to keep an accumulated total earned. You might imagine
your child keeping track of their pocket money!
39.1
Other Spreadsheets
39.1.1
39.1.2
KSpread
39.1.3
ApplixWare Spreadsheet
347
348
Gnumeric: Spreadsheet
349
350
Gnumeric: Spreadsheet
Chapter 40
GQView: Viewing Images
You can use gqview for presentations where your presentation is a collection
of images (one image for each slide!). Click the button to go to full screen.
351
352
Chapter 41
Graphics
Graphics packages available include:
eog: Eye of Gnome
gthumb: A graphics file browser that displays thumbnail images.
Also see R and Python for other graphics information.
41.1
Graphics Editors
354
41.1.1
Graphics
With xfig figures are drawn using objects such as circles, boxes, lines, spline
curves, and text. Images can be imported, supporting formats such as gif,
jpg, and eps.
Xfig saves its figures in its native Fig format that may be converted into
various formats such as eps, gif, and jpg
Other applications can produce output in the Fig format, including gnuplot
and xgraph, both of which can generate graphs direct from the corresponding
data. Alternatively, pstoedit can generate input suitable for editting with
Xfig.
Figure 41.1: Xfig is an older Unix-based vector graphics tool. It has been
quite popular and although its interface is showing signs of its age, it remains
a useful and powerful vector graphics editor.
41.2
Common Operations
41.2.1
355
Many fine packages provide plotting capabilities. See Chapter 71 for plotting
capabilities in the R statistical package.
Gnuplot
Examples using gnuplot:
gnuplot>
gnuplot>
gnuplot>
gnuplot>
gnuplot>
gnuplot>
gnuplot>
gnuplot>
gnuplot>
gnuplot>
GDChart
This charting toolkit with bindings for Python is available from http://
athani.pair.com/msteed/software/gdchart/. However, for sophisticated
plotting the R statistics package is recommended, particularly through its
Python interface RPy. See Chapter 71.
Some of the required packages include: python2.1-dev zlib1g-dev libpng2-dev
libjpeg62-dev.
Installation is straightforward. (Note that there is not currently a Debian
package for python-gdchart so need to compile and install it. The installation
is in /usr/local because of this.)
$ wget http://athani.pair.com/msteed/software/gdchart/gdchart-py-0.6.tar.gz
$ tar zxvf gdchart-py-0.6.tar.gz
$ cd gdchart-py-0.6
356
$
$
$
#
#
#
#
Graphics
perl -pi -e s|local/include/python2.0|include/python2.1| Makefile
make
su
cp gdchart.so /usr/local/lib/python2.1/site-packages/
chown root.staff /usr/local/lib/python2.1/site-packages/gdchart.so
chmod o+rx /usr/local/lib/python2.1/site-packages/gdchart.so
exit
Ggobi
The Debian ggobi package is a GTK+ version of xgobi, an interactive dynamic
data visualisation program. There is a Python interface to ggobi. However,
for sophisticated control over the generation of plots and graphs, see the R
statistics package (Chapter 71), particularly with its Python interface RPy
(Section 70.2.2).
41.2.2
Screen Capture
At times one comes across the need to capture the screen. That is, to save
what you see on your display, or in a window on your display, into an graphics
file. Perhaps you want to impress your colleagues with how youve managed
to settle upon a wonderful combination of Gnome and Sawfish themes (Section 85).
Gnome Screen-Shooter
An excellent solution is the Gnome Screen-Shooter applet. This little applet
sits in your gnome panel and is ready to take a snat at your whim.
Using ImageMagick
Try imagemagick with screenshot...I think or something like that ...its part
of the Gnome desktop environment
41.3 Conversions
357
Using xv
41.2.3
Thumbnails
41.2.4
Suppose you have a PNG graphics file that you want to place on your web
page but its background is white, whereas your web page is blue. Make the
PNG background transparent with:
41.3
Conversions
41.3.1
PostScript
A useful tool for converting from PostScript to other editable formats (including vector formats like fig and svg) is pstoedit.
To convert from PostScript to XFig placing the output into example.fig:
$ pstoedit -f fig example.ps
358
Graphics
This determines an accurate bounding box and trims the image to that box.
Chapter 42
Groups: Managing Access
Permissions
Every file and folder in a GNU/Linux system belongs to a group. Each user
is also a member of a group. Groups are used to control collections of users
who may have access to particular files and folders.
A Debian GNU/Linux system creates some standard groups and users. The
system administrator can also create new users and may also create new
groups. Groups can be managed using the Gnome users-admin tool, accessed from ApplicationsSystem ToolsUsers and Groups. By default this
shows only users, but you can access groups by selecting the More Options
button. This allows you to add new groups and to add and remove users
from groups.
We list below the standard groups and users, but the reader is referred
to /usr/share/doc/base-passwd/users-and-groups.html for further details.
359
360
Group
root
daemon
bin
gid
0
1
2
sys
adm
tty
disk
lp
news
uucp
proxy
kmem
10
13
15
dialout
20
fax
voice
cdrom
21
22
24
Description
This is roots primary group.
A group for non-root daemons.
This group exists for historical reasons and some programs wont run without it.
This group exists for historical reasons and some programs wont run without it.
Most of the log files (in /var/log) are group readable
by users who belong to his group. You can add users
who need to monitor such log files to this group. Note
though that sometimes private information can be accidentally included in logs, like passwords when connecting via PPP over a Modem. This should not happen
(the scripts that write the logs should identify these as
not being echoed) but the potential for mistakes is there.
The terminal devices with names beginning with /dev/
tty are group accessible to group tty. Programs such as
write and wall need access to /dev/tty and they set
their group id (sgid) to tty.
The disk device nodes are group accessible to disk so
that programs that need access to them are sgid disk.
Jobs associated with the lp (printer) daemon (lpd) are
group accessible to the lp group so that lpd can access
them without being root.
mailbox spool directories belong to group mail, MUA
software runs setgid mail. This makes dot locking possible. Also, mailboxes must be writeable by group mail
(Policy Manual, 3.1.1.1, 5.6).
standard group for user news. Why does news have its
own group, and many of the other daemon uids dont?
uucp jobs are group accessible to uucp.
web cache files are group accessible to proxy.
/proc/kmem is group accessible to kmem. Programs
that need access are sgid kmem.
ppp- and isdn device nodes are group accessible to dialout. Include users allowed to initiate dialout in this
group.
fax jobs are group accessible to fax.
voice messages are group accessible to voice (vgetty)
361
floppy
tape
25
26
sudo
audio
27
29
dip
30
majordom
30
postgres
32
www-data
33
backup
msql
34
36
operator
list
irc
37
38
39
src
40
gnats
41
shadow
42
utmp
43
video
staff
44
50
362
games
qmail
users
Chapter 43
HTML Editors
HTML editors include bluefish, screem and quanta. Bluefish is the standard
Gnome editor.
43.1
Bluefish
Editing HTML (and indeed any type of XML document) is supported through
bluefish, a purpose built editor based on the Gnome edit toolkit. Bluefish is
described as a programmers HTML editor because it is not a graphical editor (in that you work directly with the mark-up, i.e., the actual HTML tags,
rather than with how the final page might look, as with Netscape Compser).
Features include a multiple file editor, multiple toolbars, custom menus, image and thumbnail dialogs, open from the Web, CSS dialogs, PHP, SSI and
RXML support, HTML validation, and many wizards.
Figure 43.1 shows the basic interface editing a simple HTML document.
Syntax highlighting has been turned on under the ViewHighlight syntax
menu. You may also need to initialise a set of highlighting patterns with
OptionsListsReset syntax highlighting. You can refresh the highlighting
with ViewRefresh highlighting or else F5.
When you are ready to see what your marked up document will look like in
a browser simply select ViewPreview or use the F4 keyboard shortcut.
363
364
HTML Editors
Chapter 44
ImageMagick
ImageMagick is the tool for transforming images.
The command line mogrify is excellent for changing the size of an image.
mogrify -geometry does that, maintaining the images aspect ratio (the specified width and height are maximum values) append the geometry with an
exclamation point to force a change to aspect ratio.
Rotate an image with -rotate
Reduce the colors in an image: mogrify -colors 2 filename
To also dither the image: mogrify -colors 4 -dither filename
Monochrome image: mogrify -monochrome filename
Annotate image: mogrify -comment Hi there filename
Add borders to image (pixel width and height): mogrify -border 2x4 filename
Decorative border: mogrify -frame 20x20 filename
365
366
ImageMagick
Chapter 45
Initialisations on Booting
The Debian GNU/Linux kernel loads init very early on in the boot process,
using /etc/inittab as its configuration file. This file defines the default run
level and what should be done for each run level.
If you have a look at the processes running on your system (with the command line ps or with the graphical Gnome utility gtop) you will see that the
init process has process identifier of 1 (unless you are running a more secure
GNU/Linux where random numbers are assigned to the processes).
The initialisation table (/etc/inittab) is where system initialisations occur.
This table consists of records with four fields separated by a colon:
id:runlevels:action:process
The first field is an identifier. The second lists the runlevels for which this
record is relevant. The third is the action to be performed. The fourth is the
command to be run.
In this chapter we look at how the GNU/Linux system is initialised. See
Chapter 12 for an explanation of the boot process and how to control booting.
45.1
Run Levels
The runlevel is an identifier for each of the different states in which the
GNU/Linux operating system can be running, such as in single user mode,
367
368
Initialisations on Booting
multi-user mode, and halt and reboot modes. Generally a GNU/Linux system is running in multi-user mode.
The first script run by init, after booting into GNU/Linux, is /etc/init.
d/rcS. The initialisation files for the default run level (usually 2) are then
run. This is specified in /etc/inittab with the line:
l2:2:wait:/etc/init.d/rc 2
In general the runlevels 2, 3, 4, and 5 are all multi-user run levels and Debian
sets them up to be the same.
#
#
#
#
Runlevel 0 is
Runlevel 1 is
Runlevels 2-5
Runlevel 6 is
halt.
single-user.
are multi-user.
reboot.
l0:0:wait:/etc/init.d/rc
l1:1:wait:/etc/init.d/rc
l2:2:wait:/etc/init.d/rc
l3:3:wait:/etc/init.d/rc
l4:4:wait:/etc/init.d/rc
l5:5:wait:/etc/init.d/rc
l6:6:wait:/etc/init.d/rc
0
1
2
3
4
5
6
Thus, when the system enters a runlevel it executes the scripts in /etc/rc.n
where n is the runlevel in question. These scripts are in fact symbolic links
(symlinks) to scripts in /etc/init.d/. A script starting with S starts a
service. One starting with K stops a service. The number after the S or
K specifies the order in which the scripts are run. For example, S25xdm
will start before S35xdm.
369
To stop xdm, for example, from starting up by default on boot, simply remove
the symbolic link of the corresponding S script from /etc/rc?.d/S*xdm.
See the man page for init for an extensive discussion.
The init script is run with start on changing runlevel (S) and runlevels 0
(the halt runlevel) and 6 (the reboot runlevel).
To remove something (e.g., gdm) from the init scripts:
# update-rc.d -f gdm remove
45.2
Initialisation Scripts
370
Initialisations on Booting
45.3
The infamous CTRL-ALT-DEL of the MS-Windows world (to reboot or shutdown your computer) is enabled by default under Debian. It is the following
line in the initialisation table that enables this:
# What to do when CTRL-ALT-DEL is pressed.
ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now
45.4
Terminals
There are six terminals enabled by default in Debian. This means that when
you boot the machine you will have one terminal where you see the boot
messages and eventually the login prompt (unless you are using a windowbased login such as gdm). This terminal is controlled as the device /dev/
tty1. By default there are five others: /dev/tty2. . . /dev/tty6. The entries
in the initialisation table responsible for running the appropriate application
to control each of these terminals are:
# Format:
# <id>:<runlevels>:<action>:<process>
1:2345:respawn:/sbin/getty 38400 tty1
2:23:respawn:/sbin/getty 38400 tty2
3:23:respawn:/sbin/getty 38400 tty3
45.4 Terminals
371
We can see that only the terminal on tty1 is initiated for all user run levels
(2, 3, 4, and 5). The others are initiated only for run levels 2 and 3.
To get more than the default six terminals add additional getty entries and
inform the init daemon with:
# telinit q
A total of 256 terminals are available with a default kernel. There are 64
virtual consoles available. More terminals can be provided for in the kernel
by recompiling the kernel with different options.
Note that exporting a serial console is in the default init script. This is
particularly handy for Palms and similar handheld computers as a system
rescue option.
You can move to any of the consoles using left Alt-F1 to left Alt-F6 or left
Ctl-Alt-F1 to left Ctl-Alt F6. You can also move between the consoles with
Alt-Left and Alt-Right. If you have more that 12 virtual consoles (hence
you run out of function keys for Ctl-Alt) you can access them directly with
Alt-F1 (for console 13) etc.
If you are running one of the X Window System display managers (i.e., you
are presented with a graphical log on screen) such as gdm then this is usually
running on virtual terminal 7 which you can access with Alt-F7. Note that
X captures the Alt key so you will need to use Ctl-Alt-F1 to switch to virtual
console 1.
372
Initialisations on Booting
Chapter 46
Java
Debian can not distribute Suns Java because of Suns licenses which do not
meet the Debian Free Software Guidelines. This is a problem since Java is
such a widely used Internet language. However, you can manually install
the Sun Java software development kit yourself, as long as you are happy to
accept the Sun Java license. Alternatively, install one of the alternatives like
kaffe.
46.1
To accept the license type yes and the installation will begin. This will create
a new directory in /usr/local/bin with the name j2sdk1.4.2 03. Now create
the necessary links:
# ln -s /usr/local/bin/j2sdk1.4.2_03/bin/* /usr/local/bin
To confirm it is installed:
> java -version
373
374
Java
46.2
Java Alternatives
46.3
375
# cd /usr/lib/mozilla/plugins
# ln -s /usr/local/bin/j2sdk1.4.2_03/jre/plugin/i386/ns610-gcc32/libjavaplugin_oji.so
Then run Mozilla and visit about:plugins to ensure the plug in is found.
Old Recipes
An older recipe for installing a Java plugin for the then new version of Mozilla
(e.g., 2:1.3.1-3) which was compiled with gcc 3.3 was:
$
$
$
$
$
$
$
$
mkdir j2sdk-1.4.1-01-linux-i586-gcc3.2
cd j2sdk-1.4.1-01-linux-i586-gcc3.2
wget ftp://ftp.easynet.be/blackdown/JDK-1.4.1/i386/01/j2sdk-1.4.1-01-linux-i586-gcc3.2.b
wget http://twolife.free.fr/debian/j2se1.4-i586_1.4.1.0.1-4.diff
patch -p1 -i j2se1.4-i586_1.4.1.0.1-4.diff
debuild -uc -us
cd ../
wajig install j2re1.4_1.4.1.0.1-4_i386.deb
376
Java
Chapter 47
Jigdo: Build CD-ROM Images
Install jigdo-file
To build snapshot of sid distribution:
$ jigdo-lite ftp://ftp.fsn.hu/pub/CDROM-Images/debian-unofficial/sid/jigdo/sid-i386-1.is
<ENTER>
ftp://mirror.aarnet.edu.au/pub/debian/
ftp://mirror.aarnet.edu.au/pub/linux/debian-non-US/
377
378
Chapter 48
KDE: Desktop Management
KDE is a popular alternative to Gnome. I dont use KDE so theres not a
lot I can say about it. Feel free to contribute.
Various KDE applications are described in this book, in limited detail. See
Chapter 54 for Magellan, the KDE personal information manager, and Chapter 51 for Konqueror for the KDE file manager.
379
380
Chapter 49
Kernel: Rolling Your Own
Compiling your own Linux kernel may sound like a pretty scary task. Take
a deep breath and enjoy the experience. It is actually not such a big thing
to compile your own kernel. And Debian makes it even more straightforward
by supplying the kernel-package to leave you with a kernel-image package that
you simply install, just as you would any kernel-image package you might get
from Debian.
The advantages of compiling your own kernel include being able to tune the
kernel to your specific hardware, and ending up with a smaller kernel. You
may also need to compile your own kernel if the default kernel does not support some specific hardware you have. The distributed kernels though are
becoming modular and it is becoming rare that you would need to compile
your own kernel. If you do though, the recipe here should help and the introduction to compiling your own kernel at http://newbiedoc.sourceforge.
net/tutorials/kernel-pkg/index-kernel-pkg.html should prove a useful read.
The hardware we review in this book has occasionally required kernel compiles. For example, Bartok (Section 4.10.1) contains over 1GB of memory
but the supplied kernels limit to less than 1GB (NOHIGHMEM). Mint (Section 4.10.27) had a specific kernel compiled for it with sound support through
ALSA, IDE SCSI emulation support for CDRW, and with PPP and IPMASQ
support. Velox (Section 4.10.26) had a kernel compiled with sound support
through ALSA, IDE SCSI emulation support for CDRW, and support for
dual processors.
Some sample compiles of the kernel are included with specific installations
381
382
in Section 4.10. See Section 4.10.1 for an example of compiling kernel 2.4.16
with extra memory support (HIGHMEM) and multiple CPU support (SMP).
See Section 4.10.16 for an example of obtaining the linux kernel source (kernel
2.4.19) directly and compiling it the Debian way for Bach (Section 4.10.16).
See Section ?? for an example of obtaining the linux kernel source (kernel
2.4.19) and patching it with a pre-release (2.4.20-pre11) and compiling it the
Debian way for Vivaldi (Section 4.10.13).
49.1
Getting Started
For the particular release of Debian being used the version numbers will be
different. The kernel-package provides tools to generate, from the compiled
kernel image, a genuine Debian package that you simply install as a standard type package. The resulting package can be installed (and uninstalled)
cleanly and correctly with dpkg and wajig.
Note that you do not need the kernel-headers package as all the headers
required are in the kernel-source package. The headers were split out for
other reasons (compiling other packages without installing all of the kernel
sources).
Installing the kernel-source package simply places the archived kernel source
file (kernel-source-2.4.16.tar.bz2) into /usr/src. Similarly for any kernel modules you wish to also install (like alsa). Extract the actual source code
into /usr/src/kernel-source-2.4.16:
#
#
#
#
cd /usr/src
tar jxvf kernel-source-2.4.16.tar.bz2
tar zxvf alsa-driver-0.5.tar.gz
tar zxvf pcmcia-cs.tar.gz
383
You can also obtain a more recent (or even just any different) version of the
kernel from the net yourself and still use the Debian kernel-package utilities.
49.2
Kernel Configuration
The next task is to configure the kernel to suit your setup. There are very
many configuration options and most can be ignored. Each also has a brief
but helpful piece of documentation in /usr/src/linux/Documentation/
Configure.help.
There are three methods available for selecting the configuration. The first
and most basic is config which presents each option, sequentially, for you
to decide what to do. This is a long process. The menu-based menuconfig
presents a menu in a terminal. Options are grouped hierarchically and you
can navigate to the specific options you wish to modify. The X Window
System configurator is xconfig. We might suggest xconfig as the more convenient of the methods, but menuconfig is a good alternative if there is no X
Window System running.
A good starting point for configuration is the basic configuration that is
the default provided by Debian. You then refine the configuration. For an
installed kernel-image you can find its configuration in /boot/config-2.4.
16, for example. A simple approach to configuration is to copy the installed
kernels configuration as the starting point and simply enable the options
missing from that configuration (e.g., SMP):
# cp /boot/config-2.4.16-686 kernel-source-2.4.16/.config
However, you may be better off starting with no .config. A default configuration will be installed and you can then add to this support for your specific
hardware.
Below is a record of my configurations for Mint (Section 4.10.27) and Velox
(Section 4.10.26) where configuration started with no /usr/src/kernel-source-2.
4.16/.config:
# cd kernel-source-2.4.16
# make xconfig (or menuconfig or config)
-> CONFIG_M686=y
384
For Altrop (Section 4.10.20) and Bartok (Section 4.10.1) the configuration
began with a copy of config-2.4.16-686-smp and /boot/config-2.4.16
respectively and the following were modified for the extra memory and SMP.
385
For the laptop Inco the initial configuration was that of /boot/config-2.4.
16-686 then modified as:
Processor Type and Features
CONFIG_MPENTIUMIII=y
This is not really needed though as I believe this simply adds some minor
tunings to the kernel.
49.3
Kernel Modules
49.4
# make-kpkg clean
# make-kpkg --append-to-version -p3 --revision kayon01 --initrd kernel_image
# make-kpkg --append-to-version -p3 --revision kayon01 --initrd modules_image
49.5
386
If you are installing a new version of a kernel that is already installed you
should move the corresponding modules aside, or else you will be asked to
do so during the install:
# cd /lib/modules
# mv 2.4.16-p3 2.4.16-p3.prev
You will be asked whether you wish to run lilo. Usually you would. If this
wipes out a precious master boot record (MBR) you can recover it with lilo
-u.
Now install the modules (if any):
# wajig install alsa-modules-2.4.16-p3_0.5.10b-9+p0+kayon01_i386.deb
# wajig install pcmcia-modules-2.4.16-p3_3.1.8-10+2:kayon01_i386.deb
For Mint (Section 4.10.27) with support for CD-RW you now need to modify
/etc/modutils/cdrw (as suggested in CD Writing HOWTO):
options ide-cd ignore=hdd
alias scd0 sr_mode
pre-install sg
modprobe ide-scsi
pre-install sr_mod
modprobe ide-scsi
pre-install ide-scsi
modprobe ide-cd
To get this information into the right place the following should be done:
# update-modules
Again for Mint (Section 4.10.27) the following were added to /etc/modules
(otherwise the modules must be loaded manually for some reason which can
be avoid using char-major stuff but dont understand this yet):
387
sr_mod
sg
ide-cd
49.6
Lilo Configuration
image=/boot/vmlinuz-2.4.16-p3
label=2.4.16-p3
read-only
initrd=/boot/initrd.img-2.4.16-p3
49.7
Kernel Versions
49.8
Latest Kernel
If you have a kernel-source installed you can update to latest available kernel
with:
# cd /usr/src/kernel-source-NNN
# uupdate -u ../linux.tar.gz
388
49.9
Why make-kpkg?
49.10
389
390
Chapter 50
Keyboard
50.1
Mapping a Key
First find the keycode of the key you wish to map. Do this by running xev
and press the key you wish to map (e.g., the Windows key) and look for the
keycode:
391
392
Keyboard
Now you should be able to bind F15 to any action with, for example, sawfish.
Even better, sawfish supports custom modifier keys (i.e., modifiers apart
from Ctrl, Alt, and Shift- and knows about Hyper). You can map the left
windows key:
keycode 115 = Hyper_L
add Mod2 = Hyper_L
Then use Hyper_L for all bindings related to the window manager (thus freeing Ctrl and Alt-based bindings). This makes it a perfect window manager
key.
I end up with /home/kayon/.Xmodmap containing:
keycode 115 = Hyper_L
add mod3 = Hyper_L
keysym Alt_L = Meta_L Alt_L
add mod1 = Meta_L
Chapter 51
Konqueror: The KDE File
Manager
Konqueror is a file manager and web browser for the KDE desktop. It provides the usual file manager functionality including display of files and directories using an icon view or tree view, copying, moving and deleting by
direct drag and drop or by using copy, cut and paste, and file properties.
393
394
Chapter 52
LaTeX
Debian Packages: tetex-bin tetex-extra
LATEX and TEX are sophisticated document typesetting systems. LATEX is a
mark-up language where you edit text documents (using any editor of choice)
and include mark-up to tell the formatter how to produce the final printed
page. Unlike proprietary word processing systems, like MS Word, LATEX is
available freely on most platforms and documents produced on one platform
will be identical to that produced on another platform.
52.1
LaTeX Documentation
52.2
Generating LaTeX
Many Debian packages can generate LaTeX. These include the Gnome office
suite applications Gnumeric (Chapter 39), AbiWord (Section 8.1) and Dia
(Chapter 23).
395
396
LaTeX
52.3
52.3.1
Using LyX
A great GUI for editing LaTeX documents is LyX. LyX provides much help
for the novice LaTeX user in getting started with producing very nice looking
documents.
52.3.2
Using Emacs
The AucTeX package provides a complete emacs environment for editing LaTeX documents.
C-c = runs the reftex command reftex-toc which will split the current
Emacs window to show two buffers, the top buffer showing the table of contents of the whole document, allowing quick navigation around the document.
The preview-latex package will provide a preview of graphics and mathematics
inside the emacs buffer where the LATEX file is being edited.
52.4
52.5
52.5.1
397
The natbib package in LATEX checks to see whether the chapter command is
defined. If so it decides to use that for the bibliography headings. This will
generally place the bibliography on a new page, which is what you would
expect for a book. However, the llncs LATEX document class does define
the chapter command, but is used generally for writing articles! A simple solution is to tell natbib to use section rather than chapter for the
bibliography:
\usepackage{natbib}
\makeatletter
\renewcommand\bibsection%
{
\section*{\refname
\@mkboth{\MakeUppercase{\refname}}{\MakeUppercase{\refname}}}
}
\makeatother
52.6
where you add something to the current value of nnnnnn. This should take
effect next time you run LATEX.
398
LaTeX
Chapter 53
Login
53.1
If you enter your username on the login prompt all in capitals then the login
progam will be lead to believe that you have an upper-case only terminal
(pretty rare devices these days but once upon a time they ruled the desktop).
You will then enter into the system where uppercase letters rule. This is a
feature and not a bug!
Make sure your disable capslock before entering your userid.
53.2
Login Screen
400
Login
virtual terminals on your system. When getty starts, it prints the contents
of /etc/issue to the terminal. To customize the look of your console, all you
have to do is edit /etc/issue.
You can also add colour by using the colour capabilities of the Linux console.
The Linux console, like almost any other existing terminal, has escape sequences that can be used to change the appearance of text on screen. Piping
the following script into /etc/issue:
#!/bin/sh
spaces(){ COUNT=0; while [ $COUNT -lt
$1 ]; do echo -ne " ";
COUNT=$[$COUNT+1] done }
esc="\033[" echo -ne
"${esc}H${esc}J\n${esc}44;37;1m"
WELCOME="Welcome to "hostname"
running Linux "uname -r
CHARS=$[(80-echo $WELCOME | wc
--chars)/2] spaces $CHARS echo -ne
$WELCOME spaces $CHARS echo -ne
"${esc}0m\n\\l "
The 44;37 specifies White on Blue. To see how your terminal renders colours,
use this script:
#!/bin/bash
401
53.3
Midnight Commander
You can browse through the contents of a Deb package (*.deb file) with gmc
as if it were a locally mounted fileystem, without having to unarchive and
untar all the constituent components. You can also browse tarballs, gzips,
bzips, gzipped tarballs, bzipped tarballs, and zips as well, providing that the
attendant gzip, bzip, tar, and zip programs are all installed. Double click the
archive in question and you can browse the archive as if it were a directory.
53.4
402
Login
Chapter 54
Magellan: KDE Personal
Information Manager
Magellan is a KDE-based alternative to Evolution. It is a personal information manager handling email, contacts, notes, tasks, to do lists, and journals.
For email it supports mail retrieval via POP3, IMAP4, and local mailboxes.
An interesting feature is that it supports mixed-mode POP3 and IMAP4 accounts where each account can be a completely different identity (e.g., if you
have multiple email accounts on different servers with different usernames).
403
404
Chapter 55
Modems
55.1
Silence
If you want to turn the speaker of your modem off, then add ATM0 to /etc/
chatscripts/provider:
# ispnumber
OK-AT-OK ATM0
OK-AT-OK ATDT12345678
55.2
No Dial Tone
Replace ATZ with ATH1. May need to extend the time waiting from the 100 (1 sec) standard setting to 250, so the modem
doesnt send the ATDT(phone no.) too soon.
405
406
55.3
Modems
By default pon does not wait around too long to establish a connection.
Sometimes it does not wait long enough. You can introduce a longer wait
(e.g., two minutes) as below.
Edit /etc/ppp/peers/provider (assuming your connection is the default,
called provider ) to replace:
connect "/usr/sbin/chat -v -f /etc/chatscripts/provider"
with
connect "/usr/sbin/chat -v -t120 -f /etc/chatscripts/provider"
If you connection is not the default provider but something else, then edit
the file with the same name in /etc/ppp/peers/.
Chapter 56
MSWindows
For running MSWindows applications under GNU/Linux see Wine (Section 56.1) and Citrix (Section 56.2). Wine provides an implementation of
many of the MSWindows libraries so that MSWindows applications can run
diretly under GNU/Linux. Citrix uses the Windows Terminal Server to access a Windows machine and display the desktop within a window on the
GNU/Linux desktop.
For applications that can work with MSWindows documents see OpenOffice 63 and AbiWord 8.
To simply view the contents of a MSWord document use wv.
56.1
Wine works well with MS-Windows/98 (e.g., winword and excel work just
fine) but not so good with MS-Windows/NT, MS-Windows/2000, and MSWindows/XP.
56.2
408
MSWindows
56.2.1
Screenshot
56.2.2
Installation
Citrix provides both a standard client and a Java based client that can run
as an application or as an applet (although the Java application is only
available as version 6, with version 7 only providing an applet). The clients
can be downloaded from the Citrix web site, after agreeing to their licensing
conditions.
Client Installation
To install the client on GNU/Linux:
409
$ wget http://download2.citrix.com/files/en/products/client/ica/current/ICAClient-7.00-1
$ wajig rpminstall ICAClient-7.00-1.i386.rpm
$ /usr/lib/ICAClient/wfcmgr
Create new Entry
Network
Server [ACT] [citrix.ktware.com]
Window
Window Size [75%]
Login
[kayon,NEXUS,passwd]
Tools -> Settings
Drive Mapping
H: /home/kayon/
Enable Drive Mapping
$ /usr/lib/ICAClient/wfcmgr -desc ACT
410
MSWindows
Chapter 57
Music
Most computers today have hardware for producing great audio. In this
chapter we explore how to get the most from your sound system.
FIRST DISCUSS CD PLAYERS
With the explosive growth of MP3 freely available on the web you will need
an MP3 player. There are several to choose from, but we concentrate on
xmms and qvmpeg.
You may want to record your own audio CDs so that you can listen to them
yourself or download them to your portable MP3 player. The grip package
encodes an audio CD as a collection of MP3 files.
411
412
Music
Chapter 58
MySQL
Debian Pacakges: mysql-client mysql-server mysql-navigator mytop
MySQL is a common database system used in GNU/Linux. It is extensively
used as the backend database server for the Apache web server. To quote
the Debian information about mysql-server:
414
MySQL
58.0.3
You will then also need to let cron jobs work on the database so create a
personal mysql config file for root in /root/.my.cnf containing:
[mysqladmin]
user
password
= root
= <secret>
58.0.4
415
The data to populate a new table we will create is stored in the file nhds99.
data as comma separated values. We can write a simple script to create the
table and import the data. The script is called nhds99.sql:
USE nhds;
CREATE TABLE nhds99 (
svy_year
int,
newborn
char(1),
age_unit
char(1),
age
int,
sex
char(1),
race
char(1),
m_status
char(1),
dis_month
int,
dis_status
char(1),
days_care
int,
los_flag
char(1),
geo_region
char(1),
no_beds
char(1),
hos_ownership
char(1),
ana_weight
int,
dc1
char(5),
dc2
char(5),
dc3
char(5),
dc4
char(5),
dc5
char(5),
dc6
char(5),
dc7
char(5),
pc1
char(4),
pc2
char(4),
pc3
char(4),
pc4
char(4),
p_src_payment
char(2),
s_src_payment
char(2),
drg
char(3));
LOAD DATA
LOCAL INFILE nhds99.data
INTO TABLE nhds99
FIELDS TERMINATED BY ,;
416
MySQL
Using mysql-navigator you can not currently create new databases (except
by running an external script) but you can create tables. You can also run
SQL scripts. So create your database for nhds as above. Then start up the
navigator and open root@localhost. Then under the MySQL menu choose
Script. Identify the script and a log file then Fire. The new table should
then appear under the nhds database.
With the navigator you can even edit the script files with the Edit item in
the MySQL menu.
58.0.5
The mysql-navigator can be used to create a new user. Fire it up and open a
connection to the localhost server with user root and database mysql. Under
the MySQL menu select User. Choose the action to permform, prvoide the
relevant information then Fire. Then under the MySQL menu select Privilege
to grant database access. Note that you may still need mysqladmin -u root
-p reload?
Alternatively, you can do it as follows. The first insert adds this users
password to the users table. The second then gives this user access to a
particular database.
$ mysql -u root -pYYYYY mysql
mysql> insert into user (host,user,password,select_priv)
-> values (localhost, kayon, password(XXXXXX),Y);
Query OK, 1 row affected (0.00 sec)
mysql> insert into db (host,db,user,select_priv)
-> values (localhost, customers, kayon, Y);
Query OK, 1 row affected (0.00 sec)
417
mysql> exit
altrop$ mysqladmin -u root -pYYYYY reload
Then this user can access the specified data base to perform SELECT queries:
$ mysql -u kayon -pXXXXXX customers
58.0.6
58.0.7
On any host in domain ktware.com user kayon would like to connect to the
customers database with select privileges on the MySQL server running on
altrop.ktware.com.
You can arrange this as follows. The first insert adds this users password
to the users table. The second then gives this user access to a particular
database.
On altrop.ktware.com:
altrop$ mysql -u root -pYYYYYY mysql
mysql> insert into user (host,user,password)
-> values (%.ktware.com, kayon, password(XXXXXX));
Query OK, 1 row affected (0.00 sec)
mysql> insert into db (host,db,user,select_priv)
-> values (%.ktware.com, customers, kayon, Y);
Query OK, 1 row affected (0.00 sec)
418
MySQL
mysql> exit
altrop$ mysqladmin -u root -pYYYYYY reload
58.0.8
Basic MySQL
419
mysql> use nhds;
Database changed
420
| dc5
| char(5) | YES |
| NULL
|
|
| dc6
| char(5) | YES |
| NULL
|
|
| dc7
| char(5) | YES |
| NULL
|
|
| pc1
| char(4) | YES |
| NULL
|
|
| pc2
| char(4) | YES |
| NULL
|
|
| pc3
| char(4) | YES |
| NULL
|
|
| pc4
| char(4) | YES |
| NULL
|
|
| p_src_payment | char(2) | YES |
| NULL
|
|
| s_src_payment | char(2) | YES |
| NULL
|
|
| drg
| char(3) | YES |
| NULL
|
|
+---------------+---------+------+-----+---------+-------+
29 rows in set (0.00 sec)
MySQL
Chapter 59
Nautilus: Navigating
FoldersNear and Far
The Apple Macintosh commercially pioneered the graphical user interface
(GUI) invented by Xerox Palo Alto Research Center (PARC). The Macintosh
Finder provided an ease of use that heretheto was lacking in computers.
Microsoft came along much later with their File Manager and then MSWindows Explorer. Learning well from both of these and more, Nautilus
was developed by Eazel, a startup company founded by some of the original
Apple Macintosh developers, including Mike Boich, Andy Hertzfeld, and Bud
Tribble.
Nautilus is a component-based Gnome-based file manager for the GNU/Linux
Operating System. Nautilus features a refreshingly new yet intuitive graphical user interface which is easily customised to suit individual tastes and
expertise.
Documents are, as we expect, represented by icons on a desktop. But the
contents of those documents are previewed within the icon!
Also users can share and manage files across a network.
59.1
Navigation will be familiar to any user, with the usual Back, Forward, Up,
Reload, Home, Search and Web Search buttons in the toolbar.
421
422
The main window has two panels with the left hand panel containing tabs
to access different components.
The right hand panel displays folders and documents in a rich variety of
ways. Users will be familiar with the View as List and View as Icons Folder
displays.
Folders containing MP3 music can be displayed using the View as Album
component, which provides a specialised view of your music collection as an
album, designed to allow easy music listening. Selecting an MP3 file starts
it playing automatically.
It can also display the album artwork if you have that available. To link the
artwork in you need to.
59.2
HTML documents (the type of documents that form the basis of the world
wide web), whether they live on your local disk or somewhere on the web,
are just another type of document, and Nautilus treats them as such. Open
one and you begin browsing the web within the Nautilus shell! By default
Nautilus uses the Embedded Mozilla to render these documents, but others
can be plugged in, depending on your desires.
59.3
423
Nautilus CD Creator
59.4
Or ftp:
ftp://kayon:[email protected]
424
Chapter 60
Networks
60.1
Introduction
The network provides access to a wide collection of resources. Most computers today connect to the network either through an Ethernet network card
or else by modem. Once connected you have an IP address (and sometimes
more than one) assigned to your computer by which all communications is
effected. IP addresses are sequences of numbers.
Two things need to happen to get your network going: loading a driver for
your network card and specifying your network address and configuration.
An Ethernet based network is usually started up at boot time by the system
initialisation script /etc/init.d/networking. For pcmcia network cards the
/etc/pcmcia/ tree provides its own scrips, including /etc/pcmcia/network,
that is called whenever a network card is found in the PCMCIA socket.
Your IP address bitwise ANDed with the so called netmask yields your network address. The network address bitwise ORed with the negated netmask
yields your so called broadcast address. The IP address of the router through
which you connect to the Internet is referred to as the gateway.
A simple example is:
IP:
Mask:
Network:
Broadcast:
192.168.0.34
255.255.255.240
192.168.0.32
192.168.0.47
(0xc0a80022)
(0xfffffff0)
(0xc0a80020 = 0xc0a80022 & 0xfffffff0)
(0xc0a8002f = 0xc0a80020 | ~0x0f)
425
426
Networks
60.2
Network Configuration
60.2.1
Graphical Tools
60.2.2
Manual Setup
Note that to have networking started in this way you need to have auto eth0
in /etc/network/interfaces. Otherwise the start-up script /etc/init.d/
427
Figure 60.2: Configuration of networks using the Gnome network administration tool.
networking will not start eth0. The start-up script calls ifup -a which
only starts those interfaces marked as auto. You can still manually start the
network with ifup eth0.
60.2.3
If you get a neighborhood table overflow message make sure the loopback
device is running:
# ifup lo
60.2.4
Example Configurations
428
Networks
Velox (Section 4.10.26) was initially set up to allow DHCP allocation of the IP
address. The DHCP server delivered the appropriate information as demonstrated in /var/log/installer.log:
got dhcp offer
HOSTNAME: requesting velox
ip: 183.44.70.122
next server: 0.0.0.0
netmask: 255.255.255.0
gateway: 183.44.70.177
dnsServers[0]: 183.44.72.1
numDns: 1
domain: ktware.com
broadcast: 183.44.70.255
network: 183.44.70.0
configured interface eth0
The network has been successfully configured using DHCP/BOOTP.
429
60.3
Wireless Network
mkdir /tmp/cisco
cd /tmp/csico
wget http://www.cisco.com/pcgi-bin/Software/Tablebuild/download.cgi/Linux-ACU-Driver-v
tar zxvf Linux-ACU-Driver-v2.0.tar.gz
mkdir -p /opt/cisco/bin
mv utilities/* /opt/cisco/bin
mv helpml.tar.gz /opt/cisco
cd /opt/csico
tar zxvf helpml.tar.gz
tm helpml.tar.gz
cd
/opt/cisco/bin/acu
430
Networks
For LEAP authentication you can login with a username and password. This
can be set up with:
# leapscript <username> <password>
60.4
If you would like to search for hosts in other domains by simply listing the
host name (e.g., inco, rather than inco.ktware.com) you can add those other
domains to /etc/resolv.conf. Note that PPP will add its own ISP related resolv.conf file on dial up. Thus, with ISP identified as provider add
the following line to /etc/ppp/resolv/provider:
search ktware.com
60.5
431
Hostname Changes
This alone will not suffice as the change in hostname will not survive a reboot.
You need to edit /etc/hostname which is where the name is obtained at boot
time.
Then search through /etc, for example, for occurances of the old name, just
in case:
# grep -r inco /etc
60.6
You can turn services on and off by the update-inetd command. For example, to turn telnet off:
# update-inetd --disable telnet
You can also manually turn services off by directly editing /etc/inetd.conf.
For example, if you have telnetd installed (not recommended) and wish to
turn it off (rather than uninstalling it) then comment out the line in /etc/
inetd.conf that starts with telnet and restart inetd:
# /etc/init.d/inetd restart
432
Networks
7
9
echo
discard
13
daytime
17
20
21
22
23
25
37
quotd
ftp-data
ftp
ssh
telnet
smtp
time
prints the current time as seconds sine the epoch in
machine readable form. This can be useful if network
clients expect the service for crude time synchronisation
(some windows clients can use this service). Otherwise
it is not generally needed.
domain
gopher
finger
http
pop3
sunrpc
auth
The IDENT protocol. It is not useful but most IRC
servers require this port to be open and returning information. Apparently some FTP servers and postgresql
require this service as well.
nntp
is the Network News Transport Service if you are running a news server (e.g., inn or cnews). Otherwise it is
not needed.
53
70
79
80
110
111
113
119
ntp
imap2
udp snmp
tcp irc
udp irc
imap3
tcp ldap
tcp https
tcp rsync
tcp nfs
udp nfs
3306
6000
6667
8080
32860
tcp
433
mysql
X Window System
udp ircd
Internet Relay Chat
tcp webcache
WWW caching service
udp nlockmgr
Not known to be a security problem but could be turned
off.
60.7
60.8
iptables
iptables
iptables
iptables
iptables
--flush
--table nat --flush
--delete-chain
--table nat --delete-chain
--table nat --append POSTROUTING --out-interface ppp0 -j MASQUERADE
434
Networks
This clears the rules for filtering and then adds a rule to provide the IP
forwarding. Now we need to turn it on for the kernel:
# echo 1 > /proc/sys/net/ipv4/ip_forward
And thats it! This host, Modern (Section 4.10.7) will now act as a gateway
to the Internet for your local machines.
There is some setup needed to have this survive a reboot. One approach is
to do this through init.d, as explained in Section 45.2. The first step is to
create a script file called /etc/init.d/myfirewall containing:
#! /bin/sh
#
# Set up a firewall for IP Masquerading
#
PATH=/bin:/usr/bin:/sbin:/usr/sbin
case "$1" in
start)
echo -n "Starting IP Masquerading: myfirewall"
iptables --flush
iptables --table nat --flush
iptables --delete-chain
iptables --table nat --delete-chain
iptables --table nat --append POSTROUTING --out-interface ppp0 -j MASQUERADE
iptables --append FORWARD --in-interface eth0 -j ACCEPT
echo 1 > /proc/sys/net/ipv4/ip_forward
echo "."
;;
stop)
echo -n "Stopping IP Masquerading: myfirewall"
echo 0 > /proc/sys/net/ipv4/ip_forward
echo "."
;;
reload)
echo "Not implemented."
;;
force-reload|restart)
435
sh $0 stop
sh $0 start
;;
*)
echo "Usage: /etc/init.d/myfirewall {start|stop|restart|force-reload|reload}"
exit 1
;;
esac
exit 0
Another approach is to only turn it on and off as a PPP connection is established. See the scripts in /usr/share/doc/iptables/examples for details.
Now Rose (Section 4.10.29) and Inco (Section 4.10.24), machines on the local
home network, can have their network interface set up:
iface eth0 inet
address
network
netmask
gateway
static
192.168.1.2
192.168.1.0
255.255.255.0
192.168.1.5
(modern)
436
60.9
Networks
On the Dell laptop Inco (Section 4.10.24) we have two Ethernet cards when
the Laptop is docked and one when not docked. The card in the Laptop itself
is identified as eth0 when not docked but as eth1 when docked, in which
case the docking station Ethernet card is identified as eth0.
The laptops internal Ethernet card is only used when the laptop is not
docked. Thus we can get away with configuring eth0 for both situations and
eth1 as a removable card so that it is not automatically configured when the
machine is booted!
Chapter 61
NFS: Network File System
Debian Pacakges: nfs-kernel-server nfs-client
For managing a collection of networked Debian boxes the use of NFS to
mount home directories is a good idea.
61.1
Setting Up NFS
Suppose Altrop (Section 4.10.20) is the host of the home directories that are
exported to Cultus (Section 4.10.19). On Altrop install nfs-kernel-server:
altrop$ wajig install nfs-kernel-server
438
You should also maintain common passwd, shadow, group and gshadow files
between the various hosts. See Section 66.1 below for details.
61.2
Export Lists
Suppose you have a network that is a subnet of a C class network, as with the
hosts on ktnet. They have addresses starting from 155.229.8.150 with a
netmask of 255.255.255.192. To NFS export to all hosts in this subnetwork
you can use the following:
/home
/usr/local
/edmnet/altrop
/var/lib/cvs
/var/spool/mail
155.229.8.150/255.255.255.192(rw)
155.229.8.150/255.255.255.192(rw)
155.229.8.150/255.255.255.192(rw)
155.229.8.150/255.255.255.192(rw)
155.229.8.150/255.255.255.192(rw,no_root_squash)
61.3
439
cultus(rw,no_root_squash)
440
Chapter 62
NT File System
Kernel 2.2.12 and beyond support read only access to NTFS, the file system
of MS-Windows/NT. The kernel needs to be configured to use it:
CONFIG_NTFS_FS=m
/nt/c
/nt/d
ntfs
ntfs
defaults,user,ro,umask=002,gid=100 0 0
defaults,user,ro,umask=002,gid=100 0 0
The various options mean: ro mounts the file system as read-only; user
lets any user mount the file-system; nohide shows hidden and associated
files; noexec avoids regular files showing up as non-executable.
Then create directories for the mount points:
# mkdir /nt/c
# mkdir /nt/d
441
442
NT File System
These will be mounted each time you reboot, unless you add the noauto
option to the appropriate lines in [NTFS]/etc/fstab.
Users are granted access to [NTFS]/nt/c and [NTFS]/nt/d through the
use of the umask=002,gid=100 in the fstab, and then add trusted users
to this group. You can allow access for only a specific user by adding
uid=1000,gid=1000 to the options. Or you can remove all security and
give complete access to everyone with umask=000 (this is dangerous as any
login will be able to peruse your possibly private and password containing
files on the NTFS partition).
Note that permissions on the mountpoint itself ([NTFS]/nt/c are irrelevant:
when you mount a filesystem the permissions of the mounted filesystems
root directory replace the permissions of the mountpoint, even when the
filesystem in question does not support permissions.
If you need to transfer files from your linux partition to your NTFS partition
then Explore2fs is an option. Have a look at http://uranus.it.swin.edu.
au/~jn/linux/explore2fs.htm
Chapter 63
OpenOffice
OpenOffice began life as StarOffice from the German company StarDivision.
Sun Microsystems purchased it and made it open source and also sells it as
StarOffice.
To start up OpenOffice:
$ openoffice
63.1
OpenOffice Writer
OpenOffice Writer can be used for a variety of tasks including business letters,
documentation and desktop publishing. Flexible layout and design options
make support multicolumn newsletters and brochures. Indexing can be used
for bibliographical and index entries and keywords as well as the generation of
indexes and reference tables (such as a table of contents). Groupware features
support easy collaboration with others on the same document, while keeping
track of changes. Export to HTML means you can create your own web site
with hyperlinks, frames, and image maps.
63.2
Dictionaries
The UK dictionary should be installed as the package myspell-en-gb. Previously to install the English (UK) dictionary one had to:
443
444
OpenOffice
$ wget http://dict.progbits.com/en_GB.zip
$ cd /usr/lib/openoffice/share/dict/ooo
$ sudo unzip ~/en_GB.zip
$ chmod u=rw,go=r *en_GB*
$ sudo zile dictionary.lst
DICT en GB en_GB
$
445
THES en GB th_en_US
63.3
OpenOffice Impress
446
OpenOffice
Chapter 64
Oracle: Commercial Database
Installing Oracle on Debian involves obtaining the Oracle tar file, setting up
an Oracle user and some Oracle groups, and running the Oracle installation
software.
See http://openacs.org/doc/openacs-4/oracle.html for details.
64.1
64.2
Then create various groups which normal users might belong to in order to
administer Oracle.
447
448
# addgroup dba
# addgroup oinstall
ORACLE_BASE=/ktnet/oracle
ORACLE_HOME=$ORACLE_BASE/product/8.1.7
PATH=$PATH:$ORACLE_HOME/bin
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib
ORACLE_SID=ora8
ORACLE_TERM=vt100
ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
umask 022
64.3
Oracle Installation
Chapter 65
Partitions
Partitioning of your hard drive(s) can be as trivial as creating just two partitions, one for swap and the rest for the installation and everything elsethis
is the Debian default and recommendation for new users. Or it can be as
complex as creating many partitions for different parts of the system to use.
An argument for creating multiple partitions is that filling up one partition
wont impact on other partitions (which could be a problem if the system is
unable to function properly because the disk is full). Also, corrupting one
partition (although rare) wont affect another, thus it is good to keep the
system partition separate from the user partitions. The decision is yours.
65.1
Sample Usage
It is useful to see where the disk is being used for an installed system. Below
we identify the usage on several systems at some specific time.
449
450
Host
Disk
/bin
/boot
/dev
/etc
/home
/lib
/sbin
/tmp
/usr
/var
Partitions
Altrop Festival
66G
69G
3M
3M
21M
37M
32M
21G
153M
4M
2G
5G
21G
37M
2G
124M
4M
0G
4G
16G
Cultus
36G
3M
17M
Mint
8G
3M
10M
60M
27M 38M
2G
3G
89M 80M
3M
3M
2M
6M
3G
3G
2G 284M
65.2
Suggested Partitioning
/tmp
/boot
/usr
/var
/etc
/usr/local
/home
Size
2xRAM
451
Rationale
An old rule of thumb. Generally theres
plenty of disk space to handle this.
50MB100MB This is where the base system lives and contains just enough to boot a system, and will
allow you to boot into single user mode in
case of catastrophe elsewhere on the disk.
By being small it is less prone to corruption
as a result of a system crash. On a typical server (maximum of PLYMZ and Velox
(Section 4.10.26)) it contains bin (2MB),
lib (40MB), root (15MB), and sbin (2MB).
The directory is usually static and unshareable.
50MB100MB It is empty after reboot.
16MB
It is 6MB on PLYMZ, 2MB on Velox (Section 4.10.26).
500MB-2GB
This directory is usually static and shareable.
It is 1GB on PLYMZ, 2GB on Velox (Section 4.10.26). This includes /usr/local.
200MB500MB This directory is variable with some parts
shareable and others not. Often used for
email and news feeds. It is 1GB on PLYMZ,
2GB on Velox (Section 4.10.26), and both are
being used as web servers.
This directory is usually static and unshareable. It is 5MB on PLYMZ, 10MB on Velox
(Section 4.10.26).
200MB-2GB
This directory is usually shareable. Typically for local networks this is mounted
from a server. It is 500MB on Velox (Section 4.10.26) acting as a server.
200MB
This directory is usually shareable. Typically for local networks this is mounted from
a server. It is 4GB on Velox (Section 4.10.26)
acting as a server.
452
/ktnet
65.3
Partitions
(remainder)
Repartitioning MS-Windows
Your computer perhaps came with MS-Windows installed and perhaps two
partitions on the hard drive, one called the C: drive and the other called
the D: drive. These are simply areas on the disk that have been allocated
to each of these drives. The partition essentially marks where on the disk
the boundaries are between the different drives. The raw bits associated
with each drive are then organised in some way to create a filesystem. The
C: drive and the D: drive probably have the FAT or the FAT32 filesystem.
(Under GNU/Linux these drives are usually identified as /dev/hda1 and
/dev/hda2.)
These two partitions (or however many your computer came withperhaps
just one) will probably have been arranged to fill the whole of the hard drive,
leaving no room for any other operating system. So, if you wish to keep a
dual boot system you need to move these partitions to make room for other
partitions (with different organisations of the bitsthat is, different types of
file systems).
Changing the size of an existing partition can damage the data on that
partition although by carefully following certain steps this should not happen.
Nonetheless be sure to make a backup of the current partitions if you can.
This is important if you have data on the system you do not want to lose.
The first step is to decide how much space you need for each of your partitions. For a 6GB hard drive you might give 3GB to Win32 and 3GB to
GNU/Linux. But this depends on how much space you are currently using.
Next, the aim is to move all of the data on the current partitions to the
beginning of the partition, then change the location of the end of the partition. The Win32 tool fips is commonly used to perform this rearrangement
of partitions.
453
454
Partitions
Chapter 66
Passwords
If you forget your password for root, then you will be in a spot of bother. One
way to fix this is to reboot the machine using the Debian installation floppy
or CD. When you get the first question (about the having a colour monitor)
press CTRL-ALT-F1 to get a shell. Mount your root partition (lets say it is
/dev/hda1):
# mount /dev/hda1 /mnt
then edit the password file to erase the encrypted password for root:
# editor /mnt/etc/passwd
66.1
NIS, which manages password file sharing among several hosts, provides the
simplest mechanism for doing this, but there are alternatives that can work
for small networks (2 or 3 machines). You can maintain the passwd, shadow,
group, and gshadow files on a server Altrop (Section 4.10.20) and copy them
across to the other machines as needed, as described below, using rdist! The
downside is that all new users should be added on the server and passwords
should be changed on the server only with the appropriate password files
then pumped out to the other hosts.
455
456
66.1.1
Passwords
Using rdist
The rdist package can be used to update files on a collection of hosts from
a central host. This is what I do from Altrop (Section 4.10.20) where the
password and group files are maintained.
On Altrop (Section 4.10.20) in /root/distfile I have the following:
KTNET = ( inco punto cultus festival atom brick prefect )
FILES
Thus I have seveb hosts that are updated with seven files from altrop. The
options for install include: younger so that if the remote host has update the
files they wont be updated from altrop, and instead I need to have a look
at them to see what has changed; chknfs so that NFS mounted files are not
updated; and savetargets so that old copies are placed in .OLD files so I can
then compare what has changed!
The command to do the update is:
# rdist -F -P /usr/bin/ssh
This will use ssh to communicate and will do it serially (-F) so that the
passwords that are asked for dont interfere with each other!
66.1.2
Simple tar
When a new user is added (using adduser) the files need to be copied to
each of the other hosts. A simple way is to tar up the files, copy them to a
NFS mounted are (e.g., a trusted users home directory), log in as root on
the other host, cp the tar file to /tmp so that root can access it (root access
to the NFS mounted home directories is not permitted) and then untar it in
/etc.
This is okay for a small network! It also relies on /home being mounted by
NFS from the master (altrop). Still, I need a better solution.
66.1.3
457
Using NIS
You will be asked to name the nis domain. You can call it anything and later
edit it in /etc/defaultdomain. Lets call it ktnet.ktware.com (it has no
formal relationship to the network domain name).
In the file /etc/default/nis set NISSERVER=master to identify caravelle
as the master server.
To restrict who can access you NIS server add your local network number to
the file /etc/ypserv.securenets
Now restart the NIS server:
$ wajig restart nis
You will be asked to list all of your servers (just caravelle for now).
This essentially builds the maps from the current password file on caravelle.
Note that you cant use the nis maps on caravelle itself - dont remove the
users from caravelles password file!
458
Passwords
You will be asked the name of the nis domain. You must use the name
you supplied to the master server (ktnet.ktware.com). It is stored in
/etc/defaultdomain.
Specify the NIS server address in /etc/yp.conf:
ypserver 105.229.8.170
Now edit the passwd, shadow, group and gshadow files. In passwd remove
all the users (anyone with a user id in the 1000s) and add:
+::::::
And in shadow:
+::::::::
Then in groups and gshadow files, similarly remove the users and add:
+:::
NIS should now be working. Certainly ypcat passwd should show the users
in NIS.
Chapter 67
PPP: Networking Over
Modems
For Debian use pppconfig to configure your network connections. This tool
will request the appropriate information and knows about chat scripts and
PAP connections. It will ask you to name the connection you want to configure, with a default name of provider. It will then generate the appropriate
configuration scripts in [ppp]/etc/chatscripts/provider and [ppp]/etc/ppp/peers/provider
(the provider in these paths is replaced with the name you supply pppconfig).
The plog command will show you the ppp log which is in [plog]/var/log/ppp.log.
To watch the plog file issue the command plog -f as root or else as a user
in the group adm.
The pppconfig command allows you to configure your modem connections.
Essentially it is a front end to the various scripts in /etc/ppp. My PCMCIA
modem is loaded at /dev/ttyS1. Newer versions of ppconfig check the serial
ports for modems for you. Usually, /dev/ttyS0 corresponds to COM1 under
MS-Windows and /dev/ttyS1 corresponds to COM2.
To allow users other than root to connect through the modem (using the pon
and poff pair of commands) add the users to the Unix group dip:
# adduser kayon dip
Then, next time user kayon logs on he will be in group dip in addition to
the other groups he was already in. He will then be able to initiate and
459
460
terminate a dial up session. However, user kayon does not have access to the
log file through the plog commandonly root does, presumably for security
reasons, since unless you inhibit it, passwords can be displayed there.
Further information on PPP is available from
67.1
modemlights applet
This is the Gnome applet I use for modem access. After adding a user to
the dip Unix group they can use this applet to dial the modem, display
transfers, and to hangup. Under properties I had to change the connect
and disconnect commands to be pon and poff rather than pppon and pppoff
(which dont exist perhaps this is a problem). The newer Potato version
of the applet had the defaults correct.
Chapter 68
Presentations
68.1
Beamer
68.2
Prosper
Prosper is a LATEX package for generating presentations with colour, animations and flair! A newer alternative that works better with PDF is beamer
(see Section 68.1).
68.3
OpenOffice Impress
462
Presentations
68.4
KPresenter
Chapter 69
Printing
69.1
69.1.1
If you have CUPS set up already on a server, and you generally have the
same environment on your desktop machines, when setting up a new host,
simply install the packages listed above. Then copy over the appropriate
configuration files:
#
#
#
#
cd /etc/cups
scp ktw:/etc/cups/printers.conf .
scp ktw:/etc/cups/ppd/* ppd
chmod o+r ppd/*.ppd
463
464
Printing
Always keep your configuration up to date on the server, perhaps using the
web interface via []http://ktw:631/. (If you use instead the command line
interface with the command lpadmin then you also need to copy lpoptions
across.) A convenient way to keep the configurations consistent is with rdist
(see Section 66.1.1 for an example).
69.1.2
If you are using the web interface and now go to the printer and get a
permission denied error, chances are it is because your browser is going to
bartok.act.ktware.com rather than localhost. You can edit /etc/cups/
cupsd.conf to give permission for all local hosts (since in my setup I have
printers configured on the server then use rdist to distribute the configuration
to all clients):
<Location />
...
Allow From 192.168.0.*
</Location>
...
<Location /admin>
...
Allow From 192.168.0.*
</Location>
You could use .act.ktware.com instead to allow access from any host in
your domain. Then restart the cupsys daemon:
465
Print a test page to make sure it works. Also, go into Configure Printer to
set Page Size to A4, and any other default settings, like duplex printing.
69.1.3
# cd /usr/share/cups/model
# foomatic-datafile -t cups -d hpijs -p HP-PSC_2210 > HP-PSC_2210-hpijs.ppd
# wajig restart cupsys
Then the printer is listed as Make Hewlett-Packard (not HP) in the web
interface to CUPS. Simply choose it.
69.1.4
Enabling a Printer
# /usr/bin/enable lp1
69.1.5
You can also simply use the command line to administer the printers. You
can add a network printer enable the printer with:
# lpadmin -p hplj -v socket://192.168.0.6:9100/ -E
466
Printing
# lpoptions -p lp7 -l
$ lp -o HPNup=TwoUpL sample.pdf
$ lp -o HPwmText=Draft odbcmine.pdf
69.2
69.3
467
cd
ln
ln
ln
/usr/local/bin
-s /usr/bin/rlpr lpr
-s /usr/bin/rlpq lpq
-s /usr/bin/rlprm lprm
To specify the pinter on which to print you need to include in the printer
name the print server host, as in [email protected]. This can be
improved on by creating a /etc/rlprrc file with something like:
artz.ktware.com: lp1 lp1nd lp5 lp5t lp7 lp9
Make sure the protections on the file allow everyone to read the file. Then
when specifying a printer, simply mention its name, as in -Plp1 or set the
PRINTER environment variable to "lp1".
468
Printing
Chapter 70
Python
Debian Pacakges: python-base python-dev python-doc python-examples pythongdbm python-mpz python-regrtest python-tk python-xmlbase
Python is a programming language that is similar to Java in some respects,
but has fewer of the overheads of Java, and generally at a higher level
than Java. It is an excellent choice as a glue language. Being interpreted,
it is also excellent for rapid prototyping, with common experience being
that applications can be developed 5 times more quickly in Python than in
Java. See http://www.ferg.org/projects/python_java_side-by-side.
html for more details of such a comparison.
A number of products use Python as a scripting and extension language,
including OpenOffice.
70.1
Python Documentation
All python packages are self documenting, and the documentation can be
obtained using the pydoc command:
$ pydoc csv
469
470
Python
70.2
We can now install either RSPython or RPy. Both provide a Python interface to R, and RSPython also provides an R interface to Python while
RPy is generally easier to use than RSPython! RSPython is not packaged
for Debian yet, but RPy is.
70.2.1
Installing RSPython
$ wget http://www.omegahat.org/RSPython/RSPython_0.5-1.tar.gz
This command, executed as the root user has then installed the required files
into /usr/lib/R/library/RSPython. To communicate where the files are
installed to Python we need to set up three environment variables (a Debian
package would probably set this up so that these extra environment variables
are not required), and then run Python and try out some RSPython calls:
$
$
$
$
$
export
export
export
export
python
R_HOME=/usr/lib/R
PYTHONPATH=${R_HOME}/library/RSPython/Python
PYTHONPATH=${PYTHONPATH}:${R_HOME}/library/RSPython/libs
LD_LIBRARY_PATH=${R_HOME}/bin
471
If you get:
$ python
>>> import RS
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/lib/R/library/RSPython/Python/RS.py", line 1, in ?
import RSInternal
ImportError: /usr/lib/atlas/libblas.so.2: undefined symbol: e_wsfe
>>>
70.2.2
Installing RPy
472
Python
$ python
Python 2.3.1 (#2, Sep 24 2003, 11:39:14)
[GCC 3.3.2 20030908 (Debian prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from rpy import *
>>> l = [r.dchisq(x, 4) for x in r.seq(0, 10, by=0.1)]
>>> r.par(ask=1, ann=0)
{ask: 0, ann: 1}
>>> r.plot(l, type=lines)
Hit <Return> to see next plot:
>>> r.dev_off()
{null device: 1}
>>> ^D
$ cd /tmp
$ wget http://easynews.dl.sourceforge.net/sourceforge/rpy/rpy-0.2.tar.gz
$ tar zxvf rpy-0.2.tar.gz
$ cd rpy-0.2
$ sudo python setup.py install
$ sudo emacs -nw /etc/ld.so.conf
Add the line:
/usr/lib/R/bin
$ sudo ldconfig
$ python
Python 2.2.1 (#2, Sep 7 2002, 15:35:22)
[GCC 2.95.4 20011002 (Debian prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from rpy import *
>>> l = [r.dchisq(x, 4) for x in r.seq(0, 10, by=0.1)]
>>> r.par(ask=1, ann=0)
>>> r.plot(l, type=lines)
>>> ^D
$ cd ..
$ sudo rm -rf rpy-0.2*
473
$ python
>>> from rpy imprt *
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "rpy.py", line 24, in ?
import _rpy
ImportError: /usr/lib/atlas/libblas.so.2: undefined symbol: e_wsfe
>>>
However, more recently this packages is actually required to run R and rpy!
With version 0.3.1 of rpy I get the following (11 Aug 03):
> python2.2
Python 2.2.3+ (#1, Aug 10 2003, 10:11:23)
[GCC 3.3.1 (Debian)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import rpy
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/lib/python2.2/site-packages/rpy.py", line 24, in ?
import _rpy
ImportError: /usr/lib/python2.2/site-packages/_rpymodule.so:
undefined symbol: jump_now
>>>
474
Python
Chapter 71
R: Statistical Software
Debian Pacakges: r-base
There is an excellent selection of very high quality statistical software available for Debian GNU/Linux. A favourite is R, an open source version of
S/SPlus, widely used in the academic statistical community.
While R has its own interpreter and interactive shell, the examples provided
here use the RPy interface (Section 70.2.2) so that we can use R inside of
Python programs. This is simply a convenience of staying within the one
environment.
71.1
Graphs
475
476
R: Statistical Software
Services
> python
>>> from rpy import *
>>> l = [1,2,3,4,5,4,5,3,6,2,3,4,8,2,1]
>>> r.postscript("rplot01.eps")
>>> r.plot(l, type=b, xlab="Days", ylab="Services")
>>> r.dev_off()
10
12
14
Days
r.png("rplot02.png")
r.par(cex=1.5)
r.plot(death6m, type="b", xlab="Month", ylab="Percentage",
lty=1, pch=0, axes=False)
r.lines(death30, type="b", lty=2, pch=1)
r.box()
71.1 Graphs
477
478
R: Statistical Software
71.1 Graphs
Generate a pie chart:
from rpy import *
import os
dates = (A, B, C, D, E, F)
percs = (25, 12, 35, 8, 10, 10)
labs = ()
for i in xrange(len(dates)):
labs += ("%s (%d%%)" % (dates[i], percs[i]),)
r.postscript("rplot04.eps")
r.pie(percs, labels=labs)
r.dev_off()
os.system("gv rplot04.eps")
479
480
R: Statistical Software
Chapter 72
Rsync: Remote Files
72.1
Rsync Server
To set up an rsync server simply install the rsync package then copy /usr/
share/doc/rsync/sample-rsyncd.conf.gz to /etc/rsyncd.conf. Edit it
to perhaps turn logging on:
log file=/var/log/rsyncd
...
transfer logging = yes
Make sure that port 873 is allowed through your firewall. Add the following
line to /etc/inetd.conf:
rsync stream tcp nowait root /usr/bin/rsync rsyncd --daemon
$ rsync datamining.csiro.au::
debianbook
Grahams Debian GNU/Linux Survival Guide
481
482
For each module (debianbook in the above) you identify a its configuration,
including a path to where it lives, for example:
[debianbook]
comment = Grahams Debian GNU/Linux Survival Guide
path = /var/www/debian/book
read only = yes
list = yes
uid = nobody
gid = nogroup
transfer logging = yes
...
To have your local server start up at boot time add the following to /etc/
inetd.conf:
rsync stream tcp nowait root /usr/bin/rsync rsyncd --daemon
After editing the /etc/rsyncd.conf file be sure to send the process a HUP
signal.
Chapter 73
Samba
Debian Pacakges: samba swat
The swat package is a nice web based administration tool. Highly recommended.
If using encrypted passwords (default) then need to add users using the
password manager in swat or with the command line smbpasswd. You may
also need to set the encrypted password option in /etc/samba/smb.cnf:
encrypt passwords = true
Note that the default installation provides access to user homes straight out
of the box.
483
484
Samba
Chapter 74
Scanning
The usual GNU/Linux scanner interface is called sane (Scanner Access Now
Easy).
74.1
Note that the hpoj daemon is the one to start/stop when changing hpoj
options.
Test it works as a user:
> ptal-devid
MFG:Hewlett-Packard;MDL:PSC 2200 Series;
CMD:MLC,PCL,PML,DW-PCL,DYN;CLS:PRINTER;
1284.4DL:4d,4e,1;SN:MY32AF320G0G;
S:0380008084021000002c148005cc250005c;AiO:0;
485
486
Scanning
If permission problems (printing works just fine but cant access the device
for scanning etc.), then try:
# chmod o+rx /dev/ptal-printd
74.2
Scanning Setup
If you still have problems, try disconnecting the USB scanner and plug it
back in.
Chapter 75
Science
75.1
Chemistry
75.1.1
Periodic Tables
487
488
Science
Chapter 76
Security
76.1
Booting Linux
You can protect against just anyone booting your system into Linux by disabling booting from floppy disk and CD-ROM in the BIOS, and by password
protecting LILO.
76.2
Note that this daemon is not automatically run within the /etc/init.d
framework.
As a user start up the nessus client and login with your user name. Go to
the Target selection tab and type in a list of hosts you wish to check, comma
489
490
Security
separated. If you want to test all machine on your network, try something
like 192.167.0.1/24.
After you click Start the scan the checking is initiated. Eventually a report
will be presented. You can save the report in various formats, including
LATEX.
The testing is extensive and the report provides suggestions for eliminating
security holes.
76.3
The chkrootkit package provides the chkrootkit command to check for signs
of rootkits on the local system. Run the command as root and scan the
output for warnings.
# chkrootkit
ROOTDIR is /
Checking amd... not found
Checking basename... not infected
Checking biff... not found
Checking chfn... not infected
Checking chsh... not infected
Checking cron... not infected
Checking date... not infected
Checking du... not infected
Checking dirname... not infected
Checking echo... not infected
Checking egrep... not infected
Checking env... not infected
Checking find... not infected
Checking fingerd... not found
Checking gpm... not found
Checking grep... not infected
Checking hdparm... not infected
Checking su... not infected
Checking ifconfig... not infected
Checking inetd... not infected
Checking inetdconf... not infected
Checking identd... not found
491
492
Security
Note that with current versions of ps and chkrootkit (as of 3 December 2003),
ps reports the PID of some kernel processes as 0 which chkrootkit does not
match to the process. Output from ps is:
USER
VSZ
RSS TTY
STAT START
TIME COMMAND
1
2
0
0
0
0
0
22
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
1484
0
0
0
0
0
0
0
493
488
0
0
0
0
0
0
0
?
?
?
?
?
?
?
?
S
SW
SWN
SWN
SW
SW
SW
SW
Dec02
Dec02
Dec02
Dec02
Dec02
Dec02
Dec02
Dec02
0:00
0:00
0:00
0:00
0:00
0:00
0:00
0:00
init
keventd
ksoftirqd_CPU0
ksoftirqd_CPU1
kswapd
bdflush
kupdated
aacraid
494
Security
TracerPid:
0
Uid:
0
0
0
Gid:
0
0
0
FDSize: 32
Groups:
SigPnd: 0000000000000000
SigBlk: ffffffffffffffff
SigIgn: 0000000000000000
SigCgt: 0000000000000000
CapInh: 0000000000000000
CapPrm: 00000000ffffffff
CapEff: 00000000fffffeff
0
0
76.4
Identify Portscanners
There are some tools to check who is portscanning your machine and when.
A good tool seems to be ippl, the IP Protocols Logger, but others include
snort and portsentry.
In kernel 2.4 iptables has a mechanism for portscans where you can set it up
so that most portscans will take hours to return nothing.
76.5
Packages to Avoid
495
ftp: Users will try to ftp to remote hosts and log in using clear text
passwords. Run dsniff on the local machine as root to see that you can
easily capture their passwords!
ftpd
netkit-rpc
nfs-common
nfs-kernel-server
nfs-user-server
portmap
rsh-client: Users will try to rsh to remote hosts and log in using clear
text passwords. Run dsniff on the local machine as root to see that
you can easily capture their passwords! The ssh package will install a
replacement rsh.
rsh-server
rstart
rstartd
rusersd
rwalld
sendmail
talkd
telnet: Users will try to telnet to remote hosts and log in using clear
text passwords. Run dsniff on the local machine as root to see that you
can easily capture their passwords!
telnetd
496
76.6
Security
Install the GNU Privacy Guard package in Debian as gnupg. This is the
GNU implementation of the OpenPGP.
To automatically check signatures from a keyserver add the name of a keyserver to /home/kayon/.gnupg/options file. For example:
keyserver wwwkeys.au.pgp.net
497
498
sub
Security
1024g/D7DE757D 2003-04-03
This generates:
-----BEGIN PGP PUBLIC KEY BLOCK----Version: GnuPG v1.2.3 (GNU/Linux)
mQGiBD6Le6QRBACa0Di6Gcx4Q3Tpghl+hu/geCBRaZUZlMxbx0yxxOgsoOb/SMzP
NNNG5IdMVKrV60X8jwzCi/tx3QdKps9hE+kNESW472LDEUdbDLjxDMajyfW16k2r
sxkvW3iiyQeO8catYdUm4Qt5SoU/X1/U1PGurSzC9jeMcnB5UThQ6tGs+wCg6Qgq
X5NCHtzpKPWU06I7trfSEpsD/1+w3g5+qjy+s3jj+gUf3kELY1NMyrvGnsb5D8ns
y9mXA35QnRGh+66gGYS5JSPB4eZLz/p6E4cum8M8UiFFIYuzdN8mec4hoT8MD1Eg
+WT1S3L6337k0S+p0ePaTVFQuZw7p0O9UX1xlqCsvFXqlsQSy9ZG+2AB4wg5zR25
vnEvBACBB+js3IbvXyWsDRcEsgYHm0whA+rB0cOgYW0VxdpdgLOwhm71TAbR8KDS
icbM8raWwFlA/8m5z/0CMo6izm7pI3lDUmXsrE8qsJvHawMd+Vvt5XAwEB3yonWU
o6lHvZKROZuyNM5I2pT2i331Ukwbg42cRG75HD2LZnrV6CuitLQuR3JhaGFtIFdp
bGxpYW1zIDxHcmFoYW0uV2lsbGlhbXNAdG9nYXdhcmUuY29tPohZBBMRAgAZBQI+
i3ukBAsHAwIDFQIDAxYCAQIeAQIXgAAKCRCeP1CyW4KdSwVEAJ9XbkhnzcYojuII
vsX3JkCK8De3qQCgqY8bbuCJyW5Ky1bPfd3mpEliObS5AQ0EPot7pRAEAIXoJqCf
mWpUasWeeNICVVwM30urggwXHnOjAcKkBN8uJGK6WeHlFNJmFfd4D5bHny6sJw7X
QiYZKlAwFULct55DwS/GUuko1wtPOXS1jmC3XbkzBXpWE05PgP+7BOXkZdimPm+g
xZdeG/GjGGg3HVMHY13xCe0C73Ou0gKSfidrAAMFA/9VrkDyPgYNgWEKfpgqkJHD
TX5cmy5Q1gKFEEKRnJGMhm8UauHIBX3SzlYylguHNFEfITPqOxNbYeMgaDwL6/7h
HVegv5o93bUkqE88J3q5t0EZDRlE2yoL6vcaqyDdwhAGmwGoT2lUk9DrbIwJGmZD
a6BPHIQ23Q2Av/+zl0qLI4hGBBgRAgAGBQI+i3ulAAoJEJ4/ULJbgp1LjhUAniKX
qE3SGxCAVFUeIrKHk/pYqyTVAJ9WkJ31FxQWBmmw81dxsdAslDFxkg==
=nrTb
-----END PGP PUBLIC KEY BLOCK-----
499
To put your public key on to one of the public key servers (so others can
access it) you can do:
> gpg --send-key --keyserver pgp.earth.li 5A829E4A
gpg: success sending to pgp.earth.li (status=200)
The key is also now at other servers without any extra effort:
> gpg --recv-key --keyserver wwwkeys.pgp.net 5A829E4A
gpg: key 5A829E4A: "Kayon Toga <[email protected]>" not changed
gpg: Total number processed: 1
gpg:
unchanged: 1
76.7
There is a lot to understand about networking in order to secure your network. Fortunately Debian GNU/Linux is generally by default quite secure.
That is, the default configuration of packages tend to be secure. You have
to take action to make them insecure. Nontheless, it is possible!
Here are some random jottings:
To start with, if someone has physical access to your hub-based network they
can plug in a machine and do many things.
With a passive ethernet frame sniffer an attacker can listen for ARP requests
on a network and guess at IP addresses that may not be in use within the
range of available adresses for the network and use this as its own address.
Even if your network has hosts using the whole range of addresses that are
available theres always the likelihood that one PC or Laptop is turned off
so that its IP address is free.
500
Security
If you use a switch-network and put MAC address filters on the switch an
attacker can simply unplug an existing PC or Laptop and take over its MAC
address.
Normally the MAC address is in the ethernet card. A typical situation is
to plug a Laptop into a network and perhaps bring up the interface using
DHCP to get an IP but may not be able to do much more.
In some situations the MAC address can be set in software. DECnet, for
example, depends on being able to do this. Older suns had the MAC in
battery-backedup ram and used the same address for all ethernet cards in the
system. When you change the 48 bit MAC address you are actually turning
it into a customised MAC address which will be 96 bits long consisting of
the original 48 bit MAC followed by the new 48 bits you set. To the outside
it appears as another MAC address.
You can change the MAC address with:
# ifconfig eth0 hw ether 00:50:56:01:00:00
Turning off DHCP will help protect against users that plug in a Laptop but
not the hackers youre trying to guard against.
FROM http://www.linuxlock.org/features/somjuly00.html
LinuxSecurity.Com wins Source of the Month for July, 2000
This months LinuxLock.Org Security Source of the Month goes to a group
of individuals dedicated to bringing security to the fore-front of the linux
community; this is the staff of LinuxSecurity.Com. Since we started following
the site in January 2000, it has evolved into one of the internets premiere
sources of Linux Security Information.
LinuxSecurity.Com contains a large newsfeed, of linux security news, articles,
and press releases, to keep us on top of the industry.
This month pushed them over the top, when they released The Linux Security Quick Reference Guide. This guide is a printable PDF document with
numerous security checks and tips, some of the sections include Linux Kernel
Security, File Permissions, Intrusions Detection, Linux Security Resources,
and more.
LinuxSecurity.Com has provided original features every month, covering things
such as, how to use certain security tools, and interviews with Security
501
76.8
Note that, for example, a HTTP server on port 80 identifying itself as:
> httptype ktware.com
Apache/1.3.29 (Debian GNU/Linux) PHP/4.3.3
is not really a security risk. Serious attacks will attempt all know vulnerabilities of the port, irrespective of what is running behind the port. Thus
this is not regarded as sensitive information. On the other-hand, hiding the
banner loses a lot for inter-operation.
502
Security
Indeed, software should advertise its version number to aid debugging in all
kinds of circumstances. If theres a security flaw then the flaw should be
fixed instead of trying to hide it.
Chapter 77
Sketch
Sketch is an interactive vector drawing program. It is comparable to the
commercial CorelDraw. Sketch supports drawing primitives like rectangles,
ellipses, bezier curves, bitmap and Encapsulated PostScript images, and text.
Objects can be rotated, scaled, and sheared. Primitives can have fill and line
properties. A number of special effects like blend groups, text to bezier and
text along a path are provided. Sketch supports an unlimited undo history.
Import of xfig, ai, wmf, cmx and svg files. Exports to pdf, eps, ai and
svg. Sketch is written in Python with a Tkinter GUI. User scripts can be
written in Python.
503
504
Sketch
Chapter 78
Sound Recording
Debian Pacakges: gnome-media sound-recorder gramofile audacity aumix aumixgtk rawrec
Recording from the sound card of your computer opens up the possibility of
recording from external sources including your old Long Playing turntable
turn that old collection of vinyl into a collection of audio CDs.
Recording to WAV format takes up quite a bit of spaceapproximately
10MB for each 1 minute of recording. Thats about 600MB for a very long
LP, which is about what you can fit onto a CD. Often though old LPs contain
just 30 to 40 minutes and so can be doubled up on to 74 or 80 minute CD-Rs.
78.1
Required Software
The Gnome sound recorder comes from the gnome-media package. A command line application sound-recorder provides an alternative method of recording sounds.
The rawrec package provides a useful command line recorder and might be
used to record to a 320kbps mp3 as in:
505
506
Sound Recording
The gramofile application is more useful for recording from vinyl LPs, for
example. It also supports track splitting and filtering to remove thr traditional vinyl pop. For editing the sound signal use the graphical audacity
application.
78.2
Hardware Connections
78.3
Mixer Settings
Sound recording applications rely on proper settings within the audio mixer.
With the mixer you can select the source for the recording (line-in or microphone) and the level of Gain for the recording. The mixer is also used to set
output volume levels.
There are multiple possible sources for recording, including Line-In and Microphone. If the source is an external multitrack mixer or HiFi then plug it
into the Line In and set Line as the Rec source. Note that both the line level
and IGain need to be set appropriately, perhaps after some experimentation.
Setting the gain too high results in clipping and setting it too low means
that noise in the source can overwhelm the signal.
There are various tools to set the levels of various channels. Gnome Audio
Mixer is available under ProgramsMultimedia, providing a graphical interface to mute/unmute channels and to select the channels for recording.
A command line alternative is the aumix command from the aumix package.
You can query the current setting of the line-in and input-gain with:
$ aumix -lq -iq
line 100, 100, R
igain 30, 30
Here the line-in is selected for recording with 100% level. The gain is set at
30%. These work for my sound card.
Alternatively you can get all the current settings with:
507
$ aumix -q
vol 62, 62, P
pcm 63, 63
speaker 79, 79
line 100, 100, R
mic 62, 62, P
cd 100, 100, P
igain 30, 30
line1 0, 0, P
line2 0, 0, P
phin 0, 0, P
phout 0, 0
video 3, 3, P
To set the line-in and gain to the above values and for recording from line-in:
With aumix-gtk installed aumix will start up a graphical display that allows
setting the values interactively.
78.4
Using Gramofile
This is, currently, by far the simplest tool to record from gramophones, with
a usable but unsophisticated interface.
Consider a sample record: Kraftwerks Computer World, side 1. Line-in
is set to 100 and igain is 30. From gramofiles recording meters this setting
rarely (0.3%) exceeds 50% maximum volume level, which is perhaps too low?
Nonetheless the result sounds okay.
The automatic track finder only found 3 (instead of 4) tracks (but only when
the minimum gap is set to 5). Listening to the Track 3/4 changeover it is
clear whythere is no gap. However, the .tracks file that is written can
be edited by hand and then the audio processing can be deployed to split
the file into tracks. The filtering includes Conditional Median Filtering to
filter out ticks. Mostly works just fine and is the default, so use it. Loading
the resulting 4 tracks into xmms works just fine (the original WAV file has a
508
Sound Recording
header that says it is 100 minutes long but this can be fixed within gramofile
by choosing to process the audio signal and using the Copy Only filter).
To record the resulting files to an audio CD see Chapter 14.
78.5
1. Gramofile to record from the sound card through line in from the source
(e.g., LP record)
2. Gramofile to identify track beginnings and endings. These are saved to
a .tracks file automatically.
3. Audacity to confirm and fine tune the track splits stored in the .tracks
file.
4. Gramofile to perform the split into tracks and to filter out pops using
the Conditional Median Filter II. The tracks are saved into separate
files numbered 01, 02, etc.
5. Xmms to check the beginning and ending of each track to confirm the
splits were fine.
6. Audacity to edit out any remaining spikes in each track, being sure to
export back to WAV if any changes are made.
7. The tracks are now ready to burn to CD. Create a disk.toc:
CD_DA
TRACK AUDIO
FILE "side1001.wav" 0
TRACK AUDIO
FILE "side1002.wav" 0
...
TRACK AUDIO
FILE "side2005.wav" 0
Then
$ cdrdao write disk.toc
509
78.6
2/120
7/420
12/720
17/1020
22/1320
27/1620
3/180
8/480
13/780
18/1080
23/1380
28/1680
4/240
9/540
14/840
19/1140
24/1440
29/1740
5/300
10/600
15/900
20/1200
25/1500
30/1800
When recording using the Gnome Sound Recorder the first 10 seconds of the
recording are chopped off? Might be better to use sound-recorder.
78.7
The options set stereo recording (-c 2), 16 bit sampling (-b 16), priority threading (-P) to ensure high priority in CPU usage, and limiting the
recording to 5 minutes. The output is written to the file recording.wav.
Many of these options are the default so you can simply:
$ sound-recorder -P recording.wav
78.8
510
Sound Recording
Chapter 79
Spell
For the older standard ispell, to change the default dictionary use the updateispell-dictionary. You will be offered a choice if the appropriate packages
are installed. This is being replaced by aspell.
For the newer aspell you can choose your default dictionary by specifying it
in /etc/aspell.conf:
master british
511
512
Spell
Chapter 80
SPlus: Statistical Software
SPlus is commercial software, popular with statisticians and commercial data
analysts. Install on Debian:
# adduser splus
# su - splus
$ cd
$ umask 022
$ tar zxvf splus.tz
$ ./HOSTINFO
Email the code and your SPlus serial number and server name to SPlus
By return mail you will get a license key
$ ./CONFIGURE
Select 4:
Destinations and Name of Splus Script
Select 2:
Name of Splus shell script
"Splus"
Change to "splus" to make life easier for everyone
The script to start Splus will be installed in /usr/local
$ ./INSTALL
Enter the key when prompted
Then fails with:
cp: cannot create regular file /usr/local/bin/splus:
Permission denied
So:
$ su
# ./INSTALL
y to CONFIGURE
# chmod go+rx /usr/local/bin/splus
Should now be installed!
513
514
Chapter 81
Spruce: Email
This is not Gnome, but it is GTK+ and supports multiple POP accounts.
515
516
Spruce: Email
Chapter 82
SSH: Secure Communications
The Secure Shell (provided by the ssh package) provides a secure mechanism
for communicating with remote hosts on a network. Unlike traditional tools
such as rsh, rcp, rlogin, telnet, and ftp, ssh encrypts all communications,
including passwords, reducing the opportunity for inappropriate interception.
It can also be used to encrypt your pop (email) communications and protect
you from DNS and IP spoofing where remote machines pretend to be genuine
machines that you are wanting to connect to. Implementations of ssh exist
for most of the major operating systems.
82.1
Versions of SSH
A Finnish company developed the original ssh but copyright and patent issues
lead to the development of the free OpenSSH.
There are two major (and slightly incompatible) versions of ssh: 1.X and 2.X.
From a 2.X client you will not be able to connect to a 1.X server. Connecting
to an OpenSSH 2.X server from any version of the client is supported though.
82.2
Installation
518
Having made this addition you can update the information about available
packages and then retrieve, unpack, and configure the package with:
# wajig update
# wajig install ssh
(apt-get update)
(apt-get install ssh)
During the install you may be asked about installing ssh as setuid root. The
suggestion from the configuration script is that you do not install as setuid
root and if you have problems, then run dpk-reconfigure ssh to reconfigure
the package.
82.3
When you use ssh to connect to a remote host for the first time you will be
confronted with a message like:
The authenticity of host rosz (192.168.1.2) cant be established.
RSA key fingerprint is 99:1f:eb:c2:8f:cb7:33:23:1f:4c:e5:51:20:e9:85:5a.
Are you sure you want to continue connecting (yes/no)?
SSH does not know this host. Type yes to add the fingerprint of this host
to ~/.ssh/known_hosts. Next time you connect to this remote host you
should not get this message.
82.4
Simple Usage
Ssh is a client-server program where your client (on your local host) connects
to a remote ssh server (running on the remote host), requiring that ssh be
installed on both hosts. (Many systems now run ssh.) You need to know the
519
password of the account you wish to connect to on the remote host. Once
connected all communications between the two hosts is securely encrypted.
Connect to a remote host simply by issuing the appropriate ssh command.
To connect as user kayon to a remote host altrop.ktware.com or to copy files
from your local host to kayons account at the remote host you can simply:
$ ssh [email protected]
$ scp file.name [email protected]:remote.file.name
82.5
ssh-keygen -t dsa
cd .ssh
scp id_dsa.pub [email protected]:.ssh/id_dsa.pub.modern
ssh altrop
> cd .ssh
> cat id_dsa.pub.modern >> authorized_keys
> exit
520
The remote host may already have an authorised keys file in /home/kayon/
.ssh/authorized_keys. Dont copy over it, but append the contents of your
local /home/kayon/.ssh/identity.pub to it. Multiple keys can appear in
the one file.
Now, when you connect to the remote host using ssh your public key on
that host will be used to send an encrypted message (a random number in
fact) back to your local host. The local host decrypts the message using the
private key stored only on the local host and decrypted using the passphrase.
The decrypted message is returned to the remote host for verification.
This method, using public keys, does not send passwords (or passphrases)
over the network. A passphrase is used on the local host only to unlock the
local private key.
82.6
SSH Agents
Entering the passphrase every time you want to do a remote copy or make
a remote connection can be tiring. There is a simple mechanism provided to
avoid this. All you need do is to start up a shell or other similar command
that already knows what your passphrase is (by you telling it just once).
This is done with ssh-agent to start the shell and ssh-add to store the
passphrase for this shell:
The ssh-add will prompt you for your passphrase but from then on all further
interaction with the remote host will not require the passphrase again.
The -l option of ssh-add lists the key(s) currently kept in memory for this
ssh-agent. The -d option removes an identity from memory.
82.7
521
Version 2 of ssh provides alternative encryption methods with DSA encryption instead of the RSA keys for Version 1. There is debate as to which
is more secure. Version 2 encrypts more of the data but always uses the
same Diffie-Hellman group (perhaps being more likely then that it has been
cracked).
inx$ ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/home/kayon/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/kayon/.ssh/id_dsa.
Your public key has been saved in /home/kayon/.ssh/id_dsa.pub.
The key fingerprint is:
cc:50:d4:85:86:56:b8:8a:77:57:61:51:63:89:46:09 kayon@inx
$ scp .ssh/id_dsa.pub altrop:.ssh/authorized_keys2.inx
$
$
$
$
ssh altrop
cd .ssh
cat authorized_keys2.inx >> authorized_keys2
exit
Be sure the protections on the files do not permit others to access them. In
particular, ssh wont work if the /home/kayon/.ssh/authorized_keys is
writable by anyone other than the user.
82.8
The passphrase to unlock your private key can be changed at any time with:
$ ssh-keygen -t dsa -p
This does not change your private or public key at all so no further action is
required in terms of distributing your public key.
522
82.9
Rsync is used to efficiently copy files across the network. It can use ssh to
perform its tasks by setting the appropriate environment variable:
export RSYNC_RSH=ssh
82.10
The default Xsession on Debian is run with ssh-agent so that ssh connections
can be initiated more easily (after you have performed an ssh-add). This is
controlled by the file /etc/X11/Xsession.options:
use-ssh-agent
You can have your ssh passphrase asked for each time you log on. Using
gdm and the Debian Session (rather than the Gnome Session) will load the
/home/kayon/.xsession file which can contain:
#!/bin/sh
ssh-add .ssh/id_dsa < /dev/null
exec gnome-session
Or else you can turn it on for all connections to a particular host by adding
the following line to /home/kayon/.ssh/config:
523
Host plymz
ForwardX11 yes
Or even more generally allow X Window System forwarding through all connections:
Host *
ForwardX11 yes
82.11
SSH Tunnelling
You will either receive a message stating the version of the remote ssh server
or an error message similar to:
telnet: Unable to connect to remote host: Connection refused
524
Then you can access this firewall protected HTTPS server locally through
https://localhost:5443/.
Heres an example using POP:
$ ssh -2 -n -N -f -a -L 5143:mail-bt:143 lynx sleep 1000d
Then you can access the POP server on your local machine.
82.12
82.13
which makes it immediately available (assuming you are running a http server
such as apache).
This supports both the external ssh pop up window and the internal (to
the browser) ssh window. No problems with terminal types here. Although
the default internal terminal is a bit too narrow for my liking. I extend it
525
82.14
SSH Version 1
526
Chapter 83
SUDO: Root Access
The sudo package allows a normal user to execute commands as root in a
controlled manner.
Debians sudo package has the password timeout set to 15 minutes. This
means that when you first enter your password, as long as you dont wait
more than 15 minutes between sudo commands, you wont have to enter it
again. The password timeout can be immediately expired with sudo -k.
Debians sudo is compiled with
--with-exempt=sudo
--with-secure-path="/usr/local/sbin:/usr/local/bin:/usr/sbin:...
527
528
Chapter 84
Swap
If running out of swap you can add 257MB more. First have a look at what
you have available:
# free
total
Mem:
256216
-/+ buffers/cache:
Swap:
224900
used
252208
148268
51268
free
4008
107948
173632
shared
118100
buffers
56996
529
cached
46944
530
Swap
used
252448
148508
51268
free
3768
107708
435768
shared
118100
buffers
56996
none
swap
sw
Then on boot when swapon -a is run the new swap will be added to swap
space.
cached
46944
Chapter 85
Themes
These have become quite popular in GNU/Linux resulting in the http://
themes.freshmeat.net web site as a central repository.
85.1
Enlightenment
Head over to e.themes.org, and find the themes you like. Download them,
and put them in ~/.enlightenment/themes. Then, restart Enlightenment
(use the left-click menu). Now, you can choose your new themes from the
middle-click menu. Its really pretty simple... I wouldnt worry about aptgetting that sort of thing (if you even can). There is supposed to be a tool
that will automatically update your themes, but last time I checked, it was
in the alpha stages. Cant recall what it was called, sorry...
531
532
Themes
Chapter 86
USB
Debian Pacakges: hotplug, usbview, usbutils.
The USB port is well supported in Debian. USB allows plug-n-play functionality of many devices. Installing hotplug (or the older usbmgr) will install
a daemon that monitors the USB ports and install the appropriate modules when devices are plugged in, while also noting when they are removed.
The usbview command will display the tree of USB devices connected in a
window, while the lsusb command lists in a terminal the usb devices. The
usbmodules command will list the drivers that might be able to manage
interfaces on currently plugged in USB devices.
For USB devices simply connect them to the USB socket and hotplug will
notice the new device and load the appropriate modules. (The alternative
usbmgr daemon will beep twice as it notices new devices.) The lsusb command will show that the device is recognised. What happens next depends
on the type of the device.
Further information about USB under GNU/Linux is available from http:
//www.linux-usb.org/. In particular, see http://www.linux-usb.org/
USB-guide/book1.html.
Generally, newer kernels are required. For example, with kernel-image-2.4.16686 a USB 20GB Hard Disk and USB DVD Burner worked but a USB Printer
did not. With kernel-image-2.4.20-686 they all worked.
533
534
86.1
USB
The standard Mass Storage Device protocol is used for USB devices such
as hard disk drives, flash memory drives, memory card readers, and digital
cameras. Such devices have a standard VFAT (MSWindows) file system.
The USB mass storage device is treated as a SCSI device so simply mount
the SCSI device:
# mount -t auto /dev/sda1 /mnt
You should now be able to see and use the device as any other disk. If you
already have a SCSI device then the USB device might be /dev/sdb1!
The kernel module usb-storage drives USB mass storage devices and should
be automatically loaded by hotplug. The kernel module vfat is also required,
and if it does not autoload then you will need to:
# modprobe vfat
You can run dmesg to check that the USB device has been found.
A sample setup of four USB devices includes a USB mouse, HP Printer/Scanner/Copier
with a card reader, a digital camera, and a flash memory drive (3System USB
flash disk). The /etc/fstab includes:
/dev/sda1
/dev/sdb1
/dev/sdc1
/hpcard auto
/camera auto
/flash auto
rw,user,noauto 0 0
rw,user,noauto 0 0
defaults,user,noauto 0 0
Then any user can mount, for example, /hpcard, when a memory card has
been inserted into the card reader. A problem is that unless the camera is
connected before the flash drive after a reboot, the mappings end up being
reversed!
The devices look like any other hard drive device so you can run fdisk on it
and reorganise partitions:
# fdisk /dev/sda
535
You can also format the partition(s) on the device, usually with a DOS/FAT
filesystem:
> mkfs -t vfat /dev/sda1
86.1.1
HP Photosmart 320
The camera acts just like a mass storage device! Photos can be copied or cut
from the appropriate folder and saved to your hard disk.
86.2
Connect a Sony DRX-500ULX, DVD+/-RW+/-R to Debin GNU/Linux using USB. Plugging it in results in a coule of beeps as usbmgr recognises it.
You can also run usbview or lsusb to check that it is properly recognised.
The device will be treated as a SCSI CD so you should be able to mount it
as:
# mount -t iso9660 /dev/scd1 /mnt
/dvdrw
auto
defaults,user,noauto 0 0
536
USB
With cdrdao and cdrecord the CD write functionality works just fine:
# cdrdao disk-info --device 4,0,0 --driver generic-mmc
Note that dvdrecord does not appear to be actively maintained. Also, this
dvdrecord command will fail for a DVD+RW (it only works for DVDRW presently), so use the dvd+rw-tools instead. This package is actively
maintained and also supports DVD-R(W). Format the DVD+RW with:
# dvd+rw-format /dev/scd1
Now growisofs is meant to work but failed with this particular drive with a
message indicating that the drive does not support TAO (Track At Once)
mode.
# growisofs /dev/scd1 -R -J dvd/
86.3
537
86.4
Install the packages for the printer: hpoj hpijs hp-ppd sane xsane mtools
hpoj-xojpanel. Install packages for printer queueing: cupsys cupsys-bsd
cupsys-client. Perhaps also foomatic-bin. Make sure the module printer
is loaded:
# lsmod | grep printer
# modprobe printer
If the printer module does not get loaded at boot time then add it to
/etc/modules.
538
USB
Chapter 87
Video
This chapter reviews software for viewing and modifying Video, and the set
up of software for particular video chip sets.
87.1
Viewing Video
87.2
DVD Videos
There at least five video players available for Debian: totem, xine-ui, mplayer,
ogle, and vlc.
There are considerable uncertainties in the legal situation with respect to the
position of the US movie studios. Certainly illegal copying of DVDs is to be
539
540
Video
avoided, but unfortunately the CSS copy protection scheme (used on DVDs)
has become a view restriction scheme, thereby, according to many, restricting
freedom of speech. Thus the required library to read many commercial DVDs
needs to be obtained separately.
# sh /usr/share/doc/libdvdread2/examples/install-css.sh
87.2.1
Xine
87.2.2
g
a
PgUp PgDn
v V
pause
p
subtitles . ,
chapt %
0-9
enlarge <> M-1,2,3
full screen
audio channel
audio sync
1:1 aspect
f
+ <- -> Home
s
Ogle
87.2.3
You can extract sound from a DVD, one track at a time or a chapter at a
time. Some simple command line examples should suffice to demonstrate
how this is done.
First off place the DVD into the DVD drive! This should probably be identified as /dev/dvd. Have a look at its table of contents with the lsdvd
command:
541
version 1.2.5
Chapters: 26,
Chapters: 02,
Chapters: 02,
This DVD has three titles, the first one (Title 01) probably contains the main
material, as it is identified as being the longest track. It also has two audio
streams.
To capture the audio from the tenth chapter of the first title, saving it as
OGG format, the command line is simply:
transcode -i /dev/dvd -x dvd -T 1,10,1 -a 0 -y ogg -m track10.ogg
The arguments identify the input as /dev/dvd (-i), the type of input as
DVD (-x), the title, chapter, and angle to encode, in this case being title
1, chapter 10, and camera angle 1 (-T), the audio track is track 0 (-a), the
output format is OGG (-y, and the output filename is track10.ogg (-m).
To extract multiple chapters from a title you can do the following composite
command:
for i in 1 2 3 4 5 6 7 8 9; do
echo transcode -i /dev/dvd -x dvd -T 1,$i,1 -a 0 -y ogg -m track0$i.ogg;
done
To extract the whole audio track of a title (all chapters) as OGG audio:
transcode -i /dev/dvd -x dvd -T 1,-1 -a 0 -y ogg -m audiotrack.ogg
542
87.3
Video
Video Backups
87.3.1
The video-dvdrip packages provides tools for working with DVD videos. With
this tool you can make backup copies (in numerous compressed video formats) for personal use of videos that you own. Or you could copy the video
onto your hard disk for archiving and watching directly. Youll need lots of
disk space (a movie DVD contains up to 9GB and converting needs further
disk space).
In fact dvdrip is only a GUI to numerous command line tools including
transcode which does the bulk of the work.
The dvdrip command provides an intuitive interface and reminder of all the
vast array of options available. Generally, load your DVD, go to the RIP
Title table and obtain the table of contents. The largest one is usually the
movie! If you are space restricted (less than 10GB say) you may like to do
one or more chapters at a time. You can then begin the rip to produce a
.vob file.
You have many choices for the format you would like to convert to.
Here is an example of taking a single chapter (happens to be chapter 19 of
title 1 of one of my DVDs) and encoding in several formats (where there is
a choice, they are 2620 kbit/s, but VCD is only 1152):
543
Ext Time
.vob
2m
.mpg
23m
.mpg
16m
Size Comments
239MB Audio somewhat poor.
99MB Very blocky.
51MB No choice of kbit/s.
.avi
.avi
.avi
94MB
103MB
103MB
10m
10m
10m
But to determine the best procedure, format and parameters for grabbing a
DVD into a compressed form suitable for hard disk storage is not a trivial
exercise. For example, deinterlacing may be required, but it is (almost) only
needed for material which was shot using a video camera, or transmitted for
TV.
87.3.2
Heres a recipe for generating an SVCD backup copy of your own DVD DVDs are expensive and a backup can save the heartache of a bad scratch.
The first step is to copy the video data from the DVD. You can use either
cpdvd:
> mkdir xyz
> cd xyz
> cpdvd .
or dvdbackup:
> dvdbackup -F -i/dev/dvd -o.
544
Video
Set the target for ripmake to be avi (generally thought to be a better format
and okay if you only view on computer, but there arent many, if any, DVD
players that can play an AVI file, although for backup you could regenerate
the DVD and thus if you lose or damage your original at least there is some
hope):
>
>
>
>
>
>
mkdir xyz
cd xyz
cpdvd .
ripmake [-s 650] ../xyz avi
make -f xyz-avi.mak
make -f xyz-avi.mak rip
87.4 DVD-AUDIO
545
To adjust the synchronisation of the adio, where the video appears to lag
behind the audio:
87.4
DVD-AUDIO
87.5
Use mencoder-686. Convert all images to the same size first. (Whats the
best size? Should I crop or rescale?)
Then transcode to SVCD and burn to CD. So far I do the following. But
this gives 1 frame per second. Cant seem to slow it down?
>
>
>
>
>
>
546
Video
87.6
nVidia does not supply Open Source drivers for GNU/Linux. Thus some
extra work is required to get nVidia graphics chips working. Bartok (Section 4.10.1) has an nVidia Riva Ultra 64 graphics chip. The appropriate
driver was installed and configured.
> wajig install nvidia-kernel-2.4.25-1-686-smp nvidia-glx
"GLcore"
"dri"
and to replace:
Driver
"nv"
Driver
"nvidia"
with
87.6.1
If the package for your kernel is not available yo ucan compile your own.
The process of installing the video drivers for GEForce 256 (Velox (Section 4.10.26)) and TNT2 (Mint (Section 4.10.27)) is straightforward. Note
that this is no longer required for standard Debian kernels which supply the
nvidia-kernel-2.4.25-1-686-smp and nvidia-glx packages. See section 87.6 for
details.
Install the appropriate Debian packages (with the kernel-headers package
that matches your installed kernel):
$ wajig install nvidia-kernel-src nvidia-glx-src
$ wajig install kernel-headers-2.4.20-686
547
Then, assuming youve installed a standard Debian kernel (e.g., kernel-image2.4.20-686) go to the kernel source directory and unpack the downloaded
archives:
# cd /usr/src
# tar zxvf nvidia-kernel-src.tar.gz
Debian packages are now generated from these sources with the following
steps. First build the nvidia kernel package. As part of this step the file
NVIDIA kernel-1.0-4349.tar.gz (about 700K) will be downloaded from the
nVidia archive:
#
#
#
#
#
#
export KSRC=/usr/src/kernel-headers-2.4.20-686
export KVERS=2.4.20-686
cd modules/nvidia-kernel-1.0.4349
CC=gcc-2.95 debian/rules binary_modules
cd ../..
wajig install nvidia-kernel-2.4.20-686_1.0.4349-1+_i386.deb
Next build and install the nVidia GLX package. Again, during this step the
file NVIDIA GLX-1.0-4349.tar.gz (about 4.2M) will be retrieved from the
nNidia archive:
#
#
#
#
cd nvidia-glx-1.0.4349
dpkg-buildpackage -us -uc
cd ..
wajig install nvidia-glx_1.0.4349-1_i386.deb
"nv"
with
Driver
"nvidia"
548
Load
Load
Video
"GLcore"
"dri"
To have this loaded at boot time add the following line to /etc/modules:
NVdriver
You can check that it all works by loading some of the GL graphics from
xscreensaver. Or run them directly, e.g., gears or evas-demo.
On Mint (Section 4.10.27) with version 0.9.769 of the nVidia driver there were
problems with system freezes. It generally happened in the xscreensaver
preferences when trying some of the GL savers (in full screen mode). In
window mode outside of xscreensaver they work just fine. Also freezes were
occurring when switching between multiple X Window Sessions (C-A-F7 and
C-A-F8, for example). The screen would go black. The problem appears to
have gone away with version 1.0.2314 of the nVidia driver.
On Velox (Section 4.10.26) with version 0.9.769 of the nVidia driver running
the evas test demo command crashed the xserver on exit from evas-demo!
Chapter 88
Web: Serving, Accessing, and
Mirroring
88.1
88.1.1
Epiphany
88.1.2
Galeon
Galeon is the Gnome web browser using Mozilla as the rendering engine.
For information on adding plugins for Galeon see Section 88.1.4.
88.1.3
Mozilla
550
deb http://pandora.debian.org/~kitame/mozilla ./
Mozilla is becoming pretty stable and works as the rendering engine for
galeon and epiphany.
88.1.4
Plugins
88.2
Web Server
551
You will now have a default web page at http://localhost/. The actual
page being displayed there comes from /var/www/index.html. You can
begin creating your own web site from there.
For a secure web server, using SSL to encrypt all communications from a
browser to the server (recognised with the https: prefix), there are at least two
options in Debian. One is to use apache with the libapache-mod-ssl module
and the other is to install the apache-ssl which installs a separate apache
server to listen to port 443 (instead of 80). There are advantages either
way but using apache-ssl is straightforward and cleanly keeps the two servers
separate (configuration files are in /etc/apache and /etc/apache-ssl and
log files in /var/log/apache and /var/log/apache-ssl respectively).
552
88.2.1
The directory /home/kayon/public_html is usually made accessible by default by apache. It can be accessed as:
http://www.ktware.com/~kayon/
That will allow Apache to look at a directory under the users home directory
named public_html.
88.2.2
they will get an error since this is actually a directory being referenced.
With a ServerName defined to be www.ktware.com in httpd.conf a / will
be automatically appended.
88.2.3
553
AuthUserFile /home/kayon/public_html/.htpasswd
AuthGroupFile /dev/null
AuthName ByPassword
AuthType Basic
Require user kayon
You will be prompted for a password. This stores the encrypted password in
the file .htpasswd (the -c option says to create the file). You can manually
edit this file, keeping the same format, and perhaps even cutting the user
passwords from /etc/shadow to maintain the same passwords.
Note that you should take precautions to protect the actual encrypted passwords if you copy them from the shadow file (otherwise they may be subject
to attempts to crack them). For example:
# chown www-data.www-data .htpasswd
# chmod o= .htpasswd
I would like to figure out a way to use the system passwords file without
making /etc/shadow accessible to everyone (which is precisely the point of
the shadow file) and without having to copy the encrypted passwords into
.htpasswd. Then I would define the particular user group (AuthGroupFile)
as the users who can actually access the relevent web pages.
Protecting a cgi-bin directory through the use of the .htaccess file make
sure you have in /etc/apache-ssl/httpd.conf:
AllowOverride AuthConfig
554
AllowOverride AuthConfig
Order deny,allow
Deny from all
Allow from ktware.com
</Directory>
88.2.4
I am using a self-signed certificate. To renew the certificate for 365 days once
it expires (from http://www.euhq.org/debian-apache-ssl-howto.html:
#
#
#
#
#
#
#
#
#
cd /etc/apache-ssl
openssl genrsa -out ktware.com.key 1024
chmod 600 ktware.com.key
openssl req -new -key ktware.com.key -out ktware.com.csr
AU
ACT
Canberra
Togaware
Data Mining
Togaware
[email protected]
(no challenge)
openssl x509 -req -days 365 -in ktware.com.csr \
-signkey ktware.com.key -out ktware.com.crt
mv apache.pem apache.pem.old
cp ktware.com.key apache.pem
cat ktware.com.crt >> apache.pem
chmod 600 apache.pem
88.2.5
Compressed HTML
Gzip you html documents and apache will still serve them up as if they were
not compressed! All automatically.
88.2.6
555
A very nice web log analyser and summary generator is awstats. Install the
package:
# wajig install awstats
Also you may like to include browser and host OS information in the summary
by using the apache combined log format:
LogFormat=1
Be sure the apache generates this information (the default is not to). Your
/etc/apache/httpd.conf should contain:
CustomLog /var/log/apache/access.log combined
To allow the analyser to run through the apache log files (/var/log/apache/
access) it needs permission to be able to read them. The simplest approach
is to:
# chmod o+r /var/log/apache/access*
556
88.2.7
88.2.8
To identify the web server running on a particular site you can use the httptype command available from http://httptype.sourceforge.net/. Example usage:
> httptype ktware.com
Apache/1.3.26 (Unix) Debian GNU/Linux PHP/4.1.2
88.3
Mirror Websites
Wget is a command line tool to download multiple files from http and ftp
addresses on the Internet. Suppose you wish to download all of the available
xmms skins from http://www.spacefem.com/skins/. The skins are in files
with the .tar.gz extension:
> wget -r -l 1 -A tar.gz -nd http://www.spacefem.com/skins/
Here the -r flag indicates that we want to recurse through the link, while -l
1 indicates that we recurse only a single level. The -A .tar.gz resticts the
download to just those files the have a .tar.gz extension. The extenstions
can be a comma separated list. The -nd request wget to not create any
directoriesthe files are downloaded to the current directory.
Chapter 89
Word: Processing and Printing
The premier Gnome word processor is AbiWord (Chapter 8) and KWord
does the same for KDE, although OpenOffice (Chapter 63) provides a word
processor that is very competitive with MSWord. Professional editors may
be more interested in the LATEX (Chapter 52) publishing systems.
557
558
Chapter 90
X: The Window System
The X Window System is the GNU/Linux windowing environment, serving a similar function to MS-Windows in providing a graphical windowing
interactive mouse point-and-click (WIMP) interface.
The first task in setting up the X Window System is to determine the type
of your video controller chip. There are very many video controller chips
available and when you purchase a PC with MS-Windows preinstalled someone has already done the hard work of making MS-Windows work with the
particular video chip. Under Linux you will need to tune the configuration
to get the X Window System functionally fully.
The X Window System, unlike MS-Windows, is a client-server architecture.
You run an X Window System server somewhere (usually on your local host)
to display onto your local host. You then run clients (such as word processors,
Netscape, etc.) somewhere (usually your local host, but no necessarily) and
have them display on through the server onto the display on your local host!
The freely available XFree86 is the default X Window System for most
GNU/Linux systems. Version 4.1.0 is becoming an easily tuned system.
You will then need to run either xf86config (for a console-based interface) or
XF86Setup (for a X Window System based interface) to create an appropriate /etc/X11/XF86Config file. If you are in luck, this will be straightforward.
Below are sample configurations:
559
560
90.1
"Standard"
500 5
Meta
ModeShift
Compose
ModeLock
"xfree86(us)"
"PS/2"
"/dev/psaux"
50
Section "Monitor"
Identifier "Dell SyncMaster 17GLi"
561
"Dell"
"SyncMaster 17GLi"
31.5 - 48.5
55-65
"1024x768" 65 1024 1032 1176 1344 768 771 777 806 -hsync -vsync
Section "Device"
Identifier "NeoMagic"
#
Option
"intern_disp"
Option
"extern_disp"
EndSection
Section "Screen"
Driver
"svga"
Device
"NeoMagic"
Monitor
"Dell SyncMaster 17GLi"
DefaultColorDepth 16
Subsection "Display"
Depth
16
Modes
"1024x768" "800x600" "640x480"
ViewPort
0 0
EndSubsection
EndSection
This setup is used when the notebook is docked with display being to an
external monitor. Both internal and external displays dont work together
and so you need to manually edit the XF86Config file each time you change
between the external and internal display (could be done with a script, but
essentially you swap the # around, which is used to identify a comment
line). It is reported that having both enabled can destroy the internal display.
It certainly makes it go pretty ugly momentarily. According to the Linux
on the Dell Latitude CPi A366XT page http://www.radcyberzine.com/
linux/linux-dell.html page, you cant just switch between internal and
external displays without updating your XF86Config and restarting X, or
YOU CAN DAMAGE YOUR DISPLAYS!
The value for the Vertical Refresh rate of 55-65 was suggested by Charlie
Hedlin since LCDs dont need 80Hz and the like.
XF86Config for the clgd7543/b/font
562
I hand crafted a simple XF86Config for the clgd7543 that worked to get 8
bpp at 800x600:
90.2
The most basic mode of operation of Debian is through the console with a
command line interface. This is, after all, how Unix users have interfaced
with Unix for more than thirty years. In a modern environment though
we expect to be able to use the point-and-click interface with the desktop
metaphor invented by Xerox in 197XXXX and popularised by the release of
the Apple Macintosh in 1984, the X11 Window System in 1986, and finally
with MS-Windows in 1995.
It is the X Window System that provides the platform for todays graphical
user interfaces in Debian and many other platforms. The X Window System
is really nothing more than another application sitting on top of the Linux
kernel. However, it is special in that it uses a client-server architecture so
important to a multi-user, multi-hardware, networked environment. The
significance of this is that you can run your X Window System application
on one machine (whether it is a Debian, Redhat, Solaris, Macintosh, or
Microsft machine) and have remote hosts of any type display directly to it.
As presented in Chapter 90 to run the X Window System we issue the command startx. With no further embelishments we have a basic graphical user
interface running and can usually start up oher applications like Netscape.
But this is just the start!
When you start up an application under the X Window System that application will display a window on your screen. The raw window is under the
control of the application while the X Window System simply handles the
rendering of the window onto your screen. For a very simply installation
this might look like the screen in Figure 90.1. You can get this with the
command:
$ startx xterm
Or to have this happen automatically each time you start the X Window
System simply create an ~/.xsession file and with the single line:
563
xterm
Either way this will start up the X Window System and then a terminal
emulator (xterm) but absolutely nothing else. If you get an error like the following then you probably already have an X Window System session running
on the default virtual terminal (vt07).
Fatal server error:
Server is already active for display 0
If this server is no longer running, remove /tmp/.X0-lock
and start again.
xinit:
Server error.
The solution is simply to run the new X Window System server on a different
virtual terminal (lets use vt09, but it could be vt08 or vt10) and we will call
the display by the name :1 rather than the default :0 which seems to already
be in use:
$ startx xterm -- :1 vt09
or else
564
$ startx -- :1 vt09
565
Then next time your startx Gnome will automatically begin. Details of
working with Gnome are in Chapter 37.
566
Figure 90.3: The Gnome desktop is now in control. These are the windows
that come up by default on a new installation.
90.3
567
You want two or more users to be able to run on seperate X Window System
sessions on the same system. Obviously not interacting with the system at
the same time if both sessions are running on console, but not havin to bail
out of a session to allow the other user access.
Do a console login as the desired userid. Launch an X Window System session
to an unused local display. Assuming your first session runs to :0, try:
startx -- :1 1>.startx.log 2>&1 &
90.4
We will assume that you have installed Gnome and the related packages.
This includes the Gnome Display Manager (gdm) which, once installed, will
automatically start up when you boot into Debian.
The essence to running Gnome is to include the following in the file ~/
.xsession:
exec gnome-session
Alternatively if you are using the Gnome Display Manager (gdm) then select
Gnome or Debian from the Session menu.
90.5
GDM Startup
The Gnome Display Manager gdm, when installed, will start up automatically on boot. This presents an X Window System interface to log on. If you
are used to starting the X Window System from the command line you will
be used to using either .xsession or .xinitrc to tune some of your X Window System settings. The System menu in the gdm dialogue lets you start
568
90.6
References
90.7
Wheel Mouse
"Generic Mouse"
"mouse"
"CorePointer"
"Device"
"Protocol"
"Emulate3Buttons"
"ZAxisMapping"
"/dev/psaux"
"ImPS/2"
"true"
"4 5"
90.8
569
Window Managers
90.9
XFree
570
Chapter 91
XML
91.1
XSLT Processors
sablotron: Works well but my sample genealogy style sheet with a parameter cause sablotron to find an error! (Perhaps its stricter with XSL or else
it does not implement some featurenot yet explored.)
$ sabcmd <XSL file> <XML file> [\$id=wgi001]
transformiix: Produces slightly different output to all the rest. Does not
seem to allow assignment to parameters.
$ transfrmx -s <XSL file> -i <XML file>
xalan: Works well but could not get it to take the parameter?
$ xalan -xsl <XSL file> -in <XML file> [-param id wgi001]
xsltproc:
$ xsltproc [--param id wgi001] <XSL file> <XML file>
571
572
XML
Thanks
Many people have contributed directly and indirectly to this book, with
snippets from email messages and discussion group postings and directly to
me. I list here some of the people who have contributed, knowingly and
unknowingly.
Rohinton Kazak fixed many typos. Vincent McIntyre provided information
on the installation of the machine Ive called Vince (Section 4.10.10). Damien
McAullay, Christian Kaske, Yoshiro Mihira, Jason Burrell, Bob Bownes, Peter Lamb, Dirk Eddelbuettel, Dean Jackson, Karsten Self, Shaul Karl, Ethan
Benson, John Flinchbaugh, Nathan Norman, Noah L. Meyerhans, Manoj Srivastava, and many others.
573
Index
.config, 86, 89, 93, 101
.fetchmailrc, 270
.htaccess, 552, 553
.procmailrc, 272
.tar.gz, 556
.vob, 542
.xinitrc, 567
.xsession, 567
/, 52, 53, 60, 63, 66, 69, 70, 72, 73,
450
/bin/sh, 31
/boot, 181
/boot/config-2.4.16, 383, 384
/boot/config-2.4.16-686, 385
/boot/grub/menu.lst, 65, 181
/boot/vmlinux, 180
/boot/vmlinux.old, 180
/cdrom, 192
/dev/cdrom, 191
/dev/dvd, 539541
/dev/fd0, 289
/dev/hda, 100, 263
/dev/hda1, 107, 185, 452
/dev/hda2, 53, 107, 452
/dev/hda3, 53, 62, 65
/dev/hdc, 195, 539
/dev/hdd, 193
/dev/hde, 93, 101, 191, 192
/dev/hdg, 93, 101
/dev/hdh, 93
/dev/hdj, 93
/dev/scd0, 193, 195
/dev/sda1, 74, 109, 185
/dev/sda2, 109
/dev/sdb1, 74
/dev/sdc1, 75
/dev/sg0, 206
/dev/tty1, 370
/dev/tty2, 370
/dev/tty6, 370
/dev/ttyS0, 459
/dev/ttyS1, 459
/dev/zero, 196
/dmrnet, 69
/dvdrw, 535
/etc, 33
/etc/, 431
/etc/X11/XF86Config, 295, 559, 560
/etc/X11/XF86Config-4, 127, 293,
547
/etc/X11/Xsession.options, 522
/etc/adduser.conf, 135
/etc/adjtime, 219
/etc/adjtimex.conf, 218, 219
/etc/alsa/alsa-base.conf, 387
/etc/apache, 551
/etc/apache-ssl, 551
/etc/apache-ssl/httpd.conf, 553
/etc/apache/httpd.conf, 552, 555
/etc/apt-move.conf, 151
/etc/apt/apt.conf, 148
/etc/apt/preferences, 148
/etc/apt/sources.list, 2629, 38, 44,
47, 84, 138, 142, 146, 148,
149, 151, 152, 159, 470, 549
/etc/aspell.conf, 511
575
576
/etc/backup.include, 172
/etc/chatscripts/provider, 405
/etc/cron.daily/, 225
/etc/cron.monthly/, 225
/etc/cron.weekly/, 225
/etc/crontab, 225, 226
/etc/cups/cupsd.conf, 464
/etc/cups/lpoptions, 466
/etc/cups/ppd/lp1.ppd, 466
/etc/cups/ppd/lp11.ppd, 466
/etc/debian version, 223
/etc/default/cdrdao, 198
/etc/default/nis, 457
/etc/default/rcS, 215
/etc/defaultdomain, 457
/etc/email-addresses, 270
/etc/exim.conf, 269
/etc/exim4/update-exim4.conf.conf,
270
/etc/exports, 223, 437, 439
/etc/fstab, 51, 55, 100, 192, 223,
263, 290, 438, 530, 534, 535
/etc/gdm/gdm.conf, 51
/etc/hostname, 269, 431
/etc/hosts, 269, 431, 464
/etc/hosts.allow, 223
/etc/hosts.deny, 223
/etc/inetd.conf, 223, 224, 431, 481,
482
/etc/init.d/, 368, 369
/etc/init.d/hwtools, 101
/etc/init.d/myfirewall, 369, 434
/etc/init.d/networker, 174
/etc/init.d/networking, 425, 426
/etc/init.d/rc, 368
/etc/init.d/rcS, 368, 369
/etc/inittab, 224, 367369
/etc/kernel-img.conf, 50, 62, 65, 74,
182
/etc/lilo.conf, 50, 56, 132, 180, 185
/etc/lilo/conf, 167
INDEX
/etc/mailname, 431
/etc/modules, 45, 72, 84, 107, 110,
167, 194, 195, 386, 387, 389,
438, 537
/etc/modules.conf, 107, 109, 118,
389
/etc/modutils/, 389
/etc/modutils/cdrw, 193, 386
/etc/modutils/sndconfig, 107, 109,
118, 163
/etc/motd, 224, 431
/etc/mysql/my.cnf, 417
/etc/network/interfaces, 45, 285, 426,
427
/etc/orbitrc, 342
/etc/passwd, 224
/etc/pcmcia/, 425
/etc/pcmcia/network, 425
/etc/ppp/ip-up.d, 217
/etc/ppp/peers/, 406
/etc/ppp/peers/provider, 406
/etc/ppp/resolv/provider, 430
/etc/profile, 177, 224
/etc/rc2.d/, 368
/etc/rcS.d/, 369
/etc/rcS.d/S30setserial, 369
/etc/rcS.d/S50hwclock.sh, 369
/etc/resolv.conf, 45, 430
/etc/rsyncd.conf, 481, 482
/etc/samba/smb.cnf, 483
/etc/securetty, 224
/etc/services, 224
/etc/shadow, 224, 553
/etc/shells, 224
/etc/texmf/texmf.cnf, 397
/etc/yp.conf, 458
/etc/ypserv.securenets, 457
/flash, 75
/home, 52, 53, 66, 70, 72, 73, 450
/home/kayon/.Xmodmap, 391, 392
/home/kayon/.bashrc, 232
INDEX
577
/usr/share/rubber/rubber/, 396
/home/kayon/.cdrdao, 198
/usr/src, 382
/home/kayon/.cvsignore, 232
/usr/src/kernel-source-2.4.16, 382
/home/kayon/.gnupg/options, 496
/usr/src/kernel-source-2.4.16/.config,
/home/kayon/.ssh/authorized keys,
383
521
/usr/src/linux/Documentation/sound/,
/home/kayon/.xsession, 522
107, 109, 118
/home/kayon/bin/spam-filter.sh, 277
/usr/src/linux/arch/i386/boot/video.S,
/home/kayon/public html, 552
132
/home/oracle/.bash profile, 448
/usr/src/linux/drivers/sound/i810 audio.c,
/hpcard, 534
163
/ktware/oracle/product/8.1.7, 448
/var, 262, 450
/mirrors/debian, 152
/var/cache/apt/archive/, 144
/mnt/floppy, 290
/var/cache/apt/archives, 152
/proc/cpuinfo, 52, 58, 60, 63, 66,
/var/lib/csv, 361
69, 72, 116
/var/lib/cvs/, 231
/raid, 55
/var/lib/cvs/CVSROOT/cvsignore,
/root/.my.cnf, 414
232
/root/distfile, 456
/usr/X11R6/include/X11/keysymdef.h, /var/lib/mysql, 450
/var/log, 360
391
/var/log/apache, 551
/usr/lib/R/library/RSPython, 470
/var/log/apache-ssl, 551
/usr/local, 261
/var/log/apache/access, 555
/usr/local/, 146
/var/log/auth.log, 524
/usr/local/bin/bash, 31
/var/log/installer.log, 428
/usr/local/bin/mkcdrtoc, 201
/var/log/syslog, 287
/usr/share, 52
/usr/share/dia/sheets/, 250
/var/spool/mail, 439
/usr/share/doc/apt-howto/en/index.html,/var/www/index.html, 551
138
[, 442, 459
/usr/share/doc/apt/offline.html/index.html,
init .py, 396
138
/.bash login, 177
/usr/share/doc/base-passwd/users/.bash logout, 177
and-groups.html, 359
/.bash profile, 177
/usr/share/doc/iptables/examples,
/.cddb, 203
435
/.dia/diarc, 238
/usr/share/doc/mysql-doc/index.html, /.dia/shapes, 255
414
/.dia/shapes/Sample/minimal.shape,
/usr/share/doc/rsync/sample-rsyncd.conf.gz,
255
481
/.dia/sheets/Sample.sheet, 256
/usr/share/myspell/dicts/dictionary.lst, /.enlightenment/themes, 531
444
/.profile, 177
578
/.xsession, 562, 567
a2ps, 463
abiword, 165
latex export, 165
adjtimex, 215, 218
Adobe, 299
alien, 145, 414
alsa, 382
alsa-source, 388
Altrop, 47, 84, 193, 195, 201, 208,
384, 437439, 450, 455, 456
Amirix, 21
apache, 62, 65, 68, 550, 551, 555
installing, 550
apache-ssl, 551
apm, 168
apmd, 168
Applications
System Tools
Floppy Formatter, 289
Networking, 426, 428
Users and Groups, 289, 359
apt, 67, 70, 144
apt-get, 24, 28, 29, 33
apt-get install wajig, 59, 61, 64
apt-get update, 59, 61, 64
apt-howto, 138
apt-listchanges, 145
apt-move, 151, 152
apt-setup, 27
aptitude, 29
aspell, 511
ati rage 128 pro tf, 106
atlas2-base, 471, 473
auctex, 396
audacity, 505, 506, 508
audio, 164
audio mixer, 506
audio recording, 505
connecting, 506
INDEX
mixer, 506
plugs, 506
recording settings, 507
required software, 505
steps, 508
aumix, 505507
aumix-gtk, 505, 507
autoconf, 314
autogen.sh, 313, 318
automake, 313, 314
awstats, 555
Bach, 263, 382
Background
colour, 248
Backup, 171175
Legato NetWorker, 173175
Bartok, 51, 381, 384, 464, 537, 546
base-config, 38, 61, 64
bash, 31
bastille, 285
beamer, 461
BIOS, 179
bladeenc, 203
bluefish, 363
boot
sparc station, 42
boot managers
lilo, 180
Build, 313
build (wajig command), 146
callbacks.c, 314, 317
callbacks.h, 314
capt, 29
Caravan, 457
Cargo, 58, 91
cat, 9
cd-rw
ide-probe-mod, 195
ide-scsi, 195
INDEX
cdda2wav, 203
cdlabelgen, 210
cdmaster, 197
cdparanoia, 203, 204
cdrdao, 194, 197201, 209
cdrecord, 146, 148, 194, 196, 197,
201, 202, 207, 208
Cepheus, 42
chemical modelling
ghemical, 297
chemistry
ghemical, 297
chkrootkit, 490
chrony, 217
cinepaint, 62, 65, 68, 71
clamav, 277
clamav-freshclam, 277
clipboard, 321
clock, 215
hardware clock, 215
system clock, 215
timezone
change, 215
timezones, 215
CMD Technology Inc PCI0680, 91
CMD680, 91
commands
adjtimex, 215
apm, 168
apt-get, 24, 28
apt-get install wajig, 59, 61, 64
apt-get update, 59, 61, 64
apt-move, 152
apt-setup, 27
aumix, 506, 507
base-config, 38, 61, 64
cat, 9
cdrdao, 194, 197
chkrootkit, 490
cpdvd, 543
cpvts, 543
579
cron, 216
date, 215
depmod, 55
dmesg, 193, 534
dpkg, 24, 28
dselect, 28
dvdrecord, 536
dvdrip, 542
fdisk, 534
fetchmail, 271, 272
fips, 452
ftp, 517
gdm, 567
gnome-session, 565, 568
gramofile, 508
hdparm, 100
head, 9
httptype, 556
hwclock, 215
i8kctl, 118
initrd, 56
insmod, 193
install-mbr, 180
lilo, 180
lpadmin, 464
ls, 9
lsdvd, 540
lshw, 52, 58, 60, 63, 66, 69, 72,
77, 79, 116, 123
lsmod, 193
lspci, 52, 58, 60, 63, 66, 69, 72,
85, 88, 92, 95, 97, 99, 103,
106, 108, 112, 114, 116, 119,
121, 125, 163
lsusb, 533, 535
make-kpkg, 388
make-pseudo-image, 31
mkdir, 9
mkdosfs, 290
modconf, 193, 429
modprobe, 107, 109
580
INDEX
mv, 9
network-admin, 426
nsrexecd, 174, 175
ntpd, 216
ntpdate, 216, 217
nwrecover, 175
orpheus, 164
plog, 459
pop, 517
ppconfig, 459
pppconfig, 459
pydoc, 469
rcp, 517
ripmake, 545
rlogin, 517
rm, 9
rsh, 517
rsync, 32, 152, 522
sawfish, 564
smbpasswd, 483
sort, 9
spamassassin, 277
ssh, 518, 519, 521523
ssh-add, 520, 522
ssh-agent, 520
ssh-keygen, 519
startx, 562
su, 46
swapon -a, 530
tasksel, 39, 62, 65, 68
telnet, 517, 523
texdoc, 395
transcode, 542
tzconfig, 215
update-grub, 74, 182
update-modules, 107, 109, 118,
389
update-rc.d, 369
uptime, 8
usbview, 533, 535
users-admin, 359
uudecode, 276
uuencode, 276
visudo, 38, 62, 65, 67, 70
vorbiscomment, 164
wc, 9
wget, 556
xf86config, 559
XF86Setup, 559
concurrent versioning system, 227
config-2.4.16-686-smp, 384
configure.in, 318
Connection Points, 243, 257
cpdvd, 543
cpvts, 543
Create Text, 242
cron, 216
Cultus, 437439
cupsomatic-ppd, 463
cupsys, 463
cupsys-bsd, 463
cupsys-client, 463
cupsys-driver-gimpprint, 463
cvdimager, 542
cvs, 227
cvs-doc, 227
daemons
ntpd, 216
usbmgr, 533, 535
database
mysql, 413
date, 215
Debian GNU/Linux, xxix
defoma, 293
dell
latitude c600, 63
optiplex gx110, 123
optiplex gx150, 76
optiplex gx240, 79, 106
optiplex gx260, 81, 84, 88
optiplex gx270, 72
INDEX
optiplex gxi 523m, 103
precision 420, 105, 121
precision 620, 95, 97
precision 650, 69
presatio 5740AP, 66
depmod, 55
dhelp, 267
dia, 237, 238, 240, 241, 243, 245,
247, 250, 255258
discover, 43
disk.toc, 202
dist-upgrade (wajig command), 107,
109
distributions, 19
debian, 20
code name, 25
release name, 25
version, 25
mandrake, 33
red hat, 20, 33
slackware, 20, 33
suse, 33
dmesg, 193, 534
doc-base, 267
doc-central, 267
document typesetting
latex, 395
dpkg, 24, 28
dselect, 28
dual boot, 183
MS-Windows/NT, 181
DVD
Audio, 545
Sound track
Extraction, 540
dvd+rw-tools, 536
dvdbackup, 543
dvdrecord, 536
dvdrip, 542
dwww, 267
581
Edit, 247, 319
Clear, 321
Copy, 247, 321
Cut, 247, 321
Delete, 247
Paste, 247, 321
emacs, 274, 396
auctex, 396
latex, 396
emacs21, 38, 61, 64, 67, 70
Embedded Debian, 21
eog, 279
epiphany, 550
epiphany-browser, 549
etc/modules, 548
etherconf, 44
evas-demo, 548
Evolution, 281
evolution, 274, 277, 439
exim, 46, 269, 270
exim4, 270
Export, 246
eye of gnome, 279
fdisk, 534
Festival, 88, 91, 201, 208, 450, 458
feta, 137
fetchmail, 47, 269272
File, 244, 319
Build Source Code, 320
Close, 247
Exit, 247, 319
New Diagram, 238, 244
New Project, 319
Open, 244, 319
Page Setup, 238, 247
Preferences, 238, 245, 248
Grid Lines, 245
User Interface, 245
View Defaults, 245
Project Options, 306, 320
582
INDEX
callbacks.h, 314
configure.in, 318
files
interface.c, 314
.fetchmailrc, 270
interface.h, 314
.procmailrc, 272
j2sdk-1 4 2 03-linux-i586.bin, 373
.vob, 542
main.c, 314
/etc/X11/XF86Config, 295
Makefile, 313, 314
/etc/X11/XF86Config-4, 293
sources.list, 59, 61, 64
/etc/default/nis, 457
src/gword, 314
/etc/email-addresses, 270
src/Makefile.am, 318
/etc/exim.conf, 269
src/Makefile.in, 318
/etc/exim4/update-exim4.conf.conf,
support.c, 314, 317
270
support.h, 314
/etc/fstab, 263, 290, 534
fingerprint, 518
/etc/hostname, 269
fips, 452
/etc/hosts, 269
firewall, 285
/etc/inetd.conf, 481
floppy, 289
/etc/init.d/myfirewall, 369, 434
foomatic-db, 463
/etc/init.d/rc, 368
frozen, 25
/etc/init.d/rcS, 368, 369
fstab
/etc/inittab, 367369
noauto, 192
/etc/network/interfaces, 285
nohide, 192
/etc/orbitrc, 342
ro, 192
/etc/rcS.d/S30setserial, 369
user, 192
/etc/rcS.d/S50hwclock.sh, 369
users, 192
/etc/yp.conf, 458
ftp, 517
/etc/ypserv.securenets, 457
functions
/home/kayon/bin/spam-filter.sh,
glade xml get widget(), 318
277
gtk.mainquit, 316
/usr/share/doc/base-passwd/usersgtk object get data(), 317
and-groups.html, 359
gtk object set data(), 317
/usr/share/myspell/dicts/dictionary.lst, lookup widget(), 317, 318
444
on exit1 activate, 316
/var/log/syslog, 287
galeon, 549, 550
init .py, 396
gcdmaster, 198
/.dia/diarc, 238
/.dia/shapes/Sample/minimal.shape,gdm, 39, 51, 62, 65, 68, 71, 84, 370,
567
255
gdm-themes, 39, 62, 65, 68, 71
/.dia/sheets/Sample.sheet, 256
gfloppy, 289
autogen.sh, 313, 318
callbacks.c, 314, 317
ggobi, 356
Save, 244, 319
Save As, 244
INDEX
ghemical, 297
glade, 303306, 310, 313, 314, 316
325, 327, 328
glade xml get widget(), 318
gmyclient, 414
gnome, xxxi, 5, 6, 8, 1013, 18, 20,
28, 39, 62, 65, 68, 71, 150,
164, 165, 192, 198, 235, 240,
245, 247, 258, 262, 281, 290,
291, 303307, 309, 319, 322
324, 326329, 332336, 341,
342, 345, 346, 356, 363, 367,
379, 395, 460, 487, 505, 506,
515, 549, 557, 567569
gnome office
abiword, 165
gnome-apt, 29
gnome-media, 505
gnome-session, 565, 568
gnome-system-tools, 426
gnome-tasksel, 44, 48
gnome-terminal, 313
gnuplot, 354, 355
gnus, 274
gogo, 203
gphoto2, 189
gramofile, 505508
Grid
spacing, 248
visibility, 248
grip, 203
groups
audio, 164
floppy, 289
grub, 43, 50, 62, 65, 67, 84, 88, 92,
105, 118, 179, 181184
gsfonts-other, 463
gthumb, 357
GTK+ toolkit, 235
gtk.mainquit, 316
gtk object get data(), 317
583
gtk object set data(), 317
gv, 210
gword, 315
Handles, 242
hardware clock, 215
hdparm, 100, 263
head, 9
Help, 319, 322
About, 323
FAQ, 322
Manual, 322
Quick-Start Guide, 322
help (wajig command), 139
hosts
Altrop, 47, 84, 108, 193, 195,
201, 208, 384, 437439, 450,
455, 456
Atom, 97
Bach, 99, 263, 382
Bartok, 51, 381, 384, 464, 537,
546
Bigdaddy, 79
Brick, 95
Caravan, 69, 457
Cargo, 58, 91
Cepheus, 42, 111
Cleveland, 105
Cultus, 437439
Fairmond, 76
Festival, 84, 88, 91, 201, 208,
450, 458
Friends, 66
imaphost, 271
Inci, 63
Inco, 116, 118, 152, 435, 436
Incx, 195
lynx, 271
Mint, 123, 194, 195, 199, 201,
208, 381, 383, 386, 537, 546,
548
584
Modern, 72, 433, 434
Prefect, 43, 103, 438
Punto, 438
Rose, 131, 435
Uramys1, 88
Velox, 121, 180, 185, 194, 195,
216, 218, 381, 383, 428, 437,
451, 546, 548
Vince, 81, 573
Vivaldi, 91, 382
Wayfare, 60
hotplug, 72, 74, 533, 534
hp-ppd, 463, 466
hpoj, 485
httptype, 556
hwclock, 215
hwtools, 101, 264
i8kctl, 118
i8kutils, 117
ID3, 205
image viewer
eog, 279
eye of gnome, 279
imagemagick, 357
imaphost, 271
Inco, 118, 152, 435, 436
Incx, 195
infotex, 267
initrd, 56, 106, 109
insmod, 193
install
debian 2.2r2, 106, 123
debian 3.0, 76, 79, 81, 84, 88,
91, 95, 97
debian-installer, 51, 58, 60, 63,
66
debian-installer beta 1, 69, 72
progeny 3.0, 99, 103, 105
install-mbr, 180
installation, 35
INDEX
books, 133
Debian Installation Guide, 35
from CD-ROM, 35
interface.c, 314
interface.h, 314
iptables, 433
j2re1.4, 374
j2sdk-1 4 2 03-linux-i586.bin, 373
jigdo-file, 377
kaffe, 373
kayon, 270, 271
kde, 341
kernel, 5
2.4.14-686-smp, 108
himem, 108
kernel modules
ide-probe-mod, 195
kernel-headers, 382
kernel-image, 381
kernel-image-2.2.18pre21, 51, 112
kernel-image-2.2.19, 52
kernel-image-2.4.16, 112, 385
kernel-image-2.4.16-686, 533
kernel-image-2.4.16-686-smp, 52
kernel-image-2.4.16-p3, 385
kernel-image-2.4.18-686-smp, 105
kernel-image-2.4.20, 84
kernel-image-2.4.20-1-686-smp, 55
kernel-image-2.4.20-686, 533
kernel-image-2.4.20-686-smp, 52
kernel-image-2.4.21-1-686, 91
kernel-image-2.4.22-1-686, 70, 72
kernel-image-2.4.23-1-686, 72
kernel-image-2.4.24-1-686, 65, 67
kernel-image-2.4.25-1-686, 62
kernel-image-2.4.25-1-686-smp, 52
kernel-package, 381, 382
kernel-source, 382
kernel-source-2.4.16, 52
INDEX
kernel-source-2.4.16.tar.bz2, 382
l3enc, 203
Ladder, 253
lame, 203, 204
latex, 395
abiword export, 165
emacs, 396
Legato Networker, see Backup
less, 38, 61, 64, 67, 70
libapache-mod-ssl, 551
libdvdread2, 540
libglade, 303, 304, 315, 317, 318,
324, 326, 327
lilo, 50, 84, 88, 106, 118, 179181,
386
initrd, 107, 109
Lines, 243
lookup widget(), 317, 318
lpadmin, 464
ls, 9
lsdvd, 540
lshw, 52, 58, 60, 63, 66, 69, 72, 77,
79, 116, 123, 136
lsmod, 193
lspci, 52, 58, 60, 63, 66, 69, 72, 85,
88, 92, 95, 97, 99, 103, 106,
108, 112, 114, 116, 119, 121,
125, 163
lsusb, 533, 535
lumiere, 539
lynx, 271
mailman, 276
main.c, 314
make-kpkg, 388
make-pseudo-image, 31
Makefile, 313, 314
man page, 267
mencoder-686, 542, 545
menu
585
Create Text, 242
Edit, 247, 319
Clear, 321
Copy, 247, 321
Cut, 247, 321
Delete, 247
Paste, 247, 321
Export, 246
File, 244, 319
Build Source Code, 320
Close, 247
Exit, 247, 319
New Diagram, 238, 244
New Project, 319
Open, 244, 319
Page Setup, 238, 247
Preferences, 238, 245, 248
Project Options, 306, 320
Save, 244, 319
Save As, 244
Help, 319, 322
About, 323
FAQ, 322
Manual, 322
Quick-Start Guide, 322
Ladder, 253
Objects, 249
Bring to Front, 249
Send to Back, 249
Programs
Development, 305
Select, 248
Connected, 248
Transitive, 248
Settings, 319
Tools, 250
Filter, 277
Filters, 277
UML, 238
View, 245, 248, 319
Diagram Properties, 248
586
New View, 248
Show All, 248
Show Clipboard, 305, 321
Show Widget Tree, 305, 309
Zoom, 248
Zoom In, 248
Zoom Out, 248
Mint, 194, 195, 199, 201, 208, 381,
383, 386, 537, 546, 548
mkdir, 9
mkdosfs, 290
mkisofs, 197
modconf, 193, 429
Modern, 433, 434
modprobe, 107, 109
modules
usb-storage, 534
vfat, 534
More Options, 359
most, 38, 61, 64, 67, 70
Mouse Button
left, 249
right, 244
mozilla, 549
mozplugger, 550
mp3encode, 203
mpegtools, 543
mplayer, 539
mplayer-686, 542, 550
mplayerplug-in, 550
mtools, 290
multiboot, 181
mutt, 274
mv, 9
myspell-en-gb, 443
mysql, 413, 450
mysql-client, 413
mysql-doc, 413
mysql-navigator, 413, 416
mysql-server, 413, 414
mytop, 413
INDEX
nautilus, 206, 357, 539
nautilus-cd-burner, 423
ncftp, 30
network
firewall, 285
ifconfig, 45
ip masquerading, 285
nat, 285
netstat, 45
network address translation, 285
setup, 45
network-admin, 426
nfs, 437
export list specification, 438
root access from client, 439
set up, 437
nfs-client, 437
nfs-kernel-server, 437, 438
nfs-user-server, 437
nsrexecd, 174, 175
NTFS, 441
ntp, 39, 216, 217
ntp-simple, 70, 216
ntpd, 216
ntpdate, 39, 62, 65, 68, 70, 216, 217
nvidia video chip, 546
nvidia-glx, 546
nvidia-kernel-2.4.25-1-686-smp, 546
nwrecover, 175
OReilly, 21
Object Defaults, 242
Object Properties, 239
Objects, 249
Bring to Front, 249
Send to Back, 249
office suite
abiword, 165
ogle, 539, 540
ogle-gui, 540
on exit1 activate, 316
INDEX
openoffice.org, 62, 65, 68
openssh, 517
optima, 91
super vision II 3600, 51
workpro, 99
orpheus, 164
Outlook, 281
packages
a2ps, 463
abiword, 165
adjtimex, 218
alien, 145, 414
alsa, 382
alsa-source, 388
apache, 62, 65, 68, 550, 551,
555
apache-ssl, 551
apmd, 168
apt, 67, 70, 144
apt-get, 29, 33
apt-howto, 138
apt-listchanges, 145
apt-move, 151
aptitude, 29
aspell, 511
atlas2-base, 471, 473
auctex, 396
audacity, 505, 506, 508
aumix, 505, 506
aumix-gtk, 505, 507
autoconf, 314
automake, 313, 314
awstats, 555
bash, 31
bastille, 285
beamer, 461
bladeenc, 203
bluefish, 363
capt, 29
cdda2wav, 203
587
cdlabelgen, 210
cdmaster, 197
cdparanoia, 203, 204
cdrdao, 197201, 209
cdrecord, 146, 148, 194, 196,
197, 201, 202, 207, 208
chkrootkit, 490
chrony, 217
cinepaint, 62, 65, 68, 71
clamav, 277
clamav-freshclam, 277
cupsomatic-ppd, 463
cupsys, 463
cupsys-bsd, 463
cupsys-client, 463
cupsys-driver-gimpprint, 463
cvdimager, 542
cvs, 227
cvs-doc, 227
defoma, 293
dhelp, 267
dia, 237, 238, 240, 241, 243,
245, 247, 250, 255258
discover, 43
doc-base, 267
doc-central, 267
dvd+rw-tools, 536
dvdbackup, 543
dvdrecord, 536
dwww, 267
emacs, 274
emacs21, 38, 61, 64, 67, 70
epiphany, 550
epiphany-browser, 549
etherconf, 44
evas-demo, 548
Evolution, 281
evolution, 274, 277, 439
exim, 46, 269, 270
exim4, 270
feta, 137
588
INDEX
fetchmail, 47, 269, 270
foomatic-db, 463
galeon, 549, 550
gcdmaster, 198
gdm, 39, 51, 62, 65, 68, 71, 84,
370, 567
gdm-themes, 39, 62, 65, 68, 71
gfloppy, 289
ggobi, 356
glade, 303306, 310, 313, 314,
316325, 327, 328
gmyclient, 414
gnome, xxxi, 5, 6, 8, 1013, 18,
20, 28, 39, 62, 65, 68, 71,
150, 164, 165, 192, 198, 235,
240, 245, 247, 258, 262, 281,
290, 291, 303307, 309, 319,
322324, 326329, 332336,
341, 342, 345, 346, 356, 363,
367, 379, 395, 460, 487, 505,
506, 515, 549, 557, 567569
gnome-apt, 29
gnome-media, 505
gnome-system-tools, 426
gnome-tasksel, 44, 48
gnome-terminal, 313
gnuplot, 354, 355
gnus, 274
gogo, 203
gphoto2, 189
gramofile, 505508
grip, 203
grub, 43, 50, 62, 65, 67, 84, 88,
92, 105, 118, 179, 181184
gsfonts-other, 463
gthumb, 357
gv, 210
hdparm, 100, 263
hotplug, 72, 74, 533, 534
hp-ppd, 463, 466
hpoj, 485
INDEX
lilo, 50, 84, 88, 118, 179181,
386
initrd, 107, 109
lshw, 136
lumiere, 539
mailman, 276
mencoder-686, 542, 545
mkisofs, 197
most, 38, 61, 64, 67, 70
mozilla, 549
mozplugger, 550
mp3encode, 203
mpegtools, 543
mplayer, 539
mplayer-686, 542, 550
mplayerplug-in, 550
mtools, 290
mutt, 274
myspell-en-gb, 443
mysql, 450
mysql-client, 413
mysql-doc, 413
mysql-navigator, 413, 416
mysql-server, 413, 414
mytop, 413
nautilus, 206, 357, 539
nautilus-cd-burner, 423
ncftp, 30
nfs-client, 437
nfs-kernel-server, 437, 438
nfs-user-server, 437
ntp, 39, 217
ntp-simple, 70, 216
ntpdate, 39, 62, 65, 68, 70, 216,
217
nvidia-glx, 546
nvidia-kernel-2.4.25-1-686-smp,
546
ogle, 539, 540
ogle-gui, 540
openoffice.org, 62, 65, 68
589
openssh, 517
pcmcia, 425
pcmcia-source, 388
postfix, 269
preview-latex, 396
procmail, 269
prosper, 461
pstoedit, 354, 357
python, 316, 327
python-base, 469
python-dev, 469
python-doc, 469
python-examples, 469
python-gdbm, 469
python-glade2, 64
python-gnome, 316
python-gnome2, 64
python-mpz, 469
python-regrtest, 469
python-rpy, 471
python-tk, 469
python-xmlbase, 469
qmail, 269
quanta, 363
rawrec, 505
rdist, 456, 464
readvcd, 208
reportbug, 150
rsync, 481, 482
rubber, 396, 475
samba, 483
sane-utils, 486
screem, 363
sendmail, 269
silo, 179
Sketch, 503
sndconfig, 163
sodipodi, 353
sound-recorder, 505, 509
spamassassin, 276, 277
ssh, 38, 59, 61, 64, 67, 70, 84,
590
INDEX
171, 270, 456, 517, 518, 520,
521, 523
subtitleripper, 542
sudo, 139, 197, 527
swat, 483
synaptic, 44, 48
task, 27
task-imap, 273
task-tex, 28
tasksel, 48
tetex-bin, 395
tetex-extra, 395
totem, 539
transcode, 542
usbmgr, 74, 533
usbutils, 533
usbview, 533
vcdgear, 208
vcdimager, 208
video-dvdrip, 197, 542
viewcvs, 227
vlc, 539
vm, 274
vrms, 39, 62, 65, 68
w32codecs, 539
wajig, 38, 62, 65, 67, 70, 84,
137139, 150
webmagick, 357
wget, 30, 556
wv, 407
x-ttcidfont-conf, 293
x-window-system, 39, 62, 65, 68,
71
xcdroast, 199
xfce, 235
xfig, 353, 354, 475
xgobi, 356
xgraph, 354
xine-dvdnav, 540
xine-ui, 62, 65, 68, 71, 539, 540
xingmp3enc, 203
INDEX
qmail, 269
QT+ toolkit, 341
quanta, 363
rawrec, 505
rcp, 517
rdist, 456, 464
readvcd, 208
Red Hat, 33
RedHat, xxix
reftex, 396
releases
frozen, 25
sid, 25
stable, 25, 26, 141
testing, 25, 26, 148
unstable, 25, 26, 107, 109, 116,
147, 148
woody, 25
reload (wajig command), 150
reportbug, 150
restart (wajig command), 150
Reverse Dragging, 245
ripmake, 545
rlogin, 517
rm, 9
root, 197
Rose, 435
rsh, 517
rsync, 32, 152, 481, 482, 522
rubber, 396, 475
samba, 483
sane-utils, 486
Save, 313
sawfish, 564
screem, 363
Select, 248
Connected, 248
Transitive, 248
sendmail, 269
591
Settings, 319
SGI, 21
Sheets, 237, 243, 250
Shortcuts
Ctl+C (copy), 247
Ctl+D (delete), 248
Ctl+F2, 305
Ctl+Q, 319
Ctl+Q (quit), 247
Ctl+S, 319
Ctl+S (save), 245
Ctl+V (paste), 247
Ctl+W (close), 247
Ctl+X (cut), 247
F3, 319
F3 (open), 244, 319
sid, 25
silo, 179
Sketch, 503
Slackware, 33
smbpasswd, 483
sndconfig, 163
sodipodi, 353
sort, 9
sound recording, 505
connecting, 506
mixer, 506
plugs, 506
recording settings, 507
required software, 505
steps, 508
sound-recorder, 505, 509
sources.list, 59, 61, 64
spamassassin, 276, 277
src, 314, 315
src/gword, 314
src/Makefile.am, 318
src/Makefile.in, 318
ssh, 38, 59, 61, 64, 67, 70, 84, 171,
270, 456, 517523
ssh-add, 520, 522
592
ssh-agent, 520
ssh-keygen, 519
stable, 25, 26, 141
stage/products.jar, 448
start (wajig command), 150
startx, 562
stop (wajig command), 150
su, 46
subtitleripper, 542
sudo, 139, 197, 527
support.c, 314, 317
support.h, 314
SVG, 255
swap, 107
swapon -a, 530
swat, 483
synaptic, 44, 48
system clock, 215
task, 27
task-imap, 273
task-tex, 28
tasksel, 39, 48, 62, 65, 68
telnet, 517, 523
testing, 25, 26, 148
tetex-bin, 395
tetex-extra, 395
tex
capacity exceeded, 397
texdoc, 395
TimeSys, 21
Tools, 250
Filter, 277
Filters, 277
totem, 539
transcode, 542
tzconfig, 215
UML, 238
Undo, 248
Universal Modelling Language, see
UML
INDEX
unstable, 25, 26, 107, 109, 116, 147,
148
update-grub, 74, 182
update-modules, 107, 109, 118, 389
update-rc.d, 369
upgrade (wajig command), 146
uptime, 8
USB, 52
USB Printer, 52
usb-storage, 534
usbmgr, 74, 533, 535
usbutils, 533
usbview, 533, 535
users
kayon, 270, 271
root, 197
users-admin, 359
uudecode, 276
uuencode, 276
VA Linux Systems, 21
vcdgear, 208
vcdimager, 208
Velox, 121, 180, 185, 194, 195, 216,
218, 381, 383, 428, 437, 451,
546, 548
vfat, 534
video chips
ati rage 128 pro tf, 106
nvidia, 546
video-dvdrip, 197, 542
View, 245, 248, 319
Diagram Properties, 248
New View, 248
Show All, 248
Show Clipboard, 305, 321
Show Widget Tree, 305, 309
Zoom, 248
Zoom In, 248
Zoom Out, 248
viewcvs, 227
INDEX
Vince, 573
Virtual Mail Folders, 281
Visio, 237
visudo, 38, 62, 65, 67, 70
Vivaldi, 382
vlc, 539
vm, 274
vorbiscomment, 164
vrms, 39, 62, 65, 68
w32codecs, 539
wajig, 38, 62, 65, 67, 70, 84, 137
139, 150
Wajig Commands
build, 146
dist-upgrade, 107, 109
help, 139
reload, 150
restart, 150
start, 150
stop, 150
upgrade, 146
wc, 9
web browser
galeon, 549
web server
apache, 550
webmagick, 357
wget, 30, 556
window manager, 564
woody, 25
word processor
abiword, 165
word processor
latex, 395
wv, 407
x-ttcidfont-conf, 293
x-window-system, 39, 62, 65, 68, 71
xcdroast, 199
xf86config, 559
593
XF86Setup, 559
xfce, 235
xfig, 353, 354, 475
xfree86
4.2, 106
xgobi, 356
xgraph, 354
xine-dvdnav, 540
xine-ui, 62, 65, 68, 71, 539, 540
xingmp3enc, 203
xmms, 39, 62, 65, 68, 508, 556
xosl, 179
xsane, 486
xserver-xfree86, 127, 293
xterm, 563
zile, 38, 61, 64, 67