Posted by Chris Blackburn Wed, 03 Jan 2007 06:00:00 GMT

I’ve used SmartWhois at all-nettools.com for years. It is usually very fast and returns pertinent data, yet leaving out the normal ARPA registration junk that I don’t often care about.

Here is a Ruby script that will post an IP address to the online tool and parse the results for the command line, showing information about the party that owns the particular IP being searched. It will also accept hostnames.

You’ll need Hpricot and hpricot_helper.rb along with some other standards.

You can script it using a list of ip addresses like this:

cat iplist | while read ip; do
    ./smartwhois.rb $ip
done

Enjoy

Posted by Chris Blackburn Tue, 28 Apr 2009 05:00:00 GMT

Thought I had posted this last year but can’t seem to find it, so here it is again:

#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../../config/boot'

# Restart Applicable Passenger Instance
filename = "#{RAILS_ROOT}/tmp/restart.txt"
File.open(filename, 'w') {|f| f.write('restart passenger') }

Save this file as: ./scripts/process/reaper, then deploy and it will restart your passenger instance.