Skip to content

Instantly share code, notes, and snippets.

View glehmann's full-sized avatar
🙂

Gaëtan Lehmann glehmann

🙂
View GitHub Profile
@glehmann
glehmann / vault_intermediate_ca_setup.sh
Last active October 21, 2016 20:06 — forked from bhouse/vault_intermediate_ca_setup.sh
Setting Up Hashicorp Vault with an intermediate CA based on https://gist.github.com/jefferai/092d2cd728ff66089f17
#!/bin/bash -e
# Setup a Root CA in vault
# Generate and sign an Intermediate cert
#
# Requires:
# * vault cli (https://www.vaultproject.io)
# * jq (https://stedolan.github.io/jq/)
# * A running vault server already initialzed and unsealed
# * vault cli must be already authenticated (try "vault server -dev")
@glehmann
glehmann / main.rs
Created December 27, 2018 09:47
adding path to io error in rust
extern crate custom_error;
use custom_error::custom_error;
use std::fs::metadata;
use std::io;
use std::path::Path;
use std::path::PathBuf;
use std::result::Result;
custom_error! {ProgramError
@glehmann
glehmann / main.rs
Created December 27, 2018 20:54
adding path to io error in rust, with a trait to ease the error transformation
extern crate custom_error;
use custom_error::custom_error;
use std::fs::metadata;
use std::io;
use std::path::Path;
use std::path::PathBuf;
use std::result::Result;
custom_error! {ProgramError
@glehmann
glehmann / gist:3d5d416bc76e3bb1fcad6eaaa0be86bb
Last active January 21, 2024 08:57
creating files with the expected uid/gid in a docker local volume
glehmann@gbook:/tmp/test$ docker run -v .:/app alpine touch /app/foo
glehmann@gbook:/tmp/test$ ls -lh
total 0
-rw-r--r-- 1 root root 0 janv. 21 09:48 foo
glehmann@gbook:/tmp/test$ docker run -u $(id -u):$(id -g) -v .:/app alpine touch /app/bar
glehmann@gbook:/tmp/test$ ls -lh
total 0
-rw-r--r-- 1 glehmann glehmann 0 janv. 21 09:48 bar
-rw-r--r-- 1 root root 0 janv. 21 09:48 foo