Tools for 2024

1) Maven

Installation of Maven build tool in Ubuntu 20.04 LTS

a) Update the system repository using:

sudo apt update

b) Install Maven from the official repository: 

sudo apt install maven  

c) When prompted, type Y and press Enter to confirm the installation. 

d) Check the current version of Maven to verify the installation: 

mvn -version  

If successful, the output will look like this: 

e) How to build java maven project 

Change directory (cd ) to project name: 

Run mvn compile : It will create a target folder after that run mvn package it will generate the zip artefact in the target folder. 

2) DOCKER

How to install Docker in Ubuntu:

How to install Docker in Ubuntu 20.04

sudo apt update

sudo apt install apt-transport-https ca-certificates curl software-properties-common

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add –

sudo add-apt-repository “deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable”

apt-cache policy docker-ce

sudo apt install docker-ce

sudo systemctl status docker

3) SonarQube server installation in Ubuntu

Installation of SonarQube in the EC2 Ubuntu 20.04 LTS

Prerequisites 

 

    • Ubuntu 20.04 LTS with t2.medium 

    • Open GitBash terminal in local 

    • How to copy sonarqube-9.7.1.62043.zip from local to EC2:

       

        • download key pair “sonar_qube_key_pair” to your local  

        • chmod 400 sonar_qube_key_pair” 

        • Keep key pair and  sonarqube-9.7.1.62043.zip at same folder or location. 

        • Run command below to copy SonarQube from download to EC2 instance home: 

        • scp -i sonar_qube_key_pair.pem sonarqube-developer-9.7.1.62043.zip ubuntu@ec2-3-215-186-196.compute-1.amazonaws.com:/home/ubuntu 

 

    • PostgreSQL Version 9.3 or higher

    • SSH access with sudo privileges 

Port opens: 

TCP: 9000

 TCP: 5432 

TCP: 22:

TCP: 443

Steps followed to configure the SonarQube: 

To Increase the vm.max_map_count kernal ,file discriptor and ulimit for current session at runtime. 

sudo sysctl -w vm.max_map_count=262144 

sudo sysctl -w fs.file-max=65536 

ulimit -n 65536 

Upgrade and update EC2 instance and install Java 11jdk and jre: 

Sudo apt-get upgrade 

Sudo apt-get update 

sudo apt-get install openjdk-11-jdk -y 

sudo apt-get install openjdk-11-jre -y 

Check java version: 

This image has an empty alt attribute; its file name is GwZfKv7pF9a48AnOXDekwlH7FpGFiHTvE3aibpQKS0Ln-Beguf0jd3TEMOHI_0__zQv1OnmaRT-IyepkZm46yUIf8r_M9ALWFmVT-RQlLhSQdilTLIaRRW_7_Jxas-0TJhMk6fIDeEZu3l83Rv8ZA_4

Install and Setup PostgreSQL 10 Database For SonarQube 

sudo apt-get -y install postgresql postgresql-contrib 

sudo systemctl start postgresql  

sudo systemctl enable postgresql 

sudo passwd postgres  

su – postgres 

createuser sonar  

Password: Glob@qw 

Type:psql 

ALTER USER sonar WITH ENCRYPTED password ‘sonar’; 

grant all privileges on DATABASE sonarqube to sonar; 

exit 

Create a sonar user : 

This image has an empty alt attribute; its file name is r5hqF5PvkqsqbfLciv3XcWjEgMiGZbRDKPzGbDqzafEjjxOXr6fA0ZDoWU_evIwuBhaSxvvPb-jdSEg49lC70Aj4BWL5WoudRgaQkcxYZFkNkW4qDLXUQpdTUxxnBSjl1N4bffZlLd6xPpPyzgjbLq4

Password for soanr user: MasterB#456OpLead 

Configure SonarQube 

Copy sonarqube-9.7.1.62043.zip to /opt: and unzip 

sudo unzip sonarqube-9.7.1.62043.zip -d /opt 

sudo mv /opt/sonarqube-9.7.1.62043 /opt/sonarqube 

Give access to the sonar user: 

sudo useradd -c “user to run SonarQube” -d /opt/sonarqube -g sonar sonar 

sudo chown sonar:sonar /opt/sonarqube -R 

sudo vim /opt/sonarqube/conf/sonar.properties 

Update the username and password of database

This image has an empty alt attribute; its file name is 3IQiu1J13LaFv88cBPXBqhMI0IFK3D2BGENlOJ8llT5sOh3t0V4sAAP_jv0KzsggYm6i3Uc4vyzj9-bywTJ-XFAqKDav-pxEdEsNfhOv9V1XQ8-n_CgXp_DAVdK13r2iNfalM5Pu_Sn3kO9vt7n7Mbo

sudo vim /opt/sonarqube/bin/linux-x86-64/sonar.sh 

sudo su sonar 

cd /opt/sonarqube/bin/linux-x86-64/ 

./sonar.sh start 

This image has an empty alt attribute; its file name is ogm6di6tXQO5ez0dr7cKcBLQqHWixTui1ZfRmnpIf9g1oNNwLmsj7yN1SHpqJxyEf-tdEhjxORJKJixKirFvhqcv6dFCtduzTyT8vtZ2fvGl7gqOCCz94XQKZdf3yUS2Zy-jVLZ2f9ewSmLg9fIr2MI

Configure Systemd service: 

cd /opt/sonarqube/bin/linux-x86-64/ 

./sonar.sh stop 

sudo vim /etc/systemd/system/sonar.service 

sudo systemctl start sonar 

This image has an empty alt attribute; its file name is WnEcB6F3zICV6Eo_BKNapyVBNk5-8UFbYRDf2P1T6kNyVL7_9A1lcvc45prEXeS80wKcHz0ONrqBqqljMGz6uL-DHNkuDOqE70o_wujZVjwWwsZ0X02kEtuG5hErya7R4RfSozuy8YMLj_nFknjA7Hc

sudo systemctl enable sonar 

This image has an empty alt attribute; its file name is VPjNvc_C2RKVChPUEPmppDdy3UeD2E2qTw4FMl8UV1WXJpCNhuVYuxpidIH9kK-dqj7_uiUvBOiFvpi9UZdY4LWph0ScQLwvwzKjfi2YJU92ypYsQJZDhP5l64idIc0dgR5HkUTWSkHUdJgUpBBYDq4

Click on the link below: 

http://3.239.83.182:9000/sessions/new?return_to=%2F 

Username:admin 

Password: Glob@qw 

4.) DevOps Interview questions of 2024

Which are some of the most popular DevOps tools?

 

    • Git

    • Azure DevOps

    • Jenkin

    • Ansible

    • Docker

    • Kubernetes

    • Selenium

    • Azure test plans

    • Appium

 What is the git command that downloads any repository from GitHub to your computer?  

git clone <repo url>

 Which of the following CLI commands can be used to rename files?

  git mv repo_name  destination_repo_name

 What is the process for reverting a commit that has already been pushed and made public? 

  Create a new commit with the latest changes that were made in the bad commit. Use   the following command: git revert  <commit_id>

5) Docker Interview questions

6) Trivy

7) SonarQube

Solverwp- WordPress Theme and Plugin