Ubuntu setup guide

TODO: make custom shortcuts portable

preface

this is a guide for me to configure a new Ubuntu install, including install packages, some configurations to be made
this guide is not comprehensive, some steps were not recorded

packages to install:

only vim.tiny is installed by default

    $ sudo apt-get install vim
    # using .vimrc file from Dropbox 
    # put following settings to ~/.vimrc
    # set nu
    # set expandtab
    # set tabstop=4
    # set autoindent
    # set hlsearch

    # install gvim, by default, this will make vim-gnome as the default vim, replacing vim.basic
    # vim-gnome is compiled with clipboard support, you can copy text to system clipboard, vim.basic lacks this functionality (gvim compiled with '+xterm_clipboard', while vim.basic compiled with '-xterm_clipboard')
    sudo apt-get install vim-gnome

    # install exuberant-ctags
    sudo apt-get install exuberant-ctags

packages to remove

configurations to make

Fonts

fonts-arphic-uming (文鼎楷体) fonts-arphic-uming (文鼎宋体)

visit this page to generate a font configuration file if any problem encountered: http://wenq.org/cloud/fcdesigner_local.html

            $ sudo apt-get install fonts-arphic-uming

            # tweak system fonts
            $ sudo apt-get install unity-tweak-tool

install custom fonts

put the fonts file (.ttf) in ~/.fonts

Apache, MySQL, PHP

            $ sudo apt-get install php5
            $ sudo apt-get install php5-dev php-pear
            $ sudo apt-get install php5-curl php5-mcrypt php5-memcached php5-mysql php5-xdebug php-apc php5-memcache


            # local memcache server
            $ sudo apt-get install memcached

            # when asked about this:
            # 'OpenSSL install prefix (no to disable SSL support) [/usr] :'
            # when you input '/usr', you got error, input 'yes' here, then everything is ok
            $ sudo pecl install stomp

            # phpunit
            $ sudo apt-get install phpunit
            $ pear config-set auto_discover 1
            $ pear install pear.phpunit.de/PHPUnit

            # mysql
            $ sudo apt-get install mysql-client mysql-server

            # apache
            $ sudo apt-get install apache2
            $ sudo a2enmod rewrite  # enable a module
            $ sudo service apache2 restart  # restart apache

            $ sudo apt-get install sendmail

            # install composer
            $ curl -sS https://getcomposer.org/installer | php
            $ sudo mv composer.phar /usr/local/bin/composer

            install ice-php, for Vela search, we need php-zeroc-ice 3.3.*, which can be found in Ubuntu 10.04 Lucid's repository, whild Ubuntu 12.04 Precise's repository contains php-zeroc-ice 3.4.*, to install the 3.3 version, add this lines to your /etc/apt/sources.list

            deb http://cn.archive.ubuntu.com/ubuntu/ lucid main restricted universe multiverse
            deb http://cn.archive.ubuntu.com/ubuntu/ lucid-updates main restricted universe multiverse
            deb http://cn.archive.ubuntu.com/ubuntu/ lucid-security main restricted universe multiverse

            then, 

            $ sudo apt-get update
            $ apt-cache show php-zeroc-ice      # will show both 3.3 and 3.4 version info
            $ sudo apt-get install php-zeroc-ice=3.3.1-12   # install the 3.3 version
            $ cp ~/Dropbox/config/etc/php5/conf.d/ice.* /etc/php5/conf.d/   # copy config files

            or, install from source, ref: https://dev.tbox.me/projects/vela/wiki/Ice_install

Python

            **NOTICE:**
            Seems like if installing python in a customized location, the readline module is not enabled, which is cumbersome for interaction at the command line 

            # download python tarball, extract it
            # cd Python-3.3.2/
            # ./configure --prefix='/opt/python3.3.2'
            # make
            # sudo make install

            # add python3.3 to path
            sudo ln -s /opt/python3.3.2/bin/python3.3 /usr/bin/python3.3

            # install setuptools
            wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py -O - | sudo python3.3
            sudo ln -s /opt/python3.3.2/bin/easy_install-3.3 /usr/bin/easy_install-3.3

            # install pip
            sudo easy_install-3.3 pip
            sudo ln -s /opt/python3.3.2/bin/pip-3.3 /usr/bin/pip-3.3

            # ipython
            sudo pip-3.3 install ipython

            # MySQLdb module
            $ sudo apt-get install python-mysqldb

            # Tkinter
            $ apt-cache search python-tk

            # pylab, matplotlib
            # pre-built package: python-matplotlib

Java

install Oracle JDK (maybe better than OpenJDK for Eclipse suport)
ref: http://www.cnblogs.com/Wisp/articles/3099494.html
!! apt-get install may fail, download jdk manually and move it to /var/cache/oracle-jdk7-installer
    sudo mv ~/downloads/oracle-jdk7-installer.tar.gz /var/cache/oracle-jdk7-installer

startup applications

            $ gnome-session-properties  # a gui for editting startup applications
            # the config files are in ~/.config/autostart/

if you want a sudo service to autostart, add the command to `/etc/rc.local`

multi-monitor display

    sudo apt-get install compizconfig-settings-manager compiz-plugins

then use the 'Put' in 'Window Management' to set a shortcut for moving window between monitors

Notes

    # set up dropbox daemon to run at ubuntu startup, see: http://www.dropboxwiki.com/Ubuntu_Startup
    # the 'update-rc.d' line in the tutorial may not appropriate, it should start late and stop early, use the following line instead:
    # sudo update-rc.d dropbox start 98 2 3 4 5 . stop 2 0 1 6 .
    # use the rc.d do not show the dropbox icon in status bar, add '/home/lee/.dropbox-dist/dropbox' to 'Startup Applications'

    # customize Launcher
    # show Launcher items
    $ gsettings get com.canonical.Unity.Launcher favorites
    ['firefox.desktop', '/home/lee/Dropbox/config/home/eclipse.desktop', 'google-chrome.desktop', 'virtualbox.desktop', 'nautilus-home.desktop', 'gnome-control-center.desktop']
    # .desktop files usually stored in ~/.local/share/applications/ or /usr/share/applications/
    # you can edit those files, once .desktop files are placed in those two folders, you can found them through Dash, and drag them to the Launcher from Dash