Skip to content

Instantly share code, notes, and snippets.

@csexton
Forked from cupakromer/README.md
Created February 20, 2013 01:51
Show Gist options
  • Save csexton/4992036 to your computer and use it in GitHub Desktop.
Save csexton/4992036 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'pty'
interface = 'en0'
cmd = %W[tshark -i #{interface} -R http -T fields -e wlan.sa -e http.user_agent]
cmd = "yes"
begin
PTY.spawn( cmd ) do |r, w, pid|
while true
r.each do |line|
# Process dat line
puts line
end
end
end
rescue PTY::ChildExited => e
puts 'OMGWTFBBQ'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment