Skip to content

Instantly share code, notes, and snippets.

View marcaurele's full-sized avatar
🚵
Coaching kids to jump of their fears

Marc-Aurèle Brothier marcaurele

🚵
Coaching kids to jump of their fears
View GitHub Profile
@marcaurele
marcaurele / passwordstore-team.md
Last active May 25, 2022 09:37
Team management for passwotdstore.org

Share a repository for password with pass

Pass is a great command line tool to handle your password, as well in a team.

Add a new member in the team

Add the key into your local GPG base:

$ gpg --keyserver <a specific key server if needed> --search-keys <email address>
@marcaurele
marcaurele / insert-aws-routes-nmcli.md
Created February 12, 2021 13:29
Inject AWS ip ranges into your VPN static routes

AWS routes insertion in NetworkManager

Change <vpn-name> with your VPN's name.

For IPv4 ranges

# IPv4
curl --silent https://ip-ranges.amazonaws.com/ip-ranges.json \
  | jq -r '.prefixes | .[].ip_prefix' \
 | tr '\n' ',' \
@marcaurele
marcaurele / docs.nomad
Created March 10, 2021 07:09
Nomad sample job
job "docs" {
datacenters = ["racobro"]
group "example" {
network {
port "http" {
static = "5678"
}
}
task "server" {
@marcaurele
marcaurele / exif_rename.sh
Last active April 9, 2022 14:44
Rename my photos with my preferred datetime format
for i in $( ls *.JPG ); do exiv2 -v -r '%Y-%m-%d_%Hh%M%m%S' rename "$i"; done
for i in $( ls *.JPG ); do mv $i ${i%%.JPG}.jpg; done
@marcaurele
marcaurele / cloud.rego
Created March 24, 2021 09:04
Example REGO rule
package httpapi.authorization.project
import input
# Very important!, default to deny!
default allow_reading = false
default allow_editing = false
default allow_processing = false
role_allow_processing = {"MANAGER", "OWNER"}
@marcaurele
marcaurele / ocr-my-pdf.sh
Last active October 3, 2023 07:47
OCR PDF inside a directory
# Option 1
find . -printf '%p\n' -name '*.pdf' -exec ocrmypdf '{}' '{}' \;
# Option 2
for f in *; do echo $f; ocrmypdf -l fra $f $f; done
@marcaurele
marcaurele / gist:96957102802669248fc39860f85d2f5c
Created May 12, 2021 09:25
One liner for release history between 2 branches
git log --pretty=oneline --abbrev-commit master..staging
@marcaurele
marcaurele / exif-xmp.sh
Created June 15, 2021 14:20
Read photo XMP tags
exiv2 -PXkyct $*
@marcaurele
marcaurele / Dockerfile
Last active November 3, 2021 20:12
pyenv setup under Ubuntu 21.04
FROM ubuntu:21.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -y \
# Tools for the pyenv installer script
curl \
git \
# Tools to build python from source
@marcaurele
marcaurele / terraform-via-docker-aws-vault.md
Created April 8, 2022 11:39
Run Terraform via docker using aws-vault to provide AWS variables

To run terraform via a container while providing the aws-vault env variables:

docker run --rm \
    -v `pwd`:/workspace \
    -w /workspace/terraform \
    --env-file <(aws-vault exec default -- env | grep AWS) \
    --env TF_WORKSPACE=production \
    hashicorp/terraform:1.1.6 \
    init/plan/apply