Ubuntu_Kung_Fu

Ubuntu_Kung_Fu

This book was born out of an experiment carried out when Ubuntu
6.06 was released in 2006. Back then Ubuntu was rougher around the
edges than it is today. Getting MP3 ﬁles to play took some effort. Only
a handful of wiﬁ cards worked out of the box and the rest had to be
wrangled into working.

Nội dung Text: Ubuntu_Kung_Fu

Prepared exclusively for J.S. Ash

Beta
Book
Agile publishing for agile developers
The book you’re reading is still under development. As part of our
Beta book program, we’re releasing this copy well before we normally
would. That way you’ll be able to get this content a couple of months
before it’s available in ﬁnished form, and we’ll get feedback to make
the book even better. The idea is that everyone wins!
Be warned. The book has not had a full technical edit, so it will con-
tain errors. It has not been copyedited, so it will be full of typos and
other weirdness. And there’s been no effort spent doing layout, so
you’ll ﬁnd bad page breaks, over-long lines with little black rectan-
gles, incorrect hyphenations, and all the other ugly things that you
wouldn’t expect to see in a ﬁnished book. We can’t be held liable if you
use this book to try to create a spiffy application and you somehow
end up with a strangely shaped farm implement instead. Despite all
this, we think you’ll enjoy it!
Throughout this process you’ll be able to download updated PDFs
from your account on http://pragprog.com. When the book is ﬁnally
ready, you’ll get the ﬁnal version (and subsequent updates) from the
same address. In the meantime, we’d appreciate you sending us your
feedback on this book at http://books.pragprog.com/titles/ktuk/errata, or
by using the links at the bottom of each page.
Thank you for being part of the Pragmatic community!
Andy Hunt
Prepared exclusively for J.S. Ash

Bug #1 in Ubuntu’s bug database:
https://launchpad.net/ubuntu/+bug/1
“Microsoft has a majority market share in the new desktop
PC marketplace.
This is a bug, which Ubuntu is designed to ﬁx.”
Mark Shuttleworth, Ubuntu founder
Chapter 1
Introduction
This book was born out of an experiment carried out when Ubuntu
6.06 was released in 2006. Back then Ubuntu was rougher around the
edges than it is today. Getting MP3 ﬁles to play took some effort. Only
a handful of wiﬁ cards worked out of the box and the rest had to be
wrangled into working.
So I wrote 25 tips to get Ubuntu working the way I felt it should. I also
looked at some cool things that could be done with Ubuntu—the kind
of things that wowed people passing by your computer. Everything was
kept simple because I knew a high proportion of Ubuntu users had
switched from Windows, where things were done differently. Many of
the tips were pulled from my award-winning book, Beginning Ubuntu
Linux.
I put the tips on my website and then posted a link to the page on the
Digg.com social networking website. Within hours it was in the top 10
links for that day. My site was actually knocked ofﬂine by the sheer
volume of visitors.
The popularity of the tips was partly because Ubuntu has always been
popular with the Digg.com crowd, but there was a more important rea-
son. People wanted Ubuntu to "just work". They brought with them the
expectations of Windows users. They didn’t want to make any compro-
mises, either in terms of usability or function. And they wanted to learn
how Ubuntu worked. They wanted that above all, in fact.
Ubuntu Kung Fu is for those people, and others like them. It’s an Ubuntu
book for the rest of us.
In its pages you’ll ﬁnd over 300 tips that:
Prepared exclusively for J.S. Ash

H OW TO READ THIS BOOK 16
1. Make Ubuntu more usable for newcomers and experienced users
alike;
2. Point out cool and often extraordinary things that Ubuntu can do;
3. Show how Ubuntu can be fun.
Along the way you’ll pick up many skills that will make you a more
proﬁcient Ubuntu user.
If you’d like to share some of the tips from this book on your blog
then feel free. I’m not sure my publishers will be too happy if you take
liberties, but sharing a handful of tips you’ve found useful with others
can only be a good thing. If you do, it would be great if you could link to
http://www.ubuntukungfu.org, the community site that partners this book
(if you’re feeling generous, you might also link to the book’s ofﬁcial
webpage—http://pragprog.com/titles/ktuk).
1.1 How to read this book
In a nutshell, Ubuntu Kung Fu is a big book of tips. As such I don’t
recommend any particular way of reading it. You don’t need to be sitting
beside your computer to do so. The whole point of Ubuntu Kung Fu is
that you can jump in anywhere. Start at the beginning or start in the
middle. You could even start at the end and work your way to the front.
Just start reading. If you ﬁnd a tip you like then try it!
Ubuntu Kung Fu expects no prior Linux or Ubuntu experience from its
readers. That doesn’t mean all the tips are beginner-level. Some are
more involved than others and a handful are written for experienced
users. But in every tip I walk the reader through each step of the way.
I’ve also provided a crash-course in Ubuntu administration skills in
the second chapter of the book. This should get even the greenest of
newbies up to speed quickly.
Before you dive into the tips I need to mention some caveats. Some
of the tips affect your system in a profound way. Conﬁguration ﬁles
are edited, for example, and one wrong keystroke could mean disaster
(although it’s nearly always possible to ﬁx things—this is discussed in
Chapter 2, An Ubuntu administration crash course, on page 19). Be sure
to read through a tip before attempting anything it says. Check what
you type or click against what’s written.
Report erratum
Prepared exclusively for J.S. Ash
this copy is (B2.0 printing, July 15, 2008)

A CKNOWLEDGEMENTS 17
If you’re unsure about what you’re doing then skip that particular tip and
perhaps come back to it later.
If you spot anything that doesn’t seem to work, and you think it should,
contact http://pragprog.com/titles/ktuk/errata. Provide as many details as
possible. If possible, as well as correcting the tip in question, I’ll thank
you in a future edition of Ubuntu Kung Fu. Additionally, head over to
the forums at www.ubuntukungfu.org and see if a member of the Ubuntu
Kung Fu community can help you ﬁgure out what went wrong.
Secondly, please note that this book was written using Ubuntu 8.04.1
LTS (Hardy Heron) as a base. As with all releases of Ubuntu, this brings
a handful of small but important changes in the way system conﬁgu-
ration is handled. If you haven’t already, I strongly advise you upgrade
to 8.04.1 if you’re using an earlier version of Ubuntu. If you’re using a
later version of Ubuntu then you might have to occasionally apply some
common-sense.
Lastly, please note that the tips concentrate on productivity, enhance-
ments and doing cool stuff. I’ve deliberately steered-clear of provid-
ing work-arounds for bugs or gotchas. This is because the tips would
become dated very quickly as the bugs are ﬁxed or patched, or ofﬁ-
cial work-arounds are introduced. If you run up against something in
Ubuntu that doesn’t work the way it should, you ﬁrst port of call should
be the ofﬁcial Ubuntu forums—www.ubuntuforums.org—where it’s very
likely somebody will have posted a solution.
1.2 Acknowledgements
Thanks go to Pragmatic Programmers for not slamming the door in the
face of a crazy guy who suggested a one-chapter book full of things he
thinks are cool. Thanks go to Jackie Carter, my editor, plus Pragmatic
Programmer overlords Andy and Dave for their patience, guidance and
encouragement. I’ve never met such switched-on, optimistic and gen-
uinely agile people in over a decade of working in publishing. To para-
phrase Simon & Garfunkel, they’ve got a groovy thing going on.
Thanks also to the small army of technical reviewers who put this
book through its paces prior to release and often suggested impor-
tant improvements. My gratitude goes to John Dong, Matthew Helmke,
Eric Hewitt, Carthik Sharma, John Southern, and Aaron Porter. There’s
some astonishingly large brains in that list. A zombie would have a
Report erratum
Prepared exclusively for J.S. Ash
this copy is (B2.0 printing, July 15, 2008)

A CKNOWLEDGEMENTS 18
feast. I’m honored that they all agreed to give this book the beneﬁt of
their experience and knowledge.
Finally, thanks to the beta testers who took a chance on this book
before it was ofﬁcially published. Your errata comments made Ubuntu
Kung Fu a stronger book.
—Keir Thomas, September 2008
Report erratum
Prepared exclusively for J.S. Ash
this copy is (B2.0 printing, July 15, 2008)

Chapter 2
An Ubuntu administration crash
course
There’s a time when all of us sit down in front of Ubuntu for the ﬁrst
time. The African drum beats of the login sound fade away and we’re
greeted by the orange and browns of the desktop wallpaper. (Orange
and brown? What were they thinking?)
What goes through your mind following this probably depends on how
busy you are. To quote from Peter Pan, Ubuntu can be an “awfully big
adventure.” But for that to be true you have to be the kind of person
who enjoys adventures. I suspect most people simply want to know
what’s what, and how things work.
That’s what this chapter is about. It’s a crash course in basic Ubuntu
skills and knowledge. It’s the mechanic’s guide that tells you which
end of a screwdriver is the useful one, and how to use it. It’s necessary
because you’ll have to get your hands dirty under the hood of Ubuntu,
not only to follow the tips in this book, but as part of day-to-day life
with the operating system.
There are certainly more comprehensive introductory guides to Ubuntu
(I recommend Beginning Ubuntu Linux, Third Edition, written by myself
and Jaime Sicam). However, if you have little time to spare, or just a
brief attention span, this chapter will give you enough know-how to get
by. You might have to read it more than once, and maybe come back to
it later. That’s ﬁne. It isn’t going anywhere.
Even if you’re an experienced Ubuntu user it might be worth skimming
through this chapter to ensure you know enough to proceed to the
Prepared exclusively for J.S. Ash

T HE U BUNTU DESKTOP 20
tips ahead. I’d ask that you pay particular attention to the section that
describes how to use gconf-editor, which is used extensively in some of
the tips. This is a lesser-known but very useful conﬁguration tool.
So let’s get to it.
2.1 The Ubuntu desktop
Before we get down to speciﬁcs, let’s take an overview of the Ubuntu
desktop. If you’ve already spent time playing around with the desktop
then you can probably skip this part.
You ﬁrst thing you might notice is that it’s virtually icon-free. This is
just because the Ubuntu developers don’t like clutter. You can drag and
drop icons onto the desktop and get it as messy as you wish.
At the top and bottom of the screen are the panels. These are almost
identical to Windows’ taskbar, except that there are two of them. The
one at the top tends to be about running software and presenting infor-
mation to the user. The one at the bottom is where programs minimize
to, and contains a Show Desktop button (left) and Trash icon (right),
along with a virtual desktop switcher (far right).
On the top panel there are three menus—Applications, Places, and Sys-
tem. These will always stick around, no matter what. An application’s
own menus (File, Edit, View etc.) will appear underneath.
The Applications menu contains the software you use on a day-to-
day basis—media players, ofﬁce applications, calculator, and so on.
However, software used to administrate the software isn’t found there.
That’s on the System menu, which has two sub-menus—Preferences,
and Administration. Preferences lists programs that tweak settings spe-
ciﬁc to your user account, such as changing the desktop wallpaper.
Administration lists programs that conﬁgure the overall system.
Programs on the System → Administration menu won’t run unless you
type your login password when prompted. I explain more about this on
page 22.
The Places menu provides quick access to the ﬁle system, or to any
other ﬁle system that is attached to your computer, such as your Win-
dows partition, or USB memory sticks that are plugged in. See Fig-
ure 2.1, on the following page for an example. The Windows partition
will probably be identiﬁed as x GB Media, where x is the size of the
Report erratum
Prepared exclusively for J.S. Ash
this copy is (B2.0 printing, July 15, 2008)