Control Web Panel

Developers => New Modules => Topic started by: MyBuddyBen on January 06, 2016, 08:30:37 PM

Title: [module] Speedtest your server in 30 seconds
Post by: MyBuddyBen on January 06, 2016, 08:30:37 PM
This quickly and effectly uses the speedtest.net servers to test your server's internet bandwidth connection. Check to see if you're really getting what your provider says you should get!

Features:
- Speed test your server within 30 seconds
- Uses the connection from speedtest.net
- NO buttons to click, auto runs on page and live updates to show the speed
- Detects and uses the server closest to your server's geolocation

Latest Version: 1.1a

Add this line to:
/usr/local/cwpsrv/htdocs/resources/admin/include/3rdparty.php

Quote
<li><a href="index.php?module=speedtest"><span class="icon16 icomoon-icon-arrow-right-3"></span>Speed Test</a></li>


Then create a new file called "speedtest.php" on:
/usr/local/cwpsrv/htdocs/resources/admin/modules
with this content:
Quote
<center><h3>Speed test your server's internet connection</h3><h2>Verison 1.1a</h2><br>
Python file provided by Speedtest.net<br>
<button type="button" class="btn btn-warning" onclick='window.location.reload(true);'>Restart Test</button>

<a href="http://forum.centos-webpanel.com/new-modules/(module)-speedtest-your-server-in-30-seconds/" target="_blank"><button type="button" class="btn btn-primary">Check for Update</button></a><br><br></center>
<pre>
<?php

$command = "python /usr/local/cwpsrv/htdocs/resources/admin/modules/speedtest/speedtest.py 2>&1";
$pid = popen( $command,"r");
while( !feof( $pid ) )
{
 echo fread($pid, 256);
 flush();
 ob_flush();
 usleep(100000);
}
pclose($pid);
?>
</pre>

Then run this command from your Terminal/SSH Window (You can copy and paste this; Do the last empty line too ;) )
Quote
mkdir /usr/local/cwpsrv/htdocs/resources/admin/modules/speedtest
cd /usr/local/cwpsrv/htdocs/resources/admin/modules/speedtest
wget -O speedtest.py https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py
chmod 755 speedtest-cli.py
chmod +x speedtest-cli.py
echo Complete!



Now just load the page Developer Menu -> Speedtest from the sidebar and you will begin the speed test.
Which will be /index.php?module=speedtest
Title: Re: [module] Speedtest your server in 30 seconds
Post by: pedromidiasf on April 13, 2016, 09:01:29 PM
Thanks mate, well done :)
Title: Re: [module] Speedtest your server in 30 seconds
Post by: Jae on April 14, 2016, 01:37:23 AM
thanks bentheman96 , awesome
Title: Re: [module] Speedtest your server in 30 seconds
Post by: MyBuddyBen on December 26, 2016, 02:08:54 PM
Updated to 1.1a

* Updated github speedtest.py new link.
Title: Re: [module] Speedtest your server in 30 seconds
Post by: harpreet9629 on January 23, 2017, 02:55:38 PM
Hi,

This file is not available in newer version
/usr/local/cwpsrv/htdocs/resources/admin/include/3rdparty.php all another files are encryped
Title: Re: [module] Speedtest your server in 30 seconds
Post by: oleteacher on February 25, 2017, 04:08:39 PM
What a shame. People spend time making modules to share and then files get encrypted and end users cannot use. As a new user (pro) makes me think twice about creating modules...
Title: Re: [module] Speedtest your server in 30 seconds
Post by: MyBuddyBen on May 02, 2017, 06:53:44 PM
Sadly I can't modify my first post  :-\  ???

But for the 3rdparty.php; it still works. You just need to create it  ;)
From SSH you can simply CD into /usr/local/cwpsrv/htdocs/resources/admin/include and do "touch 3rdparty.php" command

Then follow the steps above with normal modules. So modules and 3rdparty support still work.
Title: Re: [module] Speedtest your server in 30 seconds
Post by: johnny09 on September 06, 2017, 07:49:48 AM
Thanks, it works
Title: Re: [module] Speedtest your server in 30 seconds
Post by: studio4host on September 06, 2017, 08:02:15 AM
What a shame. People spend time making modules to share and then files get encrypted and end users cannot use. As a new user (pro) makes me think twice about creating modules...

how would you files got encrypted that is not possible???? since encryption can be done only by software developer so any custom script you have can't be encrypted in any way.
Title: Re: [module] Speedtest your server in 30 seconds
Post by: MyBuddyBen on July 15, 2020, 05:32:16 PM
This still works  :D

(https://tb5.chetcrooms.com/file/5tbhdd/Temp-Pictures/Screenshot_2020-07-15.png)