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
View django_logging.py
import logging.config
from django.utils.log import DEFAULT_LOGGING
# =======
# LOGGING
# =======
LOGGING_CONFIG = None
LOGLEVEL = os.getenv("LOGLEVEL", "info").upper()
@ipmb
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
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin#Examples
route-if = regexp:${HTTP_ORIGIN};^.*\.example\.com$ addheader:Access-Control-Allow-Origin: ${HTTP_ORIGIN}
View pyproject.toml
[tool.poetry]
name = "tmp"
version = "0.1.0"
description = ""
authors = ["User <user@example.com>"]
[tool.poetry.dependencies]
python = "^3.7"
requests = "^2.21"
sentry-sdk = "^0.7.11"
@ipmb
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 https://packagecloud.io/varnishcache/${REPO}/ubuntu/ bionic main" > /etc/apt/sources.list.d/varnish.list && \
curl -L https://packagecloud.io/varnishcache/${REPO}/gpgkey | apt-key add && \
apt-get update -qq && \
apt-get -yq install varnish varnish-dev
View keybase.md

Keybase proof

I hereby claim:

  • I am ipmb on github.
  • I am ipmb (https://keybase.io/ipmb) on keybase.
  • I have a public key ASAhIL1zFberH0RNfVsAfqZOpwcXxLWpcQgGfaSywHmS0wo

To claim this, I am signing this object:

View create_shiv.sh
shiv -o test.pyz -e pytest:main .
./test.pyz --pyargs my_tests
echo $?
@ipmb
ipmb / status.txt
Created Jun 7, 2018
Systemd Status exmple
View status.txt
$ sudo systemctl status saltdash@0.9.4.service
● saltdash@0.9.4.service - Saltdash v0.9.4
Loaded: loaded (/etc/systemd/system/saltdash@.service; indirect; vendor preset: enabled)
Active: active (running) since Tue 2018-05-15 23:25:08 UTC; 3 weeks 1 days ago
Main PID: 25580 (python3.6)
Tasks: 5 (limit: 4704)
CGroup: /system.slice/system-saltdash.slice/saltdash@0.9.4.service
└─25580 /usr/bin/python3.6 /srv/saltdash/saltdash-0.9.4.pyz serve
Jun 07 18:15:42 web-prod python3.6[25580]: localhost - - [07/Jun/2018:18:15:42 +0000] "GET /-/alive/ HTTP/1.1" 200 - "-" "Go-http-client/1.1
@ipmb
ipmb / Dockerfile
Created Jun 6, 2018
vmods on trusty
View Dockerfile
FROM ubuntu:14.04
ENV VARNISHVERSION=52 MODSVERSION=0.15.0
RUN apt-get update && \
apt-get -yq install curl gnupg apt-transport-https build-essential pkg-config \
libpcre3-dev automake autogen libtool libreadline6-dev \
libeditline0 libeditline-dev python-docutils
RUN curl -sL https://packagecloud.io/varnishcache/varnish$VARNISHVERSION/gpgkey | apt-key add - && \
printf "deb https://packagecloud.io/varnishcache/varnish$VARNISHVERSION/ubuntu/ trusty main\ndeb-src https://packagecloud.io/varnishcache/varnish$VARNISHVERSION/ubuntu/ trusty main" > /etc/apt/sources.list.d/varnish.list && \
apt-get update && \
@ipmb
ipmb / doh-on-mac.md
Created May 31, 2018
DNS over HTTP (DOH) on MacOS
View doh-on-mac.md

Install

brew install dnscrypt-proxy

Configure

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

@ipmb
ipmb / run.py
Created May 13, 2018
uwsgi as lib
View run.py
# UWSGI_AS_LIB=`pwd`/saltdash/libuwsgi.so pip install uwgi
# via https://gist.github.com/sixninetynine/c5c2c0047ea510d9db6c4f99f09c341e
import sys
import os
import ctypes
try:
from importlib import resources
except ImportError:
import importlib_resources as resources
You can’t perform that action at this time.