Skip to content

Instantly share code, notes, and snippets.

View nicosingh's full-sized avatar

Nico Singh nicosingh

View GitHub Profile
@nicosingh
nicosingh / alert-manager.md
Last active November 23, 2025 07:26
A small and local configuration for Prometheus + AlertManager + Slack notifications + Unsee

TL;DR

Clone this repo:

git clone https://gist.github.com/08be6d6e7605a43fe52d1f201c2b47d8.git
cd 08be6d6e7605a43fe52d1f201c2b47d8

Start the docker stack:

@nicosingh
nicosingh / .gitignore
Last active July 2, 2025 06:02
ECS using Terraform sample
*.tfbackup
.terraform/
*.tfstate
.terraform.tfstate.lock.info
@nicosingh
nicosingh / main.py
Created May 3, 2025 19:59
F1 24 UDP Client in Python
import socket
import ctypes
from enum import IntEnum, Enum
import time
class PacketID(IntEnum):
MOTION = 0
SESSION = 1
LAP_DATA = 2
EVENT = 3
@nicosingh
nicosingh / .env
Last active December 17, 2024 01:10
MySQL cluster using docker
MYSQL_ROOT_PASSWORD=rootpass
resource "aws_acm_certificate" "certificate" {
certificate_body = acme_certificate.certificate.certificate_pem
private_key = acme_certificate.certificate.private_key_pem
certificate_chain = acme_certificate.certificate.issuer_pem
}
output "certificate_pem" {
value = acme_certificate.certificate.certificate_pem
}
output "issuer_pem" {
value = acme_certificate.certificate.issuer_pem
}
output "private_key_pem" {
value = nonsensitive(acme_certificate.certificate.private_key_pem)
resource "aws_s3_object" "certificate_artifacts_s3_objects" {
for_each = toset(["certificate_pem", "issuer_pem", "private_key_pem"])
bucket = "test-singh-cl-ssl-cert" # TODO put your own S3 bucket, and create it before if necessary!
key = each.key # TODO prefix with your own bucket path if there is any
content = lookup(acme_certificate.certificate, "${each.key}")
}
provider "acme" {
server_url = "https://acme-staging-v02.api.letsencrypt.org/directory"
#server_url = "https://acme-v02.api.letsencrypt.org/directory"
}
data "aws_route53_zone" "base_domain" {
name = "eks.singh.cl" # TODO put your own DNS in here!
}
resource "tls_private_key" "private_key" {
terraform {
required_version = "~> 1.9.5"
required_providers {
acme = {
source = "vancluever/acme"
version = "~> 2.5.3"
}
aws = {
source = "hashicorp/aws"
eks_pod_identity_associations = {}