reorx
11/13/2012 - 4:04 PM

Kubuntu setup for PC

Kubuntu setup for PC

Kubuntu Setup For PC
====================

This article is about how to install a Kubuntu on the computer, and something that makes it better to use.

The contents is ordered by importance, so it's recommend to read and practice in sequence.

.. contents::


Install
-------

1. Download kubuntu 12.04.

   http://www.kubuntu.org/getkubuntu/download-lts

2. Make a start-up usb disk.

3. Install step by step.

   - Choose English as the language to make life easier.

   - It's better to mount ``/`` and ``/home`` seperately


Basic softwares
---------------

1. Update software sources::

       sudo kate /etc/apt/sources.list

   Copy contents below [1]_::

       deb http://mirrors.163.com/ubuntu/ precise main restricted universe multiverse
       deb http://mirrors.163.com/ubuntu/ precise-security main restricted universe multiverse
       deb http://mirrors.163.com/ubuntu/ precise-updates main restricted universe multiverse
       deb http://mirrors.163.com/ubuntu/ precise-proposed main restricted universe multiverse
       deb http://mirrors.163.com/ubuntu/ precise-backports main restricted universe multiverse
       deb-src http://mirrors.163.com/ubuntu/ precise main restricted universe multiverse
       deb-src http://mirrors.163.com/ubuntu/ precise-security main restricted universe multiverse
       deb-src http://mirrors.163.com/ubuntu/ precise-updates main restricted universe multiverse
       deb-src http://mirrors.163.com/ubuntu/ precise-proposed main restricted universe multiverse
       deb-src http://mirrors.163.com/ubuntu/ precise-backports main restricted universe multiverse

   .. [1] from: http://wiki.ubuntu.org.cn/%E6%BA%90%E5%88%97%E8%A1%A8

   Save and exit, then execute::

       sudo apt-get update

2. Install softwares::

       sudo apt-get install build-essential

       sudo apt-get install vim

       sudo apt-get install zsh

       sudo apt-get install git-core tig qgit

       sudo apt-get install pidgin

       sudo apt-get install yakuake

       sudo apt-get install unzip

       sudo apt-get install shutter

       sudo apt-get install conky feh

       sudo apt-get install moc cmus

       sudo apt-get install xclip

       sudo apt-get install curl

   .. MountManager

      Seems noneed since kubuntu has a built-in tool in System Settings

   .. should write in python development: sudo apt-get install ipython bpython


Settings
--------

System Settings
~~~~~~~~~~~~~~~
Open **System Settings** in Application Launcher

- Locale

  Install language packages by prompt

  Country/Region & Language → Date & Time

  + Long date format: *YYYY-MM-DD, WEEKDAY*

  + Short date format: *YY-MM-DD*

- Shortcuts and Gestures

  + Custom Shortcuts

    =======  =======
    konsole  Alt + S
    =======  =======

  + Global Keyboard Shortcuts

    =====================  =========================  ============
    KWin                   Switch to Desktop n        Meta + n
    KWin                   Show Desktop               Meta + D
    KWin                   Show Desktop Grid          Meta + W
    KWin                   Walk Through Desktop List  Meta + tab
    KWin                   Keep Window Above Others   Meta + T
    KWin                   Max Window                 Alt + F1
    KWin                   Max Window Vertically      Alt + F2
    Run Command Interface  Run Command                Meta + Space
    =====================  =========================  ============

- Workspace Appearance

  + Desktop Theme:

    - Big-Blue

    - Caledonia

    - Fushigi

    - Helium One

    - Opaquity

    - Oxygen

    - Wave

  + Splash Screen

    - Caledonia-KSplash

- Window Behavior

  + Task Switcher

    Main → Effect → Layout based switcher

- Input Devices

  + Keyboard

    Advanced → ☑ Swap Ctrl and Caps Lock

- Power Management

  + Energy Saving Settings

    Adjust ``Display Brightness`` in ``On AC Power`` to change default screen brightness

- Removable Devices

  Configure disk D to be automounted

- Startup and Shutdown

  + Autostart

  + Session Management

    Change session behavior in ``On Login``

- Desktop Effects

  Deactivate effects to improve UI performance.

  http://userbase.kde.org/Desktop_Effects_Performance

  https://wiki.mageia.org/en/Speeding_up_KDE

- Application Appearance

  Disable Oxygen Animations:

  Style → Applications → Widget style → Configure → Show advanced.. → Animations → Uncheck "Enable animations"

  http://mschlander.wordpress.com/2011/01/23/kde-is-slow-for-dummies/

  http://chakra-project.org/bbs/viewtopic.php?id=6719


Open **Muon Update Manager** in Application Launcher

Menu → Settings → Configure Muon Update Manager → uncheck ``Distribution upgrades``

Dolphin
~~~~~~~

Hide unused entries on the left

Hide right side panel

Konsole
~~~~~~~

Set shortcuts

- tab switch

- full screen


Command-line Configs
--------------------

Git
~~~

Setup ssh::

    cd ~/.ssh
    ssh-keygen -t rsa -C "your_email@youremail.com"

Go to https://github.com/settings/ssh and add new key from the content of ``id_rsa.pub``.

Dotfiles
~~~~~~~~

Initialize

::

    git clone git@github.com:reorx/dotfiles.git
    cd dotfiles
    implement.sh -i

Konsole
#######

Add tango colorscheme to konsole ::

    cp tango.colorscheme ~/.kde/share/apps/konsole

..

    Now colorscheme file folder may be at ``/usr/share/kde4/apps/konsole``

Conky
#####

::

    cp conky/conkyrc ~/.conkyrc
    cp conky/conky-start.sh ~/.kde/Autostart

Sudo
~~~~

Start editing::

    sudo visudo

To make shell variable ``http_proxy`` effective for sudo.

after ``Defaults env_reset``, add line::

    Defaults env_keep = "http_proxy ftp_proxy"

SSH
~~~

Open(or create) ``~/.ssh/config``

::

    Host dev
        HostName dev.example.com
        Port 22000
        User foo

If the host need private key file, which is normally added after option ``-i``, add ``IdentityFile``

::

    Host dev
        ...
        IdentityFile ~/.ssh/dev.example.key


Autostart
~~~~~~~~~

Two places to add script or application entry for autostart

- ``~/.config/autostart``

- ``~/.kde/Autostart``

Automount
---------

``/etc/fstab``::

    UUID=2A72A99A72A96AF1 /media/D ntfs-3g users 0 0


3rd Party Softwares
-------------------

Sometimes a proxy is needed if the source is blocked in your current network environment.

::

    export http_proxy="http://user:password@address:port"
    sudo apt-get update

Fcitx
~~~~~

1. Preparation::

    sudo apt-get build-dep fcitx

2. Install all relevant modules

    fcitx
    fcitx-googlepinyin
    fcitx-module-cloudpinyin
    fcitx-tools
    fcitx-ui-kimpanel
    im-switch
    fcitx-frontend-qt4
    qt4-qtconfig

2.5 Run ``qtconfig-qt4``, and set fcitx as the default method

3. ``~/.xprofile`` could be created to ensure::

    export XMODIFIERS=@im=fcitx
    export GTK_IM_MODULE=fcitx
    export QT_IM_MODULE=fcitx

4. Execute::

    im-switch -s fcitx -z all_ALL

5. Panel Tool Box → Add Widgets

   add ``Input Method Panel`` to panel and configure it.

Chrome
~~~~~~

Setup key with::

    wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -

Setup repository with::

    sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'

Setup package with::

    sudo apt-get update
    sudo apt-get install <package name>

*<package name>* could be:

- google-chrome-stable

- google-chrome-unstable

- google-chrome-beta

Sublime
~~~~~~~

1. Download

   http://www.sublimetext.com/2

2. Install `Package Control <http://wbond.net/sublime_packages/package_control/installation>`_

   ``Ctrl + \``` to open the console, and paste

    import urllib2,os; pf='Package Control.sublime-package'; ipp=sublime.installed_packages_path(); os.makedirs(ipp) if not os.path.exists(ipp) else None; urllib2.install_opener(urllib2.build_opener(urllib2.ProxyHandler())); open(os.path.join(ipp,pf),'wb').write(urllib2.urlopen('http://sublime.wbond.net/'+pf.replace(' ','%20')).read()); print 'Please restart Sublime Text to finish installation'

   Note:

    If error always occurs, use code from
    http://wbond.net/sublime_packages/package_control/installation#Testing_Version

3. Install Packages

   - Git

   - SublimeCodeIntel

   - SublimeLinter

   - Terminal

   - Theme - Nil

   - Theme - Phoenix

   - Theme - Soda

   - Tomorrow Color Schemes

   - VintageE

4. Settings

   **Settings - User**::

    {
        "color_scheme": "Packages/Tomorrow Color Schemes/Tomorrow-Night.tmTheme",
        "default_line_ending": "unix",
        "ensure_newline_at_eof_on_save": true,
        "font_size": 11,
        "ignored_packages":
        [
        ],
        "rulers": [80, 120],
        "soda_classic_tabs": false,
        "theme": "Soda Light.sublime-theme",
        "translate_tabs_to_spaces": true,
        "trim_trailing_white_space_on_save": true
    }

   **SublimeCodeIntel - Settings - User**::

    {
        "codeintel_live": false
    }

   **SublimeLinter - Settings - User**::

    {
        "sublimelinter": "load-save"
    }

5. Add some textmate colorschemes

   ::

    git clone git@github.com:reorx/colorscheme-textmate.git

   Copy the folder to ``~/.config/sublime-text-2/Packages``

   *Another colorscheme called `carlcalderon
   <https://github.com/carlcalderon/sublime-color-schemes>`_ is also pretty good*

6. Application Entry & Command

   create a symbolic link of sublime::

    sudo ln -s /place/of/sublime/executable /usr/local/bin/sublime

   right click the ``Application Launcher`` and choose ``Edit Applications``

   add a new entry, using icons from `github <https://github.com/reorx/Sublime-Text-2-Icon>`_

   or create a file named ``sublime.desktop``::

    [Desktop Entry]
    Version=1.0
    Name=Sublime Text 2
    # Only KDE 4 seems to use GenericName, so we reuse the KDE strings.
    # From Ubuntu's language-pack-kde-XX-base packages, version 9.04-20090413.
    GenericName=Text Editor

    Exec=sublime
    Terminal=false
    Icon=/usr/lib/Sublime Text 2/Icon/48x48/sublime_text.png
    Type=Application
    Categories=TextEditor;IDE;Development
    X-Ayatana-Desktop-Shortcuts=NewWindow

    [NewWindow Shortcut Group]
    Name=New Window
    Exec=sublime -n
    TargetEnvironment=Unity

   and copy it to ``/usr/share/applications``

Dropbox
~~~~~~~

https://www.dropbox.com/install?os=lnx

DeaDBeef
~~~~~~~~

http://deadbeef.sourceforge.net/download.html

yEd
~~~

http://www.yworks.com/en/products_yed_download.html


Development
-----------

Softwares
~~~~~~~~~

sudo apt-get install nginx

sudo apt-get install redis-server

Node.js
#######

::

    sudo apt-get install python-software-properties
    sudo add-apt-repository ppa:chris-lea/node.js
    sudo apt-get update
    sudo apt-get install nodejs npm

MongoDB
#######

::

    sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
    sudo sh -c 'echo "deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen " > /etc/apt/sources.list.d/10gen.list'
    sudo apt-get update
    sudo apt-get install mongodb-10gen

::

    sudo update-rc.d -f nginx disable
    sudo update-rc.d -f redis-server disable

MySQL
#####

::

    sudo apt-get install mysql-server

modify /etc/mysql/my.cnf::

    [client]
        default-character-set = utf8
    [mysqld]
        character-set-server = utf8
    [mysql]
        default-character-set = utf8

restart::

    $ sudo service mysql restart


install tool bundle `MySQL Workbench <http://dev.mysql.com/downloads/workbench/>`_

Python
~~~~~~
See another gist: https://gist.github.com/4067217