Skip to content

Instantly share code, notes, and snippets.

@kenichi
Created December 11, 2014 00:26
Show Gist options
  • Save kenichi/bc1061294a621c1f7199 to your computer and use it in GitHub Desktop.
Save kenichi/bc1061294a621c1f7199 to your computer and use it in GitHub Desktop.
require 'sinatra/base'
require 'celluloid'
class Nmapper
include Celluloid
def nmap opts = ''
`nmap #{opts}`
end
end
class Nmap < Sinatra::Base
@@nmapper = Nmapper.pool
puts "nmapper size: #{@@nmapper.size}"
get '/nmap' do
content_type :text
@@nmapper.nmap(params[:opts])
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment