Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Ram mramanathan

🎯
Focusing
View GitHub Profile
@ismits
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
blaisep / jenkins-pipeline-git-cred.md
Created Oct 20, 2016
Insert git credentials into Jenkins Pipeline Script projects
View jenkins-pipeline-git-cred.md

Suppose you want to inject a credential into a Pipeline script. The cloudbees note does not include Pipeline script examples. https://support.cloudbees.com/hc/en-us/articles/203802500-Injecting-Secrets-into-Jenkins-Build-Jobs

The Jenkins Pipeline Docs' description of the git pushmethod doesn't have an example using injected credentials. (https://jenkins.io/doc/pipeline/examples/#push-git-repo)

The Snippet generator is helpful, but not not if you try to follow the instructions at: https://wiki.jenkins-ci.org/display/JENKINS/Credentials+Binding+Plugin

@vancluever
vancluever / amifind.sh
Created Jan 26, 2016
Find the most recent Ubuntu AMI using aws-cli (or any other AMI for that matter)
View amifind.sh
#!/bin/sh
# 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
dastergon / ec2_info_retriever.py
Last active Apr 6, 2021
A basic boto3 based tool for retrieving information from running EC2 instances.
View ec2_info_retriever.py
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
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"},