25 Articles, Search for '프로그래밍/기타'

  1. 2007/04/18 PuTTY에서 한글 입력하기
  2. 2007/03/06 PHP SOAP Client 만들기
  3. 2007/01/25 윈도우 배치파일을 이용한 백업?
  4. 2006/08/23 javascript String Trim
  5. 2006/08/23 javascript에서 Base64 인코딩/디코딩
프로그래밍/기타2007/04/18 14:52
1. 한글을 사용하고자 하는 Session을 하나 저장한다.
2. 레지스트리 수정
    HKEY_CURRENT_USER/Software/SimonTatham/PuTTY/Sessions
   1번에서 저장한 세션을 선택.
3. "FontCharSet"=dword:00000081 (16진수: 81)로 변경한다.
4. 환경설정의
    Window -> Appearance -> Font settings에서 굴림체로 변경
    Window -> Translation -> Character set translation on received data에서
             Received data assumed to be in which character set: 을
             "Use font encoding" 으로 선택

5. ls 명령을 실행했을경우 한글 파일명이 ?? 와 같이 나오면.
    /etc/profile에 서
    alias ls="ls --color=auto --show-control-char" 을 추가한다.

※ 참고:
    그래도 안될경우
    export LANG=ko_KR.eucKR; export LC_ALL=ko_KR.eucKR

한글사용... 어디서나 문제가 되네요~ 쩝...

 

2007/04/18 14:52 2007/04/18 14:52
Posted by 나그네
Tags , ,
프로그래밍/기타2007/03/06 17:58
$client = new SoapClient("http://localhost/axis/WebHardServer.jws?wsdl");
$result = $client->TestMethod();


파라미터값이 Object인경우

class TestObject {
    public $value1;
    public $value2;
}

$param = new TestObject();
$result = $client->TestMethod($param);



TestMethod의 리턴값이 Object인경우
echo $result->value1;

와 같이 그냥 참조하면 된다.

SoapServer 개발중일 경우 변경된 메소드를 인식하지 못하는 경우가 있다.
http://localhost/axis/WebHardServer.jws?method=TestMethod 와같이 호출시 정상이나
PHP에선 메소드를 찾지 못했다고 오류가 나는 경우.
/tmp/wsdl_XXXXXX 와같이 php가 남긴 케쉬를 지워주면 정상 동작 한다.
(이거때문에 몇시간 삽질했다는....)

2007/03/06 17:58 2007/03/06 17:58
Posted by 나그네
프로그래밍/기타2007/01/25 18:59

WinXP에서 작업한 소스파일(원하는파일만...)을 압축하여 다른 서버에 보내야 하는데...
매번 cmd창이나 탐색기에서 하자니 여간 짜증이 나는게 아니다...
다른 프로그램을 이용하면 쉬울수 있겠으나... 찾기도 귀찮고...
그냥 있는것으로만 해봤다...


필요 프로그램:
gnu tar :
[다운받기]

WinXP backup.bat 내용

@ECHO OFF

FOR /F "tokens=1-3 delims=- " %%i IN ('date /t') DO SET date=%%i%%j%%k
SET file_name=server_%date%.tar.gz

tar -zcvf %file_name% * --exclude=*.pyc --exclude=*.scc --exclude=*.gz --exclude=*.bat

copy %file_name% d:\ftp_home\server.tar.gz



Linux Server fileget.sh 내용

#!/bin/sh
SRCPATH=/email_server       #다운받을 위치
FTPIP=xxx.xxx.xxx.xxx       #다운받을 IP
SRCFILENAME=server.tar.gz   #파일명

ARGV="$@"
if [ "x$ARGV" = "x" ] ; then
    echo "INPUT FTP PASSWORD"
    exit 0
fi

echo "+-------------------------------------------------------------------------+"
echo "| Source Get                                                              |"
echo "+-------------------------------------------------------------------------+"
cd $SRCPATH/src
ftp -n $FTPIP << EOF
user acepro $1
hash
prompt
binary
get $SRCFILENAME
quit
EOF

if [ -f $SRCFILENAME ] ; then
   size=`stat $SRCFILENAME -c%s`
   if [ "$size" -eq "0" ]; then
       echo "#ERROR: Source File Not Found!!!"
       exit 0
   fi
else
   echo "#ERROR: Source File Not Found!!!"
   exit 0
fi
tar zxvf $SRCFILENAME > /dev/null
2007/01/25 18:59 2007/01/25 18:59
Posted by 나그네
프로그래밍/기타2006/08/23 11:53

function trim (strSource) {
  re = /^\s+|\s+$/g;
  return strSource.replace(re, '');
}

function ltrim (strSource) {
  re = /^\s+/g;
  return strSource.replace(re, '');
}

function rtrim (strSource) {
  re = /\s+$/g;
  return strSource.replace(re, '');
}

2006/08/23 11:53 2006/08/23 11:53
Posted by 나그네
Tags
프로그래밍/기타2006/08/23 11:52

var enc64List, dec64List;

function initBase64() {
  enc64List = new Array();
  dec64List = new Array();
  var i;
  for (i = 0; i < 26; i++) {
       enc64List[enc64List.length] = String.fromCharCode(65 + i);
  }
  for (i = 0; i < 26; i++) {
       enc64List[enc64List.length] = String.fromCharCode(97 + i);
  }
  for (i = 0; i < 10; i++) {
       enc64List[enc64List.length] = String.fromCharCode(48 + i);
  }
  enc64List[enc64List.length] = "+";
  enc64List[enc64List.length] = "/";
  for (i = 0; i < 128; i++) {
       dec64List[dec64List.length] = -1;
  }
  for (i = 0; i < 64; i++) {
       dec64List[enc64List[i].charCodeAt(0)] = i;
  }
}

function base64Encode(str) {
  var c, d, e, end = 0;
  var u, v, w, x;
  var ptr = -1;
  var input = str.split("");
  var output = "";
  while(end == 0) {
       c = (typeof input[++ptr] != "undefined") ? input[ptr].charCodeAt(0) :
           ((end = 1) ? 0 : 0);
       d = (typeof input[++ptr] != "undefined") ? input[ptr].charCodeAt(0) :
           ((end += 1) ? 0 : 0);
       e = (typeof input[++ptr] != "undefined") ? input[ptr].charCodeAt(0) :
           ((end += 1) ? 0 : 0);
       u = enc64List[c >> 2];
       v = enc64List[(0x00000003 & c) << 4 | d >> 4];
       w = enc64List[(0x0000000F & d) << 2 | e >> 6];
       x = enc64List[e & 0x0000003F];
       if (end >= 1) {x = "=";}
       if (end == 2) {w = "=";}
       if (end < 3) {output += u + v + w + x;}
  }
  var formattedOutput = "";
  var lineLength = 76;
  while (output.length > lineLength) {
    formattedOutput += output.substring(0, lineLength) + "\n";
    output = output.substring(lineLength);
  }
  formattedOutput += output;
  return formattedOutput;
}

function base64Decode(str) {
  var c=0, d=0, e=0, f=0, i=0, n=0;
  var input = str.split("");
  var output = "";
  var ptr = 0;
  do {
       f = input[ptr++].charCodeAt(0);
       i = dec64List[f];
       if ( f >= 0 && f < 128 && i != -1 ) {
           if ( n % 4 == 0 ) {
               c = i << 2;
           } else if ( n % 4 == 1 ) {
               c = c | ( i >> 4 );
               d = ( i & 0x0000000F ) << 4;
           } else if ( n % 4 == 2 ) {
               d = d | ( i >> 2 );
               e = ( i & 0x00000003 ) << 6;
           } else {
               e = e | i;
           }
           n++;
           if ( n % 4 == 0 ) {
               output += String.fromCharCode(c) +
                         String.fromCharCode(d) +
                         String.fromCharCode(e);
           }
       }
  }
  while (typeof input[ptr] != "undefined");
  output += (n % 4 == 3) ? String.fromCharCode(c) + String.fromCharCode(d) :
             ((n % 4 == 2) ? String.fromCharCode(c) : "");
  return output;
}
initBase64();




2006/08/23 11:52 2006/08/23 11:52
Posted by 나그네
Tags