Wednesday, August 26, 2020

How to change default port number in Sonatype Nexus 3? | Change default port number in SonaType Nexus 3 | Change default port number in Nexus

The default port number for Sonatype Nexus is 8081. It can be changed though by modifying the below properties file.

$install-dir/nexus/etc/nexus-default.properties

Modify the desired port no in the above file. once you modify, you need to restart Nexus service to take effect.

sudo service nexus stop

sudo service nexus start

sudo service nexus status


Click here to see steps for how to install Nexus on Redhat.
Click here to see steps for how to install Nexus on Ubuntu.

Tuesday, August 25, 2020

How to install Ansible on Mac OS | Ansible Installation Steps on Apple Mac OS

Ansible is one of the popular configuration management tools. Ansible can also be used for infrastructure provisioning as well in AWS. Please find steps for installing Ansible on Apple Mac OS or laptop.

Ansible can be installed on Mac OS many ways, but preferred way is using pip which is a Python package manager.

Install Pip

If pip isn’t already available on your system, run the following commands to install it:
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3 get-pip.py
pip --version

Once pip is installed, install Ansible using pip.

Install Ansible using Pip
To install ansible globally, use following command
sudo -H pip3 install ansible
Once Ansible is installed, you can verify the version.

ansible --version
You should be able to see the version.

Install Boto framework
Boto is a Python package that provides interfaces to Amazon Web Service. It is AWS SDK for Python.

sudo pip install boto
sudo pip install boto3
 
Create Ansible hosts file
when you install Ansible on Mac OS, it does not create ansible hosts file. so you need to create it.
sudo mkdir /etc/ansible
 
Watch the above steps as a video in YouTube channel:

Monday, August 3, 2020

How to configure Nexus 3 as private Docker Registry | How to host private Docker Registry in Nexus 3

Nexus 3 is one of the popular binary repository managers. It can be also used to store Docker images as well besides storing binaries such as WARs, EARs, Jars, DLLs and Exes.

Let us see how to configure Nexus to host as private Docker registry.

Pre-requisites:
  • Make sure Nexus is successfully configured, it is up and running.
  • Also do open port 8085 open as well besides port 8081 for Nexus.
  • Docker is setup and running.
Steps to configure Nexus 3 as Docker Registry:

1. Login to Nexus and click on Server Administration link at the top of the window. Click on Repositories.







2. Now click on create repository



3. Choose docker hosted repository


4. Choose the value as mentioned:


5. Click on Create repository.

Configure Realm
6. Move Docker Bearer Token realm to right by clicking on >

This settings allows docker repository to have anonymous read enabled.


7. after moving save it.

Please click below link to know how to create Docker image and push docker images into Nexus

Saturday, August 1, 2020

How to Reset Jenkins Admin password | Jenkins admin password unlock | Forgotten Jenkins Admin Password | How to Recover Jenkins admin password

How to Reset the Jenkins administrator password?

Let's say you have forgotten Jenkins admin password. How to reset or retrieve the admin password? Here below are the steps for resetting Jenkins admin password:

1. Edit the Jenkins config.xml under /var/lib/jenkins to disable securityFlag by executing below command:

sudo vi /var/lib/jenkins/config.xml


you need to disable security to Jenkins by below change
2. Find this <useSecurity>true</useSecurity> and change it to <useSecurity>false</useSecurity>
3. Restart Jenkins by below command:
sudo service jenkins restart
4. Access Jenkins now, click on Manage Jenkins, click on configure Global security 

5. click on Enable security 

6. Click on Jenkins Own user database option.



7. click on apply and save
8. Now click on Manage users, click on admin, click on configure






  9. Enter new password and apply/save

After changing the password, you will be able to log into your Jenkins controller again using the same username and the new password that you have just set.

Enable security

  1. Log in as your admin account.

  2. On the dashboard, select Manage Jenkins in the navigation pane on the left side of the page.

  3. On the Manage Jenkins page, under the Security section, select Configure Global Security.

  4. Set the Authorization to Logged-in users can do anything. Uncheck the option Allow anonymous read access. Select Save.

Wednesday, July 22, 2020

Install AWS CLI 2 on Red Hat Linux | Install AWS CLI 2 on Ubuntu 18.0.4

Follow these steps from the command line to install the AWS CLI on Linux.

curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install

aws --version
The above command should display the version like below:
aws-cli/2.0.33 Python/3.7.3 Linux/5.3.0-1030-aws botocore/2.0.0dev37

Wednesday, July 8, 2020

How to clean workspace after Jenkins Build - Clean up workspace after every build

You can clean workspace using Workspace cleanup plugin in Jenkins after builds executions.

Install workspace clean up Plug-in

Free Style Job Workspace - cleanup

Go to your existing freestyle job, click on Post-Build actions --> Select Delete workspace when build is done option.

Now run the job. You should be able to see workspace is cleaned up after build is done inside Jenkins node. You will not see any folder with job name, in Ubuntu usually under /var/lib/jenkins/workspace/

Pipeline Job Workspace - cleanup code

Go to your existing pipeline job, you can code something like this below:
pipeline {
    agent any
     tools {
        maven 'Maven3'
    }
    stages {
        stage ("checkout")  {
            steps {
            checkout logic here
            }
        }
    stage ('build')  {
        steps {
            sh "mvn clean install -f MyWebApp/pom.xml"
        }
     }
    }

/*** workspace clean up*/
    post {
        always {
            cleanWs()
        }
    }   

 }

Watch this on YouTube video:

🚀 Live AI-Enabled DevSecOps & Cloud Engineering Bootcamp – Sep 2026

  Live AI-Enabled DevSecOps & Cloud Engineering Bootcamp from Coach AK - Sep 2026 Schedule