Skip to content

Instantly share code, notes, and snippets.

View tgermain's full-sized avatar

Timothée GERMAIN tgermain

View GitHub Profile
@tgermain
tgermain / tp.md
Last active January 25, 2019 16:05
docker TP
@tgermain
tgermain / docker_keyid.py
Created January 15, 2016 11:13
mimic docker/libtrust keyIDFromCryptoKey, usefull when using JWT as authentication for a docker registry v2
# -*- coding: utf-8 -*-
"""
This code mimic the behaviour of docker/libtrust function keyIDFromCryptoKey
It is usefull when using Json Web Token as authentication in a docker regsitry V2.
source : https://github.com/docker/libtrust/blob/9cbd2a1374f46905c68a4eb3694a130610adc62a/util.go#L194
"""
from cryptography import x509
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import serialization
@tgermain
tgermain / App descriptor
Created July 2, 2015 13:11
even stranger port mapping
{
"id": "easy-app-python",
"cpus": 0.2,
"mem": 32.0,
"instances": 2,
"container": {
"docker": {
"type": "DOCKER",
"image": "docker.io/tgermain/easy_app_python:v3",
"network": "BRIDGE",
@tgermain
tgermain / app 1 portMapped
Created July 1, 2015 14:31
Example application with 1 port mapped
{
"id": "easy-app-python",
"cpus": 0.2,
"mem": 32.0,
"instances": 2,
"container": {
"docker": {
"type": "DOCKER",
"image": "docker.io/tgermain/easy_app_python:v3",
"network": "BRIDGE",
@tgermain
tgermain / app 2 portMapping
Created July 1, 2015 14:24
Example application with 2 ports mapped
{
"id": "easy-app-python",
"cpus": 0.2,
"mem": 32.0,
"instances": 2,
"container": {
"docker": {
"type": "DOCKER",
"image": "docker.io/tgermain/easy_app_python:v3",
"network": "BRIDGE",