Anyone Hosting On Servers In Obscure Locations?

Discussion in 'Hosting Discussions' started by Digitalpoint, Apr 1, 2015.

  1. Digitalpoint

    Digitalpoint Brain

    284
    697
    +446
    So I made a ping test tool that is able to tell you latency to certain sites/IPs from around the world. Ideally looking for people hosting stuff in geographical locations that we don't already have a location for here: https://tools.digitalpoint.com/ping

    Also looking for people willing to toss up a small PHP script that basically just does 5 small UDP ping packets and reports back (it's a few lines of code... nothing too fancy). Attribution link on any nodes will be given (of course) as you can see on that page.

    To give an example of how it works/looks like:

    upload_2015-4-1_14-28-4.png
     
  2. The Sandman

    The Sandman Administrator

    27,097
    1,822
    +4,099
    TAZ is happy to be participating in this project. :)
     
  3. ozzy47

    ozzy47 Moderator

    8,972
    742
    +4,191
    If it can be easily integrated into vB, I would be willing to do it on OzzModz.
     
  4. Digitalpoint

    Digitalpoint Brain

    284
    697
    +446
    Doesn't need to be integrated into anything... Server just would need to support PHP 5.3.0 or higher on Linux (or some other Unix flavor) is all. Plop the script on the server and done. Has no other framework/CMS/forum requirements.
     
  5. Jake

    Jake Developer

    1,054
    252
    +1,057
    I'll add it to a couple of my servers.

    - Jake
     
  6. Digitalpoint

    Digitalpoint Brain

    284
    697
    +446
    If anyone wants to run it, this is the PHP script:
    PHP:
    <?php

        
    /*******************************
        *
        *  Proxy helper for https://tools.digitalpoint.com/ping
        *
        *  Some systems might need u+s permission on ping set like so:  chmod u+s /bin/ping
        *
        *******************************/

        
    if(!function_exists('json_encode'))
        {
            
    $results = array('error' => 'json_encode missing');
        }
        elseif(!
    $host preg_replace('#[^a-z0-9\-\.]#i' ,''strtolower(@$_REQUEST['host'])))
        {
            
    $results = array('error' => 'no host');
        }
        elseif(!
    function_exists('shell_exec') || strpos(ini_get('disable_functions'), 'shell_exec') !== false)
        {
            if(!
    function_exists('fsockopen') || strpos(ini_get('disable_functions'), 'fsockopen') !== false)
            {
                
    $results = array('error' => 'shell_exec & fsockopen disabled');
            }
            else
            {
                
    $time microtime(true);
                if (!
    $handle fsockopen($host80$errno$errstr10))
                {
                    
    $results = array('error' => 'fsockopen error: ' $errstr ' (' $errno ')');
                }
                
    $time round((microtime(true) - $time) * 10003);
                
    $results = array('results' => array(
                    
    'ptr' => gethostbyname($host),
                    
    'latency' => $time,
                ));
            }
        }
        else
        {
            
    $results = array('results' => shell_exec('ping -i 0.2 -l 3 -c 5 -W 5 -q ' escapeshellarg($host) . ' 2>&1'));
        }

        echo 
    json_encode($results);
    As far as a breakdown of what it does, it tries to run the ping command with the following parameters:
    • Send a total of 5 packets
    • preload 3 packets (first 3 go out at the same time)
    • 0.2 seconds delay between last 3 packets
    • Don't wait more than 5 seconds total for ping responses
    PHP has to run as root in order to do a native UDP socket connection, which is why it has the requirement of being able to run the shell command. Anyone running PHP as root has security issues they need to address before anything. :)

    It falls back to making a TCP connection on port 80 if the server doesn't support UDP/ping command... but that makes the results a little weird because TCP takes longer than a ran UDP ping.

    Anyway, if anyone wants to be a node, that's the script... upload the script, and just shoot me a private message/conversation letting me know the URL of the script, physical location of the server (if you know) and attribution info (company name/link).
     
  7. Host4Geeks

    Host4Geeks Participant

    78
    13
    +30
    We can run it at Los Angeles, Orlando and Lenoir in US and Kent in UK. I will toss this up later in the day today and shoot you a PM.
     
  8. Digitalpoint

    Digitalpoint Brain

    284
    697
    +446
    Looping back around on this... was doing clean up of random tools and went through and removed the ping nodes that are no longer available.

    Is anyone interested in being a ping node these days?

    More or less no load on server (a couple random pings here and there), and get a free link.

    https://tools.digitalpoint.com/ping
     
Verification:
Draft saved Draft deleted