Thursday, November 6, 2014

Test internet bandwidth in Ubuntu Linux Terminal

Want to test your internet bandwidth without opening web browser? Well, here’s command line tool to do this using speedtest.net.
This may be help if you’re on Ubuntu Linux servers that doesn’t have a GUI. The tool is based on Python 2.4-3.3, so it works on all Canonical supported Ubuntu releases.

To install the tool, speedtest-cli:

1.) First install python-pip, a tool for installing and managing Python packages. To do so, run below command:

sudo apt-get install python-pip

2.) Install speedtest-cli via python-pip:

sudo pip install speedtest-cli

Once installed, you can use one command to test your internet bandwidth. The command is:

speedtest

You’ll see the similar output, which display you internet bandwidth as well as ISP & IP address.
Retrieving speedtest.net configuration…
Retrieving speedtest.net server list…
Testing from M-net Telekommunikations GmbH (88.217.180.40)…
Selecting best server based on ping…
Hosted by InterNetX GmbH (Munich) [2.23 km]: 18.756ms
Testing download speed………………………………….
Download: 7.81 Mbit/s
Testing upload speed…………………………………………..
Upload: 3.46 Mbit/s

One Command to Make ISO Image from Live CD/DVD in Ubuntu

To make iso image out of CD or DVD:


Insert your live CD or DVD into computer, then you can check the device name by running below command:

df -lh
 
You’ll get a similar output. The last line tells the device name /dev/sr0 and mount point /media/handbook/CD-Rom
Filesystem Size Used Avail Use% Mounted on
/dev/sda6 92G 47G 41G 54% /
none 4.0K 0 4.0K 0% /sys/fs/cgroup
udev 870M 4.0K 870M 1% /dev
tmpfs 176M 980K 175M 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 878M 3.5M 874M 1% /run/shm
none 100M 56K 100M 1% /run/user
/dev/sr0 807M 807M 0 100% /media/handbook/CD-Rom
Now, use below command to create iso from it:

dd if=/dev/sda6 of=~/backup.iso bs=1000000 count=512 &&sync
 
Here if reads from file /dev/sr0, of write to file backup.iso, ~/ means user home directory. The value of ‘bs’ means read and write up to 1000000 bytes at a time.