Skip to content

Instantly share code, notes, and snippets.

@bthornto
bthornto / html5url.rb
Created August 1, 2015 17:55
html5 console connection to a vcenter guest
require 'rbvmomi'
require 'pry-byebug'
require 'socket'
require 'openssl'
require 'digest/sha1'
require 'io/console'
def get_thumbprint(vc)
ssl_context = OpenSSL::SSL::SSLContext.new
tcp_client = TCPSocket.new vc, 443
@bthornto
bthornto / ipsets.rb
Last active June 21, 2017 15:23
Copy IPSETs from one NSX DFW to another
require 'curb'
require 'pp'
require 'json'
require 'active_support/all'
def curl(u,p,url,action,xml="")
c = Curl::Easy.new(url)
c.http_auth_types = :basic
c.username = u
c.password = p