Skip to content

Instantly share code, notes, and snippets.

View zot24's full-sized avatar
🦑
boom!

zot24

🦑
boom!
View GitHub Profile
@zot24
zot24 / haproxy.cfg
Created October 25, 2017 09:31
Custom Rancher Load Balancer haproxy.cfg to redirect any request under http to https and to redirect www. request to remove www.
backend www-redirect
http-request redirect prefix https://%[hdr(host),regsub(^www\.,,i)] code 302 if { hdr_beg(host) -i www. }
backend https-redirect
http-request redirect scheme https code 302 if !{ ssl_fc }
@zot24
zot24 / haproxy.cfg
Created October 25, 2017 09:31
Custom Rancher Load Balancer haproxy.cfg to redirect any request under http to https and to redirect www. request to remove www.
backend www-redirect
http-request redirect prefix https://%[hdr(host),regsub(^www\.,,i)] code 302 if { hdr_beg(host) -i www. }
backend https-redirect
http-request redirect scheme https code 302 if !{ ssl_fc }
@zot24
zot24 / Makefile
Last active April 9, 2019 08:09
Nested if's on a Makefile
.PHONY: deploy
deploy: ## deploy app
@if [[ $(ENVIRONMENT) == "development" ]]; then \
if [[ ! -f .built ]]; then \
$(MAKE) build; \
fi; \
if [[ ! -f .import ]]; then \
$(MAKE) import; \
fi; \
if [[ ! -f .migrate ]]; then \
@zot24
zot24 / s3.tf
Created August 9, 2017 13:18 — forked from onnimonni/s3.tf
s3 replicated bucket with terraform
# Create all variables used in this Terraform run
variable "aws_access_key" {}
variable "aws_access_secret_key" {}
variable "aws_bucket_name" {}
variable "aws_region_main" {
default = "eu-west-1"
}
variable "aws_region_replica" {
default = "eu-central-1"
}
@zot24
zot24 / README-Template.md
Created June 1, 2017 23:37 — forked from PurpleBooth/README-Template.md
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

@zot24
zot24 / configure_proxy_protocol.md
Created June 1, 2017 21:19 — forked from pablitoc/configure_proxy_protocol.md
Configuring Proxy Protocol

##Install AWS CLI Tools##

  1. Install AWS CLI Tools. You can also use the EC2 API Tool if you are more comfortable with them. But this write-up uses the EC2 CLI.
  2. Create a user via Amazon IAM or download the security accessID and securitykey you will need it to query Amazon CLI.
  3. using Terminal cd into .aws directory cd ~/.aws edit or create new file named config paste the following contents inside.
    `[default]`
    `aws_access_key_id = ACCESS_ID`
    `aws_secret_access_key = SECRET_ID`
    `output = json OR bson OR text`
    `region = PREFERRED_AWS_REGION`

Save the file as "config"

@zot24
zot24 / Jenkinsfile
Created May 2, 2017 19:16 — forked from amaksoft/Jenkinsfile
My example Jenkins Pipeline setup for Android app project
#!/usr/bin/groovy
/*
* Copyright (c) 2016, Andrey Makeev <amaksoft@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
@zot24
zot24 / Jenkinsfile.groovy
Created May 2, 2017 18:30 — forked from frekele/Jenkinsfile.groovy
Jenkinsfile to tag the sources used by current build
node {
repositoryAccess = 'https://'
repositoryAccessSeparator = '/'
echo "repository host: ${repositoryHost}" // github.com
echo "repository path: ${repositoryPath}" // <user>/<repository>.git
echo "repository jenkins credentials id: ${credentialsId}" // jenkins credentials for the jenkins git account who have commit access
echo "repository branch: ${branch}" // master or another branch
echo "repository commiter username: ${repositoryCommiterUsername}" // Jenkins account email
echo "repository commiter name: ${repositoryCommiterEmail}" // Jenkins
@zot24
zot24 / s3_bucket.tf
Last active October 11, 2017 12:15
Create a S3 Bucket to store Terraform Remote State files
resource "aws_s3_bucket" "state" {
bucket = "${var.bucket_name}"
versioning {
enabled = true
}
lifecycle {
prevent_destroy = true
}
@zot24
zot24 / Makefile
Last active October 11, 2017 12:15
Before we start test that we have the manditory executables avilable
EXECUTABLES = git terraform
K := $(foreach exec,$(EXECUTABLES),\
$(if $(shell which $(exec)),some string,$(error "No $(exec) in PATH, consider apt-get install $(exec)")))