7/30/2009

nautilus script : backup script

This script copy the selected files in the folder named 'old'.
If the folder is not exist, the script create 'old' folder.
Time stamp strings, e.g. "_Thu_Jul_30_11.05.39_2009", are automatically attached at the end of the file name.


#!/usr/bin/python
# -*- coding: UTF-8 -*-

import os, glob, time

old = 'old' # backup folder name

def showme(s):
os.system('gmessage -center ' + str(s))

def make_time_str():
tmp = time.ctime()
tmp = tmp.replace(' ', '_')
tmp = tmp.replace(':', '.')
return tmp

def make_old_folder():
if len(glob.glob(old)) == 1 and os.path.isdir(old) :
pass #
else :
os.system('mkdir old')

return

make_old_folder()

# get selected file paths
tmp = os.environ['NAUTILUS_SCRIPT_SELECTED_FILE_PATHS']
fns = tmp.strip().split('\n') #filenames

for fn in fns : # for filename in filenames
if os.path.isdir(fn) :
#showme('pass')
pass
fn_nameonly = os.path.basename(fn) # extract file name from file path
#showme(os.path.splitext(fn)[1])
cmd = 'cp ' + '"' + fn_nameonly + '" old/"' + fn_nameonly + '_' + make_time_str() + os.path.splitext(fn)[1] + '"'
os.system(cmd)

The script file must be in ~/.gnome2/nautilus-scripts/

7/29/2009

HOWTO install python multiprocessing module with python 2.5

Python 2.6 has multiprocessing by default, while 2.5 has not.
This is HOWTO install multiprocessing module with python 2.5.

download site : http://linux.softpedia.com/get/Programming/Libraries/python-multiprocessing-43286.shtml

In above site, download multiprocessing-2.6.1.1.tar.gz
uncompress, and run "sudo python setup.py install"
That's it

Detail is in INSTALL.txt file.

usage ref : http://kldp.org/node/107470

7/28/2009

HOWTO use korean in lyx (beamer class)

1. open /usr/share/lyx/languages and find line for korean, and modify as follows:
(This will add koreanUCS option for lyx language setting. utf8 encoding is needed for using korean.)

from
korean "" "Korean" false euc-kr ko ""
to
korean "" "Korean" false euc-kr ko ""
koreanUCS "" "KoreanUCS" false utf8 ko_KR.UTF8 ""
Then, reconfigure, restart lyx.
ref : http://ktug.kldp.net/jsboard/read.php?table=setup&no=12092&page=150

2. lyx menu > Tools > Preferences > Language Settings
In Language submenu, change "Default language" to "koreanUCS"
Make "Language package" and "Command start" option blank.
Uncheck the "Use babel" option.

3. Go to Document Settings > Language, and change Language to "KoreanUCS"

4. Document Settings > LaTeX Preamble, add the followings :
\usepackage{kotex}
\usepackage{dhucs-cmap}
ref : http://faq.ktug.or.kr/faq/%C7%D1%B1%DB%B0%CB%BB%F6%B9%D7%C3%DF%C3%E2

5. For 한글(korean) bookmark, go to Document > Settings > Document Class >
add the following line in Class options > Custom
hyperref={unicode, pdftex}
ref : http://project.ktug.or.kr/ko.TeX/kotexguide.pdf -> page 60, '한글 책갈피'

The above ref recommended "\usepackage[unicode,(driver),...]{hyperref}"
where, (driver) is pdftex.

In lyx, however, adding above line into "LaTeX Preamble" makes an error.
The reason is like that : The hyperref package is automatically loaded by beamer.cls and certain options are setup. In order to pass additional options to hyperref or to override options, you can use the following class option:
\documentclass[hyperref=(list of options)]{beamer}
Causes the to be passed on to the hyperref package.
Example: \documentclass[hyperref={bookmarks=false}]{beamer}

ref : http://www.tex.ac.uk/tex-archive/macros/latex/contrib/beamer/doc/beameruserguide.pdf -> page 15

7/24/2009

intel fortran non-commercial version for linux

download site :

http://software.intel.com/en-us/articles/non-commercial-software-download/

get IA32/Intel64 version


During install process, I met the following error/warning messages :

Step no: 4 of 7 | Installation configuration - Missing Optional Pre-requisite
--------------------------------------------------------------------------------
There is one or more optional unresolved issues. It is highly recommended to fix
it all before you continue the installation. You can fix it without exiting from
the installation and re-check. Or you can quit from the installation, fix it and
run the installation again.
--------------------------------------------------------------------------------
Missing optional pre-requisite
-- operating system type is not supported.
-- system glibc or kernel version not supported or not detectable
-- binutils version not supported or not detectable
--------------------------------------------------------------------------------
1. Skip missing optional pre-requisites [default]
2. Show the detailed info about issue(s)
3. Re-check the pre-requisites

h. Help
b. Back to the previous menu
q. Quit
--------------------------------------------------------------------------------
Please type a selection or press "Enter" to accept default choice [1]:

Ignore this message, and just hit enter.
(ref : http://software.intel.com/en-us/articles/using-intel-compilers-for-linux-with-ubuntu/)
Then, installation was completed.

Next, I added the following lines to .bashrc file for setting PATH and LD_LIBRARY_PATH :
######## For intel compiler #################################
PATH="/opt/intel/Compiler/11.1/046/bin/ia32:$PATH"; export PATH
LD_LIBRARY_PATH="/opt/intel/Compile/11.1/046/lib/ia32:$LD_LIBRARY_PATH"; export LD_LIBRARY_PATH
#############################################################


or

source /opt/intel/Compiler/11.1/046/bin/ifortvars.sh ia32

7/23/2009

ubuntu gnome screensaver cycle_delay

run gconf-editor
Change the key /apps/gnome-screensaver/cycle_delay from 10 to 0,
where, "10" means user must wait 10 minute when he enter an incorrect password.

Change it to "0" so that user could re-enter the password immediately.

7/20/2009

install scipy 0.7.1 on ubuntu hardy

1. download numpy 1.3.0 and scipy 0.7.1
2. remove gfortran and libatlas3gf-sse2 (and related packages which use gfortran)
(numpy and scipy must use g77.. not gfortran)
sudo apt-get install atlas3-base-dev
sudo apt-get install atlas3-sse2

3. tar -xvzf numpy-1.3.0.tar.gz
4. cd numpy-1.3.0
5. python setup.py build --fcompiler=gnu
6. sudo python setup.py install

7. tar -xvzf scipy-0.7.1.tar.gz
8. cd scipy-0.7.1
9. sudo python setup.py install

7/19/2009

run C code in python program by using scipy.weave

http://mail.scipy.org/pipermail/scipy-user/2008-November/018739.html

7/11/2009

Simple web server using python

cd /folder/to/be/used/as/web/root/

sudo python -m SimpleHTTPServer 8888

where, 8888 is port number.

Speaker candidates..

JBL control 5 - 12
Wharfedale Diamond 9.1 - 30
mordaunt-short avant 902i - 30
캠브리지 S30
패러다임 아톰 v6


Monitor audio BR-2 (~40)

<평가>
만약 카오디오를 하셨던 분이고, 홈오디오 입문을 해볼까 하시는분이라면 강력추천..
Huk !!@#!$~@#%!@#$

Drive Unit : Complement 1 x 6.5" MMP® MK2 Bass mid-range, 1 x 1"
(25mm) Gold Dome C-CAM® tweeter

구매 비교 - google

Quad 11L2 (~43)


Bass : 125mm /5 - Tweeter : 25mm /1


HighLand Aingel 3201 (~42)


4" mid, 1" tweeter

Mordaunt short Avant 902i (~32)



PC speaker 로 현재 사용중.
5.25" mid, 1" tweeter.

쏜다는 평이 있긴 한데.. 모르겠음.

7/04/2009

Repo for Amarok 2.0 for hardy and intrepid


deb http://ppa.launchpad.net/kubuntu-members-kde4/ubuntu intrepid main

sudo apt-get install libxine1 libxine1-ffmpeg phonon-backend-xine
mv ~/.kde/share/config/phonondevicesrc ~/.kde/share/config/phonondevicesrc.save