hackorama
hackorama

Dynamo + Speedometer - Broadband Utility Scripts

A bandwidth measuring script for your home broadband connection and another script for uploading your changing DHCP assigned dynamic IP to an external server and/or to a dynamic DNS service provider. The scripts are not limited to broadband, it should work on a modem dialup as well.

Speedometer

This simple shell script will time an HTTP download on your broadband connection. You need to put a 1 MB ( Mega Byte ) data file on a webserver somewhere on the net which will be downloaded by the script using the lynx command line browser. If you dont have a webserver use a free service like geocities. Lynx is available for all UNIX platforms and most Linux distros comes with lynx preinstalled.

You can use it with the accompanying Perl CGI script to print out a nice HTML graph using HTML tables like the one below, on your web server.

1 MB | 2 MB |
1508 kbps  

View speedometer.sh - The script
View speedometer.cgi - The CGI script

Download speedometer.sh - The script
Downlaod speedometer.cgi - The CGI script

If you dont have a 1 Mb ( Mega bit ) data file, create one.

  FILE* fp;
  int i = 0, length = 1024 * ( 1024 / sizeof(char) );
  fp = fopen( "speedometer.dat" , "w" );
  for( i = 0; i < length; i++ )
	fputc( 'x' , fp );
  fclose(fp);

Speedometer++

Try speedometerplus.cgi which is an enhanced version of the above CGI script which will generate tables, with time stamp and avarage speed. The client shellscript is same as above just run it as a cronjob to upload the speed to the CGI script maybe once a day.


1 MB | 2 MB | AT&T CABLE
1511 Kbps   Thu Dec 20 12:24:18 2001
1336 Kbps   Thu Dec 20 19:24:18 2001
1563 Kbps   Fri Dec 21 01:18:32 2001
1470 Kbps   AVARAGE SPEED

Check the live chart for my AT&T cable connection here

Dynamo

The Cable modem services does not provide a static IP, only DHCP assigned dynamic IP. This script will check for a change in your IP, and can upload the new IP to a CGI script on a webserver using lynx.

You can also register with the free dynamic DNS service provided by myip.org which will provide you with a host name like "yourmachine.myip.org" for your machine. They also have a script to update your IP whenever it chabges. This script can also be called from the Dynamo script, so that your dynamic DNS entry will be updated as well as the new IP address will be stored on external server in case the dynamic DNS updation is delayed or did not work.

View dynamo.sh - The script
View dynamo.cgi - The CGI script

Download dynamo.sh - The script
Downlaod dynamo.cgi - The CGI script



Wednesday, 27-Apr-2005 17:34:46 PDT kishan at hackorama dot com