Skip to content

Instantly share code, notes, and snippets.

Christophe Labouisse ggtools

Block or report user

Report or block ggtools

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ggtools
ggtools / pg_values.py
Last active Jun 5, 2019
Implementation of PostgreSQL values construct
View pg_values.py
from sqlalchemy.ext.compiler import compiles
from sqlalchemy.sql.expression import FromClause
class values(FromClause):
named_with_column = True
def __init__(self, columns, *args, **kw):
self._column_args = columns
self.list = args
self.alias_name = self.name = kw.pop('alias_name', None)
@ggtools
ggtools / update_services.sh
Created Feb 13, 2017
Update services secrets
View update_services.sh
#!/usr/bin/env bash
for service in $(docker service ls -f "label=le_auto" -q)
do
echo "Checking service $service"
docker service inspect --format '{{json .Spec.TaskTemplate.ContainerSpec.Secrets}}' $service \
| sed -r 's/("File":\{)/\n/g' \
| sed -n -r '/Name/ s/"[^"]+":"([^"]+)"[^"]+/\1 /g;s/"Mode":([[:digit:]]+)[^[:alnum:]]*/\1 / p' \
| ( while read target uid gid mode secret_id secret
@ggtools
ggtools / create_secrets.sh
Created Feb 13, 2017
Docker Secrets & Letsencrypt automation
View create_secrets.sh
#!/usr/bin/env bash
LE_ARC_DIR="etc/archive"
SECRETS=$(docker secret ls | tail -n +2 | awk '{print $2}')
find $LE_ARC_DIR -name 'fullchain*.pem' -o -name 'privkey*.pem' | sed "s,$LE_ARC_DIR/,," | while read file
do
base_file=$(basename $file .pem | sed -r 's/[0-9]+$//')
version=$(basename $file .pem | sed -r 's/^.*?([0-9]+)$/\1/')
View Dockerfile
/run/secrets/site.crt FROM nginx
COPY site.conf /etc/nginx/conf.d/
@ggtools
ggtools / convoy.service
Created Feb 3, 2017
Systemd unit for convoy
View convoy.service
[Unit]
Description=Convoy Daemon
Before=docker.service
[Service]
ExecStart=/usr/local/bin/convoy daemon --drivers vfs --driver-opts vfs.path=/path/to/convoy/volume/storage
Type=simple
Restart=always
KillMode=process
View jenkins-mirror-hack.sh
sed -i 's,"url":"http://updates.jenkins-ci.org/download/plugins/,"url":"http://mirror.mirror.on.the.wall/plugins/,g' /var/jenkins_home/updates/default.json
@ggtools
ggtools / docker-pfw.conf
Last active Dec 14, 2016
Shell hack to protect Docker published services from being accessible through a public interfaces
View docker-pfw.conf
[Service]
EnvironmentFile=-/etc/sysconfig/docker-pfw
ExecStartPost=-/usr/local/bin/docker-pfw.sh start
ExecStopPost=-/usr/local/bin/docker-pfw.sh stop
@ggtools
ggtools / logstash.conf
Last active Oct 12, 2017
Logstash configuration for Docker + Spring Boot applications
View logstash.conf
input {
gelf {
type => docker
port => 12201
}
}
filter {
multiline {
pattern => "^%{TIMESTAMP_ISO8601}"
View keybase.md

Keybase proof

I hereby claim:

  • I am ggtools on github.
  • I am clabouisse (https://keybase.io/clabouisse) on keybase.
  • I have a public key whose fingerprint is AF03 78CE 6C5A F3C4 6C51 E7CE FB49 83B4 1AD2 5EC7

To claim this, I am signing this object:

@ggtools
ggtools / containerHelper.py
Created Nov 17, 2014
Script to retrieve some information/metrics for a Docker container.
View containerHelper.py
#!/usr/bin/env python
__author__ = 'Christophe Labouisse'
import argparse
import re
import os
from docker import Client
from docker.utils import kwargs_from_env
You can’t perform that action at this time.