# Speedtest Mini



## ripv (Oct 1, 2012)

Hi, has anyone got speedtest mini working recently ? I can't seem to make any progress 

My old install started saying it was expired, I tried updating - no joy!

Tried upgrading from 8.2 to 9 Release and updating the Ports - no joy.

Deinstalled and now when I try reinstall I get:


```
jail01# cd /usr/ports/www/speedtest-mini
jail01# make clean install
===>  Cleaning for speedtest-mini-2.2.0
===>  License MIT accepted by the user
===>  Extracting for speedtest-mini-2.2.0
=> SHA256 Checksum mismatch for mini.zip.
===>  Refetch for 1 more times files: mini.zip
===>  License MIT accepted by the user
=> mini.zip doesn't seem to exist in /usr/ports/distfiles/.
=> Attempting to fetch http://c.speedtest.net/mini/mini.zip
fetch: http://c.speedtest.net/mini/mini.zip:Requested Range Not Satisfiable
=> Attempting to fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/mini.zip
fetch: mini.zip: local file (99763433 bytes) is longer than remote file (98993097 bytes)
=> Couldn't fetch it - please try to retrieve this
=> port manually into /usr/ports/distfiles/ and try again.
*** Error code 1 Stop in /usr/ports/www/speedtest-mini.
jail01#
```

So I retrieve manually:

```
jail01# cd /usr/ports/distfiles
jail01# fetch http://c.speedtest.net/mini/mini.zip
mini.zip                                      100% of   95 MB  536 kBps 00m00s
jail01#
```

Then try install again and get the same error as above - seems like I'm stuck in an infinite loop !!


----------



## SirDice (Oct 2, 2012)

Same error:

```
root@vps-2417-1:/usr/ports/www/speedtest-mini#make fetch
===>  License MIT accepted by the user
=> mini.zip doesn't seem to exist in /usr/ports/distfiles/.
=> Attempting to fetch http://c.speedtest.net/mini/mini.zip
fetch: http://c.speedtest.net/mini/mini.zip: size mismatch: expected 98993097, actual 99763433
=> Attempting to fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/mini.zip
mini.zip                                      100% of   94 MB 5539 kBps 00m00s
root@vps-2417-1:/usr/ports/www/speedtest-mini#
```

File a PR. It's possible the upstream got updated.


----------



## ripv (Oct 2, 2012)

Thanks, PR submitted.


----------



## ripv (Oct 25, 2012)

Never got a solution to this, had anyone got speedtest mini working recently ?

I did get a reply back from the PR mentioning a Patch but I was not able to follow it.


----------



## ripv (Feb 2, 2013)

Isn't anyone out there running speedtest-mini on freebsd FreeBSD?


----------



## fonz (Feb 2, 2013)

ripv said:
			
		

> I did get a reply back from the PR mentioning a Patch but I was not able to follow it.


Care to elaborate?



			
				ripv said:
			
		

> Isn't anyone out there running speed test min[red]speedtest-mini[/red] on freebsd[red]FreeBSD[/red] ??


I don't actually use it, but when I tried to build and install it everything went peachy. Have you updated your ports tree recently?


----------



## ripv (Feb 2, 2013)

As far as I can tell my ports tree is up to date.


```
jail01# uname -rs
FreeBSD 9.1-RC1
jail01# portsnap update
Ports tree is already up to date.
```

Then when I try to install:

```
jail01# cd /usr/ports/www/speedtest-mini/ && make install clean
===>  License MIT accepted by the user
===>  Extracting for speedtest-mini-2.2.0
=> SHA256 Checksum mismatch for mini.zip.
===>  Refetch for 1 more times files: mini.zip 
===>  License MIT accepted by the user
=> mini.zip doesn't seem to exist in /usr/ports/distfiles/.
=> Attempting to fetch http://c.speedtest.net/mini/mini.zip
fetch: http://c.speedtest.net/mini/mini.zip: size mismatch: expected 98993097, actual 99763924
=> Attempting to fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/mini.zip
mini.zip                                        0% of   94 MB    0  Bps
```

Just sits here forever, as above if I try downloading manually and installing I get the size mismatch error.


----------



## ripv (Feb 2, 2013)

Here is what happens when I fetch the file manually:


```
jail01# cd /usr/ports/distfiles
jail01# fetch http://c.speedtest.net/mini/mini.zip
mini.zip                                      100% of   95 MB  876 kBps 00m00s
```

Then try installing:


```
jail01# cd /usr/ports/www/speedtest-mini
jail01# make install
===>  License MIT accepted by the user
===>  Extracting for speedtest-mini-2.2.0
=> SHA256 Checksum mismatch for mini.zip.
===>  Refetch for 1 more times files: mini.zip 
===>  License MIT accepted by the user
=> mini.zip doesn't seem to exist in /usr/ports/distfiles/.
=> Attempting to fetch http://c.speedtest.net/mini/mini.zip
fetch: http://c.speedtest.net/mini/mini.zip: Requested Range Not Satisfiable
=> Attempting to fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/mini.zip
fetch: mini.zip: local file (99763924 bytes) is longer than remote file (98993097 bytes)
=> Couldn't fetch it - please try to retrieve this
=> port manually into /usr/ports/distfiles/ and try again.
*** [do-fetch] Error code 1

Stop in /usr/ports/www/speedtest-mini.
*** [checksum] Error code 1

Stop in /usr/ports/www/speedtest-mini.
jail01#
```


----------



## fonz (Feb 2, 2013)

ripv said:
			
		

> ```
> jail01# portsnap update
> Ports tree is already up to date.
> ```


That should be `# portsnap [color=blue]fetch[/color] update`.


----------



## ripv (Feb 3, 2013)

Thanks, I ran the corrected command and it did update some ports, I doesn't look like speedtest-mini was one of them though:

```
root@jail01:/root # portsnap fetch update
Looking up portsnap.FreeBSD.org mirrors... 6 mirrors found.
Fetching snapshot tag from ec2-eu-west-1.portsnap.freebsd.org... done.
Fetching snapshot metadata... done.
Updating from Sat Feb  2 01:47:01 GMT 2013 to Sun Feb  3 01:00:59 GMT 2013.
Fetching 4 metadata patches... done.
Applying metadata patches... done.
Fetching 0 metadata files... done.
Fetching 60 patches.....10....20....30....40....50....60 done.
Applying patches... done.
Fetching 0 new ports or files... done.
Removing old files and directories... done.
Extracting new files:
/usr/ports/LASTCOMMIT.txt
/usr/ports/MOVED
/usr/ports/Mk/bsd.options.desc.mk
/usr/ports/UPDATING
/usr/ports/archivers/paq/
/usr/ports/audio/p5-MIDI/
/usr/ports/converters/cl-babel-sbcl/
/usr/ports/databases/p5-Rose-DB-Object/
/usr/ports/databases/p5-Rose-DB/
/usr/ports/deskutils/orage/
/usr/ports/devel/buildapp/
/usr/ports/devel/cl-alexandria-sbcl/
/usr/ports/devel/cl-cffi-sbcl/
/usr/ports/devel/cl-infix-sbcl/
/usr/ports/devel/cl-port-sbcl/
/usr/ports/devel/cl-split-sequence-sbcl/
/usr/ports/devel/cl-trivial-features-sbcl/
/usr/ports/devel/cl-trivial-gray-streams-sbcl/
/usr/ports/devel/cl-uffi-sbcl/
/usr/ports/devel/jenkins/
/usr/ports/devel/p5-IPC-Locker/
/usr/ports/devel/p5-Module-Util/
/usr/ports/devel/t1lib/
/usr/ports/editors/tamago/
/usr/ports/graphics/libcdr/
/usr/ports/japanese/font-ume/
/usr/ports/java/linux-sun-jdk16/
/usr/ports/java/linux-sun-jdk17/
/usr/ports/java/linux-sun-jre16/
/usr/ports/java/linux-sun-jre17/
/usr/ports/lang/ghc/
/usr/ports/lang/python33/
/usr/ports/lang/sbcl/
/usr/ports/mail/msmtp/
/usr/ports/math/fricas/
/usr/ports/math/maxima/
/usr/ports/math/open-axiom/
/usr/ports/math/wxMaxima/
/usr/ports/misc/pciids/
/usr/ports/multimedia/vlc/
/usr/ports/net-mgmt/Makefile
/usr/ports/net-mgmt/hastmon/
/usr/ports/net-mgmt/nettop/
/usr/ports/net-p2p/deluge/
/usr/ports/net/hostapd/
/usr/ports/security/cl-md5-sbcl/
/usr/ports/security/clamtk/
/usr/ports/sysutils/lbl-cf/
/usr/ports/textproc/cl-meta-sbcl/
/usr/ports/textproc/cl-ppcre-sbcl/
/usr/ports/www/cl-lml-sbcl/
/usr/ports/www/p5-RT-Authen-ExternalAuth/
/usr/ports/www/p5-RT-Extension-LDAPImport/
/usr/ports/www/p5-Rose-HTML-Objects/
/usr/ports/www/pecl-APC/
/usr/ports/www/py-bottle/
/usr/ports/x11-fm/Makefile
/usr/ports/x11-servers/xorg-server/
/usr/ports/x11-wm/stumpwm/
/usr/ports/x11-wm/xfce4/
Building new INDEX files... done.
```
I ran the command a second time to ensure everything was up to date:

```
root@jail01:/root # portsnap fetch update
Looking up portsnap.FreeBSD.org mirrors... 6 mirrors found.
Fetching snapshot tag from ec2-eu-west-1.portsnap.freebsd.org... done.
Latest snapshot on server matches what we already have.
No updates needed.
Ports tree is already up to date.
```
Then tried to install again, still getting the same error:

```
root@jail01:/root # cd /usr/ports/www/speedtest-mini
root@jail01:/usr/ports/www/speedtest-mini # make clean install
===>  Cleaning for speedtest-mini-2.2.0
===>  License MIT accepted by the user
===>  Extracting for speedtest-mini-2.2.0
=> SHA256 Checksum mismatch for mini.zip.
===>  Refetch for 1 more times files: mini.zip 
===>  License MIT accepted by the user
=> mini.zip doesn't seem to exist in /usr/ports/distfiles/.
=> Attempting to fetch http://c.speedtest.net/mini/mini.zip
fetch: http://c.speedtest.net/mini/mini.zip: Requested Range Not Satisfiable
=> Attempting to fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/mini.zip
fetch: mini.zip: local file (99763924 bytes) is longer than remote file (98993097 bytes)
=> Couldn't fetch it - please try to retrieve this
=> port manually into /usr/ports/distfiles/ and try again.
*** [do-fetch] Error code 1

Stop in /usr/ports/www/speedtest-mini.
*** [checksum] Error code 1

Stop in /usr/ports/www/speedtest-mini.
root@jail01:/usr/ports/www/speedtest-mini #
```

Thanks for helping with this, I will try to find the email I got relating to the patch and post it also, in case it could help.


----------



## cpm@ (Feb 3, 2013)

ripv said:
			
		

> => Attempting to fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/mini.zip
> fetch: mini.zip: local file (99763924 bytes) is longer than remote file (98993097 bytes)
> => Couldn't fetch it - please try to retrieve this
> => port manually into /usr/ports/distfiles/ and try again.
> *** [do-fetch] Error code 1



Remove mini.zip from /usr/ports/distfiles and run:

`# cd /usr/ports/www/speedtest-mini && make config clean && make install clean`


----------



## wblock@ (Feb 3, 2013)

cpu82 said:
			
		

> Remove mini.zip from /usr/ports/distfiles and run:
> 
> `# cd /usr/ports/www/speedtest-mini && make config clean && make install clean`



`# make distclean`

will remove the distfiles and the work directory.


----------



## cpm@ (Feb 3, 2013)

To be more selective about distfile removal, can use portsclean(1) tool or portmaster(8), as following:

`# portsclean -CDD`

Or, usually I prefer this one:

`# portmaster -t --clean-distfiles-all`


----------



## wblock@ (Feb 3, 2013)

To be clear, make distclean in a port directory does a make clean and then deletes all of that port's distfiles from /usr/ports/distfiles.  portmaster(8) removes all outdated distfiles, or all distfiles that are not needed by installed ports (depending on the options given).


----------



## ripv (Feb 3, 2013)

cpu82 said:
			
		

> Remove mini.zip from /usr/ports/distfiles and run:
> 
> `# cd /usr/ports/www/speedtest-mini && make config clean && make install clean`



Thanks this allowed me to get speedtest-mini installed again.

I followed the instructions at the end of the Installation and added an Alias for the installation directory to my httpd.conf in apache22. 

With the Alias in place the address is: http://10.10.5.5/speedtest/

However when I load in a browser I am back to getting the original error I started with, namely the speedtest-mini says "This test has expired"


----------



## ripv (Feb 3, 2013)

ripv said:
			
		

> Thanks for helping with this, I will try to find the email I got relating to the patch and post it also, in case it could help.



Here is the first email I received after submitting the PR:



> ________________________________________
> From: FreeBSD-gnats-submit@FreeBSD.org [FreeBSD-gnats-submit@FreeBSD.org]
> Sent: 02 October 2012 12:40
> To: Darran Fitzpatrick
> ...



Followed by this one:


> ________________________________________
> From: Rodrigo OSORIO [rodrigo@bebik.net]
> Sent: 04 October 2012 00:24
> To: Darran Fitzpatrick
> ...



And the final one:


> From:Mark Linimon <linimon@lonesome.com>
> To:bug-followup@FreeBSD.org
> Date:Thu, 4 Oct 2012 20:50:19 -0500
> 
> ...



I didn't know what to do after this, or if I needed to do anything except wait for the maintainers feedback.
I never heard anything further anyway.
I did try running the diff command above from the console but this just gave me the following error:


```
diff: invalid option -- ,
diff: Try `diff --help' for more information.
```


----------



## cpm@ (Feb 5, 2013)

Download latest from speedtest.net and move to /usr/ports/distfiles.

Try this patch instead:

```
--- /usr/ports/www/speedtest-mini/distinfo      2012-05-12 07:56:23.000000000 +0200
+++ /usr/ports/www/speedtest-mini/distinfo      2013-02-05 01:52:34.000000000 +0200
@@ -1,2 +1,2 @@
-SHA256 (mini.zip) = 31d86df8ea25e5dfac4ebc383172c3408a3ca67a61193f62a75fb68d6d47621b
-SIZE (mini.zip) = 98993097
+SHA256 (mini.zip) = fc5af8b07b01133d9012314a8931e7852f86c25277c4b1a7764a9874ebfa955e
+SIZE (mini.zip) = 99763924
```

Apply using patch(1) as following:

```
# cd /usr/ports/www/speedtest-mini 
# patch -u < /home/user/distinfo
```

Be sure you added as part in /usr/local/etc/apache22/httpd.conf

```
<IfModule dir_module>
        DirectoryIndex index.html index.html.var index.php
</IfModule>
```


----------



## ripv (Feb 5, 2013)

cpu82 said:
			
		

> Download latest from speedtest.net and move to /usr/ports/distfiles.
> 
> Try this patch instead:
> 
> ...



Thanks cpu82 for helping, I hope I can rely on your patience and generosity just a bit more... 

I'm not sure if I have followed your instruction correctly, here is what I did:

1) Downloaded mini.zip and moved it into '/usr/ports/www/speedtest-mini' 

2) Created and saved a new file called 'distinfo' in my '/home/myusername' folder containing all the text from the first code section.

3) Then 'cd /usr/ports/www/speedtest-mini'  

4) 'patch -u < /home/myusername/distinfo'

This gave me the following results:

```
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- /usr/ports/www/speedtest-mini/distinfo      2012-05-12 07:56:23.000000000 +0200
|+++ /usr/ports/www/speedtest-mini/distinfo      2013-02-05 01:52:34.000000000 +0200
--------------------------
Patching file distinfo using Plan A...
Hunk #1 succeeded at 1.
done
```

Do I need to do anything else?

If I access the speedtest, which for me is at, 'http://10.10.5.5/speedtest/'
I am still getting the speed test graphic displayed with the message "This test has expired!"


----------



## cpm@ (Feb 5, 2013)

Changed distfile sum for update to latest package available. De/install speedtest-mini port again as usual. Remember you have to go back to their site every couple of month and download and reinstall it or wait until maintainer updates the port.

Show your httpd.conf, please paste using pastebin.com service or similars and copy here the URL.


----------



## ripv (Feb 10, 2013)

cpu82 said:
			
		

> Changed distinfo for update to latest package available. De/install speedtest-mini port again as usual. Remember you have to go back to their site every couple of month and download and reinstall it or wait until maintainer updates the port.
> 
> Show your httpd.conf, please paste using pastebin.com service or similars and copy here the URL.




Tried everything I could on this, deinstalled and verified no speedtest-mini folders or files existed and that http://10.10.5.5/speedtest/ had stopped resolving.
Deleted my entire ports folder (including subfolders), Rebooted. Did a new 'fetch' and 'extract'.
Reinstalled speedtest-mini, had the very same result; when the site loads I get the Speedtest-Mini graphic displayed with the message "This test has expired" 

Thanks again cpu82 for your time and help however I've thrown my hat at this one!
I installed apache and speedtest-mini on one of our windows servers, worked first time, 10 minutes in all start to finish. 

I'm sure if I was more knowledgeable and experienced with FreeBSD I could resolve my (seemingly) simple issue however I've already spent more time on this than it is worth to us for our small requirement.


----------



## cpm@ (Feb 10, 2013)

I guess you know that the message that shows application is because there is a new update on his website. You must have properly configured the Apache HTTP Server. Anyway, you solved your problem.


----------

