Skip to content

Instantly share code, notes, and snippets.

View rcbop's full-sized avatar

Rogerio Peixoto rcbop

  • Spain
View GitHub Profile
@rbanks74
rbanks74 / ebs-snapshot.sh
Created May 1, 2015 17:24
Copy of CaseyLabs/aws-ec2-ebs-automatic-snapshot-bash
#!/bin/bash
export PATH=$PATH:/usr/local/bin/:/usr/bin
# Safety feature: exit script if error is returned, or if variables not set.
# Exit if a pipeline results in an error.
set -ue
set -o pipefail
## Automatic EBS Volume Snapshot Creation & Clean-Up Script
@ianblenke
ianblenke / prune_eb_versions.sh
Last active March 8, 2019 16:46
Delete any ElasticBeanstalk application versions older than a week old that are not currently in use by an environment.
awsargs="--profile aws-dev --region us-east-1"
now=$(date -j -f "%a %b %d %T %Z %Y" "$(date)" "+%s" 2>/dev/null);
oneweekago=$(expr $now - 604800);
aws elasticbeanstalk describe-application-versions $awsargs | \
jq -r '.ApplicationVersions[] | .ApplicationName + " " + .VersionLabel + " " + .DateCreated'| \
while read line ; do
fields=( $line )
utime=$(date -j -f %Y-%m-%dT%H:%M:%S "${fields[2]};" "+%s" 2>/dev/null);
if [[ $utime -lt $oneweekago ]]; then
if [ -n "$(aws elasticbeanstalk describe-environments $awsargs \
@RobertoSchneiders
RobertoSchneiders / elasticbeanstalk_deploy_iam_policy.md
Last active October 29, 2024 19:38
IAM Policy for deploy on Elastic Beanstalk

I am deploying with this IAM using Codeship and Circle CI to Elastic Beanstalk. I had a lot of trouble with this config. I talked to the aws support for about 6 hours until this worked properly, so, I guess it is worth to share.

UPDATE: In the end, I have to use the AWSElasticBeanstalkFullAccess policy. My custom policy keep breaking every week with some new added permission or some EB internal change. Anyway, the IAM I was using is below.

This works for me with CircleCI and EB Cli.

{
    "Version": "2012-10-17",
    "Statement": [
        {
@hermanbanken
hermanbanken / Dockerfile
Last active November 15, 2024 19:43
Compiling NGINX module as dynamic module for use in docker
FROM nginx:alpine AS builder
# nginx:alpine contains NGINX_VERSION environment variable, like so:
# ENV NGINX_VERSION 1.15.0
# Our NCHAN version
ENV NCHAN_VERSION 1.1.15
# Download sources
RUN wget "http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz" -O nginx.tar.gz && \
@PurpleBooth
PurpleBooth / 1password
Last active October 15, 2024 16:57
Use sops to cache the one password vault session token because op is horrible to use
#!/usr/bin/env bash
set -euo pipefail
CACHE_DIR="${XDG_CACHE_HOME:-$HOME/Library/Caches}/wrapper-1password"
CACHE_FILE="$CACHE_DIR/session-token.yaml"
OP_LOCATION="$(command -v op)"
mkdir -p "$CACHE_DIR"
############################################################################################################
################## #############################
################## #############################
This Gist collection contains all localstack related examples
################## #############################
################## #############################
############################################################################################################