Вы находитесь на странице: 1из 164

NEW

Ubuntu
5IF

5IFVMUJNBUFIBOECPPL
GPSBMM6CVOUVVTFST

r-FBSOUPVTF6CVOUV
r4FDVSFZPVSTZTUFN
r(FUUPLOPXUIFUFSNJOBM
r%JTDPWFSUIF4PGUXBSF$FOUSF

#PPL

Welcome to

The

Ubuntu
Book
Many people who want to make the move from their Windows systems to a Linux
distribution choose Ubuntu as their first step. The reasons for this are clear, as it provides
a clean, attractive GUI with Unity, and usability by the bucket-load. It is the perfect
environment in which to begin learning about the command line and creating a more
customisable workspace, while still benefitting from the positives that you were used
to in Windows and other desktop systems. In this book, our aim is to guide you from
where you are now whether thats about to download Ubuntu, or looking for ways
to supercharge your experience to becoming a confident Ubuntu power user. Youll
discover the best features of Ubuntus default software, and the best FOSS apps for you
to download from the Software Centre. Well even suggest some re-spins of Ubuntu to
try, should you want to go beyond the basic Unity interface.

The

Ubuntu
Book
Imagine Publishing Ltd
Richmond House
33 Richmond Hill
Bournemouth
Dorset BH2 6EZ
 +44 (0) 1202 586200
Website: www.imagine-publishing.co.uk
Twitter: @Books_Imagine
Facebook: www.facebook.com/ImagineBookazines

Publishing Director
Aaron Asadi
Head of Design
Ross Andrews
Production Editor
Alex Hoskins
Senior Art Editor
Greg Whitaker
Designer
Perry Wardell-Wicks
Printed by
William Gibbons, 26 Planetary Road, Willenhall, West Midlands, WV13 3XT
Distributed in the UK, Eire & the Rest of the World by
Marketforce, 5 Churchill Place, Canary Wharf, London, E14 5HU
Tel 0203 787 9060 www.marketforce.co.uk
Distributed in Australia by
Gordon & Gotch Australia Pty Ltd, 26 Rodborough Road, Frenchs Forest, NSW, 2086 Australia
Tel: +61 2 9972 8800 Web: www.gordongotch.com.au
Disclaimer
The publisher cannot accept responsibility for any unsolicited material lost or damaged in the
post. All text and layout is the copyright of Imagine Publishing Ltd. Nothing in this bookazine may
be reproduced in whole or part without the written permission of the publisher. All copyrights are
recognised and used specifically for the purpose of criticism and review. Although the bookazine has
endeavoured to ensure all information is correct at time of print, prices and availability may change.
This bookazine is fully independent and not affiliated in any way with the companies mentioned herein.
The Ubuntu Book First Edition 2016 Imagine Publishing Ltd
ISBN 978 1785 462 849

Part of the

bookazine series

The

Ubuntu
Book

Contents
08 Get
started
with
Ubuntu
Get to know this
popular Linux distro

Ubuntu essentials
24 Navigate Ubuntus desktop
Find your way around

26 Dual boot with Ubuntu


Run Ubuntu alongside Windows

28 Customising the desktop


Change settings to your preferences

30 Discover System Settings


Personalise your system details

32 Tweak Security Settings


Ensure you are protected

34 Find your way around Dash


This handy search bar is your gateway

36 Understand the ile system


Learn about ile system organisation

38 Accessibility in Ubuntu
Make Ubuntu easier to use

40 Sharing iles in Ubuntu


Transfer your documents with ease

42 Manage drives with Disks


Use hard drives and removable media

44 Commanding Ubuntu
Get to grips with the command line
6 The Ubuntu Book

48 GNOME Terminal & XTerm


Explore the basics and beneits

50 Secure iles with Dj Dup


Create a copy of your valuable data

52 Use Startup Disk Creator

16 Whats
your
Ubuntu
l
avour?
Discover diferent
desktop environments

62 Connect with
Online Accounts
Enjoy convenient integration

63 Use System Monitor


View and manage your resources

Make a bootable USB

54 Check the Time & Date


View the calendar and make changes

55 Unleash Archive Manager


Understand this handy accessory

56 Using Disk Usage Analyzer


Find out where your disk space went

57 Manage Startup
Applications
Automatically start your apps

58 Monitor Software
& Updates
Keep your system up to date

59 Work with Universal Access


Make Ubuntu more friendly

60 Conigure Network
connections
Set up a new connection

61 Tweak the Power settings


Make your laptop run longer

Ubuntu apps
66 Explore the Ubuntu
Software Centre
Your one-stop shop for new apps

70 Browse with Firefox


Explore the Internet

72 Manage emails
with Thunderbird
All your email accounts covered

74 Communicate with Empathy


Set up and use this instant messenger

76 Explore LibreOffice Writer


Discover the features of the FOSS
word processor

78 Unlock LibreOffice Calc tricks


Use the spreadsheets like a pro

80 Edit formulas in Math


Learn about this LibreOice extra

82 Present with Impress


Get to know the FOSS presenting tool

84 20 LibreOffice tips & tricks


Make your working day even
more productive

88 Text editing with Gedit


Understand its features and uses

90 Create discs with Brasero


Create CDs and DVDs fast

Create
with Ubuntu

104 Touch up photos


with GIMP
Enhance your photos like a
professional

108 Discover PulseAudio


We reveal its mind-blowing features

Supercharge
Ubuntu

Create cool vector graphics

96 View images with Shotwell


Make viewing images seamless

98 Manage images
with Shotwell
Keep tabs on large numbers of image iles

Upload and download data

132 Visualise data with Chart.js


Draw gorgeous graphs of all kinds

136 Command-line efficiency


Take the terminal further

142 Develop with Python


Learn about this popular coding language

Beyond Ubuntu

114 Best free software


Enhance your Ubuntu experience

124 Partition with GParted


Use the GUI to handle partitioning

94 Work with LibreOffice draw

130 BitTorrent with Transmission

126 Remote control


workstations with
Remmina
Manage a remote server from your
desk with Remmina

128 Switch languages


with FCITX
Master this extra feature

150 Mint 17.3 Rosa Cinnamon


Is this variant better than Ubuntu?

152 Elementary Freya


Discover this Mac-like, consistent distro

154 Netrunner 17 Horizon


A plasma desktop with striking aesthetics

156 LXLE 14.04.3


A Lubuntu respin, great for old hardware

158 Deepin Linux 2014.3


An elegant HTML5 desktop

100 View movies with Videos


View videos with Ubuntus default app

102 Listen to songs


with RhythmBox
Use this background music app

The Ubuntu Book 7

Get started with Ubuntu

Get started
with Ubuntu
Because of its free, open source and user-friendly nature, Ubuntu has
gained a lot of momentum in recent times. No wonder so many software
developers are using it for their projects

buntu is a free, user-friendly Linux-based


operating system that has found its place in
every corner of the world. The best thing about
Ubuntu is that it is absolutely free, including its future
updates. Another thing that makes Ubuntu so popular
is that it is extremely light on PC hardware, so you can
install it on computers that are three to four years old,
yet it still runs very smoothly. Ubuntu is the most widely
used Linux operating system both for desktops and
in the cloud. Consider Ubuntu as a complete desktop
operating system that is freely available with both
community and professional support. It can be noted
here that Ubuntu is suitable for both desktop and

8 The Ubuntu Book

server use. These are just some of the features that


make Ubuntu the best operating system to go for in the
developer community
Ubuntu is everywhere Almost all computer
manufacturers are shipping models based on Ubuntu
this is one of the main reasons why you can use
Ubuntu everywhere.
Ubuntu is well supported There are few other Linux
distros that provide the same kind of long-term support
as Ubuntu. Considering the amount of money and effort
involved in developing software, it becomes even more
important to provide long-term support when it comes
to open source projects.

Ubuntu is easy to use Its easy to pick up and use, even


if you come from a Windows background. Users dont
need to do anything extra when booting Ubuntu for the
first time.
Ubuntu is pretty stable For most users, Ubuntu just
works. This is because the OS is being tweaked and
fixed all the time. Since all the latest packages are not
integrated during the development cycle, it also helps in
providing better stability.
Looking at the above features, its no surprise that
Ubuntu is so popular. We will go into more detail during
the rest of this feature, and will cover various aspects
that will be of great help to new Ubuntu users.

Get started with Ubuntu


Getting started with
the trial version

Dual boot

You can try out Ubuntu


without even installing it
The system requirements required vary among Ubuntu
products. For the Ubuntu desktop release 14.04, a PC
with at least 768MB of RAM and 5GB of disk space is
highly recommended. For less powerful computers, its
best to use one of the other Ubuntu distributions.
Ubuntu can be booted from a USB drive or CD and
used without even installing it. Lets take a look at the
the different ways of downloading and using the trial
version of Ubuntu

Live booting and virtual machines


One of the easiest ways to get started with Ubuntu is
by creating a live USB drive, CD or DVD. After placing
Ubuntu onto it, you can insert your USB stick or disc
into any computer and restart it. The computer should
then boot from the removable medium you provided
and youll be able to use Ubuntu without making any
changes to the computers hard drive.
You may be wondering how to create a live Ubuntu
USB drive or disc. For this, you can download the latest
Ubuntu disk image from Ubuntus website. Use the
Unetbootin tool to put Ubuntu on your USB flash drive or
burn the downloaded ISO image to a disc. All you need to
do now is to restart your computer from the removable
medium you provided and select the Try Ubuntu option.
Like any other operating system, Ubuntu can also
be run in a virtual machine on your computer. In this
way, youll be able to try Linux without even restarting
your computer, although you should note that virtual
machines are slower than running the operating
system on your computer itself. To create a Ubuntu
virtual machine, first you need to download and install
VirtualBox. Create a new virtual machine with it, select
the Ubuntu operating system, and provide the ISO
file you downloaded from Ubuntus website when
prompted. The installation process is self-explanatory
and you can go through it in the virtual machine as if you
were installing Ubuntu on a real computer.

Ubuntu can be booted from a


USBdrive or disc and used without
even installing it

If you want to use


Linux, but still want
Windows installed
on your computer,
the best option
for you is to install
Ubuntu in a dual-boot
configuration. Just
place the Ubuntu
installer on a USB
drive, CD or DVD. Once
you have done this,
restart your computer
and select the Install
Ubuntu option instead
of the Try Ubuntu
option. Go through
the install process
and select the option
to install Ubuntu
alongside Windows.
Youll be able to select
the operating system
you want to use
whenever you start
your computer. Head
to p.24 for more.

Above You can install


Ubuntu or just try it out
Left If successful, you
will be presented with the
standard Ubuntu desktop

Boot Ubuntu from a disc or USB stick


As mentioned earlier, as a newcomer to Ubuntu, you will
be able to try it without even installing it. This can be
done either an Ubuntu DVD in the drive or a USB stick with
Ubuntu on it in a USB port.
If using a DVD, put the Ubuntu DVD into the drive and
restart the computer. You will see a welcome screen
which prompts you to choose your language and gives an
option to install Ubuntu or try it from the DVD.

If you want to use a USB drive, note that the latest


computers can start up from a USB stick. Here also,

youll see a welcome screen that prompts you to choose


your language and gives an option to either install Ubuntu
or try it from the USB stick.
Irrespective of whether you are using the DVD or USB
stick method, the next step is to select your preferred
language and then click on Try Ubuntu. Your live desktop
will then appear (as shown in the picture above).

As a final step, when you are ready to install Ubuntu,


you just need to double-click on the icon on your
desktop: Install Ubuntu 14.04 LTS.

The Ubuntu Book 9

Get started with Ubuntu

Adopting the
full version of
Ubuntu
New versions are released
every six months and are
supported for 18 months
As noted previously, Ubuntu is a very popular Linux
distribution with many years of maturity under its belt
and a huge user base. After becoming comfortable
with the initial few aspects of Ubuntu, now it is time
for you to take a deeper look at Ubuntus full version.
Before you start with Ubuntu, you need to obtain a copy
of the Ubuntu installation image. In addition, you will
have to ensure that your system meets the minimum
requirements. The most common method of obtaining
Ubuntu is to download the Ubuntu DVD image directly
from the official site: ubuntu.com/download. For
downloading and installing it, you just need to select
whether you require the 32-bit or 64-bit version and then
click Start download.
It is important to understand here the two versions
that Ubuntu is available in: 32-bit and 64-bit. They differ
from each other in the way the computer processes
information. So if your computer has a 64-bit processor,
you will need to install the 64-bit version; if you have
an older computer or you do not know the type of the
processor in your computer, it is advisable to install
the 32-bit version.
Although 5GB of free space on your hard drive is
required for installing Ubuntu, the recommendation is
to have 15GB or more. This will mean youll have enough
space to install extra applications, as well as to store
your own documents, music etc.
You can note here that if you have an Internet
connection, then the installer will ask you if you want
to Download updates while installing. It is highly
recommended to perform this step.

If you have an older computer or you do not


know the type of the processor it uses, it is
advisable to install the 32-bit version

Options for
installation
You can install Ubuntu
alongside another OS or
replace it
The Ubuntu installer will automatically detect any
existing operating system installed on your machine,
and present installation options suitable for your
system. Please note that the options listed below
entirely depend on your specific system and may not
all be available:
Install alongside other operating systems
Upgrade Ubuntu to 14.04
Erase and install Ubuntu
Something else
Out of the above four options, the most preferred
is Upgrade Ubuntu to 14.04. This is because
this option will allow you to keep all your precious
documents, music, pictures and any other personal
files on the computer. Installed software will be

10 The Ubuntu Book

retained when possible and system-wide settings will


be cleared.
The Erase disk and install Ubuntu option can be
used if you want to erase your entire disk. As expected,
this will delete any existing operating system that is
installed on that disk and install Ubuntu in its place.
When you choose the Something else option, you
will be able to configure the partitions as you need
before installing Ubuntu.
It can be noted here that in order to reduce the
time required for installation, Ubuntu will continue
the installation process in the background while the
user configures some important user details like
username, password, keyboard settings, the default
time zone and so on.

Internet connection
It is important to have an Internet connection during
the Ubuntu installation process. If you are not
connected to the Internet, the installer will ask you to
choose a wireless network, if available. You can follow
these steps in such a scenario
1. Select Connect to this network and then you need
to choose your network from the list.
2. In the Password field, enter your routers WEP or
WPA key.
3. Then click Connect to continue.

Get started with Ubuntu


User account details and beyond
Ubuntu needs to know some information about you so that
it can set up the primary user account on your computer.
As expected, when congured, your name will appear on
the login screen as well as the user menu.
On this screen you will need to provide the following
information to Ubuntu
Your name
What you want to call your computer
Your desired username
Your desired password
After the installation has nished and your computer
is restarted, you will be greeted with the login screen
of Ubuntu. The login screen will present you with your
username and you will need to enter the password that
you provided previously to get past it. Click to enter your
username and password; you may then press Enter to
access the Ubuntu desktop.
Once we have our Ubuntu desktop ready, we may be
interested in viewing the hidden les. This can be easily
done by clicking View Options>Show Hidden Files.
After successfully installing Ubuntu, you may want to
encrypt your home folder. It takes very little time and is

pretty straightforward, and is considered as an important


step before you proceed further.
You may notice that Ubuntu is a little different compared
to some other operating systems. The most important
thing to understand is the Ubuntu packaging system.
Typically it includes:
/usr
/var
/bin
/sbin
/lib
The other thing to note here is cron job management.
The jobs that are the under the purview of the system
administrator can be found in the /etc directory. Therefore,
if you have a root cron job for daily, weekly or monthly runs,
make sure to place them under
/etc/cron.{daily,weekly,monthly}.
These jobs can be invoked from /etc/crontab.
There is a tool called Ubuntu After Install available, which
can be used to install some of the best and essential
software after installing the Ubuntu desktop. It has a

bunch of useful applications, and will automate the


installation process on a newly installed machine to obtain
a near perfect desktop. This tool saves a lot of your time
and effort, and installs all latest versions of software on
your Ubuntu system.

The menu bar


incorporates the most
common functions
used in Ubuntu. Each
installation of Ubuntu
may contain slightly
different types and
quantities of icons

Left You can choose to


employ the terminal

Navigate Ubuntu
Decode the menu bar, Launcher, Dash, home directory and more
After taking a look at the initial aspects of Ubuntu,
now its time to delve deeper into the operating
system. To start with, you may notice many similarities
between Ubuntu and other operating systems
mainly because of the fact that they are all based on
the concept of a GUI (graphical user interface). It is
definitely a good idea to understand the applications
and menus in Ubuntu so that we will be comfortable
with using its GUI. Any GUI-based operating system
makes use of a desktop environment. The main

features provided by a desktop environment are related


to the look and feel of the system and how easily a user
can navigate the desktop.
Let us take a quick look at the menu bar in Ubuntu.
The menu bar incorporates the most common functions
used in Ubuntu. Each installation of Ubuntu may contain
slightly different types and quantities of icons based
on a number of factors, including the type of hardware.
Some programs add an icon to the indicator area
automatically during installation.

The Ubuntu Book 11

Get started with Ubuntu

You should note that every application features its


own menu system wherein different actions can be
executed within it (such as File, Edit, View and so on).
Appropriately, the menu system for an application is
known as the application menu.
Another thing that we need to understand in
Ubuntu is the Launcher: the vertical bar of icons
available on the left side of the desktop. With the help
of this Launcher, one can easily access the various
applications, mounted devices and trash. Note that any
application that is running will have its icon placed in the
Launcher bar.

In Ubuntu, we commonly come across something


called Dash. If you have used Windows in the past,
you can consider Dash as something similar to the
Windows Start menu. The Dash will help you to find the
applications and files on your machine.

Above To run any application from the Launcher, you just need
to click on the applications icon

To explore the Dash, you need to click on the topmost


icon on the Launcher. Now you will be able to see a
window with a search bar on the top as well as the
recently accessed applications, files and downloads.

You can consider Dash


as something similar
to the Windows Start
menu: it helps you to
find applications and
files on your machine
As mentioned above, Dash is a very powerful tool that
can be used to search for files and applications on your
computer. In order to find files or folders, you simply
need to type a portion of the file or folder name: as you
type, the results will appear in the Dash.
As expected, a standard Ubuntu installation comes
with many applications. And users can additionally
download thousands of applications from the Ubuntu
Software Centre. The Applications lens on the Dash will
automatically categorise installed applications under
Recently Used, Installed or More Suggestions.
You can also enter the name of an application (or a
part of it) into the search bar in the Dash, and the names
of applications matching your search criteria will appear.
Even if you dont remember the name of the application
at all, type a keyword that is relevant to that application
and the Dash will be able to find it. Another thing that we
need to understand here is that in addition to searching
your local machine for files and applications, Dash can
help in searching various online resources.
Now lets take a look at how to browse the files on
your machine. In addition to using Dash to search for
files, one can also access them directly from their

12 The Ubuntu Book

Get started with Ubuntu

directory. The home directory is used to store all of your


personal files (instead of system-related files).
Sometimes, you may need to make use of the
Files file manager window. Whenever you select the
Files shortcut in the Launcher, Ubuntu will open this
file manager.

Once you are done with working on your machine, you


can select the option to log out, suspend, restart or shut
down through the Session Indicator.
Alhough Ubuntu provides a nice GUI, to fully utilise the
power of the OS youll need to understand the terminal.
Any operating system has two types of user interface:
GUI: This is the desktop, windows, menus and toolbars
that you click to get things done.
Command-line interface (CLI): The terminal is Ubuntus
CLI. It can be considered as a method of controlling
some aspects of Ubuntu using only commands that you
type on the keyboard.
Even though users are able to perform most dayto-day activities without ever opening a terminal, it is
considered as a very powerful tool and is therefore well
worth investigating. With it, you will be able to perform
many useful tasks.

As you can see from the above screenshot, this window


comes with the following features:
menu bar: It is located at the top of the screen. With this
menu bar, one will be able to browse and
remove bookmarks, open a new window,
connect to a server, quit etc.
title bar: This indicates the name of the currently
selected directory.
toolbar: This displays your location in the file system, a
search button etc.
Sometimes, you may need to customise your Ubuntu
desktop. Most customisation can be achieved via the
Session Indicator and then selecting System Settings to
open the System Settings application window.

Troubleshooting tasks: If you face any difficulties while


using Ubuntu, then you may need to use the terminal.
If you need to perform operations on multiple files at the
same time, then the terminal is the preferred method.
System administration and software development
skills can be significantly improved by having a good
understanding of the CLI.
A terminal can be opening either by hitting Alt+Ctrl+T
simultaneously or by right-clicking the desktop and then
selecting Terminal from the menu.
Please note that all the commands in the terminal
follow the same approach: you can type the command,
possibly followed by some parameters, and then press
Enter to perform the specified action. In most cases,
some type of output will be displayed to confirm the
action was completed successfully, although this can
depend on the command being executed.
Ubuntu offers various text editors which are installed
by default. The most commonly used command-line
editor is vim. The table below gives quick information
about some of the important files in Ubuntu.

Securing Ubuntu
Ubuntu is considered as secure primarily due to the
following reasons
Many viruses designed to primarily target Windowsbased systems do not affect Ubuntu system.
Security patches for open source software like
Ubuntu are often released quickly.
Open source software like Ubuntu allows security
aws to be easily detected.
The basic security concepts such as le permissions,
passwords and user accounts are also available with
Ubuntu. Understanding these concepts will help you
in securing your computer.

Another concept that users need to know about


is mounting and unmounting removable devices.
Mounting a device means associating a directory name
with the device, and this in turn allows you to navigate
to the directory to access the devices files. When youve
finished using a device, you can safely unmount it.
Unmounting a device disassociates the device from its
directory, allowing you to eject it.

Mounting a device means associating a directory


name with the device, and this in turn allows you
to navigate to the directory to access the devices
files directly

Ubuntu file system structure


Ubuntu uses the Linux le system and it is based
on a series of folders in the root directory. These
folders contain important system les that cannot be
modied unless you are running as the root user or use
the sudo command. With this restriction, computer
viruses will not be able to change the core system
les, and normal users will not be able to accidently
change anything that is critical.

File
/etc/issue
/etc/apt/sources.list
lsb_release -a
/usr/share/tomcat

A quick description
Gives info about Ubuntu version that you
are currently running
Contains the available sources for
software installation
Prints out the Ubuntu version you
are running
Installation directory for Tomcat
The Ubuntu Book 13

Get started with Ubuntu

What next?
Troubleshooting and software
management in Ubuntu
Sometimes when you are using Ubuntu, things
may not work out as expected. The good thing is
that the problems encountered while working with
Ubuntu can be easily fixed. The best practice for any
troubleshooting with Ubuntu is to complete all the steps
and document the changes you have made, so that you
will be able to track and undo changes (if necessary),
and also to pass the details about your work to other
users in the community. Let us take a quick look at some
of the most common problems that users may face
with Ubuntu.

Its all too easy to accidentally delete a file weve all


done it. If this happens, the good news is that you should
still be able to recover the file from Ubuntus Trash folder.
The Trash can be considered as a special folder where
Ubuntu stores deleted files before they are permanently
removed from your computer. Follow these steps in
order to recover a file

Open Trash folder


If you need to restore an item, select it in the Trash. Click
Restore selected items and this will move the selected
deleted items back to their original locations.

Forgot your password?


In Ubuntu, if you forget your password, you can reset it
by using Recovery mode. To start the Recovery mode,
you need to shut down your computer and then start
again. As the computer starts up, press the Shift key and
then select the Recovery mode option using the arrow
keys on your keyboard. Once booted, instead of a normal
login screen, you will see a Recovery Menu. Select root
using the arrow keys and press Enter. You will now be at
a terminal prompt:

root@ubuntu:~#
In order to reset your password, you can enter:

# passwd username
replacing username with your own username. After
this, Ubuntu will prompt you for a new password. Type
it, press the Enter key, then retype your password and
press Enter again when you are done.

Problems encountered
while working with
Ubuntu are easily fixed

14 The Ubuntu Book

How to clean Ubuntu?


Unused packages and temporary files will be
accumulated in Ubuntus software packaging system
and over a time, this can grow quite large. Cleaning
up allows a user to reclaim space on their computer.
We have two options clean and autoclean for this
purpose. In order to obtain the clean utility (activated
using the clean command), open a terminal and enter:

$ sudo apt-get clean


One can also use the autoremove option here to remove
unused packages:

$ sudo apt-get autoremove

Issues with the hardware


In some scenarios, Ubuntu may have difficulties running
on certain computers. The good thing is that the Ubuntu
community has plenty of documentation that may help
you to overcome many such problems. The complete
hardware troubleshooting guide is available on Ubuntus
support wiki at wiki.ubuntu.com/HardwareSupport.
Lets take a closer look at how software management
can be achieved in Ubuntu. Ubuntu uses a set of
software utlities called a package management
system or package manager. Consider a package
manager as a collection of tools that will make the
life of a user much easier when it comes to installing,
upgrading, deleting and configuring software. A package
management system has a database of all software,
called the repository, and this repository provides a lot of
information about the software including the version,
the vendors name and the dependencies that are there
for the software to properly get installed. By default,
Ubuntu provides two different ways by which one can
browse the repositories for searching, installing and
removing software.
1. Ubuntu Software Centre
2. Command-line apt-get
With the help of the Ubuntu Software Centre, one can
search, install and remove applications easily and
conveniently. It is considered as the most common
application management system used by both novice
and expert Ubuntu users. Since in Ubuntu, software is
delivered in the form of packages, it becomes a oneclick process when we install the software by using the
Ubuntu Software Centre. You can consider the Software
Centre as a kind of app store that gives you instant
access to thousands of applications.

Get started with Ubuntu

Trusting third-party software


As discussed, by default we will add applications
via the Ubuntu Software Centre that downloads the
required software from the Ubuntu repository. But in
some cases, we may need to add software from other
repositories. Using only recognised sources, such as a
projects site or various community repositories is more
secure than downloading applications from an arbitrary
source. When using a third-party source, you will need
to consider its trustworthiness, and be 100 per cent
sure about what youre installing on your computer.

Get involved with Ubuntu


The Ubuntu community provides users with a lot of
opportunities to get involved. Doing so will also help
you to enhance your skills. Some of the ways for you to
contribute are:
Providing technical support to end users
Fixing bugs in the existing software
Contributing to community documentation
Writing new software

As can be seen from the screenshot on the previous


page, the Ubuntu Software Centre window has four
sections a list of categories on the left, a banner on
the top, a Whats new panel, and a Recommended For
You panel. Note that clicking on a category will take you
to a list of related applications. If you are looking for a
specific application, you may already know its specific
name or you may just have a general category in mind.
To help you find the right application, you can browse the
Software Centre catalogue by clicking on the category
reflecting the type of software you seek.
Another handy feature of Software Centre is that
it keeps track of past software management in the
History section. This is very useful if you wish to
reinstall an application previously removed and do
not remember the applications name. The Software
Centre also helps in recommending the software based
on the software already installed on your system.
Although the Software Centre provides a large library of
applications from which to choose, only those packages
available within the official Ubuntu repositories are
listed. Sometimes, you may be interested in a specific
application that is not available in these repositories. In
this scenario, we may have to use alternative methods
for accessing and installing software in Ubuntu, such
as downloading an installation file manually from the
internet or adding extra repositories.

7. Manage payment information and transaction


history with a single Ubuntu account
In addition, Ubuntu allows the user to decide how
they want to manage their package updates. This can
be achieved through the Updates tab in the Software
and Updates window.
With this, you will be able to specify what kinds of
updates you are interested in installing on your machine.
The available options are:
1. Important security updates (trusty-security)
2. Recommended updates (trusty-updates)
3. Pre-released updates (trusty-proposed)
4. Unsupported updates (trusty-backports)

The middle section of this specific window allows you


to customise the updates. You can customise the
frequency for the updates; it also provides options for
installing the updates.
You should now be comfortable using Ubuntu.
As a next step, you can enhance your knowledge by
understanding various other Linux distributions (such as
Kubuntu, Lubuntu and Xubuntu). Another thing you may
want to take a closer look at is Ubuntu Server Edition.
We can consider Ubuntu Server Edition as an operating
system that has been optimised to perform multi-user
tasks. Some of these tasks may include file sharing,
website hosting etc. More official documentation about
Ubuntu is available at help.ubuntu.com and we advise
you to peruse it at your leisure.

In summary, with Ubuntu Software Centre, one will be


able to perform the following activities:
1. Search for, download, install and remove software in
a single window
2. Keep track of your software installation, update and
removal history
3. Test-drive software without installation or purchase
4. Read and write user reviews
5. Receive software recommendations based on your
search and installation history
6. Filter software searches by providers, like Ubuntu,
Canonical Partners, and For Purchase

The Ubuntu Book 15

Ubuntu flavours

Whats your
Ubuntu flavour?
Canonical recognises Ubuntu flavours - custom Ubuntu versions shipped
with different desktop environments, or designed for specific usage
Ubuntu is a Linux distribution that ships with the Unity
desktop. However, there are other desktops, such as
KDE, GNOME, MATE, XFCE and others with their own
established communities. Technically, changing a
desktop is about installing another set of packages, that
are all part of standard Ubuntu online repositories. This
way you can install all of them and choose what desktop
you want to use at the login greeter. Ubuntu works fine
with multiple desktops, but could always use a polish
in terms of its user experience due to minor details, like
icons from one desktop appearing in a system tray of
another, or a mixed set of default applications.
A custom Ubuntu remix with a desktop other
than Unit, or with specific usage focus is called the
Ubuntu Flavour. Everyone can build his or her own
clone of Ubuntu with custom settings, tweaks,
added extra applications and so on, but here we
are going to review so-called official Ubuntu
flavours. The difference between a custommade Ubuntu delivery with an official flavour
is that the latter has been recognised by the
Tech Board of main Ubuntu team and thus
is officially supported by Canonical. The
official support means that Canonical
provides its Launchpad infrastructure for
building and testing a flavours images,
Ubuntu team members monitor bugs
in the public bug tracker of a flavour,
and also a community manager from
a flavours party aligns his or her plans
with the official Ubuntu release schedule.
Recognised Ubuntu flavours are often
released a few days after the main Ubuntu
release announcements and share Ubuntu
fixes and improvements once they are not
desktop-specific. There are no significant
differences between Ubuntu and its
flavours in terms of hardware and software
compatibility, and almost any application
for Linux works with any of Ubuntu
flavours once it is reported to work with
the flagship Ubuntu distribution.

16 The Ubuntu Book

Ubuntu flavours

Kubuntu
An Ubuntu flavour with the KDE
Plasma desktop, Kubuntu is reported
to offer the best KDE experience, and
even has the letter k in its name!
Kubuntu has been the second most popular version of Ubuntu ever since it
emerged in 2005, when KDE developers talked loud about the undisputed
superiority of their beloved desktop environment and often added the k
letter to an application name to make it clear to users that it was a KDEcentric one. Modern Kubuntu features the Plasma5 desktop, the version that
superseded the previous version called KDE Software Compilation 4.x. Kubuntu
is about KDE, and KDE is about customising the UI. The KDE offers the same
desktop paradigm as the older Windows versions (without the controversial
Metro interface), with a taskbar along the bottom and the K menu on the left for
starting programmes. In KDE you can change hundreds of settings, customise the
toolbar, add plasmoids (desktop widgets), redefine any aspect of the look and feel and
have your desktop behave the way you want it to. To accommodate this, KDE does eat
up more system resources and sometimes can slow your system down (especially on
low-end machines). The KDE Plasma desktop is often considered as a heavyweight
shell due to various processes that run in the background (like the file indexer for
instant searches) and sophisticated desktop effects. Besides the fact that you can
configure KDE to run faster by disabling extra features, the desktop is improving
over time. Kubuntu with Plasma 5 runs very smooth and fluid, it has a much better
compositing engine that removes flickering when you watch videos, and doesnt load
your system with heavy background tasks if it detects that you are running productivity
applications. Default applications choice does not differ much between Ubuntu and
Kubuntu, except for the fact that Thunderbird mail was replaced with KMail.

The KDE Plasma desktop is a


heavyweight shell due to processes
that run in the background

Above Windows Aero and OS X


Aqua are gone, but KDE Plasma is
here to stay!

The Ubuntu Book 17

Lubuntu
A lightweight Ubuntu-based Linux distribution
with the LXDE desktop that provides faster
performance and better energy saving
The world of Linux is so big, that there has been no lack of lightweight Linux
distributions. Still Lubuntu managed to become the most popular lightweight distro
within the last few years. The secret is in the logical and balanced approach of the
great LXDE desktop complemented with a stable and widely recognised Ubuntu
basement. LXDE was started in 2006 as a set of lightweight GTK-based accessories
made to accompany PCManFM, a quick and robust file manager. Since then, LXDE
included but was not limited to home grown desktop modules with speaking names
(LXInput, LXLauncher, LXPanel...) as well as third-party components: Openbox
as a window manager, SDDM for login greeter, Leafpad for text editor and a few
others. Following a trend to roll out a desktop-specific application store in every
other Ubuntu flavour, Lubuntu team has integrated the Lubuntu Software Center
into its distribution. It lets users install or remove extra applications and looks like it
is a happy blend of Ubuntu Software Center (with its ratings and screenshots) and
Synaptic (with its detailed packages control).

From LXDE to LXQT


LXDE developers had been unhappy with GTK 3 development some time ago, and
decided to move interface controls from GTK to Qt. Qt is the industry-standard
graphical toolkit that delivers very comfortable cross-platform development.
Currently the future of LXDE with Qt happens under the new name LXQT. It is
under active development and while many people already use LXQT for testing and
reporting bugs, it is not ready for everyday use yet. The modern LXQT has absorbed
contribution from Razor-Qt another minimalistic desktop, with which LXQT was
merged in 2013. LXQt already looks sleek and still works very fast. Lubuntu offers a
way to test LXQT with just three commands:

sudo add-apt-repository -y ppa:lubuntu-dev/lubuntu-daily


sudo apt-get update
sudo apt-get install lxqt-metapackage lxqt-panel openbox

18 The Ubuntu Book

Edubuntu
Edubuntu offers a custom applications set for
educational purposes and is designed to be
used in schools and universities
Edubuntu ships with Unity the same shell you might have seen in the flagship
Ubuntu distribution. However, it is almost impossible to mix this flavour with its
parent due to massive customisation. Edubuntu has clearly been tailored for school
classes. First, Edubuntu sticks to the LTS Ubuntu releases for its basis, thats why
major Edubuntu versions see the light once in two years, with smaller updates
inbetween. For that reason, the newest version in the time of writing is 14.04.2 LTS,
not 15.10 as for many other Ubuntu flavours.
Second, Edubuntus installation image is quite large and needs a DVD or USB
stick for preparing an installation media. When you launch the installation wizard,
you will notice the Edubuntu-specific additions to it. You can add the GNOME
Fallback session here or install LTSP (Linux Terminal Server Project) to make
students machines boot via network from the tutors server machine. Edubuntu
installer also lets you select package templates for required target audience
(preschool) and course level (primary, secondary, tertiary).
When the system is up and running, you can guess that it is Edubuntu by the
modified Ubuntu logo with raised hand and by the custom (and rich) set of preinstalled applications. These include Blinken memory game, Calibre books
manager, Fritzing emulator for building electronic circuits, Chemtool for scheming
chemical formulas and much more. It includes educational software from KDE
project and standalone learning applications, with high-grade scientific solutions.

Ubuntu GNOME
Though Unity incorporates lots of GNOME
applications, some people want enjoy a pure
GNOME Shell experience. Ubuntu GNOME is
the best solution for that
Years ago there was no GNOME 3 (also known as GNOME Shell), and Ubuntu
featured the now-classic GNOME 2.x desktop. Since then GNOME 3 has evolved
into an original environment where mobile and desktop interface combine in grace.
The team at the main Ubuntu distribution is focused on polishing Unity desktop
features, while very few devs actually care that Ubuntu still ships with very outdated
GNOME accessories. Sooner or later, a GNOME 3 based flavour must have been
made. The first Ubuntu GNOME release took place during 2012 and was warmly
welcomed by GNOME fans, who preferred pure GNOME 3 desktop to Unity.
GNOME 3 has a trendy look, slightly larger UI controls (some of them are designed
to be triggered by finger on touchscreens) and the original desktop layout. The top
bar is fixed, with the Activities button on the left, while a clock with calendar and
notifications are at the centre, and applications indicators on the right. Similar to
Unity, there is a vertical launcher panel along the left edge of the screen, but GNOME
3 hides it by default (press the Super key to reveal it).
GNOME takes a different approach in offering settings to a user. There is the builtin System Settings, which is fine but quite basic once you want to customise system
look and feel. A more powerful settings altering tool is called GNOME-tweak-tool,
and it is available in Ubuntu GNOME standard repositories. GNOME Tweak Tool can
be combined with Unity Tweak Tool: even though we dont have the Unity desktop
here, the two tweakers complement each other and will prove useful.

Mythbuntu
Mythbuntu is an Ubuntu version tailored
to deliver a smooth MythTV experience
The idea behind Mythbuntu is to bridge the gap between inexperienced users
that still want to turn their PC into a media center, and Ubuntu geeks. Mythbuntu
makes installing and setting up the MythTV system a little easier at least users
dont have to hunt down individual packages and stick to command line to enter
commands. So, Mythbuntu is a comfortable and ready-to-configure delivery
of MythTV in Linux. MythTV offers the interface and the underlying routines
for setting up a digital video recorder, or maybe a digital home multimedia/
entertaining system. In short, it is an open source alternative to things like
Windows Media Center.

Client and Server

GNOME 3 has a trendy look, with


slightly larger UI controls, and the
original desktop layout

MythTV has a client-server architecture, so there is a foreground user-friendly


part (client) with a fullscreen interface, remote control support, and a background
part (server) that runs the underlying routines, like converting media, interacting
with TV tuners, etc. The server side is very powerful: it supports ATSC, QAM, DMBT/H and DVB sources virtually all major formats for high-definition television.
Mythbuntu lets you create custom setups with client and server running on the
same machine, or a frontend-only installation in case you already have a MythTV
backend running somewhere else.

The Ubuntu Book 19

Xubuntu
Xubuntu is an Ubuntu version with the
XFCE desktop, which is focused on
performance and useability. XFCE is lighter
than Unity, but not as light as LXDE
Xubuntu is fast, low on resources and offers a clean, uncluttered desktop. Does
that sound familiar to you? It might remind you of what we said about Lubuntu.
Xubuntu and Lubuntu share their target audiences by offering Ubuntu flavours
with similar features. Both systems are good for old or low-end computers, but
it seems like Xubuntu doesnt slim down desktop features like Lubuntu does and
generally is feature-rich rather than minimalistic.
Xubuntu offers a clean XFCE desktop with the main launcher panel at the
top of the screen. There are now 5 presets of the panel and the backup and
restoration tool for the panel. Browse the XFCE main menu to explore the
wonderful world of different default applications. Thunar is the default file
manager, Orage offers a calendar, and Mousepad is a text editor. In fact, XFCE has
a wide list of custom-made accessories and utilities (including a CD burner!), the
original Xfwm window manager, own frontend to Gstreamer media framework
(Parole), and of course its own System Settings clone with original modules.

Reasons to go with X
A lot of people can be left undecided with what desktop environment to go
with: XFCE or LXDE. Both are attractive and fine and have little footprint both
in RAM and occupied hard drive space. Remember that the underlying system
remains the same, and you can install both desktops at one time using standard
Ubuntu repositories. However, LXDE has been switching to Qt lately, and is not
considered stable enough, while XFCE is older and generally very stable. Also,
since LXDE is transforming to LXQT, there is the inevitable mix of GTK and Qt
based apps, whereas XFCE remains to be purely GTK based.

Ubuntu MATE
MATE is the reincarnation of the classic
GNOME 2 desktop, that used to be very
popular before GNOME 3 (GNOME Shell) took
over. Ubuntu MATE brings it to the fore
While certain Ubuntu flavours are targeted at low-end machines, or specific
area of usage, Ubuntu MATE is a mainstream distribution. It doesnt compete
with the main Ubuntu and its Unity desktop, but attracts the part of the audience
that simply doesnt like Unity. It doesnt mean that Unity is bad, but Ubuntu used
to offer a GNOME 2.x desktop before version 11.04 and a lot of people got used to
it. GNOME 2.x was appreciated for its clean and logical desktop layout and robust
performance. This version was left unmaintained since GNOME 3 took over, and
it was forked for a new project called MATE. MATE looks exactly the same as the
old GNOME 2.x, but brings modern improvements to user experience, such as full
support for modern GTK 3 toolkit, correct usage of application indicators in the
system tray, fixed integration with Pulseaudio mixer, Bluetooth applet and more.

Different naming

Xubuntu and Lubuntu offer Ubuntu


flavours with similar features
20 The Ubuntu Book

The desktop is named after the South American plant yerba mate. To avoid collision
between modern GNOME 3 default applications and forked old-timers, MATE
developers renamed everything. Gedit is now Pluma, Nautilus is Caja, Evince is Atril
and so on. Thanks to this, MATE can coexist with GNOME 3 on the same machine.

Ubuntu Kylin
Ubuntu Kylin is the official Chinese version of
Ubuntu, developed by joint forces of Canonical
and the Ministry of Industry and Information
Technology of the Peoples Republic of China
This is an exquisite Ubuntu flavour, which is really unlike the others. Naturally, it
is intended for use in China, by Chinese people in other countries and by students
of the Chinese language, culture and traditions. The Chinese government used to
invest heavily into Kylin, a FreeBSD-based system that was designed to become
a national OS in China. But later on, in 2013, the Chinese government agreed with
Canonical to develop a customised Ubuntu version specifically for Chinese market,
so the history of Ubuntu Kylin began. The new operating system was named after the
mythical beast Qi Lin, a hybrid of a dragon head and tiger body which represents
good omens, protection, prosperity, success, and longevity. The Ubuntu Kylin release
schedule is aligned with the main Ubuntu Linux, and both systems are mutually
compatible in terms of supported software. The difference is in default applications
and, of course, localisation that goes far beyond simple change of UI language.

Ubuntu with a Chinese flair


Installing Ubuntu Kylin is possible for non-Chinese users if they memorise the order
of the buttons in the original Ubuntu. You can change the UI language to English later
on. Ubuntu Kylin has tested the FCitx input module well, which supports Wubi, pen,
Cangjie, breeze, spelling and more. The very lovely Kylin theme is also a bonus.

The operating system was named


after the mythical beast Qi Lin, a
hybrid of a dragon and tiger
Left How the Ubuntu Kylin
interface looks

The Ubuntu Book 21

Ubuntu
essentials
24 Navigate Ubuntus desktop

55 Unleash Archive Manager

Find your way around

26 Dual boot with Ubuntu

Understand this handy accessory

56 Using Disk Usage Analyzer

Run Ubuntu alongside Windows

28 Customising the desktop


Change settings to your preferences

Find out where your disk space went

57 Manage Startup
Applications

32 Tweak Security Settings

58 Monitor Software
& Updates
59 Work with Universal Access

36 Understand the ile system 32


Learn about ile system organisation

38 Accessibility in Ubuntu
Make Ubuntu easier to use

40 Sharing iles in Ubuntu


Transfer your documents with ease
Use hard drives and removable media

44 Commanding Ubuntu
Get to grips with the command line

48 GNOME Terminal & XTerm


Explore the basics and beneits

50 Secure iles with Dj Dup


Create a copy of your valuable data

52 Use Startup Disk Creator


Make a bootable USB

54 Check the Time & Date


View the calendar and make changes
22 The Ubuntu Book

Make your laptop run longer

62 Connect with
Online Accounts
Enjoy convenient integration

63 Use System Monitor


View and manage your resources

Make Ubuntu more friendly

This handy search bar is your gateway

42 Manage drives with Disks

61 Tweak the Power settings

Keep your system up to date

Ensure you are protected

34 Find your way around Dash

Set up a new connection

Automatically start your apps

30 Discover System Settings


Personalise your system details

60 Conigure Network
connections

50

56

63

The Ubuntu Book 23

Ubuntu essentials

Navigating the basic


Ubuntu desktop
Get to know where to
find everything you
need on the intuitive
and attractive Ubuntu
desktop screen

The dash
Unitys start menu is keyboard driven
and opening it in this way can save
time. Savvy users will open it using the
Windows key on their keyboard. You
can get a real productivity boost by
following it up with a few characters
describing the app you are looking for:
for example, entering Thun after tapping
the Windows key virtually ensures that
the Thunderbird icon appears right in
the middle of the application list

When Ubuntu first introduced its Unity desktop,


some users threatened to move back to Windows
Vista. However, as time went by, the desktop
became more and more reliable: as of 12.04LTS,
there is no real reason to dislike Unity.
Unity initially started out as a research product
trying to create a GUI that was better suited to
netbooks: their extremely wide displays did not work
particularly well with traditional desktop managers
that had been intended for workstations utilising the
standard 4:3 displays.
This explains two important changes to the
interface: first of all, the launcher was moved to the
side of the screen in order to preserve the valuable
vertical real estate. Secondarily, the menu bars of the
various different applications were grouped together
into one top bar that is always dedicated to the
currently enabled application. This is one of the main
differences you will find from Windows and other
distros in terms of usability, but it is one that you will
become accustomed to over time.
While getting up to speed with Unity might take
users a bit of time, rest assured that the productivity
increases that you will eventually see are more than
worth it. Take a look at the annotations to find the
hotspots youll need most quickly.

The menu bars of


the various different
applications were
grouped together into
one top bar that is always
dedicated to the currently
enabled application on
the screen
24 The Ubuntu Book

The quick launcher

Trash
Just where youd expect to
find it, the trash can is always
visible at the bottom of the
quick launch bar

All of the running applications


are shown below the dash
symbol. The arrows located
on the left side of the icon
let you know the number of
windows that are currently
open. On dual-screen
workstations, an empty
arrow here indicates that the
window is not located on the
display that is showing this
particular version of the bar

Navigating the basic Ubuntu desktop


The keyboard cheatsheet

Wallpaper

Unity comes with a set of helpful


keyboard shortcuts that increase
productivity and get things done faster.
Press and hold on the Windows key to
make the desktop environment display a
list of shortcuts for you in the middle of
the screen that is currently active

As with practically any


other distro or OS, your
wallpaper is a canvas
for you to put your own
stamp on. The default
Ubuntu offering isnt too
shabby, though

The quick
launcher
Right-click on the
symbol of a running
application to open
a short menu.
Selecting Lock to
launcher from the
available options
ensures that the
symbol will always
remain in the bar for
quick access to that
specific application,
even if it is not
currently running

The indicator menu


Ubuntu will display symbols
alerting you about any events and/
or important system state changes
that are taking place or need your
attention. Click on any of these
icons when they appear to reveal
a short menu providing you with
further options about the situation
at hand

Active workspace

The menu bar

Front and centre, its the


window youre working on.
To switch to another without
closing the current window,
just click on or search for the
app you want to open next. It
can be minimised if you hover
at the top of the window, when
the classic three buttons
will appear: close, minimise
and maximise. Be aware that
clicking the close option will
mean you need to start the
program again

Move your mouse


cursor up to the very
top of the screen to
enable the menu
display. This is a
really helpful tool
for accessibility
as less dexterity is
required to complete
it. Simply flick the
cursor to the top of
the screen and let
Unity take care of
any overshoot

The Ubuntu Book 25

Ubuntu essentials

Dual boot with Ubuntu


Get Ubuntu running alongside your existing Windows installation
Most users who want to try Ubuntu
already have desktop PCs or laptops with
the Windows OS. Ubuntu can be installed
alongside Windows and both systems will coexist just
fine, without interfering with each other.
Ubuntus installation wizard has an advanced disk
partition stage, where you can either trust the installer
to automatically shrink the Windows partition and let
Ubuntu use the freed space, or do it manually. Shrinking

NTFS partitions from Linux is considered stable enough


and if you didnt have any problems with your C drive in
Windows (such as severe fragmentation), Ubuntu will
resize it correctly. The installer will create the mandatory
root partition (/) in the free disk area and sometimes
also create separate partitions for user data (/home)
and swap space. After the installer copies Ubuntu
files to the root partition, itll perform post-installation
arrangements and install the GRUB2 bootloader into

the master boot record (MBR) of the hard drive on


older systems, or GRUB2-EFI into the dedicated FAT32
partition on modern systems with Windows 8 or 10 and
a GPT-formatted drive. The Ubuntu installer supports
the Secure Boot feature of many modern Windows PCs
and installs the GRUB2-EFI bootloader correctly. After
rebooting, youll see the GRUB2/GRUB2-EFI interface,
where you can choose Ubuntu or Windows. You can
access Windows files from Ubuntu, but not vice versa.

Discover bootloader menu Find out how to use the GRUB2 bootloader
Meet the GNU GRUB

The default entry

GRUB in Ubuntu looks nearly


identical on systems with a BIOS
or UEFI setup. The version of the
program is displayed on the top

If you do nothing, GRUB will load the default


menu entry, which is the first one in the list.
It always points to the latest installed kernel
version with default parameters

Boot Windows

Reveal the power of GRUB

Select the last entry to boot


Windows. GRUB will redirect you to
the Microsoft standard bootloader
that sits on the Windows partition

You can instantly change boot settings by


pressing the E key, editing an entry and then
pressing F10. This is a one-time solution: GRUB
will discard such custom settings after reboot

26 The Ubuntu Book

Dual boot with Ubuntu


Dare to go for
manual setup
Ubuntus installation program has been polished in
recent years and now looks very smooth. Soon after
completing basic steps (like language selection), a user
faces the first real obstacle during the Installation
type step. You can see that Ubuntu has automatically
detected our Windows 7 copy and offered the simple
solution that does not require any extra user input. If
so, you let the installer automatically guess what OS
you already have and how to keep it intact. Its safe,
and youll be able to define how much space you want
to allocate for Ubuntu in the next step.
Note the second option with the red Warning label
we are going to install Ubuntu and keep Windows
working, so do not choose this. The last option is a
path to a more expert-like drive allocation program.
Dual-booting in UEFI mode introduces more routines
for the Ubuntu installer. If youre unsure what to
choose, go with auto mode. If your system uses a BIOS
interface, you can repartition your drive manually.

Define the space for Ubuntu

Create Ubuntu partitions

Make sure you give it enough disk space

Options for partitioning your hard drive

The automatic partitioning option


in the Ubuntu installer is definitely
more comfortable for non-techsavvy users, but it does have
certain limitations, such as the
inability to add an extra Home
partition or define the swap space
manually. Lets use the fully fledged
partitioning method by choosing
the Something else option in the
previous step, or by clicking the
Advanced partitioning tool link
in the simple mode. First, youll
need to resize the NTFS volume

and make it smaller by some


number of gigabytes. Make sure
that you dont have excessive hard
disk fragmentation in Windows,
otherwise you may turn your NTFS
volume in Ubuntu installer unusable.
Try to guess how much space youll
need in the unallocated area after
shrinking. For instance, 10GB looks
like the bare minimum go with at
least twice as much as that for the
Ubuntu root partition. Think ahead
to cover aspects like swapping and a
separate partition for /home.

Many older articles concerning the


installation of Linux strongly advise
users to create a swap partition
with a size twice that of the RAM
volume (for instance, 2GB if you
have 1GB of RAM). However, modern
computers generally have larger
amounts of RAM and therefore
this rule is not that important any
more. That being said, you could
go without the swap partition
altogether unless you feel that you
really need it. The separate partition
for your home folder in Ubuntu is

another aspect to consider. If you go


with a single root partition, that
means all your personal files and
settings will be kept together with
the rest of the system on a single
partition (/), just like if you only had
the C: drive in Windows for storing
everything. Sometimes it is more
sensible to create another partition
and mount it as /home this
means that your files and settings
will not get lost, even if you decide
to reinstall or remove Ubuntu in
the future.

Select target drive


for the bootloader
This option only requires your attention if its the
case that you have more than one hard drive inside
or attached to your computer. Otherwise, if you had
previously installed custom operating systems onto
your Windows desktop PC or laptop, you might find it
useful to get to grips with this option as well. First of
all, in order to boot correctly, Ubuntu needs a properly
installed GRUB bootloader.
You can install it on a hard drive (eg /dev/sda) or on
a drive partition (eg /dev/sda3). If you have a relatively
modern UEFI/Secure Boot setup, then Ubuntu will
act differently: it will install GRUB2-EFI on /dev/sda1,
which is a FAT32 partition, and mount it as /boot/efi.
Furthermore, a special loader entry in your computers
UEFI internals will be made by the means of the
efibbotmgr utility. Dont worry though, Ubuntu does all
of this automatically.

The Ubuntu Book 27

Ubuntu essentials

Customising the desktop

Change desktop settings and add a personal touch to Ubuntus exterior

Tweak desktop settings

Use related sections in Ubuntus System Settings app

Unity Tweak Tool

Change Specific settings

Window manager

Default wallpaper

Its not included right out of


the box, but it is instantly
available in the standard
Ubuntu online repository. Get
it with $ sudo apt-get install
unity-tweak-tool

Unity is made up of various different


elements, including the main taskbar
which is along the right side of the
screen, the main menu with a search
feature (Dash), the top panel and the
task switcher

There are ways in which you


can change the behaviour
of window manager in Unity.
Shadows, translucency,
animations, hot corners,
snapping, focusing rules etc

You can set the default


Ubuntu wallpaper to a photo
(or maybe a drawing) of your
choice in the Appearance
section of the standard
System Settings

Appearance settings

System settings

A Register Editor for Ubuntu

Change the theme

Here you can change GTK


style, window decoration
theme and fonts separately,
change mouse cursor look
and move window buttons to
another edge of a window

Unity Tweak Tool offers


advanced system settings, eg
enabling desktop icons, extra
security measures, control
over scroll bars as well as
mouse behaviour

Use the command $ sudo apt-get


install dconf-editor to install a twin
panel settings manager. It behaves
similarly to the Register Editor in
Windows OS and lets you adjust many
hidden settings

This defines how various


UI controls look, and this
includes buttons, scroll
bars, menu background,
window decorations and
lots of other details

The default desktop environment in


Ubuntu is called Unity. It provides users
with a consistent and easy-to-use graphical
interface for doing common everyday tasks. The default
settings in Unity are quite simple, they are based on
studies that were conducted with the exact goal being
to find out what exactly people find comfortable and
intuitive and other useful details. However, with so many
people with so many different tastes, Unity allows all

28 The Ubuntu Book

essential features, such as appearance and behaviour


of the desktop, to be customised to the users liking.
This is done with the Look and Feel settings,
localisation, input options as well as privacy-related
settings. Some of the above dont affect Ubuntu
behaviour such as various aesthetic settings (theme,
icons), but some do .
It is worth mentioning that sometimes people need
more precise control over their Ubuntu installation and

require some extra features that are not part of the outof-the-box Ubuntu. For that reason, there are different
ways to work around it in the form of commands ($
gsettings) and even stand-alone tweakers (eg Unitytweak-tool). Such extras let you change advanced
settings like fonts, window control placement, desktop
effects and more. Next you can find out how you
can change the most common settings and resolve
frequently met issues.

Customising the desktop

Tutorial

Give a personal touch to your Ubuntu desktop

01

Adjust the Launcher (taskbar)

02

Change privacy settings

The taskbar panel or the Launcher works


just fine, but sometimes you need to get rid of some
of the default icons there and add your favourite
apps instead. To remove an icon, right-click on it and
select the Unlock from Launcher option. To add an
application to the taskbar you first need to find it
in the Dash and then drag it onto the desired place
of the taskbar. You can also drag and rearrange the
existing icons on the taskbar. Use the Appearance
>Look section in System Settings to change the
taskbar icon size. If you make it smaller, more icons
will fit there, which is helpful for small displays. Also,
check the Behaviour tab for auto-hiding option,
enabling multiple workspaces and more.

Ubuntu includes certain mechanisms for


gathering users data and collecting statistics of
course, this is meant entirely for the sake of better
usability in future Ubuntu releases. Some find this
behaviour controversial, so lets adjust it a little.
In System Settings>Security and Privacy go to the
Files & Applications tab and uncheck or maybe
turn completely off files and applications usage
statistics. On the Search tab you can actually turn
the online search results in Unity Dash on or off. If
you dont like shopping suggestions while looking
for a local app on your computer, simply turn it off.

With so many people


with so many different
tastes, Unity allows all
essential features, such
as appearance and
behaviour of the desktop,
to be customised

03

Change look and feel

Changing the interface theme can


dramatically change the working experience and
make it more pleasant. It is perfectly safe: you dont
change how your desktop works, you change how it
looks. By default Ubuntu ships with three themes:
Ambiance (the default one), Radiance (light colours)
and High Contrast (for visually challenged). You can
add more by installing new themes via command line
(adding a PPA with a theme and installing its package
for example), or download themes manually from site
like gnome-look.org. Ubuntu looks for themes in the
system-wide /usr/share/themes directory and in
~/.themes inside your home.

04

Use hot corners

05

Rule the indicators

The Unity desktop lets you assign an action to any corner of the screen, plus to any of its sides. In order
to do this, we need to access advanced window manager settings. Launch Unity Tweak Tool and go to Window
Manager>Hotcorners. There are eight areas (four corners and four sides) with a drop-down menus next to each,
letting you choose what action will be performed once you move your mouse to the respective area. You can
set a corner or a side to toggle the desktop (for example, minimise all windows or bring them back on), spread
windows or show workspaces. All changes are applied instantly, you can check it by driving your mouse to a
corner or a side that has been set up.

The System Tray area in Unity traditionally


resides the far-right corner of the top bar. Some
indicators there can be configured individually (like
date and time), but you cannot have better control of
them without dealing with Dconf-editor. This twinpanel app has a categories list on the left and the
contents on the right allows you adjust many aspects
of Unity indicators. Go to com>canonical>indicator
and explore what parameters each one has. You
can turn indicator presence on the top bar on and
off by toggling the visibility parameter and change
indicators display format by playing with show-*
parameters. This way you can keep your system
tray area clean and tidy, or maybe add some extra
information there.

The Ubuntu Book 29

Ubuntu essentials

Discover System Settings

Discover system details, manage user accounts and configure hardware


The System Settings application houses
various settings and acts the same way
as the Control Panel in Windows. You can
launch System Settings from the farthest indicator in
the top bar, or even from the command line ($ unitycontrol-center). Of course, the set of system-related
settings here isnt the only place where you can change
such settings, but it is the most convenient and safe
place to do it. Traditionally in Linux (and Ubuntu is

no exception), system settings could be changed via


editing configuration files in the /etc directory, or by
issuing certain commands while being in root. While
these work in Ubuntu, it requires advanced skills and
sometimes involves putting your Linux installation at
risk. The System Settings shell in Ubuntu contains a
limited number of neatly designed items that help you
manage essential system-related settings with ease
and minimum skill. The System subsection contains

The important subsections

settings for Backup, System Details, Landscape


Service, Software Sources, Time & Date, Universal
Access and User Accounts. Some of the above are
applicable for enterprise Ubuntu users (such as the
paid subscription for technical support, which is called
Landscape), while other settings are covered in detail
in separate chapters (Backup, Time & Date, etc). This
overview focuses on Details and User Accounts as well
as on certain hardware-related settings.

Configure your Ubuntu installation

Navigation

Search for a setting

When you open a subsection, it


loads in the same window. In order
to get back to the main overview, use
the All Settings button here

If you cannot find the required settings but


you know its name, type it into the search
bar and see how System Settings filter the
results according to your input on the fly

Personal settings

Hardware settings

System-related settings

Most settings here are userspecific. You can also change


look and feel settings here, adjust
privacy, manage online accounts etc

You might set up extra peripherals,


input devices, change power
settings, or even manage colour
profiles for printers and displays

Backups, system details, updates


and software sources, accessibility
options, time and date and more, can
be managed within this category

30 The Ubuntu Book

Discover System Settings


Explore system details
and change some defaults
Sometimes you need to know what version of Ubuntu
you have. Is it 32 or 64 bit, how much memory there
is in your PC and so on. In order to not get lost, there
is a dedicated subsection in System Settings called
Details. The main screen in Details shows a summary
of the most important specs of your system, including
CPU name and clock, graphics driver, hard disk volume
and more. You can also update your system with the
Install Updates button on the right. There are other
useful tabs in Details see the list on the left side of
the screen. Go to Default Applications to change your
default web browser, email client, music player or
image viewer. Similarly, on the Removable Media tab
you can define what Ubuntu should do when an optical
disc (CD/DVD/BD) is inserted. Again, all changes are
then applied immediately.

Manage Ubuntu users

Tune up power settings

Add guest logins or other users

Optimise your power consumption

If your PC is mainly used as a private


or personal computer then perhaps
you are the only user in the system.
Heres what you do you need to do if
you want to create another user for
testing purposes, or for guest logins.
If there is actually already more than
one person that accesses the PC (in a
public place for example), youll need
the correct number of login accounts.
These are managed in the User

Accounts subsection. By default, you


can only see the list and the settings,
but cant change anything. To add
or remove users you must click the
Unlock button and enter the root
password. After that youll be able
to click the tiny + and - buttons
displayed at the lower left corner of
the screen, watch an activity log of
other users (the History button) and
toggle their automatic login.

These settings mostly affect laptop


users, but they can help optimise
desktop power consumption as
well. In the Hardware category, go to
Power and use the first drop-down
menu to set the inactivity period,
after which your computer will
automatically suspend. The second
option below lets you disable the
battery indicator for example. When
your laptop always runs from AC,

there is no need for this. Another


power-related tunable is screen
brightness. Either follow the link on
the Power tab or open the Brightness
& Lock subsection directly. Here
you can set a period of inactivity for
turning the display off automatically,
as well as lock it and define whether
the user should be required to
provide a previously set password to
unlock the computer.

Set up a printer
Ubuntu automatically detects and configures local
printers in case it has a driver for them. Most consumer
printers are supported without any problems in Linux
nowadays, so if you open the Printers subsection, you
should see the icon for a configured printer. You can
change (edit) the printers preferences, change its driver,
or you can create several instances of the same printer
with different settings.
Press the Add button and follow the easy-to-use
wizard to set up a local or remote printer Ubuntu
detects network printers automatically. In case you
need more control or you want to resolve a printing
issue, use this tip: $ sudo service cups restart. This is
the command for restarting the system-wide printing
service in Ubuntu. To enjoy the feature-rich CUPS admin
interface instead, then try going to http://localhost:631
in your web browser.
Note that all changes to printer settings require the
root password of your Ubuntu system.

Follow the easy-to-use


wizard to set up a printer
The Ubuntu Book 31

Ubuntu essentials

Tweak the Security Settings


Make sure your Ubuntu setup provides proper privacy protection

Find the security settings

Check out the Security & Privacy tools on offer

Protect your PC

Related settings

Usage activities record

If your PC suspends or
turns off the display after
a period of inactivity, you
can set Ubuntu to require
a password in order to
resume using the PC

The first link takes you to the User


Accounts subsection, where you can
change your password; the second
link is for Power settings, where you
can change the time period before
you system suspends

Here is the global switch that


triggers file and application
usage logging. You can turn it
off with just one mouse click,
or alternatively decide to make
more precise adjustments

Choose what to include


There are default places inside your
home directory for Music, Pictures,
Downloads etc. You can decide what
items you want to include in Ubuntu
logging. Aside from directories, there
are also chat logs and office documents
Privacy is a cornerstone of secure
computing, meaning that your data should
be protected from loss or leakage, your
computer should prevent unauthorised access and
that you should be aware of what personal data is
sent from your system to remote servers. Ubuntu
provides a good balance between usability and security,
for example you cannot log in to Unity desktop directly;
instead you can actually use the sudo prefix to run

32 The Ubuntu Book

Exclude specific directories


and apps
Use the + and - buttons to select specific
directories or applications that Ubuntu
will not log or trace. You can even create
sophisticated combinations of apps

commands as an administrator. For regular desktop


activities there is the System Settings>Security &
Privacy subsection, where you can change most of the
security-related settings. The majority of them refer to
password protection, keeping logs and history for files
and applications, online search results in Ubuntu Dash
and diagnostics information that Canonical would like
to have in order to fix bugs and collect users statistics.
The reasons as to why you may want to change anything

What about online


search results?
A rather controversial feature,
which is why Canonical decided
to put in the Off mode in 16.04.
You can always change the
triggers position here

Diagnostic reporting
Canonical needs your feedback
in order to make Ubuntu better.
If something goes wrong (eg a
program crashes), Ubuntu will
send details of the problem in a
report to its headquarters
may vary. You may not want others to see what you have
been using recently, or maybe online search results in
Dash (Unitys main menu) distracts you, or you simply
dont want Canonical to know you better. There is
another security setting in Ubuntu outside its System
Settings shell. When you launch Firefox for the first
time it politely asks you to choose what data youd like to
share. By default Firefox sends crash and help reports to
Mozilla, but still its you who decides and approves it.

Tweak the Security Settings

Tutorial

Resolve typical security-related issues in Ubuntu

01

Generate a stronger password

02

Enable automatic security updates

There is no sense in setting your Ubuntu


password as something simple such as 12345678
or P@ssw0rd. It is sensible to invent a combination
of symbols that is unique, complex, long enough and
most importantly something that you are sure you
will not forget. A good password contains lower and
uppercase letters, special characters and digits.
Thankfully, Ubuntu can help you deal better with
stronger passwords via the APG utility. Install it with
$ sudo apt-get install apg and run simply with $ apg.
APG which will prompt you to enter a random word
of your choosing, and then converts your suggestion
into a stronger combination of characters, but still
something readable and not too hard to remember by
heart like WoudElIc6 (Woud-El-Ic-SIX).

Lets go a little further and make Ubuntu


receive important security updates without any
interaction with a user. This feature is very useful
because not all updates are installed without your
awareness, but only security-related ones that fix
vulnerabilities, critical bugs, memory leakage and
so on. To enable this feature, first start by installing
the package along with the required scripts:

$ sudo apt-get install unattended-upgrades.


Next, enable updates with the following command:

$ sudo dpkg-reconfigure -priority-low


unattended-upgrades.
All you have to do is to add unattended upgrades
command to your Cron list on a daily/weekly/
monthly basis. Find more details at bit.ly/1EtLKFF.

03

Enable uncomplicated firewall

Firewall is an effective tool for blocking


network intrusions from the outer world and limiting
suspicious network activity in both directions by
blocking certain network packets in IPv4 and IPv6
protocols. Linux has the iptables tool for doing this
job, but it is not very intuitive for newcomers. Luckily,
Ubuntu has a nice front end to iptables called UFW
the Ubuntu FireWall in its standard repositories.
Install it with:

$ sudo apt-get install ufw gufw


You can control it either from command line ($ sudo
ufw --help), or within a graphical interface (search
for firewall in Dash or simply launch $ gufw).

A good password
contains lower and
uppercase letters, special
characters and digits.
Thankfully, Ubuntu can
help you

04

Configure sudo

The sudo is a command that you can put


before another command in order to make it run
with root priviliges. You can use sudo anytime and
for any command but practically you only need to
do so if you havent got enough permissions with
your regular user account for managing printers,
or in case you need to write a file into a directory
outside your home for example. Ubuntu comes
with sudo enabled by default, which lets you run
any command, but requires entering your current
password (not the root password, root is disabled
in Ubuntu by default). You can change the sudo
settings by issuing the $ sudo visudo command,
which will open the /etc/sudoers file in the Nano
editor. You can discover the magic of sudo with $
man sudo, but there are also instant solutions you
can use by changing the following line:

username ALL=(ALL) ALL


to the one below:

username ALL=(ALL) NOPASSWD: ALL


to stop sudo asking for a password.

The Ubuntu Book 33

Ubuntu essentials

Find your way around Dash


Learn essential tips and tricks to use Dash like a pro

It is very common for people switching


from a Windows platform to a Linux system
to look for the ever-popular Start menu.
Generally, the Start menu serves as the starting point
of your interaction with the computer, and once you get
used to it, it feels like the most natural way to work on
the computer. Thankfully, Unity the standard desktop
environment for Ubuntu systems offers Dash. Think
of Dash as the equivalent Start menu of your Ubuntu

system. Dash allows you to search for applications, files,


music and videos, and shows you items that you have
recently used. Dash also helps you to launch application
and file shortcuts.
To start Dash, simply click on the Ubuntu logo on the
top-left portion of the menu bar. You can also press the
super key on your keyboard (marked with the Windows
logo) to launch it. To exit Dash, all you need to do is click
the esc button.

Dash segregates the search results as a series of


scopes (or lenses). These are used to provide views to
your files, folders, applications and data. There are a
few basic scopes installed by default with an option to
disable them. Switching off a scope means you wont
see any results from that scope in your search results.
With so many configurable features, it is evident that
Dash is more than a search box for finding files, but
rather it provides a view of the whole operating system.

Navigate the Dash display Get familiar with the display and filter options
Text area

Reference

Categories

This is the space where


you type your queries into
Dash. As you type in the
text, you will see the space
below being populated with
results dynamically

This is the Dash result section


that displays references
related to the search query.
You can see the definition,
images and more related to
the search query here

You can select the


categories from
which youd like
to view results
by choosing the
categories here

Application
This section
displays results
related to the
applications scope.
Youll see all the
applications that
match the search
query here

Sources
Weather

More suggestions

Dash automatically detects the scopes


that may be relevant to the search
query. Since there is a place called
Dash, it automatically displays the
weather forecast for that location

This is the section that


displays results from online
shopping websites and other
sources that are relevant to
the search query

34 The Ubuntu Book

Scopes
Dash by default shows
results from all the
available scopes. You
can limit the results
to specific scopes by
selecting them here

This section
allows you
to select the
sources from
where Dash will
look for results
when you enter
a search query

Find your way around Dash


Dash scopes and lenses
Dash serves as the universal window for finding
content, but as there are several types of content on
the computer, the results are segregated into smaller
scopes or lenses. Dash has a series of scopes that
logically separate the results and provide views to
your files, folders, applications and data. The following
scopes are installed by default: Home, Applications,
Files, Videos, Music, Photos and Online (social media).
Once you launch Dash, youll see a search bar on the
top. This is common to all scopes. Simply start typing
and a list of results will appear below. Note that this is
the home lens. The home lens is the default and will
appear unless you explicitly select another lens. You
can explicitly select a lens by clicking one of the options
on the bottom bar (when Dash is active). Other lenses
will only show the items from the corresponding scope
that is relevant to your search query. For example, if you
type text as a search query, home lens will show the
results from all over the computer, but if you change it
to an application lens, youll see the text editor as the
first result.

Dash Keyboard shortcuts

Filtering Dash responses

Learn keyboard shortcuts to master Dash

Restrict search results using filters

There are several shortcuts you can


use to speed up your interaction
with it. For example, press the super
key and hold it for a while; a list of
numbers will appear against the
launcher. You can open any of the
applications by simply pressing
the associated number on the
keyboard. While you hold the super
key, you will see a window with
several shortcuts listed.
To go straight to the applications

lens, simply press the super key


and the letter A at the same time.
Similarly for the music lens, press
the super key and M at the same
time. For videos, press the super
key and V.
Super key+C takes you to photo
lens and Super key+F opens the
file lens. If you would rather switch
between lenses on the fly, you can
use Ctrl+Tab to switch between
lenses once you are inside Dash.

The top-right corner of each lens


has the filter option. You can click on
the filter results link to expand the
options. Note that the options are
contextual that is to say that there
are options under different lenses.
In the Home tab the filter option lets
you choose which categories are
shown and the online sources from
where results can be pulled.
The filters for the Applications tab
include the ability to filter by type

(such as graphics), games, internet


applications and so on. The filters
also enable you to narrow down the
search between applications that are
already installed and applications
that appear in the software centre.
Similarly, if you are in the Files lens,
you will be able to filter the results
by type, size and the last edited
time. Music lens filters by genre and
decade. Photo lens filters based on
the date that the photo was taken.

Managing lenses in Dash


Though Dash offers a lot of flexibility in showing search
results, you may wish to remove some of the results
listed, or add some that are either hidden by default, or
simply dont exist. There is a small application available
in the Ubuntu Software Center to help you to do this.
Lets install it first. Open Dash. Change the scope to
Applications and search for the main menu. In the
results that appear, click on the link to the Ubuntu
Software Center. Click Install on the top-right corner of
the page to install the software. Now, open the main
menu application using the launcher or Dash.
You can now enable, disable and even permanently
delete items or whole categories from here. Check
out the categories in the left-hand column. You can
uncheck items or categories to hide them, and check
to make them searchable again. This will not install
or uninstall any software, but just stop results from
showing in the Dash search results. This way, you can
be sure of not breaking anything important.

The Ubuntu Book 35

Ubuntu essentials

Understanding the file system


Learn about the file system organisation in Ubuntu

Understand file listing

Learn the meaning of each column in the file listing output

First column

File listing command

Special files

The first character indicates


whether it is a directory
or a file. The other nine
characters indicate the
permissions for file owners,
groups and everybody else

ls lists all the files in the current


directory and the -la extension shows
the files in long format, along with all the
hidden files. When executed from the
root directory, it shows all the directories
in the top-level hierarchy

Wherever you issue the ls command in


Linux, youll see these two files listed on
the top. However, these arent visible if you
inspect the same directory via the GUI. The
single dot indicates the current directory;
double dot, the parent directory

File names
This is where all the
directory/file names
are listed. You can
see all the toplevel Linux default
directories here

Fifth column
Second column

Third & fourth column

This column indicates


the number of links
or directories inside
the directory

The third column shows the


owner of the file, and the
fourth column indicates the
groups that the file belongs to

One of the most complex things about


any Linux-based computer is probably
its file system. There are so many files and
folders that serve so many different purposes. To
a newcomer just getting started with Linux, all this
appears like a huge maze. This calls for a basic, yet clear
understanding of how files and folders are organised in
Linux, and specifically Ubuntu. This is exactly what we
are going to do in this guide. Lets start with the basics.

36 The Ubuntu Book

This column shows the size in


bytes. You may modify this by
using the -h option together
with -l; this will have the output
in kB, MB and GB for a better
understanding of the size

Ubuntu (like all Unix-like systems) organises files in


a hierarchical tree, where relationships are thought of
in terms of child and parent. Directories can contain
other directories as well as regular files. Any element of
the tree can be referenced by a path name absolute
or relative. An absolute path name starts with the
character / (identifying the root directory, which
contains all other directories and files), then every child
directory that must be traversed to reach the element

Sixth column
This shows the
timestamp of
last modification
of the directory

is listed, each separated by a / sign. A relative path


name is one that doesnt start with /; in that case, the
directory tree is traversed starting from a given point,
which changes depending on context, called the current
directory. The fact that all files and directories have
a common root means that, even if several different
storage devices are present on the system, they are all
seen as directories somewhere in the tree, once they
are mounted to the desired place.

Understanding the file system

Tutorial

Learn about folders and their organisation

03

Various directories under /

Let us now see the various important directories present under the root
directory and get an idea of which ones serve what purpose.
/bin is a place for most commonly used terminal commands, such
as ls, mount, rm etc.
/boot contains files needed to start up the system, including the Linux kernel, a
RAM disk image and bootloader configuration files.

/dev contains all device files, which are not regular files but instead refer to
various hardware devices on the system, including hard drives.
/etc contains system-global configuration files, which affect the systems
behaviour for all users.
/home this is the place for users home directories.

01

File system hierarchy standard

The Ubuntu file system is based on the Filesystem Hierarchy Standard


(FHS). The latter defines the main directories and their contents in Linux operating
systems. For the most part, it is a formalisation and extension of the traditional
BSD file system hierarchy. The Linux Foundation a non-profit organisation
consisting of major software and hardware vendors, such as HP, Red Hat, IBM
and Dell maintains the FHS. At the time of writing, the current FHS version is 3.0,
released on 3 June 2015.

/lib contains very important dynamic libraries and kernel modules.


/media is intended as a mount point for external devices, such as hard drives or
removable media (CDs, DVDs etc).
/mnt is also a place for mount points, but dedicated specifically to temporarily
mounted devices such as network file systems.
/opt can be used to store additional software for your system which is not
handled by the package manager.
/proc is a virtual file system that provides a mechanism for the kernel to send
information to processes.
/root is the superusers home directory; its not in /home/ to allow for booting the
system even if /home/ is not available.
/run is a temporary file system available early in the boot process where
ephemeral run-time data is stored. Files under this directory are removed or
truncated at the beginning of the boot process.
/sbin contains important administrative commands that should generally only
be employed by the superuser.
/srv can contain data directories of services such as HTTP (/srv/www/) or FTP.

02

The root directory

Unix abstracts the nature of tree hierarchy entirely, and the root directory
is the base of all the folders in the Ubuntu hierarchy. Indicated by the / sign,
the root directory contains all the other folders. Though the root directory is
conventionally referred to as /, the directory entry itself has no name its
name is the empty part before the initial directory separator character (/). All
file system entries, including mounted file systems, are branches of this root.
It is because of this layout that all the absolute paths in Unix systems start with
/. Even if there are several physical or virtual storage devices attached to your
computer, all the folders will be shown under the root directory.
Note that this is not to be confused with the /root directory that serves as the
home directory for the root users.

/sys is a virtual file system that can be accessed to set or obtain information
about the kernels view of the system.
/tmp is a place for temporary files used by applications.
/usr contains the majority of user utilities and applications, and partly
replicates the root directory structure, containing for instance, among others,
/usr/bin/ and /usr/lib.
/var is dedicated to variable data, such as logs, databases, websites and
temporary spool (email etc) files that persist from one boot to the next. A notable
directory it contains is /var/log, where system log files are kept.

The Ubuntu Book 37

Ubuntu essentials

Accessibility in Ubuntu
Learn to use the accessibility tools and options available in Ubuntu
Usability was a prime concern when
developing Ubuntu. Developers worked
hard to ensure that Ubuntu is as easy as
possible for people of all ages languages and physical
abilities to use. This was not easy; it included providing
an accessible platform with high-quality assistive
tools, and making other applications work with these
tools; a feat only an open-source software approach
could achieve.

Ubuntu provides several accessibility options for


people with different needs. For visually challenged
users, Ubuntu offers Orca. Using various combinations
of speech synthesis and Braille, Orca helps to provide
access to applications and toolkits that support the
assistive technology service provider interface (AT-SPI),
for example the GNOME desktop and Unity. The Orca
screen reader can be enabled at any time when logged
in to a desktop session on any Ubuntu installation. Orca

can be enabled and disabled using the Alt+Super+S


keyboard shortcut.
For mobility impairments, Ubuntu offers options for
modifying the behaviour of the mouse and keyboard.
The modifier keys (Shift, Ctrl and Alt) can be made sticky
so that when they are pressed once, they remain active
until the next key is pressed. There are several other
accessibility options that users can adopt to make their
interactions with Ubuntu seamless.

Accessibility settings Understand various accessibility tools and their settings


Dasher settings

Accessibility settings

On-screen keyboard

Dasher opens up as a separate


application. Once you type in the text,
you can save it as a file using buttons
on this panel. There are other textediting buttons, such as cut, copy,
paste and so on available here as well

All the settings under the


accessibility options are
available under Settings>
Universal Access. Here youll
see tabs with settings related to
different impairments

Ubuntu offers an
easy-to-use, resizable
on-screen keyboard. Just
flip on this switch and the
keyboard will appear on
your desktop

Text entry
This is the area
where you can use
the mouse pointer
to enter text into
a file. As you point
in a direction, the
page zooms in,
and once you click,
the character gets
typed in

Sticky keys
This switch lets you
enable the sticky
key configuration, so
that one key press
on the Shift, Ctrl
or Alt key remains
active until the next
key press

Enable by keyboard

Bounce keys

Slow keys

If you want to use keyboard


shortcuts to manage
accessibility options, you
simply need totoggle this
switch to on. This will
make the process easier

Enable this switch to


make the computer
ignore fast repeated key
presses. Again, you can
choose the acceptance
delay using the slider

This switch lets you enable the


slow key configuration. This
inserts a delay between when
a key is pressed and when it is
accepted. You can also choose the
delay time using the slider below

38 The Ubuntu Book

Accessibility in Ubuntu
Orca screen reader
The Orca screen reader can be enabled at any time
when you are logged in to any Ubuntu installation.
Once enabled, Orca screen reader will be loaded every
subsequent time you log in to your session. Orca is a
function that can be enabled and disabled using the
Alt+Super+S keyboard shortcut. Note, however, that
you can also enable Orca using the same shortcut key
at the login screen. The super key is also known as the
Windows key.
It is also possible to enable Orca at install time, which
means that it will be able to guide you and help you
independently install Ubuntu onto your system. When
you boot the live CD, you should hear a bongo drum
sound. At this point, you can just go ahead and enable
Orca. Once again, the keyboard shortcut Alt+Super+S is
used to enable Orca.
Orca should start speaking, and from this point you
can select your language, and either boot into a live
Ubuntu desktop by selecting the Try Ubuntu push
button, or you can elect to install Ubuntu by selecting
the Install Ubuntu push button.

The Orca screen reader can be enabled


at any time when logged in
Keyboard modifiers
Learn to use keyboard options for accessibility
There are several keyboard options,
such as sticky keys, slow keys
and bounce keys that can change
the key-press behaviour and help
people with special needs to better
use the keyboard.
The modifier keys (Shift, Ctrl
and Alt) can be made sticky so
that when they are pressed once
they remain active until the next
key is pressed, making it possible
to write uppercase characters or
use keyboard shortcuts while only
pressing one key at a time. Slow
Keys and Bounce Keys control the

reaction rate and repeat rate of


keys, whereas Mouse Keys allow
the numeric keypad to be used to
control the mouse cursor.
Ubuntu also includes the onscreen keyboard, a lightweight
text-entry application, which is
extensible through macros, scripts
and custom layouts. To enable these
options, all you have to do is go to the
Settings page and click on Universal
Access. Then go to the Typing tab.
You will see the settings to enable
the on-screen keyboard, sticky keys,
slow keys and more on this page.

Dasher
Enter text without using the keyboard
Dasher provides an intuitive way
to enter text without using the
computer keyboard. With Dasher,
you point where you want to go,
and the display zooms in wherever
you point. The area into which you
are zooming is painted with letters,
so that any point you zoom in on
corresponds to a piece of text. The
more you zoom in, the longer the
piece of text you have written. You
choose what you write by choosing
where to zoom.

In order to make the interface


efficient, Dasher uses the predictions
of a language model to determine
how much of the world is devoted to
each piece of text. Probable pieces of
text are given more space, so they are
quick and easy to select. Improbable
pieces of text (for example, text with
spelling mistakes) are given less
space, so they are harder to write.
Dasher is not installed by default
on Ubuntu; you can install it via the
Ubuntu Software Centre.

Mousetweaks
For users who cannot click with a hardware button, there is a utility
named Mousetweaks that enables them to perform the various clicks by software.
Mousetweaks offers several features to users: system-wide software click, usually
called dwelling, and system-wide simulated right click through a click and hold of the
left button (of course, for left-handed mouse users, the terms left and right have to
be inverted). Provide an area on the panel to temporarily lock the pointer (provided
by a panel applet). It uses image processing to translate the users head movements
into mouse events (movements and clicks), which allow users to interact with the
different desktop managers and applications. Mousetweaks is installed by default in
Ubuntu 15.10, and can be easily launched via the terminal. Just type mousetweaks in
the terminal.

The Ubuntu Book 39

Ubuntu essentials

Sharing files in Ubuntu

Learn to create file servers to share data from your Ubuntu system

Sharing files with Samba GUI

Learn to share files with Samba GUI

Menu bar
This section has the
basic settings to add
files to share and
set preferences like
server group and view
all Samba users

Share name
You can set the
name for the
directory selected
above in this section

Samba share
directory
Once you click on Add file
to share, youll get a popup. In the Directory section,
just browse and select the
directory youd like to share

Standard
toolbar
Here you have
quick links to
settings, add file
and help options

Description
Set the
description
for the shared
directory here

Shared files

Permissions

Here you can see the list


of all the files available
under Samba sharing

Save or
cancel changes

If youd like the directory


you are sharing to be
writable/visible, just tick the
corresponding checkboxes

Click OK to save the changes to


the Samba configuration file and
start sharing. If you hit Cancel,
the changes are discarded

The default Ubuntu file manager Nautilus


offers an easy-to-use interface to help
you share files across systems. Behind the
scenes, however, Samba is running the show.
Samba is a software suite for seamless file and print
services. It implements the Server Message Block
(SMB)/Common Internet File System (CIFS) protocol for
Unix systems, supporting file and printer sharing across
Windows, OS X and other Unix systems.

40 The Ubuntu Book

Samba is freely available, unlike other SMB/CIFS


implementations, and so is widely used on various
systems. You can facilitate the file sharing between
Ubuntu and Windows computers by configuring Samba
as a file server on one of the systems.
Samba can do several other things including acting
as a server for SMB clients: you can share printers,
including PDF pseudo-printers so all the computers
in your network may write PDF files. Samba can also

act as a domain controller in a Windows network


(authenticating users, and so on) and even help using a
Windows domain controller to authenticate the users of
a Linux/Unix machine. However we will focus only on the
file sharing aspect of Samba in this feature.
Samba is not installed by default in Ubuntu 15.10 and
so to start file sharing youll have to install Samba. Well
see the installation process and the steps to set up file
sharing in next sections.

Sharing files in Ubuntu

Tutorial

Learn to set up a Samba client and server

something that better matches your environment. Then,


to share a directory, create a new section at the bottom
of the file, or uncomment one of the examples:

[share]
comment = Ubuntu File Server Share
path = /srv/samba/share
browsable = yes
guest ok = yes
read only = no
create mask = 0755
Lets look at the meaning of each section
comment: a short description of the share. You can
adjust it to fit your needs.

01

Samba server configuration

To share a directory, you must have


permission to access the directory. For
demonstration purposes, lets take a folder from the
users home directory, such as Documents.
Go to your home directory. Right-click on the
Documents directory and in the pop-up menu,
select Local Network Share. Then check the Share
this folder checkbox. If Samba is not installed,
you will get a pop-up menu: Sharing service is not
installed. Select Install additional software and
then click Install. If you get an error message that the
samba .deb could not be found, open a terminal and
update apt-get like this:

$ sudo apt-get update


Try again and Ubuntu will download and install
Samba. Lets try sharing the folder again. Rightclick on the Documents directory and in the pop-up
menu, select Local Network Share. Next, check the
Share this folder checkbox. And then click the Share
button. Thats it; the directory should now be shared
and accessible from Samba clients. You can also
install Samba GUI for Ubuntu. Just type:

$ sudo apt-get install system-config-samba

02

Samba clients

Ubuntu and Gnome make it easy to access


files from a Samba server share. To start with, go to
the files explorer and locate the Browse Network link
on the left vertical menu bar. Open this link and you will
see a Windows network icon. Double-click to open it.
The next window shows all the domains/workgroups
found on your network. Inside each domain/workgroup
you will see all the computers on the domain/
workgroup with sharing enabled. Double-click on a
computer icon to access its shares and files.

03

Samba configuration file

We have learnt about sharing files via the


GUI, but directly editing the configuration file gives
you several more options and flexibility to implement
things exactly how you want to. So, let us now learn
how to enable sharing via the configuration file.
The main Samba configuration file is located in
/etc/samba/smb.conf. The default configuration file
has a significant amount of comments in order to
document various configuration directives. First, edit
the following key/value pairs in the [global] section
of the config file.

Workgroup = EXAMPLE
Security = user

path: the path to the directory to share. This example


uses /srv/samba/sharename because, according to
the Filesystem Hierarchy Standard (FHS), /srv is where
site-specific data should be served. Technically, Samba
shares can be placed anywhere on the file system as
long as the permissions are correct, but adhering to
standards is recommended.
browsable: enables Windows clients to browse the
shared directory using Windows Explorer.
guest ok: allows clients to connect to the share without
supplying a password.
read only: determines if the share is read only or if write
privileges are granted. Write privileges are allowed only
when the value is no, as is seen in this example. If the
value is yes, then access to the share is read only.
create mask: determines the permissions new files will
have when created.
Now Samba is configured, the directory needs to be
created and permissions changed. In a terminal, enter:

$ sudo mkdir -p /srv/samba/share


$ sudo chown nobody:nogroup /srv/samba/share/
Finally, restart Samba to enable the new configuration:

or search for Samba in the Ubuntu Software Centre


and install it from there. Once installed, just search
Dash for system-config-samba.

Note that the security parameter is further down in


the [global] section, and is commented by default.
Also, change the workgroup value from EXAMPLE to

$ sudo restart smbd


$ sudo restart nmbd
The Ubuntu Book 41

Ubuntu essentials

Manage drives with Disks

Manage hard drives, SSDs and removable media with Ubuntus Disks tool

Manage your drives

Disks offers a very neat layout with lots of powerful features

See what is connected

Linux filesystem

More details

Disks shows you all connected


drives that it can support (and that
is almost everything). The Devices
bar lets you select multiple drives
and apply some actions to multiple
drives at a time

Here you can see the drive name as well


as its size. The bold label shows you the
total capacity of the currently selected
drive, while the next line shows the name
of the drive, which you can address in
console commands

These helpful five lines


show you the selected
drives model, size in bytes,
partitioning type (MBR or
GPT), serial number and
assessment information

Extra
features

Separate controls for each partition

Partition details

Volumes count and drive structure

This tiny button only works for the currently


selected partition. It actually lets you
unmount or deactivate a partition and
provide a set of options for formatting,
removing and benchmarking

Once you select a partition, you can


see its name, size, available free space,
filesystem type and mountpoint. Click
the link to open the partition contents in
Ubuntus file manager

Here you can find out how your drive


is partitioned, whether there are any
extended volumes or a swap partition. The
size of the rectangles corresponds to the
size of the respective partitions

Ubuntu has a marvellous tool for managing


both local and removable drives,
repartitioning them as well as doing backup
images and restoring from them. The application has
a concise name Disks and it copies the very successful
design and approach of the Disk Utility in OS X.
It is quite a straightforward tool with device list on the
left and the currently selected devices details on the
right. With Disks you can find out the model and size of

42 The Ubuntu Book

your hard drive, how many partitions it has, its serial


number, health status (SMART) and some other details.
Users often launch Disks in Ubuntu when they need to
do some manipulations with the hard drives, SSDs or
removable mass storage with the USB interface. Disks
is very helpful thanks to its illustrative visualisation of
a drives volumes. If you are not aware about Primary
or Extended partitions, you will instantly catch the
idea after looking at the graphical scheme under the

The gear
button hides
lots of extra
features,
including
options for
creating and
restoring
disk images,
benchmarking
tool, drive
settings
dialog and if
supported,
SMART
self-tests

Volumes label in Disks. You can do many advanced


things with a few mouse clicks, such as benchmark
your drive, put it in a standby mode, create or delete
partitions and much more.
Another tool in Disks is its ability to create images
from drives (*.img) and to restore such images into
other drives. This feature lets you clone all data, logical
structure and a bootloader to, say, a newly acquired
hard drive that you wish to use as a replacement drive.

Manage drives with Disks

Tutorial

01

Perform basic diagnostic and management tasks with your drives

Format a USB portable drive

Sometimes new hard drives arrive with


no partitions at all and Disks will show them as a
monotonous rectangle labelled as Unknown. You
may now choose what you want to do: if you go with
an upper gear button and format the whole disk,
you will only create a partition table, not volumes.
There is the legacy MBR (Master Boot Record) type,
and the modern GPT (GUID Partition Table). The
first one is compatible with everything, the other is
required by new PCs with UEFI boot and also by large
disks (>2TB). Next, you may want to create the actual
volume by clicking on a volume-specific gear button
below and again choosing the Format option. If you
plan to access your disk from Windows, use the NTFS
filesystem. Otherwise, for Linux-only usage, the best
option would be to go with Ext4.

02

Benchmark your drive

Conducting performance tests is fun but


challenging, especially for non tech-savvy users.
The Disks application in Ubuntu has a built-in tool
that means you can benchmark your drive for
read and write speed at any time. First you need to
unmount either all volumes (for the whole drive),
or a volume youd like to test. For that reason, you
cannot benchmark the root partition of your current
Ubuntu system, but there are no other limitations for
the rest. Click on the gear tab and select the Start
Benchmark option and then Start Benchmarking.
Youll get a graph with the red curve for average
write rate, blue curve for read rate and green spots
for access time. It can help you detect a dying drive
before it is too late, and also to compare real-world
specs of the newly bought drive with its whitepaper.

03

Adjust drive standby settings

04

Create an image and restore from it

Drive settings can be sensitive to both


desktop and laptop computers. Putting a drive into
standby mode not only helps save some watts but
also reduces heating, and even makes the system
quieter. Regardless of the default behaviour of your
drive in Ubuntu, you can explicitly set it to go to sleep
after a certain amount of time. Click on the gear
icon and go to Drive Settings, where you can move
the Apply Standby Timeout Settings switcher to
the on position. Now you drag the slider and set the
preferred timeout value, after which the drive will go
on to standby. Similarly, you can decide whether you
want to enable or disable write caching just go to
the Write Cache tab and choose the desired mode.
When caching is enabled, your drive works faster but
may get corrupt your files in case of power outage.

A hard drive image is a very handy thing


compared to plain file backups. It stores all drive
structure, bootloader records and all other drive
details, letting you replicate your setup onto another
physical drive. Again, in case of an ageing drive, which
you feel can break at any time, theres no better way
to save it other than create an image. Depending on
what gear button you use, you can either create
an image of the whole drive, or just the current
partition. When you choose the Create Disk Image
option, Disks will prompt you to choose a destination
directory for the image file. Note that it must be
saved on another physical drive. Later on youll be
able to restore the drive form the image file using the
Restore Disk Image option.

The Ubuntu Book 43

Ubuntu essentials

Commanding Ubuntu: get to grips


with the Linux command line
Sometimes well-chosen words will save you jumping through GUI hoops
we set you on the path to the right commands

ave you been avoiding the inscrutable blinking


cursor of the command line, convinced
its a relic of the past, of no use on todays
computers? The command line may be an older
interface, but the reason its survived is the power to
tell the computer, in a few apposite commands, exactly
what you want. For example, a single command can
copy all of the MP3 and MP4 files in a directory to a
backup disk or a machine elsewhere on the network or
anywhere else on the internet.
Many peoples first encounter with a computer
perhaps at university in the 1970s or 1980s was seated

44 The Ubuntu Book

at a dumb terminal, known as a console, connected


to a distant, and very large, computer. Nowadays,
computers can be the size of a credit card like the
Raspberry Pi but the old-fashioned terminal is
remembered in the form of the terminal program that
gives you a command-line interface to Ubuntu.
Depending on which flavour of Ubuntu you are
running, the terminal may have a different name,
but type term into the app search of Unity Shell, or
your menu, and you will bring up at least one choice
of terminal. Open this and youll see a fairly emptylooking window.

Dont be scared of that blinking cursor usually


the $ sign, known as the dollar prompt. Its waiting to
do whatever you tell it. You just need to know the right
words: read on and youll soon tell that terminal whos
boss. Heres an easy one for you to try first, though: type
evince into the terminal - well put the instructions you
need to type into bold, so you can see commands more
clearly; always press Enter afterwards, to let Ubuntu
know its now got to do something.
Provided you didnt mistype, youll have just opened
Ubuntus PDF reader, without using a GUI menu or
shortcut item.

Commanding Ubuntu
Left The mv command is
used to move files from
one location to another

Files, folders,
and familiar
things
Time to get the command
line working for you, on
your files and folders
To look inside your Documents folder, open a
terminal and type in ls Documents.
Dont forget to press Enter! Youll see a listing of all
of the files in Documents. Type ls and youll see a
listing of the files in your home directory thats
because when you open a terminal, it places you in
that directory. You can change by using the change
directory command cd like this: cd Documents.
Now ls alone will show you your files.
The cd - command will take you back, because
the - is a shortcut to tell cd to go back to where
you were before. You could also type cd ~, as ~ is
short for your home folder /home/jo/ or whatever.
pwd will remind you where you are now.
Configuration files the ones called dotfiles,
because their names are prefixed by a dot are
normally hidden from listing. In most file managers
you can toggle them into view with Ctrl+H (on a few,
its Ctrl+.). At the terminal, its ls -a.
The . and .. are shortcuts to this directory and
parent directory, or the one above hide them
by using -A in place of -a. Those letters after the
hyphen are called command-line switches: try
ls -l, for long listing. Well tell you about some of
that cryptic-looking info it displays later.
Moving and copying files uses mv and cp well
see cp in use overleaf, but for now type:

Left The grep command


enables you to search for
terms inside files

Left Most commands


have manuals, accessed
with the man command

cd ~
touch random.txt
mv random.txt newname.txt
mv newname.txt Documents/
ls
ls Documents

Tab complete
If you think thats a lot of typing, try hitting the
Tab key after a couple of letters of each word.
Where theres only a single possible completion,
the word will be automatically filled in. Two tab
clicks brings up suggestions where there are
multiple possibilities.
If you want to know more about a command, they
(almost) all have manuals or man pages. man ls
will tell you all about options for ls; man man will tell
you about the manual command itself.

Look inside
You dont need to open an application to look inside a file.
The file command will let you see what sort of file it is. cat
sends the contents of the file scrolling by, or more gives
them to you a page at a time. less does the same thing,
with more controls, and leaves you stuck if you dont know
to press Q to quit. Q will also exit man pages; for other
apps, Ctrl+C is a good bet for quitting.

Sometimes you just want to see the first or last few lines
of a file head and tail are the commands you need, each
defaulting to ten lines. tail -n 30 /var/log/syslog
shows you the last 30 things registered by that log file.
Real power comes with grep, to search for a term inside
a file. Try grep ls ~/.bash_history to pull out all the
instances of ls that you have used so far.

The Ubuntu Book 45

Ubuntu essentials

inactive (said to be commented out) remove the #


to get one to work next time you log in or open a new
terminal session.
You can use the arrows to navigate to the text you
want to edit; delete and type in new text as required.
Nothing too strange so far, until youve finished: note
those two lines at the bottom of letters preceded by
a ^ (caret). These are the keyboard commands the ^
represents the Ctrl key type ^O (hold down the Ctrl key
and hit O), and your work will be saved; hit ^X and youll
exit Nano.
You can set a temporary alias directly, which will last
until you close the terminal:

alias myplace=ls -lAhF /home/richard/

Permissions, please
Ubuntu files are protected from alterations by other
users on a shared machine. All files and folders belong
to a user it doesnt have to be a person, it could be
a piece of software, like a web server and a group;
permissions on each file relate to whether a user, group
or anyone else can read, write or execute the file; this
is abbreviated as rwx permissions. For directories,
execute permission is just permission to open. Execute
a file means run it as a program so a JPG picture file
doesnt have permission to run, nor does a spreadsheet
file, meaning the embedding inside one of malicious
code is much harder to accomplish for virus writers.
From whichever directory you are currently in, create
an empty file touch testfile will do the trick then
ls -l. The long listing shows you permissions (see the
annotated screenshot on the right), and you can see
the default permissions of a newly created file. Enter
mkdir testfolder and you can see the permissions
of a newly created directory. Remove the file with
rm testfile youll need the recursive switch to
remove a directory: rm -r testfolder.

No attachment?

Above Nano isnt the friendliest text editor, but its included
in Ubuntu and most other Linux distros by default

46 The Ubuntu Book

Using Nano

While the protection offered by permissions is very


useful, they are also there to trip up the unwary. For
example, using sudo, you may have copied files from
another users home folder. Unless you change the
ownership (see the annotated screenshot), you may be
left scratching your head when you try to attach the files
to an email, and they just wont stick because you dont
even have permission to read the files!

Looking inside a file is all very well, but often we need to


quickly change something inside it. Were going to use
Nano, a command-line text editor. There are many more
powerful editors and many a little friendlier, too but
Nano is included in Ubuntu, and many other flavours of
Linux, so its handy to know the basics.
Well edit the ~/.bashrc file, a collection of
customisations for the shell environment; dont worry
that much of it wont yet make sense. To offset the risk of
damage to your command environment, back up the file
first: cp .bashrc .bashrc.bak then nano .bashrc.
Find the section with the alias commands near the
end. Note that the ones with a # in front of them are

Ubuntu files are


protected from
alterationsby other users
on a shared machine.
Allfiles and folders
belong to a user

Commanding Ubuntu

Who owns what? Permission to change


Octal code
The rwx read
/ write / execute
permissions are
given respective
values of 4, 2 and
1. To give a file read
+ write + execute
permissions, 4, 2
and 1 are added to
give 7. For just read
and execute, 4 + 1
= 5. Applying the
former to user and
group, and the latter
to other, chmod 755
file.txt.

Long listing
Running ls -l lets you see
who owns a file or folder,
and who has permission
to read, write and run
software. Three groups
of rwx in the listing apply,
respectively, to the named
user, the named group, and
everyone else left

Give me the file


If youve copied a
file into your folder
using sudo, you may
have left it with root
ownership. Change
the ownership with

Run with it

chown jo myfile.txt

A file becomes a program when it


can be run. You write or download
a shell script, say backup.sh, and
try to run it - ./backup.sh and
nothing happens. You need to give
it executable positions: to save the
octal adding, you can just chmod
u+x backup.sh. You can also call it
with sh backup.sh.

for example and


the group with chown
:audio myfile.mp3.
Fill both sides of
the : to change
user and group
ownership together

Give me more software


Despite every flavour of Ubuntu having a graphical program
to install software onto the system, youll usually see
projects supplying the command-line way of getting their
software. The reason for this is that the command-line
instructions are direct and unambiguous. Lets try it out,
and youll see what we mean.
Ubuntu, as you may have read elsewhere within these
pages, is based upon Debian, one of the earliest GNU/
Linux distributions, dating back to 1992. Its an open
collaborative project between over a thousand developers
across the world co-operating over the Internet, which
has contributed to its longevity. So too has the Debian
package management system, and the command-line
program to manage fetching and installing the packages:
Apt the Advanced Package Tool keeps track of all of
the software in Ubuntus repositories, and takes care of
any dependencies on other packages when you install. Its
what the Ubuntu Software Centre uses behind the curtain
of that graphical interface.
Every step that involves installing software on your
system needs root, or superuser, permissions: on Ubuntu

this is done by prefixing the command with sudo. On


some other systems you would log in as root user: you
can temporarily do this on Ubuntu by running sudo -s or
sudo bash, but we dont recommend it, as its easy to get
into the habit of running with root permissions, and to
accidentally cause some damage.
Update Ubuntus knowledge of the latest available
packages with sudo apt-get update.
You can look under /etc/apt/ to see the source files
where Ubuntu remembers which repositories to look in:
you can edit these manually to add more, and to change
version for upgrading (proceed with care!), but the simplest
way to add a new repository is with apt-add-repository:
sudo apt-add-repository ppa:jon-hedgerows/get-iplayer.
After which youll need to run sudo apt-get update again,
before installing from the repository: sudo apt-get install
get-iplayer. The get-iplayer script is a command-line
piece of software for timeshifting BBC radio (and TV)
programmes; apt-get upgrade will install all of the security
updates and bugfixes that have been made recently this
is something you should run regularly (but to save you the

trouble, Ubuntu tells you that updates are available, and


regularly asks permission to get them). Run apt-cache
search terminal to find alternative terminal programs, and
apt-cache show eterm to examine one of them. Now you
know the basics, explore a little more.

The Ubuntu Book 47

Ubuntu essentials

Use GNOME Terminal & Xterm

Explore the basics and benefits of the terminal emulators in Ubuntu

Save yourself time

Working with terminal emulators is easier than you think


Try a fail-safe solution
Xterm is relatively old, however, it
delivers a pure Bash experience without
any bells and whistles. Xterm comes
in every OS that uses X.org (all Linux
distros do)

Edit your
terminal profile

Non-distracting
scrollbars

Change the title,


cursor shape, scrolling
options and command
behaviour, as well as
colours, fonts, some
historic legacy stuff
(like Backspace and
Delete-key behaviour)
and more

GNOME Terminal drew


ugly, thick scrollbars in
the past. Sometime later,
Canonical applied its
overlay bars, and removed
the 1-pixel outline around
the terminal frame

Enjoy the convenience of


GNOME Terminal

The icon says it all


You will never confuse Xterm with
any other terminal emulator thanks
to that distinctive icon, boasting
support for 256 colours on that
expressive cathode-tube display

It may seem surprising, but Ubuntu ships


with two terminal emulators. One is
GNOME Terminal, a widely used program
and probably the only known terminal application
for many Ubuntu users. GNOME Terminal is one of
many GTK-based apps that Unity desktop shares with
GNOME Shell many tools and accessories are the
same in Unity and GNOME. GNOME terminal looks
clean and minimalist, but it has enough settings that

48 The Ubuntu Book

GNOME Terminal fits well into the Ubuntu


design with its recognisable Ubuntu Mono
font and deep-purple background. However,
you can change these and other settings
with several mouse clicks
let you configure this small application according
to your needs and tastes. Choose Edit>Profile
Preferences to edit the current Default profile for
the sake of different behaviour or a custom look and
feel. GNOME Terminal makes interaction comfortable
between graphical applications and the Bash shell
thanks to the support of drag and drop for text strings,
copy and paste with both keystrokes and context
menus, and mouse scrolling in terminal mode.

Xterm is entirely different; it is a tiny, old-school


thing that hasnt changed much since 1984, and was
initially developed before the X Window System saw
the light. Xterm uses the same Bash shell as GNOME
Terminal does, so the commands behave in exactly the
same way in both terminals. Xterm turns out to be very
helpful in case of an emergency; if your main desktop
fails to load and you just need to get to graphical mode,
use something like $ xinit xterm. It never breaks!

Use GNOME Terminal & Xterm

Tutorial

01

Start working in command-line mode

Change Bash to something else

Every Linux distribution uses Bash (Bourneagain shell) in text mode and graphical mode within
a terminal emulator, including Xterm and GNOME
Terminal. Bash
has a very rich set of supported
commands, but the most useful feature comes from its
popularity; all Linux users use their terminals with the
same syntax. However, there are other shells such as
a highly customisable ZSH with an even wider feature
set, or CSH with a built-in scripting language that
have similarities with the C language. To change the
default shell from Bash to something else in GNOME
Terminal, go to Edit>Profile Preferences, switch to the
Title and Command tab, enable the Run a custom
command instead of my shell option and put the name
of your desired shell in the Custom Command field.

02

Change fonts, colours and background

Lets make the GNOME Terminal look a


little more personal by changing text font, colour
and background. Go to Edit>Profile Preferences
and switch to the Colors tab. Uncheck the Use
colors from my system theme option and choose
any combination of colours for text, text in bold and
background. There is a list of good presets in the
Built-in schemes drop-down menu; it can save
you from an agony of choosing. To change the font

itself, go to the General tab and uncheck the Use the


system fixed width font. After that, youll be able to
select another Mono font.

03

Learn some helpful shortcuts

Knowing tricks for GNOME Terminal in


Ubuntu can save time and increase productivity. We
start with the simplest: launch the application using
the Ctrl+Alt+T sequence anywhere in Unity. When
browsing your files in Nautilus, it is useful to open a
terminal window for the current directory. Nautilus
can do it once you right-click on an empty space
within a view area and select Open in Terminal, but
this feature is not enabled by default in Ubuntu. Fix it
with this command:

$ sudo apt-get install nautilus-open-terminal


then restart the file manager.
When you need to copy or paste text, use Ctrl+Ins
and Shift+Ins respectively, instead of right-clicking
menus. To clear the input, you can either cancel a
command with Ctrl+C, or clear what has been written
with Alt+R.

04

jokes that bring in some fun and help you to feel more
comfortable in the terminal. Start with $ sudo apt-get
install moo to bring up a jolly cow, find another Easter
egg with $ aptitiude moo and then $ aptitude --v moo
and add an extra v three more times to see a snake
that has eaten an elephant. The $ sl shows a steam
locomotive and finally the $ fortune | cowsay shows a
cow that tells your fortune. However, to finish up, lets
do something massive and change our boring GNOME
Terminal to a Hollywood Technodrama showcase,
mimicking an FBI command centre:

Have some fun

Working in the terminal goes long into the


history of Linux and UNIX, so its no wonder we have
a decent number of discovered Easter eggs and

sudo apt-add-repository ppa:hollywood/ppa


sudo apt-get update
sudo apt-get install Hollywood
The Ubuntu Book 49

Ubuntu essentials

Secure files with Dj Dup


Create an extra copy of your valuable data and keep it updated

Secure your data quickly

Dj Dup is an intuitive app for managing backed up files

Check destination

Decide to go more secured

Dj Dup stores backed up files in


the form of archived files that can
be handled with the Duplicity utility.
You cant extract the files with a
regular unarchiver

When a backup process starts,


the wizard prompts you to set a
password. You may choose to protect
your backup copy with it, or opt to go
without any passwords

Set up scheduling

Proceed with
important
routines

Here you can select


the frequency of
regular automatic
backups. Depending
on your workflow,
choose daily or weekly
backups and also set
the time for keeping
older backup copies

Choose where you want


to store a backup copy
and optionally define
what directories you
want to ignore and not
include in the backup

Overview your backup

Choose manual or auto mode

The starting screen in Dj Dup shows


when the last backup copy was made and
when the nearest next backup will take
place. Theres also a link that triggers the
automatic backups switch

By default, Dj Dup doesnt enable


automatic backups right away, but you
can trigger this switch and if you set the
rest of the routine correctly, youll get
unattended backups

Having a backup copy of your photos,


documents, music and video files is a
high priority to keep them safe, even
though some novice users opt to skip it. Imagine that
something has gone wrong with your hard drive and
it can no longer boot up. The bad news is that while
you can buy a new hard drive, you may well lose your
data on the old one, which is often more precious than
any hardware. So here comes the finest hour for your

50 The Ubuntu Book

backup copy that you have prepared beforehand and


kept updating regularly. Theres no excuse not to do that,
since Ubuntu includes a great tool for automatic and
hassle-free backups called Dj Dup also known by
the simpler name, Backups.
Using Dj Dup is simple as it can be: you choose
what you want to back up and where, optionally tell what
directories it should skip and then put the task into the
automatic queue of the Ubuntu scheduler, which can

perform backups periodically and even keep new and


older backups at the same time. The interface of Dj
Dup has a category tree on the left and a main part
to the right, with a clear arrangement of easy-to-use
controls. The default setup assumes you might want
to back up your ~/home directory with an exception for
Trash and ~/Downloads, so you may leave it intact and
go ahead with this safe assumption, or opt to customise
the list of included and ignored directories to your liking.

Secure files with Dj Dup

Tutorial

01

Set up your backup the right way with Dj Dup

Choose what you need to backup

Common things that people often need to


back up are photos, videos, office documents and
application settings. While this is true for home
computers, let us also complement this with targets
that are more relevant to production servers and
corporate usage in general, such as databases,
dumps, and collected data files and so on. To be
on the safe side, you should evaluate the size of
the proposed backup beforehand and make sure it
fits the target storage. Youll definitely need extra
space if you do incremental backups, or decide to
include directories like ~/Downloads that usually get
populated with lots of large files.

02

Choose a destination

If you store a backup copy on the same


drive with the original files, it can only save you from
accidental deletion, which is not the only threat to
your data. It is highly recommended to save backups
to another physical drive or disk and so protect
yourself from main hard drive failure. For frequent
incremental backups, external hard drives are known
to work better compared with flash drives the
latter have a limited lifetime and dont like too many
overwrites. You can also use a remote destination via
SSH, WebDAV or Windows shared folder choose the
right place in the Storage Location menu.

03

Make a test restore

04

Access a backup copy outside


Dj Dup

Nobody knows when things will go wrong, but


to protect yourself from that sinking feeling when you
discover that your backups are broken, go for a test
restore at the very beginning. Its a good idea to set up
a small backup task and run it. After that, go to the
Overview section and press the Restore button. Dj
Dup will guide you with a simple wizard, where youll be
able to choose the location of a backup and then select
a date, from which a copy will be derived. Go ahead
with a real-world backup if everything restores fine.

Dj Dup has a known limitation: it is an all or nothing


tool, meaning that you will not be able to extract only
some of your backed up files and directories. Instead,
each time, you are forced to copy or download the
entire backup snapshot. To solve this issue, use the
Restore missing files item in the Nautilus context
menu. This option works for directories that have
been included in the backup and lets you restore
individual files. Also, Dj Dup is a front-end to the
Duplicity utility, and this lets you extract your backup
snapshot without launching Dj Dup at all. It can be
useful for scripting, or maybe when you access your
backup location remotely via SSH. The syntax for
extracting is as follows:

$ duplicity restore --no-encryption file:///


path/to/ snapshot /where/to/extract
The Duplicity syntax also can extract individual
backed up items (see $ duplicity --help).

05

Back up to the cloud

The simplest way is to use your Dropbox,


MEGASync or other cloud-synced directory as the
backup location. This way, your data will be uploaded
to the cloud once Dj Dup finishes its job. However,
lets do direct online backups, such as to the Amazon
S3 cloud. To make it happen, you only need a proper
account at Amazon and a few extra packages:

$ sudo apt-get install python-boto pythoncloudfiles


After that, the list of available storage locations will be
complemented by Amazon S3 and Rackspace cloud.

The Ubuntu Book 51

Ubuntu essentials

Use Startup Disk Creator


Create a bootable USB with Ubuntu or virtually any other Linux

Get a live Ubuntu system

Use a regular USB flash drive or any mass-storage device

Select the source

Operating system version

Mind the size

Here is the list of source disc


images (.iso) and CD/DVD discs
found on your system. Startup
Disk Creator automatically
updates the list

Sometimes its not clear exactly which


version of a system is inside an ISO, or
what is on that unlabelled optical disc.
The column entitled OS Version extracts
necessary details

The last column here indicates the size of


the source media. It shows the exact weight
of the ISO file, but defaults to the total
capacity of CDs and DVDs no matter how
many megabytes are actually there

Select the
disk to use
Startup Disk Creator
displays available
target USB drives here.
When you plug it in, the
application detects it
automatically and adds
it to the list

Choose an
image file
If you want your ISO
image to appear in
the list, click the
Other button and
select the image
file. By the way, it
also supports disk
images (.img)

Storage persistence

Copy the files

Capacity and free space

A very useful feature that allows


saving all your data persistently. This
way you can turn your live Ubuntu
thumb drive into a fully featured
portable working system

Check everything one more time and


press the Make Startup Disk button.
The application will show a progress
dialog and copy the files onto the target
USB medium

You can find the total size of the media


as well as the amount of free space on it.
This feature is designed for USB sticks
that are formatted to FAT16 or FAT32 file
systems and may contain user data

The first question that would most likely


emerge here is what on Earth would you
need a startup disk for? Historically, Linux
distributions were distributed as CD discs, from which
you were supposed to install them. Later on, the age of
recordable CD/DVD discs came in and, together with
broadband Internet access, this led Linux enthusiasts
to download ISO images of their favourite Linux
distributions and burn them to blank discs. However,

52 The Ubuntu Book

such optical discs are already out of trend, with USB


thumb drives now being the sanest media. You can use
USB sticks hundreds of times with strong reliability.
In Linux you can transfer an installable ISO file to
a USB drive by the dd command. Its quite easy, but
the whole procedure isnt very conclusive for regular
users, so thats why Ubuntu offers the handy and
convenient Startup Disk Creator utility. Its features
slightly intersect with those found in Disks, but

Startup Disk Creator focuses on turning CD/DVD


discs or downloaded ISO files of installable Ubuntucompatible Linux distributions to bootable USB media,
that is it helps you move from legacy media to more
contemporary and efficient USB disks.
Startup Disk Creator also has the ability to use a
newly created USB disk as a working environment
in live mode, consequently saving all your data
persistently on a disk.

Use Startup Disk Creator

Tutorial

01

Create a bootable USB stick with Startup Disk Creator

Select the proper source

Startup Disk Creator is designed to work


with Ubuntu and a bunch of other systems that
were derived from it. For instance, here is a short
and incomplete list: Kubuntu, Linux Mint, Xubuntu,
Lubuntu,
Ultimate-Edition,
elementaryOS,
Peppermint One, Peppermint Ice, Deepin and
Zorin OS. Other flavours of Linux, especially those
non-Debian based, might not work with Startup
Disk Creator. Anyhow, if you have a free target USB
medium, testing other Linux OSs and sharing the
results will be welcome. If you have an Ubuntucompatible system on CD or DVD, it will be a good
idea to transfer it to USB and benefit from higher boot
speed, better compatibility and persistent storage.

02

Prepare the target

The most common target device is a flash


drive, also known as a USB stick or thumb drive,
external USB hard drive, an SD card or any other
memory card connected through a USB card reader.
Virtually everything that can be connected as a USB
mass-storage device in Linux will work fine, including
odd things like your smartphones internal storage.
Startup Disk Creator doesnt wipe any data from
FAT32 volumes once there is enough space there

for a source image. Although, it is recommended


to use a clean flash drive or at least format it to
avoid issues resulting from a heavy use of that flash
drive (for instance, a flash drive might suffer from
a fragmentation).

03

Create a persistence file

Drag the respective slider and define how


much persistent storage you need for your files and
settings. Startup Disk Creator will create a persistent
storage file of an appropriate size and merge it with
the root file system in the live system. Changes in
the /home directory, downloads and other files
added or removed from within the live system will be
preserved after reboot. The same works for systemwide components, for example you can install extra
software or remove something unnecessary and keep
it after shutting down or rebooting the live OS. This
makes your live USB stick a fully fledged portable OS.
At the same time, the device will still be readable and
accessible from Windows or other non-Linux OSs.

04

Go for a test drive

When you are done with setting things up,


and the file copying dialog finishes successfully,
reboot and select your USB medium as a boot device.

Startup Disk Creator adds the Ubuntu bootloader


to the FAT32 volume of your USB medium, so that it
can boot Ubuntu. The experience doesnt vary much
between an OS written with Startup Disk Creator
and with a classic live mode achieved with the dd
command. The only visible difference is that you can
have persistent storage, even though it is limited with
4GB this is a maximum file size in FAT32.
You can write some files or folders on your USB
medium in Windows (or elsewhere), then boot from it
and find your files safe and intact.

The Ubuntu Book 53

Ubuntu essentials

Check the Time & Date

View the calendar, change time display settings and more

Ubuntu takes time and date from the


firmware settings of your computer and,
if necessary, automatically adjusts it
with respect to time zone and locale set when you
install Ubuntu. The time format may be 24-hour or 12hour with AM/PM indication, or look different in other

ways depending on your system-wide locale. Locale


is a regional setting which affects the displayed time
format, but it should not be confused with the interface
language you can have any combination of both.
If you click on the time, a panel rolls out with more
details. It starts with a label containing the day of the

week and full date, followed by the calendar grid. Below


the calendar is the name of your current time zone and
the current time. It may look excessive, but at least it
keeps things clear. Also, if you change time and date
settings to display more than one time zone, you will
easily be able to see what the time is where.

Calendar
When you click on the time, the calendar appears with the current date highlighted.
The first row has a slightly different colour in the background and indicates the threeletter names of the days of the week. The calendar lets you see the month with one
easy glance and you can highlight any date simply by clicking on it. It is also helpful
when it comes to rewinding to an earlier date or browsing future months and years.
Note the small arrows that band the month and year headings click on the left arrow
to go back and the right to move forward; the calendar will be updated instantly.

The calendar lets you see the month


with one easy glance and you can
highlight any date simply by clicking
on it

The Clock tab

Time zone settings


The last line is a shortcut to the Time & Date section of Ubuntus System settings.
This is the place where you can change your location and choose whether you want to
set time and date manually or trust the internet service that delivers it automatically.
Usually, the latter option is preferable, because it proves that the time your Ubuntu
desktop shows is accurate, and it also helps travelling users to keep up with local
time in different locations. Sometimes, however, there is a need to enter the time and
date manually for example, when your computers system time is wrong and you are
not connected to the internet. The map, which occupies the most of the tabs area, is
responsive to mouse clicks: you can click on the location you are currently at and see
the name of the corresponding time zone.
The Time & Date window has two tabs: one for adjusting time and date, and another
for changing clock settings.

54 The Ubuntu Book

There are many useful checkboxes that affect the time display format. The most
obvious option, Show a clock in the menu bar does what it says, so you can remove
the time indicator from the Ubuntu panel entirely. The rest of the settings are divided
in two groups: what youd like to see in the clock and in the clocks menu. There are no
limitations on what exact combination of checkboxes you can use. You can add weekday,
date and month or seconds directly to the system top bar and choose the clock format.
For the clock menu, there is the Monthly calendar switch, which turns calendar display
on and off, and also a few other useful checkboxes for showing time in auto-detected
locations and adding extra locations by hand. Plus, if you happen to use the Evolution
mail application with its built-in calendar feature, youll be able to display calendar
events right in the clock menu were currently in note the Coming events from the
Evolution Calendar checkbox, which is currently greyed out.

Unleash the Archive Manager

Unleash the Archive Manager

Make use of this small accessory that sits inside your Ubuntu system

Archive Manager is a small tool for opening


compressed files and creating your own
archives. Years ago, when people had small
hard drives, Archive Manager was king of the hill. Its still
an important part of the standard desktop experience,
simply because every other time we need to unpack

downloaded archives or combine many files into one,


the easiest way to do it is to use Archive Manager.
The standard Ubuntu Archive Manager follows the
general naming policy and therefore doesnt have any
special name (together with Disks, Backups and so
on). However, Ubuntu had taken it from the GNOME

desktop, where the archive manager is called File Roller.


You can check it out by launching the $ file-roller
command in the terminal in Ubuntu. When launched
separately, the File Roller interface looks quite empty,
because it is designed to show an archives content in
the largest area of its window.

Create an archive
The reason why you may need to create an archive can vary. Firstly, an archived file
is always smaller than the original one, so the simplest goal is to save some disk
space. This doesnt help much with photos and videos, because they are already
compressed and so adding them to an archive doesnt save much space. However,
office documents or uncompressed media files (DOC, XLS, WAV, TIFF and so on) show
a splendid compression ratio, up to 90-95%. Secondly, archiving merges many files
into one archive, which is very convenient. For instance, copying a thousand of small
files can take a long time (it drives most file systems crazy), but when compressed into
an archive, you will wait for just a couple of seconds. To transfer files with symlinks and
UNIX-specific attributes (like permissions and extra flags) to a FAT32 or NTFS volume,
you should also archive such files first.
Compress any file or directory using the Compress item in the right-click menu of an
item, or use the respective feature inside File Roller.

Copying a thousand small files can


take a long while (and it drives most file
systems crazy), but when compressed
into an archive, you will wait just a
couple of seconds
Make use of extra features
Open or view an archive
Opening an archive is simple: just double-click it or use the Open with Archive
Manager item in the right-click menu of an archive. If its icon looks like a box, it
means that most probably such an archive will be supported. File Roller supports
ZIP, RAR, GZIP, BZIP. 7Z, JAR, XZ and many other formats, for both opening and
compressing, and also AR and ISO formats in read-only mode. You can also go the
other way around: open the empty File Roller window and use its Open button to
browse and select an archive.
There is a difference between opening and viewing an archive. While it is clear
what the first one means, the second lets you look through the entire list of files
and see the whole archives content in a single view. For instance, if there are many
subdirectories in your archive, you may want to select View>View All Files and see
everything as a single list. File Roller adds the extra Location column to help you see
which file is where.

File Roller has some extra features and boasts fine integration with the Ubuntu file
manager, Nautilus. This means that you can extract any supported archive simply
by right-clicking it and selecting Extract Here from the menu. You can also dragand-drop files and directories from Nautilus to the File Roller window in order to
add them to an archive. The application will prompt you for an archive name and
offer advanced options that include password protection (ZIP and CBZ only). You
can protect just the files and directories, so it will be possible to view the list of files
inside an archive, but in order to open or extract anything from such archive, one
must provide a proper password. You can also protect the list of the archives files
and directories, or split an archive into parts of fixed size.

When we need to unpack archives or


combine many files into one, the easiest
way to do it is to use Archive Manager
The Ubuntu Book 55

Ubuntu essentials

Use the Disk Usage Analyzer

Find out where your free disk space went with a specialised accessory

Files and directories tend to grow and


occupy a large amount of disk space. These
days even a couple of terabytes will run low
once you decide to keep your movie collection there.
Sometimes you dont pay enough attention to how
much you are actually downloading, copying or storing,

meaning that your hard drive gets cluttered with lots of


files, draining your free space.
Disk Usage Analyzer, also known as Baobab, is a
tool that comes within a standard Ubuntu desktop.
It analyses any directory you throw at it and shows
a colourful ring chart, where the size of each slice

corresponds to a size of the respective subdirectory.


This is a beautiful graphical representation with instant
usefulness, letting you know what on your drive is using
the most space. Sometimes it can be as simple as an
overfilled temporary directory, or a giant log file, or just
your media library that grew too fast.

Get instant results

Dive into statistics

Launch Disk Usage Analyzer by searching for this name or Baobab in Ubuntu Dash.
After it launches, you will be presented with a list of devices and locations.
If a drive is mounted, it will be included in the statistics of your root partition. For
example, if you mount a 4TB drive within a relatively small root partition (say, 20GB),
the resulting ring chart will show your system directories within a hair-thin slice. For
that reason, you will need to unmount any external media if you want to analyse what
Ubuntu itself consists of.
To get a structure of your home directory simply click its icon and wait while until
Disk Usage Analyzer completes its job this can take some time depending on how
many files there are.

There are no limitations with which directory you want to analyse. Disk Usage Analyzer
lets you open any directory, be it a local or remote one. Click the small gear icon in the
top-right corner to open the desired location. If it is a remote one, please use the Scan
Remote Folder option and provide the correct address, for example Samba share
addresses start with smb://.
When you see the resulting ring chart, hover your mouse over a slice to see the
details. Click a slice to dive in and set it as a top directory. The chart will adjust
automatically and you will see more details about what content inputs to overall
directory weight. The left part of the screen compliments the chart with a tree view,
with extra columns for usage percentage, size and number of items.

Switch between graphical views


This ring chart isnt the only way you can get a graphical representation of data. In the
lower right-hand corner of the application youll notice two buttons that let you switch
between ring chart and treemap modes. Treemap is an alternative method of data
visualisation with a strong focus on the size of units.
The main difference between a ring chart and a treemap is that the latter shows all
units together along with subdirectories and large files. This actually works better when

56 The Ubuntu Book

you need to estimate the relative sizes of different units. A treemap may be hard to
understand when you first look at it, but it does help when you know how its built. Disk
Usage Analyzer first draws the largest rectangle for your top-level drive or directory
and then recursively subdivides it into smaller rectangles according to the size of the
content inside. Larger rectangles display their names instantly, others will give more
information once hovered with a mouse.

Manage Startup Applications

Manage Startup Applications


Make your favourite applications start automatically in Ubuntu

Think about what you usually do once you


start up your desktop. What are your habits?
Many people have the same routines every
time they sit back in front of their computers, opening
a web browser, a personal productivity programme, or
instant messenger for example. In Ubuntu you can set

such applications to load automatically once you log in.


There is a special graphical tool for doing this, with the
self-describing name Startup Applications Properties.
Like many other small utilities in Unity, this one was
also borrowed from GNOME and retained its original
name. When you load up your shiny new Ubuntu Unity

desktop, initially your desktop will be clean with most


of the screen occupied by a wallpaper, with the main
launcher panel on the left with the application indicators
in the top bar at its far-right corner. You can actually
launch from a terminal by issuing the gnome-sessionproperties command.

Add your own applications


To add an application to the list of startup apps, click the Add button and fill in the
offered fields. Only one field is obligatory a command name and if you leave the
Name field blank, it will be filled automatically with a copy of the Command field. This
stage is where many people fail to provide the exact command for their app, so make
sure you do so. If you dont, when you click the Browse button, the file will want us to
provide it with a path to an applications executable. To solve it, simply search for the
desired application in Dash, then drag its icon to the desktop. You will then have to go
to its properties and see what is at the Basic tab. By doing this, you can find out the
startup command for any application that has a shortcut in Dash. Then you will be
able to alter the resulting list of auto-started apps by disabling or removing certain
entries. For test purposes, it is better to remove a check mark instead of deleting the
whole entry.

This stage is where many people fail to


provide the exact command for their
app, so make sure you do so
Unlock hidden features

Explore the default entries


Even after a clean Ubuntu installation, the systems autostart list already contains
some items. The GPG Password Agent is a binding between GNOME Keyring and
GnuPG agent. The first one stores your passwords and provides keys, only letting you
authorise when it is really necessary, while the second is an encryption mechanism
used for signing various things, including Ubuntu repositories and packages. SSH
Key Agent binds passwords from the sshd daemon with GNOME Keyring. When you
access remote machines via SSH, this tool can remember authorisation password
and store it in the user keyring. The Indicator Application enables Unity to display
system tray icons of various third-party programs and integrates them nicely into your
desktop. It seems that you dont really need to disable anything of the above; it will not
improve your Ubuntu performance noticeably, but may cause errors later on.

Even though there is no way for you to rearrange entries or define the order in which
they load when you start up your computer, you can make other changes with
minimum effort.
Say you want to load an application that requires immediate Internet access, but
your connection doesnt load immediately after your computer turns on and Unity
starts. You can fix it by setting the application to sleep for a while initially by adding
a command like sleep 20; (for twenty seconds) before the actual command. For
example $ sleep 20; application_executable.
There are also many small scripts and utilities that start automatically together
with the Unity desktop, but dont show up in Startup Applications Preferences. You
can bring back the hidden entries by issuing the following command:

$ sudo sed -i s/NoDisplay=true/NoDisplay=false/g /etc/xdg/


autostart/*.desktop
Some entries are specific for use in cases that you dont necessarily feel up to so
they can be safely disabled.

This tool can remember authorisation


password and store it in the user keyring.
The Indicator Application enables Unity
to display system tray icons of third-party
programs and integrates them nicely
into your desktop
The Ubuntu Book 57

Ubuntu essentials

Monitor Software & Updates

Add more application sources and keep your system up to date

Ubuntu comes with a set of pre-installed


applications and accessories, enough for
basic computing tasks and activities, such
as writing emails, browsing the web, or daily tasks
and office routines. Even though there are thousands
of other application titles available for Linux, Ubuntu has

rich repositories that actually includes the best of them.


Software & Updates is a standalone application,
which lets you customise the standard set of software
sources, configure updates and manage additional
drivers. A software source is a general term that
includes both online repositories and local media. You

can turn standard Ubuntu software source on and off,


manage third-party source and authenticate them with
signing keys.
With Nvidia or AMD graphics, you can install a
proprietary driver, but it cannot be included in Ubuntu
right away due to license restrictions.

Set up updates
Ubuntu periodically checks for its updates online and if it finds a newer version for
at least one package, a special notification pops up. In the Software & Updates
application, you can choose what updates the system looks for and how frequently
checks should be carried out. To do this, go to the Updates tab and review the list of
ticked boxes. By default, Ubuntu looks for security updates, recommended updates
for regular packages and also for backported software that is not supported by
Canonical, but contributes to the Ubuntu experience.
The next four drop down menus control the updates frequency and behaviour.
For instance, here you can program Software & Updates to download and install all
or particular updates automatically, without disturbing the user. This can be helpful
for unattended Ubuntu installation with a stable Internet connection. The last drop
down menu lets you choose whether Ubuntu should notify about any new version of
the OS itself or about long-term support version (LTS) only. If dont like to hop to newer
versions too often, stick to LTS releases.

Add or remove software sources


Standard Ubuntu repositories can be managed on the Ubuntu Software tab in
Software & Updates. It lists the Main repository, for which Canonical (the Ubuntu
maker) provides official support; the Universe repository, which is maintained by
Ubuntu community; the Multiverse repository with proprietary software; and the
Restricted one with closed-source device drivers. If you somehow need to develop
software in Ubuntu yourself, you can enable the Source repository. Below are
other helpful controls for selecting the nearest mirror (this can boost a packages
download speed) and the optional switch for Ubuntu CD/DVD with standard delivery
of packages.
The Other software tab lets you add third-party repositories and by default lists
entries within the Canonical Partners repository and the extra Independent repository
for even more software. Press the Add button to add a new repository, Edit to change
details and Remove to delete a repository. There are many additional repositories on
the Internet, but always approach with caution.

Press the Add button to add a new


repository, Edit to change details and
Remove to delete a repository. There
are many additional repositories on the
Internet, but approach with caution
58 The Ubuntu Book

Install additional drivers


A common case when Ubuntu users turn to the Additional Drivers tab in Software
& Updates is graphics drivers. Computers with Nvidia and AMD video chips are
supported in Ubuntu out of the box, but the system utilises open source drivers
(nouveau and radeon respectively), that still lag behind a proprietary driver for 3D
performance and gaming. To replace an open source driver with a proprietary one, go
to the Additional Drivers tab and wait for a while before Ubuntu discovers if there is
a proprietary driver for your hardware. It will not necessarily be a video card: dozens
of drivers for wireless networks and various firmware bits that improve system
performance cannot be shipped directly because of their licenses.
Once you decide to go with one or several non-free drivers, simply select them
and press the Apply Changes button. Ubuntu will download all required files in the
background and install drivers automatically. You will then need to logout and log back
in, or better, restart the system.

Once you decide to go with one or


several non-free drivers, simply select
them and press Apply Changes

Work with Universal Access

Work with Universal Access

Configure accessibility settings to make Ubuntu more friendly

Ubuntu is a friendly place for everyone,


including people with reduced capabilities
or disabilities. If you need to use special
settings for a more comfortable user experience
in Ubuntu, there is a dedicated subsection called
Universal Access inside System Settings. If you want
too, you can also launch it separately by searching its
name in the Dash or by using the $ unity-control-center
universal-access command in the terminal.

Universal Access consists of a large number of


settings divided into four individual categories: seeing,
hearing, typing and pointing, and clicking. Each category
has switches that improve usability and make the most
out of Ubuntu. Ubuntu ships with a high-contrast icon

theme and the Large Text switcher, both of which help


visually impaired people see more on their screens.
There is also a screen reader, which pronounces window
titles and messages, an on-screen keyboard, advanced
sound notifications more, covered below.

Each category has a number of switches that


improve usability in different ways
Type the way you need to
The Typing tab in Universal Access houses a list of options that help input data using
a keyboard for those who are unable to type normally and need assistance. The most
noticeable option here is the on-screen keyboard switch that enables text input using
mouse clicks. The on-screen keyboard will appear after you re-log in to a session. It
looks like a desktop widget that flows at the top of any windows. There are various
keyboard tweaks that can ease input in some cases, such as sticky keys (treats a
sequence of modifier keys as a key combination), slow keys (puts a delay between when
a key is pressed and when it is accepted) and bounce keys (ignores double pressing a
key in a short period). This can be complemented with extra audible notifications, such
as beeping when certain keys are pressed.
The on-screen keyboard in Ubuntu can also be used for an extra security if you feel
like the use of a physical keyboard can compromise your privacy.

The Typing tab in Universal Access


houses a list of options that help input
data using a keyboard for those who
are unable to type normally
Adopting Orca screen reader
The default screen reader in Ubuntu is called Orca. It can be enabled in the Seeing
tab of Universal Access, or it can also be launched from command line ($ orca).
Orca pronounces titles and text corresponding to the controls in use. To access
Orca preferences after enabling it for the first time, press Ins + Space on a desktop
keyboard or Caps lock + Space on a laptop. A new window will open, and Orca will
announce Screen reader preferences. General page tab. You can now configure Orca
to your liking, change voice type and speed, redefine key bindings, turn Braille support
on or off and change lots of other tunables. Orca also lets you customise its verbosity
and define the categories of text that will be spoken. It also has a built-in help system
in audible mode. Press Ins + H or Capslock + H to hear instructions and references to
other important key bindings.

Using the keyboard as a cursor


If moving a mouse in a regular manner is uncomfortable, you can control the mouse
cursor from a keyboard using the arrows. This accessibility feature can be enabled by
going to the Pointing and Clicking tab and putting the Mouse Clicks switcher on. There
are also two ways to trigger a mouse click without clicking its buttons. The first tweak
is to simulate secondary click in double-clicking by holding the left mouse button down
for some time. Second, you can simulate a click by hovering a mouse cursor over an
item and waiting longer. For either, there are helpful sliders that let us adjust a delay.
Regular mouse settings in the Mouse & Touchpad subsection also contribute to a more
flexible mouse performance. There you can lower the double-click delay, change cursor
speed and switch buttons arrangement if you need a mouse for left-handed people.

The Ubuntu Book 59

Ubuntu essentials

Configure Network Connections


Setting up a network connection in Ubuntu is easy

Those who only need to plug their Ethernet


cable into their computers network
port in order to have an instant access to
the Internet can skip this section (perhaps those
running Ubuntu inside a virtual environment can
do that too). The majority of Linux newbies, however,

often need assistance in connecting to the Internet or


changing their network parameters. During the last
decade, almost every Linux distribution has relied on
NetworkManager a stable, feature-rich and intuitive
network handler for Linux. The Unity desktop in Ubuntu
has a tight integration with NetworkManager by offering

a network indicator on the top bar and a standalone


graphical utility called Network. You can search for it
in Dash, open it as a subsection in System Settings or
launch from command line ($ unity-control-center
network). Both wired and wireless network connections
can be added and modified or even removed here.

View connection settings


When you are online, you still may want to use NetworkManager to find out certain
details about your current connection. The quickest way to find out such details will
be to click on the network indicator on the Unity top bar and go to the Connection
Information item. You will see a separate window with lots of details about your
connection, including general settings (your network car MAC address, declared
speed, interface name), and IP connection details for both IPv4 and IPv6 (if it is relevant
for you). The main window of the Network application also displays network settings
and includes a briefer list with Hardware Address (MAC), IP Address, Default Route
and the list of DNS servers. If you cannot run NetworkManager in graphical mode for
some reason, use the $ ifconfig command to view settings and $ nmcli to manage
connections. For instance, let us bring up a known Wi-Fi connection from within a
broken Ubuntu system that cannot boot into any desktop:

$ nmcli dev wifi con Network_Name password your_password

Connect to a wireless or wired network


If you want to use a wireless connection and if you have a Wi-Fi network card or
chip, things are quite easy: notice the radar sign at the far-right position on Unity
top bar and click it to see a list of available networks. Select your network and once
you provide the correct authentication password, you are mostly done. With wired
network connection, for which you are given an IP address, network mask and a
gateway address, youll need to enter the Network configuration dialogue and add your
connection manually. To do so, first check that the global switch for wired networks
is in the On mode and then press the Options button in the lower-right corner of the
window. This will bring up the connection editor, in which the most common place to
go is the IPv4 Settings tab. In the Method drop-down menu, select Manual and then
provide your connection details in fields below.

The majority of Linux newbies often


need assistance in connecting to the
Internet or changing their network
parameters. During the last decade,
almost every Linux distribution has
relied on NetworkManager
60 The Ubuntu Book

Set up a network proxy


Sitting behind a proxy adds a little complexity. Usually you have to declare your proxy
settings several times: separately for a web browser, in the Bash environment, for
Apt package manager, for Wget downloader and so on. Ubuntu makes things a little
easier. Click the Network Proxy item in the list on the left and choose what kind of
proxy setup works for you. If you have been given a URL, select the Automatic method
and provide that URL in the field below. Proxy with personal authentication usually
requires manual setup. Select the Manual method and provide at least the HTTP
proxy, using the following syntax:

username:password@server-name.domain
Provide a proper port and finally hit the Apply system wide button to finish with setup.

Tweak the Power settings

Tweak the Power settings

Make your laptop run longer and let Ubuntu reduce your monthly bills

Ubuntu is an intelligent operating system


that supports modern power saving
technologies. For example, it will downclock
your processor when it is inactive, dim your screen
when you are away and put your laptop or desktop PC
into sleep mode after a given period of time. The default

power settings in Ubuntu work well for an average user,


but no one knows exactly what your usage scenario is,
so you might want to tweak the settings according to
your personal needs and tastes.
You can access Power settings in Ubuntu either from
System Settings or as a standalone application just

search for power in Dash or run the $ unity-controlcenter command. The Power application is a tiny one,
it has only two settings: one for selecting a period of
inactivity, after which your PC will be suspended (put
into sleep mode). The other setting triggers the battery
indicator display on the top bar in Unity.

Suspend your system differently


System suspension is a great way to save power and enjoy an almost instant computer
boot (which would be a resume from suspend). Suspension puts everything into RAM
and essentially powers down your PC, but keeps it at minimum power, which is just
enough to keep data in RAM and not lose it. By default, Ubuntu doesnt suspend in case
of system inactivity, no matter how long it is. You can change it by selecting anything
other than Dont Suspend in Power settings. Alternatively, you can put your computer
to sleep manually, by issuing the $ sudo pm-suspend command. Using a command
line, you can either suspend or hibernate your system. The difference between the
two is that hibernation means saving all data from RAM to the hard disk and complete
power off, whereas suspension is a reverse action that draws only the small amount of
power required to keep RAM alive.

Save even more power

Make sure the screen is always on when


watching movies
The display is one of the most hungry power consumers, and that can be a crucial issue
for those who use Ubuntu on laptops. You can set Ubuntu to dim the screen or turn it
off completely after a given period of inactivity. Both settings are available in System
Settings>Brightness & Lock. However, this also means that when you decide to watch
a movie and sit back, youll need to move your mouse every once in a while in order to
disturb the system and get the brightness back on. However, there is a way to fix this
with a special indicator called Caffeine. Install it with a following series of commands:

There are various other tweaks and hints that can save even more power and make
your laptop battery last longer. Ubuntu used to have various all-in-one solutions
that combined plenty of standalone tweaks. Not anymore. Currently the most viable
solution is TLP. It automatically adjusts the CPU clock, hard drive time outs and
supports power saving modes for your wireless network chip, Bluetooth, audio and
other built-in subsystems. TLP is not (yet) included in Ubuntu by default, so you will
need to install it, but first add the projects repository, as follows:

$ sudo add-apt-repository ppa:linrunner/tlp


$ sudo apt-get update
$ sudo apt-get install tlp tlp-rdw
TLP automatically switches between AC and battery mode when you plug or unplug
the power cable and also makes your system run at a cooler temperature.
Additionally, you can find out what software components draw extra power by
installing the Powertop diagnostic tool ($ sudo apt-get install powertop). It collects
the various pieces of information from a system and tells you what can be optimised.

$ sudo add-apt-repository ppa:caffeine-developers/ppa


$ sudo apt-get update
$ sudo apt-get install caffeine
Caffeine offers a panel indicator and a command; both designed to inhibit desktop
idleness after you decide to do so. Click the coffee cup icon on the top bar or use
something like $ caffeinate vlc (or any other player) to enjoy your movies.

The default power settings in Ubuntu


generally work well for an average user
but you may well want to tweak the
settings according to your personal
needs and tastes
The Ubuntu Book 61

Ubuntu essentials

Connect with Online Accounts

Enjoy a more convenient integration with online services in Ubuntu

Online social services are already a part


of everyday life for an average user. Most
of us use these services for connecting
with friends and relatives, for sharing photos, videos
and other files. Almost every online service requires
authentication, which is commonly about registering
an account and using it later for accessing the personal
part of a service. Ubuntu simplifies the general
experience with online services by eliminating the
need to sign into one account several times in different

applications. It also makes using local applications


easier because it is much more convenient to provide
your username and password on a classic login web
page than to have the hassle of local application
settings. A good example is the Evolution email client.
Years ago people had to remember incoming and

outgoing server addresses, ports, security settings


and the authentication method. Now all you have to
do is to provide your username and password for your
email service in Ubuntus Online Accounts once you
log in there Evolution will already be configured and
automatically display your inbox.

Most of us use these services for connecting with


friends and relatives, for sharing photos and videos

Set up instant messaging


Ubuntu offers Empathy as a default application for instant messaging. Open Online
Accounts either by searching for it in Dash or as a subsection in System Settings. You
can even go from the command line ($ unity-control-center credentials).
The list of online services, for which Ubuntu offers desktop integration, has grown
recently so you may want to filter the list by applications. In the Show accounts that
integrate with drop-down menu select Empathy. You can click the desired service
for which you already have an account and provide credentials in a built-in browser
window, right there in Online Accounts. You can even add more than one account of
the same service, or add accounts from various different services to one application.
Online Accounts lets you enable, disable and change options of added entries at any
time. After you are done, you can launch Empathy and start chatting immediately.

You can click the desired service for


which you already have an account and
provide credentials in a built-in browser
Connect to your Google account
Online Accounts offers the most comprehensive integration with Google services. If
you have a Google account (using Gmail for example), you can benefit from a very wide
list of desktop applications that Ubuntu can integrate with. It includes Evolution Data
Server, Shotwell photo manager, Google Drive and Picasa lenses for Unity Dash and
Empathy instant messaging.
Once you log in to your Google account it will prompt you to allow it access to
manage your emails, calendar, photos and videos, contacts, view your data and so
on. You have to grant this access in order to proceed. After that your list of connected
services will be populated with everything that Ubuntu supports for Google and you
can start using your favourite applications and enjoy them working without your
Google account without any extra movements. Your search results can now include
files found on your Google Drive and Picasa web albums. You can also start using
Gmail directly from your Evolution client and do much more.

Upload photos to a cloud-based account


Ubuntu ships with Shotwell, a manager, viewer and even a simple editor for your
photos. Not only can you sort and tag images, but also import them from external
sources and export to a cloud account the latter requires integration with Online
Accounts. Shotwell can publish your photos to Facebook, Flickr, Picasa Web Albums
and Piwigo CMS. You can configure one of these, all, or any combination of services by
adding respective entries in Online Accounts.
As with Google, in most cases you have to pass an authentication routine and grant
access to your data. After that you can launch Shotwell and select one or several
photos youd like to publish. Notice the toolbar along the bottom of the window and
press the Publish button there. Select a cloud service from the drop-down list and
choose publishing options. Shotwell can create new albums in an account or commit
to existing ones. It also supports tags and photo metadata in its publishing module.

Not only can you sort and tag images,


but import them from external sources
and export to a cloud. Shotwell can
publish your photos to Facebook, Flickr,
Picasa Web Albums and Piwigo CMS
62 The Ubuntu Book

Use System Monitor

Use System Monitor

View and manage system resources using the System Monitor app

System Monitor is a tool for managing


running processes and monitoring system
resources. It is one of many accessories
borrowed from the Gnome desktop. You can run from
Dash or from command line ($ gnome-system-monitor).
The application looks and works similarly to its
analogues in Windows and OS X, and contains three
logical tabs: Processes, Resources and File systems.

Launch the application with a specific tab showing


by using command line parameters -p for processes,
-r for resources and -f for file systems. Launching
with the File Systems tab shown can be done with

the $ gnome-system-monitor -f command line.


System Monitor is used to tackle system sluggishness.
You could also use the CPU load graph to find out if
hardware-accelerated video output really works.

The application looks and works similarly to its


analogues in Windows and OS X
Control resources usage
The Resources tab offers effective graphs that get updated in real time and look like
a mission control board. The first graph shows CPU History in live mode (there is no
delay in data update by default), showing CPU cores in different colours. When you
launch a heavyweight application youll notice peaks on that graph. You can also figure
out whether an application can use several CPU cores at once, or if pushes all of the
load on one core.
The middle graph is for Memory and Swap Usage. On modern systems, swapping to
a file or to a separate Swap partition is rarely used in everyday tasks, simply because
there is already sufficient RAM. However, processing large files (like retouching a giant
poster in GIMP) may require swapping, which only takes place when your system is
running low on available RAM.
The final graph, Network History, shows the network speeds for both downloading
and uploading. This graph can be particularly helpful for network troubleshooting and
low Internet speed diagnostics. Both memory and network graphs help you monitor
your system performance.

Manage system processes


Each application in Linux creates at least one process. Some processes refer
to graphical applications, others run in the background and provide service
functionality. With the help of System Monitor you can view the list of all processes,
know their names, find out which process belongs to which users, detect processes
that devour too much CPU cycles or draw high levels of RAM, associate processes
with their low-level IDs and manage processes priority. Normally youll see a list of
processes sorted by name. Note that you can click the name of a column to sort
processes by it. It is very helpful to sort them by CPU percentage or memory usage.
If a process belongs to you (or if you have the permissions), you can kill it or lower its
priority. Select the process you want to get rid of and press the End Process button in
the lower right corner of the window. Right-click the process and select the Change
Priority menu alter its priority.

Some processes refer to graphical


applications, others run in the
background and provide service
functionality. With the help of System
Monitor you can view the list of all
processes, learn names and find out
which process belongs to which users

Find out details about file systems


The File Systems tab displays a table of all file systems that are currently mounted in
Ubuntu. You can find out the device name, file system type, mount point, total capacity
and available disk space.
Of course, you can find out a similar set of information in Ubuntus disk utility (Disks,
p.40), but System Monitor offers a more comfortable view, which lets you quickly
analyse how much space is left on your device and sort them by various criteria. The
Used column doubles the information about free disk space, but shows it in the form
of a percentage bar. When the bar fills up to approximately 90 per cent or more, it
means that you are running low on free disk space, which can be troublesome for
certain workflow scenarios. Ubuntu cannot work properly if the root partition (/) gets
100 per cent full. You can also check for free disk space in terminal by using the $ df
command (disk free), although it doesnt let you sort or reorder any of the lines.

The Ubuntu Book 63

Ubuntu
apps
66 Explore the Ubuntu
Software Centre
Your one-stop shop for new apps

70 Browse with Firefox


Explore the Internet

72 Manage emails
with Thunderbird

Ubuntu comes ready-loaded with a


host of useful apps for you to enjoy
and add to

All your email accounts covered

74 Communicate with
Empathy

70

Set up and use this instant messenger

76 Explore LibreOffice Writer


Discover the features of the FOSS
word processor

78 Unlock LibreOffice
Calc tricks
Use spreadsheets like a pro

80 Edit formulas in Math


Learn about this LibreOice extra

82 Present with Impress


Get to know the FOSS presenting tool

84 20 LibreOffice tips & tricks


Make your working day even
more productive

88 Text editing with Gedit


Understand its features and uses

90 Create discs with Brasero


Create CDs and DVDs fast

64 The Ubuntu Book

84

72

90

The Ubuntu Book 65

Ubuntu apps

Explore the Ubuntu


Software Centre
The flavours of Ubuntu are the set of packages installed on the system.
The Software Centre is the one-stop shop for installing, purchasing and
removing software in Ubuntu
Ubuntu Software Centre, aka USC, is a
package management portal that is,
a consolidated platform where you can
search for, install or purchase software, and even
remove apps from the list of installed software.
Initially released on 29 October 2009, Ubuntu Software
Centre is developed in Python and contains more than
53,000 apps.
Previously, Ubuntu programmes were downloaded
from the repository as tar files, unzipped and then
installed, by manually running the commands in the
console. Even the previous versions of Ubuntu had
many graphical utilities for adding/removing software,
which ultimately led to redundancy and fragmented
development effort. To ease this cumbersome process,
USC came with a worthwhile approach where all the

66 The Ubuntu Book

software is installed with the click of a few buttons.


The search for specific software ends here as USC has
name/description-based search functionality, with
multiple options to choose from. The rating and users
review helps you to find the best software. USC also
provides Ubuntu application developers a prominent
way to offer their software to potential users.
The latest version of Ubuntu comes with some
preconfigured tools and software like the LibreOffice
suite, Mozilla Firefox, text editors, Software Centre
etc, which are displayed vertically in the left sidebar.
To get started, search for the shopping bag icon in the
display and click it to launch Ubuntu Software Centre.
Upon the launch of USC, the home screen appears,
which contains different categories of software,
recommended software, newly added software, top

rated software and many more. For instance, if youre


looking for a text editor, you can type the keyword in
the search bar, which shows the different text editors
present in USC in a list view. You can just select any one
of them and click the Install button to start using it.

Explore the Ubuntu Software Centre


Getting started
Ubuntu Software Centre is easy to use with a self-explanatory user interface. Open it
on your Ubuntu machine and start installing the software you need
On the top of the home screen you will find the section
navigation commands: All Software and Installed. The
Back and Forward button displayed as less than (<) and
greater than (>) signs help in navigating the different pages.
USC keeps the visited pages in memory so that by clicking
the Back button once, youll reach the page you just left.
The Back command is unavailable whenever no previous
screens exist in the history, and the Forward command
whenever no later screens exist in the history. The All
Software section presents all the programmes available, be
they already installed on the computer or not.
In the Installed section you will find the list of programmes
that are installed on your Ubuntu machine, with the date of
installation specified. When a software item is selected be
it from any screen or category or subcategory screen if the
item is not currently installed in your system, you will see an
Install button. Clicking the latter will install the software on
your machine. If the software is already installed, a Remove
button is available; clicking it will uninstall the software.
On the home screen itself, you will find the section
Recommended For You. In order to make use of the
recommendation facility, you have to register yourself in
Ubuntu by providing the details in the form with a valid email
ID. You will receive the verification code at the email address
provided, which you need to give in order to activate your
account. Once thats done, you get a success message and
Ubuntu starts recommending useful software to you, which
you can select and install on your machine with ease.

Ubuntu will start


recommending useful
software to you, which
you can then select and
install on to your machine
with ease

To make use of the


recommendation facility,
you have to register
yourself in Ubuntu
Top Rated
In terms of display, if the category is set to Show
non-applications by default, then results are
displayed in a list view; otherwise tile view is
used, and non-application items are hidden
by default. The top rated applications are also
displayed on the home screen using tile view
in descending order of DR (dampened rating),
regardless of whether they are installed or not.
Applications with seven five-star ratings and
one four-star will be displayed before other
applications having two five-star ratings. 12
items are displayed in the home screen under
the Top Rated tab; once the More button is
clicked, you land on a page where 60 items are
displayed in decreasing order of DR using the
list view.

Navigation
Programmes are categorised based on their functionality, performance,
ease of use, time of launch and user ratings, which are all displayed in the
home screen of Ubuntu Software Centre
The USC segregates software into different categories
such as accessories, developer tools, books and
magazines, games, education, office and many more.
Upon clicking the Accessories tab, for instance, a list
of accessories is displayed, including Speed Crunch
(precision calculator), 7zip (compression/uncompression
tool), PuTTY (SSH/Telnet client) and Shutter (screenshot
utility). The software listed in the Accessories tab is by
default sorted by rating; the other sorting criteria are
name and release date.
Moving on to the Developer Tools page, you will find
many open source tools which are subcategorised
into version control, IDEs (integrated development

environments), web development and so on. The version


control subcategory has many flavours of versioning
software, prominent ones being Git-Cola, qgit and
ggit. The IDEs tab has Netbeans, Ninja, Spyder and
Eclipse, which can be installed and used for software
development. There are also other subcategories named
after software languages like Java, Python and Perl
that contain the different versions and tools related to
the specific language.

Many open source tools


are subcategorised
The Ubuntu Book 67

Ubuntu apps
Updates and
past downloads

On the home screen of USC you will find the History


tab; when clicked, this shows the All Changes page
by default. Under the navigation bar are tabs for All
Changes, Installations, Updates and Removals.
The entries are grouped in branches and labelled by
the day in reverse chronological order; (newest on top).
Clicking anywhere on a branch (or pressing the spacebar when it is selected) should expand it if it is collapsed,
and collapse it if it is expanded. The branch on which the
recent activity has occurred is opened by default in the
USC history screen. The items displayed in the History
tab contain the icon of the software, name, plus the date
and time of installation. Upon clicking the Installation
tab, you will find all the installed applications grouped
by their installation dates. The Updates tab, on the other
hand, lists all the updated applications along with their
update dates.
Finally, the Removal tab displays the list of
applications which have been uninstalled from the
system. In the History tab, the search bar present on the

68 The Ubuntu Book

To check out your installed applications, removals and


updates, click on the various History tabs to view items in
reverse chronological order

top right can search for applications which are already


installed or have been removed from the system.
Whenever the Back ports channel contains a version
of any application which is newer than the one installed,
an Updates item appears in the last navigation bar. The
Updates section displays the number of application
updates available, along with an Update All button.
The list contains the icon, title, the newer version of the
application and an Update button at the far right end.
When an item is selected, pressing the Enter key
should activate its Update button; when an update is
installed or waiting to be installed, its Update button
should be inactive.

The Software Centre


contains a list of
programmes provided by
Ubuntu itself

One Stop Shop for Ubuntu


As well as offering a vast selection of free
software to download, the Ubuntu Software
Centre provides the option to purchase and
install commercial software. The Software
Centre contains a list of programmes which
are provided by Ubuntu itself, along with
software offered by Canonicals partners (those
programmes which abide by the software rules
of Ubuntu). The number of programmes available
in the Software Centre continues to grow rapidly,
so theres a lot of choice.
In simple terms, the Ubuntu Software Centre
is the equivalent of the Google Play Store (or
Apple App Store) for Ubuntu, where you can
find thousands of programmes, tools and
applications which can be installed with just a
few clicks.

Explore the Ubuntu Software Centre


Installing programs
In this example, we show how to install two programs in the Developer Tools section
of the Software Centre
Now weve covered navigation and layout, lets move on to
installation. In this example, well install OpenJDK Java 7 and the
Eclipse IDE. Select the Developer Tools category from the home
screen of USC. This will take you to the Developer Tools page,
which is further subcategorised. Click on Java (cup of coffee
icon), which takes you to the page where Java-related items are
displayed in a list view. Now select the item Open JDK Java 7
Runtime and on the right side you will find the Install button; click
it to install the packages. Youll then be prompted to enter your
administrator password; type the correct password and hit Enter
to start the installation.
During installation, you will find the progress icon graphically
displaying the status of the installation. Once its complete, you
will be redirected to the success page, which also contains the
Remove button in order to uninstall the programme.
Click the Back button to search for the IDEs section; now click
the IDEs icon to see the list of IDEs present in USC. Type Eclipse
in the search bar to search for the Eclipse IDE. Select the Eclipse
IDE (blue ball icon) and then click the Install button; enter the
administrator password to start installation. Once Eclipse is
successfully installed, open it by double-clicking. Create a project
named Hello, with a Java filename of Hello.java, in the test
package. Now run this program to get an output in the console.
This confirms that both Java and Eclipse are up and running.

There are many programmes


to install, such as chat apps,
file sharing and more

Advanced software suggestions


We look at some of the advanced tools available in the Ubuntu Software Centre
and see how they can help you in your activities
Switching from Developer Tools to Internet in the
category section of USC, you will find many programmes
to install, such as chat applications, file sharing tools,
email clients and web browsers. By clicking the File
Sharing tab, you will see many tools, FileZilla being the
highest rated one. FileZilla uses FTP, SFTP and FTPS
mechanisms to share and upload files to different
systems. Just click on the Install button and start
sharing your files within different systems.
In order to use your Ubuntu computer for office work
and view different formats of files, you will find the Kile
application under the Office category. The source editor
is a multi-document editor designed for .tex and .bib
files. Menus, wizards and auto-completion are provided
to assist with tag insertion and code generation.

The Ubuntu Book 69

Ubuntu apps

Browse the Internet with Firefox


Explore the hidden features of Mozilla Firefox

Discover Firefox

Learn various Firefox settings to speed up your browsing

Address and search bar


Enter the website address, that is the
URL, here to browse the Internet. The
address bar is smart, as it automatically
suggests websites based on your history
and bookmarks. You can enter search
queries in the search bar

Add and view


bookmarks

Icon bar
This bar holds icons for
other services like Pockets
(to save reading lists),
Downloads, Home and
Chat. The last icon opens
up the Settings menu

You can add a bookmark


with the star icon and
view all the saved
bookmarks by clicking
on the next icon

General
options
This area holds
all the major
options that
Firefox has
to offer. You
can open new
windows, print,
view history,
edit settings
and more

Editing
buttons

Sync

Customise

This is where you


can log in to enable
syncing of your
browsing data across
all your devices

You can configure the button


positions, themes and
overall look and feel of your
Firefox installation using the
Customize option here

Internet browsing is one of the most


common activities taken up by computer
users. People use the Internet for almost
everything, from online shopping and reading to gaming
and more. Almost all Internet access is via an Internet
browser, and a significant amount of time spent on a
computer is often on a browser. So, as an Internet user,
it is very important that you understand your Internets
interface, that is the web browser, extremely well.

70 The Ubuntu Book

Ubuntu ships with Mozilla Firefox as the default


browser. Youll find the browser icon on the left bar on
the Ubuntu Home page. Let us learn a few basic things
about Firefox.
Once you launch Firefox, you will see the Google
search page as the Home page. Note that the default
search engine is Google, but you are able to change
it to other search engines, such as Yahoo!, Bing or
DuckDuckGo, for example. To change the default Home

Zoom
Click on the - sign to
zoom out or the + sign
to zoom in to the web
page. The middle area
here shows the current
zoom percentage

You can edit


website URLs
or text that
you enter in
websites using
this buttons

page, go to Menu>Preferences>Home page and enter


the URL you would like to set as the Home page. You can
also drag and drop an open tab on to the Home icon on
the right icon bar. This will automatically set the Home
page. To bookmark a web page, click on the star icon of
the right icon bar while the page is open. The address
bar automatically shows a list of pages from your
browsing history and bookmarks when you start typing
in the address bar.

Browse the Internet with Firefox

Tutorial

01

Learn important aspects of web browsing with Firefox

Search website from the address bar

There are steps that you will repeat several


times a day without realising how much time they
take, for example, searching specific websites.
Instead of going to the search engine, finding the
search box, entering the keyword and executing the
search, you can directly search the Internet using
Firefox, while you are on any website.
To set this up on your browser, visit the page on
the target website that has the search field you
would normally use to search the site. Hold down
the Ctrl key and click on the search field. Select Add
a Keyword for this search. The Add Bookmark
dialog appears. Enter an appropriate name for the
bookmark (for example: Wikipedia search). Create
a keyword (like wikipedia). Select the bookmark
folder to contain the smart keyword. Click OK. To use
the created smart bookmark, enter the keyword and
search string in the Location bar then press Return.

02

Sync information across devices

People now use multiple devices to access


the Internet. Firefox helps to make sure all your
bookmarks, links and other things are synced
across devices seamlessly. Firefox does this with
a feature called Sync. It lets you share your data
and preferences (such as your bookmarks, history,
passwords, open tabs, Reading List and installed
add-ons) across all your devices.
Let us see how to set up and sync an account in
Firefox. First, click on the menu button and click
Sign in to Sync. The sign-in page will open in a new
tab. Click the Get Started button. Fill out the form
to create an account and click Next. Take note of the
email address and password you used; youll need it
later to log in. Check your emails for the verification
link and click on it to confirm your email address.
Youre ready to go! Now you just need to log in to Sync
on all your other devices and let it do the rest.

03

Protect your privacy while browsing

04

Install an app

As you browse the web, Firefox remembers


lots of information, for example the sites youve
visited and your passwords. There may be times,
however, when you dont want people with access
to your computer to see this information. Private
Browsing allows you to browse the Internet without
saving any information about which sites and pages
youve visited. Private Browsing also includes Tracking
Protection, which prevents companies from tracking
your browsing history across multiple sites. To open
a private browsing session, click on the menu button
and then click New Private Window. If you want to
directly open a link in a new private window, hold
down the Ctrl key while you click on this link and
choose Open Link in New Private Window from the
context menu.

Mozilla offers the browser platform to


developers as well. This paves the way for thousands
of interesting and useful apps in the Mozilla
marketplace. With a wide selection of games, music
and productivity apps, Firefox Marketplace has
something for everybody.
To install an app, open Firefox, click on the
Tools menu and select Apps. This will open up the
marketplace. Now, type a search query in the search
box to look for a specific app or choose a category
for the type of app you are looking for. You can also
choose the screen type from the drop-down menu to
see apps optimised for that screen size. Click on an
app to view its details. Finally, if youre ready to install
an app, click the blue install button.

The Ubuntu Book 71

Ubuntu apps

Manage your emails with


Thunderbird

Learn to manage all your email accounts using Thunderbird

Part of the Mozilla suite, Thunderbird is a


lightweight mail client. It supports different
account protocols like POP, IMAP, Gmail etc.
It also has an integrated learning spam filter that offers
easy organisation of mails with tagging and virtual
folders. More features can be added by simply installing
extensions. If youre an avid reader, Thunderbird acts
as news and RSS client as well. So, you can get all your
information at a single point of contact.

Tabbed email lets you load messages in separate


tabs so you can quickly jump between conversations.
A quick filter toolbar helps you filter messages by
tags, contacts, keywords etc. Other features include
message archiving, customisable themes and
personas, smart folders, and even chat integration. You
can also add social media accounts, like Twitter and
Facebook, directly to Thunderbird and chat with your
contacts with accounts on these platforms.

Thunderbird is installed by default on Ubuntu 15.10,


so just fire up Dash and search for it. Click on the icon
in the results to launch Thunderbird. You can now add
your email accounts to get started here. Note that
Thunderbird, in association with some service providers,
offers email servers as well. So, you can avail a new
email ID right from the Thunderbird GUI. If you dont want
a new email address, however, just select Skip this and
use my existing email.

Discover Thunderbird UI Explore Thunderbird UI elements to use them efficiently


Get messages

Write

Address book

Search and filter

You can use this


button to force sync
with the email servers
and fetch all the new
messages for all your
email accounts

Click here
to open
the Mail
Compose
dialog and
write a mail

This holds all


your contact
details from
different mailbox
accounts in a
single place

You can search your


mailbox for specific
keywords or filter the
mails based on sender,
recipient, subject etc
from this section

Mail folder list


This section holds
all the mail folders
from all your
mailboxes. If you
have enabled the
unified mailbox,
youll see each
mailbox as a child
inside the generic
mail folders

72 The Ubuntu Book

Mails list

Chat

Mail display

All the social platform


profiles such as
Facebook, Twitter etc (if
linked to Thunderbird)
are visible inside this
chat box

This section displays a


detailed view of the mail
selected in the pane
above. Youll see the
reply, forward and delete
buttons here

This is the
section that
shows a list of
all your mails in
a chronological
order. Just
click on the
column header
to sort the
mails based
on different
criteria

Manage your emails with Thunderbird


Use Thunderbird as your
mail client
Setting up a new account with Thunderbird is easy.
Just click on the Email link on its launch page. You then
need to provide your username and password for your
email provider and your email address. Thunderbird
determines connection details (such as ports, server
names, security protocols etc) by looking up your email
provider and can usually provide the account details.
You need to configure your account manually if your
email provider is not listed in Thunderbirds database,
or if you have a non-standard email configuration. To
configure an account manually, you need the following
details: incoming mail server and port (eg pop.example.
com and port 110), outgoing mail server and port (eg
smtp.example.com and port 25), and the security setting
for the connection with the server (eg SSL/TLS and
whether or not to use secure authentication). Fill in these
details and you are good to go.

Social chat with Thunderbird

Multiple mail accounts with unified folders

Configure Thunderbird to chat with your contacts on


social media platforms

Learn to manage multiple accounts by


combining folders

To add chat accounts to


Thunderbird, click on the Chat
button next to the Email button
on Thunderbirds launch page.
After you click the link, youll see a
pop-up with supported services.
Facebook, Twitter, Google Talk,
IRC and Yahoo are all supported.
Select the account to add and click
Next. On the next page, enter the
username and then on the next
page, select the alias. Finally, click

the Finish button. You will then be


taken to the website of the account
you chose to authenticate access to
your account. Once authenticated,
you can view all your social
conversations in a new tab. Another
aspect of Thunderbird chat is that all
the chat conversations are included
in search. So, if you are looking for a
keyword, just type it and the results
you get will include results from past
chat conversations.

Unified folders is a folder pane view


which resembles a global inbox
account: it merges the contents
of all inbox folders (both POP, IMAP
and local folders) from all accounts.
It also shows the inbox of each
account as a child folder of the
unified Inbox account. Any message
in an inbox shows up in both the
root of the unified Inbox, plus the
child folder of the unified Inbox.
Each account displays any child

folders of the inbox, only its inbox


folder has been moved away from
the account. This does not change
where and how messages are
stored. Unified is just another way to
view your folders at a single point.
To enable unified folders, go to
View> Folders>Unified Folders and
select it. Alternately, if you dont
want to use the feature, use View>
Folders>All Folders to select a more
traditional display.

Extend Thunderbird
features
Thunderbird has an open, extensible design and
program architecture. This enables people to create
add-ons for it. Most of these are distributed via
the Mozilla add-ons site, but authors can do so any way
they choose. Lets see how to install an add-on
To start, go to Tools>Add-ons. Click on Get Add-ons.
Type the name or keywords of the add-on you want in
the search field and click the magnifier icon. Then select
the add-on from the list and click Add to Thunderbird.
Click on Install Now once the button is available. Note
that the add-ons from the official site (addons.mozilla.
org) are reviewed by Mozilla and are relatively safe to
install. Also, if the author is verified, the author name will
be displayed. Finally, restart Thunderbird to complete
your changes.
To remove an add-on, go to Tools>Add-ons and
select the add-on to be removed from the Extensions,
Themes or Plugins panel. Then click Disable to prevent it
from loading; you can also click Uninstall to completely
remove it.

The Ubuntu Book 73

Ubuntu apps

Communicate with Empathy


Learn to set up and use Empathy text messenger

The Empathy interface Understand how Empathy works and what you can change
Application settings

Online accounts

Other settings

Once you open Empathy,


these settings are available
automatically on the top status
bar. You can find various settings
related to conversations,
contacts and so on here

If you select Add Accounts


in the status bar, youll see
this open up. If you click
All Settings here, youll
be taken to the System
settings page

You can see several other


settings like sounds,
calls, location, spell
check, themes and so on
as different tabs under
Empathy> Preferences

Contacts list
This window
displays a list of
all the contacts
and their current
status. To chat with
anyone from this
list, right click on
the contact, and
select chat

General
settings
You can find
these under
Empathy>
Preferences.
Under the
General
settings you
can set what
contacts will
be visible by
default and
also select the
chat settings

Accounts list

Chat window

Youll see a list of


accounts added to the
system here. Click Add
account to add a new
online account here

This is the actual chat window


where you can converse with
your contacts. Based on the
system capabilities, you can also
chat in audio and video mode

Instant messaging, also abbreviated to IM,


is a text-based means to communicate
instantly over the Internet and the local
network. While some IM applications need you to
create a new account, others provide IM facilities by
using accounts from different service providers like
Google, Yahoo etc. IM applications can also be used to
connect to chat rooms. For the uninitiated, chat rooms
are online places where like-minded people meet to talk.

74 The Ubuntu Book

In this feature, we are going to explore Empathy. It is


a messaging program that supports text, voice, video
chat, and file transfers over many different protocols.
Empathy also lets you add accounts from different
services and use them to chat with your contacts.
Based on Telepathy for protocol support and a UI based
on Gossip, Empathy is the default chat client in current
versions of GNOME, (and hence Ubuntu). To get started
with Empathy simply type Empathy in Dash. Then click

Account details
Once you select an already
added account on the left
window, youll see all the related
options here. You can choose
to enable or disable related
services from here
on the Empathy icon to launch the application. When
you launch it for the first time, youll be asked to link
your online accounts. Just link your accounts and you
can then easily talk to all your contacts. Using Empathy,
you can also group all the conversations in a single
window, have multiple windows for different kinds of
conversations, easily search through your previous
conversations, and share your desktop in just two clicks.
Now lets learn about Empathy in more detail.

Communicate with Empathy

Tutorial

01

Get started with Empathy messenger

Add a new account

You can add instant messaging accounts


from several supported services. For some
account providers, these steps will also allow you
to register for a new account. To add an account,
click Empathy>Accounts and then press +. From
the What kind of chat account do you have?
drop-down list, select the type of account you
wish to add. Enter the required information. For
most accounts, you will only need a login ID and a
password. Some accounts may require additional
information though. Finally click Add to confirm and
save the account details.

02

Manage contacts

After you have your accounts added to


Empathy, next step is to add your contacts and
manage them. To add contacts, click Chat>Add
Contact. Then from the accounts drop-down list
select the account you wish to use to connect to
your contact. Note that your contact should be
using the same service as the account you select.
In the Identifier field, enter your contacts login
ID, username, screen name, or other appropriate
identifier for the service type. In the Alias field, type
your contacts name as you would like it to appear in
your contact list. Finally, click Add to add the person
to your list of contacts.
If one or more of your contacts has multiple
accounts with different messaging services, you
can combine these accounts into a single contact.

The resulting contact is called a meta-contact: a


contact composed from different single contacts. To
link accounts press the tick button to select entries
you want to link. This will enable selection mode and
you can see a checkbox for each entry. Tick the
checkboxes that correspond to a single persons
contact entries. Finally, press Link.

03

Audio and video communication

04

IRC with Empathy

Empathy supports audio and video


communication using the default GUI, however
it is still dependent on the account you use to
communicate. This is because only a certain set of
services support audio and video communication.
Right now only Google, Jabber and SIP accounts
are supported. Considering you are using one of the
supported accounts, let us see how to initiate audio
and video calls.
To initiate a call, right-click on the contact you
want to talk to and select Audio Call or Video Call. In
the next window that opens, youll see the connection
getting established. When the connection is
established, you will see the total conversation time
at the bottom of the window. Once you are done, end
the conversation by clicking the hand up button.

name from the drop-down and then fill in the room


name and the server name. You should now be able
to chat with people in the room you joined. Note
that an IRC network may have many servers you
can connect to. When you are connected to a server
on a particular network, you can communicate
with all users on all other servers on that network.
You can also add and remove servers for this
network using the Add and Remove buttons.
When a server is selected, click the field
under Server or Port to edit it. Alternatively, use the
left and right arrow keys to focus the field, and press
the space bar to begin editing.

To use IRC with Empathy, make sure you have


at least one account added to Empathy already. You
can then select Rooms>Join Rooms, which will open
the IRC pop-up. You can simply select your account

The Ubuntu Book 75

Ubuntu apps

Explore LibreOffice Writer


Learn to use different features of LibreOffice Writer

LibreOffice Writer is the word processor


component of LibreOffice. As well as
providing all the standard word-processing
functions, there are many other advanced features
such as built-in drawing tools, tracking changes during
revisions, and integrating databases.
Writer is fully integrated into the LibreOffice suite,
and this simplifies embedding or linking graphics,
spreadsheets and other objects. For example, if a

spreadsheet is created using Calc, it can be inserted


into Writer easily. You can also work with drawings,
spreadsheets and so on directly from within Writer using
a subset of the functions and tools from respective
LibreOffice suite components.
You can view a Writer document in several ways:
Print Layout, Web Layout and Full Screen by selecting
layouts in the View menu of the Writer workspace. The
document can be saved as a Microsoft Word file for

Discover Writer features

users who are unwilling or unable to receive ODT files.


Also, it can be exported to a PDF file with its bookmarks.
The document can be protected using password at read
or write level for different groups of people. A Writer
document can be multilingual, as Writer provides tools
that make the use of different languages in a single
document easy. Spell-check dictionaries are built in
and help in applying localised versions of Autocorrect
replacement tables, thesaurus and hyphenation rules.

Understand various Writer toolbars

Menu bar

Text format toolbar

Workspace

This is the area that


has various top-level
menu options. Note the
View menu here; this is
used to enable various
toolbars in Writer

This section holds all


the options to edit and
format text in your
Writer document

This section displays the


document that you are
working on. You can zoom in
or out from this area using
the status bar slider

Standard
toolbar
This shows various
toolbars as and
when you enable
them via the View
menu option. By
default it shows the
Standard toolbar,
which has options
related to saving
files and other
standard items

Form design
toolbar
This toolbar has the options to
help you draw forms and format
them. You can see the Design
Mode On button here.

76 The Ubuntu Book

Sidebar
The sidebar
is common
among
LibreOffice
suite software.
It has four
main sections
Properties,
Styles and
Formatting,
Gallery, and
Navigator

Drawing toolbar
This section lets
you draw and insert
various objects in your
Writer document

Status bar
The Writer status bar
provides information like
page number, word and
character count for selected
text, page style, language etc
about the document

Explore LibreOffice Writer


Working with graphics
There are different ways to use graphics in Writer. You
can insert image files, such as photos, drawings and
scanned images. You can also insert diagrams created
using LibreOffice drawing tools, or charts created using
LibreOffice Chart facility. Writer supports raster file
formats such as GIF, JPG, PNG and BMP.
You can add graphics by inserting an image file
directly from a graphics program or a scanner, from a
file stored on your computer, or by copying and pasting
from a source being viewed on your computer. You can
modify the inserted picture using Picture toolbar.
Writer provides built-in drawing tools to create
graphics. If you want to create a basic diagram, you
can navigate to View>Toolbars>Drawing. For drawing
the simple diagram, you can use rectangles, circles,
lines, text and other predefined shapes, and group
several drawing objects to make sure they maintain
their relative position and proportion. To give you extra
control over the drawing, you can reposition the shapes
by sending them to the back or front.

Tracking changes

Master document

Learn to track changes during revisions

Learn to use master documents

Writer lets you track changes made


in different versions of a document.
A simple way is to create a duplicate
of the file and make changes there.
Then click Edit>Compare Document.
However, this method can only be
used if just one person is working
on the document. Another way is
to use the Change Marks option.
Later on, you or others can accept
or reject each change. To check the
available versions of the document,
navigate to File> Versions. If you
want to update the current version,

save it as a separate document with


a different name and use it as the
review copy. To record the changes,
check Edit>Changes>Record.
Protect the changes recording by
clicking Edit>Changes>Protect
Records, specify the password and
click OK.
To merge the changes made, open
the original document and click
Edit>Changes>Merge Document
and select and insert updated copy.
After merging, accept or reject the
changes that have been made.

If you have many files and you


want to group them into a single
document, you can create a master
document (*.ODM). ODM files are
used to group different ODT files.
It unifies the formatting, table of
contents (TOC), bibliography, index,
and other tables or lists.
Writer can split the
document automatically into a
master document and several
subdocuments. To perform this
function, click File>Send>Create
Master Document. Then specify

the name and location for the files,


and in separated by choose the
outline level where the file should
be split into various different
subdocuments.
To combine more files with a
master document, open it up and
click Yes to update the links. Now, in
the navigator, click and hold on the
Insert icon, move the cursor down
to File and release the button there.
Select the file youd like to be linked
and use Move Up or Move Down
icons to position it as you require.

Database integration
Writer can be used for creating forms. This is done via
two toolbars: Form Design and Form Control. If you
want to create a form for getting someones details,
click the Design Mode On button to activate the tools in
the Form Design toolbar. Insert controls like Name as a
text box, gender as an options button, Country as a list
of options, and Hobbies as checkboxes. Now beautify
the form as you want.
Forms are generally used as a front-end for the
database. LibreOffice can access numerous data
sources like ODBC, MySQL, Oracle JDBC, spreadsheets
and text files. To create a database with LibreOffice
Base, navigate to File>New>Database to start the
Database Wizard and select Create a new database.
On the next page, select Yes, register the database and
Open the database for editing; this makes it available
for other LibreOffice components.

The Ubuntu Book 77

Ubuntu apps

Unlock LibreOffice Calc features


Learn how to use LibreOffice Calc like a pro

Understanding Calc options

Find out various menu options in Calc layout

Standard toolbar

Menu bar

Formatting toolbar

This toolbar holds icons


to manage file-handling
and formatting options.
These toolbars are highly
configurable; you can easily
add or remove icons here

The menu bar has basic options related


to the handling of the software. For
example, File contains commands that
apply to the entire document, such as
Open, Save, Wizards, Export as PDF,
Print, Digital Signatures and so on

The formatting toolbar primarily


has options to manage
formatting, as the name
suggests. You can manage fonts,
font size and other related things
using the options here

Formula
toolbar
This toolbar has
the options to
view and add
various formulae
to spreadsheets

Customisation
bar
This menu lets
you access the
most-used aspects
of Calc UI, like
customisations,
navigations,
functions and more

Row headers

Status bar

This section has row


headers. A number
starting from 1
identifies Rows

Calc status bar provides


information on the spreadsheet,
like cell information, as well as
quick and convenient ways to
change some of its features

One of the most commonly used


components in an office-related software
suite is the spreadsheet. People from
all fields use spreadsheets to manage data, so its
important to understand how Calc can help you.
Spreadsheets consist of a number of individual
sheets, each sheet containing cells arranged in rows
and columns. The row number and column letter
identify a particular cell. Cells hold the individual

78 The Ubuntu Book

elements text, numbers, formulas and so on that


make up the data to display and manipulate. Each
spreadsheet can have several sheets, and each sheet
can have several individual cells. In Calc, each sheet can
have a maximum of 1,048,576 rows (65,536 rows in Calc
3.2 and earlier) and a maximum of 1024 columns.
Calc is the spreadsheet component of LibreOffice.
So, as with Microsoft Excel, you can enter data, then
manipulate it to produce certain results.

Column headers
This section holds
the column headers.
Each column is
identified by a letter
of the alphabet,
starting with A
Alternatively, you can enter data, then use Calc to
plot the data by changing some of it and observing the
results without having to retype the entire spreadsheet
or sheet.
There are some other very neat features too. You can
create formulas to perform complex calculations on
data. You can use database functions to arrange, store
and filter data. There is a wide range of 2D and 3D charts
available that can be used to plot the data and more.

Unlock LibreOffice Calc features

Tutorial

01

Learn to use various Calc features

Add formulas

The formula bar is located at the top of


the sheet in the Calc workspace. It is permanently
docked in this position, however it can be hidden via
settings. If the formula bar is not visible to you, simply
head to View on the menu bar and select Formula
Bar. The formula bar contains the function wizard
that can be used to search and add a function to the
spreadsheet. To start the function wizard, click on
the f(x) icon located on the function bar. This opens a
dialog from which you can search through a list of all
the available functions.
This can be very useful because it shows the
function formatting, a brief description about the
function and the result that the function would return
if executed on the currently selected cell.
You will also see the summation icon and (=) icon
next to the function wizard icon. Clicking on the
sum icon totals the numbers in the cells above the
selected cell and then places the total in the selected
cell. If there are no numbers above the selected cell,
then the cells to the left are totalled. Clicking on
the Function icon inserts an equals (=) sign into the
selected cell and the Input line, allowing a formula to
be entered.

02

Manage your sheets

Calc allows you to have more than one sheet


in a spreadsheet. Sheet tabs at the bottom of the
grid of cells in a spreadsheet indicate the number of
sheets in your spreadsheet. Clicking on a tab enables
access to each individual sheet and displays that
sheet. An active sheet is indicated with a white tab
(default Calc setup). You can also select multiple
sheets by holding down the Ctrl key while you click
on the sheet tabs. To change the default name for
a sheet (Sheet1, Sheet2 and so on), right-click on a
sheet tab and select Rename Sheet from the context
menu. A dialog opens, in which you can type a new
name for the sheet. Click OK when finished to close
the dialog. To change the colour of a sheet tab, rightclick on the tab and select Tab Color from the context
menu to open the Tab Color dialog. Select your colour
and click OK when finished to close the dialog.

03

Plot charts

Calc lets you plot data graphically in a chart,


based on the values from specific cell ranges. To
create a chart, highlight the data to be included. The
selection doesnt need to be in a single block. You
can choose individual cells or groups of cells. Choose

Insert>Chart from the menu bar. This will insert a


sample chart on the worksheet, open the Formatting
toolbar, and the Chart Wizard.
The Chart Wizard has three main parts: a list of
steps involved in setting up the chart, a list of chart
types, and options for each chart type. Calc offers
a choice of 10 basic chart types, with a few options
for each type of chart. The options vary according to
the type of chart you pick. The first tier of choice is
for 2D charts. Only those types that are suitable for
3D (Column, Bar, Pie and Area) give you an option to
select a 3D look. On the Choose a chart type page,
select a type by clicking its icon. The preview updates
every time you select a different chart, and provides a
good idea of what the finished chart will look like.

The Ubuntu Book 79

Ubuntu apps

Edit formulas in LibreOffice Math


Learn to use LibreOffice Math, the equation editor

Understanding Maths elements Discover the various options at your disposal


Menu bar

Set Operations
& Functions

The menu bar has various basic options


related to handling the software. For
example, File contains commands that
apply to the entire file; such as Open,
Save, Wizards, Export as PDF, Print, Digital
Signatures and so on

In the Elements window the


set of pre-defined formulas,
including set operations
and functions, are defined
in these two options

Operators
&
Attributes
Operators
consists
of a set of
operators
such as limits,
sum, integral,
etc. Attributes
consists of
symbols that
are used with
a variable in a
formula, such
as line below,
circumflex,
and vector
arrow, etc

Others &
Examples
Others consists
of symbols like
infinity, partial,
nebula, arrows,
dotted lines,
etc. Examples
has a set of
equations which
are pre-defined
in Math

Brackets and Formats

Equation editor

Brackets consists of different brackets


used in a formula. It also has brackets
used in matrices. Formats has a set of
pre-defined ways in which a formula
can be written

Equations are written


here or in the Elements
window using markup

We often struggle to insert a chemical


formula or complicated mathematical
equation in a document. Even if you write
it, its not neat. LibreOffice Math is used for writing
mathematical and chemical equations. The equations
and formulas created in it can be accessed in a perfectly
formatted way through documents, spreadsheets,
presentations and drawings. You can create equations
as a stand-alone document or insert it in a LibreOffice

80 The Ubuntu Book

Writer, Calc, Impress or Draw document. To insert the


equation in these LibreOffice components, select
Insert>Object>Formula. Note that the equations can
only be used for symbolic representation.
To enter a formula in Math, you can use the Elements
window, which has categories of formula and symbols
that can be used. Another way to insert any formula is
by right clicking on the equation editor, or directly type
markup in the equation editor. Markup is how you read

Preview window
The equation appears here
during and after input

the formula in English. All the mathematical formulae


are supported by Math and a set of pre-defined
symbols, formulae and a few equations are available.
Want to reuse the pre-defined equation? Just dragdrop the formula from Examples in the Elements
window. Similarly, other formulas, symbols and
equations can be reused from there. Math can also
display chemical formulas. With markup, molecular
formulas, ions and isotopes can be displayed neatly.

Edit formulas in LibreOffice Math

Tutorial

01

Create formulas using LibreOffice Math

Create formula layout

The equation editor uses a markup language


which is similar to how it is read in English. The order of
operation is not known to Math automatically so if you
want to write a function, use brackets to let it know the
order of operation. If brace is required in the formula,
use commands lbrace and rbrace in the markup.
There are a few other characters which are used for
controlling markup and cannot be entered directly as
normal characters. The characters concerned are: %,
&, |, _, ^ and . Either use corresponding markup or use
quotes to identify them in an equation.
To display matrices, Math provides scalable
brackets which grow in size as the size of a matrix
increases. You can use command left/right to make
scalable brackets.
Math helps users in identifying impaired brackets
also. It places an inverted question mark by the
corresponding bracket which disappears when all
the brackets are matched. Math also identifies few
in-built functions. If you want it to identify more
functions, add markup func before it.

Math can also be


used to write chemical
formulas. Complex
molecular formulas can
be easily displayed

02

Formulas in Writer

Formulas can be inserted in LibreOffice


Writer by choosing Insert>Object>Formula from the
menu bar. They are inserted as OLE objects, and are
anchored as characters embedded in the continuous
text. They can be changed to a floating formula if
required. In Calc, Draw and Impress they are added as
floating OLE objects.
Equations created in LibreOffice Writer using
the Equation editor can be numbered and crossreferenced across LibreOffice programs. To insert
a cross-reference, choose Insert, followed by
Cross-reference from the Menu bar and in the
Cross-references tab select Text as Type. Select
the equation number under Selection label and its
reference under Insert reference to, then click insert.
At this point, a stand-alone Math document is saved
as an ODF file, with the single formula. For formulas
that you use often, you can create a library and insert
it in as an OLE object in Writer for easy access.

03

Write Chemical Formulas

Although Math was designed to be used


for mathematical formulas, it can also be used to
write chemical formulas neatly. Since the chemical
formulas are non-italic you need to de-select the
italic attribute first. Now if you want to write chemical
formula for Sulphuric acid, write the markup for
it: H_2 SO_4 or molecular formula for ethanol can
be written as C_2 H_5 OH. For displaying isotopes
with left subscript and left superscript use lsub and
lsup respectively. For example, Uranium isotopes in

markup language can be written as U lsub 92 lsup


238 and U lsub 92 lsup 235. To display charge in the
ion, write empty braces after + or -. Alternatively,
+ and symbols can be enclosed in the quotes.
For example, sulphate ion is written as SO_4^{2-{}}
or SO_4^{2-}, ammonium ion can be written as
NH_4^{{}+{}} or NH_4^{+}.
Apart from different chemical formulas, chemical
equations can also be displayed using Math. To
display chemical equations, Math provides arrows.
But for reversible chemical formulas, it does not have
any suitable arrows. You can customise the catalogue
to add custom fonts which have arrows. Alternatively,
special character for the arrows can be inserted. It is
certainly interesting to play with chemical equations
and display them neatly using LibreOffice Math and
the rest of the LibreOffice package.

The Ubuntu Book 81

Ubuntu apps

Present with LibreOffice Impress


Make impressive presentations with this slideshow tool

Discover LibreOffice Impress Include multiple presentation elements


Menu bar

Standard toolbar

Sidebar

This is the default


menu bar. It is
identical across
almost all LibreOffice
suite software and
offers similar options

This section holds


options to create new
presentations, and save
and print files, as well
as other basic
formatting features

The sidebar has seven sections. To


expand a section you want to use, click
on its icon, or on the small triangle
at the top of the icons, and select a
section from the drop-down list. Only
one section at a time can be open

Slides pane
The slides pane
contains thumbnail
pictures of the
slides in your
presentation in
the order in which
they will be shown,
unless you change
the slideshow
order. Clicking a
slide in this pane
selects it and
places it straight in
the workspace

Workspace
This is the
place where
the slides
are displayed
while you work
on them. You
will see the
slides currently
selected in the
slides pane
right here

Layout selection

Drawing toolbar

These tabs indicate various layouts


available in Impress. Currently there
are five types of layouts present. To
move to a different layout, simply
click the tab

This section is similar to the


drawing toolbar in LibreOffice
Draw. With this toolbar, you can
draw free-form shapes or insert
predefined shapes to the slides

Impress is the presentation program


included in LibreOffice. You can create
slides that contain elements including text,
bulleted and numbered lists, tables, charts and a range
of graphic objects such as clipart, drawings and photos.
Impress also includes a spelling checker, thesaurus,
text styles and background styles.
To use Impress for more than simple slideshows
requires knowledge of the elements that the slides

82 The Ubuntu Book

contain. Slides containing text use styles to determine


the appearance of that text. Creating drawings is similar
to the Draw program included in LibreOffice (p.94).
When you start Impress, the Presentation Wizard
is shown. Otherwise, the main Impress window is
displayed. You can turn the Presentation Wizard on and
off in Tools>Options>LibreOffice Impress>General>New
document by selecting the Start with wizard option.
The main Impress window has three parts: the Slides

Status bar
The Status bar, located at the bottom
of the Impress window, contains
information that you may find useful
when working on a presentation,
like slide number, zoom level, cursor
position and so on
pane, workspace and sidebar. Several toolbars can be
displayed or hidden when creating a presentation.
Impress has five layouts for the workspace that can
be used in different scenarios. They are: normal view,
outline view, notes view, handout view and slide sorter
view. Each workspace view displays a different set of
toolbars when selected. You can customise toolbar sets
by going to View>Toolbars on the menu bar, then check
or uncheck the toolbar you want to add or remove.

Present with LibreOffice Impress

Tutorial

01

Create your first slideshow with Impress

Launch the wizard

The first thing to do is decide on the purpose


of the presentation and set out a plan. Although
you can make changes as you go, you will save
a lot of time by having an initial idea of who the
audience will be, the structure, the content, and
how the presentation will be delivered. To start
creating a presentation, the easiest way is to use the
presentation wizard. If you are launching Impress for
the first time, the presentation wizard will open up
automatically. Otherwise you can launch wizard using
the settings described earlier.
After you have launched the wizard, choose the
type of presentation you would like to create: empty,
from a template or an existing presentation. Well
choose Empty Presentation here. On the next page,
youll be asked to choose a design for the slides.
In the next step, select the slide transition effects.
Then in the step that follows that, enter details about
the author of the slide and other company details.
Finally, step 5 will show you a brief picture of what the
slideshow will look like.

02

Add more slides

After the presentation wizard finishes, you


have a new slideshow with only one slide. Let us see
how to add new slides, select layouts and modify
slide elements. To insert a new slide, simply go to
Insert on the menu bar and select Slide. You can

also duplicate a slide by selecting the specific slide


you want to duplicate from the Slides pane and then
clicking on Insert on the menu bar and selecting
Duplicate Slide.
When creating a presentation, the first slide is
normally a title slide. You can use either a blank layout
or one of the title layouts as your title slide. But if you
want to have different layouts for different slides,
click on the Properties icon at the side of the sidebar
to open the Layouts section and display the available
layouts. The layouts included in LibreOffice range
from a blank slide to a slide with six content boxes
and a title.

03

on the slide. To remove an unwanted element, click


the element to highlight it. The resizing handles show
it is selected. Then simply press the Delete key to
remove it.

04

Add and format text

Many of the slides are likely to contain


some text. Text used in slides is held in text boxes.
You can add two types of text boxes to a slide, first
by choosing a predefined layout from the Layouts
section of the sidebar. These text boxes are called
AutoLayout text boxes. A second option is to create a
text box using the Text icon on the Standard toolbar or
the Text toolbar, or use the keyboard shortcut F2.

Modify slide elements

A slide contains elements that were included


in the slide master, as well as those elements
included in the selected slide layout. However, it is
unlikely that the predefined layouts will suit all your
needs for the presentation. You may want to remove
elements that are not required, or insert objects such
as text and graphics. Impress allows you to resize
and move the layout elements. It is also possible to
add elements without being limited to the size and
position of the layout boxes. To resize a contents box,
click on the outer frame so that the resizing handles
are displayed. To move it, place the mouse cursor on
the frame so that the cursor changes shape. You can
now click and drag the contents box to a new position

The Ubuntu Book 83

Ubuntu apps

20 LibreOffice tips & tricks


Make your working day more productive with these
indispensable tips for the LibreOffice suite
Using office software for very specific tasks, you
can end up sticking yourself in a rut with the way
you work. You do the same thing the same way every
single time, not considering any other methods that
might make it faster, better or more efficient. When
you write several letters or documents a day for work,
or maybe create spreadsheets with regularity, you
dont really ever need to learn new techniques. We all
get stuck in our ways.
Its sometimes difficult to comprehend just how
powerful LibreOffice can be, especially when youre
treating it as you normally do and not making the
most of what it has to offer. On a day-to-day basis,
you may have no idea about macros, creating
indexes or doing a mail merge with Writer. Over the
next few pages, we are going to highlight some of the
best ways you can improve your use of LibreOffice,
with a particular focus on the core Writer and Calc
programs. Youll optimise the way you work and start
making the most of this feature-full office software.

Above Learn
how to use the
LibreOffice apps more
productively

Writer

01

Bring up formatting

When formatting a piece, perhaps for


greater readability or to make sure it prints properly,
it can be a tricky to figure out exactly why certain
sections of text are acting the way they do. On the
toolbar is a symbol that looks like a backwards P
click that to reveal live formatting symbols, such as
rogue paragraph breaks.

If youre working with


files for Microsoft Office,
you can change the
default file format
84 The Ubuntu Book

02

Better bullet points

Creating a list of bullet points is fairly easy; click the type with dots or numbers and go. You can change
the formatting of these bullet points to be different symbols or letters instead of numbers. You can, however, also
create nested lists by using the Tab key to create sub lists, and then press Shift+Tab to go back to the standard list.

20 LibreOffice tips & tricks


04

04

Quick
maths

Quick maths

Even when youre writing, you might need


to do a quick bit of maths. Instead of switching to
Google or a calculator app, you can use the formula
bar. Go to Insert, Object, Formula and write out
the calculation you want. Once you confirm it, the
outcome of the formula appears where your cursor
was placed.

03

Paste unformatted text

Generally in Linux, you can use Ctrl+Shift+V to paste text and remove its formatting at the same time.
If you use this in Writer, or find Paste Special in the Edit menu, you then have several options of how to paste the
text. One of these is unformatted, but it also allows for other methods, such as using LibreOffice formatting.

On a day-to-day basis,
you may have no idea
about macros or creating
indexes in LibreOffice

07

Create a
backup
system in Writer

05

Quick navigation

Pressing F5 or going to the View menu will


allow you to use the Navigator function. You can
use it in large documents to quickly move between
different headings, tables, graphics, bookmarks
and many more objects in the document. Its not a
proper dock, so you can move it around to see what
you want at any given time.

06

Writer has a recovery


tool
for
when
unexpected shutdowns
happen, but that relies
on temporary files and
other related files that
arent always there
when you really need
them. Writer does have
a backup system that
it can make use of
though; enable Always
create backup copy in
the Load/Save General
options to cover this.

Set default document format

By default, Writer will save new files as ODTs,


the open document format. This works in most other
word processors, but if youre regularly working with
files that need to work on Microsoft Office, you can
change the default file format to be .doc or .docx. Go
to Tools, Options and find the General settings under
Load/Save to change the default.

08

Change case

Got a sentence
or a word and its not
capitalised correctly?
Pasted
some
text
and its all randomly
capitalised? You can
change the case of
specific sections of
text without re-writing.
Simply select what
you want to change,
right click and use the
Change Case option.

Full app
explanation
As luck would have
it, if you're unsure of
everything that comes
in LibreOffice as part
of the suite, we cover
it extensively in our
guide to the best Linux
software starting on
page 114. There is more
to LibreOffice than
just Writer and Calc,
after all.

The Ubuntu Book 85

Ubuntu apps

Calc

Learn more!

11

Change status bar preview

12

AutoFilter rows

13

Grouped cells

When you select some cells with a numerical


value inside, you get a handy prompt on the status
bar that tells you the value they add up to. That
might not be what you want all the time, though.
Click on that area of the status bar to bring up
a menu and change it to average, maximum or
minimum numbers in the selection.

09

AutoFormat tables

If youve created a table, you may need to give it


colours to make it more readable. You can do this manually,
however Calc has a built-in format option under Format>
AutoFormat. From here you can give a colour scheme to a table that youve
selected and even customise what is taken into account for formatting.

10

Protect your spreadsheet

Shared spreadsheets are good for productivity, but the more complicated
they become, the more difficult it can be to track down an accidental change
made by one of the users. You can protect the spreadsheet by using Tools>
Protect Document>Sheet to give it a password so that only certain people can
make changes.

There are many more


functions to learn that
can help you do more
with LibreOffice and
the first step is to have
a look through some
of the documentation
for the software,
or just have a quick
browse through all of
the options and the
available menus.

Filtering rows helps to organise data, but if youre not


sure how exactly to go about doing that, Calc has an automatic
filtering tool you can use. Select a row, then go to Data>Filter>
Auto for it to create an automatic filtering system based on that row. You can also
modify it a bit once its in place.

Sometimes you dont need to see specific chunks of data all the time, and
collapsing it like in a piece of code will add a bit more space to the viewable page.
Using the Outline function under Data>Group and Outline>AutoOutline, you can
create these collapsible groups, which use a thick outline to indicate themselves.

Calc is very smart when it comes to


replicating cells

10

86 The Ubuntu Book

Protect your
spreadsheet

20 LibreOffice tips & tricks

Miscellaneous
17

14

Auto-increment or copy cells

15

Change Enter key

Presenter
mode

If youve never stumbled across it, Calc is very


smart when it comes to replicating cells. If you write
down two or three numbers or even dates, selecting
one and dragging the black square down to copy will
automatically fill in the cells with numbers or dates
in the correct sequence. If you dont want it to do
that, press and hold Control when copying the cell
for regular duplication.

It seems fairly natural for the Enter key


to move you down a row of cells and thats what
Calc does by default. However, you can actually
change the behaviour of the Enter key by going to
Tools>Options>LibreOffice Calc, then General to
have it move along a row instead.

17

Presenter mode

18

Switch between languages in spellcheck on the fly

19

Insert readable formulas

When using Impress for presenting


slides, you will often be hooked up to a projector
or television that either mirrors or acts as an
extension to your laptop. Impress has a neat
feature where the actual presentation will be
shown on the big screen, while you can turn on a
presenter console just for your laptop display that
shows you whats coming up in your presentation,
along with notes.

Well illustrate this with an example: perhaps you


need to paste into a document a paragraph from
Napoleon that is written in French. The rest of the
document is in English, so the spell check flips
out at words from over the Channel. Highlight the
paragraph, click Tools>Languages and then select
a language for this section of the document, and
only this section.

16

Freeze columns in place

If you have a lot of data, rows or columns


you can sometimes find yourself browsing the
spreadsheet not always able to remember or divine
what cell is for what. By selecting a row or column
you always want to be visible, go to Window then
Freeze to keep it always on the top or on the left as
you browse the spreadsheet.

There is a completely separate application


for LibreOffice called Math that is not, in fact,
database software, but actually a way to draw up
mathematical equations that can then be inserted
into other LibreOffice software. This is good if
youre writing an academic paper with ridiculous
maths that needs to be readable.

Impress has a particularly


neat feature where the
actual presentation
will be shown to the
audience on the big
screen, while you can
turn on a presenter
console just for your
laptop display that shows
you whats coming up in
your presentation, along
with notes

20

Using PDFs

PDFs can be edited in LibreOffice. Simply


import them using something like Writer and it will
dump the PDF into the Draw application. You can
edit text, change pictures and even the general
formatting of the PDF. Once its done, Draw allows
you to export the working file as a PDF for everyone
to use.

The Ubuntu Book 87

Ubuntu apps

Text editing with Gedit


Understand its features and learn about its many purposes

Discover Gedit

Understanding the user interface

New file

Save file

Undo/redo buttons

This button lets you create


a new file in Gedit. As
you click this, new tabs
will be created with new
files. Youll be asked for a
location when saving files

After you are done with


editing the file, click this
button to save your work. If
it is a brand new file, youll
also be asked to enter the
save location

You can undo your


actions in the file or
choose to redo them
using these buttons

Search file
The magnifying
glass icon lets
you search a
file, and the
next icon with
a pencil on top
lets you replace
the searched
term with an
alternative one

Open file

Print file

You can open existing


files from here. Just
click on the button and
select the file(s) you
want to open

This button lets you print


the file directly from the
application. Youll be
prompted to add a printer if
you havent already

Text Editor (aka Gedit) is the default GUI


text editor in the Ubuntu OS and the GNOME
desktop environment. It is UTF-8 compatible
and supports most standard text editor functions as
well as many advanced features like multilingual spellchecking, extensive support of syntax highlighting,
and a large number of official and third-party plugins. With multiple character sets, Text Editor can
play a versatile role - you can use it to prepare simple

88 The Ubuntu Book

Edit buttons

Status bar

Youll find the edit options


(cut, copy and paste) here.
You can also use the common
keyboard shortcuts Ctrl+X,
Ctrl+C and Ctrl+V to
accomplish these actions

This bar shows


the file details,
such as encoding,
current cursor
position, tab width
etc, in real time

notes and documents, or create source code using its


advanced features just like an integrated development
environment. Gedit is installed by default on Ubuntu
15.10 and can be launched via Dash or an application
shortcut. If you prefer the command line, you can use
the gedit command to directly interact with the tool.
To open a specific file with Gedit, type gedit
<filename> at the command prompt. To open multiple
files, type gedit <filename1> <filename2> and

so on. You can also open a file at a specific line number


by including +<line number> in the file path, like this:
gksudo gedit +21 /etc/apt/sources.list.
Gedit offers several helpful options, under Edit>
Preferences, that you may want to review. For example,
Gedit automatically creates a backup copy of files you
edit. If you are running low on space, however, you can
disable this: just go to Edit>Preferences>Editor tab and
deselect Create a backup copy.

Text editing with Gedit

Tutorial

01

Dive deeper into Gedits features

Handling files with Gedit

Weve already seen how to open files in


Gedit via the command line. Let us now dive deeper
to understand how to manage files in Gedit. To
open a file or set of files in the Gedit GUI, click the
open button or press Ctrl+O; in the dialog, select
all the files you want to open and click Open.
Also, by default, Gedit provides easy access to
five of your most recently used files. To open one,
click the downward-facing arrow to the right of
the open button. Gedit will display a list of the five
most recently used files. Select the desired file and
it will open in a new tab. You can also open files that
are located on other machines with Gedit. However,
prior to opening a file on a server from within Gedit,
you need to know some technical information about
the server. For example, youll need the IP address
or URL of the server, and may need to know what
kind of server it is (HTTP, FTP etc). Once you have the
necessary information, go to the open dialog and click
the pencil icon to enter the IP address/URL of the
server. Select the file and click Open. If you have the
required privileges, the file should open.

02

Handling text with Gedit

The Find tool can help you find specific


sequences of text within in your file. To open
the search window, click Menu Button>Find, or
press Ctrl+F. This will move your cursor to the start of
the search window. Type the text you wish to search

for in the search window. As you type, Gedit will


begin highlighting the portions of text that match
what you have entered. You can scroll through the
search results using the up/down arrow keys or by
pressing Ctrl+G.
You can also highlight a portion of text with
your mouse, and then press Ctrl+F. The text
youve highlighted will automatically appear in the
search window. For more search options, click on
the magnifying glass icon in the search window.
You can select one or more of the following search
options: select Match Case to make the search casesensitive; select Match Entire Word Only to search
only complete words; select Wrap Around to search
text from top to bottom and cycle back again.

03

04

Plug-ins

Plug-ins greatly enhance the power of Gedit


and are accessed via Edit>Preferences>Plugins. More
than a dozen plug-ins are pre-installed and can be
enabled/disabled within this section. Extra plug-ins
are available via the Internet.
Here are just two of the plug-ins that can help you
with your day-to-day activities
Tag List Displays common tags in a side pane and
allows for easy insertion into the file.
External Tools This allows the user to run external
commands on the file being edited from within Gedit
itself. Once this plug-in is enabled, the user can select
custom tools from the Tools menu. Note that this is
not enabled by default.

Syntax highlighting

If you would like to use Gedit for text


editing, you have the option to highlight the lines of
code you write. Gedit uses the GtkSourceView for
syntax highlighting. It uses .lang files to define the
highlighting schemes. The .lang file for a specific
programming language is located in the /usr/share/
gtksourceview-3.0/language-specs/ folder.
You can enable code highlighting via the menu by
going to View>Highlight Mode, or via the lower status
bar. The status bar, enabled via the View menu,
displays programming language options for
many types of sources, scripts, markup and
scientific formats.

The Ubuntu Book 89

Ubuntu apps

Create discs with Brasero


Use Brasero to quickly create CDs and DVDs from your computer
Despite flash drives taking centre stage
among media storage platforms, optical
drives offer some unique advantages
too, such as lower cost. This makes optical storage
devices the tool of choice when storing data that is
read only or distributing to a bigger audience. For
example, while it is financially difficult to give away
a 100 flash drives to attendees at an event, you
probably wouldnt mind distributing 100 DVDs.

Ubuntu comes pre-installed with a great utility


called Brasero in order to help you create CDs, DVDs
and more with great ease. Note that this is the default
CD/DVD-burning utility for Linux distributions running
the GNOME desktop.
Brasero allows you to burn, copy and erase CD and
DVD media. Some of the interesting features include
on-the-fly burning, multi-session support and quick
conversion of music playlists in all formats.

Navigate the Brasero UI

To open Braser, go to the Dash and search for


Brasero. When it opens you will see the starting
wizard, where you can select the type of project you
want to start, such as an audio project, video project,
disc copy and so on. For example, to burn an ISO
image you can simply choose Burn Image. Once you
have selected the project type, youll need to add the
files you want written to disc to the Brasero interface.
Next, simply click Burn to write the files to disc.

Master the various CD/DVD-burning options in Brasero

Audio project

Recent projects

Select a disc

You can click on this


link to create an audio
project. An audio project
lets you add music and
other audio files to your
optical disc

This is the where you will


be able to easily view all
your recent projects

Once you have launched


the Disc Checking utility,
select the disc or .iso
image youd like to check
for integrity using this
drop down menu

MD5 integrity check


Enable this option if youd
like to check the integrity
using the MD5 algorithm.
Note that you should
have the checksum file
(of the disc) that you are
trying to check in order to
use this feature

Data project

Video project

Disc copy

Burn image

This link lets you create


a data project. Under
this project type you
are able to add any
number of files to your
optical disc

You can click on this


link to create a video
project. A video project
lets you add all types
of video files to your
optical disc

You can easily duplicate


a complete disc using
this option. Once you
have clicked this icon
youll be asked to select
the disc to copy

Selecting this
option, you can
write an existing
CD/DVD image
directly to the
optical disc

90 The Ubuntu Book

Create discs with Brasero


Create ISO images with Brasero
With Brasero you can create an .iso image under any project type. You can choose
to use an audio project, a video project, a data project or anything else and write
the contents as an .iso file onto your hard disk. To get started, open Brasero, click
on the appropriate project type and then tap the plus sign in the top left-hand
corner. Select the files and folders that you want to include in your ISO image. To
select more than one, hold down Ctrl and select the desired items. Once complete,
click the Add button. At this point you should make sure that there is no blank CD/
DVD inside your optical drive so Brasero wont automatically burn those files to CD.
Next, click the Burn button. Now Brasero will automatically create an ISO file. This
file is called brasero.iso by default, and will be saved inside your home directory.

Make sure that there is no blank CD/


DVD inside your optical drive
Disc copy with Brasero

Disc integrity check

Duplicate a disc with the Brasero app

Check disc integrity using Brasero

To burn a CD/DVD disc using


Brasero, you will first need to make
sure that your computer has a
CD/DVD burner. If your computer
does meet all the requirements,
insert the CD/DVD with the data
you wish to rip, then go to Dash and
search for Brasero. When it opens,
select Disc copy. This function
will serve to duplicate the content
from one disc to another.
Brasero will open and
automatically recognise the
content on the disc if Ubuntu

is able to access your CD/DVD


burner. From there you can then
click Copy to create a single copy
from the source disc.
To make multiple copies of
the disc, click the Make Several
Copies button. When prompted,
click to install a required package.
Brasero will begin copying the
disc. When the disc has finished
copying, it will prompt you to insert
a blank writable CD/DVD disc.
Insert it and wait for it to finish
writing the content to the disc.

Brasero ships with a built-in disc


integrity checker tool, meaning
that you can check whether a disc
is corrupt or not simply by running
the tool. Its much better than
finding out midway through using
the disc or image. So lets learn
how to use the disc integrity tool.
To launch the utility, start by
selecting Tools>Check Integrity. In
the window that opens next, select
the disc that you want to check
from the drop down menu. Then
you can select the option to use

an MD5 file in order to check the


disc. An MD5 (Message-Digest
Algorithm 5) is a cryptographic
hash function thats widely
used for checking data integrity.
Note that if you choose this
option, you will have to select the
corresponding MD5 file by clicking
on the folder icon, which is placed
below. When everything is set and
ready to go, tap Check to begin
the checking process. Youll get
a notification about the result as
soon as the process finishes.

Cover editing with Brasero


To launch the cover editor, open Tools>Cover Editor.
When you first see the cover editor dialog, you will not
be able to click on any of the text-formatting options.
You will need to select the cover you want to work on
first in order to use these options.
With the cover open, once you have chosen the
formatting you wish to use for the text, simply type
away. You can then scroll down in order to see
the side and back inlay for the jewel case. Click
the Background properties toolbar icon if you want
to add a background for the current cover, or you can
right-click on the cover you wish to edit and select
Set Background Properties. Here you could choose
a coloured background or to select a background
image. Click the Close button to apply the changes
and close the Background Properties dialog. Then
you can go ahead and print using the Print button,
which will be located in the top right-hand corner of
the dialog.

Choose a coloured
background or to select a
background image
The Ubuntu Book 91

Create with
Ubuntu
94 Work with LibreOffice draw
Create cool vector graphics

96 View images with Shotwell


Make viewing images seamless

98 Manage images
with Shotwell

94

96

Keep tabs on large numbers of image iles

100 View movies with Videos


View videos with Ubuntus default app

102 Listen to songs


with RhythmBox
Use this background music app

104 Touch up photos


with GIMP
Enhance your photos like a professional

108 Discover PulseAudio


We reveal its mind-blowing features

98

Ubuntu is a great choice for


creatives, as it offers more
customisation of the workspace
100

102

92 The Ubuntu Book

104

The Ubuntu Book 93

Create with Ubuntu

Work with LibreOffice Draw


Use LibreOffice Draw to create cool vector graphics
LibreOffice Draw is a vector graphicsdrawing program. It can also perform
some operations on raster graphics (pixels).
Using Draw, you can quickly create a wide variety of
graphical images. Vector graphics store and display
an image as an assembly of simple geometric
elements, such as lines, circles, and polygons, rather
than single pixels (points on the screen). As such, they
allow for easier storage and scaling of the image.

Draw is fully integrated into the LibreOffice


suite, which simplifies exchanging graphics with all
components of the suite. For example, if you create
an image in Draw, reusing it in a Writer document is
as simple as copying and pasting the image. You can
also work with drawings directly from within Writer
or Impress using a subset of the functions and tools
from Draw. Even though LibreOffice wasnt designed
to rival high-end graphics applications, it possesses

Discover Draws features

more functionality than the drawing tools that are


generally available in most office productivity suites.
A few examples of the drawing functions are:
layer management, magnetic grid-point system,
dimensions and measurement display, connectors
for making organisation charts, 3D functions that
enable small three-dimensional drawings to be
created (with texture and lighting effects), drawing
and page-style integration, and Bzier curves.

Understand the Draw toolbars

Drawing toolbar

Standard toolbar

Menu bar

Sidebar

This toolbar contains all the necessary


functions for drawing various
geometric and freehand shapes and
organising them on the page. It is
docked vertically on the left-hand side
of the Draw window by default

This shows various toolbars as


and when you enable them via the
View menu option. By default,
the Standard toolbar is displayed,
which has options related to saving
files and the like

This is the area that has


various top-level menu
options. Note the View
link here. This is used to
enable various toolbars
in Draw

The Sidebar is common among


LibreOffice suite software. It has
four main sections Properties,
Styles and Formatting, Gallery
and Navigator to help you gain
access quickly

Properties sidebar
Opens sub-sections
for object properties
that you can change to
suit your requirements.
The sub-sections are
context based

Pages pane

Workspace

Status bar

The Pages pane gives an overview of


the pages you create in your drawing. If
it is not visible, go to View on the Menu
bar and select Page Pane. To make
changes to the page order, drag and
drop one or more pages

Workspace is where you create your


drawings. This drawing area can
be surrounded with toolbars and
information areas. Note that the
maximum size of a drawing can be
300cm by 300cm

It includes several
Draw-specific
fields like object
size, slide number,
unsaved changes,
zoom level etc

94 The Ubuntu Book

Work with LibreOffice Draw


Drawing basic shapes
LibreOffice Draw provides a wide range of shapes
located in palettes that can be accessed via the
Drawing toolbar. To draw a straight line, for example,
start by clicking on the Line icon and placing the cursor
at the point at which you want to start the line. Then
simply drag the mouse while keeping the mouse button
pressed. Release the mouse button at the point at
which you want to end the line.
A selection handle will appear at each end of the
line, showing that this object is currently selected.
The selection handle at the starting point of the line is
slightly larger than the other selection handle. Press
the Ctrl key while drawing a line if you want to enable
the end of the line to snap to the nearest grid point.
To draw a rectangle, click on the Rectangle icon in
the Drawing toolbar or in the Insert Shapes sub-section
in Sidebar Properties. Drawing the rectangle with the
mouse cursor, it appears with its bottom right corner
attached to the cursor. To draw a square, click the
Rectangle icon and hold the Shift key while you draw.

Add text

Connectors and Glue points

Learn how to add text in LibreOffice Draw

Manage shapes with handle connectors and Glue points

To add text to your creations


in LibreOffice, you will need to
activate the Text tool. Click the
Text icon for horizontal text or the
Vertical Text icon for vertical script.
If the latter isnt visible, check
that Asian has been selected
in Tools>Options>Language
Settings>Languages.
You could display the Text
Formatting toolbar (View>Toolbars)
or use the Character section in the
Properties pane of the sidebar to
select font type, font size as well

as other text properties before


you begin typing.
After activating the Text
command, click the location where
you want to position the text. A
small text frame will appear, and
can be moved like any other object.
A text frame is also dynamic
and grows as you enter text. The
information field in the status bar
shows that you are editing text and
provides details about the current
cursor location using paragraph,
row and column numbers.

Connectors are lines or arrows


whose ends snap to a glue point
of an object. They are especially
useful in drawing organisation
charts, flow diagrams and mindmaps. When objects are moved or
reordered, the connectors remain
attached to a Glue point.
Glue points are not the same
as the selection handles of an
object. The handles are for moving
or changing the shape of an
object, whereas Glue points fix or
glue a connector to an object so

that when the object moves, the


connector stays fixed.
All Draw objects have Glue
points, which are not normally
displayed. These become visible
when the Connectors icon is
selected from the Drawing toolbar
or the Insert Shapes sub-section in
Sidebar Properties. Most objects
have four Glue points. You can add
more and even customise them
using the Glue Points toolbar. To
open the Glue Points toolbar, head
to View>Toolbars>Glue Points.

Editing objects
Once you have added and shaped the objects, you
may want to colour or format them. To do this youll
need to enable various toolbars.
The Text Formatting toolbar, the Sidebar
Properties section or a context menu can be used to
edit an object, or you can change attributes such as
colour or border width, the Line and Filling toolbar.
By default, Draw doesnt show the Line and Filling
toolbar. To see it, go to View>Toolbars>Line and Filling
on the Menu bar to open the toolbar at the top of the
workspace. The most common object attributes can
be edited using this toolbar. You can also open the
Line dialog by clicking on the Line icon and the Area
dialog by clicking on the Area icon for access to more
formatting options.
You can also open the Text Formatting toolbar
by going to View>Toolbars>Text Formatting on the
Menu bar. Note that the tools on this toolbar will not
become active until text has been selected.

The Ubuntu Book 95

Create with Ubuntu

View images with Shotwell


Good image-viewing software makes the experience more comfortable
Shotwell is a Janus-headed application: it
consists of a picture database and viewer.
This page looks at the viewer component; turn
to page 98 for more on managing features.
Double-click any image in Nautilus in order to open
it in the viewer. By default, the image will be shown in a
fashion to fill the active area in the most efficient way:
increase or reduce the size of the window, and the
dimensions of your image will follow suit.

Handle the viewer

Performing an exact analysis of the image


involves displaying it with a 1:1 zoom level. Shotwell
accomplishes this need via a special button, which
displays images without zoom. In this case, the image
can be panned via a drag-and-drop type of motion.
When you are working with multiple similar images
in Shotwell, press the Delete button in order to delete
the file thats currently open for editing. This feature is
especially helpful when you are analysing multiple files

to find the best one and get rid of the rest, via one of
various sieve methods.
Shotwells viewer component derives its
tremendous speed from being simple: its small file
size is accomplished by reducing unneeded editing
operations. This, however, does not mean that the
product cant be used for editing: right-click an image,
and use the Open with dialog to defer the image to
another editor.

When viewing images, a batch of advanced features tame the flood

Local file switching

Current file name

Rotation controls

Click the next and previous


buttons to switch between files in
the folder containing the currently
displayed image. This permits you
to take a look at an entire camera
roll with minimal effort

Should you need to find


the picture being shown
currently, take a look at
the title bar. It always
displays the file name

Viewing images the wrong way leads to


headaches and nausea. Use the rotation
toggles to turn the image round by
90-degree steps. When closing Shotwell,
the product will ask whether your changes
should be saved

Picture area

Zoom to fit

This area is
dedicated to your
images. You can
click, drag and
pan around to your
hearts content

Click this
button in order
to make the
image fill the
window in the
most efficient
fashion
possible.
Shotwell will
even attempt
to minimise
white space on
the borders at
all expense

Zoom-state indicator

1:1 zoom

Judging an image requires information


about the amount of data contained. The
zoom-state indicator informs you about
the currently active zoom level, putting the
on-screen display into perspective

Rating images is best accomplished


without zooming artefacts. Press the
1:1 button to tell Shotwell to disable all
scaling. Each screen pixel gets mapped
to an image pixel directly in this mode

96 The Ubuntu Book

Picture counter
This label informs you
about the number of
images in the currently
selected folder

View images with Shotwell


Film strip view
Navigating through images blindly is not exactly
comfortable; making Shotwell render an overview
of all files contained in the currently selected folder
simplifies your life.
Enable the bottom bar by clicking View>Image
Gallery; it will populate itself automatically the
moment it is cast onto your screen. Sadly, the
width and height of the widget cannot currently be
controlled you are limited to clicking one of the
images, which then shows up in the picture area.
Alternatively, pictures can also be right-clicked in
order to access a context menu offering advanced
features, such as printing.
Shotwell can also display additional information
on the currently opened image. This is accomplished
via a second slide-out bar, which can be opened via
View>Side pane. It displays a large list containing
all kinds of metadata most of it is collected from
the EXIF header written by most digital cameras.
Furthermore, its width can be adjusted to suit your
taste simply drag the border around to change the
size of the side pane.

Open the containing folder

Change your wallpaper

Managing pictures is best done in Nautilus

Give your workstation that personal touch

The window used to open Shotwell


tends to end up closed in the heat
of the action. Fortunately, this
problem can be solved by rightclicking the picture area to open
the context menu. Select Show
containing folder and check out a
newly opened instance of Nautilus
showing the file in question.
Be aware that a lot of useful
file operations can also be done
right from Shotwell. The right-click

context menu provides an option for


moving a picture to the Trash of your
system. Doing this via Shotwell is
beneficial, as the file sequence does
not get affected changing the file
system while Shotwell is open can
ruin the image display sequence.
Furthermore, the copy menu
item copies the images contents
into the clipboard; putting it into a
LibreOffice document becomes as
easy as pressing Ctrl+V.

Changing your desktop wallpaper is


an easy and sure-fire way to show
that your workstation is yours.
If you have a picture open in
Shotwells viewer, simply right-click
the image and select the option Set
as Wallpaper.
Shotwell will then assign the
image immediately, but will also
present a flyout menu that provides
access to Ubuntus Desktop
appearance panel. The Look tab

lets you adjust the zoom mode


and the colour that is used for
padding out the space simply play
around with the settings until the
preview shown in the dialog looks
satisfactory to you.
Be aware that Shotwell does not
contain a cropping module. If you
want to remove any parts of the
image before displaying them, an
image editor, such as GIMP (covered
on page 104), is the better choice.

Print images effortlessly


Right-click the Picture area and select Print in the
context menu in order to kick off the printing process.
The General tab contains the well-known group of
options used in other Ubuntu applications Page Setup
allows you to set all kinds of paper options.
Shotwell expands Ubuntus print dialog with an extra
tab called Image Settings. It provides a set of controls
enabling you to adjust the position of the image on the
page if you dont want to fill the entire page with the
picture, use the width and/or height controls to reduce
the girth of the image at hand.
Achieving perfect prints of your photographs is an art
of its own: colour calibration, paper choice and printer
settings are topics that could fill a bookazine of its own.
In general, try to find a combination of paper, ink and
settings that work best for you getting colours 100 per
cent correct is important only if pictures are intended
for sale or competitions.

The Ubuntu Book 97

Create with Ubuntu

Manage images with Shotwell


Keep tabs on large quantities of photographs with ease

Organise your shots

Store and retrieve your pictures in no time at all

Last Import view

Camera list

Events list

Border indicator

Click this part of your image


library to put focus on the
latest addition. This can be
helpful if you want to see
what items were added to the
collection last especially
handy if youre a lazy tagger

This part of the main list


provides an overview of
all external storage media
currently connected to your
workstation. It is a prime
destination for starting
import operations

Images get catalogued


according to the date
when they were taken.
Click any of them
in order to limit the
content shown in the
picture area

Images can be selected for bulk


processing. Shotwell displays selected
pictures with a blue frame using an
overlay would affect the originality of
the pictures at hand

SQLite powered
Shotwell stores its data
in a SQLite database.
This leads to significant
performance increases
over traditional flat file
storage and might even
permit networking to be
added one day

Tag list
What the Events list is to
events, the Tags list is to
tags: a really helpful tool for
singling down on interesting
image material

Most users treat Shotwell as a simple


image viewer: a picture is double-clicked
in Nautilus and pops up in Shotwell.
Using the product as a simple picture viewer entails
losing out on a set of valuable helper features. Shotwell
comes with a relatively sophisticated database
based on SQL technology: pictures can be stored and
retrieved with blazing speed. Various advanced options
let you tailor the display list to your needs: if Shotwell

98 The Ubuntu Book

Image display

Zoom lever

Shotwell displays the contents


of the currently selected
section on a grey background.
Double-click any of the pictures
in order to open them for fullscreen viewing

The size of the image elements in the


display area can be adjusted to your
needs. Simply drag the lever to the
left or right in order to find the correct
balance between information density
and picture quality

is set up correctly, it will significantly reduce the time


needed to find specific images in your (ever-growing)
collection of files. If your digital camera is set up
correctly, Shotwell will analyse the EXIF data in order
to find out date and other information automatically
getting all photos from one event in one place is a
matter of one click.
The tutorial on the adjacent side of the screen
assumes that you already passed through the initial

configuration of the product. If this is not the case,


enter Shotwell into the dash. Click Shotwell Photo
Manager in order to start the application, and click
the OK button when confronted with the Welcome
to Shotwell dialog. Its default settings can be
accepted without further ado be prepared to wait
a few minutes as the database gets populated with
the images and screenshots found in your profiles
pictures folder.

Manage images with Shotwell

Tutorial

01

Handling images with Shotwell

Import the images

After coming home from an event, start


Shotwell and insert the memory card of your
digital camera into an internal or external card
reader. Shotwell will grasp the storage medium
automatically, and display it as an item in the
Cameras section of the tree. Wait while the progress
bar at the bottom is populated the app must
read each of the images in order to obtain further
information about it. Next, click the Import all button
at the bottom-right corner of the screen. Shotwell
will start to copy the images to your workstations
Pictures folder this process can take quite a bit of
time if the files involved are large.
When done, a message titled Keep or Delete will
be displayed. It permits you to decide whether the
images should stay on the memory card picking yes
is not an issue, as they will not be imported again.

02

See what happened

When the import process is done, your hard


drive will lack quite a bit of free space. The tree view
on the left-hand side of the screen will show a group
of new folders that correlate with the dates of when
the imported pictures were taken.
Its important that you do not touch the sub folders
in the Pictures directory of your profile. Shotwell
creates an elaborate folder structure that simplifies
correlation with the database moving files around
can have disastrous consequences.

03

Name events and add tags

If Shotwell is left to its own devices, the


pictures will be grouped by the day they were taken.
Since dates, on their own, are not particularly
informative, assigning helpful names is sensible.
Right-click any of the date entries and select
Rename Event in order to make the default name
editable. Enter a new name and press return to
commit your changes.
Tags provide a second level of context, which is
overlaid above the date information. Tagging images
is quite easy: select one or more, right-click the
group and proceed to choosing the Add tags option
in the resulting context menu. Shotwell responds by
displaying a pop-up where one or more tag strings
can be entered. Once tags are added, they show up in
the tree view automatically. Simply click a tag to show
all images bearing it.

04

mode, and right-click it. Next, select Send to. The


pop-up window allows you to select the format
picking JPG ensures that Shotwell generates an
industry-standard picture file. After clicking OK, the
program displays a dialog permitting you to select the
target; images can be sent via Bluetooth or email.

05

Share in Bulk

Sending images out one by one is painstaking.


Fortunately, Shotwell can also convert groups of
pictures in one go. Start out by selecting them in
Overview mode (Shift/Ctrl+click), and proceed to
selecting File>Export. Shotwell will start out by
displaying the format selection dialog from step four,
which will be followed by a common dialog permitting
you to select a storage destination.

Share RAW files

Be it fast-moving objects or the darkness of


the Albaycin in Grenada, when the imaging situation
gets tough, shooting in RAW helps you to make the
most of your images. Sadly, the resulting files are not
well-suited for sharing; most people dont have the
necessary viewer on their machine.
Shotwell provides a RAW exporter which can be
used to transform most wide-spread camera files
into their JPEG equivalents. Get started by doubleclicking the image in order to open it in full-screen

The Ubuntu Book 99

Create with Ubuntu

View movies with Videos


If a picture says a thousand words, a video contains an entire book
Watching movies has been a stock job
of PCs ever since Microsoft introduced
Windows 3.1. Ubuntu comes with a pretty
nice media player application which can handle both
DVDs and normal movie files.
Clicking a video in Nautilus opens the Videos
client application. On most computers, playback is
hardware accelerated by and large, the playback
controls themselves behave as in most other media

players. Click Play or Pause as usual; drag the time


bar along the screen to change the playback position.
Adjusting video resolutions is a losing game: if
you record in high resolution, users will complain
about high resource consumption and large file
size. Encoding in low resolution might remedy these
issues, but opens the door to choppy and grainy clips.
Ubuntus Videos application attempts to address
this problem by providing a flexible scaling engine.

Increase or decrease the size of the window in order


to make the video fit your desktop better.
When Videos is used in conjunction with physical
media, the product can display subtitles if they are
embedded in the movie being played back. Another
nice feature involves the changing of the language:
if your DVD contains tracks in English and German,
a single right-click is enough to select the correct
playback language.

Get smart with viewing videos Discover the possibilities of Ubuntus Video
Play area

Currently selected file

Playlist overview

This part of the Videos application


acts as host for the currently-playing
content: if the form factor does not
match the video, black padding bars
are generated automatically

Keeping check over a large batch


of videos isnt always easy. The title
bar of the videos app always shows
the file name of the multimedia
document being played back

Should you ever feel the need to


batch up multiple videos after
one another, use the playlist
dialog to satisfy all stacking and
arranging needs

Playback controls
The same as you will
see on most players.
Use these three
buttons to start and
stop the video currently
being played back

Playlist controls
You can add and/or
remove files from the
playlist effortlessly
via the buttons at the
bottom of the playlist
overview window

Playback counter

Seek bar

Volume control

The seek bar doesnt provide info about


how long a movie is. This is remedied
with a quick glance at the playback
counter, conveniently located in the
bottom-right corner of the screen

Move around your movie


effortlessly: simply drag the
seek bars pulley until the
interesting part of the clip is
ready to play

Even though content played back


by the Videos app is subject to the
system volume regulator, the need
to adjust it directly can occur. Handle
this by clicking the Speaker icon

100 The Ubuntu Book

View movies with Videos


Go to full-screen mode
Playback controls may be nice but they really do mess up your cinema
experience and can even cause burn-in on LCD and plasma displays. If you
want to use Video as a small player while working on other stuff, removing the
controls from view makes Videos use your screen real estate more efficiently (see
screenshot below).
Right-click into the running video, and select the Show controls option. The
moment it is clicked, all playback controls vanish, leaving you with the video
playing in a window. Right-click its title bar and select Always on Top and move
the window to the border of your display if your workstation were a fancy flatscreen TV, this feature would go by the name of picture-in-picture.
Undoing this operation is not too difficult. Simply right-click into the video once
again, and select the Option Show controls. Be aware that a double click does not
restore the controls: it, instead, moves Videos into fullscreen mode.

Accessing these videos is only possible


with an Internet connection
Grab online video

Generate cue cards automatically

Dont be dependent on remote servers


Some embedded videos are played
back in the Videos app. By default,
accessing these videos is only
possible while your laptop or PC
has a working Internet connection
an uncomfortable state for
people with limited data or dodgy
connections. If you have concerns,
check your data allowance before
you grab online video files.
In some cases, right-clicking
on the movie will reveal an option
in the menu called Save a copy.

Click it, and then select your


desired storage location along with
the file name in the popup dialog.
Finally, you can click OK in order to
start the copying process. This can
take quite some time video files
are large so patience is required.
Be aware that this option is not
enabled for all movies. Copyright
owners can place restrictions on
the feature: if it is greyed out, the
file can not be saved to your disk
with the Videos application.

Transposing videos into a set of images is a handy trick


Creating cue cards from videos
(see screenshot above) can be
useful. As making screenshots of
a video isnt the most exciting job,
why not just delegate the work to
the Videos app?
First off, get started by loading
the video into the application.
Next, continue by clicking Edit->
Create Screenshot gallery. Videos
will respond by presenting a more
complex version of the regular
common dialog.

The screenshot width toggle


allows you to select the width
of the images: the height will
be computed automatically in
accordance to the format of the
movie. Number of screenshots lets
you select the interval for the time
passed between the individual
captures. A high-action video
with lots of different shots might
require more screenshots than,
say, a time-lapse video. Finally,
enter a file name and click save.

Adjust colour balance


Nothing is more annoying than a video with a colour
tint. While blaming the photographer is a nice firstditch measure, the display of your workstation is just
as likely a culprit.
The Videos app contains a set of preferences
which allow you to adjust the colour schemes of
your display. The relevant dialog can be opened by
selecting Edit>Preferences, and then switching into
the Display tab.
Brightness, Contrast, Saturation and Hue behave
exactly like you would expect them to: the developers
of the Video app rightfully took inspiration from
picture managers while working on this application.
Dont feel bad about experimenting: if a movie is
playing while you shuffle the sliders around, the
content of the screen will reflect the newly selected
display settings automatically.
Should you mess up the settings, simply click the
Reset to defaults button it will reset the four sliders
to their standard value. This is a sensible operation
after doing heavy shuffling if one movie requires
correction, normally good-looking videos are likely to
look odd if subjected to the same regime.

The Ubuntu Book 101

Create with Ubuntu

Listen to songs with RhythmBox


Use your workstation to listen to music while you work

Play tunes with Ubuntu

Use RhythmBox to play music unnoticed

Playback controls

Shuffle and Repeat

Track information

If it worked for Apples iPod, it also


works for RhythmBox. These three
buttons control the playback
of the currently-selected file:
this mini-controller is handy for
changing whats playing quickly

No matter how long your playlist


is, it eventually reaches its end.
Enabling the loop mode makes
short work of this problem, as
RhythmBox simply starts off
again from the beginning

Music takes centre stage in


Rhytmbox. The two labels next to
the album cover swatch provide
information about the currentlyplaying track along with the album
and the artist

dbus callout
Rhythmbox integrates itself into
the dbus event system of Ubuntu.
This means that the currentlyplaying track gets displayed in
an annunciator display even if
Rhythmbox is not actually in the
foreground at that time

Volume toggle
Reducing Rhythmboxs
volume independently
from the rest of the
system can be helpful.
Click the speaker symbol
and then peruse the
controls in the flyout to
your preferences

Media storage list

Album cover preview

Seek bar

The big table below the


playback controls provides
you with an overview of the
media currently scheduled for
playback. Double-click an item
to start playing it immediately

Even though music is an aural


experience, adding some
visual spruce always is worth
it. Double-click the small icon
to open a pop-up with a bigger
version of the image

Ever feel like skipping


over boring interludes and
intros? Grab the seek bar
and drag it to the right the
playback position will be
adjusted automatically

High-quality headphones are a great help


for dealing with background noise and
thanks to multi-core CPUs, playing music in
the background is simple .
Sadly, obtaining media files is but part of the
challenge: once a few thousand MP3 files populate
your storage, music management becomes a severe
and annoying problem of its own. Ubuntu adresses
this problem via the RhythmBox media player. It is

102 The Ubuntu Book

a combination of a media database, an online radio


player and a classic, low-resource-consumption media
playback utility.
Getting started with Rhythmbox is easy: click a media
file in Nautilus, and the player will appear on-screen.
Minimise it to profit from background playback the
music keeps on running even if you close the application.
Sadly, using RhythmBox in this fashion means
ignoring most of the interesting features of the product.

Advanced users can create custom playlists containing


favourite hits: some obscure Falco tracks provide a surefire way to distract yourself from your work!
In addition to that, the program can also be used
as a crossfade engine. This means that the annoying
gaps between normal MP3 files get bridged over by
superimposing the songs onto one another it might
not be able to imitate a DJs handywork, but definitely is
better than nothing.

Listen to songs with RhythmBox

Tutorial

Manage large amounts of media with RhythmBox

01

Import some files

02

Set importing options

This tutorial starts out with an unlikely event:


an Austrian friend provides you with a Gigabyte
worth of Falco tracks. Let us assume that the USB
stick containing the files has already been returned
the music currently sits in a subfolder of a hard
disk on your machine. Start out by clicking File>Add
Music. Next, click the arrow next to the combobox
and choose Other to open a file selection dialog.
Then, proceed to navigating to the folder containing
the subfolders with the albums. Finally, click open to
close the common dialog.

Rhythmbox will proceed to scan the contents


of the folder: this process can take up to one second
per file, which means that patience is a virtue here.
When the analysis is done, the list below the
import controls will populate itself with further
information about the tracks found. Click the Import
button in order to add them to the media catalogue
of the Rhythmbox application.
Ticking the checkbox Copy files that are outside
the music library instructs Rhythmbox to copy
the media files into the music folder of your profile.
This is recommended if your media resides on a
removable media which has to be returned to its
owner, but should be left disabled otherwise.

03

Filter your tracks

Return to the main interface of RhythmBox


and click the Music tab: the imported tracks will
present themselves in all their glory. If the metadata
of the files was not perfect, a part of the files will
be booked in the Unknown category most files
should, however, be catalogued according to their
artist. Double-click a song in the bottom table to
start the play-back process.

When the analysis is done, the list below the import


controls will populate itself with further information

04

Search for tracks

05

Create a playlist

06

Populate the playlist

Even though RhythmBoxs file list definitely


represents progress over Nautilus, scrolling across
thousands of files is not everyones cup of tea.
The text field below the seek bar is intended to
accept query strings. Entering Fal would limit
the contents of the Artist, Album and Track fields
to songs which matches Fal in any of its metadata
fields. Entering a longer string reduces the amount
of data shown if you know the title of a song,
simply enter it to show all mixes and versions.
Alternatively, right-click an interesting song to
open up a context menu. By default, it will offer
you three choices: Genre, Artist and Album can be
used as base for further queries. The results will, of
course, be shown in the file list.

Favourite tracks should be collected in a


playlist. Create a new one by clicking the little plus
symbol at the bottom-left corner of the Rhythmbox
window. Then, click New Playlist and proceed to
entering the name of the new playlist. Finally, press
return Rhythmbox will commit the entered text
into its memory.

An empty playlist is not worth much. Add


tracks to its content list by dragging and dropping:
select the file in the Music view, and pull it to the
playlist. Should your screen be too small to display
all playlists in memory, proceed to right-clicking the
desired file. The pop-up menu will contain an item
called Add to playlist, which comes with a handy
second list of all playlists known to Rhythmbox.
When done, select the playlist in the list on the
left-hand side of the screen. Click any of the tracks
in order to start playback now just lean back and
enjoy the show!

The Ubuntu Book 103

Create with Ubuntu

Touch up photos using GIMP


Learn how to make professional photo enhancements with
open source software
Hobby photography has never been more popular,
largely thanks to the availability of high fidelity
DSLR cameras and decent point-and-shoots, not to
mention smartphones. Finally taking over from film cameras
over the last five years, high quality digital photos are much
easier to get off a camera than developing photos ever was.
With digital photos also comes digital photo manipulation
software, such as GIMP, which enables you to quickly perform

Fix common photography issues


such as red eye using in-built tools
from GIMP

Learn how to remove minor blemishes


and unessential items such as necklaces to
improve overall picture quality

While Photoshop may be an extremely


popular tool for photo editing, FOSS
offering GIMP is definitely no slouch in
that department
104 The Ubuntu Book

professionally styled touch-ups and enhancements to photos in


order to either really bring out the tones and lighting, fix any redeye, control the colour temperature and more.
While Photoshop may be an extremely popular tool for photo
editing, GIMP is definitely no slouch in that department. Having
just about every feature you could get in Photoshop, with a few
even being a bit better, its most certainly enough for creating a
great look with any of your photos.

Smooth out and highlight skin using


colour control and sharpness to make a
photo more lifelike

Touch up photos using GIMP


06

Control red-eye
levels

07

Vary highlights and shadows

08

Adjust the overall range

Photos will have a range of colours at


different levels, from the lighter highlights to
the darker shadows. You can see a histogram
and numbers for these settings by going to
Colors>Levels on a 255 point scale; 0 is the
darkest and 255 is the lightest.

01

Install GIMP

02

Work with RAW photos

Crop the image

04

Use the rule of thirds

Some DSLRs will allow you to work straight


from the JPEGs, but others will also give you RAW
files which can let you play around with the light levels
and other fine camera aspects. GIMP cant edit these,
so you may also need software such as UFRaw to
properly import them.

05

Remove red eyes

03

06

Control red-eye levels

GIMP is included on many Linux distros by


default, so searching the Graphics category in the
menus is your first step to finding it. Otherwise, it can
be installed in your software manager just by looking
for GIMP. If all else fails, head to gimp.org/downloads
to get the installation files.

Not essential for every image, but if you


werent shooting with a rule-of-thirds approach, you
can always see if the image would look a bit better with
one applied. Click on the rectangle select tool and set
the Guides to Rule of Thirds.

The rule of thirds is used to position an image


in such a way that certain aspects of a photo take
up a third of the composition. This helps to make
your photos look more dynamic and draws the eye to
particular features. Play around to see what you want
to highlight.

A common problem you may face with


improper flash is red-eye. Luckily GIMP has a tool just
for that. Use the Rectangle tool to select one eye at a
time and then find the Red Eye tool in the enhanced
sub-menu of Filters on the tool bar.

Tweak the slider on the levels to remove as


much red eye as possible without changing the whole
picture. You can refocus the selection to be larger or
smaller to try and get a better result. It can sometimes
help to do both eyes at once.

Here you can see that the histogram


doesnt cover the entire graph. A quick fix, and one
that will instantly increase image quality, is to drag
the shadow slider up until the beginning of the
histogram. In this case it made the photo slightly
darker but easier to pick out some detail.

The Ubuntu Book 105

Create with Ubuntu

09

09

Add Auto-Levels

There is an Auto-Levels tool that will


automatically do any basic corrections on the photo
for you. For some people and photos, this may be all
you need to do to enhance your photo. Sometimes
though, you might want to do a little more level
editing to ensure maximum quality.

11

Add AutoLevels

Correct skin blemishes

Theres a big debate going on right now over the


beauty industrys use of airbrushing to make models
look perfect. Were not really equipped to debate that
in this bookazine, but we feel its fine to have a look at
covering the odd skin blemish if you need to.

14

Heal blemishes

15

Clean up the photo

Paint over the blemish as you normally would


any other colour using the paintbrush tool. You may
need to reset the initial point of copy at points to avoid
using the background or another part of the picture to
cover up the target area.

10

Alter the colour range

Back on the levels editor, find the channel


selector. Here you can find the individual RGB levels.
Editing these individually can create a slightly better
tone profile across the picture. You can also edit
the Blue or Red levels to make the image colder or
warmer, or correct the white balance.

Use the Eraser tool to


remove the red areas
from the skin
106 The Ubuntu Book

12

Use the healing tool

With skin blemishes like red patches, moles


and freckles, you can easily cover them using the
Healing tool. This takes one area of a photo and uses
it to create a natural gradient. Its the plaster symbol
on the tools.

13

Set up the image

Grab the Healing tool and zoom in on the


picture. Select a patch of skin next or very near
the blemish change the brush size if need be,
depending on the size of the photo and blemish. Hold
Ctrl before clicking. This selection will move with your
painting to vary the healing tools colours.

The Heal tool can do a lot more than just


remove a mole. In this example weve removed the
necklace from our models neck. On a larger scale it
can be used to clean up the background of a photo
a bit more naturally than cutting out or guessing
colour profiles. Its not a perfect tool as it can only
estimate, but its still very smart and gets better all
the time.

Touch up photos using GIMP


17

16

Enhance the details

The Unsharp Mask works very well on photos


with small details or where the makeup is key. Go
to Filters>Enhance to select the tool, which will
automatically bring out some of the details in the
photo. Use small values and experiment; it only needs
to be subtle.

17

Use the Quick Mask

So weve removed some basic blemishes, but


you can also smooth out the skin a little using the
Quick Mask tool. Go to Select and then Toggle Quick
Mask to cover the image in a layer of red. Dont panic,
well be removing the red hue once we are done.

18

Do some preparation

Use the Eraser tool to remove the red areas


from the skin, avoiding the hair, eyes and mouth. After
thats done you can turn off the mask and it will create
a selection of what you deleted, without the Jokeresque look that occurred when the mask was on.

19

Grab Gaussian Blur

The final step to smooth out the skin is to


use the Selective Gaussian Blur in Filters>Blur. Play

Use the
Quick Mask

about with the levels again but try and keep them
small. Go too far and you can make the skin slightly
resemble plastic.

20

Beautiful photos

With a bit of practice and some creative


uses of these tools and some others, you can
really make any picture look much better than the
original, without overdoing it and giving the model a
completely different appearance.

The Ubuntu Book 107

Create with Ubuntu

Discover the power of PulseAudio


We reveal new tricks and some mind-blowing PulseAudio
features already at your fingertips
Most of us are running recent versions of our favourite
Linux distributions, and that means that probably everyone
uses PulseAudio as a default sound server, often without
making any conscious decision to do so. We just play music, watch
movies and enjoy online videos, but whatever we hear from speakers,
it is powered by PulseAudio a versatile abstraction layer that
sits between the Linux kernel (which offers a driver for your sound
hardware) and desktop applications. PulseAudio was controversial
some years ago, but it has come through seven major releases and is
rock solid these days. PulseAudio superseded a much simpler ALSA

sound system with a sophisticated modular client-server solution,


which has many benefits for power users once you decide to dive
deeper into the modern Linux sound setup.
In this tutorial well cover features that go beyond playing with your
sound applet in the system tray and reveal a number of practical
applications that will be useful for common desktop activities. These
include handling separate playback streams, redirecting sound
over a network, improving sound quality and making use of various
convenience tools that ease things a bit. All youre going to need to
provide is a command line and a few minutes of your spare time.

Right PulseAudio is
a lot more than just
a sound system with
volume control

We reveal a number
of practical applications
that will be useful for
common desktop
activities, including
handling separate
playback streams
108 The Ubuntu Book

01

Discover your sinks and sources

For any system with PulseAudio, each sound


device is identified by three main parameters: card,
sink and source. Card refers to the hardware you
use for sound playback and capturing, with all its
physical inputs and outputs. A sink is an abstraction
layer used for sound output. Not only can it point to
your speakers, headphones or line-out jack, it can
also mute sound by routing it to a null device (via
module-null-sink) or make it accessible for other
applications by creating a pipe-like FIFO output (via
module-pipe-sink).

The final parameter source is used for working


with the incoming sound stream, such as various
input devices (microphone, line-in, etc). So finally,
PulseAudio creates a set of a card, a sink and a
source for each application that deals with sound,
giving us great flexibility.
PulseAudio tries to figure out which sink and
source should be set as the default ones, so in most
cases you should hear sound from your speakers
and have your mic working correctly out of the box.
To see the current setup, just issue sudo pactl list
and examine its output.

Discover the power of PulseAudio


01

Discover your
sinks and sources

Left PulseAudio
should automatically
work out the sinks
and sources

02

Hop between speakers and phones

This is the common case for laptops,


where sound is played through loudspeakers but
once you plug in your 3.5mm jack, it is transferred
to headphones. Modern Linux systems do this
automatically, but if they fail (or you need custom
behaviour), you can control everything. In PulseAudio
it means that one sink can have several ports. To find
out the currently used one, look for something like:

Active Port: analog-output-speaker


We also know the names of the other ports, so
now we can manually switch sound playback to
headphones, like this:

$ pactl set-sink-port alsa_output.pci0000_00_1b.0.analog-stereo analog-output


The same is also true for sources; so when you cannot
record your voice in Skype, you should definitely
make sure that the corresponding source is using a
correct port for capturing sound.

03

Manage volume

PulseAudio uses a simple range from 0 to


65535 to manage sound volume, where 0 is muted
sound and 65535 is 100% loud volume. The trick is,
however, that you can go beyond 100% and boost the
volume further, without using any third-party tools (like
VLC player). Lets see some examples for the default
sink #1:

$ pactl set-sink-volume 1 100 # very


quiet,
100/65535 = 0,15%
$ pactl set-sink-volume 1 65535 # 100%
$ pactl set-sink-volume 1 78642 # 120% were

doing some overdrive


And finally, lets calm down:

$ pactl set-sink-mute 1 true


If you need to set different volumes for certain inputs
inside one sink, you may want to turn off the so-called
flat volume setting, which limits maximum volume
for a sink. This is a simple procedure to carry out:

$ sudo echo flat-volumes = no >> /etc/


pulse/
daemon.conf

Go beyond the basics


PulseAudio introduces client-server design, which
means that your sound setup can be spread across a
network. This is a lot more than just playing to a remote
device it includes other cool things like broadcasting,
radio streaming and alerting. You can set up PulseAudio
together with the Icecast server and play audio for those
that can connect to your stream.

The Ubuntu Book 109

Create with Ubuntu

Even more modules


The number of PulseAudio modules keeps growing
and most of them are still waiting to be discovered
by the general public. Meanwhile, there are some
astounding modules that will boost your fantasy
setup. A couple of examples: module-suspend-on-idle
can save your laptop battery by powering down an
idle sound card and module-position-event-sounds
positions event sounds between the Left and Right
channels depending on the position of the widget
triggering them.

04

Remove noise and echo

This is something not everyone is aware of:


PulseAudio is shipped with modules that can improve
the sound quality in certain cases, such is in VoIP
conversations. The main module for that is called
module-echo-cancel and it does the perfect job of
removing echo, auto-levelling, controlling gain and
reducing ambient noise. To use it, add the following
line to /etc/pulse/default.pa:

load-module module-echo-cancel
You can also specify one of the audio echo
cancellation (AEC) methods right there:

load-module module-echo-cancel aec_


method=webrtc # or
load-module module-echo-cancel aec_
method=speex
Webrtc removes noise better than speex, though
the latter is more stable. There is a small limitation,
however: it only works when something is being
played through a sink (apps that play back sound).
By the way, it is possible to load modules instantly,
without altering global PulseAudio settings:

In case your speakers are


not perfect and youd like
to compensate, a global
equaliser is marvellous.
PulseAudio-equalizer has
15 bands and 19 presets
for any music style

05

Fix Skype issues

Skype is a proprietary app but is the


most widespread VoIP application for Linux.
Various issues take place when using Skype, most
concerning sound quality. PulseAudio can help
here. First, if you encounter echoing, try to launch
the application with custom variables, like this:

$ PULSE_PROP=filter.want=echo-cancel skype
Another concern can be static/crackling sounds. It
was an issue in older PulseAudio versions, but some
people running Skype on 64-bit Linux systems
still find it an issue. Well try two methods now
that address two causes of the problem. The first
changes audio latency:

$ PULSE_LATENCY_MSEC=30 skype
The second one disables glitch-free playback,
which may help for sound cards that do not return
accurate timing information. Add the following line
to /etc/pulse/default.pa:

load-module module-udev-detect tsched=0


and restart the system.

$ pactl load-module <module_name>

06

Sound over network

If you have at least two Linux PCs in a home


LAN, you can set up remote audio playback with the
help of PulseAudios network capabilities. It can
be really useful when your high-end speakers are
connected to, say, a Raspberry Pi in your living room
and you want to listen to some music that is stored on
your laptop. In PulseAudio terms, your Pi would be a
server and your laptop would a client. Both machines
should be running PulseAudio and be discoverable on
the LAN. Now well set up a tunnel from the client to
the server. On the server side, add the following into
/etc/pulse/default.pa:

load-module module-zeroconf-publish
load-module module-tunnel-sink-new
server=192.168.0.1
sink_name=Remote channels=2 rate=44100
where 192.168.0.1 is your servers IP address. On
the client side, install the paprefs utility (for Ubuntu
it goes: sudo apt-get install paprefs), launch it and
enable the Make discoverable PulseAudio network
sound device available locally option. Finally, restart
the PulseAudio daemon on both your server and
client (sudo pulseaudio -k && pulseaudio --start).
Now you can choose your remote sound device from
Pavucontrol or other PulseAudio-compatible mixers.

07

Use a built-in equaliser

Many music and video players for Linux have


audio equalisers that can enhance sound or create a
desired ambient effect. However, these are custom
implementations that affect a given player but not
the system-wide audio output. In case your speakers
are not perfect and youd like to compensate, a global
equaliser is marvellous. Well, we have one and its
called PulseAudio-equalizer! It is included in almost

110 The Ubuntu Book

Discover the hidden power of PulseAudio


08

Make use
of roles

Left Its possible


to lower the volume
of streams to raise
the volume of an
important stream
all Linux distros that have the core PulseAudio bits, and
all you have to do is to head to your software centre and
get this extra package installed. PulseAudio-equalizer
has 15 bands and 19 presets for almost any music style
or conditions, such as the very useful Laptop preset.
The tool is otherwise very simple, with a few extra
checkboxes and the Apply Settings button. PulseAudioequalizer works for all audio that is played through the
current sink, including desktop notifications (if you use
them). Presets are stored as plain text files under the /
usr/share/pulseaudio-equalizer/presets directory, so
you can use existing files there as templates and create
your own presets seamlessly.

08

Make use of roles

This is a relatively new PulseAudio feature that


resembles the behaviour of modern smartphones
when you receive an incoming call, all other audio
playback (if any) gets temporarily muted. In PulseAudio
there is the module-role-ducking module which
lowers the volume of less important streams when
a more important stream appears, and raises the
volume back up once the important stream has
finished (this is called ducking). The decision whether
a stream has high or low priority is made based on
the stream role (the media.role property). By default,
music and video streams are ducked, and phone
streams trigger the ducking. Lets now load the

module with explicitly declared options and specific


attenuation to be used while ducking at -10dB:

$ pactl load-module module-role-ducking


trigger_
roles=phone ducking_roles=music,video
volume=-10dB
and then make sure its working by triggering
ducking with sample playback, like this:

$ PULSE_PROP=media.role=phone mplayer -ao


sample.mp3

09

Get things done with ease

Most of command line actions around


PulseAudio involve the pactl and pacmd commands,
both producing verbose outputs. This is when
Patricks comes out it is a simple PHP-based utility
(https://github.com/ootync/Patricks) that parses
the pactl list and pactl stat outputs and shortens
them to more readable variants. The syntax is also
very easy to understand:

$ patricks ls
lists entities, while:

$ patricks ls sink 0 properties


shows the properties of the currently used sink.
This command can even be shortened down to:

$ patricks ls si 0 pr
The Ubuntu Book 111

Supercharge
Ubuntu
114 Best free software
Enhance your Ubuntu experience

128

124 Partition with GParted


Use the GUI to handle partitioning

126 Remote control workstations


with Remmina
Manage a remote server from your desk
with Remmina

128 Switch languages


with FCITX
Master this extra feature

130 BitTorrent with Transmission


Upload and download data

132 Visualise data with Chart.js


Draw gorgeous graphs of all kinds

136 Command-line efficiency


Take the terminal further

142 Develop with Python


Learn about this popular coding language

142

Once youve mastered the basics,


theres so much more that Ubuntu
can do
124

126

112 The Ubuntu Book

132

The Ubuntu Book 113

Supercharge Ubuntu

Best free software


All the software you need to use at home & work

114 The Ubuntu Book

Best free software

Programming Tools
Make apps and solve the mysteries of
the universe with these amazing tools

RadRails Ruby/Ruby on Rails


A standalone IDE or plugin to Eclipse, RadRails is a flexible IDE for working
on Ruby projects. Its great on its own if you work exclusively in Ruby, with
an integrated debugger and other helpful features, such as code assist
and structure hierarchy to make navigation easier. The Eclipse plugin concept is
great, as it enables you to use Ruby alongside other code in a familiar environment.

Top IDEs
Coding is a mainstay of Linux activity and no matter which language youre writing in,
youre going to need an integrated development environment thats stocked with all of
the right tools and features. Youll need plugins, intelligent formatting, debugging tools
and more. Basically, you need these IDEs

IntelliJ Java/Javascript
Eclipse C/C++

Part of a network of IDEs, IntelliJ prides itself as being the most


intelligent Java IDE (whatever that means), and in our experience it is
pretty great. As well as standard smart code completion that gives you
suggestions and lets you know what arguments a function needs, it checks the
code quality and senses any problems. Its good for web-based Java and creating
mobile applications.

A very popular and powerful IDE, Eclipse is perfect for coding in C and
its derivatives on Linux frankly on any other operating system too. As
well as being cross-platform, it has a deep and varied plugin system
that will enable you to customise the way Eclipse works. It also adds extra
languages in case you really like the layout and want to try other tasks too. What
is more, it has powerful debugging and compiling tools as well.

Geany Web
Developing for the web is different to developing normal programs. For
starters, its not as easy to test changes locally. There are also a variety of
ways you might make a website and a selection of different programming
languages. However, many IDEs can help you code in these various web languages,
along with code mark-up and hierarchy interfaces to help navigate easily. Eclipse
is a good bet for this thanks to its plugin nature, but you can also try a light IDE like
Geany that should do it almost as well.

IDLE Python
While this is the standard development environment for Python, its
also very good at it. Our favourite feature is the shell: a working python
environment where you can try out bits of code to work out what does
and does not work, along with running the entire code without the need for
compiling. It hooks in well to any custom modules you might have made for a
project, giving you the arguments for functions within.

Installing Eclipse plugins


Eclipse has fantastic support for plugins, and a rich library of plugins you can access or
download and install manually. Go to Help>Install New Software and then Add. From here
you can add a repository for the Eclipse plugin you want to install; this will allow the plugin
to stay up to date. Alternatively, you can use the Add function to install a plugin directly
from a ZIP file. Be aware though, you wont get the same updates this way. You can head
to the Eclipse marketplace (marketplace.eclipse.org) to find a great selection of all the
plugins you can use.

The Ubuntu Book 115

Supercharge Ubuntu

Multimedia & art


Play games, paint, make music the choice is yours and you have plenty of it
Even while working, you may need a way to keep
yourself focused listen to some music, or take a
quick break and watch something. Some peoples
work might be more media-centric. For whatever
reason, Linux has a wide range of free media apps to
help you relax or be creative

Clementine Music
Our favourite music player and manager
is also definitely one of the best around.
Clementine, as well as being able to simply
play music, enables you to easily manage your entire
media library, playlists and even some content
from your online music streaming services. It has
more features than any other music player and it is
the only one we like on Linux that can create smart
playlists for you. And, of course, it plays every type of
music file you can think of.

Audacity

Krita Digital painting VLC Video


While GIMP is excellent as an image
editor, and you can definitely use it for
digital colouring, Krita is where you
can do some really beautiful art. The layout and
workflow is better optimised for painting than
GIMP and also has better tablet support. Instead
of doing flats, you can actually paint with a full
colour palette that is easier to select from. In
addition, there is a better selection of brush types
and effects.

VLC is ridiculously good. Video playback


on any operating system has always had
its ups and downs, requiring you to scour
the Internet to find a way to play some obscure
video file. On Linux, this sometimes required
switching between media decoders, but VLC does
away with all of that by having all the codecs built
in. And we do mean all of the codecs it will play
anything you can throw at it. Thats before you get
to its full network streaming capability.

VLC will play anything you can throw at it and


thats before you even get to its full network
streaming capability

GIMP Image editing


Photoshop, shmotoshop. GIMP may not
cost as much, but it can do just about
anything Photoshop can. It isnt exactly
fair to refer to it as a free Photoshop because it is an

image editor in its own right, with its own workflow


and interface. It has a great dev team behind it and
an active community, so it is easy to learn how to
use GIMP or move over from Adobes offering.

Here we have the main manipulation


tools your standard paintbrushes
and drawing tools, along with a variety
of selection tools along with size,
perspective and placement tools

Here is your work space you can


use the layer view for an overall look
at the composition, but you can also
look at the alpha channels, recent
documents and action history

Audio editing
Audio editing may be a bit niche, but
Audacity is certainly one of the best
tools for the job, even beyond FOSS.
With powerful effects, track control and a great
workflow, it is easy and quick to edit or produce
whatever youre working on, whether its music,
podcasts or sound effects. Our tip is to ensure you
know your way around your sound server on your
system for different microphone configurations.

Blender 3D modelling
A long-running and great piece of
software, Blender is your one-stop shop
on Linux for creating 3D models and 3D
animated films. The quality of the Blender-created
shorts over the past few years has been incredible,
demonstrating that you can do just about anything
with it if you try hard enough. The dev community
includes a lot of people that use it professionally,
so its in very good hands and has been made with
3D-modellers in mind.

116 The Ubuntu Book

Many effects, such as the


colour and filter effects, are
kept in separate windows so
you can modify the properties
and get a small preview of how
it will change the image

Use all these tools to make photos just


that little bit better, with touch-ups,
white balancing and maybe even an
adjustment layer or two to make them
really pop with colour

Best free software


Shotwell Photo
manager

GIMP can be used to edit photos, but what


can you use to organise them? This is where
Shotwell comes in, a photo management
app that can help you organise photos into albums
on your system for easier navigation, upload them to
certain social media sites to make the post process
easier, and it can also perform light batch operations
on photos with basic editing techniques. If you like to
take a lot of photos, this is probably for you.

UFRaw RAW
editors

When shooting photos with a really good


camera, youll usually be able to get RAW
photo files out of the SD card. These arent
compatible with GIMP and some other image viewing
software as they first need to be processed. UFRaw is
a free piece of Linux software that lets you load a lot
of the major RAW files and start playing around with
the white balance and other aspects of the photo, so
you can create a JPEG of the perfect version.

E-readers
Reading books on your computer can be very
convenient and a good ebook manager makes the
task much more hassle-free and relaxing. Calibre
is definitely the best for the job on Linux, as it is
compatible with every major ereader format, such as
EPUB. You can also use it to organise and read normal
document formats as well. Its optimised to run on
small screens if you want it to, so if you fancy creating
a custom mini Linux e-reader, Calibre is the software
youll need!

This software is
optimised to run on small
screens if you want it to,
so if you fancy creating
a custom mini Linux
e-reader, Calibre is the
software youll need!

KdenLive Video editing

Inkscape Vector graphics

Editing videos in Linux is generally better for normal folk than it is on


other operating systems, as the level of free software on Linux is higher
than the likes of iMovie and Movie Maker. KdenLive is a prosumer-grade
video editor with enough functions to be almost on par with Adobe Premiere. Not
only will it let you arrange videos in a linear timeline, but it also has a wide array of
effects, including green screen effects or chroma key.

Making vector graphics is very different to digitally painting an image.


Vector graphics are used to adjust art to any size without weird
pixelation. Inkscape is the most popular one available on Linux as it
has a very powerful set of tools that can help you create vectored artwork for any
application, including Bezier curvers, node editing, boolean operations on paths
and many more.

Editing videos in Linux is generally


better for normal folk than it is on other
operating systems, as the level of free
software on Linux is higher

This one is particularly popular as it has


a very powerful set of tools that can
help you create vectored artwork for
any application
The Ubuntu Book 117

Supercharge Ubuntu

Gaming on linux
Not sure its a thing? Think again here are some awesome free games

DOTA 2

Marvel Heroes

The sort-of sequel to a free mod for a game made by a different company, Dota
2 has a weird origin. Once you get past that though, you find an excellent MOBA
that makes it a great alternative to League of Legends. It has been fully embraced
by the eSports community too, with regular high-stakes tournaments and
leagues to play in. If youre not the highly competitive type though, you can still
enjoy it casually.

We swear to you that Marvel Heroes is actually pretty good, despite what your
initial assumptions might be. The game lets you be one of an ever-expanding lineup of Marvel characters and heroes as you repeatedly left-click on bad guys to try
and save the world. It takes its cues from the comic books and the current movies,
so you can use Mark Ruffalos Hulk if you really want to. Dont get too hooked into
its freemium trappings though.

Its an excellent MOBA that makes it a


great alternative to League of Legends

It lets you fly around in a starship


shooting phasers

Team Fortress 2

Star Trek Online

Part first-person shooter, part crazy economical experiment, Team Fortress 2 was
Valves first free-to-play game and they made a ridiculous amount of money from
it and still do make it, thanks to the hats you can find in-game. You dont need
to pay a penny to have a good time though, as it has a variety of classes and game
modes that suit any player and excellent core gameplay mechanics to carry it while
you shoot snipers or robots.

We will spare you the Star Trek references to tell you that Star Trek Online is a great
MMO that lets you fly around in a starship shooting phasers, or beam down to other
planets so you can shoot more phasers. The core game is free these days, but
there are paid expansions for extra content that expands the Star Trek universe
with new stories. Also, you can set your warp speed to two decimal places, which is
completely pointless but also quaintly excellent.

118 The Ubuntu Book

Best free software

Office software

Tex & latex

Set up the ultimate office system with


these powerful apps

TeX and LaTeX are programming languages used to create documents think
of it like a very manual word processor. The benefit of this is that you can control
exactly how a document will look and they can be easily written as PDFs. Moreover,
you can customise config files and scripts so that you can do some initial setup and
then rely on your created classes to quickly style up text.

Libreoffice
The successor to OpenOffice has long since established itself as the best Linux office
software around, with just about every feature youd expect from something like
Microsofts pervasive product. Heres a selection of the best applications included in
LibreOffice and what they can do

Writer Word processor


Theres a standard word processor in any office suite, however Writer
does a lot more than other text editors you can find in Linux. It has all
the formatting tools youd expect, such as layout functions, advanced
macro and mail merge tools that you find in the professional software versions. It
does prefer to save files as .ODT, but you can change it by default to .DOC or .DOCX
to be compatible with Microsoft.

Calc Spreadsheets
The equivalent of Microsoft Office Excel, Calc has all the advanced
features of Excel without you needing to relearn how to create
different formulas and codes. The workflow is similar and you can edit
the formatting for individual cells. You can even do Pivot Tables for large data
operations. Compatibility with Excel files is okay, but not great.

01

Consider TeX Studio

02

Write your document

03

Save your document

With better placement of images, mathematical formulas and more,


TeX and LaTeX are great for academics and professionals. We quite like to use
TeXStudio to create documents its an integrated writing environment that
brings things like syntax highlighting , multiple cursors, bookmarking, image
drag-and-drop and more.

Impress Presentations
LibreOffices PowerPoint may not be the flagship app of the suite,
but its able to create and replicate the kind of presentation style
youre used to, as well as being able to open and display pre-made
presentations from other software. It has limitations in the way it uses outside
media, relying on the codecs and streamers available to it, and as a result, this
can change as a file is moved between systems.

Math Formulas
Similar to the way TeX and LaTeX enable you to write and draw
mathematical formulas, the Math app allows you to create equations
to input into any of the main three pieces of LibreOffice software. As
Writer has a free PDF converter, you can even use it instead of a LaTeX editor in
a few situations. Its quite a minimal program though, focusing on easily writing
formulas in a graphical manner.

Why not openoffice?


Here, were concentrating on and recommending LibreOffice as it really is the best
office suite on Linux. You may be wondering why we havent mentioned OpenOffice;
well, OpenOffice underwent a lot of changes to the dev team a few years back, with
most of them leaving to create LibreOffice from the current state of OpenOffice.
Development has therefore stagnated somewhat since then, while LibreOffice has
gone through many updates and overhauls to keep it relevant. Because of this, its now
the better of the two and definitely much better than KDEs Calligra Suite.

Writing documents in TeX requires you to understand the syntax of the


code, but its a very powerful thing once you are familiar with the documentation.
You can bring up shortcuts to create mathematical formulas, and you can keep a
running preview of what you have created so that you can go back and check for
any errors.

As youre writing your document, you can save it as a .TEX file to go


back and modify it, however once youre finished you can output it as a PDF for
presentation. Not many word processors allows you to do this properly, but TeX
makes it easier and better-looking in PDF form.

LibreOffice has gone through many


updates to keep it relevant
The Ubuntu Book 119

Supercharge Ubuntu

Project management apps


Help your work run smoother with these Linux project managers

GNOME Planner

Vs

ProjectLibre

The verdict

A GNOME app that integrates well with other


GNOME and GTK software, Planner is a simple
project manager that enables you to easily create
plans and graphs for an entire project. It lets you create Gantt
charts, manage resources and more with its plain interface, a
common feature of current GNOME apps. All its data is stored
in either XML files or a PostgreSQL database, and you can even
export the whole thing on HTML to move it somewhere else.
The software is also cross-platform compatible, in case you
need to edit it away from a Linux machine. Its well liked in the
community and its also one of our favourites.

ProjectLibre is the
much more powerful
tool of the two
softwares were
comparing here,
giving you much
more control over
how you create a
workflow and how to
qualify it. Planner is
still very good, but it
may be more useful
for people doing
personal projects
than those looking for
an office tool.

Positioning itself as a full Microsoft Project


replacement app, ProjectLibre is a fair amount more
complex than Planner. As well as covering all of
Planners functions, you can also use both PERT or RBS charts,
and perform both a cost-benefit analysis and an earned value
costing to really get a firm hold of a project and its resources.
Unfortunately, you wont find ProjectLibre in every Linux
repository, so you will have to look for it online on SourceForge
or via its official website, but its easy enough to install with
binaries available and the source code if you fancy doing some
building from scratch.

Home & office Accounting


Manage your finances at either of your desks with these top finance apps

Gnucash

Vs

Grisbi

The verdict

Easy to use, powerful and flexible to your own


needs, GnuCash is great for personal finances and
business finances. As well as tracking your bank
accounts, income and expenses to help properly organise
your cash and savings, you can also keep an eye on stocks
so you have a better idea of your current assets. All cash
flow requires double-entry; debit and credit. Theres also a
chequebook-style register along with a multitude of report
types that you can generate in case you need to visualise the
accounts or submit a report.

120 The Ubuntu Book

Because of all its


extra features,
including the stock
options, GnuCash is
definitely the better
choice for those
who really need a
powerful accounting
software to look
after their business
finances and more.
Grisbi is still good, but
GnuCash is still going
very strong after
many years.

Grisbi is a slightly different financial manager


to GnuCash, angled a little more at home users
rather than big business. Its cross-platform like
GnuCash and lets you properly track transactions between
your accounts. It doesnt have any stock information, but
it enables you to view and create reports, as well as set up
budgets to see how close you are to keeping with them. The
reports function allows it to be used in a more small-business
scenario and its slight simplicity over GnuCash might be
useful to some.

Best free software

Web & privacy


Get the best software available for connecting to, downloading from
and for talking over the Internet

Heavyweight browsers
Most of you are using one of these but which is really the best?

Vs

Firefox

Chromium

The verdict
Features

9 | 8
Memory efficiency

8 | 6
Extensibility

Firefox is pretty much ubiquitous to Linux, if not in


its vanilla form then as a distro-rebranded spin like
Debians Iceweasel and GNUs IceCat, and is most
famous for its incredible range of extensions. It holds to a
fearsome pace of an update schedule, although these updates
often introduce new user-visible features as well as backend
tweaks and fixes. Recently, for example, it saw the introduction
of tab-based preferences; the integration of Pocket and a new
Reader View mode; and Firefox Share was integrated with
Firefox Hello, so users can invite people to the Hello VoIP service
through social networks. Firefox provides Extended Support
Releases, free of large, disruptive feature introductions and
only receive major stability and security updates.

Pidgin
Facebook and Google recently ended
their support for the XMPP API, which
means that messaging clients such
as Pidgin can no longer officially connect to the
services. A new Google solution is in the works but
theres no word from Facebook yet. However, James
Gebloski provides a work-around plugin for Debian
and Ubuntu that will help you connect the Pidgin
client to your Facebook account.

01

10 | 8
Overall

9 | 8
Firefoxs extensibility
is a massive plus
for the open source
browser and its
better memory-wise
than Chromium. Both
these make it just
that bit better in our
estimations.

The open source bedrock of the increasingly popular


Google Chrome browser, Chromium is very similar
to Chrome, but with a few notable differences.
Essentially, Chrome is 99% Chromium with the addition of
some proprietary elements, such as Flash (although its days
are numbered). Chromium uses the open source media codecs
Vorbis, Opus, VP8 and VP9, Theora and then Chrome adds
the proprietary MP3, MP4, AAC and H.264 on top. Another
difference from Chrome is that while Google pushes updates
out automatically, Chromium relies on the user or maintainer
to keep it fresh. There can be some variation with Chromium,
with some vendors adding proprietary codecs. You can find the
latest pure build at download-chromium.appspot.com.

Plugin setup

First navigate over to /etc/apt/sources.list.d


and then create the file jgebloski.list. Open it up in a
text editor and add the following line:

deb http://download.opensuse.
org/repositories/home:/
jgeboski/<version> ./
replacing <version> with one of the following,
depending on your distro: Debian_8.0, Debian_7.0,

Firefox holds to a particularly fearsome pace of an


update schedule, although these updates often
introduce new user-visible features as well as backend
tweaks and fixes

xUbuntu_12.04, xUbuntu_14.04, xUbuntu_14.10 or


the newer xUbuntu_15.04.

02

Repo key

To add the repository key, enter the following


commands into the terminal:

wget http://download.opensuse.org/
repositories/
home:/jgeboski/<version>/Release.key
sudo apt-key add Release.key
sudo rm. Release.key

03

Non-XMPP account

Now you just need to run a sudo apt-get


update and then a sudo apt-get install purplefacebook. Next, restart Pidgin. Add a new account
or modify your existing one, pick Facebook for
the protocol not Facebook (XMPP) enter your
username and password. Leave Local Alias blank.

The Ubuntu Book 121

Supercharge Ubuntu

Desktop Email clients Privacy and security


Web clients are hugely popular, but
desktop clients are very powerful

Protecting your online activity and


your personal data is becoming more
important than ever

KeePassX
In the interests of security, we recommend using different alphanumeric
passwords for each online account (although having a base, perhaps
phrase-based, password and then creating memorable permutations for
your various accounts is another good move). Keeping track of them all can be a pain,
so for simplicity and security you can use KeePassX. Store all your sensitive data
inside an encrypted database, and keep it inside Dropbox or a secure server. You can
then access that database from other devices and use a single master password to
unlock everything you need from whichever device youre using.

Tails
Thunderbird
Despite concerns in recent months that the project is dead or dying,
Thunderbird is very much alive and kicking. The project didnt see any
major feature introductions for a while, although this is chiefly down
to the development work moving across to the community following the Mozilla
chairs announcement that the company itself would no longer be developing
Thunderbird it has effectively gone the way of SeaMonkey. But it is still one of the
best and the most widely available desktop email clients, and new features such
as the Lightning Calendar add-on and OAuth2 support in Gmail were added as
recently as June.

We mention Tails a lot when it comes to security and privacy software,


but with very good reason. It is without question the best distro out there
for giving you a fully-protected online experience thats ready to go out of
the box, with the Tor network, Tor Browser and I2C set up for immediate use. The
system lives entirely in your RAM and wipes itself after use, leaving no trace on the
hard drive youre live-booting on top of, and isolates applications with AppArmour,
can spoof your MAC address and automatically encrypts your communications.

PGP mail

Camouflage mode

Send secure, encrypted


and signed emails without
having to install any extra
software, and keep your
communications private from
anyone that may want to
snoop on what youre saying

Using Tails out and about,


and dont want to draw
attention? You can launch it in
a Windows camouflage mode
that makes it look exactly like
Microsofts OS, but still has
the same functions

KMail
If you use the KDE desktop, the most powerful, most configurable email
client available is already installed: KMail, which is heavily integrated
with the Kontact application. KMail provides every standard feature
you can think of and then goes on to provide advanced features that blow the
competition out of the water everything you can do with a plugin in Thunderbird
is an option in KMails preferences. It has incredible search and filtering tools, great
conversation threading, robust and in-depth security settings, integration with
other KDE apps like KWallet and external spam checkers like SpamAssassin, and
the entire software is also completely configurable to your own taste.

122 The Ubuntu Book

Tor network

Day-to-day software
Even though its hyper
secure, you dont have to
sacrifice usability. Tails
comes with all the best
software you could need

Dont leave
a trace
When you shut down
after a session of
Tails, the RAM will be
completely erased so
that no one can try any
advanced forensics on it

Tails automatically
connects to
the private Tor
network, and
you can even see
the map of how
youre connected
and reset the
connection if you
want to

Best free software

Science software
Linux has incredible FOSS for doing proper science and engineering work
Stellarium

SciDAVis
Software for scientific data analysis and visualisation (the name is a
weird acronym), SciDAVis enables you to manually input or import data
from a variety of sources in order to be analysed via the various statistical
methods built into the software, then plot 2D and 3D graphs, matrices and more
that are suitable for publication. Its also cross-platform, so if you need to work on
a variety of different machines, everything will work between them.

Going out stargazing


is a lot of fun (just
ask All About Space),
and while you can
see some great
things by pointing
your telescope at
a random spot,
to make the most
of it you need to
plan Stellarium is
perfect for that. All
you need to do is set
your position, give it
a time and you will be
given an annotated
view of what will
be in the nights
sky. Note down the
co-ordinates (if your
telescope is fancy
enough) and youre
sure to have a great
night stargazing.

View the circuit youre building as a schematic,


or build one directly as a schematic to begin
with. You can even create a PCB view

You can arrange your components and


microcontrollers as you would in a real circuit
to get an idea of how you should make it

Cain
This is a piece of software useful for
performing stochastic and deterministic
simulations of chemical reactions. If that
at all sounds interesting to you, then you may like to
know it can also solve models using Gillespis direct
and first reaction method, Gibson and Brucks next
reaction method, Tau-leaping and a few more. It can
import and export relevant data to make analysis
easier for you, using XML and SBML formats for this.

Planets
If youve ever tried to create an orbital model of a
series of planets, moons and one star (such as in
our own solar system), youll know that coding the
mechanics can be a right pain. Luckily, there are
plenty of programs out there like NASAs GMAT
that can help you model orbits without the need
for doing it yourself. This can be useful for teaching
yourself or others about how celestial bodies move.

Fritzing

Choose from hundreds of different


components, microcontrollers and more.
Change their settings, rotate them and
customise them to your preferences

A
great
piece
of
software
for
planning
out
or
sharing electronic circuits,
Fritzing lets you create custom
circuit paths not only using
standard components such as
LEDs and resistors, but also
with a selection of different
microcontrollers from across
Arduinos range, as well as the
Raspberry Pi. It also has a neat
trick of turning the planned-out
images into standard electronic
component symbols to make
sharing the exact layout of
the circuit much easier. Even
further, you can use it to design
PCBs to then be printed and
used by yourself or others. Its
really the best tool for anyone
doing electronic design to use
as it makes the whole process
that much easier. If you want
to get into circuit design, it also
has an in-depth example and
tutorial section available to
teach you how to use it.

The Ubuntu Book 123

Supercharge Ubuntu

Partition storage with GParted


Handling partition tables with a GUI is simpler than using fdisk

Navigating GParted An example partition to learn more about how GPartedworks


Commit button

Visual overview

Free space

This button activates itself once


some changes have been made
to the partition table. Click it to
commit the new partition layout
to the disk please be aware that
this operation can not be undone

This diagram provides a visual


overview of the content of the
currently selected device. Each
partition is shown as a little box
whose width represents the
relative size on the drive

Users rejoice whenever this


grey symbol shows up. It
stands for unpartitioned
space it is disk space
which is currently not
assigned to any usage!

File system
indicator

Drive selector
GParted works on a
per-device level. The
combobox at the topright corner of the form
allows you to select
which device you want
to work on a sure-fire
way to detect the correct
candidate is comparing
the size displayed

Every operating system


has its own preferred
file system. This column
informs you about the
file systems used in the
individual partitions: FAT
is best for media which
will be used in different
operating systems

Partition name

Space consumption

Data table

Partitions can be provided


with easy-to-read names. If
your partitions are named,
the name will be displayed
in the Label field

These three columns provide a


detailed overview of the capacity
of the individual partitions. For
supported file systems, GParted
even displays information about the
amount of space currently being used

While a picture might say more than


a thousand words, putting loads of
information in one figure is not easy.
GParted bypasses this problem by
providing a table containing further
information on all partitions on the device

Ubuntus focus on user-friendliness is


illustrated by the fact that the GParted
utility comes with every installation of the operating
system: start it by entering GParted into the Dash.
Due to the utilitys sensitivity, prepare to be asked for
your password during the initialisation process.
GParted provides a visual overview of the entire
storage media. The individual partitions are then
overlaid in the form of boxes with extra information on

124 The Ubuntu Book

the file system and their role in the currently running


Ubuntu installation.
Partitions can be formatted, created, deleted
and in some cases even resized with simple, GUIdriven commands. Wizards provide step-by-step
assistance, ensuring that no invalid input is collected.
Furthermore, errors are mitigated as the partition table
is committed only upon your explicit command. This
approach compares favourably to the method used by

command-line tools: putting an inexperienced user in


front of fdisk is a sure-fire way to wreak havoc.
Let us be absolutely clear about this: when it is used
wrongly, GParted will cause severe data loss. If you are
unsure about anything, do not proceed and instead ask
a more knowledgeable person for help. Furthermore,
you should always have a backup of your important
data and do not run GParted when a power outage
may occur.

Partition storage media with GParted

Tutorial
01

Rescue your data

02

Fire up GParted

Repartition a USB stick

Even though some operations on the partition


table are non-destructive in theory, practical
experience tells us that things do go wrong, especially
when its not expected. Due to that, lets start out by
creating a backup of our sticks contents: open it in
Nautilus, select all the files and copy them to your
workstations hard disk to mitigate possible data loss.

Start GParted from the Dash, and authorise


it by entering your user password. Select the USB
stick with the device selector if working with a
standard USB drive, the content will look similar to
the one shown in the picture to the right.

Select the USB stick with


the device selector

03

Delete the old partition

Manufacturers of USB sticks tend to allocate


the entire storage space of the device to one large
partition. This is useful for most applications
average users want to be able to store very large files
with minimal effort (and without a trip to GParted).
Sadly, the document scanner targeted in this
tutorial has issues dealing with large partitions:
if the USB stick is larger than about 1GB or has
an advanced file system, the scanners firmware
perishes. Addressing this problem starts out by rightclicking the existing partition. Select Unmount in
order to remove it from your workstations file system
tree: the successful unmounting process triggers
a rescan, which can take up to a minute. Next,
right-click it again and select Delete. GParteds disk
overview window will reflect this change by displaying
the entire space of the medium as unallocated.

04

Create a partition

Right-click the unallocated space and select


the Insert option in the pop-up menu. GParted then
displays a dialog; the bar in the middle lets you move
the partition along the unallocated space using the
handles. Since dragging is less accurate than typing,
click the New size field and enter the numeric value
500. By default, GParted will create the partition at
the beginning of the storage medium this is a valid
default for most, if not all situations. Next, assign a
file system via the combo box. Small partitions (less
than 2GB) should be created with FAT16: this superprimitive file system is a gold standard for universal
compatibility across operating systems and devices.
Finally, click the Add button to commit the newly
created partition to GParteds cache of operations.

By default, GParted will


create the partition at the
beginning of the storage
medium this is a valid
default for most, if not
allsituations

05

Apply the changes

06

Deploy the USB stick

Look at the GParted window again: the


space below the table has been populated with a
series of actions. This is furthermore signified by
the status bar, which now displays 2 operations
pending. Actually changing the partition layout
requires you to click the green checkmark button.
GParted will display one final warning before getting
to work click Apply in the Apply operations to
Device button.
File system operations can take a bit of time: a
progress bar is displayed with further information.
When done, check whether the file system is
correct: if GParted created an ext4 file system, rightclick the partition and use the Format to option to
remedy the situation.

With that, were done with partitioning.


Just unmount the USB stick. Your newly formatted
storage medium is ready and waiting to accept loads
of scanned documents.

The Ubuntu Book 125

Supercharge Ubuntu

Remote control with Remmina


Manage that server in the attic without getting your clothes dusty
Desktop computers are a relatively new
invention: in the dark ages of computing,
users accessed systems which sat metres
or miles away. As the power of GUI-based workstations
grew, developers created remote access protocols.
Remmina is unique in supporting a few widely spread
protocols: in addition to VNC, the program is also
capable of communicating with hosts using Microsofts
RDP protocol.

The core idea behind remote protocols is easy: a


server mobilises its GUI, which is then accessed by
a client. If the network connection between the two
systems is fast enough, non-video tasks can be handled
with relative efficiency dont think about playing Quake
III or World of Warcraft via Remmina though.
In theory, both RDP and VNC can also be used across
public networks if your router is set up to expose the
relevant ports, a remote user can connect to the system

as if he was in your local network. Please be aware that


this can be quite unsafe: hackers perform port scans to
find vulnerable VNC and RDP servers, which are then
attacked with a range of sophisticated malware, which
is of course not what you want.
The app can be powered up via the Dash: simply enter
Remmina to open the connection manager window.
Then, follow the instructions on the next page in order to
take control of another Ubuntu workstation.

Remote control Windows 10 Handle a Windows workstation from an Ubuntu desktop


Enable scaling

Say goodbye

Connection manager

If your desktops resolution does not


match the one of the host, scrolling
will occur. Click this symbol to make
Remmina scale the content so that
it fits your window be aware of the
possibility of optical artefacts

Click this symbol to


disconnect Remmina from
the host cleanly. Simply
closing the window can
cause the host to crash in
some circumstances

Remmina can connect itself


to multiple hosts at the same
time. The Remmina Remote
Desktop Client window acts as
a manager where new remote
connections can be set up

Connection details
Remminas Basic
tab lets you enter
information about the
server IP, the user name
and the password. The
resolution and color
depth toggles allow you
to set basic properties of
the host display

Keyboard grabber
Sending Ctrl+Alt+Del to
a virtualised host can
be difficult. Press this
button to make Remmina
grab any and all keyboard
input pressing
Ctrl+Alt+Del in this state
sends the gesture to the
remote host

Work area

Rendering quality

For the Paranoid!

The blue speaks a clear


language: this is Windows land.
Click any of the symbols in
order to interact with them as
if you were running a normal
installation of Windows

Most remote desktop protocols


provide a set of quality levels
permitting you to trade display
quality for rendering speed.
Make your personal choice in
the Advanced tab

Some hosts permit


encrypted data transfers
via SSH. If this is the case,
the options related to this
feature can be set up via
the SSH tab

126 The Ubuntu Book

Remote control workstations with Remmina

Tutorial
01

Remote control an Ubuntu laptop from a workstation

Permit remote access

Ubuntu does not permit remote desktop


connections by default. Open the Dash, and
enter Desktop Sharing. Ubuntu will proceed to
presenting a settings application, which should be
started to reveal a form similar to the one shown on
the right.
Proceed to checking the Allow other users to
view your desktop checkbox in order to enable
basic access. Checking the You must confirm
each access to this machine box is ideally suited
to situations where a notebook or similar computer
must be accessed from time to time if the host is
to be unattended, requiring a password tends to be
a better approach.

Our tests showed most


Wi-Fi systems are fast
enough to provide good
performance if this is
not the case, the quality
can always be reduced

02

Find the IP address

The following steps assume that host and


client are in the same network. If that is the case,
you can open a Terminal window on the client and
then proceed to entering ifconfig. This command
dumps information about the current connection
state find the network adapter you use to
connect to the network, and note the value shown
next to inet addr:.

wlan2
Link encap:Ethernet HWaddr
e8:de:27:0f:ea:ba
inet addr:192.168.1.219 Bcast:192.168.1.255
Mask:255.255.255.0
inet6 addr: fe80::eade:27ff:fe0f:eaba/64
Scope:Link
Should you connect two systems frequently, try
to configure your router to assign a static IP to the
host in order to be able to reuse the connection
configuration created in the next step.

03

Create a connection

Click the Plus button in Remminas main


window in order to start the connection creation
dialog. The Name field should be populated with a
string which describes the connection.
Next, proceed to changing the Protocol combobox
so that its value reads VNC Virtual Network
Computing. Not doing this will lead to connection
problems with Ubuntu clients: RDP is a Microsoftesque invention which is not particularly widely
supported under Unix. The Server field must then be
populated with the IP adress determined above, while
the Resolution and Color depth fields can be set up
according to your taste.
Finally, proceed to clicking the Connect button in
order to make Remmina start the link-up process.
The main window of the program will show an extra
tab bearing the name of the connection profile bring
it to the front in order to see its contents.
When working via a decently fast network, setting
the quality to Best yields an aesthetically pleasing
display. Tests that we performed showed that most
Wi-Fi systems are fast enough to provide good
performance if this is not the case, the quality can
always be reduced later.

04

Take control

05

Do your thing!

06

Clean up

As Remmina connects to the host, a


dialog similar to the one shown in figure two will be
displayed on the hosts screen. Click the Allow button
in order to start transmitting data if you dont agree,
Remminas remote window will remain black as no
data is sent and no commands are accepted.

With that, server and client are connected


successfully. It now is up to you to decide what
needs doing next start apps, run console scripts
or write emails to your hearts content! As already
stated above, you need to be aware that games and
videos are bad candidates: stuttering frame rates
should be expected due to the way how VNC handles
display updating.

When youre done, click the disconnect


button to sever the connection between client
and host. Mark the connection profile in the main
window of Remmina, and click the red no symbol in
order to delete it alternatively, the profile can also
be changed by clicking the Pen symbol.

The Ubuntu Book 127

Supercharge Ubuntu

Switch languages with FCITX


This alternative input system is handy for working with Asian texts

Navigate FCITX Take a look at an FCITX-enabled workspace


Whos active?

Latin only!

Virtual keyboard

The name of the currentlyactive input scheme is


shown in the title bar of the
virtual keyboard fly-out.
Click it to cycle through the
various options offered!

Beware of the Fullwidth layout:


it creates normal-looking text,
which, however, lives in a different
unicode mapping. This means that
it can not be processed with most
text editors

This flyout provides further


information on how the
virtual keys of the currentlyenabled FCITX layout are
matched to the keys of a
native QWERTY keyboard

The FCITX toggle


Click this symbol if you
want to access the
main menu of the input
system: it is described
in further detail on the
facing page

Speaking Greek?
Should the need for
Greek numerals and
characters arise, users
of FCITX dont need to
fret. The product comes
with a ready-to-deploy
layout handling all
important characters

Speaking Russian?

Que Bellisima!

Advanced indexing

For all those who want


to write to a Russian
penpal, you dont have
to worry, as FCTIX
also takes care of any
Russophiles

Roman numerals can make boring


texts look smart. FCITX contains
a special substitution schedule
which lets you enter Roman
numbers ranging from 1 to 9 via
the numerical keyboard

All kinds of advanced


numerical symbols are
ready and waiting it
takes one click in FCITX
to unearth them!

The X Window System can gather user


input from a variety of input sources. If the
developer of a new keyboard or similar input
trinket wants to make his product accessible to Unix, he
simply sets out to code a new input source.
Sadly, FCITX is not included in Western versions
of Ubuntu by default. Getting started requires you to
download a group of modules a workable version can
be obtained with the following apt-get command:

128 The Ubuntu Book

sudo apt-get install fcitx fcitx-pinyin fcitx-sunpinyin


fcitx-googlepinyin fcitx-anthy fcitx-mozc
Once apt-get has downloaded the archives (expect
a file transfer volume of about 70MB for this), open
a terminal and enter im-config in order to start the
deployment process.
Then, simply follow the instructions shown on the
screen: on the authors Ubuntu 14.04 LTS machine, the
correct click sequence was OK, No, OK. After that, a

reboot is required: the X-Server can not accommodate


new input sources while a session is running. Should
your system run any important daemons, killing the X
Server is also a permissible approach.
After the reboot, the indicator menu area will be
enriched by the addition of a keyboard symbol. Click on
this in order to open the context menu which provides
access to the various functions contained in FCITX and
the modules that were downloaded alongside it.

Switch languages with FCITX


Using the keyboard
FCITX works by substituting the keys on your physical keyboard with a second set of
alternative keys. Sadly, keeping the mapping between virtual and real key placing is
not always easy especially if you use the features of the product rarely. Fortunately,
FCITX provides an easy-to-use memory aide. Click the FCITX symbol in the indicator
menu area, and proceed to hit the Toggle virtual keyboard option.
Once this is done, a semitransparent overview of the currently-active keyboard
layout will float in the middle of the screen. Clicking its title border changes the
currently-enabled input mode: the content of the virtual keys will, of course, be
adjusted to the new selection.
Should you use a non-UK keyboard, be aware that some of the keys will not match
the placements in the virtual keyboard. If you use the corresponding characters rarely,
simply click the corresponding key with your mouse the character in question will
automatically appear at the corresponding cursor position.

Your results look much more serious


and organised if your formulae have a
professional-looking design
Enter mathematical symbols

Change advanced settings

Make your documents look high-tech with FCITX

Make FCITX do what you tell it to object shapes

Be it research, finance mathematics


or the determination of an outcome
of a war game, your results look
much more serious and organised
if your formulae have a somewhat
professional-looking design. Writing
Integral, +INF and Co screams
amateur using LaTex is not for the
faint of heart and requires some skill
and determination.
FCITX lets you work around that
problem by providing an effortless
way to enter special characters for
these uses. Simply set the virtual

keyboard to the Math mode, and get


tapping away LibreOffice, Gedit
and most other Unixoid applications
should be able to handle the Unicode
characters perfectly well with no or
minimal extra effort.
Please be aware that many fonts
include but a small subset of the
mathematical symbols included in
FCITX. If you do happen to notice
small rectangles or white spaces
instead of the characters, try
switching to a different font in order
to obtain better results.

An ancient German proverb states


that no one can design a system
which satisfies everyone. This
problem, of course, also affects the
noble art of application design: a
solution can be had in the form of
options or preference dialogs.
In the case of FCITX, the relevant
settings can be found behind the
Configure entry of the main context
menu. Click it to open a dialog
providing an array of further choices.
The first tab it usually goes by
the label Input Method, lets you

select the input source which FCITX


will use to generate the character
input signals. Global Config allows
you to modify the various keyboard
shortcuts, while the Appearance tab
is responsible for changing the look
of the virtual keyboard.
Finally, most add-ons have
preference dialogs of their own.
They can be accessed by selecting
the name of the relevant Add-on
on the Add-on tag a click on the
configure button at the bottom will
provide further options for you.

Hunt down issues


Even though Japan is a very important market for
both games and applications, quite a few developers
dont test their products on a system with FCITX. The
use of trigger keys can then lead to hilarious results
the project maintainers keep a list of offenders in
their wiki, which can be accessed via the URL https://
fcitx-im.org/wiki/Hall_of_Shame_for_Linux_IME_
Support. In some cases, the team even provides basic
work-arounds which can be used to tame rebelling
applications. In some cases, however, disabling FCITX is
and remains the only workable solution.
Should your problems be on a more global level, so
that they affect all applications in the exact same way,
visiting the FAQ provided at https://fcitx-im.org/wiki/
FAQ. This is likely to provide a suitable remedy to the
problem at hand. Finally, firing up Google might also
lead to a solution.

The Ubuntu Book 129

Supercharge Ubuntu

BitTorrent with Transmission


Upload and download data with the BitTorrent protocol
BitTorrent is a P2P protocol which permits
its users to share files in a fashion similar to
filesharing systems like Napster or Kazaa.
Obtaining content from the BitTorrent network is easy: a
.torrent file contains a bit of information called a seed.
Once open, it will then connect to other systems called
peers, which will attempt to provide your computer with
a full image of the file as time goes by.

Finding BitTorrent content can be difficult if the


provider does not supply you with the .torrent file. Due
to the decentralised nature of the network, there is no
central source for the .torrent files. Tracker sites avoid
this problem by acting as a database of commonly used
.torrent files, the most popular one being The Pirate Bay.
As a file gets downloaded, your computer
automatically proceeds to sharing its contents with

other users. As a matter of courtesy, users should


always try to upload at least as much data as they
download not doing so will cause the P2P networks to
slow down.
A word of warning: BitTorrent is extraordinarily
easy to track, and its legality can be pretty sketchy.
Downloading movies, music or games in this way is
illegal and could lead to prosecution.

Transmission in action Understand key metrics displayed in the Transmission window


Download speed

Upload speed

Torrent search

This metric informs you about the


current download speed: the higher it
is, the faster data will be transmitted
to you from other peers

The upload speed indicates the speed of


the opposing traffic. The higher it is, the
more data is transferred to other users of
the torrent

Power users can have up to thousands


of BitTorrent streams active in parallel.
Transmissions search box allows you to
limit the displayed information to a subset

Active torrent list


Transmission displays
a list of active transfers
in its main window. The
bold text is the name
of the file, while the
progress bar shows how
much data has already
been downloaded

Download dialog
Click a .torrent
file to open it with
Transmission. This popup allows you to specify
where data is to be
saved and which priority
is to be assigned to the
torrenting stream

Speedbrake

Auto-delete

Cumulated statistics

BitTorrent downloads will take up all of the


network bandwidth available. This can lead to
lag in other applications the speedbrake is
enabled if the tortoise symbol is highlighted

Keeping .torrent files around once the


download process is started is a waste of
space. Check this box to make Transmission
eliminate unneeded files automatically

Transmission adds up the speeds of


all your torrents for you. The bar at the
bottom-right corner shows an aggregate of
download and upload speeds

130 The Ubuntu Book

BitTorrent with Transmission


Control the download speed
Internet connections have finite bandwidth per
definition: if the upload gets congested, other
applications start to stutter and/or lag. Transmission
addresses this problem with its throttling feature, which
restricts BitTorrent transfers to a set speed.
Click Edit>Preferences to open the transmission
settings dialog. The Speed tab shown in the
accompanying figure contains two groups of controls:
the normal speed limits, which must be enabled via
checkbox, are active at all times. The second level of
speed limits is found below the Alternative Speed
Limits, and is enabled only if the Tortoise button shown
on the facing page is pressed.
Determining sensible speed limits is easy.
Open www.speedtest.net in a web browser while
Transmission is not running, and run the speed test.
Deduct 50 to 100 KB from the determined performance
results to keep other programs happy. If you work on
a shared connection, higher deductions should be
applied to prevent slowdowns.

Stay awake while downloading

Advanced filtering

Hibernation is downloadings natural predator

Make sure that unneeded information is not on-screen

Do you want your downloads to keep


going while youre out of the house?
Its a problematic proposition due
to the automatic stand-by function:
when left alone, both workstations
and notebooks will eventually go to
sleep in order to conserve energy.
This problem can be worked
around efficiently. Open the
aforementioned Preferences
dialog, and proceed to changing
to the Desktop tab. The checkbox
Inhibit hibernation when torrents
are active makes Transmission

keep the system alive while data is


being transferred: as there always is
some kind of upload running, setting
this checkbox means that your
workstation, in practice, will never
shut down automatically.
This can be solved by stopping
the seeding process when a set ratio
has been reached. Change to the
Seeding dialog and enable the Stop
seeding at ratio checkbox the
higher the ratio, the more data needs
to be transferred before torrents
shut down automatically.

Keeping an eye on the torrents that


you have on the go is not always easy.
As such, Transmission has some
options to filter whats shown in a
more advanced way.
The three fields next to the Show:
label allow you to reduce the amount
of data shown on screen. Firstly,
the leftmost combobox allows you
to select torrents according to the
transfer state they are currently in.
Setting it to error makes solving any
download problems you encounter
that much easier. The middle one,

however, is not of any particular use if


you are not a torrent professional.
The text box on the right allows
you to enter a string of choice.
Transmission then uses what you
have input here in order to narrow
down the displayed elements quickly
and simply.
Clicking on the delete symbol on
the rightmost border of the button
allows you to clear the field of your
inputs in order to reset the display to
the choices that have been set in the
first two comboboxes.

Get long-term statistics


BitTorrent can be addictive. When yours truly was younger, he had a friend who
downloaded terabytes of data per month. Keeping a tab on your data volume is
important not only for egotistic reasons: if you overdo it with downloading, most ISPs
will shut you down after a month or two.
Transmission addresses this problem via the Statistics module which can be opened
in the menu (Help>Statistics). It is made up of two sections: the top of the form covers
the traffic caused since the last start-up, while the bottom of the window covers the
entire history of the Transmission installation. Clicking the Reset button restarts the
counting cycle: savvy Internet users click it whenever their billing cycle restarts.
The factor called Ratio is the holy grail of BitTorrenting. It is determined from the
upload and download traffic: if the number is higher than one, the corresponding user
has uploaded more data than he has downloaded. Having a ratio that is less than one
qualifies a person as leech, which can get you banned from most private trackers at
short notice.

The factor called Ratio is the holy grail


of BitTorrenting
The Ubuntu Book 131

Supercharge Ubuntu

Visualise your data


with Chart.js
Chart.js is a JavaScript library that helps you draw gorgeous
graphs of all kinds on your website
Data visualisation is one of the most important
considerations when you need to convey a message to your
audience in the clearest manner possible. Whatever the
message may be, if you want it to be instantly understood it is vital that
data is plotted as charts and graphs, not plain tables. Since humans
are wired to understand images better than text, data visualisation will
almost always save the day for you and your presentation.
Its all very well understanding the theory, but it then raises the
question of how to do it. There are tons of data visualisation tools out

Since humans are wired to understand


images better than text, data
visualisation will almost always save the
day for you
132 The Ubuntu Book

there that cost a lot and do not let you even get a glimpse of what they
are capable of before you actually pay for them. Thankfully, the open
source world comes to your rescue. There are many open source data
visualisation tools available that you can play with to illustrate your
data in the best possible way. Here we will take a look at one such tool
Chart.js. It is easy to use and offers a great deal of control over how
the graphs and charts look and feel when they are plotted. Please note
that while using Chart.js you may have to fiddle with JavaScript code
snippets, but it is very easy to handle and can be mastered by anyone.

Above Chart.js lets


you draw common
graphs with just a
tiny bit of code. This
is a pie chart with
custom tool tips

Visualise your data with Chart.js


01

Installation

To install the Chart.js library, just download


the JavaScript library from the official Chart.js GitHub
repository and then include the chart.js file wherever
youd like to use it:

<script src=Chart.js></script>
Note that you need to pass the proper path of the
chart.js file in your file system, while including the
library file.
Instead of manual download, you can also use the
JavaScript package managers like NPM or Bower.
As you may already know, NPM is used commonly to
manage Node.js modules, but it also supports frontend libraries, while Bower is created solely for frontend libraries. The biggest difference is that NPM uses
a nested dependency tree, while Bower requires a flat
dependency tree, putting the burden of dependency
resolution on the user. Coming back to Chart.js, here
is how to grab it using Bower:

$ bower install Chart.js --save


If you want to use NPM:

$ npm install chart.js --save


Also, Chart.js is available from CDN: https://cdnjs.
com/libraries/Chart.js.

02

Create your first chart

Once you have the chart included, you can


start plotting graphs. The first step is to create a
canvas tag and assign an ID to it. Later, you need to
get the element using the ID assigned to the canvas
and use it to instantiate the Chart class. For example,
create a canvas with the ID myChart at the location
youd like to draw the graph in the HTML file:

<canvas id=myChart width=400 height=400></


canvas>
Then, in JavaScript, get the context of the canvas
element using the ID, and instantiate the Chart class
using the context you got in the first step:

var ctx = document.


getElementById(myFirstChart).
getContext(2d);
var myNewChart = new Chart(ctx).
PolarArea(data);
The steps remain the same if you are using jQuery, it
is just the syntax that changes:

var ctx = $(#myChart).get(0).


getContext(2d);
var myNewChart = new Chart(ctx);
If you noticed, after creating the Chart object, the
method PolarArea() is called. This draws a Polar area
chart with the data passed as the argument to the
PolarArea() method.

Above Use the global default values and just


change the parts you want, as in this example of a
false bezierCurve chart

03

label: My Second dataset,


fillColor: rgba(151,187,205,0.2),
strokeColor: rgba(151,187,205,1),
pointColor: rgba(151,187,205,1),
pointStrokeColor: #fff,
pointHighlightFill: #fff,
pointHighlightStroke: rgba(151,187,2
05,1),
data: [28, 48, 40, 19, 86, 27, 90]

Line charts

One of the most commonly used charts, the


line chart plots data points and then connects them
on a line. It is generally used to show trend data. If more
than one line chart is plotted on a single window, it can
also be used to show comparison of data sets. To draw
a line chart, you can just call the Line() method on the
Chart object. For example:

}
]
};

var myLineChart = new Chart(ctx).Line(data,


options);
Now, there are two arguments for the Line() method.
Let us get an understanding of their usage. The first
argument data holds the data points, labels and other
metadata about how the graph should look and feel
once the points are plotted. Here is a sample dataset:

var data = {
labels: [January, February, March,
April,
May, June, July],
datasets: [
{
label: My First dataset,
fillColor: rgba(220,220,220,0.2),
strokeColor: rgba(220,220,220,1),
pointColor: rgba(220,220,220,1),
pointStrokeColor: #fff,
pointHighlightFill: #fff,
pointHighlightStroke: rgba(220,220,2
20,1),
data: [65, 59, 80, 81, 56, 55, 40]
},
{

The options argument holds the info about other


aspects of the graph, such as whether the line
between the data points should be curved or not.
You can even set the radius of the point dot in pixels.
Note that it is not mandatory to set all of the values; you
can just set the value that youd like to change. The rest
of the fields are taken from the global default values.
For example:

var myLineChart = new Chart(ctx).Line(data, {


bezierCurve: false
});
This creates a chart using all the default options, with
just the bezierCurve option set to false, meaning the
lines connecting data points will be straight lines.

If more than one line


chart is plotted on a
window, it can be used to
show comparison
The Ubuntu Book 133

Supercharge Ubuntu
pointStrokeColor: #fff,
pointHighlightFill: #fff,
pointHighlightStroke: rgba(220,220,2

Global configuration
Along with the global prototype methods, the global
configurations are also available for you to set up. This
allows for changing options globally across chart types,
avoiding the need to specify options for each instance,
or the default for a particular chart type. You can find it
in the chart.js file.

04

data: [65, 59, 90, 81, 56, 55, 40]


},
{
label: My Second dataset,
fillColor: rgba(151,187,205,0.2),
strokeColor: rgba(151,187,205,1),
pointColor: rgba(151,187,205,1),
pointStrokeColor: #fff,
pointHighlightFill: #fff,
pointHighlightStroke: rgba(151,187,2

Like line charts, bar charts are a very popular


choice when the user needs to display data points
spread over time or some other parameter. Bar charts
are generally rectangular bars with their height
corresponding to the data point (if the bar is on the
x-axis) or their length corresponding to the data point
(if the bar is on the y-axis). Multiple bars can be plotted
side-by-side to make comparisons. Here is how you
can plot a bar chart in Chart.js:

05,1),

var myBarChart = new Chart(ctx).Bar(data,


options);

06

05

Radar chart

A radar chart is a way to show data as a twodimensional chart. In these kinds of charts, three
or more variables are represented on axes starting
from the same point. Another quality of these types
of charts is that the relative position and angle of the
axes is typically uninformative. That means you can
use radar charts to plot more data points compared
to bar or line charts.
The process to plot radar charts using Chart.
js is not different; you just need to call the Radar()
method:

var myRadarChart = new Chart(ctx).Radar(data,


options);
To provide context of what each point means, we
need to include an array of strings that shows around
each point in the chart (called labels). For the radar
chart data, we have an array of datasets. Each of
these is an object, with a fill colour, a stroke colour,
a colour for the fill of each point, and a colour for the
stroke of each point. We also have an array of data
values. The label key on each dataset is optional, and
can be used when generating a scale for the chart.
Here is how the dataset looks:

var data = {
labels: [Eating, Drinking, Sleeping,
Designing,
Coding, Cycling, Running],
datasets:
[
{
label: My First dataset,
fillColor: rgba(220,220,220,0.2),
strokeColor: rgba(220,220,220,1),
pointColor: rgba(220,220,220,1),
134 The Ubuntu Book

The data structure used here is fairly simple:

20,1),

Bar chart

Note that the data structure used for a bar chart is


similar to the one used in line charts.

new Chart(ctx).PolarArea(data, options);

data: [28, 48, 40, 19, 96, 27, 100]


}
]
};
Pie charts

Pie charts are excellent at showing the


relational proportions between data. They are
generally used to plot the percentages of different
items, and as such the sum total of all the items
comes out to 100. As we saw earlier, the angle doesnt
matter in radar charts, but pie charts use the angle
(or the arc) of each segment to show the proportional
value of each piece of data.
A popular variation of pie charts is the doughnut
chart. The major difference is that the inner portion
of the pie chart is filled, while for a doughnut chart it
is empty. Hence, both the charts effectively use the
same class in Chart.js, but have one different default
value their percentageInnerCutout, set in the global
configuration file. This equates to what percentage
of the inner should be cut out. This defaults to 0 for
pie charts, and 50 for doughnuts. Though there are
different aliases for both of the charts, they differ only
in the default value.

var myPieChart = new Chart(ctx[0]).


Pie(data,options);
var myDoughnutChart = new Chart(ctx[1]).
Doughnut(data,options);

07

Polar area chart

Polar area charts look similar to pie charts,


but there is one major difference the radius of
various segments changes depending upon the
values, while the angle remains the same. Pie charts
have the same radius for all the segments and
the angle varies depending on the values. To plot a
polar area chart using Chart.js, you need to use the
PolarArea() method:

var data = [
{
value: 300,
color:#F7464A,
highlight: #FF5A5E,
label: Red
},
{
value: 50,
color: #46BFBD,
highlight: #5AD3D1,
label: Green
},
{
value: 100,
color: #FDB45C,
highlight: #FFC870,
label: Yellow
},
{
value: 40,
color: #949FB1,
highlight: #A8B3C5,
label: Grey
},
{
value: 120,
color: #4D5360,
highlight: #616774,
label: Dark Grey
}
];
Each array element has a value, default colour,
highlight colour and the label to be displayed. As with
other charts, you can keep the default options or
change them as you wish.

08

Prototype methods

For each chart, there is a set of global


prototype methods on the shared ChartType, which
you may find useful. These are available on all chart
objects created with Chart.js. Here, for example, let
us use a line chart object:

var myLineChart = new Chart(ctx).Line(data);


First method is clear(). This clears the chart canvas
on which myLineChart is drawn. You can use this
between animation frames to clear the frame and
render again:

A popular variation of pie charts is the doughnut


chart. The major difference is that the inner portion of
the pie chart is filled, while for a doughnut chart it is
left empty

Visualise your data with Chart.js


myLineChart.clear();
Next method is stop(), used to stop the current
animation loop. The frame is paused once you call
this method:

myLineChart.stop();
Use resize() to manually resize the canvas element.
This is run each time the browser is resized, but you
can also call this method manually if you change the
size of the canvas nodes container element:

myLineChart.resize();
The last method we will discuss is destroy(). This will
clean up any references stored to the chart object
within Chart.js, along with any associated event
listeners attached by Chart.js:

myLineChart.destroy();
There are a few other methods available as well.
In addition to these generic methods, there are
several chart-specific prototype methods. Space
constraints make it difficult to cover all of them
here, but you can look them up in the official Chart.
js documentation.

09

Extend existing chart types

As we all know, open source software not


only means being able to freely use and learn stuff,
but also being able to extend and build upon the
existing elements. On the same lines, let us see
how you can extend an existing chart class with
extra functionality. Lets say, for example, that you
want to run some more code while initialising every
line chart:

Chart.types.Line.extend({
// Passing a name registers this chart
in the
// Chart namespace in the same way
name: LineAlt,
initialize: function(data){
console.log(My Line chart
extension);
Chart.types.Line.prototype.
initialize.
apply(this, arguments);
}
});
// Creates a line chart in the same way
new Chart(ctx).LineAlt(data);

10

Above This scatter chart is a result of


community extensions
under Chart.helpers, including things such as
looping over collections, requesting animation
frames, and easing equations. On top of this,
there are also some more simple base classes
of Chart elements. These all extend from Chart.
Element, and include elements such as points,
bars and scales.
There are already a handful of community
extensions listed on Chart.js. One of them is
scatter chart. Take a look here: dima117.github.
io/Chart.Scatter.

If youre a power user,


and are not opposed to
having a bit of an explore
of things, Chart.js provides
easy ways to add new
chart types in to the
existing library

Chart.Type.extend({
name: Scatter,
defaults : {
options: Here,
available: at this.options
},

Adding new chart types

If youre a power user, and are not


opposed to having a bit of an explore of things,
Chart.js provides easy ways to add new chart
types to the existing library. The format here
is relatively simple. You just need to pass in a
name and provide the defaults for the new chart
type. There are a set of utility helper methods

initialize: function(data){
this.chart.ctx
this.chart.canvas
},
draw:function() {
}
});
The Ubuntu Book 135

Supercharge Ubuntu

Command-line efficiency:
Take the terminal further
Get confident with the terminal and put the command line to use to get
work done on Ubuntu

he power of words is more expressive than


pointing particularly when you want to
achieve something complicated, and do it fast.
Commands are more reliable than pointing and clicking
for getting things done repeatedly, and accurately: well
show you how they can be chained together to produce
just the result you want.
While we hope you come to appreciate the power
of the command line, well also show you its use in
situations where little other choice exists, such as
maintaining a web server for your pet project.
Well also help get to grips with rogue processes
which use too much of your precious system resources.
If you find some of the desktop metaphors hard
to leave behind, thats no problem well show you
some GUI-type apps and shortcuts that run within the
terminal, giving you the best of both worlds.

136 The Ubuntu Book

Building on this foundation, you should feel confident


keeping a terminal open all the time, ready to quickly run
a command or two, but there are other ways to quickly
get to a command shell.
apt-get install tilda and youll have a drop-down
terminal, callable by keyboard shortcut (F1 by default). If
youre using Kubuntu, then install yakuake. Theres also
a more minimalist version, yeahconsole, that you can try
on more lightweight desktops.

There are few tasks that cannot be accomplished


at the command line; the real question is which ones it
is best suited to. Well round off with a few snippets of
commands that will keep you productive, and help to
run your Ubuntu system.
Once youve learned a few key commands, think of
them like Lego bricks, and start looking for new and
productive ways to put them together well give you a
couple of simple examples to get you started.

Commands are more reliable than pointing and


clicking for getting things done repeatedly, and
accurately: well show you how they can be chained
together to produce just the result you want

Command-line efficiency

Pipes - the power


of Unix plumbing

Left Dont be
daunted by the oldfashioned look of
the terminal

Assemble a palette of commands


to produce just the result you
want from a command-line query
Remember the grep ls ~/.bash_history we used
in the introductory article (p.28), to find instances of
ls used so far? The entire contents of bash_history
can be seen by typing the command history give
it a go.
Now were going to take the output of history
and join it to the input of other commands using one
of Unixs most powerful features, the pipe. On UK
keyboards, | is found above \, to the left of Z. We can
use it to connect two commands like so:

history | tail
We can chain together as many commands as
we wish. Lets sort the commands into alphabetical
order, remove duplicates, and then view them one
page at a time:

cat ~/.bash_history | sort | uniq | more


This is quite a fascinating thing to try. Note how we
used the contents of the history file, rather than the
output of history, as the latter puts a number in front
of each command, and sort would leave them in that
numerical order. There is a way of just grabbing the
commands, using Awk to filter the columns this is
something wed encourage you to investigate if you
need to go even further with the command line.

Tail to go
The tail command has a useful live switch, -f
(for follow), which, after showing you the last ten
lines of a file, keeps it open to display new lines as
they arrive. This is very handy for monitoring log
files: Ubuntu applications that generate a lot of
information about access and system changes,
such as web servers and databases, place and
update logs under /var/log/.
If youve put up a web server, youll find a lot of
the logs are of malicious attempts to find common
flaws in PHP web apps. Assuming youre not running
a common PHP CMS, like Drupal or WordPress, the
never-ending stream of information can drown out
what you want to find.
For example, a 404 result resource not found,
indicating an image or script (or a whole page)
looked for but not found can be of use to diagnose
problems when youre building your site. Combine
tail-f with grep to filter out the extraneous noise
of live results:

tail -f /var/log/nginx/error.log | grep 404


The Ubuntu Book 137

Supercharge Ubuntu

Collecting output as text


We can use > to write text into a file. Lets say we
wanted to take a list of what is in a directory, and
save it:

ls /bin > bin.20160212.txt


The > will overwrite the existing contents of a file; if
you want to add content without overwriting, use >>
(theres no space between the symbols), which adds
content to the end of the file.

ls /usr/bin >> bin.20160212.txt


We used cat to dump a text file into the terminal,
but its designed to take more than one file, and join
(concatenate) them together; then they can be piped
into a single file if you wish:

cat ubuntu-day1.txt ubuntu-day2.txt


ubuntu-day3.txt ubuntu-day4.txt
ubuntu-day5.txt ubuntu-day6.txt
ubuntu-day7.txt > my-ubuntu-week.txt
Reversing the direction, we can feed a file to a
command sort < bin.20160212.txt then put
that through another process, and then send it to a
new file: sort < bin.20160212.txt | head >

first-of-bin.20160212.txt

A secure copy
SCP uses SSS as a transport layer, to copy files across
networks including the Internet without exposing
the files to anyone looking to intercept their contents.
The scp command has much the same syntax as the
ssh and the cp commands combined. To copy a file from
your home folder to that of your Raspberry Pi, given
the same address as above: scp ~/myfirstgame.py
pi@192.168.0.7:/home/pi/. Youll be prompted for your
password, then the file will be transferred.
Running a command on a folder, and every subfolder
and file inside, is a lot quicker with the command
line. Changing permissions, copying folders, many
commands have a recursive option usually -r. For
scp this also applies, and you could retrieve every file
from your Pi with: scp -r pi@192.168.0.7:/home/pi ~/
mypibackupfolder/.

Wildcard
The other short cut to repeating commands over
multiple files, is wildcard substitutions. * will be
unpacked by the command line as every possible
character here; use it on a part of a name like this:

cp ~/Music/*.mp3 /media/musicplayer/

The network is the computer, as the saying goes. Its


normal to be working on several computers at once,
even if your interaction is limited to reading webpages,
and streaming music across the internet. But with
Ubuntu VPSs (virtual private servers) available for
a couple of pounds a week, its tempting to try your
newfound skills on your own server to set up a
website for your projects, perhaps.
SSH (Secure Shell) gives remote access to Unix
servers whether Ubuntu, Mac OS X or even a
Raspberry Pi. You connect with ssh then the name
or address of the server, plus any login details.
For example, if you have a Raspberry Pi on your
home network, and your router has assigned it
the address 192.168.0.7, you would connect with
sshpi@192.168.0.7.
If your VPS hosts your project website about
different flavours of Ubuntu, say, and youve given
it the domain name comparebuntu.com, you could
connect with ssh root@comparebuntu.com.
A word of warning: the internet is not a safe place;
there are many random attempts to SSH into servers,
and root is the commonest login name to try. Set the
server to not allow root login, by setting the value of
PermitRootLogin to no in /etc/ssh/sshd_config .
You should first set up a regular user with a strong
password, and credentials to use sudo something
that will probably have been arranged during the
system setup. Restart the SSH server with sudo
service ssh restart, and try logging in from a
separate terminal session before closing the current
one, so that you still have access if something has
gone wrong.

138 The Ubuntu Book

to copy every MP3 to a plugged-in device. If you have


files named ubuntu-report.txt, ubuntu-notes.txt, and
ubuntu-test.txt, you could perform an operation on all of
them, but leave ubuntu-howto-video.mp4 alone, with:
mv ubuntu*.txt ~/Documents/.
One tool that may help you with moving and copying files
is mc: apt-get install mc.
mc stands for Midnight Commander; its a visual file
manager for the command line, and is a quick way of
performing a number of the file operations weve looked
at in these pages. In addition, its built-in editor, mcedit, is
slightly friendlier than nano.

mc stands for
MidnightCommander;
its a visual file manager
for the command line,
and is a quick way of
performing a number of
file operations

Command-line efficiency
Midnight Commander

A GUI for the command line

Drop-down menus

Twin pane interaction

F9 gives access to drop-down


menus, to configure mc, and to
change permissions and other
properties, as well as performing
actions for which you have forgotten
the many keyboard shortcuts

Moving or copying files or folders from one


directory to another is done with F5 (copy) or
F6 (move). As you can see from the windows
titlebar, were copying from a remote
directory; mc will transparently handle
copying over SSH and FTP

Function key shortcuts

Hints and tips

That bottom row of numbers is a key to the


shortcuts available on function keys. If your
version of Ubuntu has hijacked one of the
F-keys, you can use the Esc key followed by
the digit (pressing 0 for 10)

Above the function key listing youll see


info on current operations here listing
the directory in the left pane, to which a
file is about to be copied from the remote
machine in the right pane

All those programs, and


one goes wrong
When an app starts to eat your resources, and clicking on
the window bars X wont close it, open up a terminal and
deal with the problem. Every program running on Ubuntu
has a process identity (PID); knowing this, you can send the
process a signal to terminate. Lets pick on Firefox as an
example. ps gives us a list of all of the running processes;
ps -auxww gives us the most complete listing. If youve a lot
going on, you may have to scroll back up the list to find it no
need to reach for the mouse to grab the scroll bar: the right
Shift key and PgUp/PgDn will scroll you up and down.
Even that is unnecessary effort. Remember grep? ps
auxww | grep -i firefox note that you dont have to put the
dash after ps, while the -i after grep tells it to ignore case

matching, as occasionally youll run across an app with


upper-case letters in its executables name (although this is
rather frowned upon).
Once you have the magic PID, just add it to kill; for
example, kill 3579. You can also killall firefox. Either sends
a SIGTERM to Firefox, telling it to stop; it will shut down as
cleanly as it can, after trying to save any data.
Sometimes a program has a bad memory leak, is trapped
in a race condition, or suffers from one of many other bugs
that can leave it locked up and unreachable. If its slowing
Ubuntu right down, and waiting on the off-chance that it
clears itself is not viable, a SIGKILL tells the Linux kernel to
just drop the app, instantly killing it, but losing any unsaved
data too. The SIGKILL is sent with kill -9 3579.
You can see all of the busiest processes in the terminal
at any time by running the top program, which also shows
their memory and CPU use, as well as information on

overall CPU and memory state. We recommend installing


htop, a more informative top which splits CPU load by core,
can be scrolled sideways, and allows you to interactively
kill processes.

The Ubuntu Book 139

Supercharge Ubuntu

Your command-line
cookbook: diced and sliced
Some quick recipes for using the command line
to tackle a range of tasks and problems
Over time, youll build up your own listing of terminal
apps and piped-together commands that you go to for
particular tasks. Were rounding off this guide with a few
for you to try that show you the breadth of applications
of the command line in day-to-day use. We hope youll
feel inspired to build on them and research more ways
of getting things done speedily, and accurately, to solve
your problems without having to reach for a mouse.

See step 3 for ways of making searches for commandline tips without even opening Firefox or Chromium.
Were not suggesting avoiding GUI apps, particularly
websites, altogether; if youre simply after information,
however, a command-line web browse is a lot quicker
and has far fewer distractions.
Network troubleshooting is a topic that deserves its
own book in fact there are many of them but have a

01

Disk usage

Disk sizes keep growing, but so do files, with


HD video and 24-bit 192kHz audio files. Keep track of
your disk space with df, the disk free command. df-h
gives you the answer in kB, MB and GB, rather than
large numbers of bytes.
The same is the case with du, which tells you how
much space a folder is using, along with each item it
contains. Try out both commands, with df -h and
du/home.

140 The Ubuntu Book

look at some of the tools we mention in step 4; theyll


help you work out whats going on whenever troubles
arise, or youre just connected to a strange network and
need to know more.
We also take a brief look at working with disks,
something that can be scary enough in a GUI, and finish
off the tutorial with a tool that could be even more useful
than mc.

Youll notice that if youve got any other disks


plugged in, these are tallied too. In fact, df is a useful
quick check to see what disks are plugged in, and
mounted (available), and shows both the device and
the mount point on the file system.
The reason the default is in the less readable byte
size is so that they can be sorted. For example:

du -a /var | sort -n -r | head


shows the biggest users of memory in /var.

Command-line efficiency

02

Imagination

Commands are built to do one, simple, small


thing well but that doesnt stop you using them for
other purposes. wc is the word count program; wc -l
tells you how many lines are in a file. Put that counting
ability to use elsewhere.
There are many files in /usr/bin/, where Ubuntu
keeps the majority of your apps. Although the terminal
displays them more densely, ls actually outputs one
file per line feed that to wc and you can quickly count
the number of programs in the directory:

or your town (the -4 may not be necessary on your


network) for a local update; have a look at it in your
regular browser, too.

05

Disk division

06

GNU Screen: the persistent terminal

Your hard disk is divided up into partitions.


Ubuntu will have its files in one or more of these, most
likely formatted with ext4 file system. There will also
be a swap partition, to optimise memory use. If your
PC also has MS Windows, there will be a partition
with FAT32 or NTFS formatting, and maybe others for
recovery and backup.
All of these were created by the operating system
installer(s), but Ubuntu has the tools for you to do the
job yourself, where necessary. For example, say you
have an SD card, formatted with FAT32, but you need it
to be FAT16 for compatibility with an old device. Plug in
the card, and run sudo fdisk -l.
You should be able to identify the SD card by its size;
it may be listed as /dev/sdb (with a single partition of
/dev/sdb1). Unmount it first with umount /dev/sdb1
and format with mkfs.fat /dev/sdb1 but make
sure youve got the disk, or you will wipe everything off
another device one of many reasons why you should
always maintain good backups.

ls /usr/bin | wc -l

04
03

Web of commands

Although
JavaScript-heavy
webpages
dont work well with command-line web browsers,
fallback for mobile sites makes even Facebook
relatively useful in the terminal with a browser-like
w3m or links2, and Twitter clients like rainbowstream
are every bit as good as their GUI equivalents.
But its for quick queries of the web that the
command line fits best. Surfraw, written many
moons ago by (a then far less famous) Julian
Assange, queries everything from Amazon through
currency converters, to acronym databases, with a
single command like: sr -t acronym www.
Lastly, while curl is a great tool for downloading
web resources, websites are even being written to
suit it. Try curl -4 http://wttr.in/Liverpool

Network woes

Network troubleshooting is a huge topic, which


we can scarcely touch on here, but know that Ubuntu
has all the tools at hand (or an apt-get away). The
simple ping is a useful diagnostic: ping google.com
and if you get back regular packets, you know not just
that your network is connected successfully to the rest
of the internet, but that you can also resolve domain
names into IP addresses. ping 8.8.8.8 will decide
between one and none of those two working.
route -n tells you about your gateway to the
outside world, and ifconfig about your network
hardware, and its configuration. A traceroute
to another domain can give you information about
bottlenecks along the way, and for the Swiss Army
knife of network programs, download netcat.

Its for quick queries


of the web that the
command line fits best

Theres plenty left to explore, but well leave


you with a parting gift, one even more useful than mc.
When you SSH into your Raspberry Pi, or a remote
Ubuntu server, youll be placed in a fresh terminal
session, and unable to scroll back through what you
were doing other than look at command history.
GNU screen sudo apt-get install screen
is a terminal multiplexer, giving you multiple
windows within a terminal, but it has one killer feature:
persistence. Run screen, leave your SSH session, now
SSH back into your server and run screen -r, and it
will reattach you where you left off (like at the Emacs
session in the screenshot above). Like all of the best
command-line apps, its a real time-saver.

The Ubuntu Book 141

Supercharge Ubuntu

Develop with Python


Python is relied upon by web developers,
academic researchers and engineers, and
is one of the languages Ubuntu is written in.
Heres how to put Python to professional use
142 The Ubuntu Book

Develop with Python


Let Python handle all of the day-to-day
upkeep that keeps your system healthy

System administration
System administration tasks are some of the most
annoying things that you need to deal with when
you have to maintain your own system. Because
of this, system administrators have constantly
been trying to find ways to automate these types
of tasks to maximise their time. They started with
basic shell scripts, and then moved on to various
scripting languages. For a long time, Perl had been
the language of choice for developing these types of
maintenance tools. However, Python is now growing
in popularity as the language to use. It has reached
the point where most Linux distributions have a
Python interpreter included in order to run system
scripts, so you shouldnt have any excuse for not
writing your own scripts.
Because you will be doing a lot system level work,
you will have most need of a couple of key Python
modules. The first module is os. This module
provides the bulk of the interfaces to interacting
with the underlying system. The usual first step is to
look at the environment your script is running in to
see what information might exist there to help guide
your script. The following code gives you a mapping
object where you can interact with the environment
variables active right now:

SYSTEM ADMINISTRATION:
BASH, PERL, PYTHON

OPERATING SYSTEM

CPU

FILES/IO

import os
os.environ
You can get a list of the available environment
variables with the function os.environs.keys(),
and then access individual variables with
os.environs[key]. These environment variables are
also used when you spawn a subprocess. So you will
want to change values, like the PATH or the current
working directory, in order to run these subprocesses
correctly. While there is a putenv function that edits
these values, it doesnt exist on all systems, so the

most beneficial way in the long run is to do this is to


edit the values directly within the environs mapping.
Another category of tasks you may want to
automate is when working with files. Get the current
working directory with:

cwd = os.getcwd()
You can then get a list of the files in this directory with:

os.listdir(cwd)
You can move around the filesystem with the function
os.chdir(new_path). Once youve found the file you
are interested in, you can open it with os.open() and
open it for reading, writing and/or appending. You can
then read or write to it with the functions os.read()
and os.write(). Once you are all done, you can close
the file with os.close().

Running subprocesses from Python


The underlying philosophy of Unix is to build small,
specialised programs that do one job extremely well.
You then chain these together to build more complex
behaviours. There is no reason why you shouldnt
use the same philosophy within your Python scripts.
There are several utility programs available to use
with very little work on your part. The older way
of handling this was through using functions like
popen() and spawnl() from the os module, but a
better way of running other programs is by using the
subprocess module instead. You can then launch a
program, like ls, by using:

import subprocess
subprocess.run([ls, -l])

This gives a long file listing for the current directory.


The function run() was introduced in Python 3.5 and
is the suggested way of handling this. If you have an
older version, or need more control, you can use the
underlying Popen() function instead. If you want to
get the output, you can use:

cmd_output = subprocess.run([ls, -l],


stdout=subprocess.PIPE)
The variable cmd_output is a CompletedProcess
object that contains the return code and a string
holding the stdout output. It may not be the same
way that you are used to, but the methodology is
essentially the same.

Scheduling with cron


Once you have your scripts all written up, you may
want to schedule them to run automatically without
your intervention. On Unix systems, you can have cron
run your script on whatever schedule is necessary. The
utility crontab -l lists the current contents of your cron
file, and crontab -e lets you edit the scheduled jobs
that you want cron to run.

There are several utility


programs available to use
requiring very little work
The Ubuntu Book 143

Supercharge Ubuntu

Web development
With the content and the bulk of the computing hosted
on a server, a web application can better ensure a
consistent experience for the end user. The popular
Django framework provides a complete environment of
plugins and works on the DRY principle (Dont Repeat
Yourself). Because of this, you should be able to build
your web application quickly. Since Django is built on
Python, you should be able to install it with sudo pip
install Django. Depending on what you want to do with
your app, you may need to install a database like MySQL
or PostgreSQL to store your application data. There are
Django utilities available to automatically generate a
starting point for your new projects code:

Python has several frameworks available for your


web development tasks

MODEL
Manipulates

Updates

VIEW

CONTROLLER

Sees

Uses

django-admin startproject newsite


This command creates a file named manage.py and
a subdirectory named newsite. The file manage.
py contains several utility functions you can use to
administer your new application. The new subdirectory
contains the files __init__.py, settings.py, urls.py
and wsgi.py. These files, and the subdirectory they
reside in, comprise a Python package that is loaded
when your website is started up. The core configuration
for your site can be found in the file settings.py. The URL
declarations, basically a table of contents for your site,
are stored in the file urls.py. The file wsgi.py contains
an entry point for WSGI-compatible web servers.
Once your application is done, it should be hosted on a
properly configured and hardened web server. But this is
inconvenient if you are in the process of developing your
web application. To help you out, Django has a web server
built into the framework. You can start it up by changing
directory to the newsite project directory and running
this command:

USER
the files models.py, tests.py and views.py, among
others. The simplest possible view consists of the code:

from django.http import HttpResponse


def index(request):
return HttpResponse(Hello world)

from django.conf.urls import url


from . Import views
urlpatterns = [ url(r^$, views.index,
name=index), ]
Next, get the URL registered within your project with the
following code:

This isnt enough to make it available, however. You will


also need to create a URLconf for the view. If the file
urls.py doesnt exist yet, create it and then add the
following code:

from django.conf.urls import include, url


from django.contrib import admin
=
[
url(r^newapp/,
urlpatterns

python manage.py runserver


This will start up a server listening to port 8000 on your
local machine. As this built-in server is designed to be
used for development, it reloads your Python code for
each request, so you dont need to restart the server to
see your code changes. These steps get you to a working
project. You are now ready to start developing your
applications. Within the newsite subdirectory, type:

USER

python manage.py startapp newapp

WEB SERVER

This will create a new subdirectory named newapp, with

Virtual environments
When you start developing your own applications, you
may begin a descent into dependency hell. Several
Python packages depend on other Python packages.
This is its strength, but also its weakness. Luckily, you
have virtualenv available to help tame this jungle. You
can create new virtual environments for each of your
projects. In this way, you can be sure to capture all of the
dependencies for your own package.

144 The Ubuntu Book

DATABASE

PYTHON
INTERPRETER

Develop with Python

Using The Pycharm Ide


Terminal
development
environments
When you are in the
middle of developing
your application, you
may need to have
several different
terminal windows
open in order to have
a code editor open,
a monitor on the
server, and potentially
somewhere to test and
monitor output. If you
are doing this on your
own machine, this isnt
an issue. But if you are
working remotely, you
should look into using
tmux. This can provide
a much more robust
terminal environment
for you to work in.

The Project Pane

The Status Bar

The Editor Pane

This pane is the central location for your project.


All of your files and libraries are located here.
Right-clicking in the pane brings up a drop-down
menu where you can add new files or libraries,
run unit tests, or even start up a debugger

PyCharm does a lot of work


behind the scenes. The status
bar helps you keep track of all of
these background processes

The main editor pane can be configured


to match your own style, or one of the
other main editors, like emacs. It handles
syntax highlighting, and even displays
error locations in your scripts

To help you out, Django


has a web server built
into the framework
include(newapp.urls)),
url(r^admin, admin.site.urls), ]
This needs to be put in the urls.py file for the main
project. You can now pull up your newly created
application using the URL http://localhost:8000/
newapp/.
The last part for applications is usually the database.
The actual connection details to the database, like
the username and password, are contained in the file
settings.py. This connection information is used for all
of the applications that exist within the same project.
Create the core database tables for your site with:

python manage.py migrate


For your own applications, you can define the data
model you need within the file models.py. Once the
data model is created, you can add your application to
the INSTALLED_APPS section of the settings.py so
that Django knows to include it in any database activity.

You initialise it with:

python manage.py makemigrations newapp


Once it has been created, apply the following
migrations to the database:

python manage.py migrate

Other Python Frameworks


While Django is one of the most popular frameworks around
for doing web development, it is by no means the only one
around. There are several others available that may prove to
be a better fit for particular problem domains. For example,
if you are looking for a really self-contained framework, you
could look at web2py. Everything you need to be able to have
a complete system, from databases to web servers to a
ticketing system, are included as part of the framework. It is
so self-contained that it can even run from a USB drive.
If you need to have even less of a framework, there are
several mini-frameworks that are available. For example,
CherryPy is a purely Pythonic multi-threaded web server
that you can embed within your own application. This is
actually the server that is included with TurboGears and
web2py. A really popular microframework is a project called
flask. It includes integrated unit testing support, jinja2
templating and RESTful request dispatching.
One of the oldest frameworks around is zope, now up to

Bear in mind that any time in the future that you


make changes to your model, you will need to run the
makemigrations and migrate steps again.
Once you have your application finished, you can
get ready to make the move to the final hosting server.
Dont forget to check the available code within the
Django framework before you go ahead putting too
much work into developing your own.

For a really self-contained


framework, you could
look at web2py
version 3. This latest version was renamed BlueBream. Zope
is fairly low-level, however. You may be more interested in
looking at some of the other frameworks that are built on
top of what is provided by zope. Pyramid is a fast, easy-touse framework focussed on the most essential functions
required by most web applications. It provides templating,
the serving of static content, mapping of URLs to code, and
more. It does so while providing tools for app security.
If you are looking for some ideas, there are several
open source projects that have been built using these
frameworks, from blogs and forums to ticketing systems.
These projects can provide some best-practices when you
go to construct your own application.

The Ubuntu Book 145

Supercharge Ubuntu

Computational science

Python is fast becoming the go-to


language for computational science

Python has become one of the key languages used


in science. There is a huge number of packages
available to handle almost any task that you may have
and, importantly, Python knows what it isnt good
at. To deal with this, Python has been designed to
easily incorporate code from C or FORTRAN. This way,
you can offload any heavy computations on to more
efficient code.
The core package of most of the scientific code
available is numpy. One of the problems in Python is
that the object-oriented nature of the language is the
source of its inefficiencies. With no strict types, Python
always needs to check parameters on every operation.
Numpy provides a new datatype, the array, which
helps solve some of these issues. Arrays can only hold
one type of object, and because Python knows this
it can use some optimisations to speed things up to
almost what you can get from writing your code directly
in C or FORTRAN. The classic example of the difference
is the for loop. Lets say you wanted to scale a vector by
some value, something like a*b. In regular Python, this
would look like:

for elem in b:
c.append(a * elem)
In numpy, this would look like:

a*b

There is a huge number of packages available to


handle almost any task that you may have and,
importantly, Python knows what it isnt good at

Spyder, the IDE for scientists

Variable Explorer
The variable explorer pane lets you
access all of the data structures within
the current Python interpreter. You need
to actually run your code for anything to
show up here

The Editor Pane


This pane is where you can
open and edit your source files.
Above this pane are buttons
to allow you to simply run the
code, or run it under a debugger.
Under the debugger, you can set
breakpoints and step through
each line of code individually

Ipython Console
The console window lets you interact
directly with the underlying interpreter
that will be used when you try and run
your code

146 The Ubuntu Book

Develop with Python


Interactive science with Jupyter
For a lot of scientific problems, you need to play with your
data in an interactive way. The original way you would do this
was to use the IPython web notebook. This project has since
been renamed Jupyter. For those who have used a program
like Mathematica or Maple, the interface should seem very
familiar. Jupyter starts a server process, by default on port
8888, and then will open a web browser where you can
open a worksheet. Like most other programs of this type,
the entries run in chronological order, not in the order that
they happen on the worksheet. This can be a bit confusing
for users at first, but it means that if you go to edit an earlier
entry, all of the following entries need to be re-executed
manually in order to propagate that change through the rest
of the computations.

Jupyter will correctly print mathematical expressions


within the produced web page, as it supports the
appropriate formatting. You can also mix documentation
blocks and code blocks within the same page. This means
that you can use it to produce very powerful educational
material, where students can read about the techniques,
and then actually run it and see it in action.
By default, Jupyter will also embed matplotlib plots
within the same worksheet as a results section, so you can
see a graph of some of the data along with the code that has
generated it. This is huge considering the growing need for
reproducible science. You can always go back to the data
and see how any analysis was done in order to reproduce
any result.

Above The ability to generate complex plots is essential

Python knows what


it isnt good at; it can
incorporate code from C
or FORTEAN
So, not only is it faster, it is also written in
a shorter, clearer form. Along with the new
datatype, numpy provides overloaded forms
of all of the operators that are of most use,
like multiplication or division. It also provides
optimised versions of several functions, like
the trig functions, to take advantage of this new
datatype. The largest package available, that
is built on top of numpy, is scipy. Scipy provides
sub-sections in several areas of science. Each
of these sub-sections need to be imported
individually after importing the main scipy
package. For example, if you are doing work with
differential equations, you can use the integrate
section to solve them with code that looks like

import
import
result
sin(x),

scipy
scipy.integrate
= scipy.integrate.quad(lambda x:
0, 4.5)

Differential equations crop up in almost every


scientific field. You can do statistical analysis
with the stats section. If you want to do some
signal processing, you can use the signal
section and the fftpack section. This package
is definitely the first stop for anyone wanting to do
any scientific processing.
Once you have collected your data, you
usually need to graph it, in order to get a visual
impression of patterns within it. The primary
package you can use for this is matplotlib. If you
have ever used the graphics package in R before,
the core design of matplotlib will be familiar as
it has borrowed quite a few ideas. There are two
categories of functions for graphing: low-level
and high-level. High-level functions try to take

Above Jupyter Notebook is a web application for creating and


sharing documents that contain live code and equations

care of as many of the menial tasks as possible,


like creating a plot window, drawing axes, selecting
a coordinate system, etc. The low-level functions
give you control over almost every part of a plot,
from drawing individual pixels to controlling every
aspect of the plot window. It also borrowed the
idea of drawing graphs into a memory-based
window. This means it can draw graphs while
running on a cluster.
If you need to do symbolic maths, you may
be more used to using something more like
Mathematica or Maple. Luckily, you have sympy,
which can be used to do many of the same things.
You can use Python to do symbolic calculus, or
to solve algebraic equations. The one weird part
of sympy is that you need to use the symbols()
function to tell sympy what variables are valid to
be considered in your equations. You are then able
to start doing some manipulations using these
registered variables.
You may have large amounts of data that you
need to work with and analyse. If so, you can use
the pandas package to help deal with that. Pandas
has support for several different file formats,
like CSV files, Excel spreadsheets or HDF5. You
can merge and join datasets, or do slicing or
subsetting. In order to get the best performance
out of the code, the heaviest lifting is done by
Cython code that incorporates functions written
in C. Quite a few ideas on how to manipulate your
data were borrowed from how things are done in R.
You now have no reason not to start using
Python for your scientific work. You should be able
to use it for almost any problem that comes up!

The Need for Speed


Sometimes you need as much speed as you are capable
of pushing on your hardware. In these cases, you always
have the option of using Cython. This lets you take C code
from some other project, which has probably already
been optimised, and use it within your own Python
program. In scientific programming, you are likely to have
access to code that has been worked on for decades
and is highly specialised. There is no need to redo the
development effort that has gone into it.

The Ubuntu Book 147

Beyond
Ubuntu
150 Mint 17.3 Rosa Cinnamon
Is this variant better than Ubuntu?

152 Elementary Freya


Discover this Mac-like, consistent
distro

154 Netrunner 17 Horizon


A plasma desktop with striking
aesthetics

156 LXLE 14.04.3


A Lubuntu respin, great for old
hardware

158 Deepin Linux 2014.3


An elegant HTML5 desktop

156

148 The Ubuntu Book

These re-spins of Ubuntu


each add something new
150

154

158

The Ubuntu Book 149

Beyond Ubuntu

Mint 17.3 Rosa Cinnamon


Is it better than Ubuntu? We discover whether Mints focus on the
desktop experience warrants the lavish praise it has received
RAM
512MB RAM (1GB recommended)

STORAGE
9GB disk space
(20GB recommended)

GRAPHICS
Graphics card capable of 800 x 600
(1024 x 768 recommended)
DVD drive or USB port

150 The Ubuntu Book

Many flavours of Linux Ubuntu included


seek to run on devices large and small, with touch
screens or keyboards, and in order to do so have
left behind the traditional desktop interface. This may or may
not be a good thing, but for people who want to get things done
on their computer, and dont want to have to learn new ways of
doing things (after all, you dont expect your new car to put the
steering wheel and the pedals in different positions), Linux Mint
is a welcome refuge.
More than that, Linux Mint has polished the traditional
desktop interface until its hard to find fault with anything that
it does, developing its own Cinnamon desktop when GNOME
took a different direction. Mint has always included proprietary
hardware drivers (in 17.3, Driver Manger now tells you if the
drivers are Open Source), and codecs for MP3 and DVD playback,
which many other distributions do not carry.
17.3 will be the last Mint release based upon the Long
Term Support (LTS) 14.04 release of Ubuntu; as such its the

culmination of lots of separate improvements over an extended


period. Cinnamon has a slick interface, which seems to have
become more responsive over recent releases bucking the
general trend in computing for software to get heavier and slower
as it matures. Meanwhile, underneath the polished exterior, Mint
steadily improves audio, video and file handling. The speed of
Linux Mint, especially on older hardware, is noticeable.
Rebooting after installation, a Welcome Screen window
gives shortcuts to getting to know Mint in various ways, from
documentation, through Apps (to install extra software),
to helping out with Mint which can involve anything from
artwork to new ideas: user feedback plays a big part in the Mint
development process.
Cinnamon has a traditional taskbar, with the usual shortcuts
to network connections, battery health, removable drives etc in
the right hand corner; menu and shortcuts to favourite apps in
the left (you can drag any app you like here to create a shortcut);
and open windows (minimised or not) in the middle with

Mint 17.3 Rosa Cinnamon

Linux Mint has polished the traditional desktop interface until


its hard to find fault with anything that it does.
thumbnails displayed when you hover over them. The taskbar
applets at the right are all great pieces of software, particularly
the updated battery applet, and the audio applet, which provides
a quick and useful interface to your music collection.
The default taskbar shortcuts are for browser, file
manager, and terminal the three most needed items for a
GNU/Linux user. Were glad that Mint hasnt hidden the terminal
away in a misguided attempt at user-friendliness; as youll
appreciate from our earlier articles on the command line, its
power is one of the hidden strengths of Ubuntu, and other Unixtype operating systems.
Nevertheless, Mints own tools will keep you away from
reliance on the command line. Software Manager has
a reasonable interface for finding new apps, but recent
improvements are below the surface: it detects the fastest
mirror, and will now warn you if there is a problem with corrupted
packages, or if the mirror hasnt updated. If you need to add
other Ubuntu-related repositories to download software from

outside of Mint, the Software Sources manager can take care of


any conflicts that could arise from mixing sources. Mints other
preference and administration tools all work well, but its the dayto-day use of the desktop itself that shows off Mints slick design,
and the careful decisions taken and improvements made.
The only problem we had was when the screen-saver locked
us out with no password dialogue something a little command
line knowledge enabled us to fix, but not a good thing in a
newbie-friendly OS but it only happened on one test machine.
In long term use, it was otherwise always a joy to use.

PROS
A desktop that involves
no learning of new
interfaces, nor concessions
to mobile devices, and
works flawlessly.

CONS
Stability and gradual
improvements are at
the expense of latestand-greatest updates of
software packages, and
proprietary codecs are not
in the Free Software spirit.

SUMMARY
Dedicated to a friendly and familiar interface for traditional desktop users, Linux Mint is
the one to choose if youve felt lost since Windows XP became unsupported but youll find
it a great improvement over XP. Not for compulsive upgraders and free software purists,
but a great experience for new and experienced users alike.

The Ubuntu Book 151

Beyond Ubuntu

Elementary Freya
Not just a Mac clone, but a well-thought-through aesthetic approach to
stable and consistent computing
CPU
1GHz processor
(Intel i3 recommended)

RAM
1 GB RAM

STORAGE
5GB of disk space
(15GB recommended)

URL
elementary.io

152 The Ubuntu Book

Elementary OS is not just a slight twist on Ubuntu,


but rather a serious attempt at making something
that holds together consistently from both
aesthetic and usability angles. The strong resemblance to
OS X is far from coincidental: Elementarys Pantheon desktop
is based upon GNOME3, but owes much to both Apple and
Googles Chrome OS.
This new version fixes some boot issues with UEFI and Secure
Boot systems. Installation handled the WI-FI and graphics cards,
with a checkbox to select proprietary drivers, alongside media
codecs. Installation works without an Internet connection, but
that option sacrifices security updates. As with Linux Mint,
encrypting the entire disk is an option albeit one with slight
performance penalties for some of the lower-end hardware that
Elementary can run on.
Throughout the installation, the default wallpaper of mountain
scenery is subtly reassuring in its solidity. A subliminal message
about Elementarys stability? Elementarys additions to Ubuntu

were certainly solid throughout our use, and being written in just
C and Vala languages, dont bring in the stack of dependencies
upon which many of its rivals depend so Elementary misses
out on the penalty to performance, stability and resource
footprint that would have entailed.
The streamlined interface is a result of the Elementary
developers commitment to ease of use: everything should be
available without using the command line. We found that to be
the case but some of the GUI choices left us a little puzzled. For
example, Alt grab (holding the left mouse button down while Alt
is pressed to drag a window) does not work, meaning a window
cannot be moved to have its title bar above the top of the screen.
Right-click choices are also removed from much of the desktop.
Elementarys own apps do include a terminal (with
background transparency by default); a text editor called
Scratch; a mail client; a calendar app; and a file manager. These
all bear some resemblance to their GNOME counterparts in
use, certainly nothing unfamiliar, while a desktop email client

Elementary Freya

Elementary OS is a good beginners distro the combination


of stability and consistent aesthetics will appeal to many
is something of a rarity in these webmail-dominated days
although opening up the Geary mail app for the first time results
in an invitation to connect your Gmail account.
Noise is similar to Rhythmbox on other Ubuntus (or iTunes
elsewhere), and offers all the basics but, like the rest of
Elementary, resists the urge to allow the extreme customisation
that appeals to some GNU/Linux users. If you want a word
processor, youll have to go to the Software Center and download
LibreOffice (or an alternative) for yourself, and possibly a better
web browser than the included Midori.
Like many OSs, Elementary collects data on usage to help
to tailor development, as well as provide prompts and hints
during use: some users are concerned about such things, and
Elementary makes it easy to turn off this collection through
selecting Privacy Mode. This is available through the System
Settings menu, as is most of what you would like to customise on
your desktop.
Customisation is not nearly as flexible as many Linux variants,
and this is quite deliberate. Just like Apple, Elementary has a

rather clear idea of what is best for the user experience, and if
thats what you are here for, just go with it. If not, perhaps turn
the page and take a look at some of the alternatives. Limiting
choice does have the benefit of making Elementary extremely
easy to grasp its a good beginners distro, and the combination
of stability and consistent aesthetics, will undoubtedly appeal to
many users.
If youre looking for fuss-free computing (once youve installed
an office suite!) possibly on an old Netbook and dont want
to sacrifice a good-looking desktop in the process, try out
Elementary OS.

PROS
Great for new users and
tired aesthetes who would
like a simple, attractive
desktop, and solid, fussfree computer use.

CONS
Wont appeal to power
users, or those offended
by Mac OS X clones. Having
to bypass a pay link to
download is also a rather
jarring experience.

SUMMARY
Power users are almost certain to look elsewhere, as many things Ubuntu users take for
granted are removed, but its all in a good cause. Elementary OS presents a refreshingly
consistent interface, is relatively light in its use of system resources and great on old
Netbooks and is a stable and reliable platform for day-to-day use.

The Ubuntu Book 153

Beyond Ubuntu

Netrunner 17 Horizon
Netrunners Plasma desktop offers a glimpse of a third way, between
traditional desktops and tablet-focussed GNOME Shells
CPU
64-bit CPU
(16 & LTS run on Intel Atom)

RAM
1GB

STORAGE
10GB HDD

GRAPHICS
Intel GMA 945 Graphics Card /
Video Memory 128MB

URL
netrunner.com

154 The Ubuntu Book

The other Ubuntu respins reviewed in these pages


are all based upon Long Term Support (LS) release
of Ubuntu; Netrunner is different, in that it does
maintain and also improve with new releases an LTS
branch, but it also has new releases based on more recent
Ubuntu versions.
Netrunners homepage states the three principles of the OS:
power-up and dont dumb-down the user; include add-ons,
codecs, customizations; and, finally, avoid lock-ins and favour
free (libre) alternatives. However, something has slipped in
production with the ISO on the USB stick refusing to boot, no
matter what clever tricks we tried. By falling back on burning
a DVD, we were eventually able to boot the live image (we were
reminded once again how slow DVDs can be), from where we
could have a look around, before clicking Install Netrunner, and
getting on with the show.
This was straightforward enough, with vertical tabs marking
off the stages as you agree to timezones, disk partitions, etc,

and then the customary, but well-executed, slideshow, as files


are written to disk. Interestingly, Netrunner is the only one of the
respins not to comment on the apparent strength or safety of
your chosen password.
Based on KDEs Plasma desktop (version 5.4.3), and last
autumns Kubuntu release, Netrunner comes with all of the
codecs and apps to get running straight away by default, with no
further configuration provided you have working installation
media, of course.
Our patience with the installation was rewarded with sight
of the garish desktop. Perhaps not to everyones taste, but we
eschewed wallpaper decorations, to give its night club ambience
a chance to grow on us.
Based as it is on Kubuntu 15.10, the software is more up
to date than most LTS respins Firefox 42.0.3, VirtualBox 5,
LibreOffice 5, and a 4.2 Linux kernel. Regular updates shouldnt
carry a heavy price Kubuntu manages them well enough
most of the time but Netrunner had a number of moments of

Netrunner 17 Horizon

Krunner is a powerful shortcut to not just launch, but killing


rogue apps, and making calculations and conversions.
flakiness: a few freezes and settings apps having blank windows
when opened from shortcuts; apps not starting from the menu,
or evenAlt-F2 quick launch (Krunner) which is an otherwise
powerful shortcut to not just launch, but killing rogue apps,
and even calculations and conversions. Battery life was also
surprisingly poor under Netrunner 17.
Its a shame, as Netrunner has a lot going for it. Plasma 5 is
an improvement over earlier KDE desktops, not just in terms of
features, but performance has sharpened up too. KDE has some
great tools and apps, with Calligra, the office suite, being a great
alternative to LibreOffice with parts of both installed. There is
plenty of software installed by default, but not as much as LXLE
manages to squeeze into a much smaller ISO.
Plasmoids, KDEs embedded widgets, embed in the desktop,
and give you interactive mini apps of the type other desktops
have only in the taskbar. From weather reports, through games,
to controlling media playback, or reading online comics, theres
a widget for almost everything. Combine these with KDEs
very configurable desktop layout, with options for moving and

replacing almost everything, and you have a desktop that you


can really make your own. If youre not convinced by Unity or
GNOME Shell, and want something more than a traditional
desktop, or Mac clone, Plasma offers a path to a powerful
desktop that will work with both tablets and PCs.
Netrunner 17 is certainly worth a try. Go ahead and make a live
DVD and give it a go but you might want to wait for the release of
the next LTS, later this spring, when were confident things will be
working much better. You could also try the last LTS, 14.2, which
despite not having all of the desktop updates of 17, is still a great
OS to try.

PROS
It feels very slick (when
it worked), with plenty of
apps, Plasma widgets are
great fun and sometimes
quite useful, too!

CONS
Installation only worked
from DVD; some desktop
flakiness; problems
launching some apps. Also
a few freezes and crashes.

SUMMARY
Despite a bad start with the ISO not working on USB sticks, Netrunner did eventually install
although the problems didnt all stop there. Nevertheless, the Plasma 5 desktop is very
configurable, has loads of useful widgets, and can look great. Give it a try, and if you like
Netrunners potential, look forward with us to the next LTS.

The Ubuntu Book 155

Beyond Ubuntu

LXLE 14.04.3
Faster, stylish, and loaded with software, LXLEs respin on Lubuntu could
be the top choice on older hardware
CPU
Pentium III CPU (P IV recommended)

RAM
512MB RAM
(1024MB recommended)

STORAGE
8.4GB disk space
(20GB recommended)

URL
www.lxle.net

156 The Ubuntu Book

If youve got an older PC you want to revive, LXLE


the full featured OS for an ageing PC, as their
homepage puts it could be the Ubuntu for you, with
the light-on-its-feet LXDE desktop on top of Ubuntus power
and flexibility.
LXLE is a respin of Lubuntu but there are noteworthy
differences. LXLE ships with a lot of software not included with
the Lubuntu boot image both codecs/drivers and desktop
software and benefits from several tweaks for usability,
including several useful additions to the already excellent
PCManFM file manager. More than that, its lighter on system
resources than Lubuntu, yet smooth, sleek, and easy to use.
LXLE has a great reputation for detecting and configuring
difficult hardware, from printers to Wi-Fi cards. The proprietary
codecs installed (if you opt in during LXLE installation) help
here, but this Ubuntu respins attitude to proprietary software
is ambiguous: yes, Adobe Flash player is included, but for other
services, like Skype and Google Earth for example, Free Software

alternatives are installed (UTox, and KDEs Marble for these two
examples). Indeed, during start up, the logo sits above the slogan
Be Free, Be Open.
After a quick boot up, the user finds herself with a
choice to make which other desktop do you want LXLE
to look, and function, like? If youre looking for a replacement
for Windows XP (the default look, though simply labelled
Lubuntu), or a classic GNOME 2 type desktop, youll feel
at home right away. The other choices are: netbook mode
(good for small screens), Unity with the vertical launcher, and
other Ubuntu touches and lastly, the inevitable Mac OS X
look, with dock living on the far left edge. Underneath it all,
of course, is the flexible LXDE desktop environment, with
all of the familiar (though configurable) tools and icons plus one
unusual extra.
The thing that caught our eye straight away was wallpaper,
and plenty of it! LXLE has 100 yes, one hundred pre-installed
wallpapers, all better than average, and on the taskbar is a

LXLE 14.04.3

A marvel, squeezing into the lightweight LXDE environment all


of the functionality found in more resource-hungry desktops
random switcher: click and be amazed. The wallpapers folder
lives inside the Pictures directory of your home folder, so its
pretty easy to add even more.
The menu system is good if not quite as good as Mints and
is also accessible in the File Manager as a folder view, but for
quick launch Alt-Z allows you to run any program after typing its
first few letters (Quick Launch can also be clicked in the taskbar).
Alt-C brings up a terminal emulator in this case, the highly
configurable Roxterm.
Youll also need the terminal to configure Conky the hideable
desktop balloon full of information on your CPU, RAM, battery
and other system stats; a rare lapse in beginner-friendly ease of
use. Another inconsistency in LXLE is a weather app that looks
like it belongs on a smartphone, not the otherwise carefully
styled LXDE desktop.
There is a lot of other software to try the default installation
of LXLE gives you gigabytes of productivity apps, games, and
multimedia software, from ebook readers to home banking
software. Mozillas SeaMonkey suite is a less demanding

alternative to Firefox, that also fills in duties as a calendar, mail


client, and personal organiser.
The Guayadeque music player is more than adequate as a
default those with strong preferences elsewhere have a lot
of choice from within Ubuntus repositories and with tools like
Audacity included, you can create and edit, as well as consume
various media.
LXLE is a marvel, squeezing into the lightweight LXDE
environment all of the functionality found in any of the more
resource-hungry desktops. You wont need an older PC to
appreciate its speed and power.

PROS
Quick, consistent, and
improves on the already
fast and friendly Lubuntu
with even more speed and
yet more friendliness.

CONS
Some very minor
inconsistencies, plus an
awful lot of unwanted
software if youre a
minimalist who knows
what they want.

SUMMARY
We really liked LXLE: its full of thoughtful choices, starting at log-in, when you can match
the desktop to the style of use with which you are most comfortable. The extra packages,
and subtle interface improvements over the stock LXDE of Lubuntu are all positives, and
while the desktop is configurable, the defaults make it good to go straight away.

The Ubuntu Book 157

Beyond Ubuntu

Deepin Linux 2014.3


And now for something a little different: an Ubuntu-based distro with its
own, very elegant, HTML5 desktop
CPU
Intel Pentium IV 2.0GHz
(Core2 recommended)

RAM
1GB RAM (2GB recommended)

STORAGE
10GB disk space
(20GB recommended)

GRAPHICS
Modern video graphics
card recommended

158 The Ubuntu Book

Even if youre fairly familiar with Ubuntu, you may


never have heard of Deepin, as its still not that well
known outside of China. Thats gradually changing
with each new release. Deepin 2014.3 appeared in April 2015,
the last of the Ubuntu-based Deepins. There is a more recent,
Debian-based version, but it shares the same desktop and
features, albeit with several, slight improvements.
Installation is painless (the boot disc also allows you to run
a live distro, to try without installing), making sensible default
choices, and just asking for language, name and password. Its
one of the best installers weve seen.
Favourable first impressions are not spoilt on starting up the
installed systems, as Deepin shows a screencast introducing
its interface, before delivering you to that same Deepin Desktop
Interface (DDE), built using web technologies like HTML5.
Stealing shamelessly from Apples OS X, its a slick and appealing
desktop as you can see in the screenshots. Moving the cursor
to the corner of the screen is a shortcut to various (customisable)

functions, including the Control Centre, a slide-out interface


to preferences and settings for users, network connections,
collecting all of the things normally hidden away under a stack of
menus its very nice. In fact, its one of the best on any OS.
Move the cursor top left and youll get the Launcher, where
apps are grouped by categories. If you dont see the app you
need on the launcher screen, you can type a few letters into the
Launcher, and the selection is narrowed until the software you
want appears. Right-clicking any of the items that come up in
the Launcher gives you options for adding them to the OS X-style
Dock, to the Desktop, or to autostart.
As well as a large range of included Free and Open Source
Software, Deepin has the proprietary drivers for most wifi and
graphics cards (although some users report trouble with the
Nvidia drivers), and some other proprietary software, such as the
Skype client, and Adobes Flash player.
Speaking of Microsoft, Deepin installs Codeweavers
CrossOver. This lets you easily install and run most Windows

Deepin Linux 2014.3

Built using web technologies like HTML5, and stealing


shamelessly from Apples OS X, its a slick and appealing
desktop as you can see
software. Typically, this tends to be used for legacy games, as
there is little else not available in Ubuntus repositories so users
might like to also check out Deepin Games vast range.
Deepins own apps - such as Deepin Music, Deepin Movie and
the Deepin Store, are unique to this OS. The built-in multimedia
apps are fine, except Movies very occasional crash, with Music
being remarkably deft at finding cover art. We were playing an
old episode of the Goon Show (ask your grandparents, theyll
remember it), and up popped an image of Sir Harry Secombe.
Deepin Music works well with online radio stations after a plugin installation, and can be docked, or just put into mini-mode,
leaving essential controls in the smallest possible desktop
space. Deepin Music was also one of the few places where
some untranslated Chinese was on display, but nothing that
would stop the average non-Chinese speaker from using the
app successfully, and this release supports 23 languages. The
Deepin terminal doesnt support tabs, but can be split (the menu

opens a hotkey display to show shortcuts for this, and everything


else), and has a fullscreen overlay (Quake-mode). Occasionally
the Terminal would seem to lose its history the up arrow would
recall none of the previously issued commands yet history
showed them all.
Despite all of the niggles theres a lot to like here from
installation to the excellent Control Centre whether you try the
Ubuntu-based 2014.03 or a more recent Debian-based version.
Definitely one to keep an eye on.

PROS
Quick booting, nice
looking; interesting
desktop constructed of
web technologies, a good
package manager and
works on older hardware.

CONS
Deepins last Ubuntu-based
release has some stability
issues, and some odd
choices in the design and
dependency of Deepins
own apps.

SUMMARY
We cant ignore all of the stability issues, nor, we admit, is an OS X rip-off desktop design,
however user friendly, going to please everyone. Such shameless stealing has a long
honourable history in computing though, and Deepin is clearly on an upward trajectory.
Well worth trying this is one to watch, and very friendly to those new to Linux.

The Ubuntu Book 159

tri Spe
al ci
of al
fe
r

Enjoyed
this book?

Exclusive offer for new

Try es
3 issjuust
for *
5
* This ofer entitles new UK direct debit subscribers to receive their first three issues for 5. After these issues, subscribers will then pay 25.15 every
six issues. Subscribers can cancel this subscription at any time. New subscriptions will start from the next available issue. Ofer code ZGGZINE must
be quoted to receive this special subscriptions price. Direct debit guarantee available on request. This ofer will expire 31 March 2017.
** This is an US subscription ofer. The USA issue rate is based on an annual subscription price of 65 for 13 issues which is equivalent to $102 at the
time of writing compared with the newsstand price of $16.99 for 13 issues being $220.87. Your subscription will start from the next available issue.
This ofer expires 31 March 2017.

Dedicated to
all things Linux
Written for you
Linux User & Developer is the only
magazine dedicated to advanced users,
developers & IT professionals

In-depth guides & features

About
the
mag

Written by grass-roots developers and


industry experts

Free assets every issue


Four of the hottest distros feature every month
log in to FileSilo, download and test them all!

subscribers to

Try 3 issues for 5 in the UK*


or just $7.85 per issue in the USA**
(saving 54% off the newsstand price)

For amazing offers please visit

www.imaginesubs.co.uk/lud
Quote code ZGGZINE
Or telephone UK 0844 249 0282+ overseas +44 (0) 1795 418 661
+ Calls will cost 7p per minute plus your telephone company's access charge

From the makers of


The

Python
Discover this exciting and versatile programming language
with the new edition of The Python Book. Youll find a complete
guide for new programmers, great projects designed to build
your knowledge and tips on how to use Python with the
Raspberry Pi everything you need to master Python.

Also available

A world of content at your fingertips


Whether you love gaming, history,
animals, photography, Photoshop,
sci-fi or anything in between, every
magazine and bookazine from
Imagine Publishing is packed with
expert advice and fascinating facts.

BUY YOUR COPY TODAY


Print edition available at www.imagineshop.co.uk
Digital edition available at www.greatdigitalmags.com

The

Ubuntu
Book

The ultimate handbook


for all Ubuntu users
Perfect for
switching
from
Windows

Discover the power


of Ubuntu

Master the
Ubuntu apps

Download the best


free software

Everything you need to know, from


setting up to performance boosts

Get to grips with the powerful


software packaged with Ubuntu

2XUGHQLWLYHOLVWRIWKHRSHQVRXUFH
software you need right now

Вам также может понравиться