Skip to content

Instantly share code, notes, and snippets.


Ram mramanathan

View GitHub Profile
ismits / IsNullOrEmpty.Groovy
Created May 10, 2017
Is null or empty check in Groovy
View IsNullOrEmpty.Groovy
if (!someString?.trim()) {
logger.lifecycle("the string is null or empty.")
blaisep /
Created Oct 20, 2016
Insert git credentials into Jenkins Pipeline Script projects

Suppose you want to inject a credential into a Pipeline script. The cloudbees note does not include Pipeline script examples.

The Jenkins Pipeline Docs' description of the git pushmethod doesn't have an example using injected credentials. (

The Snippet generator is helpful, but not not if you try to follow the instructions at:

vancluever /
Created Jan 26, 2016
Find the most recent Ubuntu AMI using aws-cli (or any other AMI for that matter)
# Use AWS CLI to get the most recent version of an AMI that
# matches certain criteria. Has obvious uses. Made possible via
# --query, --output text, and the fact that RFC3339 datetime
# fields are easily sortable.
export AWS_DEFAULT_REGION=us-east-1
aws ec2 describe-images \
dastergon /
Last active May 6, 2021
A basic boto3 based tool for retrieving information from running EC2 instances.
from collections import defaultdict
import boto3
A tool for retrieving basic information from the running EC2 instances.
# Connect to EC2
ec2 = boto3.resource('ec2')
sevennineteen / example.json
Created Dec 28, 2012
Example using Jinja2 to populate a JSON payload template
View example.json
{ "path": "/content/geometrixx/my-first-jinja-page",
"properties": [
{ "name": "jcr:primaryType",
"value": "cq:Page" }],
"nodes": [
{ "path": "jcr:content",
"properties": [
{ "name": "jcr:primaryType",
"value": "cq:PageContent"},