Skip to content

Instantly share code, notes, and snippets.

@radamant
Created October 23, 2013 22:03
Show Gist options
  • Save radamant/7127574 to your computer and use it in GitHub Desktop.
Save radamant/7127574 to your computer and use it in GitHub Desktop.
require 'socket'
def usage
puts 'ruby huemato_client.rb (start|stop|status|party)'
abort
end
command = ARGV[0]
usage unless command
hostname = 'adam.local'
port = 2000
s = TCPSocket.open(hostname, port)
s.puts ARGV[0]
while line = s.gets
puts line
end
s.close
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment