Perform Internet SpeedTest from Linux Command Line (CLI)

Determining your internet connection speed is important for the applications which depends mostly communicating over internet – For such cases speedtest-cli comes handy.

speedtest-cli is developed by www.speedtest.net team for speedtest over command line.

Installation of speedtest-cli:
Installation can be carried on different in many ways as per user’s convenience. Today I’m going to show you two easiest methods
1. Installation using pip3
2. Installation using package manager (apt in Debian based systems)

  1. Installation using pip3:
    To install speedtest-cli execute below command
    pip3 install speedtest-cli

    Usage:
    Execute below command to start speedtest.
    speedtest
  2. Installation using Package Manager:
    To install speedtest-cli execute below command
    sudo apt-get install speedtest-cli

    Usage:
    Execute below command to start speedtest.
    speedtest

Detailed process is demonstrated in the video below.

Encrypt shell scripts in linux

Introduction:

Let’s consider a scenario, You are working for company and as per company policy you cannot share your developed linux shell script(s) in human readable format so that source code is not exposed to the users in human readable format but script file is needed to shared across multiple users to execute code without code being exposed.

To find out the process of securing / encrypting your script, please continue reading ..

What is the process /approach?

Shell script compiler compiles your shell script and generate encrypted script (binary file) which can be used to share across multiple users with assurance of your source code being secured.

Lets gets started….

Lets create a simple shell script which uses echo command to display message as shown in below screenshot

To download shell compiler from internet and configure please follow below steps

wget -c http://www.datsi.fi.upm.es/~frosal/sources/shc-3.8.9b.tgz
tar -zvxf shc-3.8.9b.tgz
cd shc-3.8.9b

make

Now SHELL Script Compiler is ready for use, below is the syntax and options that are allowed.

Below command needs to be executed to encrypt our script.sh which can be executed on any other supported linux system

shc -v -r -T -f /tmp/demo/script.sh

Now 2 files are created in the same path as of script.sh, these files are with extensions .x.c (ASCII C program text) and .x (executable binary file)

/tmp/demo/script.sh.x can be renamed and shared across and it is not possible to view the contents of this binary file.

/tmp/demo/script.sh.x can be used to execute and share – As it is encrypted and secured.

For feedback, queries and clarifications then please submit using below comment section.