[참고 : http://linuxhelp.blogspot.com/2006/04/enabling-and-disabling-services-during_01.html]
[참고 : http://linuxhelp.blogspot.com/2006/04/enabling-and-disabling-services-during_01.html]
Table of Contents
- 1. Introduction to Win32 Shell Scripting
- 2. The Environment
- 3. Batch Programming
- 3.1. Auxiliary files for extended batch programming
- 3.1.1. OldDos.exe
- 3.1.2. NT Resource Kit
- 3.1.3. CHOICE.EXE
- 3.2. Batch Basics
- 3.2.1. Command Redirection and Pipelines
- 3.2.2. Variables
- 3.2.3. Control Contructs
- 3.3. Simple Examples
- 3.3.1. Creating Aliases
- 3.4. Example batch file
- 3.5. BatchMaker example - Unix for Windows (sort of)
'chipper' is not recognized as an internal or external command, operable program or batch file.
|
Because we had not updated the PATH to point to the location of the binary files for this program.
Altering environment variables will depend on what version of Windows you are using, see Configuring A Windows Working Environment.
ftp://ftp.microsoft.com/softlib/mslfiles/olddos.exe
This is a self-extracting archive containing some of the files that were distributed with versions of Windows prior-to and including Windows 95, programs such as qbasic.
http://www.microsoft.com/ntserver/nts/downloads/recommended/ntkit/default.asp
This is a subset of the tools found in the full Windows NT Resource Kit. Only available for Windows 2000/NT/XP users.
-
ls > file
-
grep searchterm < file -
dir >> file -
commmandA 2>
dir | more |
New variables can be instantiated like this:
set name=value
|
Variables are referenced like this: %name%, here is an example:
@echo off
msg1=Hello
msg2=There!
echo %msg1% %msg%
|
This would echo "Hello There!" to the console display, here is another example:
@echo off
set msg1=one
set msg2=%msg1% two
set msg3=%msg2% three
echo %msg3%
|
@echo off
echo set msg=Hello World! > hello.bat
echo echo %%msg%% >> hello.bat
hello.bat
|
The flow of control within batch scripts is essentially controlled via the if construct.
IF [NOT] ERRORLEVEL number command
IF [NOT] string1==string2 command
IF [NOT] EXIST filename command
|
@echo off
if "%1"=="1" echo The first choice is nice
if "%1"=="2" echo The second choice is just as nice
if "%1"=="3" echo The third choice is excellent
if "%1"=="" echo I see you were wise enough not to choose, You Win!
|
@echo off
if exist hello.bat (
echo Removing hello.bat...
del hello.bat
echo hello.bat removed!
)
|
The syntax of the for command is:
FOR %%variable IN (set) DO command [command-parameters]
|
@echo off
if exist bigtxt.txt rename bigtxt.txt bigtxt
for %%f in (*.txt) do type %%f >> bigtxt
rename bigtxt bigtxt.txt
|
FOR /L %%variable IN (start,step,end) DO command [command-parameters]
|
@echo off
FOR /L %%i IN (0 2 100) DO echo %%i
|
@echo off
FOR /L %%i IN (0 2 100) DO (
echo ***
echo %%i
echo ***
)
|
rem A Bang Counter
@echo off
set n=%1
set i=
: loop
set i=%i%!
echo Bang!
if %i%==%n% goto end
goto loop
:end
|
@echo off
REM dir.bat, maps dir to Unix ls
dir %1
|
@echo off
REM antlr.bat, creates shortcut for antlr java program
java antlr.Tool %1
|
@echo off
REM home.bat, changes to your home directory and lists contents
c:
cd \home
cls
dir
|
The example below illustrates some of the features of batch programming.
Example 1. Batch file - Concatenate and zip Example
![]() |
The command echo followed by the option off sets batch echoing to off, this means that the batch commands will not be echoed to standard output, that is, you will not see them on your screen. The line is prefixed by a "@" character which is used to specify that the line it is present on should not be echoed to standard output, hence is needed so that we do not echo the command sequence that turns echoing off. | ||
![]() |
Comments in batch files are officially meant to begin with the prefix REM which stands for REMark, this tells the command interpreter to ignore this line. It turns out, however, that it is quicker to use :: in order to markup a comment. :: is used because : indicates the start of a label, the next : tells the parser to ignore this label. | ||
![]() |
In batch programming, command line parameters are referenced by using the %n notation where n indicates the numerical weight of the parameter on the command line. %0 refers to the name of the batch file itself, %1 the first parameter, %2 the second and so on. You may only reference a maximum of 9 parameters in this way, if you need more you should process these first ones and then use the shift command to access the rest, the shift, shifts the parameters left by one so that %2 becomes %1 etc, hence the non-existent %10 would be shifted into %9 and you could access the parameter. There is no way to recover a parameter once it has been shifted out completely, i.e %0 will disappear upon being shifted. The program listing illustrates the use of the IF clause to take an alternative course of action if no either or both of the required parameters is missing. %1 and%2 are compared to an empty string which would indicate their omission from the command line if true, hence if the IF clause evaluates to TRUE the command after is executed which is GOTO USAGE which indicates that program control should jump to the USAGE label. | ||
![]() |
This for construct enables us to implement iterative behaviour in our batch files. It says that for each %%i within the set *.%1 we should perform the commandtype %%i >> %2. %%i is a for-loop variable, these begin with %% and end with a sequence of alpha characters. The for-loop says to assign the values in our set to this variable in turn, which allows us to reference each of the values in the set with the same variable in the for-loop body allowing us to perform a specific operation on each of the values in the set. The specific operation in this case is to redirect the output of type (which dumps the contents of a file to stdout) to a file, specifically %2which is our second command line parameter. The use of two > characters in series ensures that the contents of the file are appended to the end of the target file and do not overwrite the output file, which would be the case if only one > had been used. | ||
![]() |
The shift command shifts all command line parameters one parameter to their left, see number 3 for more details about shift. The reason it has been used here is explained in the next callout. | ||
![]() |
Pkzip is a shareware file compression program that is executed from the command line, for details on obtaining PkKzip see Auxiliary files for extended batch programming, it takes the command form:
Where zipfile is the name of the zipfile you wish to create and file(s)... are the files you want to put in the zipfile. In order that the zipfile be given the same name as the second parameter (without the extension) passed to the batch file, the notation %~n1 was used to specify that %~n1 should take the value of the name of %1 but not the extension. The notation %2~n1 is not allowed so to reference just the filename of the second parameter passed to the batch file and not the extension, the command line parameters were first shifted to the left by one using SHIFT, as explained previously, the second parameter became the first parameter and it's filename could be referenced with %~n1. Pkzip was told to use the filename %~n1.zip as the zipfile and %1 as the file to compress, which (owing to the SHIFT) was the second parameter passed to the batch file. | ||
![]() |
Labels are specified by prefixing an alpha-character identifier with a ':' character, labels are jumped to using the GOTO. | ||
![]() |
By using echo text may be echoed to standard output so that the user may see it. echo. echos an empty line to standard output. This section of the program is only executed if one or both of the command line parameters are omitted. The program shows that normally execution will be caused to circumvent this section by means of GOTO END immediately prior its declaration. |
![]() |
Note |
|---|---|
This works on Windows 2000, I have tested this on Windows 98 and it does not work. | |
@echo off
if "%1"=="" GOTO USAGE
copy %1 %2 %3 %4 %5 %6 %7 %8 %9
GOTO END
:USAGE
copy /?
:END
|
@echo off
if "%1"=="" GOTO USAGE
if "%2"=="" GOTO USAGE
echo @echo off
FOR /L %%i IN (1 1 %2) DO (
echo if "%%%%i"=="" GOTO USAGE
)
echo %1 %%1 %%2 %%3 %%4 %%5 %%6 %%7 %%8 %%9
if "%2"=="0" GOTO END
echo GOTO END
echo :USAGE
echo %1 /?
echo :END
GOTO END
:USAGE
echo maps a command to an alias
echo map %%1 %%2
echo %%1 is command to map
echo %%2 is the number of command line args the command *needs*
echo e.g map copy 2 > cp.bat (to map copy to cp.bat)
:END
|
@echo off |
Because this will be present at the top of all of the batch files created. It then enters this loop:
FOR /L %%i IN (1 1 %2) DO (
echo if "%%%%i"=="" GOTO USAGE
)
|
if "%1"=="" GOTO USAGE |
echo %%1 %%2 %%3 %%4 %%5 %%6 %%7 %%8 %%9 |
command %1 %2 %3 %4 %5 %6 %7 %8 %9 |
if "%2"=="0" GOTO END
echo GOTO END
echo :USAGE
echo %1 /?
echo :END
GOTO END
|
@echo off
copy %1 %2 %3 %4 %5 %6 %7 %8 %9
|
An example usage will clarify, the contents of mv.bat after executing
map move 2 > mv.bat |
@echo off
if "%1"=="" GOTO USAGE
if "%2"=="" GOTO USAGE
move %1 %2 %3 %4 %5 %6 %7 %8 %9
GOTO END
:USAGE
move /?
:END
|
@echo off
if "%1"=="" GOTO USAGE
call map copy 2 > %1\cp.bat
call map move 2 > %1\mv.bat
call map del 1 > %1\rm.bat
call map type 1 > %1\cat.bat
call map dir 0 > %1\ls.bat
GOTO END
:USAGE
echo Creates a set of Unix-named aliases for common DOS commands:
echo map %%1
echo where %%1 is the output directory, e.g c:\windows\command
:END
|
'Programming' 카테고리의 다른 글
| Win32 Shell Scripting 가이드 (0) | 2011/08/08 |
|---|---|
| Win32 Shell Scripting Tutorial (0) | 2010/09/09 |
| vi '단말기 폭 초과' 메시지 대처법 (0) | 2010/08/28 |
| Windows Shell Programming Guide (0) | 2010/07/02 |
| 네트워크 특정 IP 작업그룹/컴퓨터명 정보 조회 (0) | 2010/02/09 |
| 정규표현식 기본 문법 (0) | 2010/02/04 |
[출처 : http://blog.naver.com/ez_/140127596628]
MySQL Character set 처리
- character_set_system (설정 불가능 변수)
MySQL 서버가 Identifier를 저장할 때 사용하는 Character set이며, 이 값은 섧정 불가능하고 항상 utf8로 설정되어 있다 - character-set-server
MySQL 서버의 기본 Character set - character_set_client
MySQL 클라이언트의 기본 Character set - character_set_connection
쿼리 문장에서 인트로듀서가 없는 리터럴 또는 Number를 String으로 변환할 때 사용하는 Character set - character_set_database
MySQL 데이터베이스의 Default Character set - character_set_filesystem
LOAD DATA INFILE ... 또는 SELECT ... INTO OUTFILE 문장이 실행될 때, 파일의 읽고 쓰기에 사용되는 Character set - character_set_results
MySQL 서버가 쿼리의 처리 결과를 클라이언트로 보낼 때 사용하는 Character set
[출처 : http://blog.naver.com/ez_/140127596628]
MySQL에서 한글을 저장하다보면, 분명 캐릭터셋을 utf8으로 지정한 것 같은데, 실제로는 UTF-8이 아닌(?) 경우가 생긴다.
- MySQL을 설치하고 데이터베이스를 생성한다.
- 테이블을 만들 때, CHARSET을 utf8으로 지정해서 만든다.
- 웹서비스를 utf-8으로 작성한다.
- 사용자에게 입력값을 받는다.
- 웹페이지에 입력받은 값을 쿼리로 추출하여 다시 출력해본다. 잘 나온다.
- (중략)
- UTF-8 터미널에서 MySQL 클라이언트 프로그램을 통해 서버에 접속한다.
- SELECT * FROM [table]을 해보니 한글이 깨져있다. 어?!
MySQL 클라이언트에서 SET NAMES latin1을 하고 SELECT 하면 값이 정상적으로 나오는데, SET NAMES utf8을 수행하면 값이 깨져보인다. 테이블이나 컬럼의 캐릭터셋은 utf8인데, 값을 저장하는 시점에서 사용된 커넥터의 기본 캐릭터셋이 utf8이 아니었을 때 발생하는 문제다.
이를 해결하기 위해 일반적으로는 mysqldump를 통해 latin1으로 데이터베이스를 덤프하고, 이 파일을 iconv나 기타 에디터를 통해 latin1 -> utf-8 변환을 수행한 후, 다시 넣는 식으로 작업한다.
나도 늘 이런 방식으로 복원했었는데, 이 작업이 불합리하다고 생각되어 다음과 같이 작업해보았다.
- ALTER TABLE [table] CONVERT TO CHARSET latin1;
- ALTER TABLE [table] MODIFY [column] BLOB;
- ALTER TABLE [table] MODIFY [column] VARCHAR(255) CHARSET utf8; // VARCHAR(255)등 원래 형식으로 복원
- ALTER TABLE [table] CONVERT TO CHARSET utf8;
http://dev.mysql.com/doc/refman/5.1/en/alter-table.html
위 레퍼런스 문서에 따르면, BLOB에서 VARCHAR나 TEXT등으로 ALTER가 발생할 경우에는 별도의 컨버젼이 발생하지 않기 때문에, 올바른 복원이 가능해진다.
아래에 MySQL 작업 예제를 첨부한다.
mysql> show create table charset_test;
+--------------+-------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+--------------+-------------------------------------------------------------------------------------------------------+
| charset_test | CREATE TABLE `charset_test` (
`name` varchar(100) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 |
+--------------+-------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql> set names latin1;
Query OK, 0 rows affected (0.00 sec)
mysql> select * from charset_test;
+--------------+
| name |
+--------------+
| 가나다라 |
+--------------+
1 row in set (0.00 sec)
mysql> set names utf8;
Query OK, 0 rows affected (0.00 sec)
mysql> select * from charset_test;
+-----------------------------+
| name |
+-----------------------------+
| e°€e‚˜e‹¤e¼ |
+-----------------------------+
1 row in set (0.00 sec)
mysql> alter table charset_test convert to charset latin1;
Query OK, 1 row affected (0.38 sec)
Records: 1 Duplicates: 0 Warnings: 0
mysql> alter table charset_test modify name blob;
Query OK, 1 row affected (0.05 sec)
Records: 1 Duplicates: 0 Warnings: 0
mysql> alter table charset_test modify name varchar(100) charset utf8;
Query OK, 1 row affected (0.04 sec)
Records: 1 Duplicates: 0 Warnings: 0
mysql> alter table charset_test convert to charset utf8;
Query OK, 1 row affected (0.04 sec)
Records: 1 Duplicates: 0 Warnings: 0
mysql> select * from charset_test;
+--------------+
| name |
+--------------+
| 가나다라 |
+--------------+
1 row in set (0.01 sec)
mysql>
[출처] MySQL : 이보시오 DBA 양반, 내가 UTF-8이 아니라니!|작성자 아미
'CS > Platform' 카테고리의 다른 글
| 솔라리스 정보 확인 (0) | 2011/04/07 |
|---|---|
| 웹서버별 환경설정 파일 위치 (0) | 2010/04/09 |
| 갤럭시S | 갤럭시S 호핀 | ||
| 외관사양 | 기본형태 | Full Touch Bar | Full Touch Bar |
| 크기(mm) | 122.4 x 64.2 x 9.9 | 112.4 x 64 x10.9(mm) | |
| 무게(g) | 121g | 129g | |
| LCD 크기 | 4.0형(10.08cm) | 4.0형(10.08cm) | |
| LCD 컬러 | 65K Color(DMB, 동영상 재생, 웹 브라우징시 16M Color 지원) | 65K Color(DMB, 동영상 재생, 웹 브라우징시 16M Color 지원) | |
| LCD 종류 | Super AMOLED | Super AMOLED | |
| LCD 해상도 | 480×800 | 480×800 | |
| COLOR 구성 | 메탈릭 블랙, 스노우 화이트, 팜므 핑크 | 전면:Black 후면:Titan Gray | |
| 배터리 사양 | 배터리 용량(표준형/대용량) | 표준형 (1500mAh) | 표준형 (1500mAh) |
| 연속통화시간 | 약 470분 | Up to 410분 | |
| 연속대기시간 | 약 490시간 | DRX 6: Up to 370시간, DRX 7: Up to 530시간 | |
| 연속통화시간(GSM모드) | 약 920분 | Up to 810분 | |
| 연속대기시간(GSM모드) | 약 590시간 | Up to 620시간 | |
| 기본기능 | 지원사양 | WCDMA / GSM | WCDMA / GSM |
| 무선인터넷 기능 | O | O | |
| 천지인 한글 | O (천지인, Qwerty) | O (천지인, Qwerty, Swype, hoppin 리모콘 키패드) | |
| 영상전화 | O | O | |
| 외장메모리 | O (microSD, 최대 32GB 지원) | O (microSD, 최대 32GB 지원) | |
| 멀티태스킹 | O | O | |
| 기본 항목 외 추가 기능 | - 프로그램 설치 공간 : 2GB - 컨텐츠 저장 공간 : 14GB - 구글 모바일 서비스 : 검색, 마켓, 지도, YouTube, 토크, Gmail, 전화번호/캘린더 싱크 | -대용량 내장메모리 : 16GB(물리적 용량) *프로그램 설치 가용 메모리 : 1.87GB *컨텐츠 저장 가용 메모리 : 12.95GB -구글 모바일 서비스 : 검색, 음성 검색, 마켓, 지도, YouTube, 토크, Gmail, 뉴스와 날씨, 내비게이션, 위치찾기, 지역정보, 전화번호/캘린더 싱크 | |
| 통화편의기능 | 소곤소곤 | X | X |
| 한뼘통화 | O | O | |
| 게임 재생 중 자동복구 | O | O | |
| 통화 중 폰 북 전송 | O | O | |
| 통화 중 메시지 보내기 | O | O | |
| 통화 중 메모 작성 | O | O | |
| 4자리 퀵 다이얼링 | O | O | |
| 초성으로 전화번호 바로검색 | O | O | |
| 특정번호 수신거부 | O (자동 수신 거절) | O (자동 수신 거절) | |
| 통화녹음 기능 | O (DH09 버젼부터 지원) | O | |
| 자동응답 기능 | O (수신 거절 메시지) | O (수신 거절 메시지) | |
| 비행기 탑승 모드 | O | O | |
| 블루투스 헤드셋으로 통화 | O | O | |
| 화면/소리 | 블랙 GUI | X | X |
| 애니 다이얼 | X | X | |
| 마이 스크린 | X | X | |
| 국번/숫자별 컬러 설정 | X | X | |
| 다이얼 숫자 크기 조절 | X | X | |
| 메뉴 글씨 크기 조절 | X | X | |
| 리듬믹스 벨 | X | X | |
| 화음 | MP3, AAC | MP3, AAC | |
| 음성 벨 | X | X | |
| 동영상 벨 | X | X | |
| 서체 변경 | O | O | |
| 배경화면 자동 변경 | X | X | |
| 화면 밝기 조정 | O | O | |
| 터치스크린 | O | O | |
| 폰트 다운로드 | X | O | |
| 플래시 메뉴 다운로드 | X | X | |
| 플래시 배경화면 다운로드 | X | X | |
| 기본 항목 외 추가 기능 | 홈스크린 위젯, 라이브 배경화면 | Widget, 라이브 배경화면 | |
| 전화번호부/메시지 | 전화번호부 그룹 관리 | O | O |
| 포토폰북 기능 | O | O | |
| 3D 메시지 | X | X | |
| 문자 확대/축소 (볼륨키로 동작) | O | O | |
| SMS 수신 | O | O (SMS, MMS 수·발신 포함 5만개) | |
| 스팸 메시지 차단기능 | O | O | |
| 애니콜 SOS | X | X | |
| 문자 메시지 영구보관함 | O | O | |
| 기본 항목 외 추가 기능 | 메시지 폴더형/대화형 보기, 이메일 | 메시지 대화형/폴더형 보기, 이메일 | |
| 멀티미디어/엔터테인먼트 | DMB | O (지상파) | O (지상파) |
| 블루투스 헤드셋으로 DMB 청취 | O | O | |
| Anycall DMB Player | X | X | |
| DMB 화면 밝기 조절 | O | O | |
| DMB 중 멀티태스킹 (SMS, 전화) | X | O | |
| 무선랜 | O | O | |
| VOD | O | O | |
| MOD | O | O | |
| MP3 | O | O | |
| MP3 이퀄라이저 | O | O | |
| 카메라 화소 | 500만 | 500만 | |
| 카메라 이미지센서 | CMOS | CMOS | |
| 카메라 광학줌 | X | X | |
| Auto Focus | O | O | |
| 손떨림 보정/자동촬영 | O | O | |
| 반셔터 | O(터치식) | O(터치식) | |
| 플래시 | X | X | |
| 포토스튜디오 사진 편집 | X | X | |
| 특수효과 촬영 | O (빈티지 샷, 플러스미 샷, 액션 샷, 카툰 등) | O (흑백, 네거티브, 새피아, 빈티지샷, 플러스미샷 등) | |
| 얼굴표정 효과 지원 | X | X | |
| 파노라마 촬영 | O | O | |
| 동영상 편집기 | X | X | |
| 마이펫과 놀기 | X | X | |
| 게임 | O (설치 프로그램 제공 : 농구, 사다리 | X | |
| 체험판 게임 | X | X | |
| 애니콜 밴드 | X | X | |
| G-Fun (동작인식) | X | X | |
| 구연동화 | X | X | |
| 기본 항목 외 추가 기능 | - 기본 탑재 : AllShare, 갤러리, Internet Browser, 동영상 코덱(DivX, MKV, AC3 등) 지원 - 설치 프로그램 제공 : Snap n Go | -기본탑재 :AllShare, 갤러리, 인터넷 -설치 프로그램 제공 : 스마트 리더, Snap n Go - 동영상 코덱(DivX, MKV, AC3 등) 지원 | |
| 전자다이어리 | 전자사전 | O | O |
| 일정관리 | O | O | |
| 시간표 | X | X | |
| 단위환산 | X | X | |
| 메모장 | O | O | |
| 계산기/공학용계산기/생활속계산기 | O (일반/공학용 계산기) | O (일반/공학용 계산기) | |
| 모닝콜 반복알림 | X | O | |
| 알람 | O (반복 알림, 스누즈) | O | |
| 세계시간 (서머타임) | O | O | |
| 스톱워치 | O | O | |
| 지하철 노선도 | O (설치 프로그램 제공) | X | |
| 기본 항목 외 추가 기능 | - 기본 탑재 : 데일리 브리핑, 날씨, 미니 다이어리 - 설치 프로그램 제공 : Nate(미니홈피), Naver(검색, 지도, 미투데이), Daum(지도, tv팟, 쇼핑하우), 가계부, OnNews, 증권정보 POP | -기본 탑재 : 데일리브리핑 - 설치 프로그램 제공 : Nate(네이트앱, 네이트온UC),가계부, OnNews, 증권정보 POP, 날씨 | |
| 편의보안 | 이동식디스크 | O | O |
| 모바일 프린팅 | X | X | |
| 무선 인터넷 버튼(메뉴) 잠금 | X | X | |
| 기능별 잠금 기능 | X | X | |
| 음성메모 녹음 | O | O | |
| GPS | O | O | |
| 파일 뷰어 | O | O | |
| 리모컨 | X | X | |
| 손전등 | X | X | |
| TTS | X | O (별도어플 설치시 영어, 스페인어등 가능(한글제외)) | |
| 음성인식 | X | O | |
| 번역기 | X | X | |
| S/W 업그레이드 | O | O | |
| 내장 매뉴얼 | O (동영상 사용설명서) | X | |
| 비밀번호 해제 지원 서비스 | O (잠금 해제) | O | |
| 기본 항목 외 추가 기능 | - 기본 탑재 : 작업관리자, 프로그램 탐색기, 애니콜 서비스 센터, 거울기능(위젯) - 설치 프로그램 제공 : V3 Mobile, 교보문고 eBook | -기본 탑재 : 작업관리자, 프로그램 설치관리자, 애니콜 서비스 센터, 위젯(거울기능, 데이터통신설정, 듀얼시계, 일정시계, 친구소식, SNS업데이트)- 설치 프로그램 제공 : V3 Mobile, 교보문고 eBook | |
| 외부장치연계 | 핸즈프리/이어폰 통화 | O | O |
| 폰 데이터 PC 호환 | O (KIES, 이동식디스크) | O (KIES, 이동식디스크) | |
| 블루투스 | O | O | |
| TV OUT | X | X | |
| IrDA | X | X | |
| Any PC | X | X | |
| 기본 항목 외 추가 기능 | - 멀티미디어 거치대(HDMI TV-OUT, Ethernet, 충전기능) | ||
| 통신서비스(SKT) | GSM 지역 로밍 | O | O |
| MMS | O | O | |
| Moneta | X | X | |
| T-interactive | X | X | |
| Mobile Web Internet | X | X | |
| X | X | ||
| June 동영상 | O | O | |
| 모바일 메신저 | X | X | |
| i's box (UCC Hub) | X | X | |
| 실시간 TV | X | X | |
| 키짱 친구 | X | X | |
| 폰명함 | X | X | |
| 주소록 자동저장 | X | X | |
| 라이브벨 | X | X | |
| 라이브스크린 | X | X | |
| T-MAP | O | O | |
| Game Box | X | X | |
| 기본 항목 외 추가 기능 | NATE, T store, MelOn, OVJET | NATE, T store, Melon, OVJET, 원격상담, June컨텐츠함,위젯(그림친구, 날씨, 뉴스) hoppin(hoppin, hoppin비디오, ShareZone, hoppin사전) |
nmap -A -p 80 127.0.0.1
포트 스캔
nmap -sS -P0 -p 80,21,22 127.0.0.1
'Security' 카테고리의 다른 글
| nmap 주요 명령어 (0) | 2011/01/06 |
|---|---|
| 악성코드 분석 소프트웨어 (0) | 2010/07/28 |
| DNS, Server 정보 조회 (0) | 2010/07/27 |
| 구글 해킹 기법 예제 (1) | 2010/07/22 |
| Metasploit Cook Book (0) | 2009/12/24 |
| 주요 파일 헤더 검증 방법 (0) | 2009/10/23 |
#!/usr/dist/perl/bin.sun4/perl
#
# Set line #1 to the path of your installed Perl binaries. On
# Solaris 8 perl supplied with the distribution in /usr/bin/perl.
#
# bigfiles - looks through sub-directory tree lists files bigger than N kbytes.
# Defaults to 500 kbytes.
#
# 15 Nov 1996 Scott Babb Created.
#
# 19 Nov 1996 Scott Babb Changed traverse to not descend into
# symlinked dirs.
#
# 09 Sep 2000 Eric Nielsen Changed to report Kilobytes as most people
# care about kilobyte resolution.
# Submitted to BigAdmin.. www.sun.com/bigadmin
#
# Usage: bigfiles [#kbytes]
#
$kbyte = 1024; # Number of bytes in a kbyte
$minsize = $kbyte * 500; # Default Minimum Size of a file (1000 kbytes)
#
# Process size argument, if any
#
if ($#ARGV >= 0) {
$minsize = $kbyte * $ARGV[0];
}
#
# scan throught the directory tree
#
&traverse('.');
sub traverse {
local($dir) = shift;
local($path);
unless (opendir(DIR, $dir)) {
warn "Can't open $dir\n";
closedir(DIR);
return;
}
foreach (readdir(DIR)) {
next if $_ eq '.' || $_ eq '..';
$path = "$dir/$_";
if ((-d $path) && (! -l $path)) { # non-symlink dir, enter it
&traverse($path);
} elsif ((-f _) && (! -l $path)) { # plain file, but not a symlink
$size = -s $path; # get the size in bytes
$ksize = $size / 1000; # convert to megabytes
if ($size > $minsize) {
$age = -A $path; # get the age in days
printf "%9d Kilobytes %4d days %s\n",$ksize,int($age),$path;
}
}
}
closedir(DIR);
}데이터 쉐어링
하나의 회선으로 여러 대의 디지털 기기를 3G 데이터 망을 이용할 수 있는 것을 일컬어
OPMD(One Person Multi Device)라 합니다.

현재 OPMD는 SKT와 KT만 도입하고 있습니다.
SKT

SKT는 이 OPMD 서비스를 일컬어 T 데이터 쉐어링이라 부르고 있는데요.
월 3천원만 추가하면 최대 5대까지 기기에 사용이 가능합니다.
경쟁사가 아직 1대까지만 가능한 것을 생각하면 이는 매력적이죠.

저는 현재 위처럼 갤럭시S, 아이패드3G를 T 데이터 쉐어링을 사용 중인데요.
갤럭시S는 올인원 55로 데이터 무제한으로 쓰고 있고, 아이패드3G는 T 데이터 쉐어링으로 추가한 USIM이 꽂혀 있습니다.
즉, 아이패드3G는 통화는 안되지만 (제품 특성상 당연히 안되지만) 월 3천원으로 3G 데이터는 똑같이 쓸 수 있으며,
이 데이터 요금은 원래 USIM인 갤럭시S에서 소비되는데,
현재 갤럭시S가 무제한 데이터 요금이므로, 아이패드 3G로 아무리 데이터를 써도 공짜가 됩니다.
월 55,000원으로 두 대의 디지털 기기를 데이터 제한없이 마구 쓸 수 있는 셈이죠.
T 데이타 쉐어링 USIM 살펴 보기
데이터 쉐어링 서비스를 신청하면 주는 USIM을 잠시 살펴 봅니다.

신청하면 이런 포장으로 USIM을 제공합니다.
이것은 일반 사이즈의 USIM이며, 흥미롭게도 아이폰4, 아이패드를 위한 마이크로 USIM도 신청하면 가능합니다.

아이폰4 리뷰에서 공개한 오른쪽 마이크로 USIM이 바로 SKT에서 제공하는 마이크로 USIM입니다.

이 녀석을 아이패드 3G에 넣어 잘 사용 중이죠.

서비스를 잘 신청했다면 그저 USIM을 꺼내어 디지털 기기에 넣어 잘 사용하시면 됩니다. :)
앞으로 T 데이터 쉐어링이 많이 쓰일 분야는 바로 태블릿일 겁니다.

조만간 발매를 앞두고 있는 갤럭시 탭이 바로 그 주역이지요.
개인적으로는 안드로이드폰 + 아이패드 조합 혹은 아이폰 + 갤럭시 탭의 조합을 지인에게 추천하는데요.
굳이 두 대의 제품을 가입해 쓰는 것은 사실 일종의 중복인 셈이죠.
이럴 때 T 데이터 쉐어링은 아주 막강한 조합일 겁니다.
특히 무제한 데이터 요금제를 감안하면 말이죠.
KT
■ 데이터 쉐어링(Data Sharing) 서비스 ㅇ 핸드폰에 가입한 데이터 요금을 데이터 전용 3G 모뎀과 공유할 수 있는 서비스 ■ 출시일 : 2010년 5월 14일 ■ 서비스 특징 ㅇ 모뎀의 가입비와 기본료를 면제해 개통하므로써 단말기별 가입비/월 기본료 부과에 따른 서비스 사용의 요금 장벽 제거할수 있음 ㅇ 핸드폰의 데이터 요금과 기본량을 공유하며, 초과시 폰의 데이터 요금 요율에 따라 추가 부과됨 ■ 이용 가능 고객 : 폰과 데이터 전용의 2nd Device를 이용하는 개인 고객 ※ 2nd Device 종류 : iPlug 모뎀, e-book, Navigation ※ iPlug ADU-610WK 이용 가능 ※ 현재는 iPlug 모뎀만 가입 가능하며, 향후 확대 예정 ※ 해외에서 구매한 3G iPad 가능 - 전파인증서, 명의자 신분증 등 구비서류 소지하고 M&S 교대직영점에 방문하여 개통(교대역 사거리 위치, ☎02-591-4010) ※ 지능망 요금상품(비기,복지,선불), i-Teen 요금상품 이용고객 및 법인 가입자 이용 불가
(1) SSL Handshake Protocol
- SSL Record 계층의 위에서 동작한다. SSL Client와 Server가 처음으로 통신을 시작할 때 서로 프로토콜 버전을 확인하고, 암호 알고리즘을 선택하고, 선택적으로 서로를 인증하고, 공유할 비밀정보를 생성하기 위해 공개키 암호 기법을 사용한다.
1) Hello Request
- 이 메시지는 서버가 클라이언트에게 보낼 수 있는 메시지지만 핸드쉐이크 프로토콜이 이미 진행 중이면 클라이언트는 이 메시지를 무시해 버린다.
2) Client Hello
- 클라이언트는 서버에 처음으로 연결을 시도할 때 Client Hello메시지를 통해 클라이언트 SSL 버전, 클라이언트에서 생성한 임의의 난수, 세션 식별자, Cipher Suit 리스트, 클라이언트가 지원하는 압축방법 리스트 등의 정보를 서버에 전송한다.
cipher_suites : SSL_키 교환 알고리즘_WITH_암호 알고리즘_해쉬 알고리즘
예) SSL_RSA_WITH_NULL_MD5
SSL_RSA_WITH_NULL_SHA
SSL_RSA_EXPROT_WITH_RC4_40_MD5(Steam Cipher)
SSL_RSA_WITH_RC4_A28_MD5
SSL_RSA_WITH_RC4_128_SHA
SSL_RSA_EXPROT_WITH_RC2_CBC_40_MD5(Block Cipher)
SSL_RSA_WITH_IDEA_CBC_SHA
SSL_RSA_WITH_DES_CBC_SHA
SSL_RSA_WITH_3DES_EDE_EBC_SHA 등
3) Server Hello
- 서버는 Client Hello 메시지를 처리한 후 Handshake Failure Alert 메시지 또는 Server Hello 메시지를 전송하게 된다. 이 단계에서 서버는 서버의 SSL 버전, 서버에서 생성한 임의의 난수, 세션 식별자, 클라이언트가 보낸Cipher Suit 리스트 중에서 선택한 하나의 Cipher Suit, 클라이언트 압축방법 리스트에서 선택한 압축 방법 등의 정보를 클라이언트에 보낸다.<?xml:namespace prefix = o /><?xml:namespace prefix = o /><?xml:namespace prefix = o />
4) Server Certificate or Server Key Exchange
- 서버 인증을 위한 자신의 공개키 인증서를 가지고 있다면, Server Certificate 메시지를 즉시 클라이언트에 전송한다. 일반적으로 X.509 버전 3 인증서를 사용한다. 만약 인증서가 없거나, 인증서를 가지고 있지만 서명용으로만 사용할 수 있다면(DSS 인증서, 서명용 RSA 인증서의 경우) 또는 Fortezza/DMS 키 교환을 사용한다면 Server Key Exchange 메시지 를 전송한다. 단 서버 인증서에 Diffie-Hellman 매개 변수가 포함되어 있다면 이 메시지는 사용되지 않는다. 이 단계에서 사용되는 인증서의 종류 또는 키 교환에 사용되는 알고리즘은 Server Hello 메시지의 Cipher Suit에 정의된 것을 사용한다.
5) Certificate Request
- 서버는 기본적으로 클라이언트에게 서버 자신을 인증할 수 있도록 한다. 이와 마찬가지로 서버는 클라이언트의 인증서를 요구하며 신뢰할 수 있는 클라이언트인지 확인할 수 있다. 이 단계는 선택적으로 동작하지만 4단계와5단계를 통해 클라이언트와 서버는 상호인증이 가능하게 된다.
6) Server Hello Done
- 서버에서 보낼 메시지를 모두 보냈음을 의미한다. 이 메시지를 클라이언트에 보내는 이유는 5단계의 메시지가 보내질 수도 있고, 생략될 수도 있기 때문이다. 따라서 이 메시지를 받은 클라이언트는 서버로부터 더 이상의 메시지 전송이 없음을 알수 있게 된다.
7) Client Certificate
- 서버로부터 클라이언트의 인증서를 보내라고 요청이 있을 경우 클라이언트 자신의 인증서를 보내야 한다. 만약 인증서를 가지고 있지 않다면 No Certificate Alert 메시지를 보낸다.
8) Client Key Exchange
- 이 단계에서 클라이언트는 세션키를 생성하는 데 이용되는 임의의 비밀정보인 48바이트pre_master_secret를 생성한다. 그런 뒤 선택된 공개키 알고리즘에 따라 pre_master_secret 정보를 암호화하여 서버에 전송한다. 이때 RSA, Fortezza, Diffie-Hellman 중 하나를 이용하게 된다.
9) Certificate Verify
- 서버의 요구에 의해 전송되는 클라이언트의 인증서를 서버가 쉽게 확인할 수 있도록 클라이언트는 핸드 쉐이크 메시지를 전자서명하여 전송하게 된다. 이 메시지를 통해 서버는 클라이언트의 인증서에 포함된 공개키가 유효한지 확인하여 클라이언트 인증을 마치게 된다.
10) Change Cipher Specs, Finished
- Change Cipher Specs 메시지는 핸드 쉐이크 프로토콜에 포함되지 않지만 클라이언트는 마지막으로Change Cipher Specs 메시지를 서버에 전송하여 이후에 전송되는 모든 메시지는 협상된 알고리즘과 키를 이용할 것임을 알리게 된다. 그런 후 즉시 Finished 메시지를 생성하여 서버에 전송한다. 따라서 이 Finished 메시지에는 협상된 알고리즘 및 키가 처음으로 적용된다.
11) Finished, Change Cipher Specs
- 서버는 클라이언트가 보낸 모든 메시지를 확인한 후 Change Cipher Specs 메시지를 클라이언트에게 보낸 후 즉시 Finished 메시지를 생성하여 전송함으로써 SSL 핸드 쉐이크 프로토콜 단계를 종료하게 된다.
'CS > Network' 카테고리의 다른 글
| SSL Protocol 동작 방식 (1) | 2010/09/26 |
|---|---|
| DNS E-book (0) | 2010/06/25 |
| Cisco Router 주요 명령어 (0) | 2010/05/28 |
| Packet 종류별 기본 크기 (0) | 2010/03/06 |



:: A batch file that concatenates all the files of a given extension in
:: the current directory to a specified file and then zips that file.
IF "%1"=="" GOTO USAGE
IF "%2"=="" GOTO USAGE
FOR %%i IN (*.%1) DO type %%i >> %2
SHIFT
pkzip %~n1.zip %1
GOTO END
:USAGE
echo.
echo USAGE: %0 extension outputfile
echo.
echo Concatenates all the files of the given extension in the current directory
echo to the specified outputfile and then compresses that file into a zip file.
echo.
:END
![[Note]](http://www.csie.ntu.edu.tw/~r92092/images/note.png)
