Skip to content

Instantly share code, notes, and snippets.

Peter Baumgartner ipmb

  • Lincoln Loop
Block or report user

Report or block ipmb

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
ipmb /
Last active Oct 7, 2019
Django logging example
import logging.config
import os
from django.utils.log import DEFAULT_LOGGING
# Disable Django's logging setup
LOGLEVEL = os.environ.get('LOGLEVEL', 'info').upper()
ipmb /
Created May 31, 2018
DNS over HTTP (DOH) on MacOS


brew install dnscrypt-proxy


Edit /usr/local/etc/dnscrypt-proxy.toml as needed. I added/modified the following lines:

import logging.config
from django.utils.log import DEFAULT_LOGGING
# =======
# =======
LOGLEVEL = os.getenv("LOGLEVEL", "info").upper()
ipmb / uwsgi_cors_router.ini
Last active Aug 6, 2019
Add CORS headers for domains matching a regex in uWSGI
View uwsgi_cors_router.ini
# Add CORS header for Origin's which match a regexp
route-if = regexp:${HTTP_ORIGIN};^.*\.example\.com$ addheader:Access-Control-Allow-Origin: ${HTTP_ORIGIN}
ipmb /
Created Apr 19, 2018
Running systemd in docker with Ubuntu 18.04

Trying to use kitchen-docker. It works great when passing privileged: true to the driver, but some hosted CI systems won't let you do that for security reasons. After trying a million different incantations, I got very close with:

image: ubuntu:18.04
run_options: --tmpfs=/run --tmpfs=/run/lock -v /sys/fs/cgroup/systemd:/sys/fs/cgroup/systemd --stop-signal=SIGRTMIN+3
run_command: /sbin/init

note: kitchen does some extra things like including -e container=docker

ipmb / ratelimit.nginxconf
Last active May 23, 2019
Nginx reverse proxy with rate limiting
View ratelimit.nginxconf
upstream myapp {
limit_req_zone $binary_remote_addr zone=login:10m rate=1r/s;
server {
listen 443 ssl spdy;
server_name _;
ipmb /
Last active May 2, 2019
Django Logging Variations

Default Django Logging Tree

#!/usr/bin/env python
import os

import django
import logging_tree
View pyproject.toml
name = "tmp"
version = "0.1.0"
description = ""
authors = ["User <>"]
python = "^3.7"
requests = "^2.21"
sentry-sdk = "^0.7.11"
ipmb / Dockerfile
Created Apr 4, 2019
Build vmods on Ubuntu from Varnish repo
View Dockerfile
FROM ubuntu:18.04
ARG REPO=varnish60lts
RUN set -ex && \
apt-get update -qq && \
apt-get -yq install curl apt-transport-https build-essential libtool autotools-dev automake gnupg && \
echo "deb${REPO}/ubuntu/ bionic main" > /etc/apt/sources.list.d/varnish.list && \
curl -L${REPO}/gpgkey | apt-key add && \
apt-get update -qq && \
apt-get -yq install varnish varnish-dev

Keybase proof

I hereby claim:

  • I am ipmb on github.
  • I am ipmb ( on keybase.
  • I have a public key ASAhIL1zFberH0RNfVsAfqZOpwcXxLWpcQgGfaSywHmS0wo

To claim this, I am signing this object:

You can’t perform that action at this time.