2011년 12월 17일 토요일

opencv compile flag

test.c 파일을 output 으로 test 를 지정할 때
gcc `pkg-config --cflags --libs opencv` -o test test.c

2011년 12월 5일 월요일

sox Sound eXchange : universal sound sample translator

터미널에서 음악 파일을 변환하는 방법

wav 파일을 raw 파일로 변환 (8000Hz 모노로)

sox -V input.wav -r 8000 -c 1 -s output.raw

옵션 

-v|--volume FACTOR             Input file volume adjustment factor (real number)
--ignore-length                        Ignore input file length given in header; read to EOF
-t|--type FILETYPE                 File type of audio
-s/-u/-f/-U/-A/-i/-a/-g                 Encoding type=signed-integer/unsigned-integer/floating point/mu-law/a-law/ima-adpcm/ms-adpcm/gsm-full-rate
-e|--encoding ENCODING    Set encoding (ENCODING in above list)
-b|--bits BITS                           Encoded sample size in bits
-1/-2/-3/-4/-8                             Encoded sample size in bytes
-N|--reverse-nibbles               Encoded nibble-order
-X|--reverse-bits                      Encoded bit-order
--endian little|big|swap          Encoded byte-order; swap means opposite to default
-L/-B/-x                                      Short options for the above
-c|--channels CHANNELS    Number of channels of audio data; e.g. 2 = stereo
-r|--rate RATE                          Sample rate of audio
-C|--compression FACTOR  Compression factor for output format
--add-comment TEXT            Append output file comment
--comment TEXT                    Specify comment text for the output file
--comment-file FILENAME    File containing comment text for the output file
--no-glob                                  Don't `glob' wildcard match the following filename


2011년 11월 18일 금요일

QT compile in command line

qt를 설치했다면 굳이 qt 에서 프로젝트를 생성하여 빌드할 필요가 없다. 폴더안에 qt 문법이 적용된 .cpp 파일과 .h 파일만 있으면 된다.

소스 파일의 폴더로 가서 다음과 같이 입력만 하면 Makefile 과 실행 파일이 자동으로 만들어진다.

qmake -project  <--- 프로젝트 파일 생성 (.pro)
qmake               <--- Makefile 생성
make                 <--- 소스파일 빌드

2011년 11월 11일 금요일

ubuntu 8.04 libreoffice install

ubuntu 8.04에서는 libreoffice 를 지원하지 않는다;;(차별이다 ㅡ.ㅡ;)
그래도 설치해보자~!!!!!

1. libreoffice download && extract
site : http://www.libreoffice.org/download

2. install
cd DEBS
sudo dpkg -i *.*

3. desktop 환경 구축
cd desktop-integration
sudo dpkg -i *.*

4. The End

ubuntu 8.04 wine install

1. /etc/apt/sources.list 에 다음과 같이 ppa 를 추가한다.
sudo gedit /etc/apt/sources.list
deb http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu hardy main 
deb-src http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu hardy main 

2. 인증키
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F9CB8DB0

3. 업데이트
sudo apt-get update

4. 설치
sudo apt-get install wine


ubuntu 8.04 는 (2011년 11월 11일까지는) wine 1.2 버전 까지만 지원하는 것 같다.
wine 의 대표적인 게임 starcraft 게임을 실행해본 결과 문제 없이 동작한다..다만.. 배틀넷이 안된다.. 흑흑 ㅡ.ㅡ;;;;ㅜ.ㅜ;;;;

2011년 10월 29일 토요일

ubuntu(우분투) 11.04 ecb install

11.04 부터는 이유를 모르겠지만

sudo apt-get install ecb

이 명령어가 실행되지 않는다.....

그래도 안되는게 없는 emacs 한 번 시도해 보자 ^^

1. 다음 링크에서 ecb를 다운 받고 원하는 곳에 압축을 푼다.
ecb.sourceforge.net/cvs_snapshots/ecb.tar.gz

필자는 ~/.emacs.d/ecb-snap 에 압축을 풀었다.


2. 다음과 같이 .emacs 파일을 수정한다.
(add-to-list 'load-path "~/.emacs.d/ecb-snap")
(require 'ecb)
3. emacs 재실행

4. M-x ecb-activate

5. ecb가 실행될것이다~~^^






2011년 5월 6일 금요일

emacs irc 자동접속(erc)

emacs를 구동(?)하면 자동으로 우분투 채널에 접속하고 싶다.

.emacs 파일을 수정하자!

(require 'erc-join)
(erc-autojoin-mode 1)
(setq erc-autojoin-channels-alist
         '(("freenode.net" "#ubuntu.ko")))
         (erc :server "irc.ubuntu.com" :port 8001 :nick "imsu")
안되면 나도 모름 ㅋㅋ

일단 나는 성공 ㅎㅎㅎ

2011년 5월 3일 화요일

이맥스 irc 접속 (한국 우분투 사용자 모임 - #ubuntu-ko)

출처 - http://www.emacswiki.org/emacs/?action=browse;oldid=EmacsIRCClient;id=ERC

irc 에 접속하기 위해서 예전에는 xchat , pidgin, empathy ,, 기타 등등을 이용했었고, 최근들어 관심이 늘게된 emacs 에서도 irc 접속이 가능하다는 것을 알았다.이맥스는 정말 안되는게 없는것 같다 ^^

그럼 이맥스에서 한국 우분투 사용자 모임 irc 에 접속해보자

irc 채널의 주소 irc.ubuntu.com 이며 freenode 이다.

irc에 접속하기 위해 이맥스에서 지원하고 있는 ERC를 이용할 것이다.

다음과 같이 입력하면 ERC 가 실행된다. 

M-x erc
이맥스 명령창에 다음 네 가지를 물어 볼 것이다. (하나씩 입력하고 엔터를 치면 된다.)
  • IRC server
  • IRC port
  • Nickname
  • Password

우분투 irc freenode 에 접속하기 위해 다음과 같이 입력한다.

IRC server: irc.ubuntu.com
IRC port: 8001
Nickname: imsu (현재 내컴퓨터 이름이 imsu 이며 우분투 채널에서도 같은 이름을 쓰고 있다.)
Password:  (우분투 채널에서는 암호가 필요 없으므로 무시하고 Enter 를 친다.)
우분투 채널의 주소는 #ubuntu-ko 이므로 채널에 입장한다는 명령을 한다.
/JOIN #ubuntu-ko

 위와 같이 기입하면 emacs 에서의 irc 채널입장이 모두 완료된다.






분도님의 미남 발언이 또 한번 파문을 일으킬것 같다 ㅎㅎㅎ

irc 채널 상에 누가 접속 했는지는 초기 윗 부분에 보면 닉(nick) 이 나와 있는데 다른 프로그램처럼 대화창이 아닌 다른 곳에 접속한 사람을 보는 창이 있었으면 좋겠다..

이 사항은 다음에 게시하도록한다..(나도 초보니깐 모른다 ㅋㅋ)

2011년 5월 2일 월요일

우분투 latex 설치

우분투 답게 너무 간단하다

sudo apt-get install texlive-latex-base
sudo apt-get install ko.tex

설치 확인

ko.tex 가 설치 안되면 저장소를 daum으로 바꿔보자.
다음과 같은 test.tex 파일을 만든다.

\documentclass{article}
\usepackage{kotex}
\begin{document}
안녕하세요!
\end{document}

터미널에서 다음과 같은 명령을 한다.
latex test.tex
 test.dvi 파일이 만들어지면 성공!!!

터미널에서 다음과 같이 입력한다.
evince test.dvi
 pdf 로"안녕하세요!" 글자가 보일것이다 ^^

2011년 4월 17일 일요일

Latex 수식 lim

Latex 에서 텍스트 모드와 수식모드에는 display 스타일의 차이가 있다.

특히 텍스트모드에서의 수식을 조판하고자 하여 $ \lim_{ n \to 0} $ 명령을 쓸 때 아래 첨자가 옆으로 나오는 문제가 생긴다.

displaymath 를 사용하면 개행이 되기 때문에 내가 원하는 문단 형식에 어긋난다. -.-;;;;

다음과 같이 바꿔보자

$displaystyle \lim_{n \to 0}$

displaystyle 을 쓸 경우 수식이 좀 커지는 경우가 있다 특히 \lim \sum 을 같이 쓰는 경우인데 \limits 명령어로 해결할 수 있다.
예)
$lim \limits _{n \to infty} \sum\limits_{k =1 } ^ {n}$
난 만족 !! 으흐흐

2011년 3월 31일 목요일

Gtk Compile 명령어

main.c 의 경우
output : melong

gcc -Wall -o melong main.c `pkg-config gtk+-2.0 --cflags --libs`

GDB

변수 값 출력 명령 출력 명령 p [변수명] p [함수명] p /[출력형식] [변수명]  출력 형식 t : binary o: octal d: decimal u: unsigned decimal x: hexadecimal c: ...