Tuesday, December 7, 2010

BAK File

In computing, ".bak" is a filename extension commonly used to signify a backup copy of a file.
When a program is about to overwrite an existing file (for example, when the user saves the document he or she is working on), the program may first make a copy of the existing file, with .bak appended to the filename. This common .bak naming scheme makes it possible to retrieve the original contents of the file. In a similar manner, a user may also manually make a copy of the file before the change and append .bak to the filename.
Other naming schemes are also in widespread use: file~, file.orig, file.old, and so on.
Database Applications like FoxPro and SQL Server use .bak files to back up their databases.[citation needed] Many applications, like XML shell, create .bak files in their Autosave process.[citation needed] They don't get automatically deleted, so they need to be manually deleted after the process using it is stopped.

Applications that use bak files

  • Finale Notepad
  • FoxPro
  • Sony Vegas
  • SQL Server
  • XML Shell
  • AutoCAD
Thanks to :
Wikipedia

how to stop automatic updates in Ubuntu and Fedora Core

 how to check correct bandwidth usage and how to stop automatic
updates,no application should connect internet without my permission,
what to do for that?

Steps to stop automatic updates
1. Go to System->Administration->
Synaptic
2. Open Settings->Repositories
3. Go to updates tab
4. Deselect "check for updates" under Automatic updates.

Satellite Phone - AT&T

TerreStar Genus now available to anyone who wants one for just $1,150

Just how much is the promise of anywhere, anytime cellphone reception worth to you? If you answered "one thousand, one hundred and fifty dollars," well... your time has finally come. After initially launching through business channels alone for $800, TerreStar's unique GSM / HSPA Windows Mobile 6.5 smartphone for AT&T with satellite connectivity is now available to consumers from all walks of life, as long as you've got $1,149.99 lying around. The Genus features Bluetooth, WiFi, GPS, a 2 megapixel camera, and pretty much every other amenity you'd expect form a WinMo 6.5 smartphone with circa-2008 hardware specs, with the obvious exception that it can be used anywhere you can see TerreStar's satellite pretty much anywhere in North America. Of course, we'd be a little hesitant about buying a four-figure phone that operates on a bankrupt service, but if you need coverage in the boondocks, your options are pretty limited. Follow the break for TerreStar's demo video and full press release.

 



Thanks to:
http://www.engadget.com/2010/11/23/terrestar-genus-now-available-to-anyone-who-wants-one-for-just/
http://www.terrestar.com/genus.php

Thursday, December 2, 2010

Solution for : The Workstation service has not been started in Windows XP

The Workstation service has not been started

If you hit this error when open webpage in browser, dont panic.
It just the "Workstation" service was stopped.
Simply go to RUN>type "net start workstation"; solve the problem.

*FYI: We can browse it in services component there. (RUN>services.msc)

Workstation purpose:
Creates and maintains client network connections to remote servers. If this service is stopped, these connections will be unavailable. If this service is disabled, any services that explicitly depend on it will fail to start.

Wednesday, December 1, 2010

Mini PCI Express Pinout

 

 
 

http://www.interfacebus.com/Mini_PCI_Express_Bus.html
 
 
 Mini PCI express pinouts
Pin # Signal Name Pin # Signal Name
51 Reserved 52 +3.3V
49 Reserved 50 GND
47 Reserved 48 +1.5V
45 Reserved 46 LED_WPAN#
43 Reserved 44 LED_WLAN#
41 Reserved 42 LED_WWAN#
39 Reserved 40 GND
37 Reserved 38 USB_D+
35 GND 36 USB_D-
33 PETp0 34 GND
31 PETn0 32 SMB_DATA
29 GND 30 SMB_CLK
27 GND 28 +1.5V
25 PERp0 26 GND
23 PERn0 24 +3.3Vaux
21 GND 22 PERST#
19 Reserved (UIM_C4) 20 Reserved
17 Reserved (UIM_C8) 18 GND

Mechanical Key
15 GND 16 UIM_VPP
13 REFCLK+ 14 UIM_RESET
11 REFCLK- 12 UIM_CLK
9 GND 10 UIM_DATA
7 CLKREQ# 8 UIM_PWR
5 Reserved 6 1.5V
3 Reserved 4 GND
1 WAKE# 2 3.3V 

Sharing files and folder between an Ubuntu and Windows machine



Thanks to:
http://www.youtube.com/watch?v=VuxSjiSVoBU&feature=watch_response

Ubuntu Installation From USB Stick

Outline

The recommended way to install Ubuntu 9.10 and later versions from a USB flash drive is to use the usb-creator program, point it at a ISO image of a Ubuntu installation CD that you have downloaded, and let it create a bootable USB that you can use instead of the CD.
  1. Acquire the correct Ubuntu installation files and tools
  2. Put Ubuntu onto your USB drive
  3. Configure your computer to boot from USB drive and boot from it
  4. Try Ubuntu or install to your hard drive.

Introduction

This page gives instructions on how to run Ubuntu from a USB flash drive for installation or to try it out. This may be necessary for netbooks and other computers without CD drives and is handy for others because a USB flash drive is so convenient. Also, you can configure Ubuntu on the USB drive up to save changes you make, unlike a read-only CD-ROM drive. Recent Ubuntu CD/DVD ISO images come with the necessary Windows and Linux utilities to get the system on a USB drive.
Booting from a USB drive created with this utility will behave just as if you had booted from the install CD. It will show the language selection and then the install menu, from which you can install Ubuntu onto the computer's hard drive or launch the LiveCD environment.
For custom, manual, older versions, and technical instructions and troubleshooting see USB Installation Media. There are also network installation options available. You can also see the instructions for USB drives from the official 9.04 Install Guide.
Note: This article uses the terms USB stick, USB drive, thumb drive and flash drive interchangeably.

Known Issues

The 9.10 CDs and DVDs are missing the usb-creator.exe program used by the Windows installation processes discussed below. To install the i386 desktop version to a flash drive from a disk image on Windows, use the incredibly easy process described at http://www.pendrivelinux.com/create-a-ubuntu-9-10-live-usb-in-windows/ . When you boot the resulting live persistent USB, you can install to your hard disk if you wish at any time, or not.
If you just get a black screen when running from USB, using the setting "Discarded on shutdown, unless you save them elsewhere" in usb-creator might help. Forum: 9.10 NBR issues
9.10 Netbook Remix does not bring up Broadcom WIFI automatically. Poll and install a few packages manually with dpkg to get networking up. https://bugs.launchpad.net/ubuntu/+source/jockey/+bug/449268
If you get "Incorrect CD-ROM detected" error on detection stage, reboot, press F6 and then ESC to go to manual boot line editing, and add the option 'cdrom-detect/try-usb=true'. On Ubuntu 9.10 server edition the install menu will be shown right after reboot. Chose "Help" and then press F6. At the boot prompt type "install cdrom-detect/try-usb=true" and hit enter.
If the above doesn't solve your CD-ROM detection problem and you used the "Universal USB Installer" to prepare your USB flash drive another solution might be give UNetbootin instead of the "Universal USB Installer" a try. If you are encountering this problem with UNetbootin, press tab at the splash screen to access the boot line editor.
Some BIOS's (eg., the Eee PC netbook') have trouble recognizing that the USB is bootable. You may have to trick it into booting using the following method: At boot, enter the BIOS by pressing F2. Then, right as you exit the BIOS, hit the Esc key. For some systems, this will bring up the boot menu.
"Can not mount /dev/loop1 on /cow" message because usb-creator.exe is not creating a valid casper-rw file holding ext2/ext3 filesystem. Fix: After running usb-creator.exe, recreate casper-rw using cygwin tools or http://www.pendrivelinux.com/casper-rw-creator-make-a-persistent-file-from-windows/. (As of April 2010)
There is an unresolved issue in that you cannot create a bootable USB flash drive from within Mac OS X. You must create the stick in Linux or Windows.

Prerequisites

Source machine

Windows

Mac OS X

  • Administrator privileges on computer used to set up the USB flash drive

Linux

  • Administrator privileges on computer used to set up the USB flash drive
  • Install and run usb-creator

USB flash drive

  • A Netbook installation requires a minimum 1 GB USB flash drive.
  • Desktop or server requires a 2 GB USB flash drive.
  • Check the USB drive for files and back them up if needed. Putting the Ubuntu system files on the USB flash drive and making it bootable will destroy all pre-existing files on the USB drive!
  • The Windows utility won't let you select the USB drive if the drive isn't properly formatted and mounted.

Target machine

Netbook

  • 1GB USB flash drive with everything backed up elsewhere, because these commands will over write the partition table.
  • ISO image file, or CD and another computer ubuntu-netbook-remix ISO, or kubuntu-netbook ISO, or
  • Optional, large capacity SD card for storing ISO and or backing up data

Desktop or Server

  • 2GB USB flash drive, or just do network install

Ubuntu CD or ISO

The Ubuntu system files that you will be putting on the USB flash drive are provided as a ISO file that is an image of an Ubuntu install CD-ROM. You need to download the appropriate .iso file.
Ubuntu
Derivatives
Or you can get a physical Ubuntu CD-ROM disk from a friend, order one ... etc.

Creating a bootable Ubuntu USB flash drive

To start Ubuntu from the USB flash drive, it needs the Ubuntu system files from the CD-ROM image, and it must be be configured to start up, or "boot", your computer. There are many guides for doing this on the web, but the easiest way to do the whole thing is to run the Ubuntu usb-creator program. Versions of this are available for Ubuntu and for Windows.

From Ubuntu Linux

The Ubuntu USB startup disk creator is available in the package usb-creator, usb-creator-kde on Kubuntu, or usb-creator-gtk on 9.10.
From the 8.10 release on (9.10 on for Kubuntu), Ubuntu includes the usb-creator by default on all LiveCDs and installations.
You can find it in System-->Administration-->Create a USB startup disk (Ubuntu Desktop) or K-Menu-->Applications-->System-->Startup Disk Creator (Kubuntu). If it is not there then you can install it using the Synaptic Package Manager, or by entering the following command in the Terminal :
sudo apt-get install usb-creator
Make sure the software-sources are activated if you are on a LiveCD (software sources or sudo gedit /etc/apt/sources.list). You may need to install the python-gnome2 package as well.
Start usb-creator. It looks like this
https://wiki.kubuntu.org/Kubuntu/Netbook?action=AttachFile&do=get&target=screenshot-usb-creator.png
  • If you have the physical CD or DVD-ROM of the Ubuntu version you want to install on the USB drive, insert it in your CD-ROM drive. Otherwise, in its top pane, click "Other" and locate and select the .iso file that you downloaded.
  • Insert the to-be-nuked USB flash drive into the computer. You do not need to mount it or view it. It should show up in the bottom pane titled "Disk to use". (You may have to use GParted to format the USB drive--I used 'ext3' as the format and it worked.)
  • Make sure you have the correct device selected before clicking the button to "Make Startup Disk"!
Notes
  • If the progress bar proceeds very slowly (1% every 10 seconds or so) you may want to make sure your USB flash drive is mounted without the "sync" option. This seems to work around single-byte writes bug in Jaunty's usb-creator.
  • There may be bugs during the formatting which will show up as two partitions when booting from the USB flash drive. Try selecting each of them and one should work. If not, restart the computer and try booting from the USB drive again.
  • If you get a DBus error with usb-creator, this bug report may be helpful: https://bugs.launchpad.net/ubuntu/+source/usb-creator/+bug/458334
  • If you have problems with usb-creator, you can instead install and use UNetbootin to do the same thing.

From Windows

Versions of Ubuntu other than Ubuntu 9.10 (Karmic Koala) include a file called usb-creator.exe in the CD image. You need to run this program, so you need to copy it out of the CD image. To do so, you can burn the Ubuntu ISO file to a disk, or you can use a Windows utility such as Virtual Clone Drive to access the .iso file's contents. You can also use 7Zip to extract the ISO so you can work with the files inside.
This process is described in detail in a video on this website.
Once you have usb-creator.exe, run it and follow the same steps as described for Linux (point it at your .iso file or your Ubuntu CD-ROM, point it at your USB flash drive, make sure you have the right device selected, then "Make Startup Disk").
Notes
  • Instead of usb-creator.exe you can use Unetbootin to create a bootable USB drive. http://unetbootin.sourceforge.net/
  • You won't be able to select the USB drive if it wasn't formatted in a way that Windows can see it. You may have to format it using Windows Explorer in order for it to show up in a creator tool.

Booting the Computer from USB

Insert the bootable USB flash drive that you just created in your target computer, and restart it. Most newer computers can boot from a USB drive. If your computer does not automatically do so, you might need to edit the BIOS settings.
Restart your computer, and watch for a message telling you which key to press to enter the BIOS setup. It will usually be one of F1, F2, DEL, ESC or F10. Press this key while your computer is booting to edit your BIOS settings. (On HP Mini Netbooks, they correct key is usually F9.)
You need to edit the Boot Order. Depending on your computer, and how your USB key was formatted, you should see an entry for "removable drive" or "USB media". Move this to the top of the list to force the computer to attempt to boot from USB before booting from the hard disk.

Alternative methods

PLoP Boot Manager

Some computers can see the USB flash drive and have the option to boot from USB but cannot actually boot from USB. All hope is not lost.

Requirements

Just follow the instructions on the PLop website.
Note: When you use this method, the files on the USB drive are changed during boot. To use this method more than once, you must delete all files from the USB drive and prepare the USB drive again as described below.

Windows

This method is recommended if you are creating Linux installation to coexist with your existing Windows installation.
  • Find a usb-creator app and run it

Installing Ubuntu directly on a USB flash drive

In order to install a fully working Ubuntu operating system on your USB flash drive make sure that:
  • Your flash Drive has more than 2GB of memory
  • Your flash Drive is bootable
  • Your flash Drive has a high read/write speed and is USB 2.0 enabled
The process is described in detail in an external source.

9.04 and Earlier .img for Netbook

If you have downloaded an .img file, please refer to the .img writing documentation

Create Bootable USB Manually

Here is a way to create a bootable USB flash drive manually. The advantage is you don't have to empty your USB drive as long as you have enough space for the files. It also allows multi boot, so you can, for example, have your USB drive holding both 32bit and 64bit versions of Ubuntu and other Boot CD tools at the same time.
In order to do so you need :
First you need to install grub on to the USB's MBR. Follow the link to the Grub4DOS Wiki: Simple example:
./bootlace /dev/sdx
Next, you open up the ISO file and extract the files in casper directory. The size (and possibly manifest) are needed if you want to install from the USB drive otherwise the install will error out.
total 701060
-rwxr-xr-x 1 adrian adrian     38784 2010-07-27 16:15 filesystem.manifest
-rwxr-xr-x 1 adrian adrian        10 2010-07-27 16:15 filesystem.size
-rwxrwxrwx 2 adrian adrian 704487424 2010-04-29 05:38 filesystem.squashfs*
-rwxrwxrwx 1 adrian adrian   9365872 2010-04-29 05:34 initrd.lz*
-rwxrwxrwx 1 adrian adrian   4029792 2010-04-16 06:01 vmlinuz*
/media/Fujitsu 60GB USB/bootimg/ubuntu.10.4.x86$
Copy grldr to the root of the drive.
drwx------ 1 adrian adrian   4096 2010-05-05 16:49 bootimg/
-rwxrwxrwx 1 adrian adrian 220049 2009-09-24 17:30 grldr*
-rwxrwxrwx 1 adrian adrian   2760 2010-05-04 23:08 menu.lst*
/media/Fujitsu 60GB USB$
Now create menu.lst at the root of USB. Example of menu.lst:
default /default
##################### 
title Ubuntu 10.04 LiveCD
find --set-root /bootimg/ubuntu.10.4.x86/initrd.lz
kernel /bootimg/ubuntu.10.4.x86/vmlinuz boot=casper live-media-path=/bootimg/ubuntu.10.4.x86/ ignore_uuid
initrd /bootimg/ubuntu.10.4.x86/initrd.lz
boot
Make sure the path match where the files you copy to.
Now, reboot.

Thanks to:
https://help.ubuntu.com/community/Installation/FromUSBStick

How to install windows xp from a usb flash disk drive (USBmultiboot)


-----------

or else you can also the follow the below method.

Someone in this post (Acer Aspire One Specifications and Windows XP Drivers) ask me to write a tutorial about how to install Windows XP using USB flash disk/flash drive.
If you want to install Windows XP, but your notebook (or PC) has no CDROM, you should install Windows XP using USB Flash disk/Flash Drive/Thumb drive...
just follow this guide :

blogger-emoticon.blogspot.com
step 1:
Buy an USB Flash Drive (at least 2GB).
When you do this tutorial, please make sure your computer/laptop/PC has a CD-ROM (or DVD).
so, now you have 2 computers, with CD-ROM support and without CD-ROM support (e.g Acer Aspire One, Asus EEE-PC).

step 2:
Download this software pack (Komku-SP-usb.exe - Download) 1.47MB
UPDATE 1 :
Anonymous said…
your download at mediafire keeps timing out, any other hosts available?
Mirror Depositfiles
Mirror Rapidshare
Mirror Easy-Share
Mirror Megaupload




this software pack contains 3 application :

-BootSect.exe (Boot Sector Manipulation Tool)
-PeToUSB (http://GoCoding.Com)
-usb_prep8 (Prepares Windows XP Setup LocalSource for Copy to USB-Drive)

step 3:
Double click Komku-SP-usb.exe


a window will appear... and click Install



step 4:
Insert your USB Flash Drive.
When I made this tutorial, I was using 4GB Transcend USB FlashDrive...



Locate folder C:\Komku\PeToUSB\
double click PeToUSB.exe




a window will appear like this...


Destination Drive : select USB Removable
check on Enable Disk Format
check on Quick Format
check on Enable LBA (FAT 16x)
Drive Label : XP-KOMKU (or whatever you want)
then click Start

Click Yes to continue....



"You are about to repartition and format a disk. Disk: .... All existing volumes and data on that disk will be lost. Are You Sure You Want To Continue?"
click Yes


Wait a few seconds...

Click OK, and you can close PeToUSB window.


step 5:
Open Command Prompt ...
Click Start > Run > type cmd > click OK


On Command Prompt window, go to directory C:\Komku\bootsect\how to do this?
first type this cd\ and press Enter

then type cd komku\bootsect and press Enter


the result...


Don't close Command Prompt window, and go to step 6...


step 6:
on command prompt window, type bootsect /nt52 H:


H:
is drive letter for my USB Flash Drive, it may be different with yours...
and press Enter

the result... "Successfully updated filesystem bootcode. Bootcode was succesfully updated on all targeted volumes."


don't close Command Prompt window, and go to step 7...


step 7:
now type this cd.. and press Enter

then type cd usb_prep8 and press Enter


type usb_prep8 again... and pres Enter



step 8:Your command prompt window will look like this

Press any key to continue...
usb_prep8 welcome screen will appear


Prepares Windows XP LocalSource for Copy to USB-Drive:

0) Change Type of USB-Drive, currently [USB-stick]
1) Change XP Setup Source Path, currently []
2) Change Virtual TempDrive, currently [T:]
3) Change Target USB-Drive Letter, currently []
4) Make New Tempimage with XP LocalSource and Copy to USB-Drive
5) Use Existing Tempimage with XP LocalSource and Copy to USB-Drive
F) Change Log File - Simple OR Extended, currently [Simple]
Q) Quit

Enter your choice:_

now, insert your original Windows XP CD, or Windows XP with sata ahci driver to your CD/DVD ROM
and back to Command Prompt window

type 1 then press Enter...
"Browse For Folder" window will appear, select your CD/DVD drive and click OK



the result... "XP Setup Source Path" changed to G:\ (yours may be different)


now for point 2, if letter T is currently assigned to a drive in your computer, you must change it.... if not, leave it as it is
how to change it?
type 2 and press Enter...

"Enter Available Virtual DriveLetter"
for example you doesn't have drive Sso you type S and press Enter

back to usb_prep8 welcome screen...
now type 3 and press Enter...
"Please give Target USB-Drive Letter e.g type U" Enter Target USB-Drive Letter:
because my Flash drive letter is Hso, type H and press Enter...

after back to usb_prep8 welcome screen...
now type 4 and press Enter to make new temporary image with XP LocalSource and copy it to USB Flash Drive
please wait a few seconds..


"WARNING, ALL DATA ON NON-REMOVABLE DISK
DRIVE T: WILL BE LOST! Proceed with Format (Y/N)?"
type Y and press Enter
please wait....
when format virtual disk complete, press any key to continue...


please wait... making of LocalSource folder is in progress...


when "Making of LocalSource folder $WIN_NT$.~LS Ready"
Press any key to continue...



"Copy TempDrive Files to USB-Drive in about 15 minutes = Yes OR STOP = End Program = No"
Click Yes, and wait...


"Would you like USB-stick to be preferred Boot Drive U: bla... bla..."
Click Yes



"Would you like to unmount the Virtual Drive ?"
Click Yes, wait a few seconds, and press any key....
press any key again to close usb_prep8...


Now, your USB Flash Drive is ready...


step 9:
Now, insert your USB Flash Drive/Flash Disk/Thumb Drive to your notebook (e.g Acer Aspire One)
go to BIOS and make USB HDD (or USB ZIP in some other machine) as primary boot device....

then boot form your USB Flash Drive....
and select "TXT Mode Setup Windows XP, Never unplug USB-Drive Until After Logon"


After Hard Disk detected, delete all partition, create single partition... and install Windows XP on that partition...
and wait...


once text mode setup is complete, computer will restart....
this time select "GUI Mode setup Windows XP, Continue Setup + Start XP"



Continue Windows XP setup.... and Done!
Windows XP Installed....



Remember, you can use this tutorial to install Windows XP on all other computers.. not just Aspire One and Asus EEE-PC....
good luck!



Thanks to:
http://www.youtube.com/watch?v=w8A1VGlxMOs
http://komku.blogspot.com/2008/11/install-windows-xp-using-usb-flash-disk.html

MAC Filtering

In computer networking, MAC Filtering (or EUI filtering, or layer 2 address filtering) refers to a security access control methodology whereby the 48-bit address assigned to each network card is used to determine access to the network.
MAC addresses are uniquely assigned to each card, so using MAC filtering on a network permits and denies network access to specific devices through the use of blacklists and whitelists. While the restriction of network access through the use of lists is straightforward, an individual person is not identified by a MAC address, rather a device only, so an authorized person will need to have a whitelist entry for each device that he or she would use to access the network.
While giving a wireless network some additional protection, MAC filtering can be circumvented by scanning a valid MAC (via airodump-ng) and then spoofing one's own MAC into a validated one. This can be done in the Windows Registry or by using commandline tools on a Linux platform.

Thanks to:
http://en.wikipedia.org/wiki/MAC_filtering

Routers vs. Access Points

So you are creating your own wireless network, and you are wondering what the difference is between a router and an access point. This is a pretty common query, since some of their tasks seem to overlap at first sight. For instance, both access points and routers provide access to the internet. But this is where the similarity stops.

What Does a Router Do?

A router is like a server, because it performs the functions of a server. A router directs data and commands coming from different places in the network towards their destinations. It organizes and choreographs the network's real-time communications.
A router can also act as a DHCP server, assigning dynamic IP addresses to each computer every time they boot up. A router can also perform port forwarding.
Finally, a router connects multiple computers to the internet. The router has an IP address that other computers on the internet can see, and it assigns different, private IP addresses to the computers connecting to it. This adds another level of security to your network since in theory, users on the internet do not know there are multiple computers in your network connected to the internet through a router, they just see the router as one computer. This may block some unwanted traffic from reaching your computers. You do still, however, need a firewall and other security features.

What Does an Access Point Do?

An access point does not perform all the functions of a router. An access point is basically what it sounds like: it provides your network computers with a wireless point of access to the internet. They also provide slower access the more computers are trying to get onto the internet at the same time.
Access points can come with some of the same security features as routers, but they will not perform its server-like functions. You can think of it this way: Whereas an access point is like a door to the internet for your network, a router is more like a police officer directing the traffic within your network and deciding who can and cannot enter and exit the network.

Thanks to:
http://www.spamlaws.com/routers-accesspoints.html

Scenarios in which you should use a wireless router instead of an AP

Scenarios in which you should use a wireless router instead of an AP are the following:

1. Situations in which an insufficient supply of IP address is available on the existing wired subnet.
2. Situations in which you want to place special limits on the wireless clients that are not usually available in wireless APs, such as firewall

Tuesday, November 23, 2010

Send email through Gmail with GNU Emacs


Sending email from GNU Emacs through Gmail is pretty simple but it does take a bit of work to get everything configured.
The first step is to install starttls (direct link). This allows Emacs to communicate with Gmail via SSL. Place the resulting starttls.el file anywhere on your load-path.
Now you need to configure your ~/.emacs file. Here is a good starting point:
; Setup email sending
(require 'smtpmail)
(require 'starttls)
(setq send-mail-function 'smtpmail-send-it
      message-send-mail-function 'smtpmail-send-it
      smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil))
      smtpmail-auth-credentials (expand-file-name "~/.authinfo")
      smtpmail-default-smtp-server "smtp.gmail.com"
      smtpmail-smtp-server "smtp.gmail.com"
      smtpmail-smtp-service 587
      user-mail-address "john@gmail.com" ; make sure to change this
      smtpmail-debug-info t)
Your login credentials are stored in a file named ~/.authinfo. Here is the format:
machine smtp.gmail.com login john@gmail.com password password123
Make sure to replace “john@gmail.com” with your email address and “password123” with your actual password. Also make sure there is no newline after the password.
Then be sure to set restrictive permissions for it:
chmod a-rwx,u+rw ~/.authinfo
Now restart GNU Emacs. You could probably eval-buffer here, but restarting the whole program is what finally got it to work for me.
Now you’re ready to send your first email. Type C-x m to begin composing a new message. Once you’re ready to send it, type C-c C-c (to send and close the buffer) or C-c C-s (to send and keep the buffer).

you are done it will send a mail from your gmail.

Thanks to :
http://ejd.posterous.com/send-email-through-gmail-with-gnu-emacs

Monday, November 22, 2010

Tips and Tricks for Ubuntu after Installation

UbuntuUbuntu is a free operating system or a Linux distribution ("distro") which receives the highest hits on DistroWatch and has been selected by readers of DesktopLinux as the most popular distro. It also gets the highest number of votes in Poll Results on Gizmo's Freeware Forum.
If you have the Ubuntu system which comes with the default Gnome window manager installed in your PC, you might find these tips and tricks useful for working with the system.
Note: The steps described in this article work with Ubuntu 10.10 and Ubuntu 10.04.
 
Panel, Desktop & Window
Drive, System & Software

Tips and Tricks
   Customize the Panel
Ubuntu includes a top panel and a bottom panel by default. If you prefer to keep only one panel at the bottom just like the Windows Taskbar, then these are the steps to follow:
  1. Ubuntu DesktopDelete the bottom panel: right-click over it and click "Delete This Panel".
  2. Move the top panel to bottom: right-click over it, select "Properties" and change Orientation from "Top" to "Bottom".
  3. Add running program buttons: right-click the panel, select "Add to Panel", scroll down and select "Window List", click "Add".
  4. Replace the Menu Bar ("Applications-Places-System") with the "Main Menu" to save space in the panel:
    1. Right-click the "Menu Bar" and select "Remove From Panel".
    2. Right-click the panel, select "Add to Panel" and choose "Main Menu", click "Add".
    3. Right-click the items (Firefox, etc) and untick "Lock to Panel".
    4. Right-click the added "Main Menu", select "Move" to relocate it to the far left. (See Note 1 below)
These are basic changes. The panels are much more flexible than the Windows Taskbar in that many items in the panels can be easily added, removed or configured.
Note 1: The Main Menu shows the "Lock Screen", "Log Out" and "Shut Down" items if you remove the "Indicator Applet Session" item (which shows your username and the shutdown button to the right of the panel). These three items are hidden from the Main Menu when the Indicator Applet Session item is on the panel.
Note 2: If you need to restore the panels to the original state, enter the following commands into the Terminal and re-start the system:
  1. sudo gconftool-2 --shutdown
  2. sudo rm -rf .gconf/apps/panel
  3. sudo pkill gnome-panel

   Set Full Transparent Panel
When you set the panel to be transparent in the default Ambiance theme in Ubuntu 10.10 or 10.04, you will find that some panel items' backgrounds are not transparent, but you can make them transparent and consistent with others, following these steps:
  1. Ubuntu DesktopGo to Applications (or Main Menu) > Accessories > Terminal.
  2. Enter cp -R /usr/share/themes/Ambiance ~/.themes/
  3. Enter gedit ~/.themes/Ambiance/gtk-2.0/apps/gnome-panel.rc (for Ubuntu 10.10) OR gedit ~/.themes/Ambiance/gtk-2.0/gtkrc (for Ubuntu 10.04), to open the file with gedit.
  4. Search for this line bg_pixmap[NORMAL] = "img/panel.png" (for Ubuntu 10.10) OR bg_pixmap[NORMAL] = "panel_bg.png" (for Ubuntu 10.04)
  5. Ubuntu DesktopComment out the line by placing a # at the beginning of the line, like this: #   bg_pixmap[NORMAL] = ...
  6. Save the file.
  7. Go to System > Preferences > Appearance, switch to the other theme and then back to the Ambiance theme.
Note: If you'd like to change to the Radiance theme, replace Ambiance with Radiance in the above command lines, but you'd like to change to the New Wave theme, then enter cp -R /usr/share/themes/"New Wave" ~/.themes/ in step 2, enter gedit ~/.themes/"New Wave"/gtk-2.0/gtkrc in step 3, search for and comment out this line bg_pixmap[NORMAL] = "Images/Panel/PanelBarLong.png" in steps 4 and 5 respectively.

   Customize the Theme
Themes in Ubuntu can be customized to match the applications or suit your needs. I once tried the "New Wave" theme and the menu (File, Edit, View, etc) was hardly visible on the dark background in OpenOffice. These are easy steps to customize a theme, for example, "New Wave" so that the menu can be more visible in OpenOffice.
  1. Customize the ThemeGo To System > Preferences > Appearance.
  2. Under the "Theme" tab, click the "Customize" button while the "New Wave" theme is selected.
  3. Under the "Controls" tab, click any other control item such as "Ambiance" and click the "Close" button.
  4. Now it becomes your Custom theme and you can save it as a new theme, such as "New Wave with Ambiance Controls".
The menu should now be clearly visible in OpenOffice in this new theme (See the lower section in the screenshot).

   Change Font Type and Color of Panel Clock
The font type and color of the panel clock follow the windows text in a theme by default. In particular, if the font color is black and shown on a dark background through a transparent panel, you can't read the clock clearly, but you can tweak it by changing the font color. And you can define the font type for your panel clock as well.
The code in Step 1 below sets the font color to white and applies DS-Digital font (Note 1), bold and size 16.
  1. Panel ClockOpen up the text editor Gedit and paste the following code:
    style "my-panel-clock"
    {
    fg[NORMAL] = "#FFFFFF"
    font_name = "DS-Digital Bold 16"
    }
    widget "*.clock-applet-button.*" style "my-panel-clock"
  2. Save the file as .gtkrc-2.0 (including the dot in front of the filename) inside your home directory /home/your_user_name.
  3. Log out and log back in (OR enter killall gnome-panel into the Terminal) to see the change.
Note 1: The DS-Digital font can be downloaded here. After downloading, unzip the file and install the font into the system for use. See Install Extra Fonts.
Note 2: The filename leading by a dot represents it's a hidden file and visible by toggling the key Ctrl-H in the Nautilus file browser.

   Set Aero Glass Effect
In Ubuntu you can set nearly the same aero glass effect to window borders with alpha transparency as available in Windows 7.
  1. Aero Glass EffectPress Alt+F2 to bring up "Run Application" window.
  2. Type gconf-editor into the box, click "Run" to bring up Configuration Editor.
  3. Browse to apps > gwd, look for "metacity_theme_active_opacity" on the right panel.
  4. Change the value in "metacity_theme_active_opacity" from 1 to 0.75 (or smaller such as 0.5 for more transparency).
  5. Then go to System > Preferences > CompizConfig Settings Manager
  6. Select "Effects" from the left panel.
  7. Tick "Blur Windows" and click the "Close" button. (Note: default values in Blur Windows can be applied.)
Note: If the aero glass effect doesn't work, check if you have updated your display driver. Go to System > Administration > Additional Drivers, activate the recommended graphics driver and restart the system.

   Pin Programs to the Panel
Frequently used programs can be easily pinned to the panel.
  1. Browse to the program from "Applications" or "Main Menu".
  2. Drag and drop the program to an empty space in the panel, or right-click the program and select "Add this launcher to panel".
  3. Right click the program icon, select "Move" and drop it to a new place in the panel.
  4. Right click the program icon and select "Lock to Panel".
See also "Enable Windows 7 Superbar".

   Add or Change Keyboard Shortcuts
Keyboard shortcuts are preset in the system, but you can add new ones or change them easily. For instance, change the default shortcut Ctrl+Alt+T (Run a Terminal) to Win+R (press R while holding down the Windows key, also known as Super key) by the following steps:
  1. Keyboard ShortcutsGo To System > Preferences > Keyboard Shortcuts
  2. Browse to Desktop > "Run a terminal"
  3. Click on the Shortcut, and it shows "New shortcut..."
  4. Press Win+R, and it shows Mod4+R
  5. Click the Close button and try the new shortcut.
Note 1: To disable a shortcut, press Backspace when it shows "New shortcut..." after the step 3 above.
Note 2: Shortcuts begin with XF86 refer to special keys available to some multimedia keyboards.
Note 3: Keyboard shortcuts can also be set by changing keybinding values with Configuration Editor. Press Alt+F2 and enter gconf-editor, then navigate to apps > gnome_settings_daemon > keybindings, or apps > metacity > global_keybindings and window_keybindings.

   Hide Drive Icons on the Desktop
Ubuntu adds an icon to the desktop for every removable drive that you attach to your system. The icons can be hidden by these steps:
  1. Press Alt+F2 to bring up "Run Application" window.
  2. Type gconf-editor into the box, click "Run" to bring up Configuration Editor.
  3. Browse to apps > nautilus > desktop.
  4. Untick "volumes_visible" and close the window.
The drive icons would then disappear from the desktop. Remember that you can always access the drives from "Places".

   Move Window Control Buttons to the Right
If your Ubuntu system sets the Minimize, Maximize and Close buttons to the left in a window and you prefer to change them to the right, then follow these simple steps:
  1. Move buttons to rightPress Alt+F2 to bring up "Run Application" window.
  2. Type gconf-editor into the box, click "Run" to bring up Configuration Editor.
  3. Browse to apps > metacity > general, look for "button_layout" on the right panel.
  4. Change the value in the "button_layout" from close,minimize,maximize: to menu:minimize,maximize,close and press the Enter key.

   Set a Default View in File Browser
Windows Explorer allows for users to set a default view to all folders. In almost the same way, Ubuntu's Nautilus File Browser allows for these settings:
  1. Set File BrowserGo to "Places" and open a folder.
  2. At the top of the File Browser, click "Edit" and "Preference".
  3. Under Default View, change "Icon View" to "List View", to see more details in columns.
  4. Tick "Show hidden and backup files" if that's your choice.
Other various settings, such as single or double click to open items, icon captions, list columns, preview files and media handling can be done in the same window as well.

   Open Up a Window in Center
When running an application without maximized, Ubuntu always puts it in the left-top corner of the desktop by default, but you are allowed to set a program window to open up in the center of the desktop area.
  1. CompizConfig Settings ManagerGo to System > Preferences > CompizConfig Settings Manager
  2. Select "Windows Management" from the left panel.
  3. Click "Place Windows".
  4. Change Placement Mode from "Smart" to "Centered", click "Back" and "Close".
Ideally, the window manager in Ubuntu should restore the last known position of an application window, but it does not do that unless an application remembers its own window position. (See reported bugs)

   Enable "Rotate Cube" Effect
Ubuntu enables "Desktop Wall" by default. By holding Ctrl-Alt keys and pressing the left-arrow or right-arrow key each time, it slides through desktop workspaces horizontally for you to choose one to work on. Alternatively, you can change this to a "rotate cube" effect.
  1. Rotate CubeGo To System > Preferences > CompizConfig Settings Manager
  2. Select "Desktop" from the left panel.
  3. Tick "Rotate Cube".
  4. Select "Eable Desktop Cube" as this plugin is required by "Rotate Cube".
  5. Select "Disable Desktop Wall".
Immediately you can rotate your desktop workspaces in this way— holding down Ctrl-Alt keys, EITHER press the left-arrow or right-arrow key OR left-click the mouse and drag it to left or right.

   Enable Windows 7 Superbar
In Windows 7, frequently used programs can be pinned to the taskbar (hence called Superbar). Likewise, DockBarX, a Gnome panel plugin, can be added to Ubuntu to achieve almost the same effect to pin and unpin or launch the applications from the panel.

  1. DockBarX AppletGo to Ubuntu Software Center > Edit > Software Source.
  2. Select "Other Software" and click "Add"
  3. At APT line, enter ppa:dockbar-main/ppa, click "Add Source" and "Close"
  4. At the left panel of Ubuntu Software Center, select "PPA for Dockbar Main Group", which is added after the above steps
  5. At the right panel, select DockbarX and click "Install"
  6. Right click the panel and click “Add to Panel”.
  7. Select the DockBarX Applet and click "Add".
Note: A thumbnail preview of a running program is also available to DockBarX. To enable this feature, right-click the DockBarX item on the panel, select Properties, choose Window List and tick "Show Previews". Other preferences such as appearance, window item and group button can also be configured by users.

   Enable Windows 7 Aero Snap
In Windows 7, you can click and drag a window to the left or right edge of the desktop and it will fill half of the screen, or snap a window to the top edge of the desktop and it will be maximized.
In Ubuntu, you can click and drag a window to the left, right or top edge of the desktop to achieve the same result.
  1. In addition to CompizConfig Settings Manager, install WmCtrl if not added.
    1. Go to Applications (or Main Menu) > Accessories > Terminal.
    2. Enter sudo apt-get install wmctrl
    3. Enter password when prompted.
  2. Go To System > Preferences > CompizConfig Settings Manager.
  3. Select "General" from the left panel and click "Commands".
  4. In Command line 0, 1 and 2, paste the following codes:
    1. Command line 0, paste WIDTH=`xdpyinfo | grep 'dimensions:' | cut -f 2 -d ':' | cut -f 1 -d 'x'` && HALF=$(($WIDTH/2)) && wmctrl -r :ACTIVE: -b add,maximized_vert && wmctrl -r :ACTIVE: -e 0,0,0,$HALF,-1
    2. Command line 1, paste WIDTH=`xdpyinfo | grep 'dimensions:' | cut -f 2 -d ':' | cut -f 1 -d 'x'` && HALF=$(($WIDTH/2)) && wmctrl -r :ACTIVE: -b add,maximized_vert && wmctrl -r :ACTIVE: -e 0,$HALF,0,$HALF,-1
    3. Command line 2, paste wmctrl -r :ACTIVE: -b add,maximized_vert,maximized_horz
  5. In the same window, click "Edge Bindings" tab.
  6. Change Run Command 0, 1 and 2 from "None" to "Left", "Right" and "Top" respectively.
  7. Click "Back" button and select "General Options", change "Edge Trigger Delay" to about 500.

   Auto Mount Drives at System Startup
Ubuntu is capable of reading and writing files stored on Windows formatted partitions, but partitions must be 'mounted' before they can be accessed each time you start up the system. With these steps, you can auto mount the drives or partitions without the need to manually mount them for access.
  1. Storage Device ManagerInstall Storage Device Manager if it has not been added.
    1. Go to Applications (or Main Menu) > Ubuntu Software Center.
    2. Enter pysdm in the Search Box.
    3. Select Storage Device Manager, click the "Install" button.
  2. Go to System > Administration > Storage Device Manager.
  3. Extend the list of sda and select the sda you want to auto mount, click 'OK' to configure.
  4. Click the "Assistant" button.
  5. Uncheck "Mount file system in read only mode" and keep "The file system is mounted at boot time" checked.
  6. Click the "Mount", "Apply" then "Close" button, and restart the system.
If you can't link a partition's label to a device, go to System > Administration > Disk Utility, select a drive and click a partition to find out its label and device.
In case you wish to remove the auto-mount of a certain drive or partition, you can similarly use Storage Device Manager to do the setting.
Note: In the background, Storage Device Manager follows your setting to edit the configuration file /etc/fstab which contains the necessary info to automate the process of mounting partitions. (See Introduction to fstab)

   Manually Mount a USB Drive
A USB storage device plugged into the system usually mounts automatically, but if for some reasons it doesn't automount, it's possible to manually mount it with these steps.
  1. Go to Applications (or Main Menu) > Accessories > Terminal.
  2. Enter sudo mkdir /media/usb to create a mount point called usb.
  3. Enter sudo fdisk -l to look for the USB drive already plugged in, let's say the drive you want to mount is /dev/sdb1.
  4. Enter sudo mount -t vfat /dev/sdb1 /media/usb -o uid=1000,gid=100,utf8,dmask=027,fmask=137 to mount a USB drive formatted with FAT16 or FAT32 system. OR:
    Enter sudo mount -t ntfs-3g /dev/sdb1 /media/usb to mount a USB drive formatted with NTFS system.
To unmount it, just enter sudo umount /media/usb in the Terminal.

   Enable Media Playback
Ubuntu only includes completely free software by default and does not configure proprietary media formats such as mp3 and mp4 'out of the box'. The required codecs however can be easily installed for the default player to playback these files following a few simple steps below.
  1. Double click an mp3 file in a folder.
  2. Click "Search" button when the the default player shows up with a "Search for suitable plugin?" window.
  3. Click the "Install" and "Confirm" buttons to download and install the restricted software.
  4. Restart the player after the package files are installed.
You might need to do the same for other restricted media formats such as mp4 too.

   Set Sound Output
When I first installed Ubuntu onto a PC with an integrated audio device and tried to play a media file on a player, it had no sound. I tried these simple steps in setting Sound Preferences and then it had sound. It works for me for the audio device I have.
  1. Go to System > Preferences > Sound to bring up the Sound Preferences window.
  2. Under the Hardware tab, change Profile to Analog Stereo Duplex from the drop-down menu.
  3. Under the Output tab, change Connector to Analog Output (LFE)/Amplifier from the drop-down menu.
As the items available from the drop-down menus might differ depending on the hardware devices detected by the system, you might want to try other items in the menus to see if they work for your devices. It might also help to check out the steps in Sound Troubleshooting from the Ubuntu Documentation.
Playing a media file in a proprietary format on a player might also have no sound if the required codecs are not installed. In this case, see Enable Media Playback in this article.

   Disable or Change Login Sound
Each time when you login to Ubuntu, it plays a login sound. If you don't like to listen to it each time you login, you can easily disable it, or you can even change it to your favorite sound.
To disable the login sound:
  1. Go to System > Preferences > Startup Applications.
  2. Under the "Startup Programs" tab, untick "GNOME Login Sound"
  3. Click Close
To change the login sound, tick the above "GNOME Login Sound" if it's unticked, then follow these steps:
  1. Press Alt+F2 to bring up "Run Application" window.
  2. Paste gksu nautilus /usr/share/sounds/ubuntu/stereo into the box, click "Run" to open Nautilus in the right folder.
  3. Rename the original file desktop-login.ogg to another such as desktop-login-original.ogg for backup
  4. Copy your sound file in ogg format to the above folder and name the file as desktop-login.ogg
  5. Log out and log back in to listen to the new login sound.

   Terminate Unresponsive Programs
Xkill is part of the X11 utilities pre-installed in Ubuntu and a tool for terminating misbehaving X clients or unresponsive programs. You can easily add a shortcut key to launch xkill with the steps below.
  1. xkillGo to System > Preferences > Keyboard Shortcuts.
  2. Click the Add button to create a custom shortcut.
  3. Enter xkill to both the Name and Command boxes and click the Apply button.
  4. Click on Disabled at the xkill row in the Keyboard Shortcuts window (Disabled is then changed to New shortcut...).
  5. Press a new key combination, e.g. Ctrl+Alt+X (New shortcut... is then changed to Ctrl+Alt+X).
  6. Click the Close button.
Xkill is ready for use. Press the above key combination to turn the cursor to an X-sign, move the X-sign and drop it into a program interface to terminate the unresponsive program, or cancel the X-sign with a right-click.

   Change Default Boot Options
After full installation, Ubuntu is set to be the default operating system to boot up if no key is pressed within a few seconds on a multi-boot system. You might want to set your preferred operating system to boot up by default. This can be done easily with StartUp-Manager.
  1. StartUp-ManagerGo to Applications (or Main Menu) > Accessories > Terminal.
  2. Enter sudo apt-get install startupmanager (OR copy the highlighted code and, in the Terminal, press Ctrl-Shift-V to paste it).
  3. Enter password used upon installation of Ubuntu.
  4. Go to System > Administration > StartUp-Manager
  5. Enter the same password to perform pre-configuration tasks, which include searching bootloaders to operating systems.
  6. Select the default operating system from the pull-down menu, click "Close" to perform post-configuration tasks.
With StartUp-Manager, you can also do others such as manage Usplash themes, adjust bootloader menu resolution or set timeout in seconds. Avoid changing timeout to 0 seconds if you need to select a system to boot up from a multi-boot menu.

   Remove Old Linux Kernel, Clean Up Boot Menu
Each time when Ubuntu updates to a new Linux kernel, the old one is left behind and the boot menu gets longer. If your new Linux kernel works well, it's safe to remove the old one and clean up the boot menu. Do take these steps carefully as incorrect removal of the items can make your system unbootable.
  1. Go to Applications (or Main Menu) > Accessories > Terminal.
  2. Enter uname -r to print the Linux kernel version you're running (e.g. 2.6.32-22-generic).
  3. Go to System > Administration > Synaptic Package Manager.
  4. Click Status from the left panel and select Installed.
  5. Enter the main version number (e.g. 2.6.32) in the Search box.
  6. Right-click the items with smaller sub version number (e.g. 2.6.32-21) for older Linux kernel and select Mark for Complete Removal. The files for the older version to remove may include linux-headers-2.6.32-21, linux-headers-2.6.32-21-generic and linux-image-2.6.32-21-generic.
  7. Click Apply from the top panel.
  8. Click Apply again from the pop-up window to confirm removal of the marked packages. The boot menu will be cleaned up automatically after the removal is confirmed.

   Auto Shutdown the System
A simple command can be entered in the Terminal to schedule a time for the system to shut down.
  1. Go to Applications (or Main Menu) > Accessories > Terminal.
  2. Enter sudo shutdown -h +m (replace m with the number of minutes, e.g. +60).
    OR: enter sudo shutdown -h hh:mm (replace hh:mm with the time on the 24hr clock, e.g. 23:15).
  3. Enter password and minimize the Terminal window.
The system will then shut down within the minutes or at the time specified. To cancel a scheduled time, enter sudo shutdown -c in the Terminal.
GShutdown is a GUI program for scheduling a time to shutdown the system but the current version 0.2 is noted not working well in the newer Ubuntu system.

   Install Extra Fonts
Do you prefer Windows TrueType fonts to the default fonts installed by Ubuntu? The mscorefonts package containing most Microsoft fonts can be installed and configured easily in a few steps below:
  1. Ubuntu Extra FontsGo to Applications (or Main Menu) > Accessories > Terminal.
  2. Paste sudo apt-get install ttf-mscorefonts-installer into the Terminal (by pressing Ctrl-Shift-V in the Terminal after copying the highlighted code).
  3. Go to System > Preferences > Appearance > Fonts.
  4. Click each of them, pick a font and size to configure for window title and so on.
How about installing more TrueType fonts? With your font files, you can manually add them into the system following the steps below:
  1. Press Alt+F2 to bring up "Run Application" window.
  2. Paste gksu nautilus /usr/share/fonts/truetype into the box, click "Run" to open Nautilus in the right folder.
  3. Create a new sub-folder and copy your files ending with .ttf into the sub-folder.
  4. Enter sudo fc-cache -f -v in the Terminal to rebuild the font information.
Besides this, you can run an application such as Font-Manager to view, install, remove fonts and so on.
Note: If you like the Tahoma font which is not included in the mscorefonts package, you might want to copy the two files tahoma.ttf and tahomabd.ttf from /Windows/Fonts and install them.

   Install Screenlets
Screenlets are small applications to represent things such as sticky notes, clocks, calendars around on your desktop. You can launch a pre-installed screenlet from Screenlet Manager, or install a new one into the Manager for launching it. Here are the steps for installing and launching a screenlet, for example, WaterMark System Information.
  1. WaterMark ScreenletInstall Screenlets Manager if it has not been added.
    1. Go to Applications (or Main Menu) > Ubuntu Software Center.
    2. Enter screenlets in the Search Box.
    3. Select Screenlets, click the "Install" button.
  2. Download the screenlet "WaterMark System Information" to a folder.
  3. Go to Applications (or Main Menu) > Accessories > Screenlets.
  4. Click Install, select Install Screenlet and click OK.
  5. Browse to the folder, select the file downloaded and click "Open" to install the screenlet into the Screenlets Manager.
  6. Select the screenlet "WaterMark" and click "Launch/Add". (Tips: you can add more than one WaterMark screenlet and set it to display other system information.)
More screenlets are available for installation from screenlets.org.

   Install Sun Java Packages
Ubuntu uses OpenJDK by default, but I note that some web services such as ezyZip.com might need the Sun Java Runtime Environment (JRE) to be installed in the system for running the services properly. If you would like to get the proprietary Sun Java packages for your system, you can download and install them from the Canonical Partner Repository with the steps below:
  1. Go to Applications (or Main Menu) > Accessories > Terminal.
  2. Enter sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner" to add the partner repository.
  3. Enter sudo apt-get update to update the source list.
  4. Enter sudo apt-get install sun-java6-jre sun-java6-plugin sun-java6-fonts to download and install the Sun Java packages. (If asked to accept the Distributor License for Java (DLJ) terms, use the left/right key to navigate and select Yes, then press the Enter key for installation).
  5. Enter sudo java -version to check the version of the Java used in the system.
  6. Enter sudo update-alternatives --config java to choose the default Java for use in the system when necessary.

   Install More Useful Software
Ubuntu Software Center lets you search and get free software. If an application you need is not included in the Center, you can go to System > Administration > Synaptic Package Manager, type in an application name to search and install a software package from the repositories.
Alternatively, you can get the latest freeware applications by clicking the Install this now button from the GetDeb Repository after the getdeb package is installed with the instructions given.
See also our Best Free Software for Linux.

Note
CompizConfig Settings Manager (ccsm), if not added yet, can be installed this way:
  1. Click "Applications" (or "Main Menu"), select "Ubuntu Software Center".
  2. Type ccsm into the Search box.
  3. Select "Advanced Desktop Effects Settings (ccsm)" and click the "Install" button.
  4. Enter the password used upon installation of Ubuntu.

Thanks to:
http://www.techsupportalert.com/content/ubuntu-tips-and-tricks.htm