Re: How to tell IP address of remote machine?



On Sun, Oct 25, 2009 at 3:32 PM, Bruno Wolff III <bruno@xxxxxxxx> wrote:

On Sun, Oct 25, 2009 at 14:17:48 +0000,
Timothy Murphy <gayleard@xxxxxxxxxx> wrote:
Sam Varshavchik wrote:

I had a little program which I ran each day
as a cron job to mail me the IP address of a machine
in a different country.
...
In any case, the program has ceased to work
because the site heliohost seems to have gone off-line.

You don't need to use any site. The sender's IP address will be
recorded
in the test message's headers.

Thanks very much for that suggestion.
I've looked at KMail showing all headers,
and there are a couple of IP addresses which could be the correct ones:

If your mail is going through the ISPs mail server, then it could
potentially
do things that make it hard to get the IP address you want.

You could note other kinds of direct connections to your machine. For
example
you could note http connections to a url at your machine that isn't
published or discoverable.



If the game is not to use any external server, then
you can use your own computer to ping back the address.
Just install an script in /var/www/cgi-bin/ in your local computer and
call ipget.pl from your remote computer. Then, you can email
your external IP to wherever you want:

#!/usr/bin/perl -wT
# ipget.pl- the script that retrieves your IP for you. Run this on the box
# whose IP you want to figure out. You can make this part of a larger
program,
# obviously.
use LWP::Simple;
$numArgs = $#ARGV + 1;
# print "$numArgs arguments.\n";
if ($numArgs == 0) {
print "using server1: ";
$host = "http://external-computer1-name/cgi-bin/ipreport.cgi";;
}
else {
print "using server2: ";
$host = "http://external-computer2-name/cgi-bin/ipreport.cgi";;
}
my $ip=get($host);
print $ip;

-----------------------------------------------------

#!/usr/bin/perl -wT
# ipreport.cgi- the script that sits external to your router
use strict;
use CGI;
my $q=CGI->new();
print $q->header().$q->remote_addr()."\n";


--
Paulo Roma Cavalcanti
LCG - UFRJ
--
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines

Relevant Pages

  • Re: convert FAT32 to NTFS problem?
    ... sDiskLetter = obiLogicalDisk.DeviceID ... >>> Your script is always launching convert.exe on the local machine. ... >>> script connects to the remote computer using WMI, and gets the drives of the ...
    (microsoft.public.scripting.vbscript)
  • Re: What permission(s) am I missing?
    ... of without success. ... > For the most part it doesn't matter which OS you're running the script on, ... > changed the permissions from the defaults on the remote computer. ... >> Administrators group missing and where can I change it? ...
    (microsoft.public.scripting.vbscript)
  • Re: EvfMgr C: -commit followed by Power Down gives lost changes
    ... > a little utility on this PC is started from a remote computer. ... > a script and connects to an external WebServer to fetch the new software. ... > This might include running a script that modifies Registry, deletes files, ... ... They turn off the power. ...
    (microsoft.public.windowsxp.embedded)
  • Re: Script Needed
    ... One thought is to have the worker script (the script that runs on the remote computer) save a text file on the desktop. ... I already tried WMI and the processes it runs remotely also are not visible to any users that happen to be logged on. ... messaging service to be turned on, and will not pay for a 3rd party app. ...
    (microsoft.public.scripting.vbscript)