Skip to content

Instantly share code, notes, and snippets.

View kaochiuan's full-sized avatar

kaochiuan kaochiuan

View GitHub Profile
@kaochiuan
kaochiuan / ssm_parameter_store.py
Last active January 29, 2021 06:39 — forked from nqbao/ssm_parameter_store.py
Python class to provide a dictionary-like interface to access AWS SSM Parameter Store easily
# Copyright (c) 2018 Bao Nguyen <b@nqbao.com>
#
# 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:
#
# The above copyright notice and this permission notice shall be included in all
@kaochiuan
kaochiuan / __init__.py
Created June 26, 2019 08:07 — forked from brianz/__init__.py
SQLAchemy helpers and mixins
import contextlib
from contextlib import contextmanager
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy.pool import NullPool
from sqlalchemy_utils import database_exists, create_database
@kaochiuan
kaochiuan / README-python-service-on-systemd-activated-socket.md
Created August 22, 2018 05:57 — forked from kylemanna/README-python-service-on-systemd-activated-socket.md
An example network service with systemd-activated socket in Python. #systemd #python #socket #socket-activation

README

The example below creates a TCP server listening on a stream (i.e. SOCK_STREAM) socket. A similar approach can be followed to create a UDP server on a datagram (i.e. SOCK_DGRAM) socket. See man systemd.socket for details.

An example server

Create an simple echo server at ~/tmp/foo/serve.py.