Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

unix - expect script freezes when called from Ruby -


i've list of hosts on need install public key. purpose, i've written ruby script calls expect script , passes password, host name , public key file. expect script in turn performs ssh-copy-id each host, feeding in password , answering "yes" unknown host keys.

the expect script works absolutely fine when run command line. when executed ruby script, expect fails answer "yes" unknown host key confirmation : "are sure want continue connecting (yes/no)?". expect script freezes when yes/no question thrown it.

any appreciated.

here ruby script :

#!/usr/bin/env ruby -w  hosts=['test@blah1.edu','test2@blah2.edu','test3@blah3.edu'] password="blahblahblah" key_file="/home/blah/.ssh/id_rsa.pub"  hosts.each{ |host|    command="expect sshcopy.exp #{host} #{key_file} #{password}"   `#{command}` } 

and here expect script sshcopy.exp :

set host [lrange $argv 0 0] set key_file [lrange $argv 1 1] set password [lrange $argv 2 2] spawn  ssh-copy-id -i $key_file $host expect -nocase "*password: $" {send "$password\r"; interact}  -nocase "*are sure want continue connecting (yes/no)? $" {send "yes\r"}  eof{exit} expect -nocase "*password: $" {send "$password\r"; interact} eof{exit} 

you see 2 expect statements above. first statement handles case when password asked (i.e. host key known) interacting immediately. handles case when unknown host identified, answering "yes".

the second expect statement executed when first expect answered "yes" leading password being asked.

i imagine problem call expect script `backticks` expect script interacts. seems ruby backticks don't allow full interaction (blocking stdin perhaps). might want investigate ruby's expect module , away separate expect script.


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -