Showing posts with label Python. Show all posts
Showing posts with label Python. Show all posts

Friday, 1 May 2020

Internet Speed Test in Linux Terminal

speedtest using python and fast

  python
$ python3 --version
  Python 3.8.2
$ cat /etc/redhat-release
  CentOS Linux release 7.7.1908 (Core)

$ git clone https://github.com/jpmolekunnel/Speed.git
$ cd Speed/
$ python speedtest.py
  Retrieving speedtest.net configuration...
  Testing from Comcast Cable (71.214.251.133)...
  Retrieving speedtest.net server list...
  Selecting best server based on ping...
  Hosted by Sprint (Fairfax, SC) [114.89 km]: 75.946 ms
  Testing download speed................................................................................
  Download: 8.19 Mbit/s
  Testing upload speed.....................................................................................................
  .Upload: 5.94 Mbit/s

  fast
$ wget https://github.com/ddo/fast/releases/download/v0.0.4/fast_linux_amd64 -O fast
$ chmod +x fast
$ ./fast
   -> 11.64 Mbps

Ref:- addictivetips.com tecmint.com

Monday, 27 April 2020

Install Python 3.8 using tarball in Linux

Install Python 3.8.2

$ cat /etc/redhat-release
  CentOS Linux release 7.7.1908 (Core)

$ python --version
  Python 2.7.5
$ which python
  /usr/bin/python

$ yum update
$ yum install yum-utils
$ yum-builddep python3

$ wget https://www.python.org/ftp/python/3.8.2/Python-3.8.2.tgz
$ tar -xvzf Python-3.8.2.tgz
$ cd Python-3.8.2

$ ./configure --enable-optimizations
$ make
$ make test
$ make install

$ python3.8 --version
  Python 3.8.2
$ which python3.8
  /usr/local/bin/python3.8

Since the python2.7 is a default system wide python interpreter and need explicitly set to new version. To change python version only for a single user edit ~/.bashrc.

$ vi ~/.bashrc
  alias python='/usr/local/bin/python3.8'
$ cd /root
$ . .bashrc #apply changes

$ python
  Python 3.8.2 (default, Apr 27 2020, 08:41:59)
  [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux
  Type "help", "copyright", "credits" or "license" for more information.
  >>>

Ref:- linuxconfig.org