Skip to content

Instantly share code, notes, and snippets.

@pb-dod
pb-dod / Dockerfile
Last active February 20, 2024 23:58
running tflocal in docker
FROM python:3.11-bullseye
ENV PYTHONUNBUFFERED 1
ENV LOCALSTACK_HOSTNAME=localstack \
S3_HOSTNAME=localstack \
AWS_DEFAULT_REGION=us-east-1
RUN apt-get update && apt-get install -y jq gnupg software-properties-common unzip \
&& curl -OL https://releases.hashicorp.com/terraform/1.5.4/terraform_1.5.4_linux_amd64.zip \
&& unzip terraform_1.5.4_linux_amd64.zip \
@pb-dod
pb-dod / main.py
Created June 14, 2022 20:41
example of checking whether you're inside of a uWSGI pre-fork worker
try:
import uwsgi
is_using_uwsgi = True
except ImportError:
is_using_uwsgi = False
def is_uwsgi_prefork():
"""Checks if code is currently being executed within a uWSGI pre-fork worker."""