Let's remove any old versions of Docker if they exist:
sudo yum remove docker \
docker-common \
docker-selinux \
docker-engine| from functools import lru_cache, wraps | |
| from datetime import datetime, timedelta | |
| def timed_lru_cache(seconds: int, maxsize: int = 128): | |
| def wrapper_cache(func): | |
| func = lru_cache(maxsize=maxsize)(func) | |
| func.lifetime = timedelta(seconds=seconds) | |
| func.expiration = datetime.utcnow() + func.lifetime | |
| @wraps(func) |
| #/etc/systemd/system/test.service | |
| [Unit] | |
| Description=Test Systemd Service | |
| [Service] | |
| ExecStartPre=/usr/bin/echo -e "\033[0;33m Pre start \033[0m" | |
| ExecStart=/usr/bin/sleep 10 | |
| ExecStartPost=/usr/bin/echo -e "\033[0;33m Post start \033[0m" |
| # All credit: http://stackoverflow.com/questions/4006324/how-to-atomically-delete-keys-matching-a-pattern-with-redis | |
| redis-cli [options] KEYS "prefix:*" | xargs redis-cli [options] DEL |
| #!/usr/bin/env python3 | |
| ''' | |
| @desc Simple MongoDB Client class. Offers the entire API | |
| of AsyncioMotorCollection. | |
| @author SDQ <sdq@afnor.org> | |
| @version 1.0.0 | |
| @date 2020-02-17 | |
| @note 1.0.0 (2020-02-17) : First functional version | |
| ''' | |
| from typing import Any, Optional |
| The MIT License (MIT) | |
| Copyright (c) 2013 Michael E. Cotterell | |
| Permission is hereby granted, free of charge, to any person obtaining a copy | |
| of this software and associated documentation files (the "Software"), to deal | |
| in the Software without restriction, including without limitation the rights | |
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| copies of the Software, and to permit persons to whom the Software is | |
| furnished to do so, subject to the following conditions: |
| title | Docker Compose Cheatsheet |
|---|---|
| subtitle | Quick reference for Docker Compose commands and config files |
| author | Jon LaBelle |
| date | April 7, 2019 |
| source | https://jonlabelle.com/snippets/view/markdown/docker-compose-cheatsheet |
| plugins = {} | |
| def get_input_plugins(): | |
| return plugins['input'].items() | |
| class Plugin(object): | |
| plugin_class = None | |
| @classmethod | |
| def register(cls, name): | |
| plugins[cls.plugin_class][name] = cls |
| import logging | |
| import asyncio | |
| import uvicorn | |
| from uvicorn.loops.uvloop import uvloop_setup | |
| from starlette.applications import Starlette | |
| from starlette.responses import JSONResponse | |
| import socketio | |
| # Set some basic logging | |
| logging.basicConfig( |