MySQL에 데이타베이스, 사용자추가

기억력이 나빠서.. 할때마다 문서찾기..

그냥 적어 놓으련다.

mysql> CREATE database 디비;
Query OK, 0 rows affected (0.00 sec)

mysql> GRANT all privileges on 디비.* TO 사용자@localhost
> IDENTIFIED BY ‘패스워드’;
Query OK, 0 rows affected (0.00 sec)

RedHat 9.0에서 MRTG 구축하기 실습

원문은 bigadmin.org의 운영자인 dk가 작성.

필요한 파일을 다운 받아서 /usr/local/src 로 받아둡니다.
초고속으로 설치할 수 있게.. 간단하게 명령어들만 정리했습니다.
자세한 설명은 저도 잘 모르기 때문에.. 생략했습니다.. ^^;;

1. zlib-1.2.1.tar.gz
2. libpng-1.2.5.tar.gz
3. gd-2.0.15.tar.gz
4. mrtg-2.10.5.tar.gz

1. zlib-1.2.1.tar.gz 설치
# gzip -d zlib-1.2.1.tar.gz; tar xvf zlib-1.2.1.tar
# cd zlib-1.2.1
# ./configure –prefix=/usr/local/zlib
# make
# make test
# make install

2. libpng-1.2.5 설치
# cd ..; gzip -d libpng-1.2.5.tar.gz; tar libpng-1.2.5.tar
# mv libpng-1.2.5/ /usr/local/libpng
# cd /usr/local/libpng/
# cp scripts/makefile.linux ./makefile
# make test
# make install

3. gd-2.0.15 설치
# cd /usr/local/src; gzip -d gd-2.0.15.tar.gz; tar xvf gd-2.0.15.tar
# cd gd-2.0.15/
# ./configure –prefix=/usr/local/gd
# make
# make install

4. mrtg-2.10.5 설치
# cd ..; gzip -d mrtg-2.10.5.tar.gz; tar xvf mrtg-2.10.5.tar
# cd mrtg-2.10.5/
# ./configure –prefix=/usr/local/mrtg \
> –with-gd=/usr/local/gd \
> –with-z=/usr/local/zlib \
> –with-png=/usr/local/libpng
# make
# make install
./configure –help=short 이렇게 하시면.. 간단하게 옵션들 보실 수 있습니다.

5. /etc/snmp/snmp.conf 수정
mrtg를 운영하기 위해선 snmpd 가 돌고 있어야 합니다.
/etc/rc.d/snmpd start 해주세용..
ucd-snmp랑 net-snmp 두가지가 있다고 하는데.. 제 머신에는 net-snmp가 설치되어있습니다.
이 부분에 대해서 잘 아시는분은 좀 알려주세요~~
vi 로 파일을 열어서

####
# First, map the community name “public” into a “security name”
# sec.name source community
#com2sec notConfigUser default public
com2sec local servertnt.com dklee

이런 식으로 수정해주세요.
# /etc/rc.d/snmpd restart

6. mrtg.cfg 파일 만들기
# cd /usr/local/mrtg/bin
# mkdir /usr/local/mrtg/conf
# cfgmaker –global ‘WorkDir:/home1/mrtg/public_html’ \
> –global ‘Options[_]:bits,growright’ \
> –output /usr/local/mrtg/conf/mrtg.cfg \
dklee@servertnt.com

마지막 부분은 snmp.conf 에서 수정한 community와 host입니다.

7. crontab 에서 실행 설정
저는 아래와 같이 작업했습니다.. 참고만 하세요..

/root/bin/mrtg.sh 만들기

#!/bin/sh
env LANG=C /usr/local/mrtg/bin/mrtg /usr/local/mrtg/conf/mrtg.cfg

# crontab -u root -e
0/5 * * * * /root/bin/mrtg.sh

여기 까지 입니닷~~. /etc/snmp/snmp.conf 파일을 수정해도 mrtg.cfg 파일이 정상적으로
생성되지 않을 수 있다고 합니다. snmp.conf 이거 받으셔서 /etc/snmp/snmp.conf로
파일을 올리시고.. 원본파일은 snmp.conf.org 정도로 수정해 놓으세요.
아까 5번 부분에서 설명한 부분만 수정해서 다시 데몬을 올려보세요~~

이것도 영어다

kldp 블로그에 재미있는 글이 있어서.. 이곳에.. 헤에헤..

원문은 여기.. http://blog.kldp.org/node/view/722

Aoccdrnig to a rscheearch at an Elingsh uinervtisy, it deosn’t mttaer in waht oredr the ltteers in a wrod are, the olny iprmoetnt tihng is taht frist and lsat ltteer is at the rghit pclae. The rset can be a toatl mses and you
can sitll raed it wouthit porbelm. Tihs is bcuseae we do not raed ervey lteter by it slef but the wrod as a wlohe.

snoop

snoop의 간단한 아주 간단한 사용법.. 헤에헤..

심심해서 써 봅니다..

solaris에서 기본적으로 제공되는 snoop를 이용하면

패킷들을 볼 수 있습니다.

물론, 네트워크의 정상 작동 유무를 확인할 수 있는 툴입니다만
이것을 이용하면, telnet, ftp등이 얼마나 보안에
취약한지도 알 수 있습니다.

각설하고,

snoop -d hme0 host xxx.xxx.xxx.xxx

이렇게 하면, 기본적으로 hme0를 통과해서
목적지가 xxx.xxx.xxx.xxx인 패킷들이 보입니다.

비슷한 툴로는 tcpdump가 있습니다.

자세한 사용법은 man snoop 하십시요 (-:

C shell에서 setfilec의 역할

set filec

Set file-completion for csh

This allows the escape key to be used for filename completion in a csh line command.

E-mail Header의 의미가 자세히 설명되어 있는곳..

http://www.stopspam.org/email/headers.html 에 아주 자세하게 설명..

단, 영문이라 보기에 불편하지만, 꽤나 상세하게 나와 있다.

OBP에서 에러

하드 디스크를 하나 추가하고 Probe-scsi 했을때

아래 에러 메시지가 나왔다.

Fatal SCSI error at script address 2d0 SCSI parity error Arbitration Complete.

하드디스크를 꾹 눌러주고 다시 했더니 정상 …

접촉불량인걸까?

watchdog reset?

ultra60.

solaris7

x윈도우 뜨고 로그인 하려고하면

watchdog reset
Externally initated reset

요런 메시지가 나오면서 prom 프롬프트가 떠버림..

원인및 해결방법은?

spamassassin…

spamassassin 에서
spamd 실행시 에러 …

unix dgram connect: Socket operation on non-socket at /usr/local/bin/spamd line xxx

solution..
add next option.

–syslog-socket=inet ..

/etc/init.d/spamd 화일
===========================================================

#!/sbin/sh
#
# Copyright (c) 2001 by Sun Microsystems, Inc
# All rights reserved.
#
#ident “@(#)spamd 05/08/06 POSS”

case “$1” in
start)
/usr/local/bin/spamd -d -i 0.0.0.0 -x -u qmaild –syslog-socket=inet &

;;
stop)
/bin/pkill spamd

;;
*)
echo “Usage: $0 { start | stop }”
exit 1
;;
esac
exit 0

Install SpamAssassin on solaris9…

자, 이제 qmail 과 courier-imap을 성공적으로 설치해서 이전에 사용하던 squirrelmail 도 이상없이 작동된다.

남은것은 스팸메일처리. SpamAssassin을 설치하려고 한다.

1. spamassassin은 perl로 되어 있으므로 perl을 설치해야 한다.
2. spamassassin을 다운로드 받는다.
3.
Using CPAN via CPAN.pm:

perl -MCPAN -e shell [as root]
o conf prerequisites_policy ask
install Mail::SpamAssassin
quit

CPAN 모듈이 설치되어 있지 않다면 perl -MCPAN -e shell 명령을 내렸을대 여러가지 설치과정을 자동으로 수행한다. 이때 wget과 같은 프로그램들의 패스를 물어본다. /usr/sfw/bin이 path에 포함되어 있도록 한다.

마지막으로 install Mail::SpamAssassin 명령을 내리면 필요한 CPAN 모듈을 반자동으로 설치한다. 물론, SpamAssassin도 자동으로 설치된다.

4. 스팸데몬의 구동

/usr/local/bin/spamd -d -i 0.0.0.0 -x -u qmaild &

5. 테스트

#/usr/local/bin/spamassassin -t

poss | 목, 09/15/2005 – 03:02

제대로 작동을 안한다. 설정화일을 바꾸어 bayes 필터를 사용가능하도록 설정했다.
=================================
rewrite_header Subject [SPAM]
report_safe 1
#trusted_networks 212.17.35.
lock_method flock
required_hits 5

use_bayes 1
bayes_path /etc/mail/spamassassin/bayes
bayes_file_mode 0700
use_auto_whitelist 1
dns_available yes
===============================

설정후

# sa-learn –spam -C /etc/mail/spamassassin –showdots –mbox –dir /path/to/spam_mbox

명령으로 스팸을 학습시킴…
결과가 궁금해진다.