Friday, December 26, 2008

Install and Configure Ubuntu 8.10

Recently, I got a used desktop which would be used as linux server. I installed Ubuntu 8.10. The installation was easy. I downloaded the Ubuntu .iso file and burned it to a CD. Then just installed Ubuntu using the CD.

Vim upgrade
By default, Ubuntu just installed vim-tiny whose functionalities may not satisfy end user's requirements. For example, opening a directory using vim-tiny would fail rather than list all files in the directory in vim. So I installed vim-full which includes all vim features using this command:
sudo apt-get install vim-full
Then usually vim is configured to meet user's specicial requirements. In my case, the configuration file $HOME/.vimrc looks like:

set tabstop=4
set shiftwidth=4
set wrapmargin=8
set smartindent	"smart indentation
set expandtab  	"expand tabs to spaces
set ruler 		"display ruler on bottom right corner
set nu			"display line number
set incsearch	"turn on incremental search
set hlsearch		"highlight search result

:colorscheme ron 
:filetype indent on		"enable special indentation rules according to file type.

"highlight the 81-th character in each line
au BufEnter * ":/\%81c"
"in default configuration, textwidth option is set
"so I want to override the default value.
au BufRead * set tw=0

"when you open a file, cursor is moved to previous position when you edited the file last time.
au BufReadPost * if line("'\"") > 0|if line("'\"") <= line("$")|exe("norm '\"")|else|exe "norm $"|endif|endif

:syntax on		"turn on syntax detection and highlight
"stop cursor blinking. Only available when compiled with GUI enabled,
"and for MS-DOS and Win32 consol
set guicursor=a:blinkon0

All available options of vim can be read here: http://www.vim.org/htmldoc/index.html

Browser
Firefox is installed by default which is the default web browser. Several addons were installed manually.

Tab Mix Plus Tab browsing with added boost.
All-in-One gestures Support mouse gestures.
 
Firebug Web development Evolved
RestTest

Allow users to send HTTP requests with customized heads and data.

Poster

A developer tool for interacting with web services and other web resources that lets you make HTTP requests, set the entity body, and content type.
Similar to RestTest. But Poster works on FF3 while RestTest does not.

HttpFox An HTTP analyzer
Web Developer Adds a menu and a toolbar with various web developer tools
 
FireShot Take a screenshot and edit it
Google Notebook Firefox addon for google notebook application
QuickRestart Add a "Restart Firefox" item to the "File" menu.
MenuEditor Customize application menus
FlashGot Enables single and massive downloads using external download managers. This addon itself is not a download program.

Terminal configuration
I like "green on black" color theme.

Keyboard shortcuts
Click System -> Keyboard Shortcuts to display the shortcut setting dialog. Shortcuts I use very often include:
Super + s     #start a terminal
Super + m    #toggle maximization state
Super + n     #minimize window
Ctrl+Alt+L    #lock screen
Alt + F2       #Show run application dialog
Alt + Tab     #switch between different windows
Ctrl + Alt + Left/Right/Up/Down    #switch to different workspaces

Following serveral shortcuts are available only after you install compiz and enable corresponding components.
Super + E      #Expo key
Super + Tab  #another window switcher
Super + leftclick    #move the window

Wireless network configuration
Wired network connection is established successfully. However, after I moved my desktop, it is not close to the router and I don't want to connect them using a cable.
I have a D-Link System AirPlus G DWL-G122 Wireless USB Adapter. After I plugged it in, I used command lsusb to see whether the device was detected.  It was detected but it did not work. Obviously, a driver is needed to make it work. I read this post: https://help.ubuntu.com/community/WifiDocs/Driver/Ndiswrapper. It states

D-Link DWL-G122 USB Wireless device: As of December 2008, Ubuntu 8.10 provides full 'out of the box' support for this device, using the rt73usb driver. In this case, there is no need to use ndiswrapper at all and there is no need to make any changes to the default /etc/modprobe.d/blacklist file."

But on my machine, the wireless adapter still did not work even after the module rt73usb was loaded. I guess the reason is that the device mentioned in the manual and my device are different although they seem the same.
Then I followed the instructions on post https://help.ubuntu.com/community/WifiDocs/Driver/Ndiswrapper and it worked well.
Network manager is a convenient tool to configure your network.
http://projects.gnome.org/NetworkManager/
https://help.ubuntu.com/community/NetworkManager

Network Management
Some packages and their useful commands to manage network devices

Supported commands by package "net-tools":
ifconfig: configure the kernel-resident network interfaces.

Supported commands by package "wireless-tools":
iwconfig: it is dedicated to the wireless interfaces. It can be used to set the parameters of NIC which are specific to wireless connection.
iwlist: display additional information from a wireless NIC. "iwlist scan" returns a list of available wireless networks.

Supported commands by package "network-manager":
NetworkManager: network management daemon.
nm-tool: utility to report state of network manager in text mode.
nm-system-settings:

Supported commands by package "network-manager-gnome":
nm-applet: a graphical networkmanager applet. It displays an icon in notification area(usually at top right corner) for managing network devices and connections. Usually, it is started up automatically when the system boots up.
nm-connection-editor: display a graphcial connection configuration tool.

Supported commands by package "gnome-nettool":
gnome-nettool : GNOME network tools. This tool can be used to display detailed network information.

gnome-network-preference : Set network proxy preferences

Compiz window manager
A good reference: https://help.ubuntu.com/community/CompositeManager/CompizFusion
Compiz provides some very cool features I like.
Use command ccsm to display CompizConfig Settings manager.
More shortcuts:
Super + E             #Expo key. supported by "Expo" component.
Super + Tab          #another window switcher. supported by "Shift Switcher" component and "Ring Switcher" component.
Alt + left-button    #move the window. supported by "Move Window" component.
Alt + mid-button   #resize the window. supported by "Resize Window" component.

Input Method
To input Chinese, I added Chinese language support. Executing command "gnome-language-selector" would display "language support" dialog and you can select any language in the list you want to use. Releated packages are installed automatically.
SCIM (smart comman input method) is installed by default. Try command "scim-setup" to configure scim. Use command "im-switch -z en_US -s scim" to switch input method to scim. Then restart X. scim would be started automatically.
Also you can manually start scim using command "scim -d".
To make the lookup table follow the cursor, in scim setup dialog uncheck
FrontEnd -> Global Setup -> Embed Preedit String into client window
and
Panel -> GTK -> Embedded lookup table

Misc. Useful packages I installed:
(*) sudo apt-get install gnome-device-manager
As its name implies, it is a device manager with GUI. Then it can be accessed by clicking Applications->System Tools -> Device Manager.
(*) Totem is installed by default which is a video player.
(*) sudo apt-get install vlc  #vlc player
Also, I tried to find a video player in Ubuntu repositories which can play .rm and .rmvb files. None of vlc, Kmplayer and mplayer can do that job. It seems that the main problem is license which means including real codec is illegal. Finally I downloaded linux version of realplayer from official real web site and installed it successfully.
(*) sudo apt-get install sun-java6-jdk  #jdk 6
Then use update-alternatives --config java to set default java executable.
(*) Package "Transmission" is installed by default which is a BitTorrent client program.
(*) sudo apt-get install deluge-torrent (a bittorrent client)
(*) sudo apt-get install d4x (a download manager)
(*) sudo apt-get install gwget (another download manager)

More tips
How to take screenshots: http://tips.webdesign10.com/how-to-take-a-screenshot-on-ubuntu-linux
How to view btchina in Linux?
http://mozilla.sociz.com/viewthread.php?tid=2367
First install greasemonkey addon and then install the script at http://userscripts.org/scripts/show/33286 (click the button "Install" at top right corner). After successful installation, you can set the options of the script by clicking Tools->GreaseMonkey->User Script Commands -> option-here.
If you use FireFox on Windows, addon IETab can be used.
Flashget on Linux?
Candidates: gwget and WebDownloader for X (d4x) (can be installed from Ubuntu repositories). wxDownload Fast and trueDownloader(maybe must be installed from source).
Pick the ones you like from this list http://en.wikipedia.org/wiki/List_of_download_managers.
How to configure multiple versions of a program?
use utility update-alternatives.

No comments: