Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require'net/ssh'
- q = Queue.new
- Thread.start{
- # Net::SSH.start("xxx.xxx.xxx.xxx", "username", :password=>"password"){|ssh|
- exeCommand = "gdb ~/work/a.out"
- ssh.exec(exeCommand){|channel, success|
- raise "failed to execute command [#{exeCommand}]" unless success
- q.push "connect success"
- channel.on_data{|c,data|
- q.push data
- }
- ssh.loop
- }
- }
- }
- loop{
- puts q.pop
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement