Couple of Ubuntu/Linux Tips

I had a number of really good Linux particularly Ubuntu specific tips lying around , so i thought instead of posting them separately it would be way better to post them together as a single article . Some of the tips i have discussed below helps you change default operating system to load in case of time out in the grub boot loader , logging in to system automatically without having to worry about typing in your login credentials , installing DVD playing support , viewing chm files in Mozilla Firefox , Improving quality of font rendered on LCD Displays , increasing your laptop's battery life , Installing cool graphics effect , enabling delete option etc .


1. Logging in automatically

Ubuntu by default does not come with automatic log-in enabled so whenever you start ubuntu you have to type in your login credentials . Now however if you want a particular user to be logged in automatically whenever ubuntu starts you can do that easily by following these steps :

1. Go to System -> Administration -> Log-In Window
2. In the dialog box that appears go to Security tab and click on " Enable Automatic login" and click on the user you want to login automatically .


2. Increasing your laptop's battery life

Intel a year back released a tool called PowerTop that uses no of features available in the Linux Kernel to make Linux Kernel power efficient and hence helps you conserve your precious laptop battery . Powertop does this by providing you entire list of running application and amount of power they are consuming , so turning of the non-essential one causes one to use less power and hence increases your battery life .

Here is text from PowerTop project about PowerTop

Computer programs can make your computer use more power. PowerTOP is a Linux tool that helps you find those programs that are misbehaving while your computer is idle. The application that misbehaved the most was the Linux kernel. However, as of version 2.6.21, the Linux kernel went tickless, and no longer has a fixed 1000Hz timer tick. The result (in theory) is huge power savings because the CPU stays in low power mode for longer periods during system idle.

However... there are many things that can ruin the party, both inside the kernel and in userspace. PowerTOP combines various sources of information from the kernel into one convenient screen so that you can see how well your system is doing at saving power, and which components are the biggest problems.

PowerTOP has these four basic goals:
  • Show how well your system is using the various hardware power-saving features
  • Show you the culprit software components that are preventing optimal usage of your hardware power savings
  • Help Linux developers test their application and achieve optimal behavior
  • Provide you with tuning suggestions to achieve low power consumption

Now , however PowerTop does not come preinstalled with ubuntu and you have to install it separately (assuming you have all your repositories in order) issue the following command in the terminal window to install power-top :

sudo apt-get install powertop


and after completing above step launch powertop by typing in following in terminal mode ( should be run in super-user administrator mode )

powertop

or
sudo powertop
Powertop in action


3. bypassing trash and deleting files directly

By default nautilus does not come with option to delete file directly , so well whenever you delete file it goes into the Trash . Now however if you want an option to delete file directly without the file going into Trash you can do so by following these steps :

First open nautilus by either clicking on Home Folder ( on menubar at top go to Places -> Home Folder) once nautilus is open go to (Edit -> Preferences )
in the menubar at top of the frame of nautilus , and in the dialog box go to Behaviour you will find a dialog box like this :



In this dialog box enable "Include a Delete command that Bypasses Trash " and close the dialog box . Now whenever you want to delete a file permanently , just right click on the file and chose Delete to delete file permanently .

4. Improving clarity of fonts on LCD/Laptop Displays

Ubuntu does not enable Subpixel smoothing by default which improves the clarity of fonts on LCD displays . To enable it go to (System -> Preference -> Appearance ) and click on the Fonts tab

You will find a window like the one shown below , chose "Subpixel smoothing(LCD)" and close the window you should be able to see the change immediately .
Dialog Box With Subpixel smoothing Enabled

Same Dialog Boxes one with Subpixel smoothing enabled and one with Best shapes enabled

5. Enabling Cool Graphics Effects

Unlike previous releases of Ubuntu where one had to manually download and install compiz,beryl etc (Compiz Fusion is composite window manager that provides best features of Compiz and Beryl) from Repositories if one wanted to have glitzy visual effects . Ubuntu 7.10 comes with Compiz Fusion pre-installed and on supported hardware offers a wide array of Visual Effect . Now depending on graphic hardware of computer one could chose from three level of Visual Effect (From System -> Preferences -> Appearance )

None : - This mode causes Ubuntu to use Metacity instead of Compiz Fusion , with no visual effect

Basic : - Has only simple visual effects like shadows , fading windows-menus etc

Advanced : - Recommended for PC with descent graphic hardware , enables effects like wobbly windows, transparency , animated workspace switching etc
Visual Effect Dialog Box
Now , the biggest advantage of Compiz Fusion is even on really slow hardware one can have descent set of visual effects even on my slow laptop i could use Extra graphics effects though it was painful while using application like OpenOffice because of my slow hardware.

However , compiz-fusion is capable of much more and you can enable more desktop effects /customize compiz by typing the following command in the terminal window : -

sudo apt-get install compizconfig-settings-manager
After completing above step , you can customize compiz by going to System > Preferences > Advanced Desktop Effects Settings .

6. Opening CHM Files using Mozilla Firefox


Mozilla Firefox is a powerful platform and it can be extended to do a number of cool things by installing different plug ins and one really useful addon is a CHM viewer .

To install CHM reader addon go to the following site and click on install button , procedure after that is quite self explanatory owing to extremely easy interface of Mozilla Firefox .


After clicking install button you will find a dialog box like this just click the "Install Now" button in this dialog box

After installing you can easily open chm files from Mozilla Firefox , In the File submenu you will find a option of opening chm files .
File Menu in Firefox showing new option to open CHM file


Firefox rendering a CHM file

7.
1.Changing default operating system to load in case of time-out in grub

Most of the Linux distributions these days use GRUB as default boot-loader . Now after completing installation , if not specified during the time of installation if grub sets Linux as the default operating system to load in case of a time-out . Now even though this is what most users would want still if some one wants to have windows or any other operating system as a default operating system one can do it easily by following the steps below :

Firstly you have to open menu.lst file which is the configuration file of grub loader . Now to modify it you need super-user(administrator ) privileges , to open the file type in the following command .

sudo gedit /boot/grub/menu.lst

Now add a default option like this and set it's value to a number that is the sequential order of operating system you want to load in the grub configuration file .

for example for the grub file :

default 5

title Ubuntu 7.10, kernel 2.6.22-14-generic
root (hd0,5)
kernel /boot/vmlinuz-2.6.22-14-generic root=UUID=4bc9176e-77b6-4067-97c4-6c25c6c6b7a2 ro quiet splash
initrd /boot/initrd.img-2.6.22-14-generic
quiet

title Ubuntu 7.10, kernel 2.6.22-14-generic (recovery mode)
root (hd0,5)
kernel /boot/vmlinuz-2.6.22-14-generic root=UUID=4bc9176e-77b6-4067-97c4-6c25c6c6b7a2 ro single
initrd /boot/initrd.img-2.6.22-14-generic

title Ubuntu 7.10, memtest86+
root (hd0,5)
kernel /boot/memtest86+.bin
quiet

title Fedora (2.6.23.1-42.fc8)
root (hd0,2)
kernel /boot/vmlinuz-2.6.23.1-42.fc8 ro root=LABEL=/ rhgb quiet
initrd /boot/initrd-2.6.23.1-42.fc8.img
### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title Other operating systems:
root


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title Windows Vista/Longhorn (loader)
root (hd0,0)
savedefault
makeactive
chainloader +1

To load windows automatically , i added

default 5


at the top of menu.lst


8. Installing Audio/Video and DVD Playback support

he first thing anyone who wants to use Ubuntu as a replacement to their windows operating system would like to do is install support for all kind of audio/video multimedia codecs . Ubuntu does not come installed with support for major audio/video formats because of licensing issue and other issues . To install support for audio/video codecs type in the following command in the terminal window : -

sudo apt-get install gstreamer0.10-plugins-bad gstreamer0.10-ffmpeg gstreamer0.10-plugins-ugly
And if you want to install mp3 support in nautilus you may like to install mpg123 which is a nice command line based utility for playing mp3 files and it works well even on modest hardware .

sudo apt-get install mpg123

This would enable most of the popularly used codecs in the Totem Movie player which uses the GStreamer framework to play audio/video files.

and to install DVD playing support , type in the following command in the terminal window (Note playing DVD in certain regions through the lib being installed below might be illegal so do it at your own risk ) :

sudo apt-get install totem-xine libxine1-ffmpeg libdvdread3


and

sudo /usr/share/doc/libdvdread3/install-css.sh


After issuing the above command whenever you insert DVD , automatically it would start playing in totem .

Article Written by : Ambuj Varshney (blogambuj@gmail.com)
For Linux on Desktop , http://linuxondesktop.blogspot.com
(C) 2008 , Ambuj Varshney

Comments

Amazon Ads