Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

IO.pl

by giulia (Scribe)
on Apr 07, 2005 at 18:29 UTC ( [id://445825]=sourcecode: print w/replies, xml ) Need Help??
Category: Networking Code
Author/Contact Info giulia aka the_enigma (giulia@olografix.org)
Description: This script convert an ip (or url) into a 32 bit adress.
#!/usr/bin/perl

###################################
#                                 #
#  IpObscurating.pl --> by giulia #
#                                 #
###################################

# This script convert an ip (or url) into a 32 bit adress.
# To use a 32 bit adress on your server you have to modify
# /var/www/conf/httpd.conf in order to add a new virtual host.
#
# Example:
# <VirtualHost *ip-server*>
#    ServerAdmin *your-mail*
#    DocumentRoot /var/www/users/*your user*
#    ServerName *32 bit adress*
#    ErrorLog *logs/user-error_log*
#    CustomLog *logs/user-access_log common*
# </VirtualHost>
#
# For more informations go to +mala's website (http://3564020356.org/)
# and solve his first riddle to be allowed to read his beautifull
# tutorial "What kind of address is this?".

$ip = $ARGV[0];

if(@ARGV == 1) {

if($ip =~ m /\.\D/) {
use Socket;
$ip=inet_ntoa((gethostbyname($ip))[4]);
}

@div = split(/\./, $ip);
$ip = ($div[0]*16777216)+($div[1]*65536)+($div[2]*256)+$div[3];
print "$ip";}

else {print "Usage: perl IO.pl <ip-host>";}

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: sourcecode [id://445825]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2024-04-18 03:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found