Ubuntu Hacks

Book description

Ubuntu Linux--the most popular Linux distribution on the planet--preserves the spirit embodied in the ancient African word ubuntu, which means both "humanity to others" and "I am what I am because of who we all are." Ubuntu won the Linux Journal Reader's Choice Award for best Linux distribution and is consistently the top-ranked Linux variant on DistroWatch.com. The reason this distribution is so widely popular is that Ubuntu is designed to be useful, usable, customizable, and always available for free worldwide.

Ubuntu Hacks is your one-stop source for all of the community knowledge you need to get the most out of Ubuntu: a collection of 100 tips and tools to help new and experienced Linux users install, configure, and customize Ubuntu. With this set of hacks, you can get Ubuntu Linux working exactly the way you need it to. Learn how to:

  • Install and test-drive Ubuntu Linux.
  • Keep your system running smoothly
  • Turn Ubuntu into a multimedia powerhouse: rip and burn discs, watch videos, listen to music, and more
  • Take Ubuntu on the road with Wi-Fi wireless networking, Bluetooth, etc.
  • Hook up multiple displays and enable your video card's 3-D acceleration
  • Run Ubuntu with virtualization technology such as Xen and VMware
  • Tighten your system's security
  • Set up an Ubuntu-powered server

Ubuntu Hacks will not only show you how to get everything working just right, you will also have a great time doing it as you explore the powerful features lurking within Ubuntu.

"Put in a nutshell, this book is a collection of around 100 tips and tricks which the authors choose to call hacks, which explain how to accomplish various tasks in Ubuntu Linux. The so called hacks range from down right ordinary to the other end of the spectrum of doing specialised things...More over, each and every tip in this book has been tested by the authors on the latest version of Ubuntu (Dapper Drake) and is guaranteed to work. In writing this book, it is clear that the authors have put in a lot of hard work in covering all facets of configuring this popular Linux distribution which makes this book a worth while buy."
-- Ravi Kumar, Slashdot.org

Publisher resources

View/Submit Errata

Table of contents

  1. Credits
    1. About the Authors
    2. Contributors
    3. Acknowledgments
      1. Jonathan
      2. Kyle
      3. Bill
  2. Preface
    1. Why Ubuntu Hacks?
    2. How to Use This Book
    3. How This Book Is Organized
    4. Conventions Used in This Book
    5. Using Code Examples
    6. Safari Enabled
    7. How to Contact Us
    8. Got a Hack?
  3. 1. Getting Started
    1. 1. Test-Drive Ubuntu
      1. Downloading the Live CD
      2. Booting the CD
      3. Another Use for the Live CD
    2. 2. Get Help
      1. Web-Based Documentation
      2. Interactive Help and Support
      3. Traditional Pay-per-Incident Support
    3. 3. Make Live CD Data Persistent
      1. Set the Label on Your USB Memory Stick
      2. Boot the Live CD in Persistent Mode
      3. Testing Persistence
      4. How It Works
    4. 4. Customize the Ubuntu Live CD
      1. Basic Requirements
        1. Add extra swap
        2. Install the tools
        3. Standard Live CD
      2. Prepare Original Image
      3. Set Up the Target Filesystem
      4. Apply Customizations
        1. Delete unnecessary packages
        2. Install additional packages
        3. Customize the home directory
      5. Unmount Customized Image
      6. Repack the Filesystem
      7. Build the ISO
      8. Burn and Boot
      9. More Information and Scripts
    5. 5. Install Ubuntu
      1. System Requirements
      2. Preserving Your Existing Data
      3. Getting the Installation CD
      4. Installing Ubuntu
    6. 6. Dual-Boot Ubuntu and Windows
      1. Preparation
      2. Installation
    7. 7. Move Your Windows Data to Ubuntu
      1. Make Sure You Notify the Post Office
        1. Transfer Outlook into Thunderbird
        2. Transfer your Thunderbird mail to Ubuntu
      2. Are You Bringing the Browser?
      3. Your Stuff, Your Music
      4. Your Little Black Book
      5. Am I Forgetting Anything?
      6. You Could Just Hire a Mover
    8. 8. Install Ubuntu on a Mac
      1. Reinstall Mac OS X
      2. Install Ubuntu
    9. 9. Set Up Your Printer
      1. GNOME CUPS Manager
      2. CUPS Web Interface
      3. Share Local Printers
      4. Apply Print Quotas
    10. 10. Install Ubuntu on an External Drive
      1. Set Up the Partitions
      2. Install GRUB
      3. Use chroot
      4. Tweak initrd
      5. Update GRUB
    11. 11. Install from a Network Boot Server
      1. Prepare the PXE Boot Server
        1. Configure DHCP
        2. Configure TFTP
      2. Boot the Client
    12. 12. Submit a Bug Report
      1. Getting Ready to File the Bug
      2. Creating a Malone Account
      3. Searching for Your Bug
      4. Filing Your Bug Report
    13. 13. Use the Command Line
      1. Navigate the Filesystem
      2. Rename and Delete Files and Directories
      3. File Globs and Tab Completion
    14. 14. Get Productive with Applications
      1. Office Suite
      2. Graphics and Photo Editor
      3. Web Browsing
      4. Email
      5. Instant Messaging
      6. Media Player
  4. 2. The Linux Desktop
    1. 15. Get Under the Hood of the GNOME Desktop
      1. Configuration Nirvana: the Configuration Editor
      2. Scripting GConf
    2. 16. Tweak the KDE Desktop
      1. Personal
      2. Hardware
      3. System Administration
    3. 17. Switch to a Lighter Window Manager
      1. Generate Program Menus
      2. Change to Your New Window Manager
      3. Try XFCE
      4. Use Fluxbox
      5. Seek Enlightenment
      6. Other Window Managers
    4. 18. Install Java
      1. Installing the Java Runtime Environment
      2. Confirming the Installation
    5. 19. Search Your Computer
      1. Installing Beagle
      2. Starting beagled
      3. Using Beagle and deskbar-applet
    6. 20. Access Remote Filesystems
    7. 21. Tweak Your Desktop Like a Pro
      1. Get Icons on Your Desktop
      2. Get Organized with Tomboy
      3. Automatic Wallpaper Switching
      4. Getting a Pull-Down “Quake” Terminal
    8. 22. Sync Your Palm PDA
      1. Configuring Palm Synchronization
      2. Configuring the Sync Conduits
      3. Add the Pilot Applet
    9. 23. Sync Your Pocket PC
      1. Connecting the Pocket PC
      2. Testing the Connection
      3. Establish a Partnership
      4. Synchronize with Evolution
        1. Testing Multisync
        2. Syncing to the Pocket PC
      5. Install Pocket PC Software
      6. Accessing the Pocket PC’s Filesystem
      7. Troubleshooting
    10. 24. Customize the Right-Click Contextual Menu
      1. Easy-Access Templates
      2. Custom Scripts
    11. 25. Download and Share Files with the Best P2P Software
      1. BitTorrent
        1. Command line
        2. GUI
      2. aMule and eDonkey2000
      3. LimeWire and Gnutella
      4. Other P2P Apps
    12. 26. Make Your Own PDFs
      1. Installing CUPS-PDF
      2. Configuring CUPS for the PDF Printer
      3. Using Your New PDF Printer
    13. 27. Blog with Ubuntu
      1. Installing Drivel
      2. Configuring and Using Drivel
  5. 3. Multimedia
    1. 28. Install Multimedia Plug-ins
      1. Tweak Your Repository List
      2. Install General-Purpose Libraries and Tools
      3. Install Gstreamer Libraries
      4. Install Codecs of Ambiguous Legality
    2. 29. Watch Videos
      1. Install MPlayer
      2. Use MPlayer
        1. DVD playback
        2. (S)VCD playback
        3. Streaming playback
        4. Troubleshooting
    3. 30. Play DVDs
    4. 31. Buy Songs at the iTunes Music Store
    5. 32. Get a Grip on CD Ripping
      1. Install Grip
      2. Configure Ubuntu to Default to Grip
      3. Configure Grip
        1. Configure CD options
        2. Configure ripping options
        3. Configure encoding options
        4. Configure ID3 options
        5. Configure DiscDB options
      4. Rip a CD
    6. 33. Burn CDs and DVDs
    7. 34. Automate Audio CD Burning
      1. Use Serpentine
      2. Use K3b
    8. 35. Rip and Encode DVDs
      1. Load Your DVD
      2. Configure Settings
      3. Queue and Rip
    9. 36. Create a Video DVD
      1. Install tovid
      2. Convert the Video
      3. Create the XML File
      4. Create the DVD Filesystem Structure
      5. Burn the DVD
    10. 37. Connect to a Digital Camera
      1. Import from a Non-USB-Storage-Device Camera
      2. Import from a USB-Storage-Device Camera
      3. Automatically Rotate Your Photos with gThumb
  6. 4. Mobile Ubuntu
    1. 38. Put Your Laptop to Sleep
      1. Getting Some Sleep
      2. Testing ACPI Sleep
    2. 39. Hibernate Your Laptop
      1. Configuring Hibernation
      2. Using Hibernation
    3. 40. Prolong Your Battery Life
    4. 41. Get Proprietary Wireless Cards Working
      1. Installing ndiswrapper and ndisgtk
      2. Wrapping the Windows Drivers
      3. Configuring the Adapter
    5. 42. Roam Wirelessly
      1. Using Your Wireless Network Card
      2. NetworkManager and You
    6. 43. Make Laptop Settings Roam with Your Network
      1. Install laptop-net
      2. Configure laptop-net Profiles
        1. Configure the offline profile
        2. Configure the default network profile
        3. Test your configuration
      3. Create Personal laptop-net Profiles
        1. Configure the patterns file
        2. Configure the after-select script
    7. 44. Make Bluetooth Connections
      1. Pairing
      2. Manual Pairing
      3. Bluetooth File Transfer
      4. Connect to the Internet
    8. 45. Expand Your Laptop
    9. 46. Hotswap Your Laptop’s Optical Drive
  7. 5. X11
    1. 47. Configure Multibutton Mice
    2. 48. Enable Your Multimedia Keyboard
      1. Assign GNOME Keyboard Shortcuts
      2. Hotkeys
        1. Understand Hotkeys configuration parsing
        2. Set keyboard type
        3. Customize predefined actions
        4. Create custom actions
        5. Test Hotkeys
        6. Onscreen display settings
      3. Start Hotkeys Automatically
    3. 49. Configure a Touchpad
      1. Preparing Your X11 Configuration
      2. Installing qsynaptics
      3. Configuring the Touchpad with QSynaptics
    4. 50. Connect Multiple Displays
      1. Grok the Xorg Conf File
        1. Section “Device”
        2. Section “Monitor”
        3. Section “Screen”
        4. Section “ServerLayout”
      2. Tracking Down X Errors
      3. Configure Xinerama
      4. Configure TwinView on nVidia
      5. Configuring MergedFB on ATI/Radeon
      6. Combining Methods
    5. 51. Change the Ubuntu Splash Screen
    6. 52. Enable 3-D Video Acceleration
      1. Measure Performance
      2. Identify Your Video Card
      3. Drivers
        1. nVidia
        2. ATI
        3. Matrox
    7. 53. Make Your Fonts Pretty
      1. Fonts Are Not Created Equal
      2. Font Management with Defoma
      3. Onscreen Font-Rendering Preferences
        1. Screen resolution
        2. Smoothing
        3. Hinting
        4. Subpixel order
      4. Install Microsoft Core Fonts
      5. Install Macintosh and Windows TrueType Fonts
  8. 6. Package Management
    1. 54. Manage Packages from the Command Line
      1. dpkg
      2. apt and Friends
        1. Lazy like a fox
    2. 55. Manage Packages with Synaptic
      1. Reload the Package List
      2. Install Packages
      3. Update Packages
      4. Remove Packages
      5. Search for Packages
      6. Edit Preferences and Add Repositories
    3. 56. Manage Packages with Adept
      1. Basic Adept Usage
      2. Receive Update Notifications Automatically
    4. 57. Install and Remove Standalone .deb Files
      1. Install a .deb
      2. Remove a Package
    5. 58. Search for Packages from the Command Line
      1. Search for Packages Based on Keywords
      2. Search for Packages Based on Files They Contain
    6. 59. Install Software from Source
      1. Install Compiler Tools
      2. Get and Compile the Source
        1. Step 1: configure
        2. Step 2: compile
        3. Step 3: install
      3. Hacking the Hack
    7. 60. Modify the List of Package Repositories
      1. Add and Remove Repositories
      2. Unofficial Repositories
    8. 61. Cache Packages Locally with Apt-cacher
      1. Installing Apt-cacher
        1. Server setup
        2. Client setup
      2. Configuration Options
      3. Traffic Reports
      4. Hacking the Hack
    9. 62. Create an Ubuntu Package
      1. Create Package Files
      2. Build the Package
      3. Update the Package
    10. 63. Compile a Source Package
      1. Enable Source Repositories
      2. Install Package Build Tools
      3. Install Build Dependencies and Fetch the Source
      4. Apply Changes
      5. Build Binary Package
    11. 64. Convert Non-Ubuntu Packages
      1. Convert Packages with Alien
      2. Solve Package-Conversion Problems
      3. Convert Ubuntu Packages to Other Formats
    12. 65. Create Your Own Package Repository
      1. Anatomy of a Repository
      2. Getting Started
      3. Update the Repository
      4. Manage a Repository Without Shell Access
    13. 66. Convert Debian to Ubuntu
      1. Perform the Conversion
      2. Mix Ubuntu and Debian
  9. 7. Security
    1. 67. Limit Permissions with sudo
      1. /etc/sudoers Syntax
      2. Show It’s Working
      3. Enable the root Account
    2. 68. Manage Security Updates
      1. Ubuntu Update Policy
      2. Obtain Security Updates
      3. Automate Update Notifications
      4. Package Signatures
      5. Monitor Security Advisories
    3. 69. Protect Your Network with a Firewall
      1. Initial Firewall Setup
      2. Initial Management-Machine Setup
        1. Create a firewall project
        2. Define a new firewall
        3. Add a host-specific policy
      3. Compile and Install the Policy
      4. Automatic Policy Startup
      5. Automatic Policy Installation
    4. 70. Use an Encrypted Filesystem to Protect Your Data
      1. Kernel Setup
      2. Create an Encrypted Device
        1. Create a loopback disk image
        2. Set up the block device
      3. Unmounting
      4. Remounting
      5. Hacking the Hack
    5. 71. Encrypt Your Email and Important Files
      1. Generate a GPG Key Pair
      2. Importing GPG Keys
      3. Signing a GPG Key
      4. Encrypting Files Using GPG
      5. Decrypting Files Using GPG
    6. 72. Surf the Web Anonymously
      1. How Onion Routing Works
      2. Installing and Using Tor
      3. Other Apps
    7. 73. Keep Windows Malware off Your System
  10. 8. Administration
    1. 74. Edit Configuration Files
      1. Navigate Through the File
      2. Edit a Line
      3. Copy and Paste
      4. Undo
      5. Save and Exit
      6. Search and Replace
      7. Help
      8. Where to Learn More
    2. 75. Manage Users and Groups
      1. Use the User Administration Tool
      2. Manage Users and Groups from the Command Line
    3. 76. Mount Any Filesystem
      1. Add a Local Partition
      2. Mount the Filesystems
      3. Mount Network Filesystems
    4. 77. Control Startup Services
      1. Services Administration Tool
      2. Command-Line Method
      3. Change the Runlevel
      4. Manually Start and Stop Services
      5. Disable Scripts from Starting
    5. 78. Build Kernels the Ubuntu Way
      1. Get the Source
      2. Tools You Will Need
      3. Configuration Methods
      4. Configuring the Kernel
      5. Compiling and Packaging
      6. Install Your Kernel Package
      7. Rebooting and Testing
      8. Installing on Other Machines
      9. Install Multiple Copies of One Kernel Version
    6. 79. Back Up Your System
      1. Get Simple Backup
      2. Configure Simple Backup
        1. Use recommended backup settings
        2. Use custom backup settings
      3. Configuring Custom Backup Settings
        1. Configure files to include
        2. Configure files to exclude
        3. Configure the backup destination
        4. Configure recurring backups
      4. Restore from Backup
    7. 80. Clone an Installation
      1. Export the List of Installed Packages
      2. Prepare the Destination System
      3. Import the Package List
      4. Hacking the Hack
    8. 81. Rescue an Unbootable System
      1. Boot into Rescue Mode
      2. Common Rescue Scenarios
        1. The system won’t go past the boot menu, or the menu is missing
        2. The system goes past the boot menu but can’t access the root filesystem
        3. The system boots and continues through part of the boot process, but hangs at a particular service
      3. Conclusion
    9. 82. Check the Captain’s Log
      1. View the Logs
    10. 83. Mount Removable Devices with Persistent Names
    11. 84. Mount Remote Directories Securely and Easily
    12. 85. Make Videos of Your Tech-Support Questions
    13. 86. Synchronize Files Across Machines
      1. The Problem with rsync
      2. Synchronize Files on Two Machines with Unison Using SSH
      3. Tweaking Your Profiles
      4. Changing the Location of Your Logfile Directory
      5. Further Information About Unison
  11. 9. Virtualization and Emulation
    1. 87. Run Windows Applications
      1. Install Wine
      2. Configure Wine
      3. Install a Windows Application
      4. Run Windows Applications
      5. Working with Wine
      6. Running Other Windows Components
    2. 88. Play Windows Games
      1. Run Blasts from the Past
      2. Run Current Windows Games with Cedega
      3. Run Google Earth with Wine
    3. 89. Run Ubuntu Inside Windows
      1. Install coLinux
      2. Set Up the Debian Image
      3. Install Ubuntu
      4. Enabling SSH
      5. Running X11 Applications
    4. 90. Use Xen to Host Virtual Machines
      1. Initial Host Installation
      2. Base Packages Required by Xen
      3. Obtain Xen3 Binary Distribution
      4. Extract Binary Distribution
      5. Configure GRUB Bootloader
      6. Xen Services
      7. Enable Networking
      8. Disable TLS Libraries
      9. Reboot
    5. 91. Create an Ubuntu/Xen Virtual Machine
      1. Prepare VM Filesystems
        1. Root filesystem
        2. Swap filesystem
        3. Mount the root filesystem image
      2. Install Ubuntu into the Root Filesystem
      3. Configure the Virtual Machine
      4. Run Setup Within the VM Image
      5. Get Ready to Crank Up the VM
      6. Configure the VM in Xen
      7. Boot Your Virtual Machine
      8. Create Additional Guests
    6. 92. Split Your Machine’s Personality
      1. Installing VMware Server
      2. Running VMware Server
  12. 10. Small Office/Home Office Server
    1. 93. Install and Configure an Ubuntu Server
      1. Minimal Installation
      2. Static Network Configuration
      3. UPS-Triggered Shutdown
    2. 94. Build a File Server
      1. Enable Quota Support
      2. Install Samba
      3. Add Shares
      4. Share Printers
    3. 95. Administer Your Server Remotely
      1. Configure SSH
      2. X11 Forwarding
      3. Configure Passwordless Authentication
      4. Copy Files Securely
    4. 96. Build a Web Server
      1. Install Apache
      2. Install PHP
      3. Configure Dynamic Virtual Hosting
    5. 97. Build an Email Server
      1. Postfix SMTP Server
      2. Reduce Spam with Greylisting
      3. Activity Reporting
      4. POP and IMAP Services
    6. 98. Build a Caching Proxy Server
      1. Basic Squid Setup
      2. Proxy Traffic Reports
      3. Peering Proxies
    7. 99. Build a DHCP Server
      1. Install the DHCP Daemon
      2. Basic Configuration
      3. Assign Addresses to Specific Hosts
      4. Hacking the Hack
    8. 100. Build a Domain Name Server
      1. Understand DNS in 60 Seconds
      2. Authoritative and Recursive Lookups
      3. Install BIND9
      4. Create an Authoritative Forward Zone
      5. Firewall Rules
  13. About the Authors
  14. Colophon
  15. Copyright

Product information

  • Title: Ubuntu Hacks
  • Author(s): Jonathan Oxer, Kyle Rankin, Bill Childers
  • Release date: June 2006
  • Publisher(s): O'Reilly Media, Inc.
  • ISBN: 9780596527204