Skip to content

Instantly share code, notes, and snippets.

@okeen
Created August 9, 2013 08:49
Show Gist options
  • Save okeen/6192137 to your computer and use it in GitHub Desktop.
Save okeen/6192137 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'net/ssh/gateway'
begin
archi_gateway = Net::SSH::Gateway.new('app.archisnapper.com', 'zorros')
p1 = archi_gateway.open('127.0.0.1', 3306, 3307)
safety_gateway = Net::SSH::Gateway.new('app.safetysnapper.com', 'zorros')
p2 = safety_gateway.open('127.0.0.1', 3306, 3308)
puts "Opened gateways on port: #{p1},#{p2}"
rescue
puts "Could not establish SSH tunnel, possibly already open"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment