On CentOS 6.x this is super easy to install since Python 2.6.x is already installed (Yum dependency).

1. Get the script:

wget -O speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest_cli.py

2. Make it executable:

chmod +x speedtest-cli

3. Run it:

./speedtest-cli

Sample output:

Retrieving …