기본 콘텐츠로 건너뛰기

2014의 게시물 표시

strftime 함수

strftime  함수 정의 string strtime(string format, int timestamp) string()함수는 date() 함수와 동일한 역할을 수행하여 함수 호출 시에 지정해 준 format에 따라 날짜 정보를 호출한다. 언어 선택이 가능하다. 인자의 종류 %Y : 년도를 네 자리수로 출력한다. %y : 년도를 두 자리 수로 출력한다. %B : 현재의 locale에 따른  월 명 을 완전한 이름으로 출력한다.   //December 또는 11월 %b : 현재의 locale에 따른  월 명 을 축약하여 출력한다. %d : 일자를 두자리 수로 출력한다. %a : 현재의locale에 따른  요일 명 을 축약 형태로 출력한다. %A : 현재의 locale에 따른  요일 명 을 완전한 문자로 출력한다. %w : 요일 명을 한자리 숫자로 출력한다. %H : 시간을 24시간제로 출력한다. %I : 시간을 12시간제(오전,오후)로 출력한다. %M : 분을 출력한다. %S : 초를 출력한다. %Z : 현재의 타임존을 출력한다. %x : 현재의 locale에 따른 날짜(월/일/년)을 출력한다. 시간정보는 제외됨.  //00-12-06 %X : 현재의 locale에 따른 시간을 출력한다. 날짜정보는 제외됨.  //오전 11:34:54 또는 11:34:54 AM %U : 올해 몇 번째 주가 지났는지를 출력해준다. 첫번째 일요일이 기준시간. %W : 올해 몇 번째 주가 지났는지를 출력. 첫번째 월요일이 기준시간.

rex create directory error (Rex::Commands::Fs)

Rex 를 사용해 vbox 설치중에 1. 경고 확인 [2014-06-22 23:59:03]  ERROR - Error executing task: Can't create directory  /srv/ share at C:/strawberry/perl/site/lib/Rex/Commands/Fs.pm line 368. [2014-06-22 23:59:03]  ERROR - Error executing task: Can't create directory  /srv/ share at C:/strawberry/perl/site/lib/Rex/Commands/Fs.pm line 368. [2014-06-22 23:59:03]  WARN - Error running task/batch: Can't create directory  /s rv/share at C:/strawberry/perl/site/lib/Rex/Commands/Fs.pm line 368. 이런식의 에러가 발생할 수 있다. 2. 모듈 확인 https://metacpan.org/pod/Rex::Commands::Fs 여기 보면 렉스 버전을 0.45로 권장 한다 mkdir($newdir) This function will create a new directory. Since: 0.45 Please use the file() resource instead. 이유는 현재 렉스 버전이 0.46 이기 때문 일 수 있다. 3. 조치 sudo mount -t vboxsf -o uid=1000,gid=1000 share /srv/share 수동으로 마운트 시켜준다. 4. 조치 안될시 컴퓨터에 문제가 있을 수 있다. 교체후 다시 진행한다. ㅋㅋㅋ 

ubuntu server 한글 설정

문제 : ubuntu 14.04 server 설치후 한글이 안나오고 자꾸 에러남. 원인 : 로케일 설정의 문제 조치 :   # cat vim /etc/default/locale  LANG=ko_KR.UTF-8 LANGUAGE=ko_KR:ko:en_US:en LC_CTYPE="ko_KR.UTF-8" LC_NUMERIC=ko_KR.UTF-8 LC_TIME=ko_KR.UTF-8 LC_COLLATE="ko_KR.UTF-8" LC_MONETARY=ko_KR.UTF-8 LC_MESSAGES="ko_KR.UTF-8" LC_PAPER=ko_KR.UTF-8 LC_NAME=ko_KR.UTF-8 LC_ADDRESS=ko_KR.UTF-8 LC_TELEPHONE=ko_KR.UTF-8 LC_MEASUREMENT=ko_KR.UTF-8 LC_IDENTIFICATION=ko_KR.UTF-8 LC_ALL= 로케일 확인한다. 로케일 설정 중에  ko_KR.eucKR 부분을 다 UTF-8 로 변경한다. LANG LC_* 값들을 설정하지 않았을 때 적용되는 기본 값 LC_ADDRESS LC_ALL LC_ALL의 값으 LC_*의 값이 override 된다. LC_TIME 시간 출력 양식 설정 LC_TELEPHONE 전화번호의 출력 양식 설정 LC_PAPER 종이의 크기 형식. 11 x17 inches, A4 등등 LC_NUMBER 숫자표현양식. 대부분 소수구분으로 "."을 사용하지만, 어떤 나라는 ","을 사용한다. LC_NAME 이름 표기 형식. first, last name등 LC_MESSAGES 시스템 메시지 출력에 사용할 언어 LC_CTYPE 대문자, 소문자간의 변환 형식 LC_COLLATE 알파벳의 정렬과 관련된 규칙. "C"나 "POSIX" 로케일의 경우 strcmp()를 적용한 것과 같은 결...

psql createdb

postgresql 설치후에 table 생성이 안될때.... FATAL:  role 'username'  does not exist 이런 에러가 나온다. 잘못된거 아니고 계정만 만들면 된다. 1. 계정 생성  sudo -u postgres createuser 'username'  2. table 생성 *createdb -U postgres -O 'username' -E utf-8 'tablename' 평범한 생성.가 *createdb -U postgres -O 'username' -E utf-8 --lc-collate=ko_KR.UTF-8 --lc-ctype=ko_KR.UTF-8 'tablename' 로케일 타입 지정. *createdb -U postgres -O 'username' -E utf-8 --lc-collate=ko_KR.UTF-8 --lc-ctype=ko_KR.UTF-8 -T 'copytable' 'tablename' 카피할 db 추가 

Oracle VM VirtualBox 4.3.14 error

Rex로 ubuntu server 실행하는데 에러가 발생했다. 구글링 해 보니 각자의 해결방법들이 나와있었지만 신뢰하지 못하겠다. 에러 메세지 : Error In supR3HardenedWinReSpawn  조치 : https://www.virtualbox.org/wiki/Download_Old_Builds_4_3   하위 버전 다운로드 하여 설치한다. 그냥 다운그레이드 하면 됨.

perl smartcd

perl을 사용해 개발을 할 때 이런저런 이유로 PATH 환경변수를 변경 해야할 때가 많다... 매번 eval 할 필요 없이 디렉토리 이동할 때 마다 자동으로 bash로 변경할 수 있게 하는것이 smartcd.  https://github.com/cxreg/smartcd 원하는곳에 클론을 받는다.  $ git clone  https://github.com/cxreg/smartcd 설치를 한다. $ make install $ source load_smartcd $ smartcd config 설치가 완료되면 입력할 폴더로 이동한다. $ mkdir ~/test  $ cd ~/test  smartcd 를 사용한다. $ echo 'eval $(perl -Mlocal::lib=~/test | sed '\''s/export/autostash/'\'')' | smartcd edit enter 확인을 한다.  $ cd .. $ cd ~/test 커멘드에 표시가 된다.  smartcd: running /home/lars/.smartcd/scripts/home/user/test/bash_enter 궁금하니까 한번 더 확인해 본다.  $ echo $PATH  /home/user/test/bin :/usr/local/sbin :/usr/local/bin :/usr/sbin :/usr/bin :/sbin :/bin :/usr/games :/usr/local/games  잘 추가가 되었다. 끝. 

perl catalyst jquery file upload

perl catalyst 를 사용해 jquery file upload 를 구현. html -  angularjs.tx <!DOCTYPE HTML> <html lang="en"> <head> <meta charset="utf-8"> <title>jQuery File Upload Demo - AngularJS version</title> <!-- Bootstrap styles --> <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> <!-- Generic page styles --> <link rel="stylesheet" href="/vendor/jQuery-File-Upload-9.8.0/css/style.css"> <!-- blueimp Gallery styles --> <link rel="stylesheet" href="//blueimp.github.io/Gallery/css/blueimp-gallery.min.css"> <!-- CSS to style the file input field as button and adjust the Bootstrap progress bars --> <link rel="stylesheet" href="/vendor/jQuery-File-Upload-9.8.0/css/jquery.fileupload.css"> <link rel="stylesheet" href="/vendor/jQuery-File-Upload-...