본문 바로가기

테크54

[Python] 파일 read, write 기본 # Goal.- python 스크립트를 수행- 특정 형식의 config파일로부터 읽어온 설정을 기반으로, child process 들을 수행, 관리한다. 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374import osimport reimport sysimport getopt def parent(): pass def get_port(fh): port = {} for line in fh: line = line.strip() strs = re.split("\s+", line) if(re.compile("^end.. 2015. 9. 1.
ps 로 프로세스 찾아서 바로 kill 하기(ps, awk, xargs) ps -ef | grep 프로세스명 | awk '{ print $2 }' | xargs kill -9 2015. 8. 26.
centos7 에 postgresql9 설치하기 #Goal.- Centos 7 에 Postgresql 9 버전 설치하기.- pg 설치 디렉토리를 지정- pg DB data 디렉토리를 지정- 특정 유저 권한으로 실행(관리)하기 설치 url : http://www.postgresql.org/download/linux/redhat/ yum으로 기본 설치yum install http://yum.postgresql.org/9.4/redhat/rhel-6-x86_64/pgdg-redhat94-9.4-1.noarch.rpmyum install postgresql94-server postgresql94-contrib /usr/pgsql-9.4/ 에 설치됨 -> pg 애플리케이션 관리를 위해 원하는 디렉토리로 이동시킴mv /usr/pgsql-9.4 /opt/3rd/ .. 2015. 8. 23.
[Perl] Method 내에서 전달된 hash 직접 조작하기 12345678910111213141516171819202122232425262728293031323334353637#!/usr/bin/perluse Data::Dumper; my $r_org_h = getHash();printf "%s", Dumper $r_org_h; sub getHash{ my %item = (); $item{s_item}{domain_a}{company0} = "10"; $item{s_item}{domain_a}{company1} = "11"; $item{s_item}{domain_b}{company0} = "20"; $item{s_item}{domain_b}{company1} = "21"; printf "%s", Dumper \%item; changeSiteHash(\%item).. 2015. 8. 10.