[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

I love net/ssh library

weber

1/30/2007 9:20:00 PM

I just wish i had discovered this earlier - i can automate so much
stuff now :D

# Syncronize my winxp clock with server's
require 'rubygems'
require 'net/ssh'

Net::SSH.start( 'servidor', 'hugo' ) do |session|
input, output, error = session.process.popen3( "date +%H:%M:%S" )
exec "time " + output.read
end

1 Answer

hemant

2/1/2007 2:21:00 PM

0

On Wed, 2007-01-31 at 06:20 +0900, haws wrote:
> I just wish i had discovered this earlier - i can automate so much
> stuff now :D
>
> # Syncronize my winxp clock with server's
> require 'rubygems'
> require 'net/ssh'
>
> Net::SSH.start( 'servidor', 'hugo' ) do |session|
> input, output, error = session.process.popen3( "date +%H:%M:%S" )
> exec "time " + output.read
> end
>
>

Read Capistrano code for hackery on this.