달력

32024  이전 다음

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31

펌 : http://www.mapoo.kr/entry/vi-%EC%82%AC%EC%9A%A9%EC%8B%9C-M-%EC%97%86%EC%95%A0%EA%B8%B0


vi(m)을 사용하다보면 윈도우즈에서 작업한 텍스트 파일에 ^M 문자가 붙는 경우를 종종 본다. 때문에 문서 보기가 상당히 귀찮아 보일 때가 있다. 특히, SQL 백업 파일을 볼 때 이 문자가 붙기도 하는데 특정한 내용을 볼 때 이런 문자가 붙은 것을 보기는 상당히 힘들다. (sun의 파일을 aix에서 받을 때에도 이런 문제가 발생한다고 한다.) 이 문자 ^M은 ^+M이 아니라 Control+v+m 이다. 따라서, 다음에 이 문자를 없앨 때도 이렇게 타이핑을 하도록 하자.

1. vi(m)이 열린 상태 

1.1 문자 치환 명령 이용

다음과 같이 문자 치환 명령으로 이 문자를 없애도록 한다.
:1,$s/^M//g

물론 이것의 입력은 다음과 같이 하도록 한다.
:1,$s/[Control]+v+m을 누른다.//g

1.2 파일 포맷 변경

 

vim 5.0 이상에서는 다음과 같이 명령을 내리도록 한다.

:set fileformat=unix
혹은
:set ff=unix
그리고, 저장하고 종료한다.
:wq

이와 반대로 끝에 ^M붙이려면 다음과 같이 한다.
:set fileformat=dos

이전 버전에서는 다음과 같이 합니다.
:set textmode 

2. 프롬프트 상에서

 

2.1 dos2unix 이용

 

dos2unix와 unix2dos를 이용하여 변환할 수 있다.

다음과 같이 하면 ^M 문자가 없어진다.
$ dos2unix [문서명](여러 파일의 경우 *.확장자)

그리고 다음과 같이 하면 ^M 문자가 생긴다.
$ unix2dos [문서명]

2.2 cat과 tr을 이용한 방법

 

다음과 같이 하면 해당 파일의 ^M 문자가 없어진다.
$ cat dos-file | tr -d ^M > unix-file

2.3 perl 스크립트

 

다음과 같이 하면 여러 파일을 한번에 바꾸게 된다.

# perl -i -pe 's/\015//g' *.html

3. 다른 에디터의 사용

 

pico라는 에디터를 이용한다. vi나 emacs에서 ^M으로 잡히는 것이 pico에서는 안 잡히는데, 파일을 pico로 열어서 다시 이 문서를 저장한다. 그리고 vi나 emacs로 읽으면 ^M이 모두 없어진 것을 알 수 있다.

4. man 페이지의 ^M, ^H 문자

 

man 페이지를 일반 화일로 바꾸면 ^M, ^H 등이 생기는데(예, 한컴리눅스 ^H) 다음과 같이 하면 이 문자를 없애고 볼 수 있다. 

다음은 ls의 예이다.

4.1 ps 또는 pdf로 변환하기

 

man -t 변경시킬 화일 > 변경 후 화일명.ps
man -t 변경시킬 화일 > 변경 후 화일명.pdf
예) man -t ls > ls.ps 또는 ls.pdf로 보시면 됩니다.

4.2 텍스로 변환하기

 

man 변환시킬화일 | col -b> 변환후 화일명.txt
예) man ls | col -b > ls.txt

Posted by tornado
|

find . -type d -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'


또하나...

http://www.centerkey.com/tree/



#!/bin/sh
#######################################################
#  UNIX TREE                                          #
#  Version: 2.3                                       #
#  File: ~/apps/tree/tree.sh                          #
#                                                     #
#  Displays Structure of Directory Hierarchy          #
#  -------------------------------------------------  #
#  This tiny script uses "ls", "grep", and "sed"      #
#  in a single command to show the nesting of         #
#  sub-directories.  The setup command for PATH       #
#  works with the Bash shell (the Mac OS X default).  #
#                                                     #
#  Setup:                                             #
#     $ cd ~/apps/tree                                #
#     $ chmod u+x tree.sh                             #
#     $ ln -s ~/apps/tree/tree.sh ~/bin/tree          #
#     $ echo "PATH=~/bin:\${PATH}" >> ~/.profile      #
#                                                     #
#  Usage:                                             #
#     $ tree [directory]                              #
#                                                     #
#  Examples:                                          #
#     $ tree                                          #
#     $ tree /etc/opt                                 #
#     $ tree ..                                       #
#                                                     #
#  Public Domain Software -- Free to Use as You Like  #
#  http://www.centerkey.com/tree  -  By Dem Pilafian  #
#######################################################

echo
if [ "$1" != "" ]  #if parameter exists, use as base folder
   then cd "$1"
   fi
pwd
ls -R | grep ":$" |   \
   sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/   /' -e 's/-/|/'
# 1st sed: remove colons
# 2nd sed: replace higher level folder names with dashes
# 3rd sed: indent graph three spaces
# 4th sed: replace first dash with a vertical bar
if [ `ls -F -1 | grep "/" | wc -l` = 0 ]   # check if no folders
   then echo "   -> no sub-directories"
   fi
echo
exit



Posted by tornado
|
[link]http://www.avianwaves.com/tech/tools/rdtabs/

탭으로 여러개의 RDP 를 관리.







 
Posted by tornado
|
토탈 커맨더는 유료. 하지만.. 요건 공짜..

[link] http://kamil.barlinek.biz/altcmd/



Start ] [ Download ] [ Screenshots ] [ Features ] [ Contact ]

Welcome to the Alt Commander Home!

Latest version: 1.3-20071014


Alt Commander is a freeware File Manager for Windows. Some features include a built-in FTP client, file compare, archive file navigation, and a multi-rename tool. 

Small and quick.

 
Free for commercial or non-commercial use.
 
Newsletter  Subscribe Unsubscribe 
This page and Alt Commander are Copyright © 2005-2007 by Kamil Wawrzyniak, Poland. All rights reserved.
 
Posted by tornado
|
Posted by tornado
|
출처 : http://onlybible.tistory.com/1202 


tmpwatch 라는 명령


1. 이런 파일이 있다.

[root@testguk guk]# ll
합계 424
-rw-r--r-- 1 root root     10  9월 23 15:40 1.txt
-rw-r--r-- 1 root root 357961  9월 18 17:31 1221626338-metabbs-0.11.tar.tar
-rw------- 1 root root   1052  9월 17 02:41 anaconda-ks.cfg
-rw-r--r-- 1 root root    104  9월 22 18:37 array_pop.php
-rw-r--r-- 1 root root     82  9월 22 18:40 array_push.php
-rw-r--r-- 1 root root    106  9월 23 14:19 array_shift.php
-rw-r--r-- 1 root root    210  9월 23 14:33 array_unique.php
-rw-r--r-- 1 root root     96  9월 23 14:23 array_unshift.php
-rw-r--r-- 1 root root    344  9월 19 16:21 asort.php
-rw-r--r-- 1 root root  13333  9월 17 02:41 install.log
-rw-r--r-- 1 root root   2551  9월 17 02:41 install.log.syslog
-rw-r--r-- 1 root root    148  9월 19 16:06 ksort.php
-rw-r--r-- 1 root root     63  9월 22 18:32 rsort.php
-rw-r--r-- 1 root root    200  9월 19 15:33 shuffle.php
-rw-r--r-- 1 root root    298  9월 19 15:48 sort.php


2. 24시간 이후로 접근이 없는 파일들 삭제

[root@testguk guk]# tmpwatch --atime 24 ./
[root@testguk guk]# ll
합계 28
-rw-r--r-- 1 root root  10  9월 23 15:40 1.txt
-rw-r--r-- 1 root root 104  9월 22 18:37 array_pop.php
-rw-r--r-- 1 root root  82  9월 22 18:40 array_push.php
-rw-r--r-- 1 root root 106  9월 23 14:19 array_shift.php
-rw-r--r-- 1 root root 210  9월 23 14:33 array_unique.php
-rw-r--r-- 1 root root  96  9월 23 14:23 array_unshift.php
-rw-r--r-- 1 root root  63  9월 22 18:32 rsort.php


간단하네.
Posted by tornado
|
출처 : http://meela.tistory.com/entry/Portsentry-%EC%84%A4%EC%A0%95%EB%B0%A9%EB%B2%95



포트 스캔을 체크툴인 Portsentry 1.1를 설정하는 방법과 실제 테스트후 블러킹 하는 방법

portsentry 란?
portsentry는 실시간으로 이런 portscan을 탐지하고 대응하기 위해 만들어진 프로그램이며, Abacus Project의 일환으로 PSIONIC사에서 개발 배포하는 도구중 하나이다. portsentry는 정상적인 스캔과 비밀스캔 모두를 탐지한다. portsentry는 portscan을 탐지하기 위해 많은 옵션들을 가지고 있는데 아래의 방법들로 portscan에 반응한다. (자세한 내용은 README.install을 참고하세요.)

portsentry 다운받기
the Project Sentry Tools Summary Page 에서 1.2 버전을 다운받을 수 있다.
 Psionic Technologies 에서 개발되고 오픈소스로 공개된 프로그램인데
Psionic Technologies 가 cisco에 acquire되면서 더이상의 서비스를 제공하지 않고있다.
현재로서는 여기에서 마지막 업데이트 버전을 제공받을 수 있다.

portsentry 설치하기
[root@chtla kan]# tar xvfz portsentry-1.2.tar.gz

[root@chtla portsentry-1.2]# make linux

SYSTYPE=linux
Making
cc -O -Wall -DLINUX -DSUPPORT_STEALTH -o ./portsentry ./portsentry.c
./portsentry_io.c ./portsentry_util.c

[root@chtla portsentry-1.2]# make install
디폴트 디렉토리는 /usr/local/psionic/portsentry/portsentry 이다..

[root@chtla portsentry-1.2]# cd /usr/local/psionic/portsentry/

[root@chtla portsentry]# vi portsentry.conf
수정할 내용은 portsentry가 점검할 대상 포트(port)에 대한 것으로서 필요한 점검포트들을 모두설정하거나 점검하지 않을 포트들을 빼버리면 된다. 크게 대상 포트는 TCP 포트와 UDP포트로 나위어져 있으며, 특히 Stealth 스캔에 대한 옵션에 대한 설정도 할수 있음을 유심히 보기 바란다.

[root@chtla portsentry]# vi portsentry.ignore
12.34.56.78 <== portsentry 에서 block 되지 않을 아이피를 적어준다..(즉 자신의 서버 아이피등..안전하다고 생각되는 아이피)

[root@chtla portsentry]# vi /etc/rc.d/rc.local <== 부팅시 실행을 위해 추가..

# Port Sentry Setting
/usr/local/psionic/portsentry/portsentry -tcp
/usr/local/psionic/portsentry/portsentry -udp
/usr/local/psionic/portsentry/portsentry -stcp
/usr/local/psionic/portsentry/portsentry -sudp
/usr/local/psionic/portsentry/portsentry -atcp
/usr/local/psionic/portsentry/portsentry -audp

옵션들 설명

-tcp - Basic port-bound TCP mode (기본 포트 제한 TCP 모드)
PortSentry는 설정파일들을 확인하고 나서, 백그라운드에 있는 모든 TCP포트들을 묶을 것이다. 만약 여러분이 init 상태를 점검하길 원한다면, 단지 여러분은 메시지가 저장되어지는 local syslog 파일을 살펴보면 된다.
-udp - Basic port-bound UDP mode (기본 포트 제한 UDP 모드)
PortSentry는 설정파일들을 확인하고 나서, 백그라운드에 있는 모든 UDP포트들을 묶을 것이다. 만약 여러분이 init 상태를 점검하길 원한다면, 단지 여러분은 메시지가 저장되어지는 local syslog 파일을 살펴보면 된다. UDP/스텔스 스캔 경고가 적용된다. (README.stealth파일을 읽어보라.)

-stcp - Stealth TCP scan detection mode (스텔스 TCP 스캔 탐지 모드)
PortSentry는 호스트로 들어오는 모든 패킷들을 감시하기 위해서 raw 소켓을 사용할 것이다. 만약 호스트로 들어오는 패킷이 감시되고 있는 포트로 향한다면, PortSentry는 호스트를 방어하기 위해 작동할 것이다. 이 방법은 connect() 스캔과 SYN/half-open 스캔과 FIN 스캔을 탐지할 것이다.
UDP/스텔스 스캔 경고가 적용된다. (README.stealth파일을 읽어보라.)

-sudp - "Stealth" UDP scan detection mode (스텔스 UDP 스캔 탐지 모드)
이것은 위의 TCP stealth mode와 작동방법은 동일하다. UDP 포트들을 나열하면, 그 포트들은 감시된다. 이것은 어떠한 소켓도 묶지 않으며, 실제 스텔스 스캔 탐지 모드가 아닌 중에도 거의 동일하게 동작한다.( 모든 UDP 패킷에 반응한다.)
UDP/스텔스 스캔 경고가 적용된다. (README.stealth파일을 읽어보라.)

-atcp - Advanced TCP stealth scan detection mode (advanced TCP 스텔스 스캔 탐지 모드)
PortSentry는 ADVANCED_PORTS_TCP 옵션에 지정된 최상의 포트번호이하의 모든 열려진 포트에 대한 목록을 만들면서 시작하고, 이러한 포트들을 기초로 제외(exclusion)목록을 만들 것이다. 제외되지 않은( 예를 들어, [SMTP, HTTP, 등의] 열려진[listening] network daemon이 아닌, ) 영역내의 임의의 포트에 연결된 호스트들은 접속이 금지된다. 이것은 여러분이 반드시 알고 있어야 할 몇몇 아주 강력한 함축적 의미들을 가지고 있다.

-audp - Advanced UDP stealth scan detection mode (advanced UDP 스탤스 스캔 탐지 모드)
UDP 프로토콜을 사용한다는 점을 제외하고는 위와 같다. Advanced UDP stealth scan detection은 지원되지 않는 트래픽을 즉시 알 수 있기 때문에 강력하지만 부정확한 경보의 가능성이 높다.

실행하기
[root@chtla portsentry]# /usr/local/psionic/portsentry/portsentry -tcp
[root@chtla portsentry]# /usr/local/psionic/portsentry/portsentry -udp
[root@chtla portsentry]# /usr/local/psionic/portsentry/portsentry -stcp
[root@chtla portsentry]# /usr/local/psionic/portsentry/portsentry -sudp
[root@chtla portsentry]# /usr/local/psionic/portsentry/portsentry -atcp
[root@chtla portsentry]# /usr/local/psionic/portsentry/portsentry -audp

[root@chtla portsentry]# ps -ax|grep portsentry
1084 ? S 0:00 /usr/local/psionic/portsentry/portsentry -tcp
1086 ? S 0:00 /usr/local/psionic/portsentry/portsentry -udp
1092 ? S 0:01 /usr/local/psionic/portsentry/portsentry -atcp
1094 ? S 0:00 /usr/local/psionic/portsentry/portsentry -audp

이처럼 실행을 되어 있는 것은 확인할수 있다..
그런데-stcp와 -sudp가 실행이 되지 않을것이다.. 서버 두대에서 같은 방법으로 돌려 보았는데, 실행이 되지 않고 있다.. 별문제라 문제되지 않아 아직까지 크게 신경을 쓰고 있지는 않아, (혹 아시는 분은 제게 좀 알려주세요..^^) 그냥 방치에 두고 있었다..
글을 쓰고면서 다시 기억이 났으니 우선을 그냥 넘어가기로 한다.. 큰 문제는 아니다.

침입 ip blocking 시키기..
우선 portsentry 는 디폴트로 tcp-wrapper 와 연동이 되어 정상적인 포트가 아닌 다른 포트로 스캔을 할지 자동으로 /etc/hosts.deny 에 기록을 하게 된다.

그냥 사용을 해도 좋으나 iptables 가 설치 되어 있다면 이것과 연동을 하는 것이 더 낮을것이다.
iptables와 연동을 하려면

[root@chtla portsentry]# vi portsentry.conf

#KILL_HOSTS_DENY="ALL: $TARGET$" <=== 이것을 주석처리 하구

# iptables support for Linux <=== 끝부분에 있을것임
KILL_ROUTE="/sbin/iptables -A INPUT -s $TARGET$ -j DROP" <=== 이것을 주석 처리를 풀어준다.

iptables 의 기본 옵션으로 -I 로 되어 있을것이다.. 그대로 사용해도 사용이 없으나, iptables를 사용할 사용이라면 -A 를 쓰도록 하자.
(-I 는 최상위로 올라가기에, 즉 최상우선적으로 적용을 시키는 옵션으로 개인적으로 iptables에 허가 ip를 등록시켜둔 상태라서 저는 이렇게 사용합니다..
-A 를 쓰면 -I 으로 적용한것보다 밑에 있게 되어 보기가 편하거든요..)

침입 테스트하기
다른 컴퓨터나 해당 서버에 텔넷(보통 기본적으로 막혀 있음)이나 다른 포트에 접속을 해 보자..

(다른 컴터에서)
# telnet 12.34.56.78 23

접속하면 별일없이 프럼프트 상에서 한참을 기다리고 있을것이다.(linux상에서).. 종료후 해당 서버의 /etc/hosts.deny (iptables 설정을 안했을 경우) 를 열어 보거나, iptables로 설정한 경우

# iptables -L
target prot opt source destination
DROP all -- 61.xx.xx.196 anywhere <== 허가 거부된 ip

이와 같이 거부된 것을 볼수 있을것이다..

참조할만한 사이트

http://www.certcc.or.kr/tools/Psionic_Portsentry.html
http://list.kldp.org/pipermail/tip/2001Sep/0292.html

Posted by tornado
|

보통 java 로 만든 웹어플리케이션을 구성하는 서버는 아파치(또는 IIS) 와 같은 웹서버와 WAS 를 연동 시켜서 사용한다.

아파치 웹서버 같은 경우 디렉토리 접근제어 등의 설정들이 존재하는데, 아래와 같이 설정한다.

<Directory "/www/context/admin/">
    Order deny,allow
    Deny from all
    Allow from 211.241.xxx.xxx/24
</Directory>

이렇게 설정되면 211.241.xxx에서 요청되는 255 개의 IP 에 대하여 허용을 하게 된다.

그런데, 이렇게 했을 경우 문제가 생긴다.

바로 루프백 주소(127.0.0.1) 이다.

왜 문제가 되느냐, 서버에서 서버로 호출할때는 127.0.0.1 로 호출되기 때문에

Allow 주소에 위에처럼 211.241.xxx 만 오픈 되어있을 경우 호출이 되지 않는다,

Allow from 에 127.0.0.1 도 추가해 주어야  URLConnection 처럼 호출 하여도 문제가 발생하지 않는다.

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

프로그램보다 인프라가 더 어려워 -.-;
Posted by tornado
|

Scripts to manage Registry

Checking Registry Key Access Rights
Creating Expanded String Values
Checking Registry Key Access Rights
Creating a Registry Key
Creating String and DWORD Values
Deleting a Registry Key
Deleting Registry Values
Enumerating Registry Properties
Enumerating Registry Values and Types
Enumerating Subkeys
Listing Registry Files
Monitoring Registry Entry Level Events
Monitoring Registry Subkey Events
Monitoring Registry Subtree Events
Reading a Binary Registry Value
Reading an Expanded String Value
Reading a MultiString Value
Reading String and DWORD Values




Checking Registry Key Access Rights

const KEY_QUERY_VALUE = &H0001
const KEY_SET_VALUE = &H0002
const KEY_CREATE_SUB_KEY = &H0004
const DELETE = &H00010000
 
 
const HKEY_LOCAL_MACHINE = &H80000002
 
strComputer = "."
Set StdOut = WScript.StdOut
 
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_ 
strComputer & "\root\default:StdRegProv")
 
strKeyPath = "SYSTEM\CurrentControlSet"
 
 
oReg.CheckAccess HKEY_LOCAL_MACHINE, strKeyPath, KEY_QUERY_VALUE, _
    bHasAccessRight
If bHasAccessRight = True Then
    StdOut.WriteLine "Have Query Value Access Rights on Key"
Else
    StdOut.WriteLine "Do Not Have Query Value Access Rights on Key"
End If   
 
oReg.CheckAccess HKEY_LOCAL_MACHINE, strKeyPath, KEY_SET_VALUE, _
    bHasAccessRight
If bHasAccessRight = True Then
    StdOut.WriteLine "Have Set Value Access Rights on Key"
Else
    StdOut.WriteLine "Do Not Have Set Value Access Rights on Key"
End If   
 
oReg.CheckAccess HKEY_LOCAL_MACHINE, strKeyPath, KEY_CREATE_SUB_KEY, _
    bHasAccessRight
If bHasAccessRight = True Then
    StdOut.WriteLine "Have Create SubKey Access Rights on Key"
Else
    StdOut.WriteLine "Do Not Have Create SubKey Access Rights on Key"
End If
 
oReg.CheckAccess HKEY_LOCAL_MACHINE, strKeyPath, DELETE, bHasAccessRight
If bHasAccessRight = True Then
    StdOut.WriteLine "Have Delete Access Rights on Key"
Else
    StdOut.WriteLine "Do Not Have Delete Access Rights on Key"
End If

Creating Expanded String Values


Uses WMI to create an expanded string value under HKLM\SOFTWARE\System Admin Scripting Guide.
const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
 
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_ 
strComputer & "\root\default:StdRegProv")
 
strKeyPath = "SOFTWARE\System Admin Scripting Guide"
strValueName = "Expanded String Value Name"
strValue = "%PATHEXT%"
 
oReg.SetExpandedStringValue _
    HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue

Checking Registry Key Access Rights


Uses WMI to check access rights for the logged on user to HKLM\SYSTEM\CurrentControlSet.
const KEY_QUERY_VALUE = &H0001
const KEY_SET_VALUE = &H0002
const KEY_CREATE_SUB_KEY = &H0004
const DELETE = &H00010000
 
 
const HKEY_LOCAL_MACHINE = &H80000002
 
strComputer = "."
Set StdOut = WScript.StdOut
 
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_ 
strComputer & "\root\default:StdRegProv")
 
strKeyPath = "SYSTEM\CurrentControlSet"
 
 
oReg.CheckAccess HKEY_LOCAL_MACHINE, strKeyPath, KEY_QUERY_VALUE, _
    bHasAccessRight
If bHasAccessRight = True Then
    StdOut.WriteLine "Have Query Value Access Rights on Key"
Else
    StdOut.WriteLine "Do Not Have Query Value Access Rights on Key"
End If   
 
oReg.CheckAccess HKEY_LOCAL_MACHINE, strKeyPath, KEY_SET_VALUE, _
    bHasAccessRight
If bHasAccessRight = True Then
    StdOut.WriteLine "Have Set Value Access Rights on Key"
Else
    StdOut.WriteLine "Do Not Have Set Value Access Rights on Key"
End If   
 
oReg.CheckAccess HKEY_LOCAL_MACHINE, strKeyPath, KEY_CREATE_SUB_KEY, _
    bHasAccessRight
If bHasAccessRight = True Then
    StdOut.WriteLine "Have Create SubKey Access Rights on Key"
Else
    StdOut.WriteLine "Do Not Have Create SubKey Access Rights on Key"
End If
 
oReg.CheckAccess HKEY_LOCAL_MACHINE, strKeyPath, DELETE, bHasAccessRight
If bHasAccessRight = True Then
    StdOut.WriteLine "Have Delete Access Rights on Key"
Else
    StdOut.WriteLine "Do Not Have Delete Access Rights on Key"
End If

Creating a Registry Key


Uses WMI to create a registry key HKLM\SOFTWARE\System Admin Scripting Guide.
const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set StdOut = WScript.StdOut
 
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_ 
strComputer & "\root\default:StdRegProv")
 
strKeyPath = "SOFTWARE\System Admin Scripting Guide"
oReg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath

Creating String and DWORD Values


Uses WMI to create string and DWORD values under HKLM\SOFTWARE\System Admin Scripting Guide.
const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set StdOut = WScript.StdOut
 
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_ 
strComputer & "\root\default:StdRegProv")
 
strKeyPath = "SOFTWARE\System Admin Scripting Guide"
strValueName = "String Value Name"
strValue = "string value"
oReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
 
strValueName = "DWORD Value Name"
dwValue = 82
oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue

Deleting a Registry Key


Uses WMI to delete the registry key HKLM\SOFTWARE\System Admin Scripting Guide.
const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
 
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_ 
strComputer & "\root\default:StdRegProv")
 
strKeyPath = "SOFTWARE\System Admin Scripting Guide"
 
oReg.DeleteKey HKEY_LOCAL_MACHINE, strKeyPath

Deleting Registry Values


Uses WMI to delete all the registry values under HKLM\SOFTWARE\System Admin Scripting Guide.
const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
 
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_ 
strComputer & "\root\default:StdRegProv")
 
strKeyPath = "SOFTWARE\System Admin Scripting Guide"
strDWORDValueName = "DWORD Value Name"
strExpandedStringValueName = "Expanded String Value Name"
strMultiStringValueName = "Multi String Value Name"
strStringValueName = "String Value Name"
 
oReg.DeleteValue HKEY_LOCAL_MACHINE,strKeyPath,strDWORDValueName
oReg.DeleteValue HKEY_LOCAL_MACHINE,strKeyPath,strExpandedStringValueName
oReg.DeleteValue HKEY_LOCAL_MACHINE,strKeyPath,strMultiStringValueName
oReg.DeleteValue HKEY_LOCAL_MACHINE,strKeyPath,strStringValueName

Enumerating Registry Properties


Returns information about the computer registry.
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_Registry")
For Each objItem in colItems
    Wscript.Echo "Current Size: " & objItem.CurrentSize
    Wscript.Echo "Description: " & objItem.Description
    Wscript.Echo "Install Date: " & objItem.InstallDate
    Wscript.Echo "Maximum Size: " & objItem.MaximumSize
    Wscript.Echo "Name: " & objItem.Name
    Wscript.Echo "Proposed Size: " & objItem.ProposedSize
Next

Enumerating Registry Values and Types


Uses WMI to list all the registry values and their types under HKLM\SYSTEM\CurrentControlSet\Control\Lsa.
const HKEY_LOCAL_MACHINE = &H80000002
const REG_SZ = 1
const REG_EXPAND_SZ = 2
const REG_BINARY = 3
const REG_DWORD = 4
const REG_MULTI_SZ = 7
 
strComputer = "."
Set StdOut = WScript.StdOut
 
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_ 
strComputer & "\root\default:StdRegProv")
 
strKeyPath = "SYSTEM\CurrentControlSet\Control\Lsa"
 
oReg.EnumValues HKEY_LOCAL_MACHINE, strKeyPath,_
 arrValueNames, arrValueTypes
 
For i=0 To UBound(arrValueNames)
    StdOut.WriteLine "Value Name: " & arrValueNames(i) 
    
    Select Case arrValueTypes(i)
        Case REG_SZ
            StdOut.WriteLine "Data Type: String"
            StdOut.WriteBlankLines(1)
        Case REG_EXPAND_SZ
            StdOut.WriteLine "Data Type: Expanded String"
            StdOut.WriteBlankLines(1)
        Case REG_BINARY
            StdOut.WriteLine "Data Type: Binary"
            StdOut.WriteBlankLines(1)
        Case REG_DWORD
            StdOut.WriteLine "Data Type: DWORD"
            StdOut.WriteBlankLines(1)
        Case REG_MULTI_SZ
            StdOut.WriteLine "Data Type: Multi String"
            StdOut.WriteBlankLines(1)
    End Select 
Next

Enumerating Subkeys


Uses WMI to enumerate all the registry subkeys under HKLM\SYSTEM\CurrentControlSet\Services.
const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set StdOut = WScript.StdOut
 
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_ 
strComputer & "\root\default:StdRegProv")
 
strKeyPath = "SYSTEM\CurrentControlSet\Services"
oReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys
 
For Each subkey In arrSubKeys
    StdOut.WriteLine subkey
Next

Listing Registry Files


Uses WMI to list all the registry file and locations under HKLM\System\CurrentControlSet\Control\Hivelist.
const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set StdOut = WScript.StdOut
 
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_ 
strComputer & "\root\default:StdRegProv")
strKeyPath = "System\CurrentControlSet\Control\hivelist"
oReg.EnumValues HKEY_LOCAL_MACHINE, strKeyPath,_
 arrValueNames, arrValueTypes
 
For i=0 To UBound(arrValueNames)
    StdOut.WriteLine "File Name: " & arrValueNames(i) & " -- "      
    oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,_
    arrValueNames(i),strValue
    StdOut.WriteLine "Location: " & strValue
    StdOut.WriteBlankLines(1)
Next

Monitoring Registry Entry Level Events


Temporary event consumer that monitors the registry for any changes to HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\CSDVersion.
Set wmiServices = GetObject("winmgmts:root/default") 
Set wmiSink = WScript.CreateObject("WbemScripting.SWbemSink", "SINK_") 
 
wmiServices.ExecNotificationQueryAsync wmiSink, _ 
  "SELECT * FROM RegistryValueChangeEvent WHERE Hive='HKEY_LOCAL_MACHINE' " & _
      "AND KeyPath='SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'" _
          & " AND ValueName='CSDVersion'" 
 
WScript.Echo "Listening for Registry Change Events..." & vbCrLf 
 
While(1) 
    WScript.Sleep 1000 
Wend 
 
Sub SINK_OnObjectReady(wmiObject, wmiAsyncContext) 
    WScript.Echo "Received Registry Change Event" & vbCrLf & _ 
                 "------------------------------" & vbCrLf & _ 
                 wmiObject.GetObjectText_() 
End Sub

Monitoring Registry Subkey Events


Temporary event consumer that monitors the registry for any changes to HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion.
Set wmiServices = GetObject("winmgmts:root/default") 
Set wmiSink = WScript.CreateObject("WbemScripting.SWbemSink", "SINK_") 
 
 
wmiServices.ExecNotificationQueryAsync wmiSink, _ 
  "SELECT * FROM RegistryKeyChangeEvent WHERE Hive='HKEY_LOCAL_MACHINE' AND " & _ 
    "KeyPath='SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'" 
 
WScript.Echo "Listening for Registry Change Events..." & vbCrLf 
 
While(1) 
    WScript.Sleep 1000 
Wend 
 
Sub SINK_OnObjectReady(wmiObject, wmiAsyncContext) 
    WScript.Echo "Received Registry Change Event" & vbCrLf & _ 
                 "------------------------------" & vbCrLf & _ 
                 wmiObject.GetObjectText_() 
End Sub

Monitoring Registry Subtree Events


Temporary event consumer that monitors the registry for any changes to HKLM.
Set wmiServices = GetObject("winmgmts:root/default") 
Set wmiSink = WScript.CreateObject("WbemScripting.SWbemSink", "SINK_") 
 
wmiServices.ExecNotificationQueryAsync wmiSink, _ 
    "SELECT * FROM RegistryTreeChangeEvent WHERE Hive= " _
        & "'HKEY_LOCAL_MACHINE' AND RootPath=''" 
 
 
WScript.Echo "Listening for Registry Change Events..." & vbCrLf 
 
While(1) 
    WScript.Sleep 1000 
Wend 
 
Sub SINK_OnObjectReady(wmiObject, wmiAsyncContext) 
    WScript.Echo "Received Registry Change Event" & vbCrLf & _ 
                 "------------------------------" & vbCrLf & _ 
                 wmiObject.GetObjectText_() 
End Sub

Reading a Binary Registry Value


Uses WMI to read a binary registry value.
const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set StdOut = WScript.StdOut
 
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_ 
strComputer & "\root\default:StdRegProv")
 
strKeyPath = "SOFTWARE\Microsoft\Windows NT\CurrentVersion"
strValueName = "LicenseInfo"
oReg.GetBinaryValue HKEY_LOCAL_MACHINE,strKeyPath,_
strValueName,strValue
 
 
For i = lBound(strValue) to uBound(strValue)
    StdOut.WriteLine  strValue(i)
Next

Reading an Expanded String Value


Uses WMI to read an expanded string registry value.
const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set StdOut = WScript.StdOut
 
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_ 
strComputer & "\root\default:StdRegProv")
 
strKeyPath = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon"
strValueName = "UIHost"
oReg.GetExpandedStringValue HKEY_LOCAL_MACHINE,strKeyPath,_
strValueName,strValue
 
StdOut.WriteLine  "The Windows logon UI host is: " & strValue

Reading a MultiString Value


Uses WMI to read a multi-string registry value.
const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set StdOut = WScript.StdOut
 
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_ 
strComputer & "\root\default:StdRegProv")
 
strKeyPath = "SYSTEM\CurrentControlSet\Services\Eventlog\System"
strValueName = "Sources"
oReg.GetMultiStringValue HKEY_LOCAL_MACHINE,strKeyPath,_
strValueName,arrValues
 
For Each strValue In arrValues
    StdOut.WriteLine  strValue
Next

Reading String and DWORD Values


Uses WMI to read a string and a DWORD registry value.
const HKEY_CURRENT_USER = &H80000001
const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set StdOut = WScript.StdOut
 
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
 strComputer & "\root\default:StdRegProv")
 
strKeyPath = "Console"
strValueName = "HistoryBufferSize"
oReg.GetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,dwValue
StdOut.WriteLine "Current History Buffer Size: " & dwValue 
 
 
strKeyPath = "SOFTWARE\Microsoft\Windows Script Host\Settings"
strValueName = "TrustPolicy"
oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
StdOut.WriteLine "Current WSH Trust Policy Value: " & strValue

'OS > WIndows' 카테고리의 다른 글

토탈 커맨더와 비슷한 알트 커맨더.  (0) 2011.08.10
무료 FTP 서버 ... 개인만 무료...  (0) 2011.01.11
windows powershell 문서  (1) 2009.04.02
윈도우에서 사용할 수 있는 메일서버  (0) 2008.10.23
분산파일 시스템  (0) 2006.06.21
Posted by tornado
|
첨부함.

Posted by tornado
|

출처 : http://blog.studioego.info/417


혹시나 Windows 원격 접속을 해 보신 적이 있나요?

MicroSoft사의 WindowsXP에서는 Windows 원격 데스크탑 접속을 할 수 있습니다. 서버로 사용하는 컴퓨터에 원격 접속 설정을 하면 학교 연구실에 있는 컴퓨터를 계속 켜고 퇴근한 후에 집에서 노트북으로 학교 연구실 컴퓨터에 접속해서 원격으로 작업을 할 수 있는 장점이 있습니다.
원격 데스크톱 연결

Window에서는 원격으로 Windows를 연결하여 원격 작업을 할 수 있습니다.


그렇다만 Linux 컴퓨터는 Xwindow가 설치되어 있는데 Windows에서 Linux컴퓨터의 Xwindow를 원격으로 실행 시킬까요?

여러가지 방법 중에서 VNC를 사용하는 방법이 있지만, VNC demon을 실행시키지 않으면 Windows에서 Linux컴퓨터의 Xwindow 실행시킬수 없습니다.
여기서는 Windows에서 Xming을 설치한 다음 Xming을 이용하여 쉽게 Linux컴퓨터의 Xwindow를 원격으로 실행하는 방법을 알려드리겠습니다.

※ Xming이란?
Wikipedia : Xming
배포사이트 : http://www.straightrunning.com/XmingNotes/
Xming는 Windows용 X Server입니다.
Microsoft사의 Windows에서 Xwindow용 프로그램을 출력할 수 있도록 해주는 화면 출력 서버입니다.
Microsoft사의 Windows에서 Linux 컴퓨터안의 X Window 프로그램을 화면에 출력할 수 있는 서버인 Xming을 설치하면 리눅스 프로그램도 Microsoft사의 Windows에서 실행 할 수 있습니다.
Windows에서 리눅스 프로그램을 실행하는 것처럼 보이지만, 실제 실행은 리눅스 컴퓨터에서 하고, 다만 X Server는 프로그램에서 전송하는 화면을 출력하고, 사용자의 키보드나 마우스와 같은 입력을 프로그램 쪽으로 전송해 주는 역할을 합니다.

Xming 설치 및 실행

  1. http://sourceforge.net/projects/xming
  2. Xming 설치.
  3. Xming-fonts 설치.
여기서 Test한 환경은
Windows XP와 CentOS 5입니다.

1. 우선 XLaunch를 띄웁니다.
2. Display settings에서 One window without titlebar를 선택합니다.

3. 데스크탑에서 Xwindow를 실행시킬려면 Start a program을 선택합니다.

4. 여기서 Xwindow환경을 실행할때에 Gnome를 실행하려면 Start Program에서 gnome-session을 넣고 KDE를 실행하려면 startkde를 넣으시면 됩니다.
원격접속할때에는 Run Remote에서 Using Putty를 선택하여 IP와 ID, Password를 넣으시면 됩니다.

5. Clipboard를 원격접속하는 곳에서 쓸려면 선택합니다.

6. 이제 셋팅이 끝났습니다.

결과 화면


ps1. Xmanager같은 비싼 프로그램이 한글지원도 편하게 되어서 사용하기에 좋긴 하지만, 학생이고 오픈소스로 공개된 Xming을 오픈소스 프로그램인 iPutty에 연결해 씁니다. 있을 것은 다 있는 오픈소스 프로그램들이라서 굳이 불법으로 쓸 필요는 없으니깐요.
ps2. Xming때문에 학교 안나오고 집에서 작업 한 후에 교수님에게 작업한 결과물을 보여주면서 학교는 나왔습니다 하면서 땡땡이 칠 수 있는 장점도 있습니다!
Posted by tornado
|

업데이트가 안되서리...

/etc/yum.conf 를 아래와 같이 수정하고 되었다.


[core]
name=Fedora Core 4
baseurl=http://mirror.secuidc.com/centos/4/os/i386/

[updates]
name=Fedora Core 4 updates
baseurl=http://mirror.secuidc.com/centos/4/updates/i386/

Posted by tornado
|

출처 - http://iccc.skku.ac.kr/zbxe/tip_tech_service/71356


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

sudo apt-get install mysql-server mysql-client

$sudo cp /etc/mysql/my.cnf /etc/mysql/my.cnf.orig


my.cnf 파일 편집

    [client]
    default-character-set=utf8

    [mysqld]
    character-set-client-handshake=FALSE
    init_connect="SET collation_connection = utf8_general_ci"
    init_connect="SET NAMES utf8"
    default-character-set=utf8
    character-set-server=utf8
    collation-server=utf8_general_ci

    [mysqldump]
    default-character-set=utf8

    [mysql]
    default-character-set=utf8


mysql을 재시작

    $sudo /etc/init.d/mysql restart


변경 여부 확인

    $mysql -u id -p
    mysql> status



Posted by tornado
|
출처 : http://blog.naver.com/mdw9754/10001069368




오라클 소프트웨어 다운로드


오라클 10G R2를 다운로드 한다.

http://www.oracle.com/technology/software/products/database/oracle10g/index.html

Oracle Database 10g Release 2 (10.2.0.1.0) for Linux x86 을 선택
(32bit용 Linux가 설치된 것으로 가정하였다. 만일 64bit용 Linux가 설치되어 있다면 64bit용 오라클을 다운로드 하면 되겠다.)

다운로드한 파일의 압축을 해제한다. (root 계정으로..)
$ unzip 10201_database_linux32.zip
database/stage/Components/oracle.server/10.2.0.3.0/1
database/stage/Components/oracle.server/10.2.0.3.0
database/stage/Components/oracle.server
database/stage/Components/oracle.tg/10.2.0.3.0/1/DataFiles
database/stage/Components/oracle.tg/10.2.0.3.0/1
database/stage/Components/oracle.tg/10.2.0.3.0
database/stage/Components/oracle.tg
database/stage/Components/oracle.assistants.dbca/10.2.0.3.0/1/DataFiles/doc.3.1.jar
database/stage/Components/oracle.assistants.dbca/10.2.0.3.0/1/DataFiles/class.jar
...

커널 변수(Kernel parameter) 확인

Oracle 10G R2를 설치하기 위한 커널 변수는 다음을 만족해야 한다.

shmmax  = 2147483648
shmmni  = 4096
shmall  = 2097152
shmmin  = 1
shmseg  = 10
semmsl  = 250
semmns  = 32000
semopm  = 100
semmni  = 128
file-max = 65536
ip_local_port_range = 1024 65000

다음과 같이 현재 오라클을 설치하려는 Linux 시스템의 커널 변수를 확인할 수 있다.


su - root
sysctl -a


너무 많은 내용이 스크롤 되어 확인하기 힘들다면 grep 명령어로 각각 확인해볼 수 있다.


sysctl -a | grep shmmax


아마도 대부분 Linux를 설치한 후 초기 상태라면 오라클 10G R2 설치 조건을 만족하지 못할 것이다.

다음과 같이 커널 변수를 세팅할 수 있다.

/etc/sysctl.conf 파일을 열어 다음 내용을 추가한다.

kernel.shmmax=2147483648
kernel.sem=250 32000 100 128
fs.file-max=65536
net.ipv4.ip_local_port_range=1024 65000

여기서 수정한 커널 변수를 Linux를 리부팅하면 자동적으로 적용되겠지만, 다음과 같이 리부팅하지 않고 즉시 적용이 가능하다.

su - root
sysctl -p



소프트웨어 패키지 확인(RPM)

오라클 10G R2를 설치하기 위해 다음과 같은 패키지가 사전에 설치되어 있어야 한다.

  make-3.79.1
  gcc-3.2.3-34
  glibc-2.3.2-95.20
  compat-db-4.0.14-5
  compat-gcc-7.3-2.96.128
  compat-gcc-c++-7.3-2.96.128
  compat-libstdc++-7.3-2.96.128
  compat-libstdc++-devel-7.3-2.96.128
  openmotif21-2.1.30-8
  setarch-1.3-1
  libaio-0.3.96-5

다음 명령어로 확인할 수 있다.

rpm -q make gcc glibc compat-db compat-gcc compat-gcc-c++ compat-libstdc++ compat-libstdc++-devel openmotif21 setarch libaio


설치되지 않았거나 구버전이 설치되어 있다면, 알아서(ㅡ.ㅡ) 구해 설치하도록 한다. 물론 꼭 없어도 오라클의 기본적인 설치와 구동은 가능하지만, 오라클 10G R2의 모든 기능을 정상적으로 사용하기를 원한다면 설치하도록 권장한다.


오라클 10G R2는 Linux에 설치할 때 Linux 소프트웨어 패키지를 확인하여 지원 가능한 Linux에만 설치를 진행한다.

필자는 Haansoft Linux에 설치를 진행하려 하는데 오라클 10G R2는 Haansoft Linux를 알지 못하므로 편법으로 약간 수정이 필요하다.

오라클 10G R2는 Redhat Linux를 지원하므로 Radhat Linux 인것처럼 속이도록 한다.

즉, /etc/redhat-release 파일을 생성하여 Haansoft Linux를 Redhat Linux인것처럼 하면 된다.


su - root
cat > /etc/redhat-release << EOF
Red Hat Enterprise Linux AS release 3 (Taroon)
EOF


오라클 설치가 끝난후 다시 삭제하면 된다. (삭제하지 않아도 별 문제 없음)

이렇게 하면 오라클 OUI (Oracle Universal Installer)가 Redhat Linux 로 인식하여 정상적으로 설치를 진행할 수 있다.

참고로, "runInstaller -ignoreSysPrereqs" 명령으로 무시하고 진행해도 되지만, 권장사항은 아니다.

oracle 계정 생성 및 .profile 편집

오라클 10G R2를 설치하고 운영하기 위해서는 적절한 Linux 사용자 계정이 필요하다. 물론, 아무 계정이나 만들어서 설치해도 되고, root에 설치해도 상관 없지만, 원할한 설치와 운영을 위해서는 꼭 별도의 오라클 계정을 생성하여 설치하도록 권장한다.

oracle 계정을 생성하여 dba 그룹에 소속하도록 한다.

dba 그룹 생성(gid를 700으로 설정하였다.)

groupadd -g 700 dba


oracle 계정 생성(uid를 700으로 설정하고 소속 그룹을 dba로 하였다.)

useradd -u 700 -c "Oracle Administrator" -s  /bin/ksh -g dba oracle
passwd oracle
******


위와 같이 command를 사용해도 되지만, GUI 환경이 편하다면 GUI환경에서 그룹과 계정을 각각 생성하여도 상관 없다. oracle이 사용하는 shell은 ksh(Kohn shell)을 사용하도록 하였다.

oracle 계정의 .profile 파일을 수정하자. (없으면 생성한다.) 다음 항목을 추가한다.


export ORACLE_BASE=/u/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export PATH=$PATH:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib


만일 oracle 계정의 shell을 ksh 로 하지 않고, bash로 했다면, .profile 파일을 수정하지 않고, .bash_profile 파일을 수정하도록 한다.


여유 디스크 공간 확인 및 디렉토리 생성

오라클 10G R2를 설치하기 위해서는 최소한 1GB 이상의 디스크 공간이 필요하다.

또한, 오라클을 설치하기 전에 필요한 디렉토리는 미리 생성해두는 것이 좋다.

일반적으로 오라클 S/W와 Datafile(실제 데이터가 저장되는 공간)의 물리적인 위치를 별도로 지정하는 것이 좋다.

oracle 계정의 home 디렉토리와 오라클 S/W가 설치되는 곳은 달라도 상관 없다.

우선, 오라클 S/W는 /u/app/oracle/product/10.2.0/db_1 에 설치하도록 하자. (Datafile 및 기타 파일의 위치는 오라클 설치 후 DB 생성시 고려하면 되겠다.)

su - root
mkdir -p /u/app/oracle/product/10.2.0/db_1
chown -R oracle:dba /u/app/oracle




오라클 10G R2 설치

oracle 계정으로 switch user (su) 한 다음, 다운받은 오라클 설치 파일을 압축해제한 디렉토리로 이동하여 runInstaller를 실행한다.


# xhost +
# su - oracle
$ cd database
$ ./runInstaller


xhost + 명령을 실행한 이유는 간혹 oracle 계정에서 Display 세팅때문에 OUI를 실행하지 못하는 경우가 있는데, Display의 제어권을 root에서 oracle로 넘겨주기 위함이다. xhost + 를 실행하지 않아도 잘 되는 경우에는 그냥 oracle계정으로 su 하여 runInstaller를 실행하면 된다.


runInstaller를 실행시키면 몇 초 후 OUI (Oracle Universal Installer)가 실행된다.

- 설치방식선택 : 고급설치 (기본설치를 선택하면 쉽게 할 수 있지만,
                                      고급설치를 통해 좀 더 배워보자.)
                        "다음" 클릭

- 인벤토리 디렉토리 및 인증서 지정
                     : 인벤토리 디렉토리에 대한 전체 경로 입력 (제품에 대한 설치정보를 저장하는 곳이며 약 150KB정도가 사용된다.)
                        -> /u/app/oracle/oraInventory
                     : 운영체제 그룹 이름 지정 (oracle을 설치하는 Linux 계정이 속한 그룹명을 입력하면 된다.)
                        -> dba
                        "다음" 클릭

-  설치유형 선택 : 사용자정의 (보통 Enterprise Edition을 선택하면 되지만, 여기서는 필요한 부분만 최소용량으로 설치하기 위해 사용자 정의를 선택하였다.)
                        "다음" 클릭

- 홈 세부 정보 지정
                       : 이름 (oraInventory 내에 저장하기 위한 이름으로 특별한 의미는 없으며 추후 설치된 오라클을 제거할 때의 이름으로 사용되므로 적절히 입력하거나 입력되어 있는 내용을 그대로 사용하면 된다.)
                          -> OraDB10g_home1
                       : 경로 (.profile에서 ORACLE_HOME 으로 지정한 디렉토리가 입력되어 있을 것이다. 확인하고 틀렸으면 수정하자.)
                          -> /u/app/oracle/product/10.2.0/db_1
                          "다음" 클릭

- 사용가능한 제품 구성 요소 (설치 유형에서 "사용자정의"를 선택하였기때문에 제품 구성요소를 선택하여 설치를 할 수 있다. Eterprise Edition을 선택했다면 이 화면은 나타나지 않는다.)
                        : 선택되어 있는대로 진행해도 상관 없지만, 필자의 경우 개발 목적으로 설치하는 것이 아니므로
                           -> Oracle Programmer 10.2.0.1.0 체크 해제
                           -> Oracle XML Developer Kit 10.2.0.1.0 체크 해제
                                (나머지 항목은 그대로)
                            "다음" 클릭

- 제품별 필요 조건 검사 : 사전에 커널변수와 필요한 패키지들을 미리 세팅해두었다면 큰 무리 없이 통과가 가능하다. 만일, 상태 항목에 "경고" 라는 문구가 있는 항목이 있으면 아래 내용을 읽어보고 조치한 후 "재시도" 버튼을 클릭하면 되고, 귀찮으면(ㅡ.ㅡ) "경고" 바로 좌측에 있는 체크박스를 모두 클릭한 후 "다음" 클릭.

- 권한 부여된 운영체제 그룹
                        : 데이터베이스 관리자(OSDBA) 그룹
                            -> dba
                        : 데이터베이스 운영자(OSOPER) 그룹
                            -> dba
                         (국내의 경우 관리자와 운영자가 동일한 경우가 대부분이지만, 외국의 경우 실제로 관리자와 운영자가 분리되어 있으므로 이러한 선택사항이 있는것으로 보인다. 모두 dba로 입력하자.)
                         "다음" 클릭.

- 데이터베이스 생성 : 데이터베이스 소프트웨어만 설치
                         (여기서 데이터베이스를 생성해도 되지만, 이것저것 준비할 것도 많고, 시간이 오래걸리므로 소프트웨어만 설치하고 데이터베이스는 나중에 생성하도록 하자.)
                         "다음" 클릭.

- 요약 : 지금까지 세팅한 설치 옵션들을 한 눈에 요약하여 보여준다.
           만일 틀린부분이 있다면 뒤로 가서 다시 세팅하도록 하자.
           "설치" 클릭.

- 설치 (설치는 상당한 시간이 소요된다. 시스템의 사양에 따라서 많은 차이가 있지만, 대략 1시간 정도 생각하면 되겠다. 설치하는데 심심하다면 설치화면 하단에 있는 로그파일 위치에 가서 생성되는 로그를 확인해보는 것도 좋겠다.)

- 구성 스크립트 실행 (새로운 터미널 창을 열어 root로 switch user(su - root)한 후 스크립트를 실행한다.)
    mkdir /opt  (Haansoft Linux에는 /opt 디렉토리가 없으므로 생성하도록 한다. root.sh 실행시 필요하다.)
    /u/app/oracle/oraInventory/orainstRoot.sh
    /u/app/oracle/product/10.2.0/db_1/root.sh
  (현재 오라클을 설치하는 oracle 계정은 타 디렉토리에 대한 생성 권한이 없기때문에 root로 위 스크립트를 실행하여 필요한 환경을 세팅하는 것이다.)
    "종료" 클릭.

오라클 10G R2 가 성공적으로 설치되었다.
Posted by tornado
|

출처 : http://mwultong.blogspot.com/2006/10/ubuntu-root-root.html


Q: root 아이디로 로그인이 안됩니다



원래 우분투 리눅스는 root (관리자 계정)로 로그인할 수 없습니다. 설치할 때 사용자 ID를 root 로 정하면 로그인이 아예 불가능하게 됩니다.


다음은 우분투에 root 계정과 암호를 만들어 주는 방법입니다.

프롬프트에서

sudo passwd root

라고 합니다. 주의! 위에서 "passwd"라는 문자열은 진짜 암호가 아니라 문자 그대로 입력해야 합니다.

만약 패스워드가 foo 라고 해서

sudo foo root

이렇게 하면 안됩니다. 정확히 sudo passwd root 이렇게 적어 주어야 합니다.

그러면 현재 암호를 먼저 묻습니다. 현재 로그인한 ID의 암호를 한번 입력해 주면 이제

Enter new UNIX password:

라고 나오며 root 의 암호를 2번 묻습니다. 새 암호를 만들어 적어 주면 됩니다.

그러면 이제 root 로 로그인할 수 있습니다. root 계정이 생기는 것입니다.

Ctrl+D키를 눌러, 로그아웃한 후 root 로 로그인해 봅니다.


그런데 root 의 패스워드가 짧고 간단하다면 해커들의 표적이 됩니다. 되도록 길고 복잡해야 합니다.
Posted by tornado
|

http://izpack.org/

이런 툴도 있었네요.

인스톨 쉴드만 써봤는데... 리눅스에서는 콘솔로 할까~ 생각중이였는데 이런 툴이 있었군요.

조만간 테스트 해봐야겠습니다.

 

사용자 삽입 이미지


Posted by tornado
|
출처 : http://www.joinc.co.kr/modules/moniwiki/wiki.php/Site/Development/Env/SelfExtractInstallScript




리눅스 프로그램 배포의 문제

윈도우즈는 통일된 단일한 방식을 통해서, 스스로 설치되는 프로그램을 만들 수 있다. 보통 Install Shield의 형태로 관리되며, 거의 모든 윈도우 버젼에 동일하게 적용시킬 수 있다. 

그러나 리눅스에 배포할 경우 많은 문제가 따른다. 일단 리눅스만으로 목표를 한정한다고 해도, RedHat, Debian, Zentoo, ubuntu 등 배포판 고유의 전혀다른 배포방식을 제공하며, 일반적으로 호환되지 않는다. 리눅스에서 개발되고 다른 유닉스로 포팅된 프로그램을 배포하는 데에도 역시 동일한 문제가 발생한다.

단순하게 tar로 묶어서 배포하면 된다. 이건 논외로 하기로 한다. 여기에서는 Install Shield와 같이 유저와 상호대화 가능하면서 간단하게 배포가능한 방법에 대해서 논할 것이다.

shell script와 tail로 구현하는 간단한 Install Script 만들기

그렇다면 리눅스 뿐만이 아닌 다른 유닉스에서도 사용가능한 Install Script 프로그램을 만드는 방법에 대해서 알아보겠다. 일단 만들 Install script는 모든 유닉스에서 작동이 될 수 있다는 것을 보장해야 하므로, 유닉스에 기본적으로 설치되는 명령만을 가지고 작성을 해야 한다.

이 문서를 제대로 이해하고 활용하기 위해서는 Bash 스크립트 프로그래밍에 대한 지식을 가지고 있어야 한다. 초보자를 위한 Bash 스크립트 프로그래밍문서를 참고하기 바란다.

여기에서는 모든 유닉스에 기본적으로 제공된다고 생각되는 sh, tail, tar를 통해서 Install Script를 만드는 방법에 대해서 알아보도록 하겠다.

당신이 mypackage-1.2.3.tgz이란 프로그램을 배포한다고 가정해보자. 당신은 실행하면, 여러가지 환경변수를 검사하고 유저의 입력을 받아서 자동으로 해당 디렉토리에 압축이 풀리는 스크립트를 만들기를 원할 것이다. 아래와 같은 방법으로 간단하게 만들 수 있다. 
cat sfx-header mypackage-1.2.3.tgz > mypackage-1.2.3.sh 
 

핵심은 sfx-header인데, 다음과 같은 내용을 포함한다.
#!/bin/sh 
echo "" 
echo "MyPackage v99.99 - extracting archive... please wait" 
echo "" 
 
# take the archive portion of this file and pipe it to tar 
# the NUMERIC parameter in this command should be one more 
# than the number of lines in this header file 
tail +12 $0 | tar xz 
 
exit 0 
 
tail +12 는 12번째 줄 부터 출력을 하라는 명령이다. 즉 mypackage-1.2.3.sh의 12번째줄 부터 출력을 해서 tar로 풀어라 이런 명령이 된다. 12번째 줄은 cat으로 가져다붙인 mypackage-1.2.3.tgz이 있으니, 최종적으로 현재 디렉토리에 mypackage-1.2.3.tgz의 압축을 풀게 된다. 

Advanced Install Script

위의 Install Script는 별 문제 없이 돌아가지만, 본격적으로 사용하기에는 몇 가지 문제가 있다.
  1. tail로 출력한 라인수를 수동으로 계산해주어야 한다. 만약 sfx-header이 사용자에 의해서 수정된다거나 라인수를 잘못 입력했다하면, 제대로 작동하지 않게 된다. 
  2. 현재 디렉토리에 압축이 풀리는데, 사용자가 원하는 디렉토리에 풀리도록 해야 할것이다. 사용자의 입력을 받아들일 수 있어야 할 것이다. 
  3. 만약의 경우를 대비해서, 임시디렉토리에서 압축을 푸는 등의 관련작업을 한 다음, 성공했을 경우 지정된 디렉토리로 옮기도록 한다. 

다음은 위의 문제들을 해결하도록 수정된 스크립트다.
#!/bin/sh 
 
DEFDIR="/usr/local" 
TEMPDIR="/tmp/myapp" 
WORKDIR=$PWD 
 
clear 
echo "=====================================================" 
echo "ESM Package V1.0 - extracting archive ... please wait" 
echo "=====================================================" 
 
if [ $UID != 0 ]; 
then 
    echo "Your not Root !!" 
    exit 1 
fi 
 
echo -n "Install Directory ($DEFDIR): " 
read UDIR 
if [ "$UDIR" = "" ]; 
then 
    UDIR=$DEFDIR 
else 
    UDIR="$UDIR" 
fi 
 
echo "Install Dir is $UDIR" 
test -d $UDIR 
if [  $? -eq 1 ]; 
then 
    mkdir $UDIR 
    if [ $? -ne 0 ]; 
    then 
        echo "Directory Create failure : $UDIR" 
    fi 
fi 
 
 
SKIP=`awk '/^__ARCHIVE_FOLLOWS__/ { print NR + 1; exit 0; }' $0` 
 
mkdir $TEMPDIR 
cp $0 $TEMPDIR 
cd $TEMPDIR  
tail +$SKIP $0 | tar x 
mv * $UDIR 
cd $WORKDIR 
 
if [ $? -eq 0 ]; 
then 
    echo "=======================================================" 
    echo " Program Install Success" 
    echo "=======================================================" 
else 
    echo "=======================================================" 
    echo " Program Install Failure" 
    echo "=======================================================" 
fi 
exit 0 
 
__ARCHIVE_FOLLOWS__ 
 
read 명령을 이용해서 프로그램이 설치될 경로를 사용자가 직접 입력할 수 있도록 했다. 만약 아무것도 입력하지 않는다면, 기본경로인 DEFDIR에 설치되도록 했다. 그다음 test 명령을 이용해서 사용자가 입력한 경로가 존재하는지를 확인하고, 존재하지 않는다면 mkdir(1)로 해당 디렉토리를 설치하도록 한다. 자동으로 압축을 풀어야할 줄을 계산하기 위해서awk(1) 명령을 이용하고 있다. awk를 이용해서 ARCHIVE_FOLLOWS를 찾게하고, 이 문자열의 줄수를 얻어와서 tail로 넘기도록 했다. 마지막으로 임시디렉토리를 만든다음 설치파일을 복사하고, 압축을 푼다음, 풀린 파일을 설치 디렉토리로 이동하도록 한다. 모든 작업을 마친다음 원래 작업 경로로 이동하는 걸로 설치 스크립트가 끝난다.
Posted by tornado
|

출처 : http://blogs.technet.com/seanearp/archive/2008/05/13/installing-ubuntu-8-04-hardy-heron-in-virtual-pc-2007.aspx




Installing Ubuntu 8.04 Hardy Heron in Virtual PC 2007

A picture is worth a thousand words...

image

"An unrecoverable processor error has been encountered.  The virtual machine will reset now."

It looks like Ubuntu isn't the only one with this problem... Fedora 9 releases tomorrow and according to this post, it has the same error in Virtual PC.  Whatever happened to Linus' Law? (given enough eyeballs, all bugs are shallow).  I guess enough eyeballs writing kernel code are not doing so on Virtual PC.  ;)

Fortunately, the fix is covered in the comments (and summarized by Robert) from Arcane Code's excellent article, aptly named Installing Ubuntu 8.04 under Microsoft Virtual PC 2007.

Using guidance from a number of participants on this blog I’ve successfully managed to install Ubuntu 8.04 on two separate PC’s running VPC 2007 and I have it running at 1152 X 768 @ 55Hz with working sound.

The notes below are nothing original, they are just summarized from previous entries and maybe clarified.

To get the CD to load,
Press F4 to select an alternate starting mode. When it pops up, change to Safe graphics mode and press Enter.
Select F6 and add “noreplace-paravirt” to the end of the command line and press Enter.
Now pick “Try Ubuntu…” (should already be selected) and press enter. Do NOT pick the Install Ubuntu option,

Once Ubuntu is loaded from CD, select install from the desktop and it’ll build the system on the VPC disk.
After you press restart, it just kind of hangs there. I shut the VPC session down and told it to save state, then started it again and it booted fine.

Once it gets to GRUB, interupt the boot and add the “noreplace-paravirt” to the kernel boot line.

1. Press “esc” while grub is visible.
2. You should now see 3 entries to select from. Leave the first one “Ubuntu 8.04, kernel 2.6.24-16-generic” selected and press “e”.
3. On the next page, select the second entry that reads “kernel /boot/vmlinuz…” and press “e” again.
4. You will see a command line that ends with “xforcevesa”. Hit “space” and add “noreplace-paravirt” (without the quotes) to that line and press “enter”.
5. You are now back at the previous selection screen with the entry “kernel /boot/vmlinuz…” still selected. Now press “b” and it should boot correctly.

Once Ubuntu has loaded, open a terminal window (Applications. Accessories, Terminal) and on the command line enter “sudu nano /boot/grub/menu.lst”
Enter your password and page down to near the bottom and locate the “kernel /boot/vmlinuz… in the “Ubuntu 8.04, kernel 2.6.24-16-generic” section

Move the cursor to the end of the line after xforcevesa and add “noreplace-paravirt” (no quotes)
Ctrl + O to write out, enter to accept the name, Ctrl + X to close

While you’re editing, you might as well fix the sound while you’re at it.

sudo nano /etc/rc.local

At the end of the # lines, but before “exit 0″, type on a new line (again without quotes) “modprobe snd-sb16″
Ctrl + O to write out, enter to accept the name, Ctrl + X to close.

Reboot Ubuntu. The reboot should be clean, and the sound icon should come up without an error indication.

Screen size is a little tricky. Go to http://arcanecode.wordpress.com/2008/04/07/installing-ubuntu-804-beta-under-virtual-pc-2007

Find the entry from pb dated April 27 and cut the xorg.conf file from this entry and past it into the Ubuntu text editor. (Applications, Accessories, Text Editor). Save the file as xorg.conf in your user folder.

Open a terminal window.

Backup the old version of xorg.conf
sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.backup

Copy the new one you created to the same location
sudo cp xorg.conf /etc/X11/xorg.conf

Reboot.

When Ubuntu reboots, your get a black screen with a X in the middle, then you’ll get a dialog message to saying “Ubuntu is running in low graphics mode, screen and graphics card coud not be detected”.

Take the option to configure graphics mode.
In the drop down where it says plug & play, select “Monitor 1280 X 1024″.
Select 1280 X 1024 @ 60Hz as your resolution.
Select Test
You should get a larger ‘gray’ window with option to keep the confguration. Select the option to keep it.

Ubuntu will start as normal and will be exactly the same size as before. Before you reboot, take alook at /etc/X11/xorg.conf …. it’s not the one you just created. Creating the new one appears to force Ubuntu to create a new one with more options.

Reboot again and you shold have a Ubuntu session runing at 1152 X 768 @ 55Hz.

Last couple of things…. in System, Preferences, Sound, set the playback options to ALSA. It’s pretty crappy but works better than OSS and certainly better than Auto detect which generates a stream error when you try to play MP3’s or movies.

Whew!  That's a lot of text.  I'll leave you with the new Ubuntu desktop background, which is pretty cool in a orange-brown-must-be-the-new-black kind of way.

hardy_heron

Published Tuesday, May 13, 2008 5:11 AM by smearp
Filed under: ,

Comments

# Installing Fedora 9 (Sulphur) in Virtual PC 2007

Fedora 9 was released last week, which you can download here: http://fedoraproject.org/get-fedora.html

Sunday, May 18, 2008 11:10 PM by The Sean Blog

# Virtual PC 2007 SP1 now out.

If you have Vista, or installed XP SP3, you might have seen some quirkiness out of Microsoft Virtual PC 2007. To counter, Microsoft has released a Service Pack for this Virtual environment. The Download is for x86 and x64 and...

Tuesday, May 20, 2008 9:17 PM by Geek News Central

# Virtual Server on Windows Home Server

Virtual Server on Windows Home Server

Sunday, June 15, 2008 2:42 AM by Developer's Notes

# Installare Fedora 9 in Virtual PC 2007

Installare Fedora 9 in Virtual PC 2007

Thursday, July 03, 2008 4:26 AM by Ermanno Goletto

# re: Installing Ubuntu 8.04 Hardy Heron in Virtual PC 2007

Very helpful article. Using it I got a Hardy Heron Desktop install onto a Virtual PC VM on Vista. Any suggestions about how to get the Server install onto a VM instead?

Monday, August 25, 2008 7:28 PM by NeilDoesDotNet

# Instalación de Ubuntu 8.04 en Virtual PC 2007

Reconozco que siempre he utilizado Windows, ya que mi trabajo así lo ha requerido, pero con los nuevos

Wednesday, September 17, 2008 5:20 PM by De todo un poco
Anonymous comments are disabled
Posted by tornado
|

http://www.smartertools.com/SmarterMail/Features/Windows-Mail-Server-Web-Interface.aspx

회사 최차장님이 알려준 메일서버 ^^

윈도우에서 사용할 수 있는 메일서버이며 무료이다.

도메인당 10 명까지 제한은 있지만 테스트 용으로 딱인것 같음.

사용자 삽입 이미지

Posted by tornado
|

[출처] http://blog.naver.com/amnesty7?Redirect=Log&logNo=30023975479



find ./ -name "*.*" -exec grep 'index_seperate.jsp' {} \; -print




Posted by tornado
|