2012년 12월 2일 일요일

unbuntu에서 R 셋업방법

sudo apt-get install r-base

emacs 2.4 셋업

ess 설치 : ess란 emacs에서 통계관련 툴을 도와주는 패키지

  • emacs 실행  후 M-x package-install ess
  • 또는 sudo apt-get install ess

R 실행 
  • M-x R
  • starting data directory? [시작할 디렉토리]

자동완성
  • Shift -  : <-
  • Tab : 자동완성

2012년 10월 22일 월요일

동일LAN상 다른 머신 접속방법

A머신  - 192.168.0.103
B머신 - 192.168.0.100

B나 A에서 
B 의 /etc/hosts 끝에 192.168.0.103 desktop

a@desktop> erl -sname a@desktop -setcookie abc
b@test> erl -sname b@desktop -setcookie abc

{badrpc,nodedown} -> host가 다른 경우 나옴.

Connection attempt from disallowed node -> cookie 값이 다른 경우 나옴.


2012년 10월 2일 화요일

oozie 3.2.0

컴파일
./mkdistro.sh -DskipTests

컴파일 hadoop과 잘 맞는 버젼
0.20.205

안 맞는 버젼
0.20.1 : oozie-setup은 되지만 실행후에 Auth 관련 에러 발생
1.0.1 : oozie-setup 쉘을 수정하면 될꺼 같지만 쉘을 수정하지 않으면 setup도 안됨

기능
workflow을 이용해서 mapreduce을 할 수 있음.
coodinator로 주기적으로 workflow를 실행시킬수 있음

2012년 8월 9일 목요일

egovframework.rte.fdl.property.impl.EgovPropertyServiceImpl 버그

public void afterPropertiesSet() throws FdlException {
        try {

            egovProperties = new ExtendedProperties();

            // 외부파일이 정의되었을때
            if (extFileName != null) {
                refreshPropertyFiles();
            }

            Iterator it = properties.entrySet().iterator();
            while (it.hasNext()) {

                Map.Entry entry = (Map.Entry) it.next();
                String key = (String) entry.getKey();
                String value = (String) entry.getValue();

                if (EgovPropertyService.LOGGER.isDebugEnabled()) {
                    EgovPropertyService.LOGGER.debug(messageSource.getMessage(
                        "debug.properties.property",
                        new String[] {key, value }, Locale.getDefault()));
                }

                if (key == null || key.equals("")) {
                    if (EgovPropertyService.LOGGER.isErrorEnabled())
                        EgovPropertyService.LOGGER.error(messageSource
                            .getMessage("error.properties.check.essential",
                                new String[] {}, Locale.getDefault()));
                    throw new FdlException(messageSource,
                        "error.properties.check.essential", null);
                }

                egovProperties.put(key, value);
            }

        } catch (Exception e) {
            if (e instanceof FdlException)
                throw (FdlException) e;
            else {
                if (EgovPropertyService.LOGGER.isErrorEnabled())
                    EgovPropertyService.LOGGER.error(messageSource.getMessage(
                        "error.properties.initialize.reason", new String[] {},
                        Locale.getDefault()));
                throw new FdlException(messageSource,
                    "error.properties.initialize", e);
            }
        }
    }

위의 코드에서

  egovProperties.put(key, value);

이 부분이 버그이다.
이 소스를 그대로 쓰면

public class Test {
   private EgovPropertyService propertiesService;

   public void showKeys() {
       Iterator keys = soapPropertiesService.getKeys();
       while(keys.hasNext()) {
         System.out.println(keys.next());
       }
   }
}


위와 같이 했을 경우 key값이 절대로 나오질 않는다.
ExtendedProperties 가 hashMap을 상속받아서
addProperties란 메소드를 쓰지 않으면  keys 들어가질 않는다.
put으로 HashTable에서 직접 key,value을 넣으니 기능을 잘돌아가지만
getKeys로 해서 가져올려고 할 경우엔 값이 나오질 않는 버그가 있다. ㅡㅡa

만들어 놓고 테스트도 안하고 배포 하는거 같다.

2012년 8월 3일 금요일

:use :require :import 다른 점

https://groups.google.com/d/topic/clojure/c8TRHm93ZWs/discussion


  • :use 
    •  namespace 사용없이 파일에 있는 함수를 호출해 옴
    • 자바에서 static import 랑 비슷하면 
    • import static org.junit.Assert.* 와 같은
    • 사용법
      • (ns some.namespace
          (:require [clojure.contrib.json :as json])
          (:use [clojure.string :only [trim lower-case split]]
                [clojure.contrib.shell-out]
                [clojure.pprint]
                [clojure.test]))
        
  • :require 
    • namespaec을 사용하면 파일에 있는 함수를 호출해 옴. 
    • 자바에서 import 와 같음
    • 사용법
      • (ns rosettacode.24game
          (:require [clojure.string :as str]))
        
        (defn parse-infix-data
          "input '1+2+3+4'
           output (1 + 2 + 3 + 4)
           where the numbers are clojure numbers, and the symbols are clojure operators"
          [string] (map read-string (next (str/split string #""))))
        
  • :import
    • java class를 import 해 옴 
    • 사용법
      • ;; Multiple imports at once.
        (import '(java.util Date Calendar)
                '(java.net URI ServerSocket)
                java.sql.DriverManager)
        
      • user=> (import java.util.Date)
        java.util.Date
        
        user=> (def *now* (Date.))
        #'user/*now*
        
        user=> (str *now*)
        "Tue Jul 13 17:53:54 IST 2010"
        

:

2012년 8월 1일 수요일

clojure 개발 방법

leiningen 설치방법 
wget https://raw.github.com/technomancy/leiningen/preview/bin/lein
chmod +xr lein
lein self-install

leiningen 설명
http://ageldama.tistory.com/94

프로젝트 생성
lein new 프로젝트명

emacs 설정

  • starter kit 설치 
  •  M-x package-install clojure-mode


swank 추가 
emacs project.clj
 
(defproject firstClojure "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :plugins [[lein-swank "1.4.4"]]
  :dependencies [[org.clojure/clojure "1.4.0"]])

slime 실행 

M-x clojure-jack-in





2012년 7월 25일 수요일

chattr

http://slog2.egloos.com/3493248

RAID

http://ko.wikipedia.org/wiki/RAID

http://loversky20.tistory.com/147

http://oracle.tistory.com/185


RAID 0 용량 계산 방법

RAID 0 시스템 내 각 디스크의 용량은 모두 동일합니다.
RAID 레벨 0 구성에서 스토리지 용량은 드라이브의 수에 디스크의 용량을 곱해서 계                                                                   산합니다.


(C = n*d)
C = 사용 가능한 용량
n = 디스크의 수
d = 디스크의 용량
예를 들어 RAID 0 어레이에서 각 용량이 1,000 GB인 드라이브가 4개 있다면 어레이
의 총 용량은 4,000 GB가 됩니다.
C = (4*1,000)


RAID 1 용량 계산 방법
RAID 1 시스템 내 각 디스크의 용량은 모두동일합니다.

RAID 레벨 1 구성에서 스토리지 용량은 드라이브의 수에 디스크의 용량을 곱한 다음 2
로 나누어 계산합니다. 
즉 C = n*d/2
여기서:
C = 사용 가능한 용량
n = 디스크의 수
d = 디스크의 용량
예를 들어 RAID 1 어레이에서 각각의 용량
이 1,000 GB인 드라이브가 4개 있다면 어
레이의 총 용량은 2,000 GB가 됩니다.
C = (4*1,000)/2


RAID 3 용량 계산 방법
RAID 3 시스템 내 각 디스크의 용량은 모두동일합니다.
RAID 레벨 3 구성에서 스토리지 용량은 드라이브의 수에서 1을 뺀 다음 디스크의 용
량을 곱해서 계산합니다. 
C = (n-1)*d
여기서:
C = 사용 가능한 용량
n = 디스크의 수
d = 디스크의 용량
예를 들어 RAID 3 어레이에서 각각의 용량이 1,000 GB인 드라이브가 4개 있다면 어레이의 총 용량은 3,000 GB가 됩니다.
C = (4-1)*1,000


RAID 3+Spare 용량 계산 방법
RAID 3+Spare 시스템 내 각 디스크의 용량
은 모두 동일합니다.
RAID 3+Spare 구성에서 스토리지 용량은 드라이브의 수에서 2를 뺀 다음 디스크의 용량을 곱해서 계산합니다. 
C = (n-2)*d

여기서:
C = 사용 가능한 용량
n = 디스크의 수
d = 디스크의 용량

예를 들어 RAID 3+Spare 어레이에서 각각의 용량이 1,000 GB인 드라이브가 4개 있다면 어레이의 총 용량은 2,000 GB가 됩니다.
C = (4-2)*1,000


RAID 5 용량 계산 방법
RAID 5 시스템 내 각 디스크의 용량은 모두 동일합니다.
RAID 레벨 5 구성에서 스토리지 용량은 드라이브의 수에서 1을 뺀 다음 디스크의 용량을 곱해서 계산합니다. 즉
C = (n-1)*d
여기서:
C = 사용 가능한 용량
n = 디스크의 수
d = 디스크의 용량

예를 들어 RAID 5 어레이에서 각각의 용량이 1,000 GB인 드라이브가 4개 있다면 어레이의 총 용량은 3,000 GB가 됩니다.
C = (4-1)*1,000


RAID 5+Spare 용량 계산 방법
RAID 5+Spare 시스템 내 각 디스크의 용량은 모두 동일합니다.

RAID 5+Spare 구성에서 스토리지 용량은드라이브의 수에서 2를 뺀 다음 디스크의
용량을 곱해서 계산합니다. 즉
C = (n-2)*d

여기서:
C = 사용 가능한 용량
n = 디스크의 수
d = 디스크의 용량

예를 들어 RAID 5+Spare 어레이에서 각각의 용량이 1,000 GB인 드라이브가 4개 있
다면 어레이의 총 용량은 2,000 GB가 됩니다.
C = (4-2)*1,000


RAID 6 용량 계산 방법
RAID 6 시스템 내 각 디스크의 용량은 모두
동일합니다.

RAID 6 구성에서 스토리지 용량은 드라이
브의 수에서 2를 뺀 다음 디스크의 용량을
곱해서 계산합니다. 즉
C = (n-2)*d

여기서:
C = 사용 가능한 용량
n = 디스크의 수
d = 디스크의 용량

예를 들어 RAID 6 어레이에서 각각의 용량 이 1,000 GB인 드라이브가 5개 있다면 어
                                                               레이의 총 용량은 3,000 GB가 됩니다.
C = (5-2)*1,000


RAID 0+1 용량 계산 방법

RAID 0+1 시스템 내 각 디스크의 용량은 모두 동일합니다.
RAID 0+1 구성에서 스토리지 용량은 드라이브의 수에 디스크 용량을 곱한 다음 2로
나누어 계산합니다. 
C = n*d/2
여기서:
C = 사용 가능한 용량
n = 디스크의 수
d = 디스크의 용량
예를 들어 RAID 0+1 어레이에서 각각의 용량이 1,000 GB인 드라이브가 4개 있다면                                                         어레이의 총 용량은 2,000 GB가 됩니다.
C = (4*1,000)/2



RAID 10 용량 계산 방법
RAID 10 시스템 내 각 디스크의 용량은 모
두 동일합니다.
RAID 10 구성에서 스토리지 용량은 드라이브의 수에 디스크 용량을 곱한 다음 2로 나                                                                 누어 계산합니다. 
C = n*d/2
여기서:
C = 사용 가능한 용량
n = 디스크의 수
d = 디스크의 용량
예를 들어 RAID 10 어레이에서 각각의 용량
                                    이 1,000 GB인 드라이브가 4개 있다면 어
                                                           레이의 총 용량은 2,000 GB가 됩니다.
C = (4*1,000)/2


리눅스 파일시스템

저널링 파일시스템 분석
http://www.ibm.com/developerworks/kr/library/l-journaling-filesystems/

저널링 파일 시스템 소개
http://blog.daum.net/_blog/BlogTypeView.do?blogid=0CNH3&articleno=5463186&categoryId=469591&regdt=20060911200234#ajax_history_home

대표적인종류 :ext3JFSReiserFSXFS


2012년 7월 18일 수요일

2012년 7월 17일 화요일

erlang에서 when 구분에서 or 사용법


http://stackoverflow.com/questions/1110601/in-erlang-when-do-i-use-or-or

; => or  : F(A,B) when A=:=B ; A > 0- > 
, => and :  F(A,B) when A=:=B, A > 0- > 


---------------------------------------------
댓글보고 수정했습니다. whne -> when ^^;;



python + unbutu notification

http://developer.ubuntu.com/resources/technologies/notification/2/#icon-summary-body-python


#!/usr/bin/python
################################################################################
##3456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
##      10        20        30        40        50        60        70        80
##
## Info:
##    Example of how to use libnotify correctly and at the same time comply to
##    the new jaunty notification spec (read: visual guidelines)
##
## Run:
##    chmod +x icon-summary-body.py
##    ./icon-summary-body.py
##
## Copyright 2009 Canonical Ltd.
##
## Author:
##    Mirco "MacSlow" Mueller <mirco.mueller@canonical.com>
##
## This program is free software: you can redistribute it and/or modify it
## under the terms of the GNU General Public License version 3, as published
## by the Free Software Foundation.
##
## This program is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranties of
## MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
## PURPOSE.  See the GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License along
## with this program.  If not, see <http://www.gnu.org/licenses/>.
##
################################################################################
import sys
import pynotify
# even in Python this is globally nasty <img src="http://developer.ubuntu.com/wp-includes/images/smilies/icon_smile.gif" alt=":)" class="wp-smiley"> , do something nicer in your own code
capabilities = {'actions':             False,
        'body':                False,
        'body-hyperlinks':     False,
        'body-images':         False,
        'body-markup':         False,
        'icon-multi':          False,
        'icon-static':         False,
        'sound':               False,
        'image/svg+xml':       False,
        'private-synchronous': False,
        'append':              False,
        'private-icon-only':   False}
def initCaps ():
    caps = pynotify.get_server_caps ()
    if caps is None:
            print "Failed to receive server caps."
        sys.exit (1)
    for cap in caps:
        capabilities[cap] = True
def printCaps ():
    info = pynotify.get_server_info ()
    print "Name:          " + info["name"]
    print "Vendor:        " + info["vendor"]
    print "Version:       " + info["version"]
    print "Spec. Version: " + info["spec-version"]
    caps = pynotify.get_server_caps ()
    if caps is None:
            print "Failed to receive server caps."
        sys.exit (1)
    print "Supported capabilities/hints:"
    if capabilities['actions']:
        print "\tactions"
    if capabilities['body']:
        print "\tbody"
    if capabilities['body-hyperlinks']:
        print "\tbody-hyperlinks"
    if capabilities['body-images']:
        print "\tbody-images"
    if capabilities['body-markup']:
        print "\tbody-markup"
    if capabilities['icon-multi']:
        print "\ticon-multi"
    if capabilities['icon-static']:
        print "\ticon-static"
    if capabilities['sound']:
        print "\tsound"
    if capabilities['image/svg+xml']:
        print "\timage/svg+xml"
    if capabilities['private-synchronous']:
        print "\tprivate-synchronous"
    if capabilities['append']:
        print "\tappend"
    if capabilities['private-icon-only']:
        print "\tprivate-icon-only"
    print "Notes:"
    if info["name"] == "notify-osd":
        print "\tx- and y-coordinates hints are ignored"
        print "\texpire-timeout is ignored"
        print "\tbody-markup is accepted but filtered"
    else:
        print "\tnone"
if __name__ == '__main__':
    if not pynotify.init ("icon-summary-body"):
        sys.exit (1)
    # call this so we can savely use capabilities dictionary later
    initCaps ()
    # show what's supported
    printCaps ()
    # try the icon-summary-body case
    n = pynotify.Notification ("Cole Raby",
                   "Hey pal, what's up with the party "
                   "next weekend? Will you join me "
                   "and Anna?",
                   "notification-message-im")
    n.show ()