2012. 12. 23. 18:49

awk 예제



== Reference ==

 * http://stone.backrush.com/sunfaq/ljs006.html


== Using awk ==


# Running awk
* awk 'instructions' files
* awk -f script files

# examples
* awk '{ print $1 }' list
* awk '/MA/' list
* awk '/MA/ { print $1 }' list
* awk -F, '/ma/ { print $1 }' list
* awk -F, '/ma/ { print $1; print $2; print $3 }' list
* example
awk -F, '{
print $4 ", " $0
}' $* |
sort |
awk -F, '
$1 == LastState {
print "\t" $2
}
$1 !== LastState {
LastState = $1
print $1
print "\t" $2
}'
* result
California
Amy Wilde
Massachusetts
Eric Adams
John Daggett


2012. 12. 23. 18:45

auto logout / Fedora


/etc/profile에 아래처럼 적는다.
# /etc/profile
TMOUT=600
export PATH .... 뒤에 TMOUT을 적는다.

root계정의 자동 로그아웃
/etc/profile (모든사용자), /root/.bash_profile( root의 bash쉘 로긴시 적용받는 프로파일)중에서 TMOUT시간을 정해 주면 된다
단, /root/.bash_profile에서는TMOUT=(초단위) 입력하고나서 export TMOUT해줘야한다.
#vi /root/.bash_profile
TMOUT=10(단위는 초)
export PATH TMOUT

근데 source .bash_profile 하면 잘 되지만
기냥 root로 로긴하면 안되더라
.bash_profile을 적용하는 방법은???

2012. 12. 23. 18:44

시간 동기화 / Fedora

Server 또는 Host의 시간을 NTP 서버와 동기화 시키기


== rdate ==

 * rdate -p -s <1time.server.name>

 * time server

time.bora.net
time.nuri.net
www.hanyang.ac.kr
www.hongik.ac.kr
www.korea.ac.kr
www.skku.ac.kr
www.snu.ac.kr

== ntpdate ==

 * ntpdate <time.server>


== hw clock ==

 * 시간을 맞추어 주고 나면 운영체제상에서는 바뀔 수 있지만 바이오스에서는 바뀌지 않으므로 리눅스의 경우 아래 명령을 실행해 준다.

 * hwclock --show (또는 -r)

 *  새로 바뀐 시스템 표준 시각을 H/W clock 에 설정하는 방법


hwclock --systohc (또는 -w) <== 현재 설정된 시간을 이용하여 하드웨어 시계를 맞춤



2012. 9. 5. 20:13

Mail(Exchange, IMAP) configuration for Thunderbird and Mobile phone - 메일 설정

########################################

# Thunderbird 설정

########################################

 

== Addon list ==

AttachmentExtractor

Lightning, Provider for Google Calendar, Provider for Microsoft Exchange

Signature Switch

Zindus

 

== Configuration for Provider for Microsoft Exchange ==

* Add Calendar and configure like below for auto-discovery

  : network = https://Domain\id@auto

* Reference : http://gitorious.org/lightning-exchange-provider/pages/Home#Usage+and+documentation++

 

== Configuration for Account for Microsoft Exchange ==

Can find the informations of server on 'Office Outlook Web Access'
    - IMAP server name : Client Access server name

    - SMTP server name : Outlook Web Access host name
    - user name : id

for IMAP

 * server name :
 * port : 143

 * user name : id

for SMTP

 * Server name : 

 * port : 587

 * Connection security : None

 * Authentication method : Password, transmitted insecurely

 * user name : id


== Configuration for Mobile phone of Exchange mail server ==

Can find the informations of server on 'Office Outlook Web Access

 * email id

 * ID

 * password :

 * Domain

 * 서버 주소 : sync-ao.e*******.com

 * SSL


 

2012. 8. 30. 18:15

Solaris/포트 번호와 사용중인 Process 확인하기

######################################

# Solaris에서 Process가 사용하는 포트번호와 실행파일 알아내기
######################################

<Reference>

< Index >

< Content >

== 해당 프로세스의 pid를 확인한다 ==

 a. ps -ef |grep <process 이름> |grep <service이름>

 a. lsof | grep -i <process 이름, ex:glassfish>


== 해당 프로세스가 찾고자 하는 서비스를 하고 있나 확인 ==

 a. lsof -p <pid> |grep <service name, ex:lat->


== 해당 프로세스가 사용중인 포트번호 확인 ==

 a. lsof -p <pid> |grep -i listen



2012. 8. 10. 18:57

Solaris/mt 명령어 - Tape management

< 목차 : Index >

==  백업용 tape 종류와 발전사 ==

== Tape status 보기 ==

== Tape Management ==

==  http://blog.naver.com/icary/140061342973 ==

== /dev/rmt/0 과 /dev/rmt/0n의 차이 : http://ps2046.blog.me/80034002396 ==


< 본문 : Content >

== 참고 ==

 * http://ps2046.blog.me/80034002280

 *  http://blog.naver.com/icary/140061342973


==  백업용 tape 종류와 발전사 ==

 * Tape 백업 발전사

   - http://blog.naver.com/sispaqlove/80026960406

 * LTO란 무엇인가?

  - http://blog.naver.com/jin31/60006439659

 * 백업장치_LTO종류

   - http://blog.naver.com/hoon295/50003772773

 * Tape Autoloader

  - http://blog.naver.com/smino81/17023762


== Tape status 보기 ==
 *  cfgadm 상태로 아래처럼 tape driver가 보이는지 확인한다. : /usr/sbin/cfgadm -al
     c3                             scsi-bus     connected    configured   unknown
     c3::rmt/0                      tape         connected    configured   unknown
  a. SL48의 scsi 케이블이 빠져 있을때는 'c3::rmt/0 tape' 부분이 보이지 않는다.

 *  mt 명령으로 tape 미디어가 보이는지 확인하여 있을때 없을때를 구분해 주면 정상으로 본다.
   a. Tape이 없을때
     mt -f /dev/rmt/0 status
    /dev/rmt/0: no tape loaded or drive offline
   a. Tape이 있을때
     bash-3.00$ mt -f /dev/rmt/0 status
    HP Ultrium LTO 4 tape drive:
      sense key(0x6)= Unit Attention   residual= 0   retries= 0
      file no= 0   block no= 0

== Tape management ==

* To rewind a tape (default)

   a. mt /dev/rmt/0 rewind

* To rewind and eject a tape

   a. mt /dev/rmt/0 offline

* mt <옵션> /dev/rmt/#hn

* 내용 확인하기

  a. tar tvf /dev/rmt/0 # tape을 rewind 시키고 해야 하나??


==  http://blog.naver.com/icary/140061342973 ==

. tape device mount하기 : devfsadm; tapes

. mount 상태 확인 : iostat -En

. tape 상태 확인 : mt status

. 백업 : ufsdump Ouf ~~

. 복구 : 

- ufsrestart -rvt 

- tar -xvf /dev/rmt/0


== /dev/rmt/0 과 /dev/rmt/0n의 차이 : http://ps2046.blog.me/80034002396 ==

 * http://ps2046.blog.me/80034002396

2012. 8. 7. 21:25

Solaris/automounter - autofs, auto_direct

AUTOMOUNTER PSD/FAQ

== Overview == * AutoFS
솔라리스 AutoFS 구성하기 *


2012. 7. 6. 11:13

MS의 VLSC(Volume License Service Center)에서 라이선스 관리

######################################################

# MS의 VLSC(Volume License Service Center)에서 라이선스 관리

######################################################


== 참고 ==

VLSC 등록하기 : http://blog.3splanner.co.kr/278


== 요약 ==

 * Windows Server 라이선스를 Open License(Volume License?)로 사게 되면 MS의 VLSC 싸이트에 등록하여 해당 키를 관리할 수 있다.

 * 설치 이미지(iso파일)도 내려 받을수 있다.

 * Windows Live에 계정이 있어야 하고 다른 사람들에게 해당 License관리/사용 권할을 할당할 수도 있다.


==  License Activation ==

 * 해당 Windows 설치후에 MS의 콜센터에 전화해서 설치시 사용했던 Key값을 불러주면 된다?
 *  설치한후 고객지원센터에 전화합니다. : 연락처- 1577-9700번-ARS-2번-2번-3번 누른후 
 * 보유하고 계신 2008 Product Key를 알려주면 정품인지 확인하고 아래 진행
 a. Open 'System Properties' window, then you can find the needed info like below.
  . open Windows explorer
  . select My computer
  . select perperties in letf-click menu

== License 내역 ==

 * 60***070 : L : ㅇㅊ

 * 60***355 : L : ㄷㅅ


2012. 6. 28. 11:00

Solaris/iso file mount 하기

###################################

# Solaris/iso file mount 하기

###################################


참고 : http://blog.naver.com/nixblade/10085250331


== 사용 방법 ==

1. iso 파일준비

     # test.iso


2. iso 파일 시스템이 인식하는 device 할당

 #lofiadm -a /tmp/test.iso # 절대경로를 사용해야 한다.

  /dev/lofi/1 -> test.iso 파일이 /dev/lofi/1 이라는 device로 자동 매핑


3. 마운트

 #mkdir /mnt/iso

 #mount -F hsfs -o ro /dev/lofi/1 /mnt/iso


4. unmount

 #unmount /mnt/iso

 #lofiadm -d /dev/lofi/1

 #lofiadm -> 현재 list 출력

2012. 6. 26. 21:59

Solaris and Linux/screen 사용법


참고 : http://sahngoh.tistory.com/345

1. 스크린 만들기 

   : Screen -S <session name>
2. 스크린 목록 보기

   : Screen -list
3. 스크린 복구

   : screen -r <session name>
4. 스크린 Detach
  [Ctrl+a, d] (etach)로 스크린을 빠져 나갑니다.
5. Attach된 스크린 Detach

  : screen -D <pid>