Quick HOWTO: Reset Jenkins Admin Password

To reset the jenkins admin password, You can simply disable the security in the config.xml file.

1. If your jenkins is running on the Linux OS, edit the below file.

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

2. Search for the word <useSecurity>true</useSecurity>
and change the word true to false

3. Restart the Jenkins server.
service jenkins restart

4. Now go to the Jenkins portal again and Jenkins will not ask any credentials this time. You navigate to "Manage Jenkins" to set the administrator password again.

5. Enable the security again by changing settings to <useSecurity>true</useSecurity> and restart the Jenkins again.

Note: 

If your jenkins is running on Windows OS, config.xml file located in C:\Program Files (x86)\Jenkis\ folder.


Quick HOWTO: dracut fails in Linux

Issue:  dracut fails when you trying to create initramfs image file.

[root@linux_server1 boot]# dracut -f /boot/initramfs-2.6.39-400.298.2.el6uek.x86_64.img 2.6.39-400.298.2
E: Failed to install /etc/system-fips

[root@linux_server1 boot]# ls -l /boot/initramfs-2.6.39-400.298.2.el6uek.x86_64.img

ls: cannot access /boot/initramfs-2.6.39-400.298.2.el6uek.x86_64.img: No such file or directory

Fix / Solution: Touch /etc/system-fips and try again.

[root@linux_server1 boot]# touch /etc/system-fips
[root@linux_server1 boot]# dracut -f /boot/initramfs-2.6.39-400.298.2.el6uek.x86_64.img 2.6.39-400.298.2.el6uek.x86_64
[root@linux_server1 boot]# ls -l /boot/initramfs-2.6.39-400.298.2.el6uek.x86_64.img
-rw------- 1 root root 31035863 May 21 03:06 /boot/initramfs-2.6.39-400.298.2.el6uek.x86_64.img 

Hope this helps..!

Quick HOWTO: Run SSH sessions in Parallel


 You often used "for loop" in shell script to gather an information from large number of your Linux / Unix infrastructure servers. However if your server count is more, it may take lot of time to finish the task. Do you think it will be good if the ssh sessions to remote servers run in parallel? Since the modern day servers having multi-core CPU's we can utilize the real parallel and multi processing of them. 

xargs is your friend here to accomplish your this.

Here is the example to run the SSH sessions in parallel:

xrags -a -n1 -P50 -I{} sh -c "ssh -q {} 'df -Ph /var' "


In this example,

-a --  Takes the input from the file instead of STDIN

-P -- number to processes to execute in parallel. In our example we are starting 50 processes in parallel.

-I -- Used to specify a name to the variable passing to the command we are executing. In our example, we have used {}. For example, You can specify like -I"server" instead of I{}.

Another example:

xrags -a -n1 -P50 -I"server" sh -c "scp server:/tmp/"



One disadvantage in xargs is the output will not be in a order. you need to make your script writes to a log with clear host identification to gather a report from multiple hosts.

Not only SSH and SCP, you can run any process / task which you want to start and run in parallel. Alternatively you can download and use "parallel" tool which is slightly better than xargs.