Skip to content

Instantly share code, notes, and snippets.

View olidroide's full-sized avatar
🐍

Oliver Mas olidroide

🐍
View GitHub Profile
@jsmolina
jsmolina / ec2_monitoring.py
Last active March 21, 2022 15:26
Simple ec2 monitoring for opentelemetry
import botocore.session
from botocore import monitoring
from opentelemetry.trace import get_tracer
from opentelemetry import trace
from opentelemetry.trace import SpanKind
from opentelemetry.semconv.trace import SpanAttributes
from opentelemetry.trace.status import Status, StatusCode
from opentelemetry.instrumentation.utils import (
http_status_to_status_code,
)
@jsmolina
jsmolina / app.py
Created November 12, 2021 12:04
simple w3c tracecontext plugin for traceapi
from plugin import TraceParentLogger
def create_app():
config = get_api_settings()
app = FastAPI...
....
app.add_middleware(RawContextMiddleware, plugins=(TraceParentLogger(),)
@jsmolina
jsmolina / Dockerfile
Last active September 27, 2022 16:06
simple http server for testing kong api gw
FROM python:3.9.5-slim-buster
ENV PYTHONUNBUFFERED 1
RUN adduser \
--disabled-password \
--gecos "" \
--home /app \
app
@timhughes
timhughes / fastapi_websocket_redis_pubsub.py
Last active February 29, 2024 02:46
FastAPI Websocket Bidirectional Redis PubSub
"""
Usage:
Make sure that redis is running on localhost (or adjust the url)
Install uvicorn or some other asgi server https://asgi.readthedocs.io/en/latest/implementations.html
pip install -u uvicorn
Install dependencies
@khongi
khongi / .env
Last active February 19, 2024 02:37
Sonarr + Radarr + Jackett + qBittorrent + ddclient cloudflare DNS update + Traefik reverse proxy with LetsEncrypt on Docker
QBITTORRENT_PATH=<PATH>
QBITTORRENT_WEBUI_PORT=<PORT>
DOWNLOAD_PATH=<PATH>
MEDIA_PATH=<PATH>
JACKETT_PATH=<PATH>
SONARR_PATH=<PATH>
RADARR_PATH=<PATH>
DOMAIN=<YOUR DOMAIN>
TZ=<Timezone e.g. Europe/Budapest>
USERDIR=<HOME DIR PATH>
import logging.config
from django.utils.log import DEFAULT_LOGGING
# =======
# LOGGING
# =======
LOGGING_CONFIG = None
LOGLEVEL = os.getenv("LOGLEVEL", "info").upper()
@g3rhard
g3rhard / docker-compose.yaml
Created July 10, 2019 06:01
docker-compose for ipsec vpn + pihole + telegram proxy
version: '2'
services:
pihole:
image: pihole/pihole:latest
container_name: pihole
volumes:
- /etc/localtime:/etc/localtime:ro
- /dev/rtc:/dev/rtc:ro
dns:
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active April 19, 2024 08:10
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@josh-burton
josh-burton / androidmanifest.xml
Created May 3, 2017 02:07
Prevent TouchWiz from surrounding your app icon in a frame
<!-- Prevents TouchWiz from surrounding your app icon in a frame -->
<!-- Add to your manifest inside the application tag -->
<meta-data
android:name="com.samsung.android.icon_container.has_icon_container"
android:value="true"/>
@pauloromeira
pauloromeira / tlp
Last active January 18, 2024 22:21
My TLP config file (/etc/default/tlp) for ThinkPad
# ------------------------------------------------------------------------------
# tlp - Parameters for power saving
# See full explanation: http://linrunner.de/en/tlp/docs/tlp-configuration.html
# dir: /etc/default/tlp
# Hint: some features are disabled by default, remove the leading # to enable
# them.
# Set to 0 to disable, 1 to enable TLP.