Skip to content

Instantly share code, notes, and snippets.

@bthornto
bthornto / html5url.rb
Created Aug 1, 2015
html5 console connection to a vcenter guest
View html5url.rb
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 Jun 21, 2017
Copy IPSETs from one NSX DFW to another
View ipsets.rb
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