Search This Blog

Saturday, August 27, 2011

방배추

http://shindonga.donga.com/docs/magazine/shin/2005/05/24/200505240500021/200505240500021_1.html

Thursday, August 18, 2011

ssh auto login script


#!/usr/bin/expect -f
# Expect script to supply root/admin password for remote ssh server 
# and execute command.
# This script needs three argument to(s) connect to remote server:
# password = Password of remote UNIX server, for root user.
# ipaddr = IP Addreess of remote UNIX server, no hostname
# scriptname = Path to remote script which will execute on remote server
# For example:
#  ./sshlogin.exp password 192.168.1.11 who 
# ------------------------------------------------------------------------
# Copyright (c) 2004 nixCraft project
# This script is licensed under GNU GPL version 2.0 or above
# -------------------------------------------------------------------------
# This script is part of nixCraft shell script collection (NSSC)
# Visit http://bash.cyberciti.biz/ for more information.
# ----------------------------------------------------------------------
# set Variables
set password [lrange $argv 0 0] 
set ipaddr [lrange $argv 1 1]   
set username [lrange $argv 2 2] 
set timeout -1   
# now connect to remote UNIX box (ipaddr) with given script to execute
spawn ssh $username@$ipaddr
match_max 100000
# Look for passwod prompt
expect "*?assword:*"
# Send password aka $password 
send -- "$password\r"
# send blank line (\r) to make sure we get back to gui
send -- "\r"
expect eof


Ref: http://bash.cyberciti.biz/security/expect-ssh-login-script/

Shell script for rsync with two folders in different computers


#!/usr/bin/expect -f
set username user
set password password


spawn rsync -arvuz ./ $username@127.0.0.1:~/tmp/simulation/
match_max 100000
expect "*?assword:*"
send -- "$password\r"
expect eof


spawn rsync -arvuz $username@127.0.0.1:~/tmp/simulation/ ./
match_max 100000
expect "*?assword:*"
send -- "$password\r"
expect eof


In this script, delete is not cared.

Wednesday, August 17, 2011

sshd in cygwin

Following commands should be executed with root privilege.

ssh-host-config -y 
- In this command, it will ask the user name and password. The user name will be used for running the service.

cygrunsrv -S sshd 
- With this command, it will start the sshd. 

cygrunsrv -E sshd 
- With this command, it will end the sshd

cygrunsrv -R sshd 
- With this command, it will remove the sshd. In this case, it is necessary to re-run ssh-host-config again.

You may want to change the port ssh is using. In this case, you need to edit '/etc/sshd_config.' Replace the old port number (typically it is 22) with new one. Original configuration in that file would be the following:

Port 22

If you want to add the port for exceptions in your firewall, you may want to run the following command.

netsh firewall add portopening TCP #port OPRule_#port ENABLE

where #port is the port number you want to use.

For a newer version of the Windows firewall (probably after Windows 10), the following command can be used ('netsh firewall' is deprecated).

netsh advfirewall firewall add rule name="OPRule_#port" dir=in action=allow protocol=TCP localport=#port

Remove sshd from cygwin

1. Stop and remove sshd service.

cygrunsrv -S sshd 
cygrunsrv -R sshd

2. Remove any related user account information in /etc/passwd. Specifically, remove sshd and cyg_server account information.

3. Remove any related user account.

net user sshd /delete
net user cyg_server /delete

Sunday, August 14, 2011

Friday, August 12, 2011

Octave in Windows

Cygwin Octave has a problem with its connection with gnuplot, since Cygwin has a problem with its pipe system. Some people reported that some versions of cygwin is working. I tested with Windows 7 x64 with cygwin 1.7.9, it didn't work. I tested cygwin1-20100301.dll and cygwin1-20110803.dll, they didn't work either. Especially, 20100301 is version 1.7.8.


Octave Window version has a problem with oct2mat. When it is installed with oct2mat in Octave Forge, Octave didn't work gnuplot. So, it is better to install it with Octave Forge unless it is required.


http://octave.1599824.n4.nabble.com/Plot-window-not-updating-td2172704.html
http://wiki.octave.org/wiki.pl?OctaveForWindows

Wednesday, August 10, 2011

2011년 8월 10일 고배당주 중 저점 부근에 있는 종목들

1. KT
- 2011년 배당 2,410원
- 지난 3년간 2008년 금융위기를 포함하여 최저가 27,350원
- 35,000원 밑으로 거의 내려가지 않음


2. 대신증권
- 2011년 배당 보통주 750원 우선주 800원
- 지난 3년간 2008년 금융위기를 포함하여 최저각 9,740원
- 13,000원 밑으로 거의 내려가지 않음


3. 부국증권
- 2011년 배당 보통주 1,000원 우선주 1,050원
- 지난 3년간 2008년 금융위기를 포함하여 최저가 11,500원
- 15,000원 밑으로 거의 내려가지 않음


4. BS금융지주
- 2011년 상장
- 부산은행, BS투자증권, BS캐피탈, BS신용정보 등을 보유한 지주회사
- 지주사 전환후 250원의 결산 배당
- 배당성향이 25%이상일 경우 주당 500원 이상의 배당의 기대됨
http://economy.hankooki.com/lpage/stock/201105/e2011051814401592480.htm



5. 부산가스
- 2011년 배당 1,000원
- 지난 3년간 18,000원 밑으로 거의 내려가지 않음
- 지난 3년간 2008년 금융위기 포함하여 최저가 13,700원


6.진로발효
- 2011년 배당 1,000원
- 지난 3년간 11,500원 밑으로 내려간 적 거의 없음
- 2008년 금융위기 때 최저가 9,750원


7. 진로
- 국내 소주시장 1위 업체
- 2011년 현금 배당 보통주 1,500원 우선주 1,550원
- 지난 3년간 최저가 현재 28,350원


또 다른 고배당 관심 종목은 다음과 같다.
http://cn.moneta.co.kr/Service/stock/ShellView.asp?ArticleID=2011081109053400896&LinkID=263&NewsSetID=2141&StockCode=035250&codeName=%B0%AD%BF%F8%B7%A3%B5%E5&wlog_pip=news

Wednesday, August 3, 2011

HYNIX - Memory - 4 GB : 2 x 2 GB - SODIMM 204-pin - DDR3 - 1066 MHz / PC3-8500 - CL7 - 1.5 V - unbuffered - non-ECC



I'm selling 4GB: 2x2GB SODIMM memory which just got out of 2010 Macbook pro. Those have been working great so far. I am sure you can install these memories in your 2010 Macbook pro or any compatible laptops.

HYNIX- Memory - 4 GB : 2 x 2 GB - SODIMM 204-pin - DDR3 - 1066 MHz / PC3-8500 - CL7 - 1.5 V - unbuffered - non-ECC

Manufacturer Part #HMT125S6BFR8C-G7

Technical Specs
ManufacturerHynix
Manufacturer Part No.HMT125S6BFR8C-G7
Memory TypeSODIMM
Capacity2GB
Pins204 Pin
Bus TypePC-8500
Cycle Time1.875ns
CasCL7
Data Transfer Rate1066Mhz
Memory Clock133Mhz
Voltage1.5
ref: http://www.memory4less.com/m4l_itemdetail.aspx?itemId=1442676296&rid=fd_13_2_23_650

SAMSUNG - Memory - 2 GB : 2 x 1 GB - SODIMM 204-pin - DDR3 - 1066 MHz / PC3-8500 - CL7 - 1.5 V - unbuffered - non-ECC





I'm selling 2x1GB SODIMM memory which just got out of 2010 Macbook. Those have been working great so far. I am sure you can install these memories in your 2010 Macbook or any compatible laptops.


SAMSUNG - Memory - 2 GB : 2 x 1 GB - SODIMM 204-pin - DDR3 - 1066 MHz / PC3-8500 - CL7 - 1.5 V - unbuffered - non-ECC


Manufacturer Part #M471B2873EH1-CF8


Technical Specs
ManufacturerSamsung Electronics Co Ltd
Manufacturer Part No.M471B2873EH1-CF8
Memory TypeSODIMM
Capacity1GB
Pins204 Pin
Bus TypePC-8500
Cycle Time1.875ns
CasCL7
Data Transfer Rate1066Mhz
Memory Clock133Mhz
Voltage1.5
ref: http://www.memory4less.com/m4l_itemdetail.aspx?itemId=1442049120&rid=fd_13_2_9_535

Blog Archive