Skip to content

Instantly share code, notes, and snippets.

View lgaticaq's full-sized avatar

Leonardo Gatica lgaticaq

View GitHub Profile
@the-vampiire
the-vampiire / mongo-atlas-whitelist-entrypoint.md
Last active March 26, 2025 14:01
docker entrypoint to automatically whitelist mongo atlas IP

why

mongo atlas provides a reasonably priced access to a managed mongo DB. CSPs where containers are hosted charge too much for their managed mongo DB. they all suggest setting an insecure CIDR (0.0.0.0/0) to allow the container to access the cluster. this is obviously ridiculous.

this entrypoint script is surgical to maintain least privileged access. only the current hosted IP address of the service is whitelisted.

related searches, hope this shows up for you

  • "How to connect to mongodb atlas cluster to container app service EKS ECS cloudrun compute engine"
  • "mongodb atlas cluster access without using whitelist 0.0.0.0"
@rishitells
rishitells / Jest_GitLab_CI.md
Last active December 25, 2024 22:21
Setting up Jest tests and coverage in GitLab CI

Configuring Jest Tests in GitLab CI

1. Add GitLab CI configuration file in the root

In the root of your project, add .gitlab-ci.yml with the configuration below.

image: node:latest

stages:
@paustint
paustint / Dockerfile
Created May 21, 2020 15:44
Deploy zip to Heroku with GitHub Action
FROM alpine
RUN apk add --no-cache curl jq
@fridgerator
fridgerator / instructions.md
Created November 14, 2019 23:48
Auto-renewing Lets Encrypt certificates for Rancher 1.6

Lets Encrypt has removed their ACME V1 api in favor of ACME V2. The Rancher 1.6 catalog entry for Lets Encrypt certificates doesn't support this api. There is a forked version of the repo, however the service has to be created manually instead of from the catalog.

  1. Create a new service, give it a name, use vxcontrol/rancher-letsencrypt:v1.0.0 for the image
  2. In the "Volumes" tab, add a volume /var/lib/rancher:/var/lib/rancher
  3. In the "Command" tab, set the "Console" option to none
  4. Click to add an Environment Variable, and paste the following into the first "Variable" input field.
  • All of the environment variables should auto-fill.
  • Fill in the necessary values
#Login to ECR with AWS SDK v1
#$(aws ecr get-login --no-include-email)
#Login to ECR with AWS SDK v2
aws ecr get-login-password \
| docker login \
--password-stdin \
--username AWS \
"xxx.dkr.ecr.us-west-2.amazonaws.com"
@mkhmylife
mkhmylife / laravel-k8s-configmap.yaml
Created May 3, 2019 18:31
Laravel Kubernetes Deployment files
apiVersion: v1
kind: ConfigMap
metadata:
name: backend-config
data:
APP_DEBUG: "false"
APP_ENV: production
APP_KEY: changeme
APP_LOG_LEVEL: debug
APP_NAME: "Laravel K8s"
@ptflp
ptflp / Dockerfile
Last active December 22, 2024 11:43
docker php install imagemagick alpine 3.8
FROM php:7.0-fpm-alpine
RUN set -ex && \
apk add --no-cache --virtual .build-deps \
libxml2-dev \
shadow \
autoconf \
g++ \
make \
&& apk add --no-cache imagemagick-dev imagemagick libjpeg-turbo libgomp freetype-dev \
@adejones
adejones / xlsx_dict_reader.py
Last active June 23, 2021 15:24
openpyxl (2.4.8) sheet-to-dict like the csv DictReader - based on https://gist.github.com/mdellavo/853413
from openpyxl import load_workbook
def XLSXDictReader(f):
book = load_workbook(f)
sheet = book.active
rows = sheet.max_row
cols = sheet.max_column
headers = dict((i, sheet.cell(row=1, column=i).value) for i in range(1, cols))
def item(i, j):
return (sheet.cell(row=1, column=j).value, sheet.cell(row=i, column=j).value)
@troyharvey
troyharvey / deployment.yml
Last active April 18, 2025 05:04
Using Kubernetes envFrom for environment variables
# Use envFrom to load Secrets and ConfigMaps into environment variables
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: mans-not-hot
labels:
app: mans-not-hot
spec:
replicas: 1
@superseb
superseb / README.md
Last active March 17, 2022 00:14
Move rancher/server with volumes to other host + DNS name change

Move rancher/server container with volumes to other host + change of DNS name (Host Registration URL/CATTLE_URL/API URL) for Rancher 1.6

This applies to Rancher 1.6 only

Variables used in this guide: