Skip to content

Instantly share code, notes, and snippets.

View jeremypruitt's full-sized avatar
:octocat:
@ Waabi.ai

Jeremy Pruitt jeremypruitt

:octocat:
@ Waabi.ai
View GitHub Profile
@ijin
ijin / eb_deploy_and_notify.sh
Last active September 29, 2023 16:41
Deploy to Elastic Beanstalk and notify via Slack
#!/bin/bash
set -x
export SHA1=`echo ${CIRCLE_SHA1} | cut -c1-7`
export ENV=`echo $1 | rev | cut -d \- -f1 | rev`
function dd_mute() {
if [[ ${DD_MUTE_ID+x} ]]; then
echo "muting DD monitor id: ${DD_MUTE_ID}"
curl -X POST "https://app.datadoghq.com/api/v1/monitor/${DD_MUTE_ID}/mute?api_key=${DD_API_KEY}&application_key=${DD_APP_KEY}"
@filipenf
filipenf / aws_saml_access.py
Last active July 7, 2021 05:39
Script to authenticate with SAML and write the security token to aws credentials file
#!/usr/bin/env python
"""
Prerequisites:
- keyring ( optional )
- argh
- beautifulsoup4
- requests-ntlm
This scripts authenticates you to your SAML provider and writes the
@ianunruh
ianunruh / cfssl_certificate.py
Created November 3, 2015 21:41
Ansible module for generating SSL certs from cfssl
#!/usr/bin/env python
import json
import os
import requests
def main():
module = AnsibleModule(
argument_spec=dict(
cert_path=dict(required=True),
@lusis
lusis / README.md
Last active September 14, 2020 17:47
terraform template to generate serverspec properties

This uses terraform's template_file resource to generate a yaml properties file for serverspec to use.

  • create the Rakefile in your terraform project root
  • create a spec directory and put spec_helper.rb in it
  • create the templates/properties.tmpl.yml file
  • create the serverspec.tf
  • terraform apply

tests

Tests will be matched based on roles defined for a given node.

@robbiet480
robbiet480 / README.md
Last active October 23, 2019 18:13
A consul-template plugin to get EC2 metadata

ec2-consul-template-plugin

About

This is a simple little Python script to let you query EC2 metadata from consul-template. It's only requirement is boto. It uses the EC2 internal metadata service so it does not require any API keys or even a region. The only caveat is that this can only be run on a machine on EC2.

Usage

You can give no arguments for full dictionary output or one or more arguments to get specific key(s). Put it somewhere on your machine, chmod +x it and give the full path to consul-template.

Examples

@RobertoSchneiders
RobertoSchneiders / deploy_with_ebcli3_on_circleci.md
Last active December 24, 2024 08:15
Settings to deploy to AWS Elastic Beanstalk on CircleCi (EB Cli 3)

This is how I configured the deploy of my rails apps to AWS Elastic Beanstalk through CircleCI 1.0.

If you are using the Circle CI 2.0, take a look at this article from ryansimms

Configure Environments Variables

On Project Settings > Environment Variables add this keys:

  • AWS_ACCESS_KEY_ID
  • AWS_SECRET_ACCESS_KEY
    The aws user must have the right permissions. This can be hard, maybe, this can help you.
@cchurch
cchurch / ratelimit.py
Created August 5, 2015 15:03
Ansible callback plugin example for rate limiting tasks
# Python
import time
class CallbackModule(object):
'''
Delay after Rackspace DNS API requests to avoid rate limit (20/minute).
'''
def _rate_limit(self):
role_name = getattr(getattr(self, 'task', None), 'role_name', '')
@PurpleBooth
PurpleBooth / README-Template.md
Last active April 18, 2025 02:49
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@yunano
yunano / consul
Last active October 7, 2022 18:58
/etc/init.d/consul for CentOS 6
#!/bin/sh
#
# consul - this script manages the consul agent
#
# chkconfig: 345 95 05
# processname: consul
### BEGIN INIT INFO
# Provides: consul
# Required-Start: $local_fs $network
@yamalight
yamalight / Makefile
Last active June 18, 2021 17:35
Generate docker TLS certs for secure remote access
# host name of your docker server
HOST=host.net
# ip of your docker server
IP=0.0.0.0
# days of validity for cert
DAYS=365
default:
openssl genrsa -aes256 -out ca-key.pem 4096
openssl req -new -x509 -days ${DAYS} -key ca-key.pem -sha256 -out ca.pem