Re: comparing two IP addresses and the underlying machine

2006-12-12 Thread Ratko Jagodic

By the same physical machine I meant one OS using two interfaces and
multiple IP addresses mapped to different interfaces. I figured there
wouldn't be a direct solution to this so each time I will send all IP
addresses to the "match maker" so I can make comparisons and that should
work. Thanks for the help.

Ratko


On 12/12/06, Tim Chase <[EMAIL PROTECTED]> wrote:


> I've been trying to figure this one out for some time but
> with no success.  I have a machine with two network
> interfaces, each with their own IP address and it's own
> domain, for example:
> - ipA on machineA.domainA
> - ipB on machineB.domainB
>
> Given any pair of IPs or hostnames (or a mix of them), how
> can I figure whether they belong to the same physical
> machine or not? Of course, this is trivial if my python
> program is running the given machine but what if a remote
> machine is trying to figure this out (but that machine has
> access to both domains/IPs).
> Appreciate and ideas.


I have a feeling that you're trying to attempt the
impossible.  What do you mean by "the same physical
machine"?  The same case?  What happens if there are two
virtual OSes on the machine, each using its own NIC?

Unless you have a client application running on "the
physical machine" that can respond to queries on each NIC,
you're pretty much out of luck.  You could write something
like a "same_ping" program that would listen on both NICs,
and respond with a "yeah, I'm the same machine"
confirmation.  There are all sorts of ways to do this,
depending on how sure you need to be that nobody can spoof
it...ranging from simple "here's a random number on one IP
address followed by asking the other IP if it's seen that
random number before" to having the physical machine sign
one request on each port and confirm that their signatures
are the same.

-tkc





-- 
http://mail.python.org/mailman/listinfo/python-list

comparing two IP addresses and the underlying machine

2006-12-11 Thread Ratko Jagodic

Hi all,

I've been trying to figure this one out for some time but with no success.
I have a machine with two network interfaces, each with their own IP address
and it's own domain, for example:
- ipA on machineA.domainA
- ipB on machineB.domainB

Given any pair of IPs or hostnames (or a mix of them), how can I figure
whether they belong to the same physical machine or not? Of course, this is
trivial if my python program is running the given machine but what if a
remote machine is trying to figure this out (but that machine has access to
both domains/IPs).
Appreciate and ideas.

Ratko
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: inserting into a list

2006-03-07 Thread Ratko Jagodic
from the Library Reference:s.insert(i, x)
same as s[i:i] = [x]
(5)On 3/7/06, John Salerno <[EMAIL PROTECTED]
> wrote:Let me apologize in advance for what I'm sure is an achingly simple
question, but I just can't find the answer in either of my Python books.I've tried a few tests with the interactive prompt, but they don't workeither.All I'm trying to do is insert an item into a list, like so:
L = [1, 2, 4]and I want to insert the integer 3 into the position L[2], so that thelist reads [1, 2, 3, 4]I've tried all kinds of combinations of slicing assignment, but I alwaysget:
TypeError: can only assign an iterableCan someone please embarrass me with the simple answer?  :)--http://mail.python.org/mailman/listinfo/python-list

-- 
http://mail.python.org/mailman/listinfo/python-list

Re: What version of python is running a script

2006-03-07 Thread Ratko Jagodic
import syssys.version yields something like:2.3.4 (#53, May 25 2004, 21:17:02) [MSC v.1200 32 bit (Intel)]On 3/7/06, Fernando Rodríguez
 <[EMAIL PROTECTED]> wrote:Hi,
How can my script tell which version of python is running it?Thanks--http://mail.python.org/mailman/listinfo/python-list

-- 
http://mail.python.org/mailman/listinfo/python-list

figuring out how much data was sent so far via XML-RPC?

2006-03-06 Thread Ratko Jagodic
I am currently using XML-RPC for a very convenient quick-and-dirty way of sending some files (base64 encoded).
The files can be bigger sometimes (10-20mb) and I was wondering if
there is a way to see how much data was sent already and how much still
needs to be sent (like a progress bar). I would of course need that
only on the client side. I know how I would do it with pure sockets but
I am not sure how could I get to that lower level with xmlrpclib...

I am using xmlrpclib.ServerProxy for the client and a
SimpleXMLRPCServer. It would also be great if I could keep the solution
(if it exists) within the standard python library (no extra modules)
because I am distributing this to other people.

Thanks in advance!
Ratko

-- 
http://mail.python.org/mailman/listinfo/python-list