gnuplot 간단사용법

Posted at 2008/04/21 10:10 // in Tips // by Daniel

정말 단순한 점 그래프만 그릴거라면

텍스트 파일에 컬럼으로 쭉 덤프된 파일 만들고

$ gnuplot


#gnuplot 프롬프트에서

# plot "dump.txt" u 1:2 title "column2", "dump.txt" u 1:3 title "column3"

이런식으로 쓰면 됨.

image

이 그림은

plot "r30.txt" u 1 title "best", "r30.txt" u 2 title "average"


plot 커맨드를 파일에서 입력해 그리고자 한다면

echo "plot \"${PLOT_FILE}\" u 1 title \"best\", \"${PLOT_FILE}\" u 2 title \"average\"" > plot.cmd
gnuplot -persist plot.cmd

이런식으로 하면 된다.

-persist는 플롯을 그리고 나서 종료되어도 플롯 그림은 그대로 남아있게 하는 옵션이다.

크리에이티브 커먼즈 라이센스
Creative Commons License

/var/tmp/badcontext

Posted at 2008/04/17 10:10 // in Tips // by Daniel

관리하는 서버가 계속 이런 파일이 생기네요

selinux관련 오류같은데

일단

restorecon으로 클리어하고 지우면 된다는군요.

selinux를 잘 몰라서.. 좀 더 알아봐야겠습니다.

http://www.redhat.com/archives/fedora-selinux-list/2004-September/msg00161.html

restorecon -f /var/tmp/badcontext.YGZFP27816
Will fix the context, then delete the files. We are investigating how do handle this better. Also
some of the bad contexts are not really bad, IE the tools not smart enough to realize that the context is
valid. Setfiles is just reporting files that don't match the regular expessions in the file_contexts file.

So cache files created by mozilla get marked as bad even though they are valid.

크리에이티브 커먼즈 라이센스
Creative Commons License

bash에서 for문을 c언어처럼 쓰기

Posted at 2008/04/16 15:24 // in Tips // by Daniel

#!/bin/bash
for i in `seq 1 10`;
do
echo $i
done

#!/bin/bash
COUNTER=0
while [ $COUNTER -lt 10 ]; do
echo The counter is $COUNTER
let COUNTER=COUNTER+1
done


#!/bin/bash
COUNTER=0
while [ $COUNTER -lt 10 ]; do
echo The counter is $COUNTER
let COUNTER=COUNTER+1
done


#!/bin/bash
COUNTER=20
until [ $COUNTER -lt 10 ]; do
echo COUNTER $COUNTER
let COUNTER-=1
done



산술계산

echo $((1+1))

echo $[1+1]


복잡한 계산은 bc를 사용한다

"echo 3/4 | bc -l"

크리에이티브 커먼즈 라이센스
Creative Commons License

Redirection

Posted at 2008/04/10 14:12 // in Tips // by Daniel

http://www.cpqlinux.com/redirect.html

  • The following command saves stdout and stderr to the files "out.txt" and "err.txt", respectively.
    [root@server /root]# ./cmd 1>out.txt 2>err.txt
  • The following command appends stdout and stderr to the files "out.txt" and "err.txt", respectively.
    [root@server /root]# ./cmd 1>>out.txt 2>>err.txt
  • The following command functions similar to the above two commands, but also copies stdout and stderr to the files "stdout.txt" and "stderr.txt", respectively.
    [root@server /root]# (((./cmd | tee stdout.txt) 3>&1 1>&2 2>&3\
    |tee stderr.txt) 3>&1 1>&2 2>&3) 1>out.txt 2>err.txt

    Note: Lines that end in a backslash are continued on the next line. Any such lines should be keyed in as one complete line. The lines are too long to fit on the web page without formatting them this way.

  • Capturing stdout
    The following will capture a copy of stdout and save it to a file called "stdout.txt"
    [root@server /root]# ./cmd | tee stdout.txt

    stdout goes through the pipe and tee is able to save a copy of it to the file "stdout.txt"; however, we just lost control of stderr. stderr will not go through the pipe, instead it goes directly to our display.

  • Gaining control of stderr and stdout.
    Lets gain control again of stderr and stdout. We do this by surrounding our command with a set of parenthesis.
    [root@server /root]# (./cmd | tee stdout.txt)

    Capturing stderr
    Now that we have swapped our stdout and stderr, lets hook up tee once again. tee will now capture stderr (tee believes that it is really stdout because stdout is the only thing that can come through the pipe).

    [root@server /root]# (./cmd | tee stdout.txt) 3>&1 1>&2 2>&3 \
    | tee stderr.txt

     

  • 크리에이티브 커먼즈 라이센스
    Creative Commons License

    make image script (u-boot용 커널 이미지 생성)

    Posted at 2008/04/08 15:00 // in Tips // by Daniel

    $ cat make_image.sh
    #!/bin/sh
    TARGET_IMAGE=MPkernel`grep "EXTRAVERSION =" Makefile | awk '{print $3}'`         # ---->  MPkernel이름에 Makefile에 있는 버전정보를 붙인다.
    TARGET_IMAGE=${TARGET_IMAGE}-`date +%m-%d`   # ---> 추가로 날짜를 붙인다.
    mkimage -A arm -T kernel -C none -a 0x7fc0 -e 0x8000 -n MPCore -d arch/arm/boot/Image ${TARGET_IMAGE} && echo resulting image name = ${TARGET_IMAGE}


    $ ./make_image.sh
    Image Name:   MPCore
    Created:      Tue Apr  8 14:54:37 2008
    Image Type:   ARM Linux Kernel Image (uncompressed)
    Data Size:    2549424 Bytes = 2489.67 kB = 2.43 MB
    Load Address: 0x00007FC0
    Entry Point:  0x00008000
    resulting image name = MPkernel-arm1-perfctr-04-08


    실행하면 위와같이 생성된다.

    개인적으로 나중에 보려고 올림.

    크리에이티브 커먼즈 라이센스
    Creative Commons License

    Redhat FedoraCore + Subversion + Trac 설치

    Posted at 2008/04/07 18:01 // in Tips // by Daniel

    http://yuzi.egloos.com/1318482

    img_6_41_0

    Yuzi님의 자료입니다.

    ... 레드햇 페도라코어에서 yum유틸리티를 사용하여 Subversion과 Trac을 설치하는 방법을 순서도로 그렸습니다. 팀단위로 Subversion서버 설치할때, Copy & Paste하려고 만들었던 파일입니다. 이거보고 깔면 설치가 쉬워요 ...

    이 외에도 볼만한 자료들이 더 있습니다.

    크리에이티브 커먼즈 라이센스
    Creative Commons License

    subversion에서 무시할 파일 설정

    Posted at 2008/04/05 18:37 // in Tips // by Daniel

    속성 svn:ignore로 설정할 수 있습니다.


    사용 방법 :

    $ cat > ignorelist
    gpl-2.0.txt
    result_10.txt
    result_30.txt
    result_100.txt
    tsp


    이런식으로 무시할 파일 목록을 만들어두고

    $ svn propset -R svn:ignore -F ignorelist .

    property 'svn:ignore' set (recursively) on '.'

    이렇게 세팅합니다. -R 옵션은 하위 디렉토리까지 적용되게 하는 겁니다.

    혹시 추가할 파일이 있으면 나중에 svn propedit하면 됩니다.

    # svn propedit svn:ignore include/arch

    세팅한 다음엔 commit해야 됩니다.

    svn stat으로 살펴보면 알수 있습니다.

    $ svn stat  (설정전)
    ?      tsp
    ?      result_10.txt
    ?      gpl-2.0.txt

    $ svn stat  (설정후)

    $

    참고 - http://kldp.org/node/60931

    크리에이티브 커먼즈 라이센스
    Creative Commons License

    [펌][통신관련] 무료 파일공유서버를 소개합니다.

    Posted at 2008/03/25 13:07 // in Tips/Web // by Daniel

    출처 - http://ruska.tistory.com/entry/통신관련-무료-파일공유서버를-소개합니다

    mediafire라는 무료 파일서버

    1. 무료 파일서버(mediafire)

    다양한 종류의 파일을 자유롭게 업로드 할 수 있고,
    자신의 홈페이지 및 블로그, 게시판에 링크 가능하며, 
    간단한 회원가입으로 업로드 한 파일 목록 조회, 삭제등 자유롭게 관리가 가능합니다.
    종류와 사이즈에 관계 없이 파일을 업로드 할 수 있습니다.

    http://www.mediafire.com

    사용자 삽입 이미지

    회원가입도 이메일주소에 패스워드면 끝나는 아주 좋은 사이트입니다..
    흠이라면 외국서버이기때문에 업로드나 다운속도가 느리다는점이죠..
    그러나 어떤 용량이든 상관없이 업/다운 가능해서 왠만한 파일서버로 활용하기는
    너무 좋을듯 싶어 여기에 소개 시키게 되었습니다..

    공짜 파일서버를 찾으신다면 한번 가보세여.. 아주 좋네요..

    그리고 추가로 국내껏 소개..

    2. 속도 빠른 이미지 호스팅 http://www.fileslink.com

       Fileslink.com 은 사진이나 이미지등을 업로드하여 링크해야 하는분을 위해 무료 이미지 호스팅을  제공해드립니다.
      회원가입이나 복잡한 절차 없이 믿을 수 있는 호스팅 서비스를 제공합니다.
      파일을 업로드 하는 방법은 정말 쉽고 간단합니다.
      찾아보기 버튼을 클릭하여 업로드 할 이미지 파일을 선택한 후, 업로드 버튼을 클릭 이게 끝이에여..ㅋ

    그리고 마지막으로 지금은 유료화가 되었지만

    얼마전까지 무료로 어떤파일이든 한파일당 30M까지 무제한 업/다운 할수있는
    3. 놀이터 http://www.playnow.co.kr 을 소개합니다.

    위 세 사이트 한번씩 방문하셔서 유용하게 사용하시길 바랍니다..^^

    크리에이티브 커먼즈 라이센스
    Creative Commons License

    텍스트큐브에 싸이 방명록 embed 하기

    Posted at 2008/03/22 22:03 // in Tips // by Daniel
    GuestBook이란 제목으로 게시물을 작성하고
    html로 다음과 같은 코드를 넣었음.

    <iframe scrolling="yes" frameBorder="0" src="방명록 주소" marginWidth="0" style="overflow-y: scroll; width: 640px; height: 800px"></iframe>

    그리고 관리자 화면에서 스킨에 Guest Book 링크를 entry/GuestBook 으로 바꿔주면 된다.
    크리에이티브 커먼즈 라이센스
    Creative Commons License

    emdebian setup

    Posted at 2008/03/22 13:36 // in Tips // by Daniel

    http://wiki.debian.org/EmdebianToolchain

    gpg --recv-key 0x97BB3B58
    gpg -a --export 0x97BB3B58 > emdebian.key
    apt-key add emdebian.key
    apt-get update

    --------------------
    vi sources.list
    --> add
    ################################
    # EmDebian Toolchain [i386 and AMD64]
    # Etch
    # deb http://www.emdebian.org/debian/ stable main
    # Sid
    deb http://www.emdebian.org/debian/ unstable main
    # Lenny
    # deb http://www.emdebian.org/debian/ testing main

    ------------------------------

    apt-cache search armel

    apt-get install libc6-armel-cross libc6-dev-armel-cross
    apt-get install binutils-arm-linux-gnueabi
    apt-get install dpkg-cross
    (inserted ubuntu cdrom)

    apt-get -s install libgomp1 (for dependency.. but not worked)
    apt-get install gcc-4.2-arm-linux-gnueabi
    -> gcc-4.2-arm-linux-gnueabi: Depends: libgomp1 (>= 4.2.2-3) but 4.2.1-5ubuntu4 is to be installed

    added sources.list
    ##########################333
    # debian
    deb http://ftp.kr.debian.org/debian/ testing main
    deb-src http://ftp.kr.debian.org/debian/ testing main

    크리에이티브 커먼즈 라이센스
    Creative Commons License