Skip to content

Instantly share code, notes, and snippets.

@mrkane27
Created January 10, 2021 12:13
Show Gist options
  • Save mrkane27/bdb59362f097ec578b6324f915e68163 to your computer and use it in GitHub Desktop.
Save mrkane27/bdb59362f097ec578b6324f915e68163 to your computer and use it in GitHub Desktop.
Network speed test to a computer you have ssh access to
#!/usr/bin/env bash
if [ -z "$1" ]; then
echo "$0 <ssh args e.g. host>"
exit
fi
FN="/tmp/$(uuidgen)"
TESTSIZE=314572800
echo generate
cat /dev/urandom | head -c $TESTSIZE > $FN
md5sum $FN
echo upload
cat $FN | pv -pabt | ssh $1 "tee $FN | md5sum"
echo
echo download
ssh $1 "cat $FN" | pv -pabt | md5sum
ssh $1 "rm $FN"
rm $FN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment