Skip to content

Instantly share code, notes, and snippets.

View y0an's full-sized avatar

Yoan Rousseau y0an

View GitHub Profile
@y0an
y0an / linuxkit101.sh
Last active October 26, 2017 11:19
Quickstart Linuxkit
#!/bin/bash
set -e
git clone https://github.com/linuxkit/linuxkit.git && cd linuxkit
make
./bin/moby build examples/minimal.yml
@y0an
y0an / create_swarm_cluster.sh
Created September 19, 2017 20:59 — forked from alexei-led/create_swarm_cluster.sh
Deploy Docker Compose (v3) to Swarm (mode) Cluster
#!/bin/bash
# vars
[ -z "$NUM_WORKERS" ] && NUM_WORKERS=3
# init swarm (need for service command); if not created
docker node ls 2> /dev/null | grep "Leader"
if [ $? -ne 0 ]; then
docker swarm init > /dev/null 2>&1
fi
@y0an
y0an / 01-docker-tls.sh
Created July 13, 2017 12:25 — forked from zigarn/01-docker-tls.sh
Generate Docker certificates for training on TLS
mkdir docker-ca
chmod 0700 docker-ca/
cd docker-ca/
# CA key
openssl genrsa -aes256 -out ca-key.pem 2048
# CA certificate
openssl req -new -x509 -days 365 -key ca-key.pem -sha256 -out ca.pem
# Server key
@y0an
y0an / snippet.java
Created July 6, 2016 08:57
Getting Target object behind a proxy (useful for mocking)
/**
* Permet d'acceder a l'object wrapper par le proxy si l'object en est un.
* TODO make a recursive loop because target of proxy can be a proxy!
* @param object
* @return
* @throws Exception
*/
@SuppressWarnings("unchecked")
protected <T> T getTargetObject(final Object object) throws Exception {
if (AopUtils.isJdkDynamicProxy(object)) {
queryParameters:
sort:
description: |
Permet de trier les éléments suivant le(s) champ(s) <br/><<sortField>> <br/>field pour ascendant et -field pour descendant
type: string
example: "field1, -field2"
#%RAML 0.8
title: My API
schemas:
- comic: !include http://gist.githubusercontent.com/y0an/f31fa6449771d69b8d28/raw/3ae3112d9a4f3969d2d84c7c0c642f4ee96e54c2/comic-schema.json
resourceTypes:
- base: !include http://gist.githubusercontent.com/y0an/3a089190b27596bed143/raw/7adea5ea4ac1ae70febb38e1cce69aa98bb90c40/base.yaml
traits:
- orderable: !include https://gist.githubusercontent.com/y0an/fd1811a030626fb95dda/raw/307849e55197e69f00d84574bda052a6737219ae/orderable.yaml
delete?:
responses:
503:
description: |
Server Unavailable. Check Your Rate Limits.
post?:
responses:
503:
description: |
Server Unavailable. Check Your Rate Limits.
@y0an
y0an / comic-schema.json
Created January 12, 2016 08:52
Schema test
{
"required" : true ,
"$schema" : "http://json-schema.org/draft-03/schema" ,
"type" : "object" ,
"properties" : {
"month" : {
"type" : "string" ,
"required" : false
} ,
"num" : {
@y0an
y0an / raml sublime
Created March 27, 2015 20:53
raml subl
I'm happy to announce that my SublimeLinter plugin for Sublime Text 3 is now available via Package Control. The plugin is named "Sublime​Linter-contrib-raml-cop" and uses RAML Cop to do the linting. It also has a fair amount of prerequisites so listen up...
Install "RAML Cop"13 via npm
Install the "RAML Syntax Highlighter"8 plugin via Package Control
Install the "Sublime​Linter"2 plugin via Package Control
Install the "Sublime​Linter-contrib-raml-cop"7 plugin via Package Control
@y0an
y0an / draw_bg.lua
Created March 26, 2015 22:23
draw_bg.lua
--[[
Background by londonali1010 (2009)
This script draws a background to the Conky window. It covers the whole of the Conky window, but you can specify rounded corners, if you wish.
To call this script in Conky, use (assuming you have saved this script to ~/scripts/):
lua_load ~/scripts/draw_bg.lua
lua_draw_hook_pre draw_bg
Changelog: