목록Software Engineering/Linux (25)
Pure Software Engineer :)
TPM(Trusted Platform Module)의 약자로 trusted computing group에서 spec을 제안한 모듈이다. TPM을 이용해 개발하기 위해 다음과 같은 packages를 설치함 apt-get install trousersapt-get install tpm-toolsapt-get install libtspi-devapt-get install libtspi1apt-get install trousers-dbg // 아래 두 패키지는 프로젝트할 때 같이 필요했던 패키지apt-get install libcurl4-openssl-dev // curl package 설치 for communication with privacy CAapt-get install swig // for python..
IPMI(Intelligent Platform Management Interface)의 약자로 서버급 머신에 칩으로 장착되어 있으며, 원격에서 전원을 켜고 끈다거나, serial console 등을 확인할 수 있게 해주는 인터페이스이다. 1. IPMI 사용을 위한 툴 설치 및 설정하는 과정 // ipmitool 설치apt-get install ipmitool // ipmi module 등록modprobe ipmi_devintfmodprobe ipmi_simodprobe ipmi_msghandler // ipmi module 등록확인lsmod | grep ipmi lsmod 를 통하여 모듈이 모두 올라가 있는것을 확인한 후에야 아래의 명령어 사용 가능 2. IPMI 명령어 // 10.1.20.52는 rem..
guest vm 여러개 띄우기 위해서는 machine에 loop device라는게 충분히 있어야 한다. guest vm 마다 loop device를 기본적으로 2개를 사용한다고 하니 충분하지 않으면 vm이 생성되지 않는다. 이를 위해 다음과 같이 loop device 를 조절 할 수있음 $ sudo vi /etc/modprobe.d/loop-local (loop-local 대신 xen 과 같이 다른 이름을 써도 됨) 위의 파일에 다음과 같이 추가한다. options loop max_loop=64 이를 적용시키기 위해 모듈을 다시 올린다. sudo rmmod loop sudo modprobe loop ls /dev/loop* 해보면 64개의 loop device가 생성되었음을 확인할 수 있다. 위와 같이 ..
리눅스 gnu gcc 로 openmp c 프로그램 컴파일 하는 방법 $ gcc -o hello hello.c -fopenmp (-lgomp 옵션으로도 컴파일은 되나 스레드 생성이 안됐음(?)) $ export OMP_NUM_THREADS=2 // 생성할 스레드 숫자를 환경변수로 설정 할 수 있다. (c code 안에서 #pragma omp parallel num_threads(8) 이런식으로도 가능) - reference http://www.dartmouth.edu/~rc/classes/intro_openmp/compile_run.html
리눅스에서 텍스트 파일 스펠링 검사할때 유용한 도구 예를들어, vi를 사용해서 tex 문서를 작성하는데 스펠링 검사를 할때 유용하다. $ aspell check [filename] OS 기본언어가 한글일 경우 다음과 같은 에러가 떳다. Error: No word lists can be found for the language "ko_KR". lang옵션을 통해 해결한다. $ aspell --lang=en_US check [filename] referenceshttp://afnastica.tistory.com/395 ===================================================================파일 검색find -name "*.pl" -ls // 현재 디렉토리에서 ..
import certificate dir(certificate) // 해당 모듈(certificate) 안에 뭐 있는지(interface) 보여줌 =========================================================== /usr/local/lib/python2.6/dist-package 파이썬에서 사용할 라이브러리 위치
second, microsecond 단위로 측정이 가능하다. 먼저 헤더를 추가한다. #include 사용할 함수 및 구조체 int gettimeofday(struct timeval*tv, struct timezone* tz); struct timeval { time_ttv_sec;// seconds suseconds_ttv_usec;// microseconds }; 변수 선언 struct timeval before, after; 측정 방법 gettimeofday(&before, NULL); solve(); // 성능을 측정할 구간 gettimeofday(&after, NULL); after.tv_sec-before.tv_sec // second after.tv_usec-before.tv_usec // m..
[jwchoi@tc5 trousers-0.2.9.1]$ tpm_version tpm_version: error while loading shared libraries: libtspi.so.1: cannot open shared object file: No such file or directory 위의 예처럼 어떤 ELF format 을 실행할때 shared library를 못찾는 경우가 생긴다. $ which tpm_version // tpm_version 이 있는 경로를 알려줌 which 를 통해 얻은 경로를 바탕으로 다음을 실행 $ ldd /usr/local/sbin/tpm_version // 해당 파일이 사용하는 shared library들을 나열 [jwchoi@tc5 trousers-0.2.9.1..