Skip to content

Instantly share code, notes, and snippets.

View exequielrafaela's full-sized avatar
💭
☕ if(infra == code){return true}

Exequiel Barrirero exequielrafaela

💭
☕ if(infra == code){return true}
View GitHub Profile
@exequielrafaela
exequielrafaela / README.md
Created August 25, 2017 22:57 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.

For more about AWS and AWS Certifications and updates to this Gist you should follow me @leonardofed


@exequielrafaela
exequielrafaela / nginx.conf
Created September 24, 2018 21:20 — forked from kmjones1979/nginx.conf
Example NGINX configuration to route based on country code using GeoIP
# load dynamic modules
load_module /etc/nginx/modules/ngx_http_geoip_module.so;
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log info;
pid /var/run/nginx.pid;
events { worker_connections 1024; }
http {
@exequielrafaela
exequielrafaela / .gitignore
Last active July 6, 2019 20:20
Reference .gitignore
# Hidden files #
################
.*
#
# Except
#
!*.env.example
!*.dockeringnore
!*.hosts
!/.gitignore
@exequielrafaela
exequielrafaela / DEVELOPMENT_WORKFLOW_A.md
Last active June 28, 2019 22:52
CI/CD Development Workflow w/ Spinnaker + Jenkins

Workflow implementation example A

Jenkins as 1ry executor with dev/stg/prod docker image tags prefix

DEV

  1. Scm-github / scm-bitbucket: git push / PR to develop branch.
  2. Jenkins webhook automatically/manual triggers job which will build docker image w/ unit tests (optional can be in a separate pre-dependency Jenkins / CircleCI job) adding dev-build# tag -> If OK.
  3. Push docker image to AWS ECR.
  4. New docker image with tag dev-* detected by Spinnaker hook that auto triggers a deployment pipeline with DB migrations + ENV vars secret mgmt
@exequielrafaela
exequielrafaela / prometheus.yml
Created October 17, 2019 23:21 — forked from reachlin/prometheus.yml
sample prometheus configuration explained
// For all the confusing Prometheus configuration and
// regular expressions,
// explained in examples.
// Remember, there are default values for each item if it's missing.
// regex is (.*),
// replacement is $1,
// separator is ;
// ,and action is replace
@exequielrafaela
exequielrafaela / aws_cloudfront_no_origin_s3_restriction_test.sh
Last active November 24, 2023 14:54
Scurity & Audit Bash script functions based on awscli to get differente AWS services information for different scenarios
#!/usr/bin/env bash
#
# AWS ENV vars for your project (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html)
#
# AWS_PROFILE – Specifies the name of the CLI profile with the credentials and options to use.
# This can be the name of a profile stored in a credentials (~/.aws/credentials) or config (~/.aws/config)
# file, or the value default to use the default profile. If you specify this environment variable,
# it overrides the behavior
# of using the profile named [default] in the configuration file.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "MultiServiceFullAccessCustom",
"Effect": "Allow",
"Action": [
"ec2:*",
"rds:*"
],
@exequielrafaela
exequielrafaela / gh-pages-deploy.md
Created August 5, 2020 18:36 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@exequielrafaela
exequielrafaela / aws-s3api-delete-objects-from-aws-s3api-list.sh
Last active October 6, 2020 15:39
aws s3api delete-objects from aws s3api list
AWS_SHARED_CREDENTIALS_FILE="/home/user/.aws/test/credentials" \
AWS_CONFIG_FILE="/home/user/.aws/test/config" \
aws s3api delete-objects \
--profile test-shared-devops \
--bucket test-shared-gdrive-backup \
--delete \
"$(AWS_SHARED_CREDENTIALS_FILE="/home/user/.aws/test/credentials" AWS_CONFIG_FILE="/home/user/.aws/test/config" aws s3api list-object-versions \
--profile test-shared-devops \
--bucket test-shared-gdrive-backup | jq '{Objects: [.Versions[] | {Key:.Key, VersionId : .VersionId}], Quiet: false}')"
@exequielrafaela
exequielrafaela / aws_s3_storage_bucket.tf
Last active October 6, 2020 15:34
AWS S3 Secure Multipurpose Storage Bucket
#
## Examples
# - Complete | https://github.com/binbashar/terraform-aws-s3-bucket/tree/master/examples/complete
# - Replication | https://github.com/binbashar/terraform-aws-s3-bucket/tree/master/examples/s3-replication
#
#=============================#
# Module Instanciation #
#=============================#
module "s3_bucket" {