Skip to content

Instantly share code, notes, and snippets.

@leejarvis
Created March 27, 2011 12:32
Show Gist options
  • Save leejarvis/889167 to your computer and use it in GitHub Desktop.
Save leejarvis/889167 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
# who the fuck said Ruby couldn't be hacky, NEVER DO THIS IT IS STUPID
require 'socket'
($s = TCPSocket.new(*ARGV.map {|a| Integer(a) rescue a }) rescue nil) or 'Usage: fail <server> <port>'
def w(*a); $s.write a.join("\r\n") + "\r\n"; end; w 'NICK asdf', "USER #{'asdf' * 3} :asdf"
until $s.eof?; $s.gets[/PING :(.+)/] && w('PONG ' + $1); end
@shurizzle
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment