목요일, 12월 14, 2006

linux network settting - route

http://kelp.or.kr/korweblog/stories.php?story=01/09/29/1007612


[ 네트워크 설정(두개의 랜카드 잡기) ]

1. IRQ, IO 번호 확인하기
$ cat /proc/pci
$ cat /proc/interrupts
$ cat /proc/ioports
$ dmesg

2. 부팅시 커널차원에서 인식 시키기
# Lan종류 + auto IRQ + auto IO + Lancard Device 번호의 순서로
$ vi /etc/lilo.conf
append="ether=0,0,eth0 ether=0,0,eth1" # PnP 인식
# append="ether=11,0x6100,eth0 ether=5,0x300,eth1" # 특정 인식

3. 일종의 드라이버인 모듈을 올리기
$ ls /lib/modules/kernel-version/net
$ modprobe ne.o io=0x300 irq=5
$ lsmod
$ rmmod
$ vi /etc/conf.modules
alias eth0 rtl8139 # PCI LANCard인 경우
alias eth1 ne # ISA LANCard인 경우
options ne io=0x300 irq=5
$ control-panel
Kernel Daemon Configuration -> Add -> Module Types eth -> OK ->
Which module type? eth1 -> Which module? ne -> OK ->
io=0x300 -> irq=5 -> Done

4. CMOS 차원에서의 IRQ 설정
# CMOS에서 네트워크의 PNP 기능을 없애서 내정 IRQ에 따른 출동을 피한다
[PNP/PCI Configuration]
PNP OS Installed : NO

5. 랜카드 차원에서의 IRQ 설정
# 물리적인 변경
LANCard Jumper move 10 -> 5
# 프로그램을 이용한 변경
Intel Ether Express Pro/10 PNP ISA e10disk.exe sofset2.exe
RealTek 8019 ISA PNP Ethernet(ne2000) rset8019.exe
# Setup
Plug and Play : Disable(or Juper less)
IO and IRQ setting

6. 모듈이 잡혔나 확인하기
$ uname -a # 커널버전 보기
$ ls /lib/modules/2.2.7/net
ne.o rt8139.o
$ /sbin/lsmod # 확실히 이부분이 올라와 있어야 한다
ne, rt8139 Module
$ modprobe ne io=0x300 irq=5 # 모듈을 로드 시키는 명령

7. 네트워크 등록정보 입력
# ip 설정
$ ifconfig # 기존 정보 보기
$ ifconfig eth0 192.168.10.5
$ ifconfig eth0 192.168.10.5 netmask 255.255.255.0 up # ip를 설정하는 명령
$ ifconfig eth0 down
# 라우팅 테이블 설정
$ route # 기존 정보 보기
$ netstat -nr # 기존 정보 보기
$ route add -net 192.168.10.0 netmask 255.255.255.0 dev eth0 # 추가 명령
$ route del default gw 192.168.255.255 eth0 # 삭제 명령
$ route add default gw 203.239.44.50 eth0
# 비주얼 제어판을 통한 설정
$ netcfg # 혹은 "$ linuxconf"
Default Gateway-203.239.44.50
Default Gateway Device-eth0
$ ifdown eth0; ifup eth0

8. 텍스트를 통한 Route, Gateway 설정
$ vi /etc/sysconfig/static-routes
# 각기 다른 게이트웨이를 쓸 경우 or skip
eth0 net 192.168.10.0 netmask 255.255.255.0 gw 192.168.10.1
eth1 net 192.168.11.0 netmask 255.255.255.0 gw 192.168.11.1
eth1:0 net 192.168.12.0 netmask 255.255.255.0 gw 192.168.12.1
# eth1:0 IP-Alias를 적용한 예
$ vi /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE="eth1"
IPADDR="192.168.100.1"
NETMASK="255.255.255.0"
NETWORK="192.168.100.0"
BROADCAST="192.168.100.255"
ONBOOT="yes"
BOOTPROTO="none"
GATEWAY="192.168.11.1" # 여기다 직접 게이트웨이를 쓸수있다.
GATEWAYDEV="eth1"
$ netcfg
$ ifdown eth1; ifup eth1
$ ifconfig

9. 네트워크를 설정하는데 쓰이는 파일들
# Basic file: hosts, resolv.conf, network, ifcfg-eth0
/etc/HOSTNAME
/etc/host.conf
/etc/hosts
/etc/resolve.conf
/etc/nsswitch.conf
/etc/conf.modules
/etc/sysconfig/network
/etc/sysconfig/static-routes
/etc/sysconfig/network-scripts/ifcfg-eth0

10. 네트워크 테스트 명령들
$ ping; traceroute; nslookup

월요일, 12월 11, 2006

Python memory leaks

Tracking Down Memory Leaks in Python


This Page Mostly Obsolete

Most of the stuff on this page is obsolete nowadays, since Python (since version 2.0, I think) now includes a cyclical-reference garbage collector. Leaks like this are still possible, but usually only because an older Python extension module (implementing a container type) is used, one that doesn't adhere to the new GC API.


Long-running processes have a nasty habit of exposing Python's Achilles' Heel: Memory Leaks created by cycles. (objects that point at each other, either directly or circuitously). Reference counting cannot collect cycles. Here's one way to create a cycle:

class thing:
pass

refcount(a) refcount(b)
a = thing() 1
b = thing() 1 1
a.other = b 1 2
b.other = a 2 2

del a 1 2
del b 1 1

Objects a and b have become immortal.

Large and complex systems may create non-obvious cycles. Here are a few quick hints to avoid various ones that I've run into:

  • Be careful with bound method objects. Bound methods are created whenever you refer to a method object through an instance. This happens safely every time you call a method; but a common programming style ('functional') passes such objects around, stores them in variables, etc... In one case storing a bound method in the object made it immortal. Either del this object manually, or change your code.
  • Tracebacks are very dangerous. To be really safe, del a traceback if you have a handle to it. Another good idea is to assign None to both sys.traceback and sys.exc_traceback.
    Tracebacks can capture a large number of objects, especially within Medusa. For example, any exception handler that is called from within the polling loop (no matter how deeply), should do something like this...
        def my_method (self):
    try:
    do_something()
    except:
    try:
    ei = sys.exc_info()
    [... report error ...]
    finally:
    del ei

    ...otherwise it will capture references to every object in the socket map. I have plugged some really bad leaks this way.
  • Keep track of your objects. Either keep a count of how many are around (in a __del__ method), or keep a dictionary of the addresses of all outstanding objects. This will help locate leaks.
    class thing:

    all_things = {}

    def __init__ (self):
    thing.all_things[id(self)] = 1

    def __del__ (self):
    del thing.all_things[id(self)]
    Here is a module that will let you resurrect leaked objects. Using this module should fill you with shame. Make sure no one is looking.
    for addr in thing.all_things.keys():
    r = resurrect.conjure (addr)
    # examine r...
  • Here's the easiest way to find leaking objects: examine the reference count of each of your class objects. This will be roughly equal to the number of extant instance objects.
    # -*- Mode: Python; tab-width: 4 -*-

    import sys
    import types

    def get_refcounts():
    d = {}
    sys.modules
    # collect all classes
    for m in sys.modules.values():
    for sym in dir(m):
    o = getattr (m, sym)
    if type(o) is types.ClassType:
    d[o] = sys.getrefcount (o)
    # sort by refcount
    pairs = map (lambda x: (x[1],x[0]), d.items())
    pairs.sort()
    pairs.reverse()
    return pairs

    def print_top_100():
    for n, c in get_refcounts()[:100]:
    print '%10d %s' % (n, c.__name__)

    if __name__ == '__main__':
    top_100()

Notes

An interface to malloc_stats() [Linux]

원문: http://www.nightmare.com/medusa/memory-leaks.html

월요일, 10월 30, 2006

Install of Oracle 9i on Fedora Core 4

Install of Oracle 9i on Fedora Core 4

* 요약
fedora에 오라클 9i설치하기....^^

Xmanager이 있으면 원격으로 설치가 가능하다.. xclock이 실행되는지 확인함...

* java 1.3.0 버젼을 미리 설치한다. http://java.sun.com/j2se/1.3/download.html

1. 계정생성
su -
# groupadd dba
# useradd -g dba oracle

2. 환경설정
/etc/sysctl.conf
kernel.sem = 250 32000 100 128
kernel.shmmax = 2147483648
kernel.shmmni = 128
kernel.shmall = 2097152
kernel.msgmnb = 65536
kernel.msgmni = 2878
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000

3. Oracle 환경변수 수정
ORACLE_BASE=/opt/oracle
ORACLE_HOME=$ORACLE_BASE/920
ORACLE_SID=MY_ORACLE
LD_LIBRARY_PATH=$ORACLE_HOME/lib
LD_ASSUME_KERNEL=2.4.1
THREADS_FLAG=native
ORACLE_OEM_JAVARUNTIME=/opt/jre1.3.1_15
PATH=$PATH:$ORACLE_HOME/bin

export ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH LD_ASSUME_KERNEL THREADS_FLAG ORACLE_OEM_JAVARUNTIME PATH

4. 설치 확인
rpm -q gcc glibc-headers glibc-kernheaders glibc-devel compat-libstdc++ cpp compat-gcc

ftp://ftp.kaist.ac.kr/pub/fedora/linux/core/4/i386/os/Fedora/RPMS

5. config 변경후 reboot <-- 꼭 필요함..
/etc/selinux/config and change value of SELINUX to "disabled"

6. Download the Oracle 9i
gunzip ship_9204_linux_disk1.cpio.gz
gunzip ship_9204_linux_disk2.cpio.gz
gunzip ship_9204_linux_disk3.cpio.gz
cpio -idmv < ship_9204_linux_disk1.cpio
cpio -idmv < ship_9204_linux_disk2.cpio
cpio -idmv < ship_9204_linux_disk3.cpio

/install/linux/oraparam.ini and modify JRE_LOCATION
variable and set path to our JRE installation from Step
JRE_LOCATION=/opt/jre1.3.1_15

7. install cd Disk1 ./runInstaller
* 참고 http://ivan.kartik.sk/oracle/install_ora9_fedora.html

fedora 4 pro*c 컴파일

undefined reference to `ECPGget_sqlca' <-- 이 함 수를 못찾는 다고 나오는 경우

이런경우 pc파일에서 c로 변환시 postgressql 함수가 추가되어서 생기는 문제로.
proc설정파일을 수정하면 됩니다...



/oracle/9.2.0/precomp/admin/pcscfg.cfg

* 기존
sys_include=(/usr/include,/usr/lib/gcc-lib/i386-redhat-linux/3.2.3/include)
ltype=short

* 수정

sys_include=(/oracle/9.2.0/precomp/public,/usr/include,/usr/lib/gcc-lib/i386-redhat-linux/3.2.3/include)
ltype=short


* 추가내용: /oracle/9.2.0/precomp/public

컴파일시 시스템함수 못찾는경우 링크하기...^^

1. man 함수명
* 일반적인 경우에 man페이지에 대부분은 링크해야하는 라이브러리가 적혀있음....

2. man으로 알 수 없는경우

# nm -A /usr/lib/*.a | grep 시스템함수
이렇게 파일이 나오는경우
libabc.a
-labc <-- 이렇게 링크시에 적어주면 됩니다. 참고하세요.

VC6에서 PRO*C 설정하기..

FileView 에
Add files to Folder
오라클이 설치되어 있는 디렉토리 밑에 oraSQL8.LIB 파일을 추가
예) G:\PROGRAM~1\ORACLE\ORA81\PRECOMP\LIB\MSVC\oraSQL8.LIB

Tools -> Options -> Directories

Include files
G:\PROGRAM~1\ORACLE\ORA81\PRECOMP\PUBLIC
G:\PROGRAM~1\ORACLE\ORA81\OCI\INCLUDE

Library files
G:\PROGRAM~1\ORACLE\ORA81\PRECOMP\LIB\MSVC
G:\PROGRAM~1\ORACLE\ORA81\OCI\LIB\MSVC


Pro C 컴파일 2가지 방법

첫번째 방법

.pc 파일에서 오른쪽 마우스를 클릭하고 Settings를 선택하고

Custom Build 메뉴에서

Commands 에 및의 내용을 추가하고

G:\program~1\Oracle\Ora81\Bin\proc oraca=yes code=CPP define=d:\Oracle\Precomp\LIB\MSVC sys_include=d:\Oracle\Precom\PUBLIC $(ProjDir)\$(InputName)

Outputs 에 및의 내용을 추가하면
$(ProjDir)\$(InputName).cpp

내용을 추가하고 컴파일하면 됨.

솔라리스 아이피 변경시 확인

솔라리스를 아이피 변경시 확인해야하는 내용.

* Solaris 에서 변경해야 될 파일들
/etc/nodename # if you need to change the name of the machine
/etc/hostname.interface # eg. hostname.hme0
/etc/hosts # Update to reflect new name
/etc/nsswitch.conf # Update if your name resolution
/etc/resolv.conf

# Update if your name servers/domain changed (DNS only)
/etc/defaultdomain # set you default domain
/etc/defaultrouter # Set the default router's IP
/etc/inet/networks # Set your network name
/etc/inet/netmasks # Set your network number
/etc/n/etc/net/ticots/hosts # For the streams-level loopback
/etc/ticlts/hosts # For the streams-level loopback
/etc/net/ticotsord/hosts # For the streams-level loopback

* Solaris 에서 IP 변경 작업

/etc/hosts 파일을 수정함.
/etc/hostname.hme0 랜카드에 적용되는 호스명을 명시

$ ifconfig hme0 [ip] netmask 0xffffff00 broadcast + up

ex)
--- 영구적인 변경
$vi /etc/hostname.hme0
xxxx

$ vi /etc/hosts
127.0.0.1 localhost
xxx.xxx.xxx.xxx xxxx xxxx

--- 임시변경시 (컴퓨터가 켜져있는 동안, 리부팅되면 정보가 사라짐)
$ ifconfig -a
lo0: flags=1000849 mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
hme0: flags=1000843 mtu 1500 index 2
inet xxx.xxx.xxx.xxx netmask ffffff00 broadcast xxx.xxx.xxx.xxx

$ ifconfig hme0 xxx.xxx.xxx.xxx netmask 0xffffff00 broadcast + up

* Solaris 에서 GATEWAY 변경 작업

$ netstat -rn
$ route add default [gateway ip]
$ vi /etc/defaultrouter
[gateway ip]

ex)
--- 영구적인 변경
$ vi /etc/defaultrouter
xxx.xxx.xxx.1

--- 임시적인 변경
route add default xxx.xxx.xxx.1


* Solaris 에서 DNS 변경 작업

ex)
$ vi /etc/resolv.conf
nameserver xxx.xxx.xxx.1
nameserver xxx.xxx.xxx.2

$ vi nsswitch.conf
# hosts: 부분을 수정한다.
# consult /etc "files" only if nis is down.
hosts: files dns

* 설정 변경 후 reboot , 시스템에 관한 내용이 변경된경우
reboot

linux network settting

리눅스 네트웩 설정 - IP 변경시 확인해야하는 파일..
LINUX NETWORK 설정

* 모든 설정은 root 계정으로 실행합니다. *

$ vi /etc/sysconfig/network

NETWORKING=yes
HOSTNAME=vtn01
GATEWAY=xxx.xxx.xxx.1 <-- default G/W IP로 변경함.

$ cd /etc/sysconfig/network-scripts

$ vi ifcfg-eth2

DEVICE=eth2
BOOTPROTO=none
HWADDR=
ONBOOT=yes
TYPE=Ethernet
DHCP_HOSTNAME=vtn01
IPADDR=xxx.xxx.xxx.xxx <-- IP
NETMASK=255.255.255.0
USERCTL=no
PEERDNS=yes
GATEWAY=xxx.xxx.xxx.1 <--- 해당 IP 대역에 G/W를 설정
IPV6INIT=no

$ vi route-eth2
GATEWAY0=xxx.xxx.xxx.1 <--- 해당 서버 GW
NETMASK0=255.0.0.0
ADDRESS0=xxx.0.0.0

$ vi route-eth3
GATEWAY0=xxx.xxx.xxx.1
NETMASK0=255.0.0.0
ADDRESS0=xxx.0.0.0

$ cd /etc/init.d

$ network restart

$ ifconfig <-- 아이피가 변경되었는지 확인

$ route <-- G/W ip가 적용되어 있는지 확인.


-----------------------------------------------------------------------------
이전

* /etc/sysconfig/network-scripts/ifcfg-eth0 파일을 수정함.
방법 1)
$ vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
IPADDR=xxx.xxx.xxx.xx
NETMASK=255.255.255.0
GATEWAY=xxx.xxx.xxx.xx

이더넷 확인)
$ ifconfig -a
eth0 Link encap:Ethernet HWaddr
inet addr:xxx.xxx.xxx.xxx Bcast:xxx.xxx.xxx.xxx Mask:xxx.xxx.xxx.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:68620 errors:0 dropped:0 overruns:0 frame:0
TX packets:45782 errors:0 dropped:0 overruns:60 carrier:0
collisions:29821 txqueuelen:100
RX bytes:73725865 (70.3 Mb) TX bytes:12988879 (12.3 Mb)
Interrupt:30

eth1 Link encap:Ethernet HWaddr
inet addr:10.0.0.50 Bcast:10.0.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4488 errors:0 dropped:0 overruns:0 frame:0
TX packets:2505 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:734304 (717.0 Kb) TX bytes:265288 (259.0 Kb)
Interrupt:29 Base address:0x2000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:6969 errors:0 dropped:0 overruns:0 frame:0
TX packets:6969 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1097647 (1.0 Mb) TX bytes:1097647 (1.0 Mb)

방법 2) Usage : ifconfig eth0 [ip] netmask 0xffffff00 broadcast + up
$ ifconfig eth0 xxx.xxx.xxx.xxx netmask 0xffffff00 broadcast + up

* Gateway 변경

방법 1)
$ netstat -rn (네트워크 상태 확인)
$ route add default [gateway ip] (게이트웨이 추가)
$ vi /etc/sysconfig/network
[gateway ip]

방법 2)
$ vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=node1 # 호스트 네임
GATEWAY=xxx.xxx.xxx.xxx

$vi /etc/sysconfig/static-routes
eth0 net xxx.xxx.xxx.0 netmask 255.255.255.0 gw xxx.xxx.xxx.xxx
eth1 net 10.0.0.0 netmask 255.255.255.0 gw 10.0.0.1

* 리눅스 DNS 변경

방법)
$ vi /etc/resolv.conf
domain xxxx.com
nameserver xxxx.xxx.xx.1
nameserver xxx.xxx.xx.2
nameserver xxx.xxx.xx.xxx


* 모든 작업을 종료하고 network restart 한다.

$ /etc/rc.d/init.d/network stop
$ /etc/rc.d/init.d/network start

수요일, 10월 11, 2006

OS별 패키지 설치 요약

* Linux (www.rpmfind.net)
* 설치
rpm -Uvh 설치패키지
* 설치확인
rpm -qa | grep 설치 패키지
* 삭제
rpm -e 패키지명

* SunOS (www.sunfreeware.com)
* 설치
pkgadd 패키지
* 설치확인
pkginfo | grep 패키지
* 삭제
pkgrm 패키지

* HPUX (hpux.connect.org.uk, www.hp.com)
* 설치
swinstall /절대경로/패키지
* 설치확인
swlist | grep 패키지
* 삭제
swremove 패키지

GNU 소프트웨어 설치하거나 컴파일 해야하는 경우에는
gmake, gcc, automake, autoconf, 기본적으로 4가지 패키지를 설치하고 작업하시면
대부분의 소프트웨어들을 설치됩니다. 설치하시는 패키지의 필요에 따라서 더 설치하시면 됩니다.

월요일, 9월 11, 2006

java execl에 내용 읽어오기.

import jxl.Cell;
import jxl.Sheet;
import jxl.Workbook;

Workbook workbook = Workbook.getWorkbook(new File("fileName"));
Sheet sheet = workbook.getSheet(0); //0번째 시트
for (int i=1; i < sheet.getRows() ; i++ )
{
totalCount++;
Cell[] cells = sheet.getRow(i);
}

* 참고 사이트
http://jxl.sourceforge.net/

Struts 1.1 File upload

다음은 동적 개수의 파일을 업로드 하는 예제이다 (** Struts 1.1 정식 부터는 위와 같은 배열로도 가능하다.!!)

1.입력 Page

<form action=""/upload.do" enctype="multipart/form-data" method="post">
<input name="file[0]" size="20" type="file">
<input name="file[1]" size="20" type="file">
<input value="OK" type="submit">


2.ActionForm private Vector vector = new Vector();

public FormFile getFile(int i) { return (FormFile)vector.elementAt(i); }
public void setFile(int i, FormFile f) { vector.add(i, f); }


3.Action
Class public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
throws Exception {

ActionErrors errors = new ActionErrors();
ActionForward forward = new ActionForward(); // return value
InputForm inputForm = (InputForm) form;
try {
FormFile file1 = inputForm.getFile(0);
FormFile file2 = inputForm.getFile(1);
save(file1); save(file2); }
catch (Exception e) { e.printStackTrace(); }

forward = mapping.findForward("result");
return (forward); }

private void save(FormFile file) {
byte[] buffer = new byte[2048];
FileOutputStream fos = null;
System.out.println(file.getFileName());
try {
fos = new FileOutputStream(new File("d:\\" + file.getFileName()));
BufferedInputStream bis = new BufferedInputStream(file.getInputStream());
int size = 0;
while ((size = bis.read(buffer)) != -1)
fos.write(buffer, 0, size);
} catch (Exception e) {
e.printStackTrace();
} finally {
if(fos != null)
try {
fos.close();
} catch(Exception e2)
{}
}
}


------
구글에서 찾은 내용입니다.

요약하면
1. Form에는 FormFile 형태로 선언해야함.
2. action에서 file.getInputStream()으로 하면 받은 파일내용을 읽을 수 있음.
3. file.getFileName() 파일 이름을 알 수 있음.

Struts 1.1 File upload

다음은 동적 개수의 파일을 업로드 하는 예제이다 (** Struts 1.1 정식 부터는 위와 같은 배열로도 가능하다.!!)

1.입력 Page

/upload.do" enctype="multipart/form-data" method="post">





2.ActionForm private Vector vector = new Vector();

public FormFile getFile(int i) { return (FormFile)vector.elementAt(i); }
public void setFile(int i, FormFile f) { vector.add(i, f); }


3.Action
Class public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
throws Exception {

ActionErrors errors = new ActionErrors();
ActionForward forward = new ActionForward(); // return value
InputForm inputForm = (InputForm) form;
try {
FormFile file1 = inputForm.getFile(0);
FormFile file2 = inputForm.getFile(1);
save(file1); save(file2); }
catch (Exception e) { e.printStackTrace(); }

forward = mapping.findForward("result");
return (forward); }

private void save(FormFile file) {
byte[] buffer = new byte[2048];
FileOutputStream fos = null;
System.out.println(file.getFileName());
try {
fos = new FileOutputStream(new File("d:\\" + file.getFileName()));
BufferedInputStream bis = new BufferedInputStream(file.getInputStream());
int size = 0;
while ((size = bis.read(buffer)) != -1)
fos.write(buffer, 0, size);
} catch (Exception e) {
e.printStackTrace();
} finally {
if(fos != null)
try {
fos.close();
} catch(Exception e2)
{}
}
}


------
구글에서 찾은 내용입니다.

요약하면
1. Form에는 FormFile 형태로 선언해야함.
2. action에서 file.getInputStream()으로 하면 받은 파일내용을 읽을 수 있음.
3. file.getFileName() 파일 이름을 알 수 있음.

수요일, 8월 16, 2006

python profile

* profile 파일 생성
import profile
profile.run('main()', 'profile.db')

* profile 분석 하기
$ python
import pstats
p = pstats.Stats('profile.db')
p.sort_stats('time').print_stats(10)

월요일, 5월 08, 2006

svn 충돌해결

svn update 또는 svn status 한 경우
C 파일명

이렇게 나오는 경우

ls
파일명
파일명.mine
파일명.r10
파일명.r20

이렇식으로 파일들이 있는 경우에 병합하고 나서 svn resolved 파일명 으로 명령을 실행하면
충돌이 해결됨.


월요일, 4월 03, 2006

Subversion 설치

http://wiki.kldp.org/wiki.php/Subversion-HOWTO

Subversion 설치

Berkeley DB 4.4 + subversion-1.3.0


기존에 CVS를 사용한 경우 SubVersion버젼으로 변경하는 방법


cvs2svn


cvs2svn --use-cvs --trunk-only -s /home/svn/프로젝트 /home/cvs/프로젝트

화요일, 3월 14, 2006

Python Oracle 모듈

저희 회사에서 사용하는 python Oracle모듈... cx_oracle

사용되는 OS는 Linux, HPUX

http://www.cxtools.net/default.aspx?nav=cxorlb

목요일, 2월 09, 2006

javascript 설명


javascript설명이 잘 되어 있는 곳


http://koxo.com/lang/js/index.html

수요일, 2월 01, 2006

rainlendar outlook plugin lunar bug patch


Rainlendar version 0.22 http://www.rainlendar.net/


Outlook Pugin v1.9 lunar patch

수정내용

기존 rainlendar는 outlook2002/2003에서 음력 반복 이벤트를 등록(예 생일같은)한 경우에 다음해가 되면 처리않되는 문제를 수정한 버젼입니다.

일년에 한번 반복되는 음력기념일에 "#"을 붙치면 정확한 양력 날짜가 표시됨.

"현재년에만 가능" 한해를 넘겨서 보고 싶은 경우 시스템 년도를 변경해야합니다.

예) 기존에 입력되어있는 "음력기념일1"을 "#음력기념일1"로 제목을 변경하면 동작함.


설치방법

1. Download

2. Rainlendar 중지

3. "C:\Program Files\Rainlendar\Plugins\" 으로 복사함

4. Rainlendar 실행


Bug List

  • 음력 윤달/년 처리가 필요.
  • 2005년 음력 설 반복 이벤트로 등록한 경우 처리가 않됨.
  • 한달에 한번씩 반복되는 음력 이벤트는 처리 않됨.



금요일, 1월 27, 2006

c/c++ cgi library

http://www.qdecoder.org/

CGI를 만들때 사용할 수 있는 library가 있음.

목요일, 1월 26, 2006

javascript 객체와 이벤트

객체 사용 가능한 이벤트 핸들러
윈도우 onLoad, onUnload
본문(Document) onLoad, onUnload
하이퍼텍스트 링크 onClick, onMouseOver
폼 onSubmit
폼 / TEXT OnBlur, onChange, onFocus, onSelect
폼 / TEXTAREA OnBlur, onChange, onFocus, onSelect
폼 / SELECT OnBlur, onChange, onFocus
폼 / CHECKBOX onClick
폼 / RADIO BUTTON onClick
폼 / BUTTON onClick
폼 / RESET BUTTON onClick
폼 / SUBMIT BUTTON onClick

금요일, 1월 06, 2006

tomcat out over memory문제

* 자바에서 기본적으로 설정되어있는 메모리 사이즈를 늘려줌

$ cp strartup.sh start.sh

$ vi startup.sh

# 사용하는 메모리사이즈를 조절함. tomcat 버젼이 5.x이상인경우에만 사용

# tomcat버젼에 4.x이하인경우에는 TOMCAT_OPTS 환경변수를 사용함.

export CATALINA_OPTS="-Xms256m -Xmx512m"

umask 0
/usr/local/tomcat/bin/start.sh

$ startup.sh


* 참고


$ java -X
-Xmixed mixed mode execution (default)
-Xint interpreted mode execution only
-Xbootclasspath:<directories and zip/jar files separated by ;>
set search path for bootstrap classes and resources
-Xbootclasspath/a:<directories and zip/jar files separated by ;>
append to end of bootstrap class path
-Xbootclasspath/p:<directories and zip/jar files separated by ;>
prepend in front of bootstrap class path
-Xnoclassgc disable class garbage collection
-Xincgc enable incremental garbage collection
-Xloggc:<file> log GC status to a file with time stamps
-Xbatch disable background compilation
-Xms<size> set initial Java heap size
-Xmx<size> set maximum Java heap size

-Xss<size> set java thread stack size
-Xprof output cpu profiling data
-Xfuture enable strictest checks, anticipating future default
-Xrs reduce use of OS signals by Java/VM (see documentation)
-Xcheck:jni perform additional checks for JNI functions
-Xshare:off do not attempt to use shared class data
-Xshare:auto use shared class data if possible (default)
-Xshare:on require using shared class data, otherwise fail.


The -X options are non-standard and subject to change without notice.

목요일, 1월 05, 2006

IP를 가지고 국가찾아내기

접근하는 IP만 가지고 해당 국가 모두를 차단할 수 있겠군요.

요즘 중국에서 오는 IP들이 해킹이나 스팸메일 많이 보내는데 이 자료를 유용하게 사용할 수 있을것 같습니다.

http://www.ip2nation.com/


수요일, 1월 04, 2006

mstone간단요약


* Mstone performance tool
http://www.mozilla.org/projects/mstone/


* download
% cvs co mozilla/mstone
% cd mozilla/mstone
% gmake rpackage


* 수신자 발신자 아이디
conf/general.wld


#<-- 발신자 %ld없이 이름을 주면 한 사람만 수신됨 램덤하게 숫자를 붙치고 싶은경우에만 %ld를 사용
smtpMailFrom mailtestuser0@test.test
loginFormat mailtestuser%ld
#<-- 수신자 %ld없이 이름을 주면 한 사람만 수신됨 램덤하게 숫자를 붙치고 싶은경우에만 %ld를 사용
addressFormat mailtestuser%ld@test.test


# %ld에 사용되는 번호
numAddresses 100
# %ld에 사용되는 최초 번호
firstAddress 0


* 동시 발송 프로세스 조절
conf/smtp.wld


clientCount 20 # <-- 100~200 사이에 수로 실행함



* 동보발송 수 조절
conf/smtp1k.wld
conf/smtp5k.wld
conf/smtp17k.wld


# deliver each message to more than 1 address
numRecips 1 # <-- 동보전송 수를 조절함



* 실행
mstone smtp -t 시간(초)


* 실행않되는 경우
/var/tmp에 ./data에 있는 메일 파일들을 복사함.. en-1k.msg, en-5k.msg, en-17k.msg

Blogging Tool 비교

http://www.zlbl.com/wp/archives/2005/09/28/407

http://www.zlbl.com/wp/blogging-tool/ <-- 아주 잘 정리되어있습니다. 참고하세요

저도 결론은 ^^
Zoundry Blog Writer

* http://www.zoundry.com/
* 무료이면서 한글이 잘 지원되는 blogger tool


VB activeX test

PARAM NAME="_ExtentX" VALUE="8467">
PARAM NAME="_ExtentY" VALUE="6350">
PARAM NAME="test1" VALUE="aaa">


'bas

Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
test1 = PropBag.ReadProperty("test1", "default value")
End Sub

월요일, 1월 02, 2006

stdcall형태로 함수 정의하기 (dll)

VC++이나 VB에서 C형태로 사용하기 위해서 정의하는 방법입니다.
CPP의 네이밍규칙때문에 C에서 함수 호출이 않되면 정의 후 사용하시면 됩니다.

extern "C" int __declspec(dllexport) fnName()
{

return 0;
}