Simple collection of Groovy scripts to help me maintain some Jenkins systems.
See also https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+Script+Console
Please comment & let me know if you have a fork / fixes you'd like to include.
import urllib | |
import urlparse | |
import collections | |
import httplib | |
def TestPayment(): | |
#Set our headers | |
headers = { | |
'X-PAYPAL-SECURITY-USERID': 'jb-us-seller_api1.paypal.com', | |
'X-PAYPAL-SECURITY-PASSWORD': 'WX4WTU3S8MY44S7F', |
# Something in lines of http://stackoverflow.com/questions/348630/how-can-i-download-all-emails-with-attachments-from-gmail | |
# Make sure you have IMAP enabled in your gmail settings. | |
# Right now it won't download same file name twice even if their contents are different. | |
import email | |
import getpass, imaplib | |
import os | |
import sys | |
detach_dir = '.' |
#!/usr/bin/env bash | |
apt-get -y update | |
apt-get -y upgrade | |
apt-get -y install git build-essential autoconf zlib1g-dev libssl-dev \ | |
libreadline-dev libyaml-dev libcurl4-openssl-dev curl python-software-properties \ | |
ruby1.9.1 ruby1.9.1-dev rubygems1.9.1 irb1.9.1 ri1.9.1 rdoc1.9.1 | |
gem install chef ruby-shadow --no-ri --no-rdoc |
Simple collection of Groovy scripts to help me maintain some Jenkins systems.
See also https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+Script+Console
Please comment & let me know if you have a fork / fixes you'd like to include.
--- | |
parser: espree | |
env: | |
amd: false | |
browser: false | |
es6: false | |
jasmine: false | |
jquery: false | |
meteor: false | |
mocha: false |
If you use Amazon AWS for nearly anything, then you are probably familiar with KMS, the Amazon Key Management Service.
KMS is a service which allows API-level access to cryptographic primitives without the expense and complexity of a full-fledged HSM or CloudHSM implementation. There are trade-offs in that the key material does reside on servers rather than tamper-proof devices, but these risks should be acceptable to a wide range of customers based on the care Amazon has put into the product. You should perform your own diligence on whether KMS is appropriate for your environment. If the security profile is not adequate, you should consider a stronger product such as CloudHSM or managing your own HSM solutions.
The goal here is to provide some introductory code on how to perform envelope encrypt a message using the AWS KMS API.
KMS allows you to encrypt messages of up to 4kb in size directly using the encrypt()/decrypt() API. To exceed these limitations, you must use a technique called "envelope encryptio
#!groovy | |
# https://github.com/cyrille-leclerc/game-of-life/blob/jenkinsfile/Jenkinsfile | |
docker.image('cloudbees/java-build-tools:0.0.6').inside { | |
checkout scm | |
def mavenSettingsFile = "${pwd()}/.m2/settings.xml" | |
stage 'Build Web App' | |
wrap([$class: 'ConfigFileBuildWrapper', |
{ | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Resources": { | |
"Topic": { | |
"Type": "AWS::SNS::Topic", | |
"Properties": { | |
} | |
}, | |
"Queue": { | |
"Type": "AWS::SQS::Queue", |
'Update or create a stack given a name and template + params' | |
from __future__ import division, print_function, unicode_literals | |
from datetime import datetime | |
import logging | |
import json | |
import sys | |
import boto3 | |
import botocore |