Skip to content

Instantly share code, notes, and snippets.

View ronaldoedy's full-sized avatar

Ronaldo ronaldoedy

View GitHub Profile
@ronaldoedy
ronaldoedy / gcp-aws-site-to-site-vpn.sh
Created December 19, 2023 11:07 — forked from mikesparr/gcp-aws-site-to-site-vpn.sh
Example site to site VPN between Google Cloud Platform (GCP) and Amazon Web Services (AWS)
#!/usr/bin/env bash
#####################################################################
# REFERENCES
# - https://cloud.google.com/architecture/build-ha-vpn-connections-google-cloud-aws
# - https://cloud.google.com/vpc/docs/private-service-connect
#####################################################################
export PROJECT_ID=$(gcloud config get-value project)
export PROJECT_USER=$(gcloud config get-value core/account) # set current user
@ronaldoedy
ronaldoedy / list.txt
Created April 28, 2023 15:25 — forked from shortjared/list.txt
List of AWS Service Principals
a4b.amazonaws.com
access-analyzer.amazonaws.com
account.amazonaws.com
acm-pca.amazonaws.com
acm.amazonaws.com
airflow-env.amazonaws.com
airflow.amazonaws.com
alexa-appkit.amazon.com
alexa-connectedhome.amazon.com
amazonmq.amazonaws.com
@ronaldoedy
ronaldoedy / libraries.md
Last active November 11, 2021 12:54
Ubuntu Development Libraries

Introduction

This is a list of essential tools for developing with Ubuntu.

Requirements

  • Ubuntu server

Installation

@ronaldoedy
ronaldoedy / toggleAutoScalingGroup.md
Created January 12, 2021 13:48 — forked from veuncent/toggleAutoScalingGroup.md
AWS Auto Scaling Groups: scheduled start/stop

Tutorial: scheduled start/stop of EC2 instances managed by Auto Scaling Groups

If your EC2 instances in AWS are managed through Auto Scaling Groups, it is easy to schedule startup and shutdown of those instances, e.g. to save money.

This tutorial walks you through setting up an AWS Lambda function that is triggered by CloudWatch Events and automatically changes the min, max and desired instances in your Auto Scaling Group(s).

The idea is to toggle between 0 (stop) and a specifed min, max and desired amount of instances (start), so you only need a single Lambda function. The premise is that you do not touch these Auto Scaling Group settings manually, or you might make your EC2 instances nocturnal.

Create new Lambda function and Start Event

@ronaldoedy
ronaldoedy / install-configure-letsencrypt.sh
Created March 12, 2020 18:46 — forked from craigvantonder/install-configure-letsencrypt.md
Install and configure LetsEncrypt on Ubuntu Server 14.04 & 16.04 (Apache)
#!/bin/bash
# https://www.digitalocean.com/community/tutorials/how-to-secure-apache-with-let-s-encrypt-on-ubuntu-14-04
# Download the Let’s Encrypt Client
cd /usr/local/sbin
sudo wget https://dl.eff.org/certbot-auto
sudo chmod a+x /usr/local/sbin/certbot-auto
# Set Up the SSL Certificate
@ronaldoedy
ronaldoedy / zabbix-alert-smtp.sh
Created September 23, 2019 18:55 — forked from AnsonYe/zabbix-alert-smtp.sh
Zabbix SMTP Alert script for gmail and Amazon SES
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Zabbix SMTP Alert script for gmail and Amazon SES.
"""
import sys
import smtplib
from email.MIMEText import MIMEText
from email.Header import Header
@ronaldoedy
ronaldoedy / Dockerfile
Created November 22, 2018 14:05 — forked from tmaiaroto/Dockerfile
WordPress on Amazon ECS
FROM alpine:3.3
MAINTAINER Tom Maiaroto <tom@outdoorsy.co>
# Install packages
RUN apk --update --repository http://dl-3.alpinelinux.org/alpine/edge/main add \
freetype-dev \
libjpeg-turbo-dev \
libpng-dev \
libwebp-dev \
php7 \
@ronaldoedy
ronaldoedy / README.md
Created November 13, 2018 21:16 — forked from eiri/README.md
Installing Prometheus on Debian

Install Prometheus on Debian

install gosu

just to not wrestle with sudo and exec

$ sudo apt-get update
$ sudo apt-get install gosu

Create prometheus user

https://blog.svedr.in/posts/prometheus-quick-start.html
https://blog.svedr.in/posts/prometheus-quick-start.rst
.. title: Prometheus quick start
.. slug: prometheus-quick-start
.. date: 2016-07-05 15:50:00 UTC+02:00
.. tags: linux, prometheus
.. link:
.. description:
@ronaldoedy
ronaldoedy / awc-ecs-access-to-aws-efs.md
Created November 2, 2018 20:50 — forked from duluca/awc-ecs-access-to-aws-efs.md
Step-by-step Instructions to Setup an AWS ECS Cluster

Configuring AWS ECS to have access to AWS EFS

If you would like to persist data from your ECS containers, i.e. hosting databases like MySQL or MongoDB with Docker, you need to ensure that you can mount the data directory of the database in the container to volume that's not going to dissappear when your container or worse yet, the EC2 instance that hosts your containers, is restarted or scaled up or down for any reason.

Don't know how to create your own AWS ECS Cluster? Go here!

New Cluster

Sadly the EC2 provisioning process doesn't allow you to configure EFS during the initial config. After your create your cluster, follow the guide below.

New Task Definition for Web App

If you're using an Alpine-based Node server like duluca/minimal-node-web-server follow this guide: