Wednesday 21 June 2017

Resetting Jenkins admin password

We can change the password with following command.

echo -n 'admin{bar}' | sha256sum

in this foo is the password and salt is bar we will get password like belwo

8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918 -

just take a copy and go to /var/lib/jenkins/users/admin/config.xml

and paste the password in <passwordHash> like

<passwordHash>bar:
8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918</passwordHash>


Now restart the jenkins service.

service jenkins restart

now login.


Monday 19 June 2017

Time and date change in rhel 7

Step 1

It's easy to change time in rhel 7. We can check the date and time with  below command.

date

If we want to know all the details like timezone, date, time and etc... run the below command.

timedatectl

it will show like below





Step 2

To set time use the following command

timedatectl set-time 15:22:34

if some times it will show the error like below

Failed to set time: Automatic time synchronization is enabled 

then we need to disable the automatic time sync with following command

timedatectl set-ntp 0

after change date and time then again enable it if needed with following command.

timedatectl set-ntp 1

If we need to change time and date along then following command will help us.

timedatectl set-time "2017-06-19 15:28:40"

Step 3

If we want to change the timezone then follow the command

timedatectl set-timezone America/New-York

if you don't know correct name of time zone then search it with following command and you can add.

timedatectl list-timezone | grep -i york

if you want to list all the timezone then follow the command

timedatectl list-timezone

Step 4

To display the current year format

date +"%Y"

To display the current month format

date +"%m"

To display current year and month and year

date +"%m-%d-%Y"

Thanks it's for my study purpose only if you see any mistakes please command and make me perfect.



 




Permanent hostname setup for RHEL7

Step 1 Set the host name on NMTUI tool like following nmtui set host name   then save and exit Step 2 add the following l...