Ubuntu Hacks

Sharpen images at the command line

Previous Page Command

If you followed Tip 154, on page 197, and Tip 11, on page 72, you'll already have come into contact with Imagemagick. This command-line program can do just about anything to images and you can learn more about it by viewing its man page (man imagemagick) or viewing its website Perhaps one of the most useful functions it can perform, besides file format conversion and resizing, is to sharpen an image. Almost all images look better when sharpened, particularly if they're being shrunk for use in...

S3 Make Ubuntu safe for children to use

Ubuntu can be as kid-safe as any other operating system with a little work. Essentially, two things can be done. First you can create a new restricted user account for the child (or children) that stops them from doing anything that might break the system, or attempting to bypass any protective measures you enact. Secondly, you can install a web filtering system so that nothing that isn't entirely child-safe gets through when they're using Firefox.10 The first thing you should do is create a...

Switch to a lightweight file manager

Thunar is the default file manager used in the stripped-back Xfce4 desktop of Xubuntu. It starts quickly, has a low-memory footprint, yet is very powerful and provides all the features you're likely to need. In fact, Switch to a lightweight file manager M 148 it beats Nautilus in many departments when it comes to features.15 It can be used to replace Nautilus within the Ubuntu desktop for some operations although bear in mind that Nautilus windows will still appear sometimes, such as when using...

Administer Ubuntu using a web browser from any computer or operating system

Webmin is some fun software designed to let a user administrate his her system using a web browser. The web browser can be running in the computer itself, or on another computer on the same network or even the Internet (provided the network is configured correctly). Webmin is geared around server configuration, but it still offerers one or two tools for more humble users. Unfortunately it isn't contained within the Ubuntu software repositories, and must be downloaded from the Webmin site....

Take complete control of desktop effects and animations

As you probably know, Ubuntu includes several desktop effects and animations. For example, windows visually shrink to the panel when minimized.12 You might also have realized that you can activate more of these effects by clicking System Preferences Appearance, selecting the Visual Effects tab, and click the Extra radio button. This will add wobbly windows to the visual mix, amongst other things. To take more control over the desktop effects, consider installing one of two packages. The first...

Avoid repetitive strain injury when using Ubuntu

Although some might scoff at repetitive strain injury, it is a significant cause of workplace injury. To help avoid it you might choose to install WorkRave, a GNOME applet19 that includes timers to tell you when to take a break, and then guides you through exercises to lessen the chances of RSI occurring. To install the program, simply search for and install workrave using Synaptic. Once installed, log out and back in again, then right-click a blank spot on the panel and select Add to panel....

See a visual representation of file and folder locations

If you're new to the Ubuntu file system (or even an old hand), it can be easy to get lost while browsing the file system. As mentioned in Chapter 2, An Ubuntu administration crash course, on page 19, the pwd can be used to get a quick reminder of the current folder, but you might also use the tree. First you'll need to install it using Synaptic search for and install tree. Then just type tree at the prompt. Here's what I saw on my test system when I typed the command within my home folder --...

Get an alternative media player

Once upon a time Linux simply wasn't very capable when it came to multimedia playback. But times have changed, and nowadays the typical user is spoiled for choice. There are essentially two well-established choices available to the Ubuntu user, above and beyond the built-in Totem Mplayer and VLC. Alongside Mplayer and VLC, the curious Ubuntu user can also install Kaffeine, which is the default media player of the KDE desktop. Kaffeine works well under Ubuntu but it's really built to fit-in with...

Scan for viruses

Put simply, viruses just aren't an issue for Ubuntu. It's unknown the number of viruses out there that target Linux but the number has been said to be less than 50. Most of those affect server software, such as the Apache web browser. When it comes to the desktop, Linux is entirely virus-free. Of course, there's no guarantee this state of nirvana will last forever and, anyhow, installing antivirus software on your computer is so easy that there's little excuse not to do so. Any viruses found...

Make Evolution more like Outlook just a little bit

Nobody can reasonably suggest that Microsoft got it right with Outlook, the email component provided as part of their office suite. However, if you're been using it for some time and have switched to Evolution, you might be annoyed by the slight differences. The good news is that Evolution can be made slightly more Outlook-like with just a little tweaking. Forward email inline Whenever you forward an email Evolution will attach it as a file that the recipient must then open. This can cause...

Synchronize files between a laptop and desktop PC

If you have two computers you might want to synchronize data between the two. For example, if you have a laptop, you might want to transfer the files in your Documents folder to the main PC (and vice versa). You )t)S.ZZt ZttY 2Z 1HI + 2 ZZZ X1N1 I gwoX2oooEnnvWvlimmmwXnn,JvV iii i.__- SZZZZZZX SZZZZla F + _qiMiZ Z2XXXZoonnnw I Iv 11 i i QWHH nZXX Ifi f s' z Z 2o -i i fy.UMi tt 2 Z-Zix'ss n n wn.W 11111 i i i BaQHit1 Z Zfe n n , d XZX 2 2 X cH 2 mi QmmHm XXXXZonnn Wv 11 v 11 i i i...

Optimize startup for faster boot times

Few operating systems seem to boot quickly enough, and unfortunately Ubuntu is amongst them. However, there are four things you can do to reduce delays and generally speed-up startup Reduce or eliminate the boot menu countdown Make boot runtime scripts start in parallel Build a read-ahead profile personalized to your PC Reduce the number of GNOME startup programs. If you dual-boot Ubuntu and Windows on your computer the boot menu appears for 10 seconds, during which you can select either...

Quickly create graphical text banners

Tip 219, on page 254, discusses using the figlet command-line tool to create ASCII banners of words but if you want to quickly create text banners as a image file, perhaps for use on websites or presentations, you can use GNOME's font preview tool. It isn't really designed for this but appropriation of existing commands is the beauty of Linux You need to specify the text, plus which font to use (including its full path), and the output filename. The following will create a banner saying 'Ubuntu...

Use a Windowsstyle Start button and taskbar

Ubuntu uses a dual-menu system, whereby the Applications, Places and System menus are always visible at the top of the screen, and an application's menus appear below. This isn't the most efficient use of desktop space and you can add a single Windows-like Start button to access Ubuntu's software, and off which can be found the Places, System Preferences and System Administration menus. The following steps explain how to combine the top and bottom panels of Ubuntu into one, to create a similar...

Software installation and management

There's a lot of software available for Ubuntu, in addition to that which comes installed out of the box, and most of it is not only free but also easily accessible. Because of this it's possible to suggest that, as far as keir keir-desktQp Documents Is grep -i project Figure 2.6 Piping the output of a command into grep active and experienced Ubuntu users are concerned, software installation is almost as common as any other activity, such as browsing the web. Part of the fun of using Ubuntu is...

Create zip files using maximum compression

When you right-click a file or folder and select Create Archive, File Roller steps in to shrink things down. However, it will only use normal compression for zip files. This is for a reason not all operating systems are compatible with the more aggressive maximum compression, and it can also take quite a bit longer to crunch uncrunch files. Yet the savings in file size can be worthwhile and the truth is that both Windows and Mac OS X are fine with maximally compressed files. To switch file...

Editing configuration files

Some of the tips in this book require that you edit configuration files by hand using a text editor. Under Ubuntu, system configuration files are usually located in the etc folder. This is a root-owned folder so root powers are needed to alter files there. In every tip requiring it, I'll tell you the exact line within the config file you'll need to change, so there's no need to fret over details. However, some general points about configuration files are worth noting. First, bear in mind that...

Take full control of Ubuntus Pulse Audio sound output

Ubuntu 8.04 Hardy Heron introduces a new sound sub-system to Ubuntu PulseAudio. Amongst other things, this is designed to give fine-grained control over audio output the sound from each application can be adjusted manually, for example (useful if you want to turn down the audio from a Flash animation without also turning-down the MP3 music playing). Unfortunately the other Ubuntu audio control tools are lagging a little behind. The PCM component of the main volume control window that appears...

Shutdown reboot hibernate or sleep Ubuntu with a single click

By creating desktop shortcuts to the terminal commands mentioned in Tip 206, on page 241, you can create one-click shutdown, reboot, hibernate, or sleep commands (although you'll need to enter your root password each time). You can do this by creating a launcher on the panels. To create a panel launcher, right-click a blank spot on a panel and select Add to panel. Then select Custom Application Launcher and click the Add button. This will open the Create Launcher dialog box. It doesn't really...

Commandline or GUI

Ubuntu might be described as an operating system with a dual nature. For many administrative tasks you can use GUI programs that are usually provided on the the System - Administration menu. Or you can do 2. The configuration files in your home folder are owned by you, rather than root. This is because they usually relate to your personal settings, such as those for the GNOME desktop. These configuration files are usually hidden, which is to say, their filenames are preceded with a period (.)....

Use an alternative wifi connection manager

Wicd (http wicd.sourceforge.net ) is an excellent swap-in replacement for NetworkManager. NetworkManager is the system software that sits in the notification area and handles network connections. Wicd does the same job but using a piece of software that's almost entirely independent of existing Ubuntu infrastructure, and packs in a few extra features too, such as the ability to configure static IP DNS addresses, and use global DNS servers such as that offered by OpenDNS (http www.opendns.org)....

Create an encrypted filestore accessible from any operating system

Tip 250, on page 289, explains how to encrypt individual files under Ubuntu but if you spend time on many different computers and operating systems, it might be worth creating an encrypted file store that you can copy to, say, a USB stick and carry around with you. An encrypted file store is a single file that is then mounted by the system and accessed as a virtual disk drive. When you've finished, you unmount it, thus locking the store so that nobody can access it without typing the password....

Use an alternative email client

The default mail client provided with Ubuntu, Evolution, is something of a benign monster. It's packed with features and is aimed squarely at business users. It's quite clearly modeled on Microsoft Outlook. Personally, I can't help feeling it's overkill for more modest needs. Below are listed two alternatives, each of which can be installed using Synaptic, and each of which are more than adequate alternatives. This is an email client with the emphasis on simplicity, although that doesn't mean...

Swap around the minimize maximize and close buttons

I don't know why you'd want to do this, unless you're an inveterate tweaker (or maybe a migrating Mac OS X user), but to reorder the minimize, maximize and close buttons, fire up gconf-editor and head for the apps metacity general entry, and look for the button_layout entry. Simply rearrange the order of menu maximize,minimize,close to the order you want. For example, to have the close button at the left of the arrangement, you'd change it to read menu close,maximize,minimize. The changes will...

Set the CPU speed from the desktop

With some types of CPU it's possible to manually alter the clock speed while the system is running. This can be very useful with a notebook computer, for example, where you might choose to throttle-down the CPU speed when on battery power to save juice, or to minimize heat generation when the computer is resting on your lap. The CPU Frequency Scaling Monitor applet takes care of this function but before it can be used some additional configuration is necessary. Open a terminal window and type...

Instantly search Google for any word or phrase

Have you ever been reading a document and wanted to look-up something in Google In Firefox you can just highlight the word or phrase, right-click it, and select Search Google. However, what if you're reading, say, a PDF file Or a man page in a terminal window A very simple but effective solution is googlizer, which you can install using Synaptic. Once installed, it's added to the Applications Internet menu, so you'll have to manually drag and drop it to a blank spot on the panel for quicker...

Users passwords and files

When you first installed Ubuntu, you created a user account for yourself. You were allocated a tranche of space to save your personal data Ubuntu doesn't use drive letters. The root of the file system, normally indicated by C within Windows, is indicated by a single forward slash in Ubuntu. Thus you'll see a path like usr share doc in Ubuntu, rather than something like C Program Files Microsoft Office within Windows. Whereas Windows uses a backslash to separate directories, Ubuntu uses a...

Reconfigure your graphics card from the groundup

If Ubuntu just hasn't got it right when it comes to your graphics card and or monitor, you can configure things manually. To do so, open a terminal window and type gksu displayconfig-gtk. Settings relating to your monitor are located on the Screen tab, while you can change the graphics driver in use by selecting the Graphics Card tab. If you can't seem to get any driver to work, try clicking the Driver dropdown list, and then selecting VESA from the Choose Driver by Name dropdown list. VESA is...

Shrink or enlarge images at the command line

GIMP can do just about anything to an image but it can be time-consuming to fire it up just to resize an image. For ultra-quick manipulation, consider Imagemagick, a command-line image manipulation program. It doesn't come installed by default and you'll need to install it via Synap-tic (search for and install imagemagick). Once installed, the convert command should be used with the addition of the -resize command option. For example, the following will shrink filename.bmp to half its original...

Slow down a touchpads scrolling

If you've got a notebook computer, you might be used to edge scroll on the touchpad when running Windows. This is where the right-hand edge of the notebook's touchpad is used as a virtual scrollbar by running a finger up and down, the currently active window scrolls up and down correspondingly. You might already have realized that you can activate the edge scroll functionality in Ubuntu using the Touchpad tab of System Preferences Mouse. The problem I had was that the scrolling was just too...

Install Google applications

As with Windows and Macintosh, Google has released a series of downloadable applications for Linux Google Earth, Picasa and Google Desktop. Google Earth allows you to spin around the globe looking at satellite photographs and planning routes between locations. Picasa lets you catalog and tweak photographs on your hard disk and then upload them to online photo albums provided as part of your Google account. Google Desktop lets you organize and search your files, as well as quickly search your...

Make Windows permanently available

Choose a picture and then load it into the GIMP (right-click and select Open With Open with GIMP Image Editor) you might like to know that the default Ubuntu desktop wallpapers are stored in usr share backgrounds. You should select a picture that's roughly in 4 3 ratio, such as a digital camera snap. Don't select very tall or broad images they won't work. 2. Right-click the image within GIMP and select Image Scale Image. In the Width box, type 640 and hit the Tab key. The Height box should then...

Rename many files at once aka bulk rename

Have you ever been out with your digital camera and then returned home to find yourself with lots of files with names like IMG_0159.jpg, IMG_0160.jpg, IMG_0161 .jpg, and so on And have you then gone through one-by-one renaming them with something relevant Well, there's no need to ever do that again because Ubuntu can come to the rescue There are a handful of ways of bulk renaming files at the command-line but many are quite involved and you'll need to remember a chain of commands. To save the...

Change Firefoxs spellchecker language

Firefox includes a handy spellchecker that will ensure anything you type into text boxes is correct. Any incorrect words are underlined in red. The problem is that it defaults to American English, which can be annoying for the British, Canadians, Australians and those of other primarily English-speaking nations. The solution is easy just visit http and then click the Install link alongside your language of choice. After Firefox has restarted, and next time it hightlights a word it thinks is...

Use Ubuntus movie player to watch You Tube movies

Like many open source applications, Totem utilizes a plugin structure, meaning that its functionality can be expanded by add-in modules. Several are supplied out of the box, including a YouTube browser. This lets you search for and playback YouTube videos within Totem. However, none of the plugins are activated. To activate the YouTube plugin, start Totem (Applications Sound & Video Movie Player), click Edit Plugins, and put a check alongside YouTube Browser in the list. click the Close button...

Change Ubuntus system sounds

Ubuntu doesn't make as heavy use of sounds as some other operating systems but there are still some in use when you login you hear the familiar music at login, for example. To change the system sounds, do the following 1. Click System Preferences Sound, and then click the Sounds tab. As you can see, there are entries for just about any significant system event, such as an error dialog appearing, but most aren't used by default. By clicking the dropdown entry in the list, you can select from a...