To do list:
 - truecrypt
 - resolve ssh over local wireless network
 - evolution incoming email notifier
 - pdf viewer, editor
 - imaging hard disk using "dd"
 - windows fonts
 - trowser -- extended less command with color text display 

Installation and configuration of Ubuntu 10.04 - June 2010
==========================================================

Install the ubuntu desktop version (32-bit) on a PC x86 
with erase hard disk option (all previous partitions gets deleted)

For dual boot installation (installing Ubuntu on a Windows system as
an additional operating system), seek professional guidance, backup your system
(hard drive) to an external disk, and plan the installation process carefully.
If you have a spare internal disk, you may install Ubuntu on that drive.
Otherwise, create two additional partitions on the primay disk as below:
Boot the system using GParted-Live CD and perform the following steps:
 - reduce the size of the Windows partition to create space for new partitions
 - create a new partition (to the right of Windows partition) of any size > 10GB
    for Linux system and user file. Choose ext4 as the format for this partition
    Note you can access (both read & write) Windows files from Linux
    but Linux (ext4) cannot be read from Windows.
    Files that need to be shared by both operating systems, need to be placed
     in the Windows (NTFS) partition
 - create the last partition at the right end of the disk for the Linux swap
    parition. Choose "swap" as the format for this partition.
    The recommended size for this partition is twice the size of the main memory
Apply all these operations and make sure that Windows work correctly.
Then install Ubuntu and carefully choose the installation options.

Login as the first user,
- customize panel
   bring the panel to the bottom
   move icons from the status panel to the bottom panel
   delete the empty status panel
   add to panel "Window List"
   drag Applications>Accessories>Terminal to the panel

- connect to the wireless network
  connect to hidden wireless network, network name, WPA PS2 Personal, passphrase
  Firefox, customize (small icon, newtab, copy, print
  Edit Preferences: home page, download

- Start a terminal session, and test  sudo command as
	sudo bash
	sudo -i
	sudo /etc/crontab
- If there is a problem due to unresolved hostname for sudo commands,
  reboot in recovery mode as root
  cd /etc
  vi hostname  [ensure that only onle line is present with the name of this pc]
  vi hosts [replace the first two lines with the following three lines]
	127.0.0.1	localhost name_of_this_pc
	127.0.1.1	name_of_this_pc
  You may add additional lines with ipaddress-servername pairs here

  save these files and reboot

- To hide login usernames,
    sudo -i
    gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.mandatory --type Boolean --set /apps/gdm/simple-greeter/disable_user_list True
    restart the computer

- To move the window control buttons to the right,
    gconftool-2 --set /apps/metacity/general/button_layout --type string “:maximize,minimize,close,”

- To move the window control buttons to the left,
    gconftool-2 --set /apps/metacity/general/button_layout --type string “menu:maximize,minimize,close,”

- To change the window title bar color,
    System > Preferences > Appearance  (Clearlooks)

- To change the background color of the panel,
    RClick on the panel > Properties > Background > Solid color

- Terminal:
	Edit > Profiles... > Default > Edit
		General > Font: Courier 10 Pitch  Regular 18 > OK
		Colors: Text color R:255 G:170 B:0 OK 
			Background color R:0 G:0 B:0 OK
              Add/create a new profile (Classroom)
		General > Font: Courier 10 Pitch  Regular 18 > OK
		Colors: Text color R:0 G:0 B:0 OK 
			Background color R:255 G:255 B:255 OK
	Close
        To open a new terminal with Classroom profile,
	   start a terminal (default profile),
		File -> Open Terminal -> Classroom
		delete the parent terminal window

- File browser
  Edit - Preferences:
	Views - List View, 
	Behavior - Single click, View executable text files

- System - Administration - Users and Groups
  sudo vi /etc/group  and  /etc/passwd
  create users & groups
  delete group names that are unused (same as usernames)

# The next step is applicable only if you would access samba files
#   from other servers
- mounting samba shares
  sudo apt-get install smbfs
  Create one directory for each smb share in /net (e.g. music)
  create /usr/local/bin/smbshares script
  Add the following line to /etc/sudoers
   %family ALL=NOPASSWD: /bin/mount, /bin/umount, /sbin/mount.cifs, /sbin/umount.cifs 
 
- ?hold:  sudo apt-get install vim

- vpn.cs.fiu.edu (FIU-SCS), username, password, 
  Advanced... select MSCHAP, MSCHAPv2, and 
  enable "Use Point-to-Point encryption (MPPE)"

- remote desktop to office desktop
  Applications -> Internet -> Terminal Server Client
   General
     Computer: remoteWindowsSystemName
     Protocol: RDPv5
     User Name, Password, Domain: AD
   Display
     select "Operate in full screen mode"
   Local Resources
     enable "Add my local drive to the remote computer"
   Save As -> remoteserver-win
  use ctrl-alt-Enter to toggle between Full Screen and regular window
   then minimize to access local windows
  In the remote screen, to access local file system
   from Windows explorer,
     My Network Places -> Entire Network -> Microsoft Terminal Services ->
	\\tsclient\Local\ ...

- rdesktop jupiter
  creating a(tunnel)
    [ see http://www.revsys.com/writings/quicktips/ssh-tunnel.html ]
    ssh -i /privateKeyPath -L localhost:5999:serverName:9999 -p9999 -l username serverName
   Linux putty for tunnel
    SSH -> Auth -> specify puttyjupiter file
    SSH -> Tunnels -> Source port: 5999  Destination: 127.0.0.1:5999   
    Do NOT include username along with the host name.
    To include automatic login name specify it under  Connection -> Data -> Auto-login username 
   vi /etc/ssh/ssh_config
      GSSAPIAuthentication no

  System -> Administration -> Synaptic Package Manager
	installed xtightvncviewer 1.3.9-6
	installed flashplugin-installer 10.1.53.64ubuntu0.10.04.1
     To start the Rdesktop session from a local terminal session (or create a application launcher),
	/usr/bin/vncviewer localhost:99
    [ http://pwet.fr/man/linux/commandes/xtightvncviewer ]

- GUI scp
   Run the following commands only one time to register authentication for each boot session
      ssh-add -D
         to remove all identities stored in the system
      ssh-add /home/user/cygwinjupiter
   Nautilus (Gnome file browser): File -> Connect to Server ->  
     for SCIS U: drive,
       Service type: SSH, Server: ocelot.aul.fiu.edu,
       Folder: /homeFolderPath
       check Add bookmark, Bookmark name: U_SCIS
       Connect
      for subsequent connections, click on U_SCIS on the left pane.
     For J_Ext
       Service type: SSH, Server: jupiterExt
       Port: 9999
       Folder: /homeFolderPath
       Uername: username
       check Add bookmark, Bookmark name: J_Ext
       Connect
      for subsequent connections, click on J_Ext on the left pane.
     Similarly, create J_Int folder (with server as jupiter)

- email client (evolution)(Edit -> Preferences -> choose account -> Edit/Add)
  http://www.gnome.org/projects/evolution 
  http://www.go-evolution.org/FAQ
  FIU-SCIS
    Receiving Email: IMAP, imap.cis.fiu.edu, no encryption
    Receiveing Options: Under Folders
     enable both "Show only subscribed folders" & "Override server namespace"
     Namespace: mail
    Sending Email: SMTP, smtp.cs.fiu.edu,
	enable "Server requires authentication", SSL encryption,
	Authentication Type: Login, Username: usernamestring
    Defaults: change the Drafts and Sent folder settings for account specific folders.
  Gmail
    Receiving Email: IMAP, imap.gmail.com, SSL encryption,
    Sending Email: SMTP, smtp.gmail.com,
	enable "Server requires authentication", SSL encryption,
	Authentication Type: Login, Username: usernamestring   
    Defaults: change the Drafts and Sent folder settings for account specific folders.

- Display configuration for projector
  System -> Preferences -> Monitors
    enable "Show monitors in panel"
    set Resolution: 1280 x 800 (local use), 1024 x 768 (projector), Apply

- customize aliases in ~/.bash_aliases
    comment out Alias "return" that includes "vi" - interferes with file completion feature
  include the following five aliases
  alias jint='ssh -p9999 -l username jupiter'
  alias jext='ssh -p9999 -l username jupiterExt'
  alias ocelot='ssh -l username ocelot.aul.fiu.edu'
  alias mapshares="/usr/local/bin/smbshares your_smbusername"
  alias rmshares="/usr/local/bin/rmshares"

- customize the prompt string PS1 as below:
   sudo vi /etc/profile
	replace 15th line as
	PS1='\u@\h:\w \!\$ '
   sudo vi /etc/bash.bashrc
	replace 21st line as
	PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w \!\$ '
   vi ~/.bashrc
	uncomment line 39  "force_color_prompt=yes"
	edit lines 53 and 55 to include "\!"
        see http://www.linux.com/archive/feature/113860 for color codes

- KMyMoney
  sudo apt-get install kmymoney2
  export Loose QIF files from the previous Microsoft Money software
  and import them in KMyMoney application

- Rhythmbox
  copy all mp3 songs repository (2.5GB) to /local folder
  Edit -> Preferences -> General -> Visible columns (choose ONLY "Time")   
  Install necessary plugins
   play  /local/MP3/LinuxPlayLists 
  sudo apt-get install tagtool
    to edit ID3 tags of mp3 files

- Chrome browser
  sudo add-apt-repository ppa:chromium-daily/ppa
  sudo apt-get update
  sudo apt-get install chromium-browser
   Chrome extensions:  NPR: News, Music and Books; Forecastfox Weather; Google Tasks by OpenBit;
     Countdown by mermin; FreshStart (Session Manager) by Visibotech; Web2pdf converter; Stock Tracker by Charlesblee;
     Docs PDF/PowerPoint Viewer (by Google) by wescarr@google.com; Google Dictionary (by Google)

  http://ubuntuguide.net/how-to-install-chromium-google-chrome-browser-in-ubuntu-10-04

- Configure papermill printers at FIU 
	System -> Administration -> Printing -> Add -> Printer
	  Network printer -> Find Network Printer -> Host: papermill -> Find
		Host: papermill   Queue: printers/printername  -> Verify -> Forward

# The following plugin is ok but not that great
- gedit text editor
    vigedit plugin: http://blog.tsmacdonald.com/archives/312
    Install this as a regular user
	mkdir ViGedit
	bzr branch http://bazaar.launchpad.net/~tristil/vigedit/main-method
	cd main-method/
	python install.py
     Start gedit -> Edit -> Preferences -> Plugin tab -> enable ViGedit -> Close

- apt-get install xchm
  copy all ComputerScienceAndTech repository (4.2GB) to /local/ComputerScienceAndTech folder

- sudo apt-get install bouml
  UML  modeling tool
  see http://mahmudahsan.wordpress.com/

- Configure wireless interface for wlan0
  ...

- Fixing ssh over wireless connection on home network
  aptitude search '~i'
  dpkg --list | grep ss
  apt-get remove openssh-client
  apt-get install openssh-client
  System -> Administration -> Update Manager ...

Keyboard shortcuts:
 To erase memory and reboot
	ctrl-prtsc-reisub  (hold ctrl + prtsc and type reverse of busier)
 check with tsclient (Applications -> Internet -> Terminal Server Client)
 To check badblocks on a hard disk
	badblocks -s -v -w /dev/hda
	badblocks -b 4096 -c 49152 -w -s /dev/hda1

============================== Previously used commands =======================

use the command "apport-collect bug-number" to submit the system error details through a browser.

*** The following section was not used.
  /etc/gdm/PostSession/Default is called directly after graphical LOGOUT.
  See https://lists.ubuntu.com/archives/ubuntu-uk/2008-May/012702.html
  Insert "/usr/local/bin/rmshares" command
    inside /etc/gdm/PostSession/Default 
  
  To prevent CIFS from hanging during shutdown,
    execute the following two commands only one time:
       sudo update-rc.d -f umountnfs.sh remove
       sudo update-rc.d umountnfs.sh stop 15 0 6 .

  The next two methods are not applicable since wireless network connection
  takes some time after login. 
  /etc/gdm/PostLogin/default is called directly after graphical LOGIN 
     before the graphical session starts (ie. it is a login script)
  Add "/usr/local/bin/smbshares $USER" to the login script
	System -> Preferences -> Startup Applications -> Add

  To run a script on logout, ( not suitable for a logoff sesion )
      Put them $HOME/.bash_logout
  This is not applicable since this will be executed for each terminal job

***

Notes:
If you are using bash, the global login file is /etc/profile, and the user login files are ~/.bash_profile

[note that .bash_profile is different from .bashrc in that .bash_profile is only sourced on login (or on the start of a login terminal).
.bashrc will be sourced for any kind of terminal startup.]

For environment variables,
  see https://help.ubuntu.com/community/EnvironmentVariables

# update-rc.d -f umountnfs.sh remove
 Removing any system startup links for /etc/init.d/umountnfs.sh ...
   /etc/rc0.d/S31umountnfs.sh
   /etc/rc6.d/S31umountnfs.sh
# update-rc.d umountnfs.sh stop 15 0 6 .
 Adding system startup for /etc/init.d/umountnfs.sh ...
   /etc/rc0.d/K15umountnfs.sh -> ../init.d/umountnfs.sh
   /etc/rc6.d/K15umountnfs.sh -> ../init.d/umountnfs.sh
# update-rc.d umountshares.sh stop 14 0 6 .
update-rc.d: warning: /etc/init.d/umountshares.sh missing LSB information
update-rc.d: see <http://wiki.debian.org/LSBInitScripts>
 Adding system startup for /etc/init.d/umountshares.sh ...
   /etc/rc0.d/K14umountshares.sh -> ../init.d/umountshares.sh
   /etc/rc6.d/K14umountshares.sh -> ../init.d/umountshares.sh
# update-rc.d -f umountshares.sh remove
 Removing any system startup links for /etc/init.d/umountshares.sh ...
   /etc/rc0.d/K14umountshares.sh
   /etc/rc6.d/K14umountshares.sh
# update-rc.d -f umountnfs.sh remove
 Removing any system startup links for /etc/init.d/umountnfs.sh ...
   /etc/rc0.d/K15umountnfs.sh
   /etc/rc6.d/K15umountnfs.sh
# update-rc.d umountnfs.sh stop 14 0 6 .
 Adding system startup for /etc/init.d/umountnfs.sh ...
   /etc/rc0.d/K14umountnfs.sh -> ../init.d/umountnfs.sh
   /etc/rc6.d/K14umountnfs.sh -> ../init.d/umountnfs.sh
#
============================================================================
- Ethernet (wired network) communication should work always.
  If there is a problem check at https://help.ubuntu.com/ and select Internet

- For a wireless network (with WPA-PSK, TKIP non-broadcast network) connection,
   visit  http://ubuntuforums.org/showthread.php?t=202834  by wieman01
   iwconfig    [note your wireless adapter as wlan0, ath0, etc.]
   Generate passphrase_in_hex_code by
	wpa_passphrase your_specific_ssid passphrase_in_ascii
	[prefix each space in the ascii passphrase with "\"]
   vi /etc/network/interfaces [for wpa-psk tkip non-broadcast network: 13 lines]
	auto lo
	iface lo inet loopback

	auto ath0
	iface ath0 inet dhcp
	wpa-driver wext
	wpa-ssid your_specific_ssid
	wpa-ap-scan 2
	wpa-proto WPA
	wpa-pairwise TKIP
	wpa-group TKIP
	wpa-key-mgmt WPA-PSK
	wpa-psk passphrase_in_hex_code_without_any_delimiters_or_quotes
   vi /etc/init.d/wireless-network.sh [1 line]
	/etc/init.d/networking restart 
   chmod +x /etc/init.d/wireless-network.sh 
   ls -l /etc/rcS.d/S41* [make sure there is no file that begins with S41]
   ln -s /etc/init.d/wireless-network.sh /etc/rcS.d/S41wireless-network
   Restart the computer

   If for some reason, the system doesn't boot up (goes into a loop)
   even in recovery mode, boot up the computer with a live CD (Knoppix)
	RightClick on the ubuntu hard drive partition (sda4) -> Properties
	  Permission tab -> uncheck "Read only" -> OK
	Start a terminal
	su (enter - no password is required)
	chroot /mnt/sda4
	cd etc
	edit the necessary file and save it
   Shutdown and boot from the hard disk as normal.
   [Hence do not save password as a text string in any file
    because it can be read with root access by any one with a live CD]

- Mounting samba shares from a server using smbmount
   visit  http://ubuntuforums.org/showthread.php?t=280473
   Add an alias in ~/.bashrc as
	alias mapshares='sudo ~/smbshares your_smbusername'
   Create one directory for each smb share in /media (e.g. music)
   Create a bash script ~/smbshares as below
	#!/bin/bash
	#
	# If the network is routed through the home gateway,
	#  mount all seven samba shares to the /media folder
	#  with appropriate credentials.
	#
	
	# check for the correct number of arguments
	if [ $# -ne 1 ]
	 then # only one argument must be given
	    echo Usage: $0 smbUserName
	    exit
	fi
	
	homenet=`ifconfig | grep inet\ addr:192.168.2. | wc -l`
	
	if [ $homenet ]; then # currently connected to the home network
	  smbuser=$1
	  userID=`id -u $smbuser`
	  echo -n "Enter password for network samba shares: "
	  stty_orig=`stty -g`
	  stty cbreak -echo
	  read passcode
	  stty $stty_orig
	  echo 
	  # for each smb share, add one line as below
	  smbmount //yourServer/smbShareName /media/music -o username=$smbuser,password=$passcode,uid=$userID,umask=000
	  echo All shares are successfully mounted from the home network
	fi
	exit
	# end of the script

- To identify names of software packages, visit
	Package list of ubuntu 8.04 at  http://packages.ubuntu.com/hardy/

- ATI (fglrx) video 
    https://help.ubuntu.com/community/BinaryDriverHowto
    https://help.ubuntu.com/community/RadeonDriver#head-de8fa92c38d23a0a45d2ac513a4e5bb85ac9e919

- Ruby
    http://www.math.umd.edu/~dcarrera/ruby/0.3/
    http://tryruby.hobix.com/ (browser based - Java applet)
    http://www.troubleshooters.com/codecorn/ruby/basictutorial.htm
    http://www.rubycentral.com/pickaxe/
    http://glasnost.itcarlow.ie/~barryp/ruby-tut.html 

- Reference: http://www.cis.fiu.edu/~prabakar/resource/Linux