<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments for Martin Falatic’s Techno Blog</title>
	<atom:link href="http://www.falatic.com/index.php/comments/feed" rel="self" type="application/rss+xml" />
	<link>http://www.falatic.com</link>
	<description>Technobabble...</description>
	<lastBuildDate>Thu, 02 Feb 2012 08:52:54 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>Comment on Problems updating/installing samba4 in Ubuntu 11.04? Read here! by Martin Falatic</title>
		<link>http://www.falatic.com/index.php/29/problems-with-samba4-when-updating-from-ubuntu-10-10-to-11-04/comment-page-1#comment-4377</link>
		<dc:creator>Martin Falatic</dc:creator>
		<pubDate>Thu, 02 Feb 2012 08:52:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.falatic.com/?p=29#comment-4377</guid>
		<description>No ideas unfortunately...</description>
		<content:encoded><![CDATA[<p>No ideas unfortunately&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Pinging with Python by ShadowX</title>
		<link>http://www.falatic.com/index.php/39/pinging-with-python/comment-page-1#comment-4346</link>
		<dc:creator>ShadowX</dc:creator>
		<pubDate>Fri, 27 Jan 2012 13:11:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.falatic.com/?p=39#comment-4346</guid>
		<description>I&#039;ve forked the github project, you can check out the changes here:
https://github.com/l4m3rx/python-ping</description>
		<content:encoded><![CDATA[<p>I&#8217;ve forked the github project, you can check out the changes here:<br />
<a href="https://github.com/l4m3rx/python-ping" rel="nofollow">https://github.com/l4m3rx/python-ping</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Pinging with Python by ShadowX</title>
		<link>http://www.falatic.com/index.php/39/pinging-with-python/comment-page-1#comment-4345</link>
		<dc:creator>ShadowX</dc:creator>
		<pubDate>Fri, 27 Jan 2012 09:08:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.falatic.com/?p=39#comment-4345</guid>
		<description>Hey :) i&#039;ve made some changes to the code... 
    * Fixing BUG #4 - competability with python 2.x [tested with 2.7]
      - Packet data building is different for 2.x and 3.x.
        &#039;cose of the string/bytes difference.
    * Fixing BUG #10 - the multiple resolv issue.
      - When pinging domain names insted of hosts (for exmaple google.com)
        you can get different IP every time you try to resolv it, we should
        resolv the host only once and stick to that IP.
    * Fixing BUGs #3 #10 - Doing hostname resolv only once.
    * Fixing BUG #14 - Removing all &#039;global&#039; stuff.
        - You should not use globul! Its bad for you...and its not thread safe!
    * Fix - forcing the use of different times on linux/windows for
            more accurate mesurments. (time.time - linux/ time.clock - windows)
    * Adding quiet_ping function - This way we&#039;ll be able to use this script
        as external lib.
    * Changing default timeout to 3s. (1second is not enought)
    * Switching data syze to packet size. It&#039;s easyer for the user to ignore the
        fact that the packet headr is 8b and the datasize 64 will make packet with
        size 72.


Here&#039;s the full source.


&lt;code&gt;
#!/usr/bin/env python
# -*- coding: utf-8 -*-

&quot;&quot;&quot;
    A pure python ping implementation using raw sockets.

    (This is Python 3 port of https://github.com/jedie/python-ping)
    (Tested and working with python 2.7, should work with 2.6+)

    Note that ICMP messages can only be sent from processes running as root
    (in Windows, you must run this script as &#039;Administrator&#039;).

    Derived from ping.c distributed in Linux&#039;s netkit. That code is
    copyright (c) 1989 by The Regents of the University of California.
    That code is in turn derived from code written by Mike Muuss of the
    US Army Ballistic Research Laboratory in December, 1983 and
    placed in the public domain. They have my thanks.

    Bugs are naturally mine. I&#039;d be glad to hear about them. There are
    certainly word - size dependencies here.

    Copyright (c) Matthew Dixon Cowles, .
    Distributable under the terms of the GNU General Public License
    version 2. Provided with no warranties of any sort.

    Original Version from Matthew Dixon Cowles:
      -&gt; ftp://ftp.visi.com/users/mdc/ping.py

    Rewrite by Jens Diemer:
      -&gt; http://www.python-forum.de/post-69122.html#69122

    Rewrite by George Notaras:
      -&gt; http://www.g-loaded.eu/2009/10/30/python-ping/

    Enhancements by Martin Falatic:
      -&gt; http://www.falatic.com/index.php/39/pinging-with-python

    Enhancements and fixes by Georgi Kolev:
      -&gt; http://github.com/jedie/python-ping/

    Revision history
    ~~~~~~~~~~~~~~~~

    January 26, 2012
    ----------------
    * Fixing BUG #4 - competability with python 2.x [tested with 2.7]
      - Packet data building is different for 2.x and 3.x.
        &#039;cose of the string/bytes difference.
    * Fixing BUG #10 - the multiple resolv issue.
      - When pinging domain names insted of hosts (for exmaple google.com)
        you can get different IP every time you try to resolv it, we should
        resolv the host only once and stick to that IP.
    * Fixing BUGs #3 #10 - Doing hostname resolv only once.
    * Fixing BUG #14 - Removing all &#039;global&#039; stuff.
        - You should not use globul! Its bad for you...and its not thread safe!
    * Fix - forcing the use of different times on linux/windows for
            more accurate mesurments. (time.time - linux/ time.clock - windows)
    * Adding quiet_ping function - This way we&#039;ll be able to use this script
        as external lib.
    * Changing default timeout to 3s. (1second is not enought)
    * Switching data syze to packet size. It&#039;s easyer for the user to ignore the
        fact that the packet headr is 8b and the datasize 64 will make packet with
        size 72.

    October 12, 2011
    --------------
    Merged updates from the main project
      -&gt; https://github.com/jedie/python-ping

    September 12, 2011
    --------------
    Bugfixes + cleanup by Jens Diemer
    Tested with Ubuntu + Windows 7

    September 6, 2011
    --------------
    Cleanup by Martin Falatic. Restored lost comments and docs. Improved
    functionality: constant time between pings, internal times consistently
    use milliseconds. Clarified annotations (e.g., in the checksum routine).
    Using unsigned data in IP &amp; ICMP header pack/unpack unless otherwise
    necessary. Signal handling. Ping-style output formatting and stats.

    August 3, 2011
    --------------
    Ported to py3k by Zach Ware. Mostly done by 2to3; also minor changes to
    deal with bytes vs. string changes (no more ord() in checksum() because
    &gt;source_string http://tools.ietf.org/html/rfc791)

    0                   1                   2                   3
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    &#124;Version&#124;  IHL  &#124;Type of Service&#124;          Total Length         &#124;
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    &#124;         Identification        &#124;Flags&#124;      Fragment Offset    &#124;
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    &#124;  Time to Live &#124;    Protocol   &#124;         Header Checksum       &#124;
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    &#124;                       Source Address                          &#124;
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    &#124;                    Destination Address                        &#124;
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    &#124;                    Options                    &#124;    Padding    &#124;
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

    ===========================================================================
    ICMP Echo / Echo Reply Message header info from RFC792
      -&gt; http://tools.ietf.org/html/rfc792

        0                   1                   2                   3
        0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
        &#124;     Type      &#124;     Code      &#124;          Checksum             &#124;
        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
        &#124;           Identifier          &#124;        Sequence Number        &#124;
        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
        &#124;     Data ...
        +-+-+-+-+-

    ===========================================================================
    ICMP parameter info:
      -&gt; http://www.iana.org/assignments/icmp-parameters/icmp-parameters.xml

    ===========================================================================
    An example of ping&#039;s typical output:

    PING heise.de (193.99.144.80): 56 data bytes
    64 bytes from 193.99.144.80: icmp_seq=0 ttl=240 time=127 ms
    64 bytes from 193.99.144.80: icmp_seq=1 ttl=240 time=127 ms
    64 bytes from 193.99.144.80: icmp_seq=2 ttl=240 time=126 ms
    64 bytes from 193.99.144.80: icmp_seq=3 ttl=240 time=126 ms
    64 bytes from 193.99.144.80: icmp_seq=4 ttl=240 time=127 ms

    ----heise.de PING Statistics----
    5 packets transmitted, 5 packets received, 0.0% packet loss
    round-trip (ms)  min/avg/max/med = 126/127/127/127

    ===========================================================================
&quot;&quot;&quot;

#=============================================================================#
import os, sys, socket, struct, select, time, signal

if sys.platform == &quot;win32&quot;:
    # On Windows, the best timer is time.clock()
    default_timer = time.clock
else:
    # On most other platforms the best timer is time.time()
    default_timer = time.time

#=============================================================================#
# ICMP parameters

ICMP_ECHOREPLY  =    0 # Echo reply (per RFC792)
ICMP_ECHO       =    8 # Echo request (per RFC792)
ICMP_MAX_RECV   = 2048 # Max size of incoming buffer

MAX_SLEEP = 1000

class MyStats:
    thisIP   = &quot;0.0.0.0&quot;
    pktsSent = 0
    pktsRcvd = 0
    minTime  = 999999999
    maxTime  = 0
    totTime  = 0
    avrgTime = 0
    fracLoss = 1.0

myStats = MyStats # NOT Used globally anymore.

#=============================================================================#
def checksum(source_string):
    &quot;&quot;&quot;
    A port of the functionality of in_cksum() from ping.c
    Ideally this would act on the string as a series of 16-bit ints (host
    packed), but this works.
    Network data is big-endian, hosts are typically little-endian
    &quot;&quot;&quot;
    countTo = (int(len(source_string)/2))*2
    sum = 0
    count = 0

    # Handle bytes in pairs (decoding as short ints)
    loByte = 0
    hiByte = 0
    while count &lt; countTo:
        if (sys.byteorder == &quot;little&quot;):
            loByte = source_string[count]
            hiByte = source_string[count + 1]
        else:
            loByte = source_string[count + 1]
            hiByte = source_string[count]
        try:     # For Python3
            sum = sum + (hiByte * 256 + loByte)
        except:  # For Python2
            sum = sum + (ord(hiByte) * 256 + ord(loByte))
        count += 2

    # Handle last byte if applicable (odd-number of bytes)
    # Endianness should be irrelevant in this case
    if countTo &gt; 16) + (sum &amp; 0xffff)    # Add high 16 bits to low 16 bits
    sum += (sum &gt;&gt; 16)                    # Add carry from above (if any)
    answer = ~sum &amp; 0xffff                # Invert and truncate to 16 bits
    answer = socket.htons(answer)

    return answer

#=============================================================================#
def do_one(myStats, destIP, hostname, timeout, mySeqNumber, numDataBytes, quiet = False):
    &quot;&quot;&quot;
    Returns either the delay (in ms) or None on timeout.
    &quot;&quot;&quot;
    delay = None

    try: # One could use UDP here, but it&#039;s obscure
        mySocket = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.getprotobyname(&quot;icmp&quot;))
    except socket.error as e:
        print(&quot;failed. (socket error: &#039;%s&#039;)&quot; % e.args[1])
        raise # raise the original error

    my_ID = os.getpid() &amp; 0xFFFF

    sentTime = send_one_ping(mySocket, destIP, my_ID, mySeqNumber, numDataBytes)
    if sentTime == None:
        mySocket.close()
        return delay

    myStats.pktsSent += 1

    recvTime, dataSize, iphSrcIP, icmpSeqNumber, iphTTL = receive_one_ping(mySocket, my_ID, timeout)

    mySocket.close()

    if recvTime:
        delay = (recvTime-sentTime)*1000
        if not quiet:
            print(&quot;%d bytes from %s: icmp_seq=%d ttl=%d time=%d ms&quot; % (
                dataSize, socket.inet_ntoa(struct.pack(&quot;!I&quot;, iphSrcIP)), icmpSeqNumber, iphTTL, delay)
            )
        myStats.pktsRcvd += 1
        myStats.totTime += delay
        if myStats.minTime &gt; delay:
            myStats.minTime = delay
        if myStats.maxTime destIP&lt;.
    &quot;&quot;&quot;
    #destIP  =  socket.gethostbyname(destIP)

    # Header is type (8), code (8), checksum (16), id (16), sequence (16)
    # (numDataBytes - 8) - Remove header size from packet size
    myChecksum = 0

    # Make a dummy heder with a 0 checksum.
    header = struct.pack(
        &quot;!BBHHH&quot;, ICMP_ECHO, 0, myChecksum, myID, mySeqNumber
    )

    padBytes = []
    startVal = 0x42
    # &#039;cose of the string/byte changes in python 2/3 we have
    # to build the data differnely for different version
    # or it will make packets with unexpected size.
    if sys.version[:1] == &#039;2&#039;:
        bytes = struct.calcsize(&quot;d&quot;)
        data = ((numDataBytes - 8) - bytes) * &quot;Q&quot;
        data = struct.pack(&quot;d&quot;, default_timer()) + data
    else:
        for i in range(startVal, startVal + (numDataBytes-8)):
            padBytes += [(i &amp; 0xff)]  # Keep chars in the 0-255 range
        #data = bytes(padBytes)
        data = bytearray(padBytes)


    # Calculate the checksum on the data and the dummy header.
    myChecksum = checksum(header + data) # Checksum is in network order

    # Now that we have the right checksum, we put that in. It&#039;s just easier
    # to make up a new header than to stuff it into the dummy.
    header = struct.pack(
        &quot;!BBHHH&quot;, ICMP_ECHO, 0, myChecksum, myID, mySeqNumber
    )

    packet = header + data

    sendTime = default_timer()

    try:
        mySocket.sendto(packet, (destIP, 1)) # Port number is irrelevant for ICMP
    except socket.error as e:
        print(&quot;General failure (%s)&quot; % (e.args[1]))
        return

    return sendTime

#=============================================================================#
def receive_one_ping(mySocket, myID, timeout):
    &quot;&quot;&quot;
    Receive the ping from the socket. Timeout = in ms
    &quot;&quot;&quot;
    timeLeft = timeout/1000

    while True: # Loop while waiting for packet or timeout
        startedSelect = default_timer()
        whatReady = select.select([mySocket], [], [], timeLeft)
        howLongInSelect = (default_timer() - startedSelect)
        if whatReady[0] == []: # Timeout
            return None, 0, 0, 0, 0

        timeReceived = default_timer()

        recPacket, addr = mySocket.recvfrom(ICMP_MAX_RECV)

        ipHeader = recPacket[:20]
        iphVersion, iphTypeOfSvc, iphLength, \
        iphID, iphFlags, iphTTL, iphProtocol, \
        iphChecksum, iphSrcIP, iphDestIP = struct.unpack(
            &quot;!BBHHHBBHII&quot;, ipHeader
        )

        icmpHeader = recPacket[20:28]
        icmpType, icmpCode, icmpChecksum, \
        icmpPacketID, icmpSeqNumber = struct.unpack(
            &quot;!BBHHH&quot;, icmpHeader
        )

        if icmpPacketID == myID: # Our packet
            dataSize = len(recPacket) - 28
            #print (len(recPacket.encode()))
            return timeReceived, (dataSize+8), iphSrcIP, icmpSeqNumber, iphTTL

        timeLeft = timeLeft - howLongInSelect
        if timeLeft  0:
        myStats.fracLoss = (myStats.pktsSent - myStats.pktsRcvd)/myStats.pktsSent

    print(&quot;%d packets transmitted, %d packets received, %0.1f%% packet loss&quot; % (
        myStats.pktsSent, myStats.pktsRcvd, 100.0 * myStats.fracLoss
    ))

    if myStats.pktsRcvd &gt; 0:
        print(&quot;round-trip (ms)  min/avg/max = %d/%0.1f/%d&quot; % (
            myStats.minTime, myStats.totTime/myStats.pktsRcvd, myStats.maxTime
        ))

    print(&quot;&quot;)
    return

#=============================================================================#
def signal_handler(signum, frame):
    &quot;&quot;&quot;
    Handle exit via signals
    &quot;&quot;&quot;
    dump_stats()
    print(&quot;\n(Terminated with signal %d)\n&quot; % (signum))
    sys.exit(0)

#=============================================================================#
def verbose_ping(hostname, timeout = 3000, count = 3,
                     numDataBytes = 64, path_finder = False):
    &quot;&quot;&quot;
    Send &gt;countdestIPtimeout delay):
            time.sleep((MAX_SLEEP - delay)/1000)

    dump_stats(myStats)

#=============================================================================#
def quiet_ping(hostname, timeout = 3000, count = 3,
                     numDataBytes = 64, path_finder = False):
    &quot;&quot;&quot;
    Same as verbose_ping, but the results are returned as tuple
    &quot;&quot;&quot;
    myStats = MyStats() # Reset the stats
    mySeqNumber = 0 # Starting value

    try:
        destIP = socket.gethostbyname(hostname)
    except socket.gaierror as e:
        return False

    myStats.thisIP = destIP

    # This will send packet that we dont care about 0.5 seconds before it starts
    # acrutally pinging. This is needed in big MAN/LAN networks where you sometimes
    # loose the first packet. (while the switches find the way... :/ )
    if path_finder:
        fakeStats = MyStats()
        do_one(fakeStats, destIP, hostname, timeout,
                        mySeqNumber, numDataBytes, quiet=True)
        time.sleep(0.5)

    for i in range(count):
        delay = do_one(myStats, destIP, hostname, timeout,
                        mySeqNumber, numDataBytes, quiet=True)

        if delay == None:
            delay = 0

        mySeqNumber += 1

        # Pause for the remainder of the MAX_SLEEP period (if applicable)
        if (MAX_SLEEP &gt; delay):
            time.sleep((MAX_SLEEP - delay)/1000)

    if myStats.pktsSent &gt; 0:
        myStats.fracLoss = (myStats.pktsSent - myStats.pktsRcvd)/myStats.pktsSent
    myStats.avrgTime = myStats.totTime / myStats.pktsRcvd

    # return tuple(max_rtt, min_rtt, avrg_rtt, percent_lost)
    return myStats.maxTime, myStats.minTime, myStats.avrgTime, myStats.fracLoss

#=============================================================================#
if __name__ == &#039;__main__&#039;:

    # These should work:
    verbose_ping(&quot;8.8.8.8&quot;)
    verbose_ping(&quot;heise.de&quot;)
    verbose_ping(&quot;google.com&quot;)

    # Inconsistent on Windows w/ ActivePython (Python 3.2 resolves correctly
    # to the local host, but 2.7 tries to resolve to the local *gateway*)
    verbose_ping(&quot;localhost&quot;)

    # Should fail with &#039;getaddrinfo failed&#039;:
    verbose_ping(&quot;foobar_url.foobar&quot;)

    # Should fail (timeout), but it depends on the local network:
    verbose_ping(&quot;192.168.255.254&quot;)

    # Should fails with &#039;The requested address is not valid in its context&#039;:
    verbose_ping(&quot;0.0.0.0&quot;)

&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Hey <img src='http://www.falatic.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  i&#8217;ve made some changes to the code&#8230;<br />
    * Fixing BUG #4 &#8211; competability with python 2.x [tested with 2.7]<br />
      &#8211; Packet data building is different for 2.x and 3.x.<br />
        &#8216;cose of the string/bytes difference.<br />
    * Fixing BUG #10 &#8211; the multiple resolv issue.<br />
      &#8211; When pinging domain names insted of hosts (for exmaple google.com)<br />
        you can get different IP every time you try to resolv it, we should<br />
        resolv the host only once and stick to that IP.<br />
    * Fixing BUGs #3 #10 &#8211; Doing hostname resolv only once.<br />
    * Fixing BUG #14 &#8211; Removing all &#8216;global&#8217; stuff.<br />
        &#8211; You should not use globul! Its bad for you&#8230;and its not thread safe!<br />
    * Fix &#8211; forcing the use of different times on linux/windows for<br />
            more accurate mesurments. (time.time &#8211; linux/ time.clock &#8211; windows)<br />
    * Adding quiet_ping function &#8211; This way we&#8217;ll be able to use this script<br />
        as external lib.<br />
    * Changing default timeout to 3s. (1second is not enought)<br />
    * Switching data syze to packet size. It&#8217;s easyer for the user to ignore the<br />
        fact that the packet headr is 8b and the datasize 64 will make packet with<br />
        size 72.</p>
<p>Here&#8217;s the full source.</p>
<p><code><br />
#!/usr/bin/env python<br />
# -*- coding: utf-8 -*-</p>
<p>"""<br />
    A pure python ping implementation using raw sockets.</p>
<p>    (This is Python 3 port of <a href="https://github.com/jedie/python-ping" rel="nofollow">https://github.com/jedie/python-ping</a>)<br />
    (Tested and working with python 2.7, should work with 2.6+)</p>
<p>    Note that ICMP messages can only be sent from processes running as root<br />
    (in Windows, you must run this script as 'Administrator').</p>
<p>    Derived from ping.c distributed in Linux's netkit. That code is<br />
    copyright (c) 1989 by The Regents of the University of California.<br />
    That code is in turn derived from code written by Mike Muuss of the<br />
    US Army Ballistic Research Laboratory in December, 1983 and<br />
    placed in the public domain. They have my thanks.</p>
<p>    Bugs are naturally mine. I'd be glad to hear about them. There are<br />
    certainly word - size dependencies here.</p>
<p>    Copyright (c) Matthew Dixon Cowles, .<br />
    Distributable under the terms of the GNU General Public License<br />
    version 2. Provided with no warranties of any sort.</p>
<p>    Original Version from Matthew Dixon Cowles:<br />
      -&gt; <a href="ftp://ftp.visi.com/users/mdc/ping.py" rel="nofollow">ftp://ftp.visi.com/users/mdc/ping.py</a></p>
<p>    Rewrite by Jens Diemer:<br />
      -&gt; <a href="http://www.python-forum.de/post-69122.html#69122" rel="nofollow">http://www.python-forum.de/post-69122.html#69122</a></p>
<p>    Rewrite by George Notaras:<br />
      -&gt; <a href="http://www.g-loaded.eu/2009/10/30/python-ping/" rel="nofollow">http://www.g-loaded.eu/2009/10/30/python-ping/</a></p>
<p>    Enhancements by Martin Falatic:<br />
      -&gt; <a href="http://www.falatic.com/index.php/39/pinging-with-python" rel="nofollow">http://www.falatic.com/index.php/39/pinging-with-python</a></p>
<p>    Enhancements and fixes by Georgi Kolev:<br />
      -&gt; <a href="http://github.com/jedie/python-ping/" rel="nofollow">http://github.com/jedie/python-ping/</a></p>
<p>    Revision history<br />
    ~~~~~~~~~~~~~~~~</p>
<p>    January 26, 2012<br />
    ----------------<br />
    * Fixing BUG #4 - competability with python 2.x [tested with 2.7]<br />
      - Packet data building is different for 2.x and 3.x.<br />
        'cose of the string/bytes difference.<br />
    * Fixing BUG #10 - the multiple resolv issue.<br />
      - When pinging domain names insted of hosts (for exmaple google.com)<br />
        you can get different IP every time you try to resolv it, we should<br />
        resolv the host only once and stick to that IP.<br />
    * Fixing BUGs #3 #10 - Doing hostname resolv only once.<br />
    * Fixing BUG #14 - Removing all 'global' stuff.<br />
        - You should not use globul! Its bad for you...and its not thread safe!<br />
    * Fix - forcing the use of different times on linux/windows for<br />
            more accurate mesurments. (time.time - linux/ time.clock - windows)<br />
    * Adding quiet_ping function - This way we'll be able to use this script<br />
        as external lib.<br />
    * Changing default timeout to 3s. (1second is not enought)<br />
    * Switching data syze to packet size. It's easyer for the user to ignore the<br />
        fact that the packet headr is 8b and the datasize 64 will make packet with<br />
        size 72.</p>
<p>    October 12, 2011<br />
    --------------<br />
    Merged updates from the main project<br />
      -&gt; <a href="https://github.com/jedie/python-ping" rel="nofollow">https://github.com/jedie/python-ping</a></p>
<p>    September 12, 2011<br />
    --------------<br />
    Bugfixes + cleanup by Jens Diemer<br />
    Tested with Ubuntu + Windows 7</p>
<p>    September 6, 2011<br />
    --------------<br />
    Cleanup by Martin Falatic. Restored lost comments and docs. Improved<br />
    functionality: constant time between pings, internal times consistently<br />
    use milliseconds. Clarified annotations (e.g., in the checksum routine).<br />
    Using unsigned data in IP &amp; ICMP header pack/unpack unless otherwise<br />
    necessary. Signal handling. Ping-style output formatting and stats.</p>
<p>    August 3, 2011<br />
    --------------<br />
    Ported to py3k by Zach Ware. Mostly done by 2to3; also minor changes to<br />
    deal with bytes vs. string changes (no more ord() in checksum() because<br />
    &gt;source_string <a href="http://tools.ietf.org/html/rfc791" rel="nofollow">http://tools.ietf.org/html/rfc791</a>)</p>
<p>    0                   1                   2                   3<br />
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1<br />
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
    |Version|  IHL  |Type of Service|          Total Length         |<br />
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
    |         Identification        |Flags|      Fragment Offset    |<br />
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
    |  Time to Live |    Protocol   |         Header Checksum       |<br />
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
    |                       Source Address                          |<br />
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
    |                    Destination Address                        |<br />
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
    |                    Options                    |    Padding    |<br />
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+</p>
<p>    ===========================================================================<br />
    ICMP Echo / Echo Reply Message header info from RFC792<br />
      -&gt; <a href="http://tools.ietf.org/html/rfc792" rel="nofollow">http://tools.ietf.org/html/rfc792</a></p>
<p>        0                   1                   2                   3<br />
        0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1<br />
        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
        |     Type      |     Code      |          Checksum             |<br />
        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
        |           Identifier          |        Sequence Number        |<br />
        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
        |     Data ...<br />
        +-+-+-+-+-</p>
<p>    ===========================================================================<br />
    ICMP parameter info:<br />
      -&gt; <a href="http://www.iana.org/assignments/icmp-parameters/icmp-parameters.xml" rel="nofollow">http://www.iana.org/assignments/icmp-parameters/icmp-parameters.xml</a></p>
<p>    ===========================================================================<br />
    An example of ping's typical output:</p>
<p>    PING heise.de (193.99.144.80): 56 data bytes<br />
    64 bytes from 193.99.144.80: icmp_seq=0 ttl=240 time=127 ms<br />
    64 bytes from 193.99.144.80: icmp_seq=1 ttl=240 time=127 ms<br />
    64 bytes from 193.99.144.80: icmp_seq=2 ttl=240 time=126 ms<br />
    64 bytes from 193.99.144.80: icmp_seq=3 ttl=240 time=126 ms<br />
    64 bytes from 193.99.144.80: icmp_seq=4 ttl=240 time=127 ms</p>
<p>    ----heise.de PING Statistics----<br />
    5 packets transmitted, 5 packets received, 0.0% packet loss<br />
    round-trip (ms)  min/avg/max/med = 126/127/127/127</p>
<p>    ===========================================================================<br />
"""</p>
<p>#=============================================================================#<br />
import os, sys, socket, struct, select, time, signal</p>
<p>if sys.platform == "win32":<br />
    # On Windows, the best timer is time.clock()<br />
    default_timer = time.clock<br />
else:<br />
    # On most other platforms the best timer is time.time()<br />
    default_timer = time.time</p>
<p>#=============================================================================#<br />
# ICMP parameters</p>
<p>ICMP_ECHOREPLY  =    0 # Echo reply (per RFC792)<br />
ICMP_ECHO       =    8 # Echo request (per RFC792)<br />
ICMP_MAX_RECV   = 2048 # Max size of incoming buffer</p>
<p>MAX_SLEEP = 1000</p>
<p>class MyStats:<br />
    thisIP   = "0.0.0.0"<br />
    pktsSent = 0<br />
    pktsRcvd = 0<br />
    minTime  = 999999999<br />
    maxTime  = 0<br />
    totTime  = 0<br />
    avrgTime = 0<br />
    fracLoss = 1.0</p>
<p>myStats = MyStats # NOT Used globally anymore.</p>
<p>#=============================================================================#<br />
def checksum(source_string):<br />
    """<br />
    A port of the functionality of in_cksum() from ping.c<br />
    Ideally this would act on the string as a series of 16-bit ints (host<br />
    packed), but this works.<br />
    Network data is big-endian, hosts are typically little-endian<br />
    """<br />
    countTo = (int(len(source_string)/2))*2<br />
    sum = 0<br />
    count = 0</p>
<p>    # Handle bytes in pairs (decoding as short ints)<br />
    loByte = 0<br />
    hiByte = 0<br />
    while count &lt; countTo:<br />
        if (sys.byteorder == &quot;little&quot;):<br />
            loByte = source_string[count]<br />
            hiByte = source_string[count + 1]<br />
        else:<br />
            loByte = source_string[count + 1]<br />
            hiByte = source_string[count]<br />
        try:     # For Python3<br />
            sum = sum + (hiByte * 256 + loByte)<br />
        except:  # For Python2<br />
            sum = sum + (ord(hiByte) * 256 + ord(loByte))<br />
        count += 2</p>
<p>    # Handle last byte if applicable (odd-number of bytes)<br />
    # Endianness should be irrelevant in this case<br />
    if countTo &gt; 16) + (sum &amp; 0xffff)    # Add high 16 bits to low 16 bits<br />
    sum += (sum &gt;&gt; 16)                    # Add carry from above (if any)<br />
    answer = ~sum &amp; 0xffff                # Invert and truncate to 16 bits<br />
    answer = socket.htons(answer)</p>
<p>    return answer</p>
<p>#=============================================================================#<br />
def do_one(myStats, destIP, hostname, timeout, mySeqNumber, numDataBytes, quiet = False):<br />
    """<br />
    Returns either the delay (in ms) or None on timeout.<br />
    """<br />
    delay = None</p>
<p>    try: # One could use UDP here, but it's obscure<br />
        mySocket = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.getprotobyname("icmp"))<br />
    except socket.error as e:<br />
        print("failed. (socket error: '%s')" % e.args[1])<br />
        raise # raise the original error</p>
<p>    my_ID = os.getpid() &amp; 0xFFFF</p>
<p>    sentTime = send_one_ping(mySocket, destIP, my_ID, mySeqNumber, numDataBytes)<br />
    if sentTime == None:<br />
        mySocket.close()<br />
        return delay</p>
<p>    myStats.pktsSent += 1</p>
<p>    recvTime, dataSize, iphSrcIP, icmpSeqNumber, iphTTL = receive_one_ping(mySocket, my_ID, timeout)</p>
<p>    mySocket.close()</p>
<p>    if recvTime:<br />
        delay = (recvTime-sentTime)*1000<br />
        if not quiet:<br />
            print("%d bytes from %s: icmp_seq=%d ttl=%d time=%d ms" % (<br />
                dataSize, socket.inet_ntoa(struct.pack("!I", iphSrcIP)), icmpSeqNumber, iphTTL, delay)<br />
            )<br />
        myStats.pktsRcvd += 1<br />
        myStats.totTime += delay<br />
        if myStats.minTime &gt; delay:<br />
            myStats.minTime = delay<br />
        if myStats.maxTime destIP&lt;.<br />
    &quot;&quot;&quot;<br />
    #destIP  =  socket.gethostbyname(destIP)</p>
<p>    # Header is type (8), code (8), checksum (16), id (16), sequence (16)<br />
    # (numDataBytes - <img src='http://www.falatic.com/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> - Remove header size from packet size<br />
    myChecksum = 0</p>
<p>    # Make a dummy heder with a 0 checksum.<br />
    header = struct.pack(<br />
        &quot;!BBHHH&quot;, ICMP_ECHO, 0, myChecksum, myID, mySeqNumber<br />
    )</p>
<p>    padBytes = []<br />
    startVal = 0x42<br />
    # &#039;cose of the string/byte changes in python 2/3 we have<br />
    # to build the data differnely for different version<br />
    # or it will make packets with unexpected size.<br />
    if sys.version[:1] == &#039;2&#039;:<br />
        bytes = struct.calcsize(&quot;d&quot;)<br />
        data = ((numDataBytes - <img src='http://www.falatic.com/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> - bytes) * &quot;Q&quot;<br />
        data = struct.pack(&quot;d&quot;, default_timer()) + data<br />
    else:<br />
        for i in range(startVal, startVal + (numDataBytes-8)):<br />
            padBytes += [(i &amp; 0xff)]  # Keep chars in the 0-255 range<br />
        #data = bytes(padBytes)<br />
        data = bytearray(padBytes)</p>
<p>    # Calculate the checksum on the data and the dummy header.<br />
    myChecksum = checksum(header + data) # Checksum is in network order</p>
<p>    # Now that we have the right checksum, we put that in. It&#039;s just easier<br />
    # to make up a new header than to stuff it into the dummy.<br />
    header = struct.pack(<br />
        &quot;!BBHHH&quot;, ICMP_ECHO, 0, myChecksum, myID, mySeqNumber<br />
    )</p>
<p>    packet = header + data</p>
<p>    sendTime = default_timer()</p>
<p>    try:<br />
        mySocket.sendto(packet, (destIP, 1)) # Port number is irrelevant for ICMP<br />
    except socket.error as e:<br />
        print(&quot;General failure (%s)&quot; % (e.args[1]))<br />
        return</p>
<p>    return sendTime</p>
<p>#=============================================================================#<br />
def receive_one_ping(mySocket, myID, timeout):<br />
    &quot;&quot;&quot;<br />
    Receive the ping from the socket. Timeout = in ms<br />
    &quot;&quot;&quot;<br />
    timeLeft = timeout/1000</p>
<p>    while True: # Loop while waiting for packet or timeout<br />
        startedSelect = default_timer()<br />
        whatReady = select.select([mySocket], [], [], timeLeft)<br />
        howLongInSelect = (default_timer() - startedSelect)<br />
        if whatReady[0] == []: # Timeout<br />
            return None, 0, 0, 0, 0</p>
<p>        timeReceived = default_timer()</p>
<p>        recPacket, addr = mySocket.recvfrom(ICMP_MAX_RECV)</p>
<p>        ipHeader = recPacket[:20]<br />
        iphVersion, iphTypeOfSvc, iphLength, \<br />
        iphID, iphFlags, iphTTL, iphProtocol, \<br />
        iphChecksum, iphSrcIP, iphDestIP = struct.unpack(<br />
            &quot;!BBHHHBBHII&quot;, ipHeader<br />
        )</p>
<p>        icmpHeader = recPacket[20:28]<br />
        icmpType, icmpCode, icmpChecksum, \<br />
        icmpPacketID, icmpSeqNumber = struct.unpack(<br />
            &quot;!BBHHH&quot;, icmpHeader<br />
        )</p>
<p>        if icmpPacketID == myID: # Our packet<br />
            dataSize = len(recPacket) - 28<br />
            #print (len(recPacket.encode()))<br />
            return timeReceived, (dataSize+8), iphSrcIP, icmpSeqNumber, iphTTL</p>
<p>        timeLeft = timeLeft - howLongInSelect<br />
        if timeLeft  0:<br />
        myStats.fracLoss = (myStats.pktsSent - myStats.pktsRcvd)/myStats.pktsSent</p>
<p>    print("%d packets transmitted, %d packets received, %0.1f%% packet loss" % (<br />
        myStats.pktsSent, myStats.pktsRcvd, 100.0 * myStats.fracLoss<br />
    ))</p>
<p>    if myStats.pktsRcvd &gt; 0:<br />
        print("round-trip (ms)  min/avg/max = %d/%0.1f/%d" % (<br />
            myStats.minTime, myStats.totTime/myStats.pktsRcvd, myStats.maxTime<br />
        ))</p>
<p>    print("")<br />
    return</p>
<p>#=============================================================================#<br />
def signal_handler(signum, frame):<br />
    """<br />
    Handle exit via signals<br />
    """<br />
    dump_stats()<br />
    print("\n(Terminated with signal %d)\n" % (signum))<br />
    sys.exit(0)</p>
<p>#=============================================================================#<br />
def verbose_ping(hostname, timeout = 3000, count = 3,<br />
                     numDataBytes = 64, path_finder = False):<br />
    """<br />
    Send &gt;countdestIPtimeout delay):<br />
            time.sleep((MAX_SLEEP - delay)/1000)</p>
<p>    dump_stats(myStats)</p>
<p>#=============================================================================#<br />
def quiet_ping(hostname, timeout = 3000, count = 3,<br />
                     numDataBytes = 64, path_finder = False):<br />
    """<br />
    Same as verbose_ping, but the results are returned as tuple<br />
    """<br />
    myStats = MyStats() # Reset the stats<br />
    mySeqNumber = 0 # Starting value</p>
<p>    try:<br />
        destIP = socket.gethostbyname(hostname)<br />
    except socket.gaierror as e:<br />
        return False</p>
<p>    myStats.thisIP = destIP</p>
<p>    # This will send packet that we dont care about 0.5 seconds before it starts<br />
    # acrutally pinging. This is needed in big MAN/LAN networks where you sometimes<br />
    # loose the first packet. (while the switches find the way... :/ )<br />
    if path_finder:<br />
        fakeStats = MyStats()<br />
        do_one(fakeStats, destIP, hostname, timeout,<br />
                        mySeqNumber, numDataBytes, quiet=True)<br />
        time.sleep(0.5)</p>
<p>    for i in range(count):<br />
        delay = do_one(myStats, destIP, hostname, timeout,<br />
                        mySeqNumber, numDataBytes, quiet=True)</p>
<p>        if delay == None:<br />
            delay = 0</p>
<p>        mySeqNumber += 1</p>
<p>        # Pause for the remainder of the MAX_SLEEP period (if applicable)<br />
        if (MAX_SLEEP &gt; delay):<br />
            time.sleep((MAX_SLEEP - delay)/1000)</p>
<p>    if myStats.pktsSent &gt; 0:<br />
        myStats.fracLoss = (myStats.pktsSent - myStats.pktsRcvd)/myStats.pktsSent<br />
    myStats.avrgTime = myStats.totTime / myStats.pktsRcvd</p>
<p>    # return tuple(max_rtt, min_rtt, avrg_rtt, percent_lost)<br />
    return myStats.maxTime, myStats.minTime, myStats.avrgTime, myStats.fracLoss</p>
<p>#=============================================================================#<br />
if __name__ == '__main__':</p>
<p>    # These should work:<br />
    verbose_ping("8.8.8.8")<br />
    verbose_ping("heise.de")<br />
    verbose_ping("google.com")</p>
<p>    # Inconsistent on Windows w/ ActivePython (Python 3.2 resolves correctly<br />
    # to the local host, but 2.7 tries to resolve to the local *gateway*)<br />
    verbose_ping("localhost")</p>
<p>    # Should fail with 'getaddrinfo failed':<br />
    verbose_ping("foobar_url.foobar")</p>
<p>    # Should fail (timeout), but it depends on the local network:<br />
    verbose_ping("192.168.255.254")</p>
<p>    # Should fails with 'The requested address is not valid in its context':<br />
    verbose_ping("0.0.0.0")</p>
<p></code></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Problems updating/installing samba4 in Ubuntu 11.04? Read here! by edgicat</title>
		<link>http://www.falatic.com/index.php/29/problems-with-samba4-when-updating-from-ubuntu-10-10-to-11-04/comment-page-1#comment-4303</link>
		<dc:creator>edgicat</dc:creator>
		<pubDate>Sun, 15 Jan 2012 01:01:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.falatic.com/?p=29#comment-4303</guid>
		<description>I&#039;ve got the same / similar problem.  Unfortunately I&#039;ve already tried the above but the reinstall still fails.

Any ideas</description>
		<content:encoded><![CDATA[<p>I&#8217;ve got the same / similar problem.  Unfortunately I&#8217;ve already tried the above but the reinstall still fails.</p>
<p>Any ideas</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Problems updating/installing samba4 in Ubuntu 11.04? Read here! by c</title>
		<link>http://www.falatic.com/index.php/29/problems-with-samba4-when-updating-from-ubuntu-10-10-to-11-04/comment-page-1#comment-4215</link>
		<dc:creator>c</dc:creator>
		<pubDate>Tue, 27 Dec 2011 19:20:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.falatic.com/?p=29#comment-4215</guid>
		<description>I tried to install samba4 (for apache2) on ubuntu 11.10, and came across the same situation. After I purged and installed samba4 again. The installation still fails, but an error message is returned prompting me to remove /etc/samba/smb.conf. 

I did just that by
# sudo su
cd /etc/samba/
rm smb.conf

and then repeat 
agt-get install samb4.

This time the installation succeeded
Thank you for your posting on the purge hint.</description>
		<content:encoded><![CDATA[<p>I tried to install samba4 (for apache2) on ubuntu 11.10, and came across the same situation. After I purged and installed samba4 again. The installation still fails, but an error message is returned prompting me to remove /etc/samba/smb.conf. </p>
<p>I did just that by<br />
# sudo su<br />
cd /etc/samba/<br />
rm smb.conf</p>
<p>and then repeat<br />
agt-get install samb4.</p>
<p>This time the installation succeeded<br />
Thank you for your posting on the purge hint.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Pinging with Python by Martin Falatic</title>
		<link>http://www.falatic.com/index.php/39/pinging-with-python/comment-page-1#comment-3281</link>
		<dc:creator>Martin Falatic</dc:creator>
		<pubDate>Wed, 12 Oct 2011 13:52:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.falatic.com/?p=39#comment-3281</guid>
		<description>As previously stated, yours is the Python 2 version, while mine is the Python 3 version. I see this repository is also the Python 2 back-port of this. At this point I&#039;m just pulling in your Python 2 changes when I see them. I appreciate you folding my cleanups into your repo there. I don&#039;t expect to be making more modifications to my Python 3 version here except to pull in your changes.

My goal was to understand the inner workings of ping and accomplish a Python 3 port while adding some functionality. I&#039;ve accomplished that... while learning that pinging natively with Python (or Perl, or any other scripting language) is an exercise in frustration because of OS-level restrictions on raw sockets. Making this simply a wrapper around a pre-existing ping subprocess defeats the purpose of all the good work done here to illuminate how ping works. To call a standalone ping several times a second or more (if one is performing a test such as a multiple traceroute with pings) doesn&#039;t appeal to me... it&#039;s a kluge that ignores the implementation of ping entirely. That said, it&#039;s the sort of solution people are forced to duct tape together in scripts when admin rights are required for simple functions like this.</description>
		<content:encoded><![CDATA[<p>As previously stated, yours is the Python 2 version, while mine is the Python 3 version. I see this repository is also the Python 2 back-port of this. At this point I&#8217;m just pulling in your Python 2 changes when I see them. I appreciate you folding my cleanups into your repo there. I don&#8217;t expect to be making more modifications to my Python 3 version here except to pull in your changes.</p>
<p>My goal was to understand the inner workings of ping and accomplish a Python 3 port while adding some functionality. I&#8217;ve accomplished that&#8230; while learning that pinging natively with Python (or Perl, or any other scripting language) is an exercise in frustration because of OS-level restrictions on raw sockets. Making this simply a wrapper around a pre-existing ping subprocess defeats the purpose of all the good work done here to illuminate how ping works. To call a standalone ping several times a second or more (if one is performing a test such as a multiple traceroute with pings) doesn&#8217;t appeal to me&#8230; it&#8217;s a kluge that ignores the implementation of ping entirely. That said, it&#8217;s the sort of solution people are forced to duct tape together in scripts when admin rights are required for simple functions like this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Pinging with Python by Jens Diemer</title>
		<link>http://www.falatic.com/index.php/39/pinging-with-python/comment-page-1#comment-3279</link>
		<dc:creator>Jens Diemer</dc:creator>
		<pubDate>Wed, 12 Oct 2011 13:00:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.falatic.com/?p=39#comment-3279</guid>
		<description>I created a separate GIT Repository for ping.py here: https://github.com/jedie/python-ping/

I found the existing fork https://github.com/samuel/python-ping and merged everything together. Would be great if everyone worked on the same repository.

A idea is to implement a subprocess call ping with a parser of the output, so that no admin right is needed: https://github.com/jedie/python-ping/issues/1</description>
		<content:encoded><![CDATA[<p>I created a separate GIT Repository for ping.py here: <a href="https://github.com/jedie/python-ping/" rel="nofollow">https://github.com/jedie/python-ping/</a></p>
<p>I found the existing fork <a href="https://github.com/samuel/python-ping" rel="nofollow">https://github.com/samuel/python-ping</a> and merged everything together. Would be great if everyone worked on the same repository.</p>
<p>A idea is to implement a subprocess call ping with a parser of the output, so that no admin right is needed: <a href="https://github.com/jedie/python-ping/issues/1" rel="nofollow">https://github.com/jedie/python-ping/issues/1</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on New (old?) Twitter password stealer making the rounds&#8230; by Roelof</title>
		<link>http://www.falatic.com/index.php/36/new-old-twitter-password-stealer-making-the-rounds/comment-page-1#comment-3111</link>
		<dc:creator>Roelof</dc:creator>
		<pubDate>Wed, 21 Sep 2011 07:02:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.falatic.com/?p=36#comment-3111</guid>
		<description>Yet another domain name used by these impostors is twittejr.com.</description>
		<content:encoded><![CDATA[<p>Yet another domain name used by these impostors is twittejr.com.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Pinging with Python by Martin Falatic</title>
		<link>http://www.falatic.com/index.php/39/pinging-with-python/comment-page-1#comment-3039</link>
		<dc:creator>Martin Falatic</dc:creator>
		<pubDate>Mon, 12 Sep 2011 12:18:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.falatic.com/?p=39#comment-3039</guid>
		<description>I see that you effectively back-ported this to Python 2.x (and you removed the comment lines that made it a little more readable). I noted the bug you fixed and pulled that change into the code I have here.

I feel having a Python 3 version is useful (it&#039;s a minor fork), especially to those of us eagerly moving forward with Python 3.</description>
		<content:encoded><![CDATA[<p>I see that you effectively back-ported this to Python 2.x (and you removed the comment lines that made it a little more readable). I noted the bug you fixed and pulled that change into the code I have here.</p>
<p>I feel having a Python 3 version is useful (it&#8217;s a minor fork), especially to those of us eagerly moving forward with Python 3.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Pinging with Python by Jens Diemer</title>
		<link>http://www.falatic.com/index.php/39/pinging-with-python/comment-page-1#comment-3038</link>
		<dc:creator>Jens Diemer</dc:creator>
		<pubDate>Mon, 12 Sep 2011 11:25:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.falatic.com/?p=39#comment-3038</guid>
		<description>I have fixed some bugs and cleanup the code:
https://github.com/jedie/python-code-snippets/commit/48d15e4127cb8cd361dbafd413d98a4a87fb012d</description>
		<content:encoded><![CDATA[<p>I have fixed some bugs and cleanup the code:<br />
<a href="https://github.com/jedie/python-code-snippets/commit/48d15e4127cb8cd361dbafd413d98a4a87fb012d" rel="nofollow">https://github.com/jedie/python-code-snippets/commit/48d15e4127cb8cd361dbafd413d98a4a87fb012d</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Adventures Building GCC 4.6.0 for Cygwin by Martin Falatic</title>
		<link>http://www.falatic.com/index.php/23/adventures-building-gcc-4-6-0-for-cygwin/comment-page-1#comment-2899</link>
		<dc:creator>Martin Falatic</dc:creator>
		<pubDate>Wed, 24 Aug 2011 14:17:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.falatic.com/?p=23#comment-2899</guid>
		<description>Point taken, though I based that comment on info from the Cygwin Wikia page I ended up updating. Even now, 3.4.4-999 is what people normally get as part of the devel pacakages (and not all users are aware that the gcc4 package is out there, which itself is 3 releases behind for 4.3, or one behind for 4.5 if you choose the experimental version). That all said, I&#039;m not sure what versions of Cygwin&#039;s gcc4 were around back when I posted this in May, 2011, though they may have been the samme.

I updated the Cygwin Wikia page to reflect this new information, including mention of gcc4.</description>
		<content:encoded><![CDATA[<p>Point taken, though I based that comment on info from the Cygwin Wikia page I ended up updating. Even now, 3.4.4-999 is what people normally get as part of the devel pacakages (and not all users are aware that the gcc4 package is out there, which itself is 3 releases behind for 4.3, or one behind for 4.5 if you choose the experimental version). That all said, I&#8217;m not sure what versions of Cygwin&#8217;s gcc4 were around back when I posted this in May, 2011, though they may have been the samme.</p>
<p>I updated the Cygwin Wikia page to reflect this new information, including mention of gcc4.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Adventures Building GCC 4.6.0 for Cygwin by Ruben</title>
		<link>http://www.falatic.com/index.php/23/adventures-building-gcc-4-6-0-for-cygwin/comment-page-1#comment-2898</link>
		<dc:creator>Ruben</dc:creator>
		<pubDate>Wed, 24 Aug 2011 13:39:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.falatic.com/?p=23#comment-2898</guid>
		<description>You&#039;re incorrect: Cygwin provides a gcc4 package which includes GCC 4.5, not he latest, but still very recent stuff.</description>
		<content:encoded><![CDATA[<p>You&#8217;re incorrect: Cygwin provides a gcc4 package which includes GCC 4.5, not he latest, but still very recent stuff.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Process Output Logging in Linux and Windows by Adventures Building GCC 4.6.0 for Cygwin &#124; Martin Falatic’s Techno Blog</title>
		<link>http://www.falatic.com/index.php/25/process-output-logging/comment-page-1#comment-2323</link>
		<dc:creator>Adventures Building GCC 4.6.0 for Cygwin &#124; Martin Falatic’s Techno Blog</dc:creator>
		<pubDate>Thu, 19 May 2011 15:23:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.falatic.com/?p=25#comment-2323</guid>
		<description>[...] Martin Falatic’s Techno Blog   Technobabble&#8230; Skip to content       HomeAbout &amp; Contact        &#8592; Interesting Software Development Resources Process Output Logging in Linux and Windows &#8594; [...]</description>
		<content:encoded><![CDATA[<p>[...] Martin Falatic’s Techno Blog   Technobabble&#8230; Skip to content       HomeAbout &amp; Contact        &larr; Interesting Software Development Resources Process Output Logging in Linux and Windows &rarr; [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Building ZXing for Android part 3 – Using Eclipse by Marco da Gualdo</title>
		<link>http://www.falatic.com/index.php/12/building-zxing-for-android-part-3-using-eclipse/comment-page-1#comment-2298</link>
		<dc:creator>Marco da Gualdo</dc:creator>
		<pubDate>Sun, 15 May 2011 19:43:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.falatic.com/?p=12#comment-2298</guid>
		<description>I&#039;m sorry I missed &quot;Frank Forte&quot; answer and... he is absolutely right! 
I edited all the mistakes in res/values folder, once I corrected all the errors Eclipse kindly generated the R.java file :)</description>
		<content:encoded><![CDATA[<p>I&#8217;m sorry I missed &#8220;Frank Forte&#8221; answer and&#8230; he is absolutely right!<br />
I edited all the mistakes in res/values folder, once I corrected all the errors Eclipse kindly generated the R.java file <img src='http://www.falatic.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Building ZXing for Android part 3 – Using Eclipse by Marco da Gualdo</title>
		<link>http://www.falatic.com/index.php/12/building-zxing-for-android-part-3-using-eclipse/comment-page-1#comment-2297</link>
		<dc:creator>Marco da Gualdo</dc:creator>
		<pubDate>Sun, 15 May 2011 18:48:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.falatic.com/?p=12#comment-2297</guid>
		<description>Great tutorial Martin! too bad I have &quot;Worked&quot; same problem.. it doesn&#039;t generate the R.java file :( if I&#039;ll find a solution I&#039;ll be happy to share it posting again. 

PS: I tried under Linux (Ubuntu) and Windows XP and I have the same identical problem.</description>
		<content:encoded><![CDATA[<p>Great tutorial Martin! too bad I have &#8220;Worked&#8221; same problem.. it doesn&#8217;t generate the R.java file <img src='http://www.falatic.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  if I&#8217;ll find a solution I&#8217;ll be happy to share it posting again. </p>
<p>PS: I tried under Linux (Ubuntu) and Windows XP and I have the same identical problem.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Building ZXing for Android part 3 – Using Eclipse by Frank Forte</title>
		<link>http://www.falatic.com/index.php/12/building-zxing-for-android-part-3-using-eclipse/comment-page-1#comment-2275</link>
		<dc:creator>Frank Forte</dc:creator>
		<pubDate>Sun, 08 May 2011 18:38:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.falatic.com/?p=12#comment-2275</guid>
		<description>It took me a while but I found a few additional requirements that might help (as of at least May 2011)

In the &quot;res/values&quot; folders (looks like one per language),  the &quot;strings.xml&quot; files contain a line with %s and %f. You must remove the percentage sign or Eclipse will have a fit.  

You can also change the &quot;app_name&quot; (how it appears below the icon on the device) by editing the res/values/strings.xml (Where it says &quot;Barcode Scanner&quot;)

Finally if you want to change the icon, make sure to change it in res/drawable AND res/drawable-hdpi (and possibly the other drawable folders)

I see that 72px x 72px in the high dots per inch, and 48px by 48px in the regular folder seem to look good.</description>
		<content:encoded><![CDATA[<p>It took me a while but I found a few additional requirements that might help (as of at least May 2011)</p>
<p>In the &#8220;res/values&#8221; folders (looks like one per language),  the &#8220;strings.xml&#8221; files contain a line with %s and %f. You must remove the percentage sign or Eclipse will have a fit.  </p>
<p>You can also change the &#8220;app_name&#8221; (how it appears below the icon on the device) by editing the res/values/strings.xml (Where it says &#8220;Barcode Scanner&#8221;)</p>
<p>Finally if you want to change the icon, make sure to change it in res/drawable AND res/drawable-hdpi (and possibly the other drawable folders)</p>
<p>I see that 72px x 72px in the high dots per inch, and 48px by 48px in the regular folder seem to look good.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Building ZXing for Android part 3 – Using Eclipse by Martin</title>
		<link>http://www.falatic.com/index.php/12/building-zxing-for-android-part-3-using-eclipse/comment-page-1#comment-2071</link>
		<dc:creator>Martin</dc:creator>
		<pubDate>Tue, 29 Mar 2011 10:25:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.falatic.com/?p=12#comment-2071</guid>
		<description>Thanks for the tip!</description>
		<content:encoded><![CDATA[<p>Thanks for the tip!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Building ZXing for Android part 3 – Using Eclipse by GB</title>
		<link>http://www.falatic.com/index.php/12/building-zxing-for-android-part-3-using-eclipse/comment-page-1#comment-2070</link>
		<dc:creator>GB</dc:creator>
		<pubDate>Tue, 29 Mar 2011 10:04:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.falatic.com/?p=12#comment-2070</guid>
		<description>The build fails becouse AndroidManifest.xml includes android:installLocation=&quot;auto&quot; and it requires sdk &gt;= 8.
If you remove the line then  the project builds fine.</description>
		<content:encoded><![CDATA[<p>The build fails becouse AndroidManifest.xml includes android:installLocation=&#8221;auto&#8221; and it requires sdk &gt;= 8.<br />
If you remove the line then  the project builds fine.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Building ZXing for Android part 3 – Using Eclipse by Martin</title>
		<link>http://www.falatic.com/index.php/12/building-zxing-for-android-part-3-using-eclipse/comment-page-1#comment-2063</link>
		<dc:creator>Martin</dc:creator>
		<pubDate>Sun, 27 Mar 2011 22:01:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.falatic.com/?p=12#comment-2063</guid>
		<description>I am sorry to hear that. This project may have changed a lot from when I was experimenting with it and I&#039;ve moved on from it since then (building from Windows was something of a fluke anyway, since Linux is the generally preferred platform for Android develoment).</description>
		<content:encoded><![CDATA[<p>I am sorry to hear that. This project may have changed a lot from when I was experimenting with it and I&#8217;ve moved on from it since then (building from Windows was something of a fluke anyway, since Linux is the generally preferred platform for Android develoment).</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Building ZXing for Android part 3 – Using Eclipse by worked</title>
		<link>http://www.falatic.com/index.php/12/building-zxing-for-android-part-3-using-eclipse/comment-page-1#comment-2062</link>
		<dc:creator>worked</dc:creator>
		<pubDate>Sun, 27 Mar 2011 20:54:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.falatic.com/?p=12#comment-2062</guid>
		<description>Following your directions exactly, the project doesn&#039;t see to generate the R.java file.  so I receive errors everywhere.  I&#039;ve tried literally everything except posting a comment.  Can you lend a few suggestions?</description>
		<content:encoded><![CDATA[<p>Following your directions exactly, the project doesn&#8217;t see to generate the R.java file.  so I receive errors everywhere.  I&#8217;ve tried literally everything except posting a comment.  Can you lend a few suggestions?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

