Skip to content

Instantly share code, notes, and snippets.

View agmangas's full-sized avatar

Andrés García Mangas agmangas

View GitHub Profile
@agmangas
agmangas / runc-proxy
Created November 17, 2020 14:12
Runc proxy for a dirty workaround to enable privileged access on Swarm nodes
#!/usr/bin/python3
import json
import os
import pathlib
import sys
from typing import List
"""
Workaround to enable capabilities on Swarm services.
Injects all capabilities before passing requests to the real runtime (runc).
@agmangas
agmangas / patch-runc.sh
Last active November 17, 2020 15:31
Script to patch the default "runc" container runtime with a proxy that enables privileged access on Swarm nodes
#!/usr/bin/env bash
set -e
set -u
set -x
RUNC_PROXY_GIST="https://gist.githubusercontent.com/agmangas/905a3045074a8645462eadad95334b6a/raw/"
echo "## Adding runc proxy to enable privileged support"
@agmangas
agmangas / quickstart.py
Created January 4, 2021 16:15
WoTemu quickstart app
import json
import logging
import pprint
import random
import time
from wotpy.wot.enums import DataType
_logger = logging.getLogger("wotemu.quickstart.thing")
@agmangas
agmangas / import.ttl
Created May 19, 2021 11:49
Test validator import
@prefix dct: <http://purl.org/dc/terms/> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
<http://publications.europa.eu/resource/authority/country/ESP>
a dct:Location ;
skos:inScheme <http://publications.europa.eu/resource/authority/country> .