This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aws-profile() { | |
read -r -d '' SCRIPT <<'EOF' | |
import argparse | |
from configparser import RawConfigParser | |
import os | |
import shutil | |
import subprocess | |
import sys | |
from textwrap import dedent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Install an SSH key on an instance automatically and then configure an | |
# SSM proxy to the instance which will be used by SSH. | |
# | |
# Copy this script to ~/.ssh/ssm-proxy and make it executable: | |
# | |
# chmod +x ~/.ssh/ssm-proxy | |
# | |
# This script should be set as the ProxyCommand. For example: | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################################################## | |
# Settings made available in site.ini.in. | |
# | |
# After making changes re-run render-config | |
# | |
# Override settings by making a .env.local file. | |
############################################################################## | |
DEBUG=yes | |
WEB_CONCURRENCY=10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyramid.security import NO_PERMISSION_REQUIRED | |
def includeme(config): | |
config.add_directive( | |
'add_cors_preflight_handler', add_cors_preflight_handler) | |
config.add_route_predicate('cors_preflight', CorsPreflightPredicate) | |
config.add_subscriber(add_cors_to_response, 'pyramid.events.NewResponse') | |
class CorsPreflightPredicate(object): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import collections | |
class DictProxy(collections.Mapping): | |
""" | |
A proxy for a dictionary that allows attribute access to underlying keys. | |
You may pass a custom ``wrapper`` to override the logic for wrapping | |
various custom types. | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cookie_state = { | |
'session_id': session_id, | |
'is_deleted': False, | |
} | |
def update_cookie(request, response): | |
exc = getattr(request, 'exception', None) | |
# exit early if there's an exception and the user specified |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[tool.poetry] | |
name = "pyramid_scaffold" | |
version = "0.1.0" | |
description = "Pyramid Scaffold" | |
authors = [] | |
classifiers = [ | |
"Programming Language :: Python", | |
"Framework :: Pyramid", | |
"Topic :: Internet :: WWW/HTTP", | |
"Topic :: Internet :: WWW/HTTP :: WSGI :: Application", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ... | |
COPY istio-launcher.py /app/istio-launcher.py | |
ENTRYPOINT ["tini", "--", "/app/istio-launcher.py"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
import boto3 | |
from collections import defaultdict | |
import csv | |
from datetime import datetime, timedelta | |
import logging | |
from pprint import pprint | |
import queue | |
import signal | |
import sys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyramid.authentication import BasicAuthAuthenticationPolicy | |
from pyramid.authorization import ACLAuthorizationPolicy | |
from pyramid.config import Configurator | |
from pyramid.httpexceptions import HTTPForbidden | |
from pyramid.httpexceptions import HTTPUnauthorized | |
from pyramid.security import ALL_PERMISSIONS | |
from pyramid.security import Allow | |
from pyramid.security import Authenticated | |
from pyramid.security import forget | |
from pyramid.view import forbidden_view_config |
NewerOlder