Skip to content

Instantly share code, notes, and snippets.

View politician's full-sized avatar
:octocat:
Focusing on OSS I maintain

Romain Barissat politician

:octocat:
Focusing on OSS I maintain
View GitHub Profile
@politician
politician / New Terraform provider from scratch.md
Created August 9, 2021 10:17
New Terraform provider from scratch

The following information is either not mentioned in the various docs and tutorials either well-hidden:

Official provider template: https://github.com/hashicorp/terraform-provider-scaffolding

When making a new provider from scratch, build it in $GOPATH/bin/terraform-provider-example then let's say your provider will reside on the official Terraform registry under my-company/example, you need to create a bypass to use your locally built provider on your system:

mkdir -p ~/.terraform.d/plugins/registry.terraform.io/my-company/example/1.0.0/darwin_amd64
ln -s $GOPATH/bin/terraform-provider-example ~/.terraform.d/plugins/registry.terraform.io/my-company/example/1.0.0/darwin_amd64/terraform-provider-example
@politician
politician / commit-build.sh
Created September 23, 2020 16:16
Pre-commit hook to build and add folder to the current commit
# This script is used for repos that need to commit a build folder (eg. Github actions)
# Add more sources/destinations by separating them by spaces (ie. source="src lib")
source="src"
build="dist"
# If some changes in $source are staged
if [[ $(git status --porcelain $source | egrep '^M') ]]
then

Keybase proof

I hereby claim:

To claim this, I am signing this object:

Goal

Find out which framework is the lightest out of the box with its dependencies

Use Case

I wanted to develop a NodeJS microservice to be deployed on AWS Lambda (serverless) where size matters! Note that out-of-the-box, each framework has very different capabilities and helpers. The aim of this test is to find out what is the minimum size for each. The next step is to compare each framework with a specific use case.

Methodology

@politician
politician / aws_change_password_error_path.md
Created February 15, 2020 12:08
Either user is not authorized to perform iam:ChangePassword or entered password does not comply with account password policy set by administrator

If you get the following error on AWS:

Either user is not authorized to perform iam:ChangePassword or entered password does not comply with account password policy set by administrator

TLDR: Don't use "paths" in IAM

You checked all your policies for a while including AWS's managed policy IAMUserChangePassword and you can't find what the hell is wrong. Maybe you were using, like me, the IAM path feature...

The IAMUserChangePassword policy is as follow:

@politician
politician / AFP-SSHFS-WebDav.md
Last active October 9, 2019 05:13
Comparing file transfer speeds for AFP, SSHFS and WebDav for accessing a shared folder for a Synology NAS over the internet

TLDR

WebDav is 2x faster

Methodology

I used the same NAS to configure all three protocols and test them remotely (half-way across the globe)

rsync -a --progress --stats --human-readable SOURCEFILE DESTINATIONPATH
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@politician
politician / brew-cask-upgrade.sh
Created May 11, 2016 08:50
brew cask upgrade
brew cask list | xargs brew cask install