#!/usr/bin/perl

$buffer=$ENV{'QUERY_STRING'};
@pairs = split(/&/,$buffer);
foreach $pair ($paris)
{
    ($name, $value) = split(/=/,$pair);
    $value =~ tr/+/ /;
    $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg;
    $FORM{$name} = $value;
}

print("Content-type: text/plain\n\n");
print `finger $FORM{"user"}`;



서버단에서 실행하면,

root@www ~ [0.00 0.00]> perl test.pl 

Content-type: text/plain


Login     Name       Tty      Idle  Login Time   Office     Office Phone   Host

xxxxx             pts/3          Dec 13 10:08                           (x.x.xx)

신고

'서버관리' 카테고리의 다른 글

불법 접근 차단하기  (0) 2012.12.13
Adaptec Raid Controller Build options  (0) 2012.12.13
취약한 cgi 프로그램 perl 예시  (0) 2012.12.13
아파치 모듈 확인하기  (0) 2012.12.12
로그 파일에 대해  (0) 2012.12.12
어떤 데몬과 연결되어 있는지 확인하기  (0) 2012.12.12

WRITTEN BY
김병국
유용했던 자료를 기록해 두었습니다. 도움이 되시길~~~ Welcome! I started this blog as a way to give back to all of the other system administrators who have taught me something in the past. Writing these posts brings me a lot of enjoyment and I hope you fun

받은 트랙백이 없고 , 댓글이 없습니다.
secret

1. up 화살표를 이용한다.
2. !! 를 입력한다.
3. !-1 을 입력한다.
4. Ctrl + P 를 입력한다.( 엔터를 입력해야 실행된다.)

저작자 표시 비영리 동일 조건 변경 허락
신고

WRITTEN BY
김병국
유용했던 자료를 기록해 두었습니다. 도움이 되시길~~~ Welcome! I started this blog as a way to give back to all of the other system administrators who have taught me something in the past. Writing these posts brings me a lot of enjoyment and I hope you fun

받은 트랙백이 없고 , 댓글이 없습니다.
secret
클라이언트 openvpn 설치시 bin 디렉토리에 보면,

addtap 있는데 이것을 실행한다.

설정 파일에서

dev-node "로컬 영역 연결 8"   이런씩으로 추가한다.


신고

WRITTEN BY
김병국
유용했던 자료를 기록해 두었습니다. 도움이 되시길~~~ Welcome! I started this blog as a way to give back to all of the other system administrators who have taught me something in the past. Writing these posts brings me a lot of enjoyment and I hope you fun

받은 트랙백이 없고 , 댓글이 없습니다.
secret

uHost 'xxx.xxx.xxx.xxx' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'Connection closed by foreign host.


기존 아래 값이 10으로 되어 있었다. 

mysql> show variables like 'max_connect_errors';
+--------------------+-------+
| Variable_name      | Value |
+--------------------+-------+
| max_connect_errors | 10000 |
+--------------------+-------+
1 row in set (0.00 sec)

mysql> SET GLOBAL max_connect_errors=10000;


아래 실행한다.
 /usr/local/mysql/bin/mysqladmin -u root -p flush-hosts

저작자 표시 비영리 동일 조건 변경 허락
신고

WRITTEN BY
김병국
유용했던 자료를 기록해 두었습니다. 도움이 되시길~~~ Welcome! I started this blog as a way to give back to all of the other system administrators who have taught me something in the past. Writing these posts brings me a lot of enjoyment and I hope you fun

받은 트랙백이 없고 , 댓글이 없습니다.
secret

url 이 아래와 같이 있다고 할때,

# cat list.txt 
naver.com
daum.net
google.co.kr

 

아래 처럼 실행하면, 모든 url 다운로드를 진행하게 된다.
# cat list.txt | xargs wget -c


--2012-11-16 14:24:09-- http://naver.com/
Resolving naver.com... 220.95.233.172, 220.95.233.171, 202.131.30.11, ...
Connecting to naver.com|220.95.233.172|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://www.naver.com/ [following]
--2012-11-16 14:24:09-- http://www.naver.com/
Resolving www.naver.com... 202.131.30.12, 202.131.30.11
Connecting to www.naver.com|202.131.30.12|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `index.html'

[ <=> ] 99,910 --.-K/s in 0.009s

2012-11-16 14:24:09 (10.6 MB/s) - `index.html' saved [99910]

--2012-11-16 14:24:09-- http://daum.net/
Resolving daum.net... 61.111.62.173, 110.45.215.23, 114.108.157.19, ...
Connecting to daum.net|61.111.62.173|:80... connected.
HTTP request sent, awaiting response... 302 Object Moved
Location: http://www.daum.net/ [following]
--2012-11-16 14:24:09-- http://www.daum.net/
Resolving www.daum.net... 110.45.215.15, 114.108.157.116
Connecting to www.daum.net|110.45.215.15|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `index.html'

100%[======================================>] 144,453 --.-K/s in 0.006s

2012-11-16 14:24:09 (24.7 MB/s) - `index.html' saved [144453]

--2012-11-16 14:24:09-- http://google.co.kr/
Resolving google.co.kr... 74.125.128.94, 2404:6800:4005:c00::5e
Connecting to google.co.kr|74.125.128.94|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://www.google.co.kr/ [following]
--2012-11-16 14:24:09-- http://www.google.co.kr/
Resolving www.google.co.kr... 74.125.128.94, 2404:6800:4005:c00::5e
Reusing existing connection to google.co.kr:80.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `index.html'

7% [=> ] 11,081 --.-K/s in 0.04s

2012-11-16 14:24:09 (297 KB/s) - `index.html' saved [144453]

FINISHED --2012-11-16 14:24:09--
Downloaded: 3 files, 380K in 0.05s (7.26 MB/s)

저작자 표시 비영리 동일 조건 변경 허락
신고

WRITTEN BY
김병국
유용했던 자료를 기록해 두었습니다. 도움이 되시길~~~ Welcome! I started this blog as a way to give back to all of the other system administrators who have taught me something in the past. Writing these posts brings me a lot of enjoyment and I hope you fun

받은 트랙백이 없고 , 댓글이 없습니다.
secret
Argument list too long

해당 디렉토리로 가서 아래 스크립트 실행

for file in $(ls)
do
    rm -fv $file
done


안써먹으니 이 간단한것도 기억에서 잊혀진다.


# find ./ -name "*.log" -print0 
./1.log./2.log

 

# find ./ -name "*.log" -print0 | xargs -0 rm -f
# ls

다 지워 졌음.

 

 

find 옵션

-print0
True; print the full file name on the standard output, followed by a null
character (instead of the newline character that '-print' uses). This
allows file names that contain newlines or other types of white space to be
correctly interpreted by programs that process the find output. This option
corresponds to the '-0' option of xargs.

 

 

xargs 옵션

--null, -0

Input items are terminated by a null character instead of by whitespace, and
the quotes and backslash are not special (every character is taken liter-
ally). Disables the end of file string, which is treated like any other
argument. Useful when input items might contain white space, quote marks,
or backslashes. The GNU find -print0 option produces input suitable for
this mode.

신고

WRITTEN BY
김병국
유용했던 자료를 기록해 두었습니다. 도움이 되시길~~~ Welcome! I started this blog as a way to give back to all of the other system administrators who have taught me something in the past. Writing these posts brings me a lot of enjoyment and I hope you fun

받은 트랙백이 없고 , 댓글이 없습니다.
secret