Skip to content

Instantly share code, notes, and snippets.

View eamonnfaherty's full-sized avatar

Eamonn Faherty eamonnfaherty

View GitHub Profile
@aydiv
aydiv / TestPayment.py
Created April 25, 2012 16:51
Paypal Adaptive Payments - Python sample for parallel payment
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',
@baali
baali / dlAttachments.py
Created May 8, 2012 08:32
Python script to download all gmail attachments.
# 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
@dnozay
dnozay / _Jenkins+Script+Console.md
Last active June 5, 2024 17:43
jenkins groovy scripts collection.
@alefteris
alefteris / .eslintrc
Created May 9, 2015 17:01
ESLint default config in YAML format
---
parser: espree
env:
amd: false
browser: false
es6: false
jasmine: false
jquery: false
meteor: false
mocha: false
@pmp
pmp / envelope_encryption_kms_boto_pycrypto.md
Last active November 17, 2021 16:35
Envelope Encryption using AWS KMS, Python Boto, and PyCrypto.

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

@cyrille-leclerc
cyrille-leclerc / Jenkinsfile
Last active December 6, 2016 14:43
Jenkinsfile Maven - Game of Life
#!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',
@Nath-P
Nath-P / AWS CloudFormation SNS Subscription.json
Last active June 25, 2018 17:31
AWS CloudFormation SNS Subscription
{
"AWSTemplateFormatVersion": "2010-09-09",
"Resources": {
"Topic": {
"Type": "AWS::SNS::Topic",
"Properties": {
}
},
"Queue": {
"Type": "AWS::SQS::Queue",
@svrist
svrist / cf_create_or_update.py
Created February 7, 2017 21:34
Update or create a CloudFormation stack given a name and template + params'
'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