Blog

Ubuntu 14.04 개발환경 세팅

May 25, 2014

Ubuntu 14.04 개발환경 세팅

Ubuntu 14.04 Setup

2010년부터 Windows 에서 개발했는데, 이제 도저히 못해먹겠습니다. VMware 에 Ubuntu 설치 후 개발하다가 Ubuntu 14.04 릴리즈 후 본격적으로 갈아 탔습니다. 이 글은 기록 / 공유 목적으로 제가 Ubuntu 14.04 설치 후 한 일들을 남긴 글입니다. 아마 같은 개발환경을 사용한다면 도움이 되리라 생각합니다.

주로 Emacs 에서 Javascript / Node.js 개발을 하고 가끔 Spring 개발, LLVM 스터디를 합니다. 따라서 STS 와 ctags, GNU global 도 세팅하였습니다.

참조 : 우분투 사용자그룹 문서

1. Default Application Install

$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install vim git wget curl ssh

$ # register ssh key on Github
$ # install chrome dropbox

2. Appearance Setting

2.1 Font

sudo apt-get install unity-tweek-tool

2.2 Appearance

enable workspace
autoi hide launcher on
launcher icon size : 40

2.3 Brightness & Lock

Turn screen off when inactive for : 10 minutes

2.4 Shell : ZSH

$ sudo apt-get install zsh
$ curl -L http://install.ohmyz.sh | sh

Ref : Here

2.5 Solarzied Terminal

$ wget --no-check-certificate https://raw.github.com/seebi/dircolors-solarized/master/dircolors.ansi-dark
$ mv dircolors.ansi-dark .dircolors

$ git clone https://github.com/sigurdga/gnome-terminal-colors-solarized.git
$ cd gnome-terminal-colors-solarized
$ ./set_dark.sh

$ # add this line into your .zshrc
$ # eval `dircolors ~/.dircolors`

Ref : Here

3. Key

3.1 Default Key Configuration

super + del -> gnome-system-monitor (Custom)
super + e -> Home Folder (in Launchers)
shift + alt + d -> hud (in Launchers)
right alt -> compose key (in Typing)
Use compose key as input source switcher (in Typing)

3.2 Capslock as ESC

$ sudo apt-get install gnome-tweak-tool
gnome-tweak-tool > Typing > Make Caps Lock an additional ESC

4. Korean

Language Supoort -> install Korean
Text Entry -> add Korean(Hangul) in Input source 

4.1 한글 짤림 문제 (Optional)

sudo add-apt-repository -y ppa:jincreator/freetype && sudo apt update && sudo apt install -y libfreetype6

5. Development Environment

5.1 Node.js

$ sudo add-apt-repository ppa:chris-lea/node.js
$ sudo apt-get update
$ sudo apt-get install python-software-properties python g++ make nodejs
$ sudo npm install -g bower supervisor grunt-cli karma karma-cli 

5.2 MongoDB

$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
$ echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
$ sudo apt-get update
$ sudo apt-get install mongodb-org
$ sudo service mongod start

$ # add admin user 
$ sudo vi /etc/mongodb.conf auth config
$ sudo service mongod restart

5.3 C++

$ sudo apt-get install gcc g++ make cmake autoconf libtool

5.4 Java 8

$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update
$ sudo apt-get install oracle-java8-installer
$ sudo apt-get install oracle-java8-set-default

5.5 Mysql 5.5

$ sudo apt-get install mysql
$ # install mysql workbench

5.6 Spring

$ # get STS 
$ tar -zxvf sts*
$ sudo mv sts-bundle /opt
$ cd /opt/sts-bundle/sts-3.5.1.RELEASE
$ sudo ln -s /opt/sts-bundle/sts-3.5.1.RELEASE/STS /usr/local/bin/sts

$ sudo vi /usr/share/applications/sts.desktop

[Desktop Entry]
Name=sts
Exec=/usr/local/bin/sts
Terminal=false
StartupNotify=true
Icon=/opt/eclipse/icon.xpm
Type=Application

$ # add extentions vrapper, color-theme, gradle support
$ # set emacs key binding as default key

5.7 Emacs

See : https://github.com/ansterd/emacs-linux/

5.8 Git

[alias]
        ci = commit -v
        ca = commit --amend
        cm = commit -m

        co = checkout
        com = checkout master

        ph = push
        pl = pull

        a = !git add . && git status
        aa = !git add --all . && git status

        s = status --short --branch
        st = status

        df = diff

        ra = remote add
        rm = remote remove
        ro = remote show origin -n

        rs = reset --hard
        rh = reset

        br = branch
        bv = branch -v
        bd = branch -d

        ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate
        lg = "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(blue)[%an]%Creset' --abbrev-commit"

        last = log -1 HEAD
        type = cat-file -t
        dump = cat-file -p

        me = config user.name

        today = "log --since=midnight --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(blue)[%an]%Creset' --abbrev-commit"
        yesterday = "log --since yesterday --until=midnight --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(blue)[%an]%Creset' --abbrev-commit"

        outgoing = "log --pretty=oneline --abbrev-commit --graph @{u}.."
        incoming = "!git fetch && git log --pretty=oneline --abbrev-commit --graph [email protected]{u}"

Ref1 : http://durdn.com/blog/2012/11/22/must-have-git-aliases-advanced-examples/
Ref2 : http://oli.jp/2012/git-powerup/