2011-12-22

다른 계정으로 명령 실행하기

다른 사용자 계정으로 명령을 실행할 수 있는 방법이 다양하게 있는데, 그 중 가장 많이 사용되는 방법을 나열하면 아래와 같다.

$ su - 아이디 -c "명령어1; 명령어2; 명령어3"
$ sudo -u 아이디 "명령어"
$ ssh 아이디@호스트 "명령어"

위와 같은 방법으로 하면 간단하게 실행할 수 있는데, 환경변수가 제대로 먹지 않아서 실행이 안되는 경우가 있다. su, ssh 의 경우, 환경변수를 .bashrc 에 넣어두면 안되고, .profile 이나 .bash_profile 넣어야 된다.

sudo 의 경우는 환경변수 보다는 보안적인 이유로 특정 디렉토리에 있는 파일만 실행되도록 설정되어 있다. /etc/sudoers 파일을 열어서 아래와 같은 부분을 찾아서, 자신이 실행하고자 하는 파일이 존재하는 디렉토리를 포함시켜주면 된다.

Defaults    secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

2011-12-20

Debian/Ubuntu + NginX + trunserver + Django 1.3.1 + Python 2.7.2

Django를 Deploy하기 위한 여러가지 방법들을 소개했었는데, 이번 방법이 내가 가장 선호하는 방식이다. Instance 별로 정상동작 유무를 확인하기가 쉽고, NginX 에서는 로드밸런싱을 하고, 하나의 Instance 에 문제가 발생하면 자동으로 제외되어 무장애/무중단 서비스를 제공할 수 있다.

여기에서 더 나아가 memcached 등을 이용하여 캐싱까지 처리하면 성능에서도 상당히 만족스러운 결과를 볼 수 있을 것이다. 또한, trunserver 조작에 대해서 개선할 부분이 많이 있다. 이런 부분들은 다음에 생각해보고, NginX와 trunserver 를 이용한 방법을 살펴보자.

Install Python

$ apt-get install zlibc zlib1g-dev libxml2 libxml2-dev libbz2-dev curl build-essential python
$ curl -kL http://github.com/utahta/pythonbrew/raw/master/pythonbrew-install | bash
$ echo 'source ~/.pythonbrew/etc/bashrc' >> ~/.bashrc
$ source ~/.bashrc
$ pythonbrew install --force --no-test 2.7.2
$ pythonbrew switch 2.7.2

Install Django, trunserver

$ pip install django psycopg2 trunserver

Create Project

$ mkdir -p /opt/project
$ cd /opt/project
$ django-admin.py startproject sample_project
$ cd sample_project
$ mkdir media

/opt/project/sample_project 에 start.sh를 만든다.

nohup python manage.py trunserver --verbosity=0 --noreload 0.0.0.0:9000 > /dev/null 2>&1 &
nohup python manage.py trunserver --verbosity=0 --noreload 0.0.0.0:9001 > /dev/null 2>&1 &
$ chmod 755 start.sh

trunuwsgi 실행

$ ./start.sh

Install NginX

$ aptitude install nginx

Configure NginX

$ cd /etc/nginx/sites-available
$ vi django 
upstream sample_project {
    ip_hash;
    server 127.0.0.1:9000;
    server 127.0.0.1:9001;
}

server {
    listen 80;
    server_name mydomain.com;
    
    location /site_media  {
        root /opt/project/sample_project/media/;
    }

    location / {
        proxy_pass sample_project;
        proxy_set_header XRealIP $remote_addr;
    }
}
$ cd /etc/nginx/sites-enabled
$ ln -s /etc/nginx/sites-available/django django

Run NginX

$ /etc/init.d/nginx restart

2011-12-17

Debian/Ubuntu + NginX + uWSGI + Django 1.3.1 + Python 2.7.2

Install Python

$ apt-get install zlibc zlib1g-dev libxml2 libxml2-dev libbz2-dev curl build-essential python
$ curl -kL http://github.com/utahta/pythonbrew/raw/master/pythonbrew-install | bash
$ echo 'source ~/.pythonbrew/etc/bashrc' >> ~/.bashrc
$ pythonbrew install --force --no-test 2.7.2
$ pythonbrew switch 2.7.2

Install Django, uWSGI

$ pip install django psycopg2 uwsgi

Create Project

$ mkdir -p /opt/project
$ cd /opt/project
$ django-admin.py startproject sample_project
$ cd sample_project
$ mkdir media

/opt/project/sample_project 에 django0.ini를 만든다.

[uwsgi]
socket = 127.0.0.1:8000
chdir = /opt/project/sample_project
pythonpath = /opt/project
env = DJANGO_SETTINGS_MODULE=sample_project.settings
module = django.core.handlers.wsgi:WSGIHandler()
master = true
processes = 4
daemonize = /opt/project/sample_project/uwsgi0.log
pidfile = /opt/project/sample_project/uwsgi0.pid

/opt/project/sample_project 에 django1.ini를 만든다.

[uwsgi]
socket = 127.0.0.1:8001
chdir = /opt/project/sample_project
pythonpath = /opt/project
env = DJANGO_SETTINGS_MODULE=sample_project.settings
module = django.core.handlers.wsgi:WSGIHandler()
master = true
processes = 4
daemonize = /opt/project/sample_project/uwsgi1.log
pidfile = /opt/project/sample_project/uwsgi1.pid

uwsgi 실행

$ uwsgi django0.ini
$ uwsgi django1.ini

Install NginX

$ aptitude install nginx

Configure NginX

$ cd /etc/nginx/sites-available
$ vi django
upstream sample_project {
    ip_hash;
    server 127.0.0.1:8000;
    server 127.0.0.1:8001;
}

server {
    listen 80;
    server_name mydomain.com;
    
    location /site_media  {
        root /opt/project/sample_project/media/;
    }

    location / {
        include uwsgi_params;
        uwsgi_pass sample_project;
    }
}
$ cd /etc/nginx/sites-enabled
$ ln -s /etc/nginx/sites-available/django django

Run NginX

$ /etc/init.d/nginx restart

2011-11-02

IE9 에서 Flash 배경이 까맣게 나오는 현상 해결하기


IE9에서 Flash 의 배경이 까맣게 나오는 경우가 있다. Flash의 버그라고 생각했었는데, 다른 브라우저(크롬 ,파이어폭스) 등에서는 정상적으로 나온다. 한참을 고민하고 검색을 해봐도 방법을 못찾았는데, 사무실 직원이 해결해주었다. ^^ 방법은 아래 화면처럼 인터넷 옵션고급탭을 누르고, GPU 렌더링 대신 소프트웨어 렌더링 사용 에 체크를 하고 적용하면 잘 되는 것을 확인할 수 있다. IE9에서 새로 생긴 옵션인데, 이 것이 지원이 안되는 하드웨어를 가지고 있다면, 반드시 체크하여 사용해야 하나보다.


2011-11-01

.tmux.conf

Install Tmux

$ apt-get install tmux

Configure Tmux

set-option -g prefix C-a
bind-key C-a last-window
unbind % # Remove default binding since we're replacing
bind | split-window -h
bind - split-window -v
# Set status bar
set -g status-bg black
set -g status-fg white
set -g status-left '#[fg=green]#H'
# Highlight active window
set-window-option -g window-status-current-bg red
set -g status-right '#[fg=yellow]#(uptime | cut -d "," -f 2-)'
# Set window notifications
setw -g monitor-activity on
set -g visual-activity on
# Automatically set window title
setw -g automatic-rename

2011-10-27

JRuby, 1.9.x 를 디폴트로 사용하기

JRuby를 처음 설치해서 버전을 확인해보면, 1.8.x 인것을 확인할 수 있다. 이것을 1.9.x 로 변경하려면, 환경변수 JRUBY_OPTS 를 수정해야 한다.

$ jruby -v
jruby 1.6.5 (ruby 1.8.7 patchlevel 330) (2011-01-10 769f847) (Java HotSp...
$ export JRUBY_OPTS=--1.9
$ jruby -v
jruby 1.6.5 (ruby 1.9.2 trunk 136) (2011-01-10 769f847) (Java HotSpot(TM...
$ export JRUBY_OPTS=--1.8
$ jruby -v
jruby 1.6.5 (ruby 1.8.7 patchlevel 330) (2011-01-10 769f847) (Java HotSpo...

Ruby : 파일(디렉토리)이름에 특정 문자열이 포함된 목록 출력하기

Ruby에서 파일(디렉토리)이름에 특정 문자열이 포함된 목록 출력하기위해서 아래와 같이 하면 된다. Unix(Linux)/Cygwin 에서는 기본적인 도구만으로도 쉽게 할 수 있지만, 그런 환경에 안되는 곳에서는 유용하다. 아주 사소한 팁이지만, 이런 것이 여러가지가 모이면, 나중에 큰 도움이 될 것이다. ^^

# -*- coding: cp949 -*-
require 'find'
 
$dirlist    = ["C:\\"]
$sub_string = "애니메이션"
 
$dirlist.each() do |dirname|
  puts dirname if dirname.include?($sub_string)
 
  Find.find(dirname) do |file|
    next if file == nil
    next if not File.file?(file)
    next if not file.include?($sub_string)
 
    puts file
  end
end

2011-10-12

USB 스틱으로 Debian 설치하기


우선, 어떤 디바이스가 USB 스틱인지를 찾아야 한다. 잘 못하면 다른 HDD 의 내용까지 날릴 수 있기 때문이다. USB 스틱을 PC/서버에 연결한 후에 dmesg 명령으로 어느 디바이스가 USB 스틱인지를 확인한다.
[ 69.902747] scsi 4:0:0:0: Direct-Access VBTM Store 'n' Go 5.00 PQ: 0 ANSI: 0 CCS
[ 69.903314] sd 4:0:0:0: Attached scsi generic sg3 type 0
[ 70.867573] sd 4:0:0:0: [sdy] 2013184 512-byte logical blocks: (1.03 GB/983 MiB)
[ 70.868085] sd 4:0:0:0: [sdy] Write Protect is off
위의 예에서는 sdy (/dev/sdy)가 USB 스틱이다. 다시 한번, 해당 디바이스가 USB 스틱인지 확인하기 바란다!
Debian 미러 사이트에서 boot.img.gz 과 netinstall iso 이미지를 다운로드 받는다.
# wget ftp://ftp.kr.debian.org/debian/dists/squeeze/main/installer-i386/current/images/hd-media/boot.img.gz
# wget ftp://ftp.kr.debian.org/debian-cd/6.0.3/i386/iso-cd/debian-6.0.3-i386-netinst.iso
boot.img.gz을 USB 스틱에 기록한다.
# zcat boot.img.gz > /dev/sdy
USB 스틱을 마운트하고 netinst.iso 이미지를 USB 스틱의 root 디렉토리에 복사한다.
# mkdir /mnt/usbstick
# mount /dev/sdy /mnt/usbstick
# cp debian-*-netinst.iso /mnt/usbstick
# umount /mnt/usbstick
이제 USB 스틱은 부팅이 되며, Debian netinstaller 를 시작할 수 있을 것이다.

2011-09-14

Debian(wheezy) + nginx + php-fpm(FastCGI) + php-apc

얼마전부터 Apache 대신, nginx 를 사용하고 있다. Django 하고 연동해서 사용하고 있지만, PHP 도 사용할 일이 생겨서 FascCGI 구성하여 설정하는 법을 정리하게 되었다. 가장 기본적인 설정법만 있기 때문에, 구체적으로 특별한 어플리케이션을 사용하는 경우 연구를 더 해봐야 한다. 그에 대한 사항은 나중에 알아보도록 하자.


  1. /etc/apt/sources.list 에 contrib non-free 추가
    deb http://ftp.daum.net/debian/ wheezy main contrib non-free
    deb-src http://ftp.daum.net/debian/ wheezy main contrib non-free
    
    deb http://security.debian.org/ wheezy/updates main contrib non-free
    deb-src http://security.debian.org/ wheezy/updates main contrib non-free
    위와 같이 파일을 수정한 후에 apt-get update 실행한다.
  2. 필요한 패키지 설치
    # apt-get install nginx php5-fpm php-apc
  3. Project 디렉토리 생성
    # mkdir -p /opt/project/phpfpm
  4. index.php 생성 (테스트용 페이지)
    # cd /opt/project/phpfpm
    # vi index.php
    <html>
    <head>
    <title>PHP-FPM Test</title>
    </head>
    <body>
    Hello~!<br/>
    <?php
    echo "PHP-FPM Test";
    ?>
    </body>
    </html>
  5. nginx 설정파일 작성
    # cd /etc/nginx/sites-available
    # vi phpfpm 
    server {
        listen *:80;
        server_name phpfpm.test.com; # 자신이 원하는 도메인주소 입력
        root /opt/project/phpfpm/;
        index index.php;
    
        location ~ \.php$ {
    
            # index index.php;
            fastcgi_pass  127.0.0.1:9000;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            fastcgi_param PATH_INFO $fastcgi_script_name;
            include /etc/nginx/fastcgi_params;
        }
    }
    # cd ../sites-enabled
    # ln -s /etc/nginx/sites-available/phpfpm phpfpm
  6. nginx, php-fpm 시작
    # /etc/init.d/nginx start
    # /etc/init.d/php-fpm start  
  7. PC의 hosts 파일에 phpfpm.test.com 을 설정한 후에, 브라우저에서 http://phpfpm.test.com 을 입력하면 출력화면을 볼 수 있을 것이다.




2011-07-27

Ubuntu 10.04 LTS + NginX + Django 1.3 (FastCGI) + Python 2.7.2

이번에는 Ubuntu 10.04 (LTS) 에서 NginX + Django 1.3 (FastCGI) + Python 2.7.2 를 구성해보았다. Python 을 설치하기 전에 zlibc 를 먼저 설치해주어야 distribute 가 제대로 설치되는 삽질이 있었긴 했지만, CentOS에서 설치했던 것처럼 대체적으로 무난하게 설정이 되었다.


  1. Install Python
    # aptitude install zlibc zlib1g-dev
    # echo 'export PYTHONBREW_ROOT=/opt/pythonbrew' >> /etc/profile; source /etc/profile
    # curl -kLO http://xrl.us/pythonbrewinstall; chmod +x pythonbrewinstall; ./pythonbrewinstall
    # echo 'source /opt/pythonbrew/etc/bashrc' >> /etc/profile; source /etc/profile
    # pythonbrew install --force --no-test 2.7.2
    # pythonbrew switch 2.7.2
  2. Install Django
    # pip install django flup
  3. Create Project
    # mkdir -p /opt/project
    # cd /opt/project
    # django-admin.py startproject sample_project
    # cd sample_project
    # mkdir media
  4. Run Project
    # cd /opt/project/sample_project
    # python manage.py runfcgi method=threaded pidfile=/tmp/django_sample.pid host=127.0.0.1 port=8000
  5. Install NginX
    # aptitude install nginx
  6. Configure NginX
    # cd /etc/nginx/sites-available
    # vi django 
    server {
        listen 80;
        server_name 도메인주소;
        location /site_media  {
            root /opt/project/sample_project/media/;
        }
        location / {
            # host and port to fastcgi server
            fastcgi_pass 127.0.0.1:8000;
            fastcgi_param PATH_INFO $fastcgi_script_name;
            fastcgi_param REQUEST_METHOD $request_method;
            fastcgi_param QUERY_STRING $query_string;
            fastcgi_param CONTENT_TYPE $content_type;
            fastcgi_param CONTENT_LENGTH $content_length;
            fastcgi_pass_header Authorization;
            fastcgi_intercept_errors off;
        }
    }
    # cd /etc/nginx/sites-enabled
    # ln -s /etc/nginx/sites-available/django django
  7. Run NginX
    # /etc/init.d/nginx restart


2011-07-26

CentOS 5.6 + NginX 0.8.54 + Django 1.3 (FastCGI) + Python 2.7.2

Python 으로 가장 많이 이용되는 웹프레임워크는 Django 이다. 최근 가벼움과 성능으로 인정을 받고 있는 NginX 와 FastCGI 로 연동하여 설치하는 방법을 간단하게 정리해보았다. CentOS 6.0 이 나오긴 했지만, 아직 5.x 환경도 많이 이용되고 있으리라 생각하여 CentOS 5.6 에서 테스트하였으며, 아마 6.0 에서도 무리없이 설치될 것으로 믿는다.

  1. Install Python
    # echo 'export PYTHONBREW_ROOT=/opt/pythonbrew' >> /etc/profile; source /etc/profile
    # curl -kLO http://xrl.us/pythonbrewinstall; chmod +x pythonbrewinstall; ./pythonbrewinstall
    # echo 'source /opt/pythonbrew/etc/bashrc' >> /etc/profile; source /etc/profile
    # pythonbrew install --force --no-test 2.7.2
    # pythonbrew switch 2.7.2
  2. Install Django
    # pip install django flup
  3. Create Project
    # mkdir -p /opt/project
    # cd /opt/project
    # django-admin.py startproject sample_project
    # cd sample_project
    # mkdir media
  4. Run Project
    # cd /opt/project/sample_project
    # python manage.py runfcgi method=prefork pidfile=/tmp/django_sample.pid host=127.0.0.1 port=8000
  5. Install NginX
    # yum install nginx
  6. Configure NginX
    # cd /etc/nginx
    # vi nginx.conf
    ...
        server {
            server_name 도메인주소;
            location /site_media  {
                root /opt/project/sample_project/media/;
            }
            location / {
                # host and port to fastcgi server
                fastcgi_pass 127.0.0.1:8000;
                fastcgi_param PATH_INFO $fastcgi_script_name;
                fastcgi_param REQUEST_METHOD $request_method;
                fastcgi_param QUERY_STRING $query_string;
                fastcgi_param CONTENT_TYPE $content_type;
                fastcgi_param CONTENT_LENGTH $content_length;
                fastcgi_pass_header Authorization;
                fastcgi_intercept_errors off;
            }
        }
    ...
  7. Run NginX
    # /etc/init.d/nginx restart



2011-07-14

Install Scala

JVM에서 사용할 수 있는 언어들이 많이 나온 상태이다. 아직도 Java 만이 JVM 에서 돌아간다고 생각하시는 분들이 계시다. 잠깐만 생각해봐도, Java, Groovy, Scala, Clojure, Jython, Jruby 등등이 줄줄 나온다. 이 중에서도 요즘 Scala 의 인기가 치솟고(?) 있다. PlayFramework 와 함께 쓰면 웹개발도 아주 신속하게 개발할 수 있다. Java 와 연계성도 괜찮으며, 성능도 보장된다. Twitter 에서도 Ruby 기반의 백앤드를 Scala로 바꾸었단다.

아무튼 모든 것이 그렇듯, 일단 설치부터 해야, 시작할 수 있으니, 간단하게 OS별로 설치하는 법을 보도록 하자.


  • 먼저, JDK는 설치되어있어야 한다.
  • Windows
    1. http://www.scala-lang.org/downloads에서 scala-w.x.y.z.zip 파일을 다운로드 받는다.
    2. 적당한 곳에 압축을 푼다. (예) C:\scala
    3. 환경변수 path 에 C:\scala\bin 을 등록한다.
  • CentOS
    • 6.0 에도 scala 가 패키지에 없으므로, 직접 다운로드하여 설치해야 한다.
    1. scala-w.x.y.z.tgz 파일을 다운로드 받는다.
      # wget http://www.scala-lang.org/downloads/distrib/files/scala-2.9.0.1.tgz
    2. 적당한 곳에 앞축을 푼다. (예) /opt/scala
      # mkdir -p /opt; tar xvfz scala-2.9.0.1.tgz -C /opt; mv /opt/scala-2.9.0.1 /opt/scala
    3. 환경변수 PATH 에 등록한다.
      # echo 'export PATH=/opt/scala/bin:$PATH' >> /etc/profile; source /etc/profile
  • Debian/Ubuntu
    • 패키지로 설치한다.
      # sudo apt-get install scala



2011-07-13

Python : 딕셔너리, 값으로 정렬하기

Python 에서 Dictionary라는 자료구조가 제공되는데, 이것은 Key 와 Value 로 요소가 이루어진다. 이번에 간단한 프로그램을 만들다가 Value 를 기준으로 Dictionary를 정렬할 필요가 생겼는데, 그 방법을 찾아보니 아래와 같았다. 이는 Python 2.4 이상에서 지원이 된다고 한다.


  • 소스
    #!/usr/bin/env python
    # filename : dict_sort.py
    from operator import itemgetter
     
    dict = {}
    dict['a'] = 2
    dict['b'] = 1
    dict['c'] = 5
     
    print(sorted(dict.iteritems(), key=itemgetter(1), reverse=True))
  • 결과
    # python dict_sort.py
    [('c', 5), ('a', 2), ('b', 1)]


2011-07-12

Python : 10MB 이상의 파일중에서 중복된 파일 찾기

PHP, Ruby 에 이어서, Python 에서도 중복파일 찾기를 만들어보았다.


# -*- coding: cp949 -*-
from operator import itemgetter
from hashlib import md5
import os
 
 
TARGET_DIR   = "M:\\USER\\특정디렉토리"
LIMITED_SIZE = 100*(1024*1024) # 100MB
 
 
def md5sum(filename, buf_size=8192):
    m = md5()
    with open(filename) as f:
        data = f.read(buf_size)
        while data:
            m.update(data)
            data = f.read(buf_size)
    return m.hexdigest()
 
 
def main():
    hash_cnt  = {}
    file_list = []
    for p, ds, fs in os.walk(TARGET_DIR):
        for f in fs:
            filename = os.path.join(p, f)
            if os.path.islink(filename) : continue
            if not os.path.isfile(filename) : continue
            filesize = os.path.getsize(filename)
            if filesize < LIMITED_SIZE: continue
 
            crc = md5sum(filename)
            if hash_cnt.has_key(crc):
                hash_cnt[crc] = hash_cnt[crc] + 1
            else:
                hash_cnt[crc] = 1
 
            item = crc+"|"+filename
            file_list.append(item)
 
    for hash, cnt in sorted(hash_cnt.iteritems(), key=itemgetter(1), reverse=True):
        if cnt < 2: continue
        print("\n["+hash+"]")
        for item in file_list:
            (hash2, filename) = item.split("|")
            if hash == hash2 : print(filename)
 
 
if __name__ == '__main__':
    main()


2011-07-09

FreeBSD 8.2 설치후 작업



FreeBSD를 설치한 후에 작업을 편하게 하게 위해서, 몇가지 필요한 패키지를 설치하고, 설정할 것들이 있다. 이렇게만 해 놓으면 리눅스와 비교를 해도 어떤 차이가 있는지 제대로 알아차리지 못할 것이다. ^^


  1. sshd 부팅시 자동시작 설정 : /etc/rc.conf
    sshd_enable="yes"
  2. sshd_config 수정 / 재시작 : root로 로그인하는 것은 보안상 문제가 있지만, 편의를 위히 일단 이렇게 해놓자.
    # vi /etc/ssh/sshd_config
    PasswordAuthentication yes
    PermitRootLogin yes
    # /etc/rc.d/sshd restart
    이제, ssh 로 원격 접속한다.
  3. root, toor 계정쉘을 bash로 변경
    # pkg_add -r bash; rehash; chsh -s bash root; chsh -s bash toor
    쉘을 바꾸었으니, 로그아웃하고 다시 로그인하자.
  4. /etc/profile 에 PACKAGESITE 설정한다.
    export PACKAGESITE="ftp://ftp8.kr.freebsd.org/FreeBSD/ports/i386/packages-8.2-release/Latest/"
    # export PACKAGESITE="http://ftp2.kr.freebsd.org/FreeBSD/ports/i386/packages-8.2-release/Latest/"
    # export PACKAGESITE="http://mirror.yongbok.net/FreeBSD/ports/i386/packages-8.2-release/Latest/"
    # export PACKAGESITE="http://ftp.kaist.ac.kr/FreeBSD/ports/i386/packages-8.2-release/Latest/"
    # export PACKAGESITE="ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-8.2-release/Latest/"
    profile 적용
    # source /etc/profile
  5. Linux Emulation 적용 (htop 에서 Linux 의 /proc 을 이용한다)
    # echo 'linux_enable="YES"' >> /etc/rc.conf
    # kldload linux; pkg_add -r linux_base-f10
    # echo 'linproc /compat/linux/proc linprocfs rw 0 0' >> /etc/fstab; mount linproc
  6. 필요한 패키지 설치
    # pkg_add -r tmux vim-lite ntp gnuls htop git curl
  7. ntpd 적용/실행
    # echo 'ntpd_enable="yes"' >> /etc/rc.conf
    # /etc/rc.d/ntpd start
  8. gnuls alias 적용
    # echo 'alias ls="gnuls --color=always"' >> /etc/profile; source /etc/profile
  9. vim 적용
    # echo 'alias vi="vim"' >> /etc/profile; source /etc/profile
  10. 언어 설정
    # echo 'export LANG=ko_KR.UTF-8' >> /etc/profile; source /etc/profile