Blog

How to change UUID of a Virtual Hard disk

Run the below command:

cd /Applications/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents/MacOS/

VBoxManage internalcommands sethduuid "full/path/to/vdi"

Reference: Stackoverflow

Advertisements

sending email notification when starting a build

  1. Install the Email-ext plugin: https://wiki.jenkins-ci.org/display/JENKINS/Email-ext+plugin

Notice that a post build action will solve your problem even though what you intend is to send an e-mail before the build.

  1. After that, go to the job configuration and “Add Post Build Action” > “Editable Email Notification
  2. Press Avanced Settings: Press advanced settings...
  3. Now, at Triggers, just add a new trigger and choose “Before Buildenter image description here

For the second part, the solution is to put the recipient list in an environment variable (for example, a string parameter called EMAIL_RECIPIENT) and then use that in the editable email notification recipients list box as ${EMAIL_RECIPIENT}.

 

Reference

How to allow Jenkins to send email to non registered users

By default, when there is an error in repository build or if we want to send mails to other team members in jenkins, it will check whether that particular email ID is registered in the jenkins database as an user to login.

It will skip the mail sending if it is not there.

To skip this checking and send mails to non registered users, add below option to the jenkins configuration file.

In Linux:

-Dhudson.tasks.MailSender.SEND_TO_UNKNOWN_USERS=true

In Windows:

Add below entry to jenkins.xml file.

mailtrue

 

Reference:

Ref1  Ref2 Ref3

how to clear jenkins build history

Go to your Jenkins home page → Manage JenkinsScript Console

VqzyG

Run the following script there. Change copy_folder to your project name

def jobName = "copy_folder"
def job = Jenkins.instance.getItem(jobName)
job.getBuilds().each { it.delete() }
job.nextBuildNumber = 1
job.save()

Reference: Stackoverflow

Command to get github commit count

curl -I –user “<username>:<password>” https://api.github.com/repos/<user or org>/<repo>/commits?per_page=1

 

then you’ll notice that the Link header is:

Link: <https://api.github.com/repositories/3228505/commits?per_page=1&page=2>; rel="next", <https://api.github.com/repositories/3228505/commits?per_page=1&page=30570>; rel="last"

This tells you that there are 30570 pages of results, and because there is one item per page — the total number of commits is 30,570.

How to fix path not found error in Python Plugin

I have installed below plugin recently for executing python scripts in jenkins.

https://wiki.jenkins.io/display/JENKINS/Python+Plugin

I have configured below location in the “global tool configuration section”

1

But still I am getting error as below.

C:\Program Files (x86)\Jenkins\workspace\testpy>exit 0
[testpy] $ python C:\Windows\TEMP\hudson7024971487055316356.py
The system cannot find the file specified
FATAL: command execution failed

So, I tried to troubleshoot by running another task “windows batch command” and found that path variable is not having the folder of python installation with the echo output.

1

So I restarted the jenkins using the below url.

http://win7_64bit-20:8080/restart

This is used to restart jenkins from web console and it loaded the variables.

Once the jenkins is restarted, it is running my python scripts and showing the python folder in path variable.

So, the final perception I got is, python plugin not able to read the location we kept in the global tool configuration, only it loads from path variable on the node.And we need to restart Jenkins to load the path variables from the node.

 

IDE for VBScript

Best suitable IDE for VBScript.

Three Options.

  1. Notepad++
  2. VBSEdit
  3. Scite

Nodepad++ , you can see the code syntax and keywords with different colors to distinguish them.

VBSEdit, most advanced tool where you can add the custom code snippets.Will be having debugging and troubleshooting features in the IDE.But it is proprietary software and you need to purchase it.

Scite, is an editor for AutoIT scripting language.And it can be used for VBScript also.

Below PDF shows how to use it.

Scite Usage

Resolve putty connectivity issue

Generally you will get below error when the SSH server is not configured properly or not installed.

PuTTY connection refused

So, you can resolve this by uninstalling the OpenSSH and reinstalling again.

Uninstallation: 

sudo apt-get –purge remove openssh-server

 

Installation:

sudo apt-get install openssh-server

 

Reference: Centrify Community

Blog at WordPress.com.

Up ↑