Sunday, April 3, 2022

Syntax Highlighter



Title: Syntax Highlighter











  /* HelloWorld.java
   */

  public class HelloWorld
  {
      public static void main(String[] args) {
          System.out.println("Hello World!");
      }
  }

Sunday, March 27, 2022

Setting Up your Linux Server (Rocky Linux 8) from Scratch.

Date: 03/27/2022
----------------

### Check Motherboard Model
[root@localhost TEST]# dmidecode -t 2
        Manufacturer: Gigabyte Technology Co., Ltd.
        Product Name: Z77M-D3H-MVP
        Version: x.x
        Serial Number: To be filled by O.E.M.
        Asset Tag: To be filled by O.E.M.
        Features:
                Board is a hosting board
                Board is replaceable
        Location In Chassis: To be filled by O.E.M.
        Chassis Handle: 0x0003
        Type: Motherboard
        Contained Object Handles: 0

### RAM Upgrade
Compatible upgrades
DRAM

Compatible memory for:
GA-Z77M-D3H

Crucial 8GB DDR3L-1600 UDIMM
CT102464BD160B
Configuration ID: CT3328288
DDR3-1600 • CL=11 • NON-ECC • UDIMM • 240-pin • 1.35V • 2Rx8 • PC3-12800

### HARD DISK
Last login: Tue Mar 29 08:46:18 2022 from 192.168.1.239
[malex@localhost ~]$  sudo lshw -class disk
  *-disk:0
       description: ATA Disk
       product: WDC WD20EZAZ-00L
       vendor: Western Digital
       physical id: 0
       bus info: scsi@0:0.0.0
       logical name: /dev/sda
       version: 0A80
       serial: WD-WX72D715ZJ7H
       size: 1863GiB (2TB)
       capabilities: gpt-1.00 partitioned partitioned:gpt
       configuration: ansiversion=5 guid=53cbf7a0-3d1b-47a4-9236-1a4faaa21750 logicalsectorsize=512 sectorsize=4096
  *-disk:1
       description: ATA Disk
       product: WDC WD10EZEX-00B
       vendor: Western Digital
       physical id: 1
       bus info: scsi@1:0.0.0
       logical name: /dev/sdb
       version: 1A01
       serial: WD-WCC3F3007000
       size: 931GiB (1TB)
       capabilities: partitioned partitioned:dos
       configuration: ansiversion=5 logicalsectorsize=512 sectorsize=4096 signature=aa05b1f1
[malex@localhost ~]$

### INSTALLATION OF OS
1. Download the latest image from URL: https://download.rockylinux.org/pub/rocky/8/isos/x86_64/Rocky-8.5-x86_64-minimal.iso.
2. From Windows 10 or another Linux, create a bootable USB drive. See URL: https://github.com/balena-io/etcher/blob/master/docs/USER-DOCUMENTATION.md
3. Power on the machine and go to system bios to set the primary boot to the USB.
4. Insert bootable USB and and reboot machine.
5. When the booting is done, it should prompt to install Rocky Linux 8.
6. Install the minimal setup. Manually change partition if necessary.

	[root@localhost .ssh]# lsblk
	NAME                  MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
	sda                     8:0    0   1.8T  0 disk
	├─sda1                  8:1    0   600M  0 part /boot/efi
	├─sda2                  8:2    0     1G  0 part /boot
	└─sda3                  8:3    0   1.8T  0 part
	  ├─rl-root           253:0    0    70G  0 lvm  /
	  ├─rl-swap           253:1    0   7.8G  0 lvm  [SWAP]
	  ├─rl-usr            253:2    0   300G  0 lvm  /usr
	  ├─rl-var            253:6    0 432.1G  0 lvm  /var
	  ├─rl-tmp            253:7    0  46.6G  0 lvm  /tmp
	  ├─rl-opt            253:8    0 279.4G  0 lvm  /opt
	  ├─rl-usr_local      253:9    0   468M  0 lvm  /usr/local
	  ├─rl-home           253:10   0 433.7G  0 lvm  /home
	  ├─rl-var_lib_docker 253:11   0   291G  0 lvm  /var/lib/docker
	  └─rl-apps           253:12   0   468M  0 lvm  /apps
	sdb                     8:16   0 931.5G  0 disk
	├─sdb1                  8:17   0     1G  0 part
	└─sdb2                  8:18   0 930.5G  0 part
	  ├─cl-swap           253:3    0   7.8G  0 lvm
	  ├─cl-home           253:4    0 872.7G  0 lvm  /home/thermalite
	  └─cl-root           253:5    0    50G  0 lvm  /home/theroot
	[root@localhost .ssh]#

7. After installation is complete, you can login as root.

### SETUP SUDO FOR malex

# sudo su -
	vi /etc/sudoers
	cat /etc/sudoers | grep malex
	malex   ALL=(ALL)       NOPASSWD:ALL
	
### SETUP BASH PROFILE
    vi ~/.bash_profile
	cat ~/.bash_profile


	# User specific environment and startup programs
	export NVM_DIR="$HOME/.nvm"
	[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
	[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion

	parse_git_branch() {
		 git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
	}
	export PS1="\[\e[97;104m\] \u@\h \[\e[30;43m\]\w\[\e[97;45m\]\$(parse_git_branch)\[\e[0m\] $ "


### CONFIGURATION OF ETHERNET
1. Then first, try to check the state of the network interface and details using nmcli. The nmcli is a command-line tool for controlling the NetworkManager service. Use the following command to check.
# nmcli device status
2. Run the tool nmtui to configure the network interface. The nmtui is part of the NetworkManager tool which gives you a nice UI to configure the network. This is part of the package NetworkManager-tui and should be installed by default when you have completed the installation of the minimal server.
# nmtui
3. Click on Edit a connection in the nmtui window.
4. Select the interface name: ensp02
5. In the Edit Connection window, choose Automatic for IPv4 and IPv6. And select Automatically Connect. Press ok once done.

	[root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-enp2s0
	TYPE=Ethernet
	PROXY_METHOD=none
	BROWSER_ONLY=no
	BOOTPROTO=none
	DEFROUTE=yes
	IPV4_FAILURE_FATAL=no
	IPV6INIT=yes
	IPV6_AUTOCONF=yes
	IPV6_DEFROUTE=yes
	IPV6_FAILURE_FATAL=no
	IPV6_ADDR_GEN_MODE=stable-privacy
	NAME=enp2s0
	UUID=64d0bc95-c8bd-45c7-8274-00ef8c74d6f7
	DEVICE=enp2s0
	ONBOOT=yes
	IPADDR=192.168.1.80
	PREFIX=24
	GATEWAY=192.168.1.1
	DNS1=8.8.8.8
	DNS2=192.168.1.1
	USRCTL=no

6. Restart the NetworkManager service via the systemd systemctl using the following command.
# systemctl restart NetworkManager
7. If all goes well, you should be connected to the network and internet in the minimal installation of CentOS, RHEL, Rocky Linux server. Provided your network has internet connectivity. You can use ping to verify whether it is working.
# ping google.com

### SETUP SSH
Enable ssh service on Rocky Linux step by step instructions

# sudo su - {
	dnf install openssh-server
	systemctl start sshd
	systemctl status sshd 
	systemctl enable sshd
	firewall-cmd --zone=public --permanent --add-service=ssh
	ssh malex@192.168.1.100
	ssh-keygen -t rsa -b 4096 -C "malex@thermalite"
	
	## REFERENCE: https://linuxize.com/post/how-to-setup-passwordless-ssh-login/
	## BACKUP: /home/malex/.ssh/authorized_keys	
	
	dnf install nmap -y
	nmap localhost -vv
}	


### SETUP git as root
	dnf install git -y

### SETUP curl as root
	dnf install curl -y

	
### SETUP xRDP
## URL: https://javalinpilipinas.blogspot.com/search?q=xrdp

### INSTALL CHROME BROWSER

sudo su - {
	dnf install wget -y
	wget https://dl.google.com/linux/linux_signing_key.pub
    rpm --import linux_signing_key.pub
	wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
	dnf install google-chrome-stable_current_x86_64.rpm -y
}	
	
### INSTALL DOCKER

sudo su - {
  dnf update -y
  dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
  dnf repolist -v
  dnf list docker-ce --showduplicates | sort -r
  dnf install -y docker-ce
  systemctl start docker
  systemctl enable docker
  systemctl status docker
}  
	malex@localhost ~ $ sudo usermod -aG docker $USER
	malex@localhost ~ $ id $USER
	malex@localhost ~ $ rpm -qa | grep docker
	malex@localhost ~ $ docker --version
	malex@localhost ~ $ docker info
	malex@localhost ~ $ sudo docker info
	malex@localhost ~ $ docker images ls
	malex@localhost ~ $ sudo chmod 666 /var/run/docker.sock
	malex@localhost ~ $ docker images ls
	malex@localhost ~ $ docker --version
	malex@localhost ~ $ docker info
	malex@localhost ~ $ docker run hello-world
	malex@localhost ~ $ docker pull alpine
	malex@localhost ~ $ docker images
	malex@localhost ~ $ docker run -it --rm alpine /bin/sh	
	
sudo su - {
	dnf install -y curl
	curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
	chmod +x /usr/local/bin/docker-compose
	docker-compose --version
} 
	
### SETUP DOCKER CONTAINERS
## Dockerhub Account: azmadriaga@gmail.com		 / (Z878=nvJ2$czx?	/ 5feb708a-51f7-4181-983d-7ccaebd93d84

	1. HTTP
	docker pull httpd
	  $ mkdir www-httpd
	  $ echo "Hello, world.httpd" > www-httpd/index.html 
	  $ chmod -R 755 www-httpd/
	docker run -dit --name httpd -p 8080:80 -v /home/malex/www-httpd/:/usr/local/apache2/htdocs/ httpd
	  $ curl http://localhost:8080

	2. nginx
	docker pull nginx
	  $ mkdir www-nginx
	  $ echo "Hello, world.nginx" > www-nginx/index.html   
	  $ chmod -R 755 www-nginx/
	docker run -dit --name nginx -p 80:80 -v /home/malex/www-nginx/:/usr/share/nginx/html:ro -d nginx
	  $ curl http://localhost

 	3. Jenkins
	docker pull jenkins/jenkins:lts-jdk11
	  $ mkdir www-jenkins
	  $ chmod -R 755 www-jenkins/
	docker run -dit --name jenkins -v /home/malex/www-jenkins:/var/jenkins_home -p 9090:8080 -p 50000:50000 jenkins/jenkins:lts-jdk11
	  $ cat www-jenkins/secrets/initialAdminPassword
	  Admin user: 
	    Username: jenkins
	    Password: docker7691!
	
	  $ Open Chrome browser URL http://192.168.1.100:9090/
	  
	4. MS-SQL Server
	docker pull mcr.microsoft.com/mssql/server
	docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=docker7691!" -e "MSSQL_PID=Express" -p 1435:1433 -d mcr.microsoft.com/mssql/server:2019-latest
	docker exec -it 3bb987b6ae39 /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P docker7691!

	On your Windows 10, open SQL Server Management Studio
	Server type: Database Engine
	Server name: 192.168.1.80,1435
	Authentication: SQL Server Authentication
	Login: sa
	Password: docker7691!
	
	jTDS - SQL Server and Sybase JDBC driver: https://sourceforge.net/projects/jtds/
	## In SQL Developer, Tools->Preferences->Database-> Third Party JDBC Drivers ->Add Entry...C:\Program Files\jdbc\jtds-1.2.8.jar  -> OK
	## Restart SQL Developer
	## Create new connection
	On your Windows 10, open SQL Developer
	Name: MS-SQL Server Connection
	Database Type: SQLServer
	Username: sa
	Password: docker7691!
	Hostname: 192.168.1.100
	Port: 1435
	
	5. Postgresql
	docker pull postgres
	docker run --name postgres -e POSTGRES_PASSWORD=docker7691! -p 5432:5432 -d postgres
	
	## In SQL Developer, Tools->Preferences->Database-> Third Party JDBC Drivers ->Add Entry...C:\Program Files\jdbc\postgresql-42.3.3.jar  -> OK
	## Restart SQL Developer
	## Create new connection
	On your Windows 10, open SQL Developer
	Name: Postgresql Connection
	Database Type: Postgresql
	Username: postgres
	Password: docker7691!
	Hostname: 192.168.1.80/postgres?
	Port: 5432
	
	6. MySQL
	docker pull mysql
	docker run --name mysql -e MYSQL_ROOT_PASSWORD=docker7691! -p 3306:3306 -d mysql
	sudo firewall-cmd --add-service=mysql --permanent
	sudo firewall-cmd --reload
	
	
	#docker run -it --network some-network --rm mysql mysql -hsome-mysql -uexample-user -p
	#docker run -it --rm mysql mysql -hsome.mysql.host -usome-mysql-user -p
	
	## In SQL Developer, Tools->Preferences->Database-> Third Party JDBC Drivers ->Add Entry...C:\Program Files\jdbc\mysql-connector-java-8.0.28.jar  -> OK
	## Restart SQL Developer
	## Create new connection
	On your Windows 10, open SQL Developer
	Name: MySQL Connection
	Database Type: MySQL
	Username: root
	Password: docker7691!
	Hostname: 192.168.1.100
	Port: 3306

	7. Oracle
	docker login container-registry.oracle.com
	Username: 
	Password: 
	Login Succeeded
	
	  $ git clone https://github.com/oracle/docker-images.git
	  $ cd /home/malex/docker-images/OracleDatabase/SingleInstance/dockerfiles
	  $ ./buildContainerImage.sh -v 19.3.0 -s
	  $ mkdir -p /home/malex/www-oracle
	  $ chmod -R a+rxw /home/malex/www-oracle
	  $ sudo firewall-cmd --add-port=1521/tcp --permanent
	  $ sudo sudo firewall-cmd --reload
	  
	docker run -d --name oracle -p 1521:1521 -p 5500:5500 -e ORACLE_SID=test -e ORACLE_PWD=docker7691! -v /home/malex/www-oracle:/opt/oracle/oradata oracle/database:19.3.0-se2
	docker container ls
		CONTAINER ID   IMAGE                          
		fbe1c71ca604   oracle/database:19.3.0-se2  
		
	docker container commit fbe1c71ca604 azmadriaga/oracle-19.3.0-se2:latest
	docker images
		REPOSITORY                       TAG          IMAGE ID       CREATED          SIZE
		azmadriaga/oracle-19.3.0-se2     latest       2c603a2b0324   19 seconds ago   6.96GB

	docker login
		Username: 
		Password: 

	docker push azmadriaga/oracle-19.3.0-se2:latest
	docker logs fbe1c71ca604 -f

		ORACLE EDITION: STANDARD

		LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 27-MAR-2022 18:25:39

		Copyright (c) 1991, 2019, Oracle.  All rights reserved.

		Starting /opt/oracle/product/19c/dbhome_1/bin/tnslsnr: please wait...

		TNSLSNR for Linux: Version 19.0.0.0.0 - Production
		System parameter file is /opt/oracle/product/19c/dbhome_1/network/admin/listener.ora
		Log messages written to /opt/oracle/diag/tnslsnr/fbe1c71ca604/listener/alert/log.xml
		Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
		Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))

		Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
		STATUS of the LISTENER
		------------------------
		Alias                     LISTENER
		Version                   TNSLSNR for Linux: Version 19.0.0.0.0 - Production
		Start Date                27-MAR-2022 18:25:41
		Uptime                    0 days 0 hr. 0 min. 2 sec
		Trace Level               off
		Security                  ON: Local OS Authentication
		SNMP                      OFF
		Listener Parameter File   /opt/oracle/product/19c/dbhome_1/network/admin/listener.ora
		Listener Log File         /opt/oracle/diag/tnslsnr/fbe1c71ca604/listener/alert/log.xml
		Listening Endpoints Summary...
		  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
		  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))
		The listener supports no services
		The command completed successfully
		[WARNING] [DBT-06208] The 'SYS' password entered does not conform to the Oracle recommended standards.
		   CAUSE:
		a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
		b.The password entered is a keyword that Oracle does not recommend to be used as password
		   ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
		[WARNING] [DBT-06208] The 'SYSTEM' password entered does not conform to the Oracle recommended standards.
		   CAUSE:
		a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
		b.The password entered is a keyword that Oracle does not recommend to be used as password
		   ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
		[WARNING] [DBT-06208] The 'PDBADMIN' password entered does not conform to the Oracle recommended standards.
		   CAUSE:
		a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
		b.The password entered is a keyword that Oracle does not recommend to be used as password
		   ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
		Prepare for db operation
		8% complete
		Copying database files
		31% complete
		Creating and starting Oracle instance


		   $ sqlplus SYS/docker7691!@//192.168.1.100:1521/test as SYSDBA
		
		## On Windows where SQL Developer will run, create a c:\oracle\tnsnames.ora.		
		thermalite =
		(DESCRIPTION_LIST =
		  (DESCRIPTION =
			(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.100)(PORT = 1521))
			(CONNECT_DATA = 
			   (SERVER = DEDICATED)
			   (SID = test)
			)
		  )
		)
		## In SQL Developer, Tools->Preferences->Database-> + ->Advanced -> Tnsnames Directory: c:\oracle\tnsnames.ora. -> OK
		## In SQL Developer, Tools->Preferences->Database-> Third Party JDBC Drivers ->Add Entry...C:\Program Files\jdbc\mysql-connector-java-8.0.28.jar  -> OK
		## Restart SQL Developer
		## Create new connection
		On your Windows 10, open SQL Developer
		Name: Oracle Connection
		Database Type: Oracle
		Username: SYS
		Role: SYSDBA
		Password: docker7691!
		Connection Type: TNS
		Network Alias: thermalite
		
		
	8. Portainer
		docker pull portainer/portainer-ce
		docker volume ls
		docker volume create portainer_data
		docker run -d -p 8007:8000 -p 9007:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data/portainer/portainer
		
		
		






Saturday, January 29, 2022

How to download your Youtube videos using command line

1. Download your version of youtube-dl from https://youtube-dl.org/
2. For Windows 10, download the file https://github.com/ytdl-org/youtube-dl/releases/download/2021.12.17/youtube-dl.exe
3. Copy the file youtube-dl.exe into the d:\youtube-dl\ directory
4. To download a youtube video, open a Windows Powershell and run: 

Examples:
PS D:\youtube-dl> .\youtube-dl.exe https://www.youtube.com/watch?v=pChVWAVY7RU 
PS D:\youtube-dl> .\youtube-dl -o " d:/youtube-dl/Downloads/%(title)s" http://www.youtube.com/watch?v=rnvK2TIhYns


Note:
1. For documentation , please check https://github.com/ytdl-org/youtube-dl/blob/master/README.md
2. For help, run: youtube-dl -h
3. Use the -o option with youtube-dl to manually give a location for the downloaded files:

youtube-dl -o "~/Desktop/%(title)s.%(ext)s" 'youtube file url'
and of course substitute your actual url for 'youtube file url'. This example sends the completed download to your Desktop.

4. Create a configuration file for youtube-dl as follows:

touch ~/.config/youtube-dl.conf
Then set a default download location in this file:

--output "~/Desktop/%(title)s.%(ext)s"
With this in place all downloaded files will automatically go to your Desktop.


From: https://askubuntu.com/questions/373336/where-does-youtube-dl-download-the-videos-to#:~:text=By%20default%20youtube%2Ddl%20downloads,%2C%20there%20is%20%2Df%20option.

#!/bin/sh
answer=""
tput clear
tput cup 05 10
echo "Give the YouTube URL: \c"
# Here you paste the YT-video-URL by ctrl+shift+V
read answer
# The follwing command will display a list of video quality options to choose from
youtube-dl -F $answer
echo
# Here you give the number shown in first column as per your choice
echo "Select Quality (Choose a number): \c"
read qual
# If you don't want to download and quit the shell, give 99
if [ $qual -ne 99 ]
then
youtube-dl -f $qual -o "/home/users/$([System.Environment]::UserName)/Videos/%(title)s.%(ext)s" $answer
else
exit 0
fi

How to execute Firewall Commands and Settings

[root@thermalite ~]# history 1000 | cut -c 8- | grep firewall-cmd | sort -u
firewall-cmd --add-port=3389/tcp --permanent firewall-cmd --add-service=http --permanent firewall-cmd --add-service=postgresql --permanent firewall-cmd --get-active-zones firewall-cmd --list-all firewall-cmd --permanent --add-service=http firewall-cmd --permanent --add-service=jenkins firewall-cmd --permanent --new-service=jenkins firewall-cmd --permanent --service=jenkins --add-port=9191/tcp firewall-cmd --permanent --zone=public --add-port=9191/tcp firewall-cmd --permanent --service=jenkins --set-description="Jenkins service firewalld port exceptions" firewall-cmd --permanent --service=jenkins --set-short="Jenkins Service Ports" firewall-cmd --permanent --zone= --add-service=jenkins; firewall-cmd --reload firewall-cmd --zone=home --add-service=http --permanent firewall-cmd --set-default-zone FedoraServer firewall-cmd --set-default-zone home firewall-cmd --set-active-zones=FedoraServer firewall-cmd --zone=public --add-service=http --permanent firewall-cmd --zone=home --list-all [root@thermalite ~]#

How to Install/Upgrade Java on CentOS 8/Rocky Linux 8


# 1. update your system

[root@thermalite ~]# dnf update -y
Repository packages-microsoft-com-prod is listed more than once in the configuration
Last metadata expiration check: 0:00:11 ago on Sat 29 Jan 2022 09:07:32 AM EST.
Dependencies resolved.
=============================================================================================================
 Package                     Arch   Version                   Repository                                Size
=============================================================================================================
Upgrading:
 java-1.8.0-openjdk          x86_64 1:1.8.0.322.b06-2.el8_5   appstream                                341 k
 java-1.8.0-openjdk-devel    x86_64 1:1.8.0.322.b06-2.el8_5   appstream                                9.8 M
 java-1.8.0-openjdk-headless x86_64 1:1.8.0.322.b06-2.el8_5   appstream                                 34 M
 mssql-server                x86_64 15.0.4198.2-10            packages-microsoft-com-mssql-server-2019 238 M

Transaction Summary
=============================================================================================================
Upgrade  4 Packages

Total download size: 282 M
Downloading Packages:
(1/4): java-1.8.0-openjdk-1.8.0.322.b06-2.el8_5.x86_64.rpm                   2.9 MB/s | 341 kB     00:00
(2/4): java-1.8.0-openjdk-devel-1.8.0.322.b06-2.el8_5.x86_64.rpm              20 MB/s | 9.8 MB     00:00
(3/4): java-1.8.0-openjdk-headless-1.8.0.322.b06-2.el8_5.x86_64.rpm           13 MB/s |  34 MB     00:02
(4/4): mssql-server-15.0.4198.2-10.x86_64.rpm                                 24 MB/s | 238 MB     00:10
-------------------------------------------------------------------------------------------------------------
Total                                                                         27 MB/s | 282 MB     00:10
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Running scriptlet: java-1.8.0-openjdk-headless-1:1.8.0.322.b06-2.el8_5.x86_64                          1/1
  Preparing        :                                                                                     1/1
  Running scriptlet: java-1.8.0-openjdk-headless-1:1.8.0.322.b06-2.el8_5.x86_64                          1/1
  Upgrading        : java-1.8.0-openjdk-headless-1:1.8.0.322.b06-2.el8_5.x86_64                          1/8
  Running scriptlet: java-1.8.0-openjdk-headless-1:1.8.0.322.b06-2.el8_5.x86_64                          1/8
  Upgrading        : java-1.8.0-openjdk-1:1.8.0.322.b06-2.el8_5.x86_64                                   2/8
  Running scriptlet: java-1.8.0-openjdk-1:1.8.0.322.b06-2.el8_5.x86_64                                   2/8
  Upgrading        : java-1.8.0-openjdk-devel-1:1.8.0.322.b06-2.el8_5.x86_64                             3/8
  Running scriptlet: java-1.8.0-openjdk-devel-1:1.8.0.322.b06-2.el8_5.x86_64                             3/8
  Running scriptlet: mssql-server-15.0.4198.2-10.x86_64                                                  4/8
  Upgrading        : mssql-server-15.0.4198.2-10.x86_64                                                  4/8
  Running scriptlet: mssql-server-15.0.4198.2-10.x86_64                                                  4/8
  Cleanup          : java-1.8.0-openjdk-devel-1:1.8.0.312.b07-2.el8_5.x86_64                             5/8
  Running scriptlet: java-1.8.0-openjdk-devel-1:1.8.0.312.b07-2.el8_5.x86_64                             5/8
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.312.b07-2.el8_5.x86_64/bin/javac has not been configured as an alternative for javac
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.312.b07-2.el8_5.x86_64 has not been configured as an alternative for java_sdk_openjdk
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.312.b07-2.el8_5.x86_64 has not been configured as an alternative for java_sdk_1.8.0
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.312.b07-2.el8_5.x86_64 has not been configured as an alternative for java_sdk_1.8.0_openjdk

  Cleanup          : mssql-server-15.0.4188.2-3.x86_64                                                   6/8
  Running scriptlet: mssql-server-15.0.4188.2-3.x86_64                                                   6/8
  Cleanup          : java-1.8.0-openjdk-1:1.8.0.312.b07-2.el8_5.x86_64                                   7/8
  Running scriptlet: java-1.8.0-openjdk-1:1.8.0.312.b07-2.el8_5.x86_64                                   7/8
  Cleanup          : java-1.8.0-openjdk-headless-1:1.8.0.312.b07-2.el8_5.x86_64                          8/8
  Running scriptlet: java-1.8.0-openjdk-headless-1:1.8.0.312.b07-2.el8_5.x86_64                          8/8
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.312.b07-2.el8_5.x86_64/jre/bin/java has not been configured as an alternative for java
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.312.b07-2.el8_5.x86_64/jre has not been configured as an alternative for jre_openjdk
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.312.b07-2.el8_5.x86_64/jre has not been configured as an alternative for jre_1.8.0
/usr/lib/jvm/jre-1.8.0-openjdk-1.8.0.312.b07-2.el8_5.x86_64 has not been configured as an alternative for jre_1.8.0_openjdk
warning: %postun(java-1.8.0-openjdk-headless-1:1.8.0.312.b07-2.el8_5.x86_64) scriptlet failed, exit status 2

Error in POSTUN scriptlet in rpm package java-1.8.0-openjdk-headless
  Running scriptlet: java-1.8.0-openjdk-1:1.8.0.322.b06-2.el8_5.x86_64                                   8/8
  Running scriptlet: java-1.8.0-openjdk-devel-1:1.8.0.322.b06-2.el8_5.x86_64                             8/8
  Running scriptlet: java-1.8.0-openjdk-headless-1:1.8.0.312.b07-2.el8_5.x86_64                          8/8
  Verifying        : java-1.8.0-openjdk-1:1.8.0.322.b06-2.el8_5.x86_64                                   1/8
  Verifying        : java-1.8.0-openjdk-1:1.8.0.312.b07-2.el8_5.x86_64                                   2/8
  Verifying        : java-1.8.0-openjdk-devel-1:1.8.0.322.b06-2.el8_5.x86_64                             3/8
  Verifying        : java-1.8.0-openjdk-devel-1:1.8.0.312.b07-2.el8_5.x86_64                             4/8
  Verifying        : java-1.8.0-openjdk-headless-1:1.8.0.322.b06-2.el8_5.x86_64                          5/8
  Verifying        : java-1.8.0-openjdk-headless-1:1.8.0.312.b07-2.el8_5.x86_64                          6/8
  Verifying        : mssql-server-15.0.4198.2-10.x86_64                                                  7/8
  Verifying        : mssql-server-15.0.4188.2-3.x86_64                                                   8/8

Upgraded:
  java-1.8.0-openjdk-1:1.8.0.322.b06-2.el8_5.x86_64
  java-1.8.0-openjdk-devel-1:1.8.0.322.b06-2.el8_5.x86_64
  java-1.8.0-openjdk-headless-1:1.8.0.322.b06-2.el8_5.x86_64
  mssql-server-15.0.4198.2-10.x86_64

Complete!

# 2. check version

[root@thermalite ~]# java -version
openjdk version "1.8.0_322"
OpenJDK Runtime Environment (build 1.8.0_322-b06)
OpenJDK 64-Bit Server VM (build 25.322-b06, mixed mode)
[root@thermalite ~]#


# 3. update openjava version to 11

[root@thermalite ~]# dnf install java-11-openjdk-devel -y
Repository packages-microsoft-com-prod is listed more than once in the configuration
Last metadata expiration check: 0:00:21 ago on Sat 29 Jan 2022 09:16:15 AM EST.
Dependencies resolved.
=============================================================================================================
 Package                           Architecture    Version                          Repository          Size
=============================================================================================================
Installing:
 java-11-openjdk-devel             x86_64          1:11.0.14.0.9-2.el8_5            appstream          3.4 M
Installing dependencies:
 java-11-openjdk                   x86_64          1:11.0.14.0.9-2.el8_5            appstream          266 k
 java-11-openjdk-headless          x86_64          1:11.0.14.0.9-2.el8_5            appstream           40 M

Transaction Summary
=============================================================================================================
Install  3 Packages

Total download size: 43 M
Installed size: 177 M
Downloading Packages:
(1/3): java-11-openjdk-11.0.14.0.9-2.el8_5.x86_64.rpm                        1.1 MB/s | 266 kB     00:00
(2/3): java-11-openjdk-devel-11.0.14.0.9-2.el8_5.x86_64.rpm                  7.7 MB/s | 3.4 MB     00:00
(3/3): java-11-openjdk-headless-11.0.14.0.9-2.el8_5.x86_64.rpm                15 MB/s |  40 MB     00:02
-------------------------------------------------------------------------------------------------------------
Total                                                                         16 MB/s |  43 MB     00:02
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Running scriptlet: java-11-openjdk-headless-1:11.0.14.0.9-2.el8_5.x86_64                               1/1
  Preparing        :                                                                                     1/1
  Installing       : java-11-openjdk-headless-1:11.0.14.0.9-2.el8_5.x86_64                               1/3
  Running scriptlet: java-11-openjdk-headless-1:11.0.14.0.9-2.el8_5.x86_64                               1/3
  Installing       : java-11-openjdk-1:11.0.14.0.9-2.el8_5.x86_64                                        2/3
  Running scriptlet: java-11-openjdk-1:11.0.14.0.9-2.el8_5.x86_64                                        2/3
  Installing       : java-11-openjdk-devel-1:11.0.14.0.9-2.el8_5.x86_64                                  3/3
  Running scriptlet: java-11-openjdk-devel-1:11.0.14.0.9-2.el8_5.x86_64                                  3/3
  Running scriptlet: java-11-openjdk-1:11.0.14.0.9-2.el8_5.x86_64                                        3/3
  Running scriptlet: java-11-openjdk-devel-1:11.0.14.0.9-2.el8_5.x86_64                                  3/3
  Verifying        : java-11-openjdk-1:11.0.14.0.9-2.el8_5.x86_64                                        1/3
  Verifying        : java-11-openjdk-devel-1:11.0.14.0.9-2.el8_5.x86_64                                  2/3
  Verifying        : java-11-openjdk-headless-1:11.0.14.0.9-2.el8_5.x86_64                               3/3

Installed:
  java-11-openjdk-1:11.0.14.0.9-2.el8_5.x86_64           java-11-openjdk-devel-1:11.0.14.0.9-2.el8_5.x86_64
  java-11-openjdk-headless-1:11.0.14.0.9-2.el8_5.x86_64

Complete!


# 4. use alternative to set the default version

[root@thermalite ~]# alternatives --config java

There are 2 programs which provide 'java'.

  Selection    Command
-----------------------------------------------
*+ 1           java-1.8.0-openjdk.x86_64 (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.322.b06-2.el8_5.x86_64/jre/bin/java)
   2           java-11-openjdk.x86_64 (/usr/lib/jvm/java-11-openjdk-11.0.14.0.9-2.el8_5.x86_64/bin/java)

Enter to keep the current selection[+], or type selection number: 2

# 5. check version

[malex@thermalite ~]$ java -version
openjdk version "11.0.14" 2022-01-18 LTS
OpenJDK Runtime Environment 18.9 (build 11.0.14+9-LTS)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.14+9-LTS, mixed mode, sharing)
[malex@thermalite ~]$

# 6. setting the JAVA_HOME Environment variable 

[root@thermalite ~]# vi /etc/profile.d/java.sh
[root@thermalite ~]# cat /etc/profile.d/java.sh
JAVA_HOME="/usr/lib/jvm/java-11-openjdk-11.0.14.0.9-2.el8_5.x86_64"
[root@thermalite ~]# source /etc/profile.d/java.sh
[root@thermalite ~]# echo $JAVA_HOME
/usr/lib/jvm/java-11-openjdk-11.0.14.0.9-2.el8_5.x86_64

[malex@thermalite ~]$ java -version
openjdk version "11.0.14" 2022-01-18 LTS
OpenJDK Runtime Environment 18.9 (build 11.0.14+9-LTS)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.14+9-LTS, mixed mode, sharing)
[malex@thermalite ~]$

Wednesday, January 26, 2022

How to prevent PuttyConnectionManager window from not maximizing after it is minimized


1. When you minimize PuttyCM, it disappears and stays on the system tray icon but wont get back the window when doouble clicking it. 

2. Go to the system tray, find the PuttyCM icon and Right-click Open.

3. Prevent/solve this issue of auto hide by disabling the feature ‘Hide when minimized‘ in Tools -> Options -> General.

How To Install NVM, NPM, Node, and NPX on CentOS/RHEL 8/Rocky Linux 8

Reference: https://tecadmin.net/install-nvm-centos-8/

## NVM stands for Node Version Manager is a command-line utility for managing Node versions. 
## Sometimes you required to deploy multiple node application with different-2 versions. 
## Nvm will help you here.


## 1. install curl on your system

[malex@thermalite ~]$ sudo dnf install curl
[sudo] password for malex:
Repository packages-microsoft-com-prod is listed more than once in the configuration
runner_gitlab-runner                                     1.2 kB/s | 862  B     00:00
runner_gitlab-runner-source                              1.6 kB/s | 862  B     00:00
Package curl-7.61.1-22.el8.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!

## 2. download nvm installer script

[malex@thermalite ~]$ curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 15462  100 15462    0     0   351k      0 --:--:-- --:--:-- --:--:--  351k
=> Downloading nvm from git to '/home/malex/.nvm'
=> Cloning into '/home/malex/.nvm'...
remote: Enumerating objects: 354, done.
remote: Counting objects: 100% (354/354), done.
remote: Compressing objects: 100% (302/302), done.
remote: Total 354 (delta 40), reused 157 (delta 27), pack-reused 0
Receiving objects: 100% (354/354), 206.94 KiB | 5.17 MiB/s, done.
Resolving deltas: 100% (40/40), done.
* (HEAD detached at FETCH_HEAD)
  master
=> Compressing and cleaning up git repository

=> Appending nvm source string to /home/malex/.bashrc
=> Appending bash_completion source string to /home/malex/.bashrc
=> Close and reopen your terminal to start using nvm or run the following to use it now:

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion

## 3. load this environment to set required configuration 
[malex@thermalite ~]$ source ~/.bashrc

## 4. check version of nvm
[malex@thermalite ~]$ nvm --version
0.39.1

## 5. list all the available version’s from remote for the installation on your system
[malex@thermalite ~]$ nvm ls-remote
        v0.1.14
        v0.1.15
        v0.1.16
        v0.1.17
        v0.1.18
        v0.1.19
        v0.1.20
        v0.1.21
        v0.1.22
        v0.1.23
        v0.1.24
        v0.1.25
        v0.1.26
        v0.1.27
        v0.1.28
        v0.1.29
        v0.1.30
        v0.1.31
        v0.1.32
        v0.1.33
        v0.1.90
        v0.1.91
        v0.1.92
        v0.1.93
        v0.1.94
        v0.1.95
        v0.1.96
        v0.1.97
        v0.1.98
        v0.1.99
       v0.1.100
       v0.1.101
       v0.1.102
       v0.1.103
       v0.1.104
         v0.2.0
         v0.2.1
         v0.2.2
         v0.2.3
         v0.2.4
         v0.2.5
         v0.2.6
         v0.3.0
         v0.3.1
         v0.3.2
         v0.3.3
         v0.3.4
         v0.3.5
         v0.3.6
         v0.3.7
         v0.3.8
         v0.4.0
         v0.4.1
         v0.4.2
         v0.4.3
         v0.4.4
         v0.4.5
         v0.4.6
         v0.4.7
         v0.4.8
         v0.4.9
        v0.4.10
        v0.4.11
        v0.4.12
         v0.5.0
         v0.5.1
         v0.5.2
         v0.5.3
         v0.5.4
         v0.5.5
         v0.5.6
         v0.5.7
         v0.5.8
         v0.5.9
        v0.5.10
         v0.6.0
         v0.6.1
         v0.6.2
         v0.6.3
         v0.6.4
         v0.6.5
         v0.6.6
         v0.6.7
         v0.6.8
         v0.6.9
        v0.6.10
        v0.6.11
        v0.6.12
        v0.6.13
        v0.6.14
        v0.6.15
        v0.6.16
        v0.6.17
        v0.6.18
        v0.6.19
        v0.6.20
        v0.6.21
         v0.7.0
         v0.7.1
         v0.7.2
         v0.7.3
         v0.7.4
         v0.7.5
         v0.7.6
         v0.7.7
         v0.7.8
         v0.7.9
        v0.7.10
        v0.7.11
        v0.7.12
         v0.8.0
         v0.8.1
         v0.8.2
         v0.8.3
         v0.8.4
         v0.8.5
         v0.8.6
         v0.8.7
         v0.8.8
         v0.8.9
        v0.8.10
        v0.8.11
        v0.8.12
        v0.8.13
        v0.8.14
        v0.8.15
        v0.8.16
        v0.8.17
        v0.8.18
        v0.8.19
        v0.8.20
        v0.8.21
        v0.8.22
        v0.8.23
        v0.8.24
        v0.8.25
        v0.8.26
        v0.8.27
        v0.8.28
         v0.9.0
         v0.9.1
         v0.9.2
         v0.9.3
         v0.9.4
         v0.9.5
         v0.9.6
         v0.9.7
         v0.9.8
         v0.9.9
        v0.9.10
        v0.9.11
        v0.9.12
        v0.10.0
        v0.10.1
        v0.10.2
        v0.10.3
        v0.10.4
        v0.10.5
        v0.10.6
        v0.10.7
        v0.10.8
        v0.10.9
       v0.10.10
       v0.10.11
       v0.10.12
       v0.10.13
       v0.10.14
       v0.10.15
       v0.10.16
       v0.10.17
       v0.10.18
       v0.10.19
       v0.10.20
       v0.10.21
       v0.10.22
       v0.10.23
       v0.10.24
       v0.10.25
       v0.10.26
       v0.10.27
       v0.10.28
       v0.10.29
       v0.10.30
       v0.10.31
       v0.10.32
       v0.10.33
       v0.10.34
       v0.10.35
       v0.10.36
       v0.10.37
       v0.10.38
       v0.10.39
       v0.10.40
       v0.10.41
       v0.10.42
       v0.10.43
       v0.10.44
       v0.10.45
       v0.10.46
       v0.10.47
       v0.10.48
        v0.11.0
        v0.11.1
        v0.11.2
        v0.11.3
        v0.11.4
        v0.11.5
        v0.11.6
        v0.11.7
        v0.11.8
        v0.11.9
       v0.11.10
       v0.11.11
       v0.11.12
       v0.11.13
       v0.11.14
       v0.11.15
       v0.11.16
        v0.12.0
        v0.12.1
        v0.12.2
        v0.12.3
        v0.12.4
        v0.12.5
        v0.12.6
        v0.12.7
        v0.12.8
        v0.12.9
       v0.12.10
       v0.12.11
       v0.12.12
       v0.12.13
       v0.12.14
       v0.12.15
       v0.12.16
       v0.12.17
       v0.12.18
    iojs-v1.0.0
    iojs-v1.0.1
    iojs-v1.0.2
    iojs-v1.0.3
    iojs-v1.0.4
    iojs-v1.1.0
    iojs-v1.2.0
    iojs-v1.3.0
    iojs-v1.4.1
    iojs-v1.4.2
    iojs-v1.4.3
    iojs-v1.5.0
    iojs-v1.5.1
    iojs-v1.6.0
    iojs-v1.6.1
    iojs-v1.6.2
    iojs-v1.6.3
    iojs-v1.6.4
    iojs-v1.7.1
    iojs-v1.8.1
    iojs-v1.8.2
    iojs-v1.8.3
    iojs-v1.8.4
    iojs-v2.0.0
    iojs-v2.0.1
    iojs-v2.0.2
    iojs-v2.1.0
    iojs-v2.2.0
    iojs-v2.2.1
    iojs-v2.3.0
    iojs-v2.3.1
    iojs-v2.3.2
    iojs-v2.3.3
    iojs-v2.3.4
    iojs-v2.4.0
    iojs-v2.5.0
    iojs-v3.0.0
    iojs-v3.1.0
    iojs-v3.2.0
    iojs-v3.3.0
    iojs-v3.3.1
         v4.0.0
         v4.1.0
         v4.1.1
         v4.1.2
         v4.2.0   (LTS: Argon)
         v4.2.1   (LTS: Argon)
         v4.2.2   (LTS: Argon)
         v4.2.3   (LTS: Argon)
         v4.2.4   (LTS: Argon)
         v4.2.5   (LTS: Argon)
         v4.2.6   (LTS: Argon)
         v4.3.0   (LTS: Argon)
         v4.3.1   (LTS: Argon)
         v4.3.2   (LTS: Argon)
         v4.4.0   (LTS: Argon)
         v4.4.1   (LTS: Argon)
         v4.4.2   (LTS: Argon)
         v4.4.3   (LTS: Argon)
         v4.4.4   (LTS: Argon)
         v4.4.5   (LTS: Argon)
         v4.4.6   (LTS: Argon)
         v4.4.7   (LTS: Argon)
         v4.5.0   (LTS: Argon)
         v4.6.0   (LTS: Argon)
         v4.6.1   (LTS: Argon)
         v4.6.2   (LTS: Argon)
         v4.7.0   (LTS: Argon)
         v4.7.1   (LTS: Argon)
         v4.7.2   (LTS: Argon)
         v4.7.3   (LTS: Argon)
         v4.8.0   (LTS: Argon)
         v4.8.1   (LTS: Argon)
         v4.8.2   (LTS: Argon)
         v4.8.3   (LTS: Argon)
         v4.8.4   (LTS: Argon)
         v4.8.5   (LTS: Argon)
         v4.8.6   (LTS: Argon)
         v4.8.7   (LTS: Argon)
         v4.9.0   (LTS: Argon)
         v4.9.1   (Latest LTS: Argon)
         v5.0.0
         v5.1.0
         v5.1.1
         v5.2.0
         v5.3.0
         v5.4.0
         v5.4.1
         v5.5.0
         v5.6.0
         v5.7.0
         v5.7.1
         v5.8.0
         v5.9.0
         v5.9.1
        v5.10.0
        v5.10.1
        v5.11.0
        v5.11.1
        v5.12.0
         v6.0.0
         v6.1.0
         v6.2.0
         v6.2.1
         v6.2.2
         v6.3.0
         v6.3.1
         v6.4.0
         v6.5.0
         v6.6.0
         v6.7.0
         v6.8.0
         v6.8.1
         v6.9.0   (LTS: Boron)
         v6.9.1   (LTS: Boron)
         v6.9.2   (LTS: Boron)
         v6.9.3   (LTS: Boron)
         v6.9.4   (LTS: Boron)
         v6.9.5   (LTS: Boron)
        v6.10.0   (LTS: Boron)
        v6.10.1   (LTS: Boron)
        v6.10.2   (LTS: Boron)
        v6.10.3   (LTS: Boron)
        v6.11.0   (LTS: Boron)
        v6.11.1   (LTS: Boron)
        v6.11.2   (LTS: Boron)
        v6.11.3   (LTS: Boron)
        v6.11.4   (LTS: Boron)
        v6.11.5   (LTS: Boron)
        v6.12.0   (LTS: Boron)
        v6.12.1   (LTS: Boron)
        v6.12.2   (LTS: Boron)
        v6.12.3   (LTS: Boron)
        v6.13.0   (LTS: Boron)
        v6.13.1   (LTS: Boron)
        v6.14.0   (LTS: Boron)
        v6.14.1   (LTS: Boron)
        v6.14.2   (LTS: Boron)
        v6.14.3   (LTS: Boron)
        v6.14.4   (LTS: Boron)
        v6.15.0   (LTS: Boron)
        v6.15.1   (LTS: Boron)
        v6.16.0   (LTS: Boron)
        v6.17.0   (LTS: Boron)
        v6.17.1   (Latest LTS: Boron)
         v7.0.0
         v7.1.0
         v7.2.0
         v7.2.1
         v7.3.0
         v7.4.0
         v7.5.0
         v7.6.0
         v7.7.0
         v7.7.1
         v7.7.2
         v7.7.3
         v7.7.4
         v7.8.0
         v7.9.0
        v7.10.0
        v7.10.1
         v8.0.0
         v8.1.0
         v8.1.1
         v8.1.2
         v8.1.3
         v8.1.4
         v8.2.0
         v8.2.1
         v8.3.0
         v8.4.0
         v8.5.0
         v8.6.0
         v8.7.0
         v8.8.0
         v8.8.1
         v8.9.0   (LTS: Carbon)
         v8.9.1   (LTS: Carbon)
         v8.9.2   (LTS: Carbon)
         v8.9.3   (LTS: Carbon)
         v8.9.4   (LTS: Carbon)
        v8.10.0   (LTS: Carbon)
        v8.11.0   (LTS: Carbon)
        v8.11.1   (LTS: Carbon)
        v8.11.2   (LTS: Carbon)
        v8.11.3   (LTS: Carbon)
        v8.11.4   (LTS: Carbon)
        v8.12.0   (LTS: Carbon)
        v8.13.0   (LTS: Carbon)
        v8.14.0   (LTS: Carbon)
        v8.14.1   (LTS: Carbon)
        v8.15.0   (LTS: Carbon)
        v8.15.1   (LTS: Carbon)
        v8.16.0   (LTS: Carbon)
        v8.16.1   (LTS: Carbon)
        v8.16.2   (LTS: Carbon)
        v8.17.0   (Latest LTS: Carbon)
         v9.0.0
         v9.1.0
         v9.2.0
         v9.2.1
         v9.3.0
         v9.4.0
         v9.5.0
         v9.6.0
         v9.6.1
         v9.7.0
         v9.7.1
         v9.8.0
         v9.9.0
        v9.10.0
        v9.10.1
        v9.11.0
        v9.11.1
        v9.11.2
        v10.0.0
        v10.1.0
        v10.2.0
        v10.2.1
        v10.3.0
        v10.4.0
        v10.4.1
        v10.5.0
        v10.6.0
        v10.7.0
        v10.8.0
        v10.9.0
       v10.10.0
       v10.11.0
       v10.12.0
       v10.13.0   (LTS: Dubnium)
       v10.14.0   (LTS: Dubnium)
       v10.14.1   (LTS: Dubnium)
       v10.14.2   (LTS: Dubnium)
       v10.15.0   (LTS: Dubnium)
       v10.15.1   (LTS: Dubnium)
       v10.15.2   (LTS: Dubnium)
       v10.15.3   (LTS: Dubnium)
       v10.16.0   (LTS: Dubnium)
       v10.16.1   (LTS: Dubnium)
       v10.16.2   (LTS: Dubnium)
       v10.16.3   (LTS: Dubnium)
       v10.17.0   (LTS: Dubnium)
       v10.18.0   (LTS: Dubnium)
       v10.18.1   (LTS: Dubnium)
       v10.19.0   (LTS: Dubnium)
       v10.20.0   (LTS: Dubnium)
       v10.20.1   (LTS: Dubnium)
       v10.21.0   (LTS: Dubnium)
       v10.22.0   (LTS: Dubnium)
       v10.22.1   (LTS: Dubnium)
       v10.23.0   (LTS: Dubnium)
       v10.23.1   (LTS: Dubnium)
       v10.23.2   (LTS: Dubnium)
       v10.23.3   (LTS: Dubnium)
       v10.24.0   (LTS: Dubnium)
       v10.24.1   (Latest LTS: Dubnium)
        v11.0.0
        v11.1.0
        v11.2.0
        v11.3.0
        v11.4.0
        v11.5.0
        v11.6.0
        v11.7.0
        v11.8.0
        v11.9.0
       v11.10.0
       v11.10.1
       v11.11.0
       v11.12.0
       v11.13.0
       v11.14.0
       v11.15.0
        v12.0.0
        v12.1.0
        v12.2.0
        v12.3.0
        v12.3.1
        v12.4.0
        v12.5.0
        v12.6.0
        v12.7.0
        v12.8.0
        v12.8.1
        v12.9.0
        v12.9.1
       v12.10.0
       v12.11.0
       v12.11.1
       v12.12.0
       v12.13.0   (LTS: Erbium)
       v12.13.1   (LTS: Erbium)
       v12.14.0   (LTS: Erbium)
       v12.14.1   (LTS: Erbium)
       v12.15.0   (LTS: Erbium)
       v12.16.0   (LTS: Erbium)
       v12.16.1   (LTS: Erbium)
       v12.16.2   (LTS: Erbium)
       v12.16.3   (LTS: Erbium)
       v12.17.0   (LTS: Erbium)
       v12.18.0   (LTS: Erbium)
       v12.18.1   (LTS: Erbium)
       v12.18.2   (LTS: Erbium)
       v12.18.3   (LTS: Erbium)
       v12.18.4   (LTS: Erbium)
       v12.19.0   (LTS: Erbium)
       v12.19.1   (LTS: Erbium)
       v12.20.0   (LTS: Erbium)
       v12.20.1   (LTS: Erbium)
       v12.20.2   (LTS: Erbium)
       v12.21.0   (LTS: Erbium)
       v12.22.0   (LTS: Erbium)
       v12.22.1   (LTS: Erbium)
       v12.22.2   (LTS: Erbium)
       v12.22.3   (LTS: Erbium)
       v12.22.4   (LTS: Erbium)
       v12.22.5   (LTS: Erbium)
       v12.22.6   (LTS: Erbium)
       v12.22.7   (LTS: Erbium)
       v12.22.8   (LTS: Erbium)
       v12.22.9   (Latest LTS: Erbium)
        v13.0.0
        v13.0.1
        v13.1.0
        v13.2.0
        v13.3.0
        v13.4.0
        v13.5.0
        v13.6.0
        v13.7.0
        v13.8.0
        v13.9.0
       v13.10.0
       v13.10.1
       v13.11.0
       v13.12.0
       v13.13.0
       v13.14.0
        v14.0.0
        v14.1.0
        v14.2.0
        v14.3.0
        v14.4.0
        v14.5.0
        v14.6.0
        v14.7.0
        v14.8.0
        v14.9.0
       v14.10.0
       v14.10.1
       v14.11.0
       v14.12.0
       v14.13.0
       v14.13.1
       v14.14.0
       v14.15.0   (LTS: Fermium)
       v14.15.1   (LTS: Fermium)
       v14.15.2   (LTS: Fermium)
       v14.15.3   (LTS: Fermium)
       v14.15.4   (LTS: Fermium)
       v14.15.5   (LTS: Fermium)
       v14.16.0   (LTS: Fermium)
       v14.16.1   (LTS: Fermium)
       v14.17.0   (LTS: Fermium)
       v14.17.1   (LTS: Fermium)
       v14.17.2   (LTS: Fermium)
       v14.17.3   (LTS: Fermium)
       v14.17.4   (LTS: Fermium)
       v14.17.5   (LTS: Fermium)
       v14.17.6   (LTS: Fermium)
       v14.18.0   (LTS: Fermium)
       v14.18.1   (LTS: Fermium)
       v14.18.2   (LTS: Fermium)
       v14.18.3   (Latest LTS: Fermium)
        v15.0.0
        v15.0.1
        v15.1.0
        v15.2.0
        v15.2.1
        v15.3.0
        v15.4.0
        v15.5.0
        v15.5.1
        v15.6.0
        v15.7.0
        v15.8.0
        v15.9.0
       v15.10.0
       v15.11.0
       v15.12.0
       v15.13.0
       v15.14.0
        v16.0.0
        v16.1.0
        v16.2.0
        v16.3.0
        v16.4.0
        v16.4.1
        v16.4.2
        v16.5.0
        v16.6.0
        v16.6.1
        v16.6.2
        v16.7.0
        v16.8.0
        v16.9.0
        v16.9.1
       v16.10.0
       v16.11.0
       v16.11.1
       v16.12.0
       v16.13.0   (LTS: Gallium)
       v16.13.1   (LTS: Gallium)
       v16.13.2   (Latest LTS: Gallium)
        v17.0.0
        v17.0.1
        v17.1.0
        v17.2.0
        v17.3.0
        v17.3.1
        v17.4.0

## 6. install the latest node version 

[malex@thermalite ~]$ nvm install lts/*
Downloading and installing node v16.13.2...
Downloading https://nodejs.org/dist/v16.13.2/node-v16.13.2-linux-x64.tar.xz...
################################################################################## 100.0%
Computing checksum with sha256sum
Checksums matched!
Now using node v16.13.2 (npm v8.1.2)
Creating default alias: default -> lts/* (-> v16.13.2)

## 7. list all the installed node versions for the current user

[malex@thermalite ~]$ nvm ls
->     v16.13.2
         system
default -> lts/* (-> v16.13.2)
iojs -> N/A (default)
unstable -> N/A (default)
node -> stable (-> v16.13.2) (default)
stable -> 16.13 (-> v16.13.2) (default)
lts/* -> lts/gallium (-> v16.13.2)
lts/argon -> v4.9.1 (-> N/A)
lts/boron -> v6.17.1 (-> N/A)
lts/carbon -> v8.17.0 (-> N/A)
lts/dubnium -> v10.24.1 (-> N/A)
lts/erbium -> v12.22.9 (-> N/A)
lts/fermium -> v14.18.3 (-> N/A)
lts/gallium -> v16.13.2

## 8. find the default Node version set for the current user

[malex@thermalite ~]$ nvm run default --version
Running node v16.13.2 (npm v8.1.2)
v16.13.2

## 9. check node version

[malex@thermalite ~]$ node --version
v16.13.2

## switch to other installed node version for the current session, 
## the new version will be the default version for current shell only
[malex@thermalite ~]$ nvm use lts/erbium

## run a script file with specific node version using exec option,
## this will not change the shell version
[malex@thermalite ~]$ nvm exec 12.19.0 server.js

## to remove node.js 5.9.0 from your account
[malex@thermalite ~]$ nvm uninstall 5.9.0

## 10. updating npm version 

## check nvm version
[malex@thermalite ~]$ nvm --version
0.39.1

## check npm version
[malex@thermalite ~]$ npm --version
8.1.2

## upgrade npm version to latest
[malex@thermalite ~]$ npm install -g npm@latest

## upgrade npm version to 8.3.2
[malex@thermalite ~]$ npm install -g npm@8.3.2

## check version
[malex@thermalite ~]$ npm --version
8.3.2

## check npx version
[malex@thermalite ~]$ npx --version
8.1.2

## update npx
[malex@thermalite ~]$ npm install -g npx

## check npx version
[malex@thermalite ~]$ npx --version
8.3.2

## 11. install yarn
[malex@thermalite ~]$ npm install -g yarn

[malex@thermalite ~]$ yarn --version
1.22.17

Sunday, January 23, 2022

How To Install Docker On CentOS 8/Rocky Linux 8

URL: https://phoenixnap.com/kb/how-to-install-docker-on-centos-8

1. Use DNF to add and enable the official Docker CE repository. Type the following command in your terminal window
------------------------------------------------------------------------------------------------------------------
[root@thermalite ~]# dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo                                                                                                    tion
Adding repo from: https://download.docker.com/linux/centos/docker-ce.repo

2. Check all relevant repolist details.
---------------------------------------
[root@thermalite ~]# dnf repolist -v
Loaded plugins: builddep, changelog, config-manager, copr, debug, debuginfo-install, download, generate_completion_cache, groups-manager, kpatch, needs-restarting, playground, repoclosure, repodiff, repograph, repomanage, reposync
DNF version: 4.4.2
cachedir: /var/cache/dnf
Repository packages-microsoft-com-prod is listed more than once in the configuration
Repository packages-microsoft-com-prod is listed more than once in the configuration
Docker CE Stable - x86_64                                                                                                                                       131 kB/s |  14 kB     00:00
Last metadata expiration check: 0:00:01 ago on Sun 13 Jun 2021 08:31:12 AM EDT.
Repo-id            : appstream
Repo-name          : CentOS Linux 8 - AppStream
Repo-revision      : 8.4.2105
Repo-distro-tags      : [cpe:/o:centos:centos:8]:  , 8, C, O, S, e, n, t
Repo-updated       : Tue 08 Jun 2021 12:04:59 PM EDT
Repo-pkgs          : 6,133
Repo-available-pkgs: 5,254
Repo-size          : 8.8 G
Repo-mirrors       : http://mirrorlist.centos.org/?release=8&arch=x86_64&repo=AppStream&infra=stock
Repo-baseurl       : http://mirrors.xmission.com/centos/8.4.2105/AppStream/x86_64/os/ (9 more)
Repo-expire        : 172,800 second(s) (last: Sun 13 Jun 2021 04:29:11 AM EDT)
Repo-filename      : /etc/yum.repos.d/CentOS-Linux-AppStream.repo

Repo-id            : baseos
Repo-name          : CentOS Linux 8 - BaseOS
Repo-revision      : 8.4.2105
Repo-distro-tags      : [cpe:/o:centos:centos:8]:  , 8, C, O, S, e, n, t
Repo-updated       : Tue 08 Jun 2021 12:04:44 PM EDT
Repo-pkgs          : 1,745
Repo-available-pkgs: 1,743
Repo-size          : 1.2 G
Repo-mirrors       : http://mirrorlist.centos.org/?release=8&arch=x86_64&repo=BaseOS&infra=stock
Repo-baseurl       : http://mirror.arizona.edu/centos/8.4.2105/BaseOS/x86_64/os/ (9 more)
Repo-expire        : 172,800 second(s) (last: Sun 13 Jun 2021 04:29:11 AM EDT)
Repo-filename      : /etc/yum.repos.d/CentOS-Linux-BaseOS.repo

Repo-id            : docker-ce-stable
Repo-name          : Docker CE Stable - x86_64
Repo-revision      : 1622662057
Repo-updated       : Wed 02 Jun 2021 03:27:37 PM EDT
Repo-pkgs          : 38
Repo-available-pkgs: 38
Repo-size          : 937 M
Repo-baseurl       : https://download.docker.com/linux/centos/8/x86_64/stable
Repo-expire        : 172,800 second(s) (last: Sun 13 Jun 2021 08:31:12 AM EDT)
Repo-filename      : /etc/yum.repos.d/docker-ce.repo

Repo-id            : epel
Repo-name          : Extra Packages for Enterprise Linux 8 - x86_64
Repo-revision      : 1623461479
Repo-updated       : Fri 11 Jun 2021 09:31:50 PM EDT
Repo-pkgs          : 7,440
Repo-available-pkgs: 7,437
Repo-size          : 11 G
Repo-metalink      : https://mirrors.fedoraproject.org/metalink?repo=epel-8&arch=x86_64&infra=stock&content=centos
  Updated          : Sun 13 Jun 2021 04:29:12 AM EDT
Repo-baseurl       : https://download-ib01.fedoraproject.org/pub/epel/8/Everything/x86_64/ (48 more)
Repo-expire        : 172,800 second(s) (last: Sun 13 Jun 2021 04:29:12 AM EDT)
Repo-filename      : /etc/yum.repos.d/epel.repo

Repo-id            : epel-modular
Repo-name          : Extra Packages for Enterprise Linux Modular 8 - x86_64
Repo-revision      : 1623287700
Repo-updated       : Wed 09 Jun 2021 09:15:14 PM EDT
Repo-pkgs          : 182
Repo-available-pkgs: 0
Repo-size          : 536 M
Repo-metalink      : https://mirrors.fedoraproject.org/metalink?repo=epel-modular-8&arch=x86_64&infra=stock&content=centos
  Updated          : Sun 13 Jun 2021 04:29:12 AM EDT
Repo-baseurl       : http://epel.mirror.constant.com/8/Modular/x86_64/ (50 more)
Repo-expire        : 172,800 second(s) (last: Sun 13 Jun 2021 04:29:12 AM EDT)
Repo-filename      : /etc/yum.repos.d/epel-modular.repo

Repo-id            : extras
Repo-name          : CentOS Linux 8 - Extras
Repo-revision      : 1618497802
Repo-updated       : Thu 15 Apr 2021 10:42:53 AM EDT
Repo-pkgs          : 34
Repo-available-pkgs: 34
Repo-size          : 385 k
Repo-mirrors       : http://mirrorlist.centos.org/?release=8&arch=x86_64&repo=extras&infra=stock
Repo-baseurl       : http://sjc.edge.kernel.org/centos/8.4.2105/extras/x86_64/os/ (9 more)
Repo-expire        : 172,800 second(s) (last: Sun 13 Jun 2021 04:29:11 AM EDT)
Repo-filename      : /etc/yum.repos.d/CentOS-Linux-Extras.repo

Repo-id            : google-chrome
Repo-name          : google-chrome
Repo-revision      : 1623354504
Repo-updated       : Thu 10 Jun 2021 03:48:24 PM EDT
Repo-pkgs          : 3
Repo-available-pkgs: 3
Repo-size          : 237 M
Repo-baseurl       : http://dl.google.com/linux/chrome/rpm/stable/x86_64
Repo-expire        : 172,800 second(s) (last: Sun 13 Jun 2021 04:29:12 AM EDT)
Repo-filename      : /etc/yum.repos.d/google-chrome.repo

Repo-id            : jenkins
Repo-name          : Jenkins-stable
Repo-revision      : 1622703353
Repo-updated       : Thu 03 Jun 2021 02:55:54 AM EDT
Repo-pkgs          : 121
Repo-available-pkgs: 121
Repo-size          : 7.3 G
Repo-baseurl       : http://pkg.jenkins.io/redhat-stable
Repo-expire        : 172,800 second(s) (last: Sun 13 Jun 2021 04:29:12 AM EDT)
Repo-filename      : /etc/yum.repos.d/jenkins.repo

Repo-id            : packages-microsoft-com-mssql-server-2019
Repo-name          : packages-microsoft-com-mssql-server-2019
Repo-revision      : 1623361364
Repo-updated       : Thu 10 Jun 2021 05:42:44 PM EDT
Repo-pkgs          : 115
Repo-available-pkgs: 115
Repo-size          : 16 G
Repo-baseurl       : https://packages.microsoft.com/rhel/8/mssql-server-2019/
Repo-expire        : 172,800 second(s) (last: Sun 13 Jun 2021 04:29:13 AM EDT)
Repo-filename      : /etc/yum.repos.d/mssql-server-2019.repo

Repo-id            : packages-microsoft-com-prod
Repo-name          : packages-microsoft-com-prod
Repo-revision      : 1623344677
Repo-updated       : Thu 10 Jun 2021 01:04:37 PM EDT
Repo-pkgs          : 304
Repo-available-pkgs: 304
Repo-size          : 8.8 G
Repo-baseurl       : https://packages.microsoft.com/centos/8/prod
Repo-expire        : 172,800 second(s) (last: Sun 13 Jun 2021 04:29:12 AM EDT)
Repo-filename      : /etc/yum.repos.d/microsoft-prod.repo
Total packages: 16,115

3. To list all the available docker-ce packages, type:
------------------------------------------------------
[root@thermalite ~]# dnf list docker-ce --showduplicates | sort -r
Repository packages-microsoft-com-prod is listed more than once in the configuration
Repository packages-microsoft-com-prod is listed more than once in the configuration
Last metadata expiration check: 0:00:11 ago on Sun 13 Jun 2021 08:31:12 AM EDT.
docker-ce.x86_64                3:20.10.7-3.el8                 docker-ce-stable
docker-ce.x86_64                3:20.10.6-3.el8                 docker-ce-stable
docker-ce.x86_64                3:20.10.5-3.el8                 docker-ce-stable
docker-ce.x86_64                3:20.10.4-3.el8                 docker-ce-stable
docker-ce.x86_64                3:20.10.3-3.el8                 docker-ce-stable
docker-ce.x86_64                3:20.10.2-3.el8                 docker-ce-stable
docker-ce.x86_64                3:20.10.1-3.el8                 docker-ce-stable
docker-ce.x86_64                3:20.10.0-3.el8                 docker-ce-stable
docker-ce.x86_64                3:19.03.15-3.el8                docker-ce-stable
docker-ce.x86_64                3:19.03.14-3.el8                docker-ce-stable
docker-ce.x86_64                3:19.03.13-3.el8                docker-ce-stable
Available Packages

4. install docker
------------------------------------------------------
[root@thermalite ~]# dnf install docker-ce --nobest
Repository packages-microsoft-com-prod is listed more than once in the configuration
Repository packages-microsoft-com-prod is listed more than once in the configuration
Last metadata expiration check: 0:00:46 ago on Sun 13 Jun 2021 08:31:12 AM EDT.
Dependencies resolved.
================================================================================================================================================================================================
 Package                                          Architecture                  Version                                                           Repository                               Size
================================================================================================================================================================================================
Installing:
 docker-ce                                        x86_64                        3:20.10.7-3.el8                                                   docker-ce-stable                         27 M
Installing dependencies:
 container-selinux                                noarch                        2:2.158.0-1.module_el8.4.0+781+acf4c33b                           appstream                                51 k
 containerd.io                                    x86_64                        1.4.6-3.1.el8                                                     docker-ce-stable                         34 M
 docker-ce-cli                                    x86_64                        1:20.10.7-3.el8                                                   docker-ce-stable                         33 M
 docker-ce-rootless-extras                        x86_64                        20.10.7-3.el8                                                     docker-ce-stable                        9.2 M
 docker-scan-plugin                               x86_64                        0.8.0-3.el8                                                       docker-ce-stable                        4.2 M
 fuse-overlayfs                                   x86_64                        1.4.0-2.module_el8.4.0+673+eabfc99d                               appstream                                72 k
 fuse3                                            x86_64                        3.2.1-12.el8                                                      baseos                                   50 k
 fuse3-libs                                       x86_64                        3.2.1-12.el8                                                      baseos                                   94 k
 libcgroup                                        x86_64                        0.41-19.el8                                                       baseos                                   70 k
 libslirp                                         x86_64                        4.3.1-1.module_el8.4.0+575+63b40ad7                               appstream                                69 k
 slirp4netns                                      x86_64                        1.1.8-1.module_el8.4.0+641+6116a774                               appstream                                51 k
Enabling module streams:
 container-tools                                                                rhel8

Transaction Summary
================================================================================================================================================================================================
Install  12 Packages

Total download size: 107 M
Installed size: 439 M
Is this ok [y/N]: y
Downloading Packages:
(1/12): fuse-overlayfs-1.4.0-2.module_el8.4.0+673+eabfc99d.x86_64.rpm                                                                                           735 kB/s |  72 kB     00:00
(2/12): libslirp-4.3.1-1.module_el8.4.0+575+63b40ad7.x86_64.rpm                                                                                                 668 kB/s |  69 kB     00:00
(3/12): container-selinux-2.158.0-1.module_el8.4.0+781+acf4c33b.noarch.rpm                                                                                      481 kB/s |  51 kB     00:00
(4/12): slirp4netns-1.1.8-1.module_el8.4.0+641+6116a774.x86_64.rpm                                                                                              2.4 MB/s |  51 kB     00:00
(5/12): fuse3-3.2.1-12.el8.x86_64.rpm                                                                                                                           205 kB/s |  50 kB     00:00
(6/12): libcgroup-0.41-19.el8.x86_64.rpm                                                                                                                        295 kB/s |  70 kB     00:00
(7/12): fuse3-libs-3.2.1-12.el8.x86_64.rpm                                                                                                                      367 kB/s |  94 kB     00:00
(8/12): docker-ce-20.10.7-3.el8.x86_64.rpm                                                                                                                       27 MB/s |  27 MB     00:00
(9/12): docker-ce-cli-20.10.7-3.el8.x86_64.rpm                                                                                                                   31 MB/s |  33 MB     00:01
(10/12): containerd.io-1.4.6-3.1.el8.x86_64.rpm                                                                                                                  28 MB/s |  34 MB     00:01
(11/12): docker-scan-plugin-0.8.0-3.el8.x86_64.rpm                                                                                                               26 MB/s | 4.2 MB     00:00
(12/12): docker-ce-rootless-extras-20.10.7-3.el8.x86_64.rpm                                                                                                      26 MB/s | 9.2 MB     00:00
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                            51 MB/s | 107 MB     00:02
warning: /var/cache/dnf/docker-ce-stable-fa9dc42ab4cec2f4/packages/containerd.io-1.4.6-3.1.el8.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID 621e9f35: NOKEY
Docker CE Stable - x86_64                                                                                                                                        40 kB/s | 1.6 kB     00:00
Importing GPG key 0x621E9F35:
 Userid     : "Docker Release (CE rpm) "
 Fingerprint: 060A 61C5 1B55 8A7F 742B 77AA C52F EB6B 621E 9F35
 From       : https://download.docker.com/linux/centos/gpg
Is this ok [y/N]: y
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                        1/1
  Installing       : docker-scan-plugin-0.8.0-3.el8.x86_64                                                                                                                                 1/12
  Running scriptlet: docker-scan-plugin-0.8.0-3.el8.x86_64                                                                                                                                 1/12
  Installing       : docker-ce-cli-1:20.10.7-3.el8.x86_64                                                                                                                                  2/12
  Running scriptlet: docker-ce-cli-1:20.10.7-3.el8.x86_64                                                                                                                                  2/12
  Running scriptlet: container-selinux-2:2.158.0-1.module_el8.4.0+781+acf4c33b.noarch                                                                                                      3/12
  Installing       : container-selinux-2:2.158.0-1.module_el8.4.0+781+acf4c33b.noarch                                                                                                      3/12
  Running scriptlet: container-selinux-2:2.158.0-1.module_el8.4.0+781+acf4c33b.noarch                                                                                                      3/12
  Installing       : containerd.io-1.4.6-3.1.el8.x86_64                                                                                                                                    4/12
  Running scriptlet: containerd.io-1.4.6-3.1.el8.x86_64                                                                                                                                    4/12
  Running scriptlet: libcgroup-0.41-19.el8.x86_64                                                                                                                                          5/12
  Installing       : libcgroup-0.41-19.el8.x86_64                                                                                                                                          5/12
  Running scriptlet: libcgroup-0.41-19.el8.x86_64                                                                                                                                          5/12
  Installing       : fuse3-libs-3.2.1-12.el8.x86_64                                                                                                                                        6/12
  Running scriptlet: fuse3-libs-3.2.1-12.el8.x86_64                                                                                                                                        6/12
  Installing       : fuse3-3.2.1-12.el8.x86_64                                                                                                                                             7/12
  Installing       : fuse-overlayfs-1.4.0-2.module_el8.4.0+673+eabfc99d.x86_64                                                                                                             8/12
  Running scriptlet: fuse-overlayfs-1.4.0-2.module_el8.4.0+673+eabfc99d.x86_64                                                                                                             8/12
  Installing       : libslirp-4.3.1-1.module_el8.4.0+575+63b40ad7.x86_64                                                                                                                   9/12
  Installing       : slirp4netns-1.1.8-1.module_el8.4.0+641+6116a774.x86_64                                                                                                               10/12
  Installing       : docker-ce-rootless-extras-20.10.7-3.el8.x86_64                                                                                                                       11/12
  Running scriptlet: docker-ce-rootless-extras-20.10.7-3.el8.x86_64                                                                                                                       11/12
  Installing       : docker-ce-3:20.10.7-3.el8.x86_64                                                                                                                                     12/12
  Running scriptlet: docker-ce-3:20.10.7-3.el8.x86_64                                                                                                                                     12/12
  Running scriptlet: container-selinux-2:2.158.0-1.module_el8.4.0+781+acf4c33b.noarch                                                                                                     12/12
  Running scriptlet: docker-ce-3:20.10.7-3.el8.x86_64                                                                                                                                     12/12
  Verifying        : container-selinux-2:2.158.0-1.module_el8.4.0+781+acf4c33b.noarch                                                                                                      1/12
  Verifying        : fuse-overlayfs-1.4.0-2.module_el8.4.0+673+eabfc99d.x86_64                                                                                                             2/12
  Verifying        : libslirp-4.3.1-1.module_el8.4.0+575+63b40ad7.x86_64                                                                                                                   3/12
  Verifying        : slirp4netns-1.1.8-1.module_el8.4.0+641+6116a774.x86_64                                                                                                                4/12
  Verifying        : fuse3-3.2.1-12.el8.x86_64                                                                                                                                             5/12
  Verifying        : fuse3-libs-3.2.1-12.el8.x86_64                                                                                                                                        6/12
  Verifying        : libcgroup-0.41-19.el8.x86_64                                                                                                                                          7/12
  Verifying        : containerd.io-1.4.6-3.1.el8.x86_64                                                                                                                                    8/12
  Verifying        : docker-ce-3:20.10.7-3.el8.x86_64                                                                                                                                      9/12
  Verifying        : docker-ce-cli-1:20.10.7-3.el8.x86_64                                                                                                                                 10/12
  Verifying        : docker-ce-rootless-extras-20.10.7-3.el8.x86_64                                                                                                                       11/12
  Verifying        : docker-scan-plugin-0.8.0-3.el8.x86_64                                                                                                                                12/12

Installed:
  container-selinux-2:2.158.0-1.module_el8.4.0+781+acf4c33b.noarch       containerd.io-1.4.6-3.1.el8.x86_64                        docker-ce-3:20.10.7-3.el8.x86_64
  docker-ce-cli-1:20.10.7-3.el8.x86_64                                   docker-ce-rootless-extras-20.10.7-3.el8.x86_64            docker-scan-plugin-0.8.0-3.el8.x86_64
  fuse-overlayfs-1.4.0-2.module_el8.4.0+673+eabfc99d.x86_64              fuse3-3.2.1-12.el8.x86_64                                 fuse3-libs-3.2.1-12.el8.x86_64
  libcgroup-0.41-19.el8.x86_64                                           libslirp-4.3.1-1.module_el8.4.0+575+63b40ad7.x86_64       slirp4netns-1.1.8-1.module_el8.4.0+641+6116a774.x86_64

Complete!
[root@thermalite ~]#

5. install containerd.io Package Manually
------------------------------------------------------------------------
[root@thermalite ~]# dnf install https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.10-3.2.el7.x86_64.rpm
Repository packages-microsoft-com-prod is listed more than once in the configuration
Repository packages-microsoft-com-prod is listed more than once in the configuration
Last metadata expiration check: 0:08:07 ago on Sun 13 Jun 2021 08:33:07 AM EDT.
containerd.io-1.2.10-3.2.el7.x86_64.rpm                                                                                                                          74 MB/s |  23 MB     00:00
Dependencies resolved.
================================================================================================================================================================================================
 Package                                       Architecture                           Version                                            Repository                                        Size
================================================================================================================================================================================================
Downgrading:
 containerd.io                                 x86_64                                 1.2.10-3.2.el7                                     @commandline                                      23 M
 docker-ce                                     x86_64                                 3:19.03.15-3.el8                                   docker-ce-stable                                  24 M

Transaction Summary
================================================================================================================================================================================================
Downgrade  2 Packages

Total size: 47 M
Total download size: 24 M
Is this ok [y/N]: y
Downloading Packages:
docker-ce-19.03.15-3.el8.x86_64.rpm                                                                                                                              58 MB/s |  24 MB     00:00
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                            58 MB/s |  24 MB     00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                        1/1
  Running scriptlet: containerd.io-1.2.10-3.2.el7.x86_64                                                                                                                                    1/1
  Downgrading      : containerd.io-1.2.10-3.2.el7.x86_64                                                                                                                                    1/4
  Running scriptlet: containerd.io-1.2.10-3.2.el7.x86_64                                                                                                                                    1/4
  Downgrading      : docker-ce-3:19.03.15-3.el8.x86_64                                                                                                                                      2/4
  Running scriptlet: docker-ce-3:19.03.15-3.el8.x86_64                                                                                                                                      2/4
  Running scriptlet: docker-ce-3:20.10.7-3.el8.x86_64                                                                                                                                       3/4
  Cleanup          : docker-ce-3:20.10.7-3.el8.x86_64                                                                                                                                       3/4
  Running scriptlet: docker-ce-3:20.10.7-3.el8.x86_64                                                                                                                                       3/4
  Running scriptlet: containerd.io-1.4.6-3.1.el8.x86_64                                                                                                                                     4/4
  Cleanup          : containerd.io-1.4.6-3.1.el8.x86_64                                                                                                                                     4/4
  Running scriptlet: containerd.io-1.4.6-3.1.el8.x86_64                                                                                                                                     4/4
  Verifying        : docker-ce-3:19.03.15-3.el8.x86_64                                                                                                                                      1/4
  Verifying        : docker-ce-3:20.10.7-3.el8.x86_64                                                                                                                                       2/4
  Verifying        : containerd.io-1.2.10-3.2.el7.x86_64                                                                                                                                    3/4
  Verifying        : containerd.io-1.4.6-3.1.el8.x86_64                                                                                                                                     4/4

Downgraded:
  containerd.io-1.2.10-3.2.el7.x86_64                                                             docker-ce-3:19.03.15-3.el8.x86_64

Complete!

[root@thermalite ~]#

6. Now we can proceed to install the latest version of docker-ce with a simple command
---------------------------------------------------------------------------------------
[root@thermalite ~]# dnf install docker-ce -y
Repository packages-microsoft-com-prod is listed more than once in the configuration
Repository packages-microsoft-com-prod is listed more than once in the configuration
Last metadata expiration check: 0:09:03 ago on Sun 13 Jun 2021 08:33:07 AM EDT.
Package docker-ce-3:19.03.15-3.el8.x86_64 is already installed.
Dependencies resolved.
================================================================================================================================================================================================
 Package                                       Architecture                           Version                                            Repository                                        Size
================================================================================================================================================================================================
Upgrading:
 containerd.io                                 x86_64                                 1.4.6-3.1.el8                                      docker-ce-stable                                  34 M
 docker-ce                                     x86_64                                 3:20.10.7-3.el8                                    docker-ce-stable                                  27 M

Transaction Summary
================================================================================================================================================================================================
Upgrade  2 Packages

Total download size: 60 M
Downloading Packages:
(1/2): docker-ce-20.10.7-3.el8.x86_64.rpm                                                                                                                        48 MB/s |  27 MB     00:00
(2/2): containerd.io-1.4.6-3.1.el8.x86_64.rpm                                                                                                                    40 MB/s |  34 MB     00:00
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                            72 MB/s |  60 MB     00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                        1/1
  Running scriptlet: containerd.io-1.4.6-3.1.el8.x86_64                                                                                                                                     1/1
  Upgrading        : containerd.io-1.4.6-3.1.el8.x86_64                                                                                                                                     1/4
  Running scriptlet: containerd.io-1.4.6-3.1.el8.x86_64                                                                                                                                     1/4
  Upgrading        : docker-ce-3:20.10.7-3.el8.x86_64                                                                                                                                       2/4
  Running scriptlet: docker-ce-3:20.10.7-3.el8.x86_64                                                                                                                                       2/4
  Running scriptlet: docker-ce-3:19.03.15-3.el8.x86_64                                                                                                                                      3/4
  Cleanup          : docker-ce-3:19.03.15-3.el8.x86_64                                                                                                                                      3/4
  Running scriptlet: docker-ce-3:19.03.15-3.el8.x86_64                                                                                                                                      3/4
  Running scriptlet: containerd.io-1.2.10-3.2.el7.x86_64                                                                                                                                    4/4
  Cleanup          : containerd.io-1.2.10-3.2.el7.x86_64                                                                                                                                    4/4
  Running scriptlet: containerd.io-1.2.10-3.2.el7.x86_64                                                                                                                                    4/4
  Verifying        : containerd.io-1.4.6-3.1.el8.x86_64                                                                                                                                     1/4
  Verifying        : containerd.io-1.2.10-3.2.el7.x86_64                                                                                                                                    2/4
  Verifying        : docker-ce-3:20.10.7-3.el8.x86_64                                                                                                                                       3/4
  Verifying        : docker-ce-3:19.03.15-3.el8.x86_64                                                                                                                                      4/4

Upgraded:
  containerd.io-1.4.6-3.1.el8.x86_64                                                              docker-ce-3:20.10.7-3.el8.x86_64

Complete!

[root@thermalite ~]#

7.Start and Test Docker, Enable Docker
---------------------------------------
[root@thermalite ~]# systemctl enable --now docker
Created symlink /etc/systemd/system/multi-user.target.wants/docker.service → /usr/lib/systemd/system/docker.service.

8. Next, use this short command to confirm that Docker is active and running:
-----------------------------------------------------------------------------
[root@thermalite ~]# systemctl status docker
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
   Active: active (running) since Sun 2021-06-13 08:43:10 EDT; 9s ago
     Docs: https://docs.docker.com
 Main PID: 24248 (dockerd)
    Tasks: 12
   Memory: 47.8M
   CGroup: /system.slice/docker.service
           └─24248 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

Jun 13 08:43:09 thermalite.localdomain dockerd[24248]: time="2021-06-13T08:43:09.443251237-04:00" level=warning msg="Your kernel does not support cgroup blkio weight"
Jun 13 08:43:09 thermalite.localdomain dockerd[24248]: time="2021-06-13T08:43:09.443276846-04:00" level=warning msg="Your kernel does not support cgroup blkio weight_device"
Jun 13 08:43:09 thermalite.localdomain dockerd[24248]: time="2021-06-13T08:43:09.443418994-04:00" level=info msg="Loading containers: start."
Jun 13 08:43:10 thermalite.localdomain dockerd[24248]: time="2021-06-13T08:43:10.408960141-04:00" level=info msg="Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon>
Jun 13 08:43:10 thermalite.localdomain dockerd[24248]: time="2021-06-13T08:43:10.523460635-04:00" level=info msg="Firewalld: interface docker0 already part of docker zone, returning"
Jun 13 08:43:10 thermalite.localdomain dockerd[24248]: time="2021-06-13T08:43:10.694621276-04:00" level=info msg="Loading containers: done."
Jun 13 08:43:10 thermalite.localdomain dockerd[24248]: time="2021-06-13T08:43:10.802528833-04:00" level=info msg="Docker daemon" commit=b0f5bc3 graphdriver(s)=overlay2 version=20.10.7
Jun 13 08:43:10 thermalite.localdomain dockerd[24248]: time="2021-06-13T08:43:10.802629176-04:00" level=info msg="Daemon has completed initialization"
Jun 13 08:43:10 thermalite.localdomain systemd[1]: Started Docker Application Container Engine.
Jun 13 08:43:10 thermalite.localdomain dockerd[24248]: time="2021-06-13T08:43:10.960984827-04:00" level=info msg="API listen on /var/run/docker.sock"
[root@thermalite ~]#

9. Login as ordinary user, and add your user to the docker group with the following command:
---------------------------------------------------------------
[malex@thermalite ~]$ sudo usermod -aG docker $USER
[sudo] password for malex:
[malex@thermalite ~]$  id $USER
uid=1002(malex) gid=1002(malex) groups=1002(malex),970(docker)
[malex@thermalite ~]$

10. check docker installation
-----------------------------
[malex@thermalite ~]$ rpm -qa | grep docker
docker-scan-plugin-0.8.0-3.el8.x86_64
docker-ce-cli-20.10.7-3.el8.x86_64
docker-ce-20.10.7-3.el8.x86_64
docker-ce-rootless-extras-20.10.7-3.el8.x86_64

11. check docker version
-----------------------------
[malex@thermalite ~]$ docker --version
Docker version 20.10.7, build f0df350

12. test docker pull
-----------------------------
[malex@thermalite ~]$ docker pull alpine
Using default tag: latest
latest: Pulling from library/alpine
540db60ca938: Pull complete
Digest: sha256:69e70a79f2d41ab5d637de98c1e0b055206ba40a8145e7bddb55ccc04e13cf8f
Status: Downloaded newer image for alpine:latest
docker.io/library/alpine:latest

13. list docker image
-----------------------------
[malex@thermalite ~]$ sudo docker images
REPOSITORY   TAG       IMAGE ID       CREATED       SIZE
alpine       latest    6dbb9cc54074   8 weeks ago   5.61MB

14. test run docker image
-----------------------------
[malex@thermalite ~]$ sudo docker run -it --rm alpine /bin/sh
/ # apk update
fetch https://dl-cdn.alpinelinux.org/alpine/v3.13/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.13/community/x86_64/APKINDEX.tar.gz
v3.13.5-194-g1274644b64 [https://dl-cdn.alpinelinux.org/alpine/v3.13/main]
v3.13.5-187-g1477654ee3 [https://dl-cdn.alpinelinux.org/alpine/v3.13/community]
OK: 13890 distinct packages available
/ # exit

Install Docker Compose

15. download docker-compose
-----------------------------
[root@thermalite ~]# curl -L https://github.com/docker/compose/releases/download/1.25.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   633  100   633    0     0   4137      0 --:--:-- --:--:-- --:--:--  4110
100 16.2M  100 16.2M    0     0  21.8M      0 --:--:-- --:--:-- --:--:-- 21.8M

16. set docker-compose to runnable
---------------------------------------------------
[root@thermalite ~]# chmod +x /usr/local/bin/docker-compose

17. check version
---------------------------------------------------
[root@thermalite ~]# docker-compose --version
docker-compose version 1.25.0, build 0a186604

18. execute several test runs
---------------------------------------------------
[malex@thermalite ~]$ docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
b8dfde127a29: Pull complete
Digest: sha256:9f6ad537c5132bcce57f7a0a20e317228d382c3cd61edae14650eec68b2b345c
Status: Downloaded newer image for hello-world:latest

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/


[malex@thermalite ~]$  docker run -it ubuntu bash
root@67b24aca2432:/# exit
exit

[malex@thermalite ~]$ 

How to Setup Docker Credentials Store for AWSCLI

[root@thermalite ~]# dnf install rng-tools -y

[malex@thermalite Kubernetes-NodeJs]$ rngd -r /dev/urandom

[root@thermalite ~]# dnf install pass -y

[malex@thermalite Kubernetes-NodeJs]$ gpg --full-generate-key
gpg (GnuPG) 2.2.19; Copyright (C) 2019 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

gpg: directory '/home/malex/.gnupg' created
gpg: keybox '/home/malex/.gnupg/pubring.kbx' created
Please select what kind of key you want:
   (1) RSA and RSA (default)
   (2) DSA and Elgamal
   (3) DSA (sign only)
   (4) RSA (sign only)
  (14) Existing key from card
Your selection?
RSA keys may be between 1024 and 4096 bits long.
What keysize do you want? (3072)
Requested keysize is 3072 bits
Please specify how long the key should be valid.
         0 = key does not expire
        = key expires in n days
      w = key expires in n weeks
      m = key expires in n months
      y = key expires in n years
Key is valid for? (0)
Key does not expire at all
Is this correct? (y/N) y

GnuPG needs to construct a user ID to identify your key.

Real name: juan dela cruz
Email address: jdelacruz@gmail.com
Comment: docker-credentials
You selected this USER-ID:
    "juan dela cruz (docker-credentials) "

Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o
We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
gpg: /home/malex/.gnupg/trustdb.gpg: trustdb created
gpg: key 347578674476 marked as ultimately trusted
gpg: directory '/home/malex/.gnupg/openpgp-revocs.d' created
gpg: revocation certificate stored as '/home/malex/.gnupg/openpgp-revocs.d/7ZGCE6EE4582676E02ZB69DC76C4CAZCD5645057.rev'
public and secret key created and signed.

pub   rsa3072 2022-01-23 [SC]
      00T1B2AC8885D969DF5573FFC570FE4B588303C4
uid                      "juan dela cruz (docker-credentials) "
sub   rsa3072 2022-01-23 [E]

[347578674476@thermalite Kubernetes-NodeJs]$ mkdir ~/bin

[347578674476@thermalite Kubernetes-NodeJs]$ cd ~/bin

[347578674476@thermalite Kubernetes-NodeJs]$ echo 'export PATH=$PATH:~/bin' >> ~/.bashrc

[347578674476@thermalite Kubernetes-NodeJs]$ wget https://github.com/docker/docker-credential-helpers/releases/download/v0.6.3/docker-credential-pass-v0.6.3-amd64.tar.gz
--2022-01-23 00:27:44--  https://github.com/docker/docker-credential-helpers/releases/download/v0.6.3/docker-credential-pass-v0.6.3-amd64.tar.gz
Resolving github.com (github.com)... 140.82.113.3
Connecting to github.com (github.com)|140.82.113.3|:443... connected.
Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.109.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1486371 (1.4M) [application/octet-stream]
Saving to: ‘docker-credential-pass-v0.6.3-amd64.tar.gz’

docker-credential-pass-v0 100%[===================================>]   1.42M  --.-KB/s    in 0.04s

2022-01-23 00:27:45 (38.8 MB/s) - ‘docker-credential-pass-v0.6.3-amd64.tar.gz’ saved [1486371/1486371]

[347578674476@thermalite Kubernetes-NodeJs]$ tar xvzf docker-credential-pass-v0.6.3-amd64.tar.gz
docker-credential-pass

[root@thermalite ~]# chmod a+x docker-credential-pass

[root@thermalite ~]# cp docker-credential-pass /usr/local/bin

[347578674476@thermalite Kubernetes-NodeJs]$ mkdir ~/.docker

[347578674476@thermalite Kubernetes-NodeJs]$ gpg --list-secret-keys
/home/347578674476/.gnupg/pubring.kbx
------------------------------
sec   rsa2048 2022-01-23 [SC]
      00T1B2AC8885D969DF5573FFC570FE4B588303C4
uid           [ultimate] "juan dela cruz (docker-credentials) "
ssb   rsa2048 2022-01-23 [E]


[347578674476@thermalite Kubernetes-NodeJs]$ pass init 00T1B2AC8885D969DF5573FFC570FE4B588303C4
Password store initialized for 00T1B2AC8885D969DF5573FFC570FE4B588303C4

[347578674476@thermalite Kubernetes-NodeJs]$ pass insert docker-credential-helpers/docker-pass-initialized-check
Enter password for docker-credential-helpers/docker-pass-initialized-check: pass is initialized
Retype password for docker-credential-helpers/docker-pass-initialized-check: pass is initialized

[347578674476@thermalite Kubernetes-NodeJs]$ pass show docker-credential-helpers/docker-pass-initialized-check
pass is initialized

[347578674476@thermalite Kubernetes-NodeJs]$ docker logout
Removing login credentials for https://index.docker.io/v1/

[347578674476@thermalite Kubernetes-NodeJs]$ docker-credential-pass list
{"347578674476.dkr.ecr.us-east-1.amazonaws.com":"AWS","https://index.docker.io/v1/":"jdelacruz"}

[347578674476@thermalite Kubernetes-NodeJs]$ vi ~/.docker/config.json

[347578674476@thermalite Kubernetes-NodeJs]$ cat ~/.docker/config.json
{
        "auths": {
                "347578674476.dkr.ecr.us-east-1.amazonaws.com": {},
                "https://index.docker.io/v1/": {}
        },
        "credsStore": "pass"
}
[347578674476@thermalite Kubernetes-NodeJs]$

[347578674476@thermalite Kubernetes-NodeJs]$ sed -i '0,/{/s/{/{\n\t"credsStore": "pass",/' ~/.docker/config.json

[347578674476@thermalite Kubernetes-NodeJs]$ vi ~/.docker/config.json

[347578674476@thermalite Kubernetes-NodeJs]$ docker-credential-pass list
{}

How to Install AWSCLI on Rocky Linux 8 / Centos 8

Note:
    It is assumed that you have a working docker that will be use to build a docker image.


1. add the current user to the root group
[root@DESKTOP-M9QDJVD Alex Madriaga]# useradd -m -s $(which bash) -G root malex
  
2. change user from root to regular user
[root@DESKTOP-M9QDJVD Alex Madriaga]# sudo -i -u malex

3. install awscli as a regular user
[malex@DESKTOP-M9QDJVD ~]$ pip3 install awscli --upgrade --user

4. check the version
[malex@DESKTOP-M9QDJVD ~]$ aws --version
aws-cli/1.22.41 Python/3.6.8 Linux/5.10.16.3-microsoft-standard-WSL2 botocore/1.23.41  

5. configure credentials
[malex@DESKTOP-M9QDJVD ~]$ aws configure
AWS Access Key ID [None]: JKIJ9BFLQ242O9M2HFDR
AWS Secret Access Key [None]: RB8T8EKegNkURW+llpnneELqnlXUwXEhhhpzH7Ij
Default region name [None]: us-east-1
Default output format [None]: json

6. check the 2 files created
[malex@DESKTOP-M9QDJVD ~]$ cat ~/.aws/credentials
[default]
aws_access_key_id = JKIJ9BFLQ242O9M2HFDR
aws_secret_access_key = RB8T8EKegNkURW+llpnneELqnlXUwXEhhhpzH7Ij

[malex@DESKTOP-M9QDJVD ~]$ cat ~/.aws/config
[default]
region = us-east-1
output = json

7. login to aws 
[malex@DESKTOP-M9QDJVD ~]$ aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 867579674613.dkr.ecr.us-east-1.amazonaws.com/test-ecr
-bash: docker: command not found
Exception ignored in: <_io.TextIOWrapper name='' mode='w' encoding='UTF-8'>
BrokenPipeError: [Errno 32] Broken pipe
[malex@DESKTOP-M9QDJVD ~]$

8. install docker (see separate guide)

9. install docker-credential-store (see separate guide)

10. after installing docker successfully, try again
[malex@DESKTOP-M9QDJVD ~]$ aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 867579674613.dkr.ecr.us-east-1.amazonaws.com/test-ecr
Login Succeeded