SmartWhois Script

Posted by admin Wed, 03 Jan 2007 15:32: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

Tags , , , ,  | no comments | no trackbacks

Ruby for System Administration

Posted by admin Sat, 23 Dec 2006 05:58:00 GMT

Every now and then I need to hack some scripts together for system administration. Perl is usually my language of choice for such tasks but moving to Ruby lately has found me wanting a good re-usable way to run system commands and capture the output for processing.

Thus I release the humble CbCommand class under the GPL.

It simply uses IO to run the command and capture the output into an array, which can then be processed further.

Tags , , ,  | no comments | no trackbacks