[FreeBSD]시스템 네트워크 최소 설정

시디넣고 설치완료된 다음에 가장 먼저 하는 작업이다.

[관련 설정 파일]

/etc/resolv.conf
   ->DNS 설정을 해준다. (ping www.daum.net 이 되냐 안되냐의 문제를 쥐고있다.)
/etc/ssh/sshd_config
   -> ROOT로그인을 허용가능하게 해준다, 기본적으로 root 원격접속은 막혀있기 때문이고 보안적으로 막아두는게 좋다.
   ->/etc/ssh/ssh_config 와 비슷해서 잘 못 설정할 수 있으니 주의할것!
/etc/rc.conf
   -> ip설정 게이트웨이설정 등 기본 네트워크 설정 관련 파일이다.
   -> 상대적으로 입력해야 할 게 많은 편이라서 익숙하지 않다면, 다른 시스템에서 복사해와서 IP만 살짝 수정해 주는 것도 좋다.


 네트워크 설정
-[수정]
# echo "nameserver 168.126.63.1" >> /etc/resolv.conf
# echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
# vi /etc/rc.conf
ifconfig_em0="inet 192.168.0.127 netmask 255.255.255.0"
defaultrouter="192.168.0.1"

수정이 완료되면, 아래 2개의 스크립트를 실행해 준다.


[실행]
/etc/netstart
/etc/rc.d/sshd start 혹은 /etc/rc.d/sshd restart


정상적으로 수정되었다면, 아래 명령을 통해 변경사항을 확인한다.
ifconfig
ping www.naver.com
다른 시스템에서 ssh를 통해 root접근이 가능한지 확인!

by 태극프로그래머 | 2009/08/10 17:39 | 트랙백 | 덧글(0)

잠실.... 뜻이란..

서울의 동쪽에 위치한 잠실이라는 마을.

누에를 치는 방을 뜻한다고한다
과거 중국에서는 심한 죄를 지어 처벌을 기다리는 죄인이 갇힌 곳을 잠실 이라고 부른다.

오늘날의 잠실 이라는 지명을 지은것은 조선시대 때라고 하는데, 
이는 어쩌면 지금의 빽빽히 차있는 아파트 단지를 예측한 선견지명이 아닐까 생각해본다.

by 태극프로그래머 | 2009/01/08 20:41 | 트랙백 | 덧글(0)

pgsql autovacuum ON/OFF



vi ~/data/postgresql.conf (autovacuum 파라미터 수정)

pg_ctl reload (conf 적용)




#---------------------------------------------------------------------------
# AUTOVACUUM PARAMETERS
#---------------------------------------------------------------------------

autovacuum = off                       # enable autovacuum subprocess?
#autovacuum_naptime = 60                # time between autovacuum runs, in secs
autovacuum_vacuum_threshold = 1000      # min # of tuple updates before
                                        # vacuum
autovacuum_analyze_threshold = 500     # min # of tuple updates before
                                        # analyze
autovacuum_vacuum_scale_factor = 0.4   # fraction of rel size before
                                        # vacuum
autovacuum_analyze_scale_factor = 0.2  # fraction of rel size before
                                        # analyze
autovacuum_vacuum_cost_delay = -1      # default vacuum cost delay for
                                        # autovac, -1 means use
                                        # vacuum_cost_delay
autovacuum_vacuum_cost_limit = -1      # default vacuum cost limit for
                                        # autovac, -1 means use
                                        # vacuum_cost_limit

by 태극프로그래머 | 2008/11/14 14:13 | 트랙백 | 덧글(0)

Secure CRT 컬럼(라인)안짤리게하기

대단한건아니고, 툴 옵션설정법에 대한 내용입니다.

 

( Tip의이해를 높이기 위해서 문서를 최대창으로보세요. )

 

기본세팅에서의 Secure CRTps aux명령에 대한 응답으로 아래와 같은 형태로 보여지게 됩니다.

root   54415  0.0  0.2  3176  1936  ??  S    Fri05PM   0:03.40 /user/service/bin/rc_syncd

root   54416  0.0  0.2  3176  1920  ??  I    Fri05PM   0:03.38 /user/service/bin/rc_syncd

root   54419  0.0  0.2  3176  1936  ??  I    Fri05PM   0:03.41 /user/service/bin/rc_syncd

root   54420  0.0  0.2  3176  1920  ??  S    Fri05PM   0:03.39 /user/service/bin/rc_syncd

nobody 85634  0.0  0.4 15188  4620  ??  S     1:54AM   0:00.23 /user/service/httpd/bin/httpd -

root   85905  0.0  0.2  5352  1948  ??  Ss    2:22AM   0:00.59 sshd: root@ttyp0 (sshd)

root   86329  0.0  0.2  5352  2000  ??  Ss    2:28AM   0:00.07 sshd: root@ttyp1 (sshd)

root     867  0.0  0.1  2648  1448  p0- I    26Sep08   0:00.00 /user/service/bin/rc_syncd

root     868  0.0  0.1  2652  1452  p0- S    26Sep08  56:21.05 /user/service/bin/rc_syncd

root     906  0.0  0.2  2976  1752  p0- I    26Sep08   0:00.00 /user/service/bin/vmasd

root     907  0.0  2.5 27368 26184  p0- S    26Sep08  10:54.51 /user/service/bin/vmasd

root     908  0.0  0.2  3000  1756  p0- I    26Sep08   0:00.00 /user/service/bin/vmasd

root     909  0.0  0.2  3028  1788  p0- I    26Sep08   0:00.00 /user/service/bin/vmasd

root     912  0.0  0.2  2708  1656  p0- I    26Sep08   0:00.00 rctl: guard: waiting mother dea

root     913  0.0  0.2  2708  1656  p0- S    26Sep08  32:00.36 rctl: mother: service loop (rct

root     914  0.0  1.3 14360 13416  p0- S    26Sep08  84:46.20 rctl: child: check data (rctl)

root     915  0.0  0.2  3028  1788  p0- I    26Sep08   0:00.00 /user/service/bin/vmasd

root     918  0.0  0.1  2568  1496  p0- I    26Sep08   0:00.00 /user/service/bin/arcmond

root     919  0.0  0.4  4804  3688  p0- S    26Sep08   0:36.72 /user/service/bin/arcmond

root     920  0.0  0.2  3028  1788  p0- I    26Sep08   0:00.00 /user/service/bin/vmasd

root     921  0.0  0.2  3028  1788  p0- I    26Sep08   0:00.00 /user/service/bin/vmasd

root     922  0.0  0.2  3028  1788  p0- I    26Sep08   0:00.00 /user/service/bin/vmasd

root     923  0.0  0.2  3028  1788  p0- I    26Sep08   0:00.00 /user/service/bin/vmasd

root   85907  0.0  0.2  2264  1644  p0  Is    2:22AM   0:00.02 -csh (csh)

root   85968  0.0  2.3 26644 23440  p0  S+    2:25AM   0:01.70 /bin/sh ./uri2cmva.sh b

root   86362  0.0  0.2  2632  1800  p0  S+    2:28AM   0:00.01 /user/service/bin/cmva -t rts60

root   86332  0.0  0.2  2248  1588  p1  Ss    2:28AM   0:00.01 -csh (csh)

root   86363  0.0  0.1  1480   816  p1  R+    2:28AM   0:00.00 ps aux

root     508  0.0  0.1  1288   780  v0  Is+  26Sep08   0:00.00 /usr/libexec/getty Pc ttyv0

root     509  0.0  0.1  1288   780  v1  Is+  26Sep08   0:00.00 /usr/libexec/getty Pc ttyv1

root     510  0.0  0.1  1288   780  v2  Is+  26Sep08   0:00.00 /usr/libexec/getty Pc ttyv2

root     511  0.0  0.1  1288   780  v3  Is+  26Sep08   0:00.00 /usr/libexec/getty Pc ttyv3

root     512  0.0  0.1  1288   780  v4  Is+  26Sep08   0:00.00 /usr/libexec/getty Pc ttyv4

root     513  0.0  0.1  1288   780  v5  Is+  26Sep08   0:00.00 /usr/libexec/getty Pc ttyv5

root     514  0.0  0.1  1288   780  v6  Is+  26Sep08   0:00.00 /usr/libexec/getty Pc ttyv6

root     515  0.0  0.1  1288   780  v7  Is+  26Sep08   0:00.00 /usr/libexec/getty Pc ttyv7

 

붉은 글씨로 표기된 것 처럼 명령을 끝까지 보여주지 못하고 기본세팅인 132(column)까지 보여주고 나머지는 잘립니다.

창을 넓혀도 여지없이 132에서 잘리는 것을 볼수있었을겁니다.

 

이러한 현상은 vi를 포함해서 출력되는 모든 화면에서자동으로 80/132 모드가 기본세팅되어있기 때문이고, 설정을통해 변경할 수 있습니다.

 

일단 결과부터 보자면

root   54415  0.0  0.2  3176  1936  ??  S    Fri05PM   0:03.40 /user/service/bin/rc_syncd

root   54416  0.0  0.2  3176  1920  ??  I    Fri05PM   0:03.38 /user/service/bin/rc_syncd

root   54419  0.0  0.2  3176  1936  ??  I    Fri05PM   0:03.41 /user/service/bin/rc_syncd

root   54420  0.0  0.2  3176  1920  ??  S    Fri05PM   0:03.39 /user/service/bin/rc_syncd

nobody 85634  0.0  0.4 15188  4620  ??  S     1:54AM   0:00.23 /user/service/httpd/bin/httpd -k start

root   85905  0.0  0.2  5352  1948  ??  Ss    2:22AM   0:00.59 sshd: root@ttyp0 (sshd)

root   86329  0.0  0.2  5352  2000  ??  Ss    2:28AM   0:00.07 sshd: root@ttyp1 (sshd)

root     867  0.0  0.1  2648  1448  p0- I    26Sep08   0:00.00 /user/service/bin/rc_syncd

root     868  0.0  0.1  2652  1452  p0- S    26Sep08  56:21.05 /user/service/bin/rc_syncd

root     906  0.0  0.2  2976  1752  p0- I    26Sep08   0:00.00 /user/service/bin/vmasd

root     907  0.0  2.5 27368 26184  p0- S    26Sep08  10:54.51 /user/service/bin/vmasd

root     908  0.0  0.2  3000  1756  p0- I    26Sep08   0:00.00 /user/service/bin/vmasd

root     909  0.0  0.2  3028  1788  p0- I    26Sep08   0:00.00 /user/service/bin/vmasd

root     912  0.0  0.2  2708  1656  p0- I    26Sep08   0:00.00 rctl: guard: waiting mother dead (rctl)

root     913  0.0  0.2  2708  1656  p0- S    26Sep08  32:00.36 rctl: mother: service loop (rctl)

root     914  0.0  1.3 14360 13416  p0- S    26Sep08  84:46.20 rctl: child: check data (rctl)

root     915  0.0  0.2  3028  1788  p0- I    26Sep08   0:00.00 /user/service/bin/vmasd

root     918  0.0  0.1  2568  1496  p0- I    26Sep08   0:00.00 /user/service/bin/arcmond

root     919  0.0  0.4  4804  3688  p0- S    26Sep08   0:36.72 /user/service/bin/arcmond

root     920  0.0  0.2  3028  1788  p0- I    26Sep08   0:00.00 /user/service/bin/vmasd

root     921  0.0  0.2  3028  1788  p0- I    26Sep08   0:00.00 /user/service/bin/vmasd

root     922  0.0  0.2  3028  1788  p0- I    26Sep08   0:00.00 /user/service/bin/vmasd

root     923  0.0  0.2  3028  1788  p0- I    26Sep08   0:00.00 /user/service/bin/vmasd

root   85907  0.0  0.2  2264  1644  p0  Is    2:22AM   0:00.02 -csh (csh)

root   85968  0.0  2.3 26644 23440  p0  S+    2:25AM   0:01.70 /bin/sh ./uri2cmva.sh b

root   86362  0.0  0.2  2632  1800  p0  S+    2:28AM   0:00.01 /user/service/bin/cmva -t rts6042.ktsh.co.kr -f /92/05/e/5/9/4/e594f9b99b8

root   86332  0.0  0.2  2248  1588  p1  Ss    2:28AM   0:00.01 -csh (csh)

root   86363  0.0  0.1  1480   816  p1  R+    2:28AM   0:00.00 ps aux

root     508  0.0  0.1  1288   780  v0  Is+  26Sep08   0:00.00 /usr/libexec/getty Pc ttyv0

root     509  0.0  0.1  1288   780  v1  Is+  26Sep08   0:00.00 /usr/libexec/getty Pc ttyv1

root     510  0.0  0.1  1288   780  v2  Is+  26Sep08   0:00.00 /usr/libexec/getty Pc ttyv2

root     511  0.0  0.1  1288   780  v3  Is+  26Sep08   0:00.00 /usr/libexec/getty Pc ttyv3

root     512  0.0  0.1  1288   780  v4  Is+  26Sep08   0:00.00 /usr/libexec/getty Pc ttyv4

root     513  0.0  0.1  1288   780  v5  Is+  26Sep08   0:00.00 /usr/libexec/getty Pc ttyv5

root     514  0.0  0.1  1288   780  v6  Is+  26Sep08   0:00.00 /usr/libexec/getty Pc ttyv6

root     515  0.0  0.1  1288   780  v7  Is+  26Sep08   0:00.00 /usr/libexec/getty Pc ttyv7

 

안잘립니다.

 

 

다들 찾아보면 되는 내용인데 귀찮아서 안찾아보고 영어해석하다 짜증나서 꺼버리는 심정 십분 이해하므로..

제가 찾아본 내용 공유차 ( & 기록차 ㅠ ) 쓰는거고요..

설정법 요약 들어갑니다. (참고로 HELP 문서에 다 있더군요)

 

 

 

글로벌옵션 세팅

1.     Option -> global Option -> Terminal -> Appearance -> Options그룹

2.     Maximum coumns : 132->1024 세팅

 

세션옵션 세팅

1.     Option -> Session Option -> Terminal -> Emulation-> Size그룹

2.     Logical columns : 132->1024 세팅 (원래Logical colmns 라고쓰여져야하는데 웬지 짤려서 안보임-_- )

 

[ 프로그램 재시작 ]

 

참고. 항상 적용되도록 설정하려면 Default세션을 변경해야하는데, 그러려면 Global Option-> General->Default Session 설정 하면됩니다.

 

 

이상~

 

인용 : Global Option

Options group

………

Maximum columns

Enter the maximum columns to be displayed in the SecureCRT application window.

……….

 

 

인용 : Session Option

Terminal / Emulation

Size group

….

Logical rows

Enter the integer value for the number of rows in the session window.

Logical columns

Enter the integer value for the number of columns in the session window.

Note: SecureCRT allows you to set a maximum for the number of columns in the SecureCRT window (the upper limit allowed is 1024 columns). The Maximum columns setting in the Terminal/Appearance category of the Global Options dialog controls the maximum number of columns that can be specified under Session Options.

….

 

 

by 태극프로그래머 | 2008/11/12 02:51 | TNT | 트랙백 | 덧글(1)

grep 제외문자열 -v -Ev

grep에서 특정문자열을 추출하는건 다들 쓰는데 제외하는건 의외로 모르는사람이 많다.

grep Hello a |grep -v apple|grep -v orange| grep -v banana

-v 옵션을 반복하여... 이렇게 쓰는방법이 있고...

grep Hello a |grep -Ev 'apple|orange|banana'

이처럼 -Ev 옵션으로 묶어서 스트링을 걸러내는 방법이 있다.

위엔 원래 알았는데 아래처럼 묶어서 찾는걸 몰라서 찾아보니 역시나 있더이다...

by 태극프로그래머 | 2008/07/23 20:14 | TNT | 트랙백 | 덧글(0)

PGSQL Restart

1. pg_ctl stop
안죽으면? 
2. pg_ctl stop -m f
안죽으면? 
3. pg_ctl stop -m i
안죽으면? 
4. killall -9 postmaster
다시 시작..
5. pg_ctl start -o "-i"

어렵다 이거.-_-

by 태극프로그래머 | 2008/07/23 19:50 | Web/Linux | 트랙백 | 덧글(0)

freebsd port 설치

Port로 어플리케이션의 설치, 삭제, 업데이트는 어떻게 합니까?
포트가 다 설치되어 있다고 가정한다면 포트를 이용한 설치는 원하는 포트가 있는 디렉토리로
가서 "make install" 하시면 됩니다.

예를 들어 xchat이라는 어플을 설치하려 하신다면

# cd /usr/ports/irc/xchat
# make install clean

하면 되겠죠. 한줄로 쓰면

cd /usr/ports/irc/xchat && make install clean

입니다. clean 타겟을 수행하지 않으면 포트 트리에 컴파일하고 남은 것이
그대로 남아 있어서 용량이 부족하게 될 수 있고(특히 XFree86 같이
큰 것을 컴파일할 때) 나중에 찾기도 힘듭니다.

삭제는 해당 포트가 있는 디렉토리에서

# make deinstall

하면 되지만 이 경우 포트와 현재 설치된 패키지의 버전이 일치해야 합니다.
패키지를 지우려면 pkg_delete명령을 쓰시면 됩니다.

# pkg_delete xchat-1.4.2

위와 같은 경우 버전을 꼭 지정해야 합니다. 패키지명의 일부에 해당하는
이름으로 찾으려면

# pkg_delete -x xchat

하시며 됩니다(4.3 이후).

sysutls/pkg_remove 포트를 설치하면 보다 나은 pkg_remove명령을 이용할 수도 있습니다.

# pkg_remove xchat

버전을 정확히 찾으려면

# pkg_info | grep xchat

하시면 됩니다.

오래 전에 포트를 설치하시고 업데이트를 하지 않았다면 설치가 안되는 경우가 있습니다.
보통 이러한 경우에는 cvsup을 이용해서 포트를 다시 업데이트하면 됩니다.

설치된 패키지의 업데이트에는 pkg_update와 sysutils/portupgrade
포트를 이용할 수 있습니다. 각각은 해당 명령의 설명을 참고하세요.

portupgrade의 경우 포트에서 컴파일해서 업그레이드해 줍니다.

가령 png-1.0.10이 설치되어 있는데 png-1.0.11이 최신 버전이라면
(pkg_version명령으로 확인할 수 있습니다) 포트 트리를 업데이트한 후

portupgrade png

로 업그레이드할 수 있습니다.

자세한 포트에 관한 정보는 FreeBSD 핸드북을 참고하세요.

http://www.kr.freebsd.org/handbook/handbook23.shtml#25




-----
여기서 퍼왔습니다
http://kr.blog.yahoo.com/birdingmate/928716

by 태극프로그래머 | 2008/05/02 18:09 | 트랙백 | 덧글(0)

iconv 파일 인코딩 변환

utf 시스템에서 euckr로 인코딩된 파일을 utf로 읽기 위한 작업이다.

 iconv -feuc-kr -tutf-8 web01.html > out.txt

euckr로 되어있던 web01.html 파일이 utf-8로 변경되었다.


정상을 확인하려면 3가지가 일치해야한다.

ssh클라이언트 인코딩
 - 수신 데이터의 문자셋 변경 부분 확인 (UTF-8) . 보통은 CP949
시스템의 인코딩
 - echo $LANG 혹은 env|grep LANG
 - LANG=en_US.UTF-8  확인
에디터의 인코딩
 - 일반적으로 그냥 보임 안된다면 :set fileencodings=utf8 이렇게..



이외에도 DB관련문제/apache 세팅문제 등등..

웹관련 작업을 하게된다면 항상 인코딩문제가 말썽!
환경은 Linux.

p.s.
본포스트를 php의 iconv()함수와 착각하지말것!

by 태극프로그래머 | 2008/04/10 17:28 | Web/Linux | 트랙백 | 덧글(0)

Linux proc 파일시스템을 통한 성능측정


아래의 사이트에서 리눅스 성능 측정을 위한 값에 대한 설명을 볼 수 있다.
http://support.uptimesoftware.com/article.php?id=117#6

uptime이라는 솔루션인데 리눅스 버전의 페이지를 보면, 정확히 원하는 값이 어떠한 값을 의미하는지에 대한 설명을 다루며, 그 값의 source도 명시되어있다.


각 항목별로의 자세한 설명은 리눅스 내부의 documentation 된 파일에 잘 설명되어있는데, 그중 일부를 발췌하면 이러한 것이다.
아래는 iostat 중 /proc/diskstats 파일의 필드가 의미하는 정확한 내용을 설명하였다.

/usr/src/linux/Documentation/iostat.txt
...
Field  1 -- # of reads issued
    This is the total number of reads completed successfully.
Field  2 -- # of reads merged, field 6 -- # of writes merged
    Reads and writes which are adjacent to each other may be merged for
    efficiency.  Thus two 4K reads may become one 8K read before it is
    ultimately handed to the disk, and so it will be counted (and queued
    as only one I/O.  This field lets you know how often this was done.
Field  3 -- # of sectors read
    This is the total number of sectors read successfully.
Field  4 -- # of milliseconds spent reading
    This is the total number of milliseconds spent by all reads (as
    measured from __make_request() to end_that_request_last()).
Field  5 -- # of writes completed
    This is the total number of writes completed successfully.
Field  7 -- # of sectors written
    This is the total number of sectors written successfully.
Field  8 -- # of milliseconds spent writing
    This is the total number of milliseconds spent by all writes (as
    measured from __make_request() to end_that_request_last()).
Field  9 -- # of I/Os currently in progress
    The only field that should go to zero. Incremented as requests are
    given to appropriate request_queue_t and decremented as they finish.
Field 10 -- # of milliseconds spent doing I/Os
    This field is increases so long as field 9 is nonzero.
Field 11 -- weighted # of milliseconds spent doing I/Os
    This field is incremented at each I/O start, I/O completion, I/O
    merge, or read of these stats by the number of I/Os in progress
    (field 9) times the number of milliseconds spent doing I/O since the
    last update of this field.  This can provide an easy measure of both
    I/O completion time and the backlog that may be accumulating.
...


여러가지 삽질의 흔적을 찾아 헤매봐야 결국 기본 문서로 돌아오게 되어있다.

전국1등이 교과서 중심으로 공부했다는 말이 결코 허황된 말이 아님을 매번 그리고 새삼 실감하게 된다.


여러 웹페이지를 뒤적거리고 천번 컴파일 해봐야 정확한 공식 메뉴얼을 이해하지 못하여 생기는 '삽질' 임이 틀림없다.


간략한 업무 프로세스 흐름
0. 무슨 내용이 필요한지 정확히 파악한다.

1. 똑같은 짓 했던 사람이 있는지 열심히 검색해서 베낀다.
2. 1번에서 실패한 잔여 작업에 필요한 매뉴얼을 수집하고, 매뉴얼을 잘 이해하지 못하거나 구현에 어려움을 가진 사람들의 QnA를 살펴보고 문제의 절실함을 깨닫는다.
3. 작업 내용에 관련하여 유사한 오픈소스를 열심히 뒤지고, 거기에 붙어있는 주석을 뚫어지게 해석해서 이해해본다.
4. 그래도 안되는 것들은 기본 메뉴얼을 보고 퍼펙트한 해석 및 기반 지식 습득을 하고, 기존 원천적인 방법을 이해한다.
(시간이 걸리더라도 짧은 매뉴얼의 완벽한 해석이 필요하다)

5. 구현을 마무리한다.


0 -> 4 -> 5 순서대로 하는 것이 능력자인것 같다. ( 이정도 해야 님좀짱 소릴 듣지.. )

경험과 속도가 업무 능력의 척도라고 누가 그러던데..

이해력과 정확도를 겸비하는 것을 절대 간과해서는 안될텐데 말이지...




그리고... 검색능력은...

눈을 감고 글자를 조합하는...


'S E N S'
...
.

by 태극프로그래머 | 2008/03/21 03:54 | 트랙백 | 덧글(0)

dd 사용법



대략 디스크를 괴롭히기 위해서 이런식으로 한다.

dd if=/dev/zero of=/stg/ddfile bs=10240000 count=1000

당연히 if=읽을경로 / of= 쓸경로
bs = 블락 싸이즈
count = 횟수


정작 dd가 무슨약자 or 뜻인지는 모르겠다. (dump..? disk...? )

by 태극프로그래머 | 2008/03/20 18:05 | Web/Linux | 트랙백 | 덧글(2)

<< 이전 페이지     다음 페이지 >>