Skip to content

Instantly share code, notes, and snippets.

View chefren's full-sized avatar
Working from home

Efrén chefren

Working from home
View GitHub Profile
chefren /
Created June 16, 2022 00:33 — forked from paulgear/
Stupid ipset hack #1: Count & log unique NTP sources addresses
set -eu

Comparison of Terraform vs CDK frameworks to use for AWS

Property Value/Behaviour TF Value/Behaviour CDK Opinion
Basic task Define and end state for the system and apply it when appropriate Generate AWS Cloudformation template to work with stack resources CDK benefits from AWS internal service. TF depends on AWS API
Language Terraform Config language Support for Typescrypt, Java, .Net, Go, Python CDK advantage for training with known languages
Backend TF state file (json) AWS Cloudformation TF requires a backend to be setup and hosted (can use S3 and DynamoDB), CDK may require CDK bootstrapping (deploys S3 and IAM through a stack via the tool)
Setup Docker containers available from Hashicorp Requires Node.js to run CDK, then the language platform of choice In both changes different envs with different versions may cause breaking changes if not car
chefren / ACG AWS
Last active February 4, 2022 06:07
ACG AWS Challenges

Linkedin challenge from ACG on AWS

Hello there, I tried the challenges and found it a good way to jump onto serverless and ML services.

So here's a summary blog as some pros and cons tables anyone may find on the challenges.


Launch a static website on S3

chefren /
Created February 4, 2020 05:57 — forked from micw/
Script to install one or more jenkins plugins including dependencies while jenkins is offline
set -e
if [ $# -eq 0 ]; then
echo "USAGE: $0 plugin1 plugin2 ..."
exit 1
chefren /
Created February 4, 2020 05:57 — forked from hgomez/
Mass install/update of Jenkins Plugins

Scripted Jenkins Plugins install

Jenkins has a very rich catalog of plugins and it's quite easy to install and update them via UI. BTW, when you want to add tons of plugin via UI, it's a fairly long and boring procedure.

Hopefully, mass installation (or update) could be easy using a simple bash script (curl/python required) :

Create a file containing plugins to be installed (or updated), ie iplugins :

How to setup AWS lambda function to talk to the internet and VPC

I'm going to walk you through the steps for setting up a AWS Lambda to talk to the internet and a VPC. Let's dive in.

So it might be really unintuitive at first but lambda functions have three states.

  1. No VPC, where it can talk openly to the web, but can't talk to any of your AWS services.
  2. VPC, the default setting where the lambda function can talk to your AWS services but can't talk to the web.
  3. VPC with NAT, The best of both worlds, AWS services and web.
chefren / GPSExif.swift
Created October 11, 2017 23:33 — forked from nitrag/GPSExif.swift
Generate Metadata Exif for GPS
// Generate EXIF GPS metadata
// Swift 3
// Exif Version supports decimal degrees
import Foundation
import CoreLocation
import ImageIO
extension CLLocation {
chefren / pre-commit
Last active November 23, 2018 10:46 — forked from jeekl/gist:5083519
git pre-commit hook to validate json objects so you don't commit broken json.
#!/usr/bin/env bash
# Runs all .json files through pythons json lint tool before commiting,
# to make sure that you don't commit broken json objects.
git_dir=$(git rev-parse --show-toplevel)
for file in $(git diff-index --name-only --diff-filter=ACM --cached HEAD -- \
| grep -P '\.(json)$'); do
python -mjson.tool $file 2> /dev/null
if [ $? -ne 0 ] ; then