1/21/2010

join or split pdf files - pdftk

join

pdftk file1.pdf file2.pdf cat output file12.pdf

split

ex) in.pdf has 10 page total. We want split it in two files.
out1.pdf has page 1 to 5, and out2.pdf has 6 to 10.

pdftk in.pdf cat 1-5 output out1.pdf
pdftk in.pdf cat 6-end output out2.pdf
very simple and elegance !!

detailed manual :

pdftk --help


.




1/17/2010

CPU 점유율 잡아먹는 네이버 실시간 검색어 없애기

firefox 파이어폭스로 네이버 접속했을 때 cpu 점유율 급상승하는 증상.

실시간 검색어 목록이 화려한 (?) 효과로 바뀌고 있는데 이게 원인인 듯.

그리스몽키로 없애버리니 cpu 가 잠잠해 짐.


방법
------------

firefox -> right click on greasemonkey icon -> 새로운 유저 스크립트

이름, 네임 스페이스 적당히 쓸것

동작할 페이지 -> http://*.naver.com/*


스크립트 내용

// ==UserScript==
// @name naver
// @namespace naver
// @include http://*.naver.com/
// ==/UserScript==

var annoying = document.getElementById('au_keyword_rank');
if (annoying)
{annoying.parentNode.removeChild(annoying);
}

실시간 검색어 부분을 소스 확인 해보면 html 태그 ID 가 au_keyword_rank 로 되어 있음.

greasemonkey 에서 이 부분 검색해서 없애는 코드.

.

1/16/2010

[HOWTO] install python-visual_5.13 to jaunty

Preparing related packages

Download linux package in

http://vpython.org/contents/download_linux.html

Uncompress it.
And make temporary folder ( ex. vp_tmp ) and get into the vp_tmp folder

/home/username/somewhere$ ls -d visual-5.13_release
visual-5.13_release
/home/username/somewhere$ mkdir vp_tmp
/home/username/somewhere$ ls
visual-5.13_release
vp_tmp
/home/username/somewhere$ cd vp_tmp
/home/username/somewhere/vp_tmp$


install the following 3 packages using synaptic :

libboost-python-dev
libboost-signals-dev
libboost-thread-dev


install the followings using synaptic :

automake
libgtkglextmm-x11-dev
libgtkmm-2.4-dev
libglademm-2.4-dev

Configure

/home/username/somewhere/vp_tmp$ PYTHON=/usr/bin/python ../visual-5.13_release/configure --prefix=/usr
The configure command should be run in a parallel folder.
The install.txt file recommand that.
(for example, vp_tmp which was made in before step)
So, the configure command should be "../visual-5.13_release/configure" rather than "./configure"



compile

/home/username/somewhere/vp_tmp$ make


install

/home/username/somewhere/vp_tmp$ make install

In jaunty, python site-packages or dist-packages are located in
"/usr/lib/python2.6/dist-packages" or "/usr/lib/python2.6/site-packages"
So, prefix should be "/usr"
Then, python-visual will be installed in prefix/lib/python2.6/site-packages folder.
After "make install", because of ubuntu jaunty's python folder policy, you should

$ sudo cp -R /usr/lib/python2.6/site-packages/* /usr/lib/python2.6/dist-packages/


If "configure" was run without --prefix option, compiled visual-python package is installed in
"/usr/local/lib/python2.6/site-packages"
In this case, user should copy the whole installed packages to "/usr/lib/python2.6/dist-packages"
(i.e.,
/home/username/somewhere/vp_tmp$ sudo cp -R /usr/local/lib/python2.6/site-packages/* /usr/lib/python2.6/dist-packages/
)

.