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
def get_client_ip( | |
request: list | |
) -> str: | |
""" | |
Returns the client's IP address from an HTTP request object. | |
Parameters: | |
request (list): A list representing the HTTP request 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 os | |
from logging.config import ( | |
dictConfig | |
) | |
from flask import ( | |
Flask | |
) | |
def create_app( |
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
CORS_ORIGINS= | |
CORS_METHODS= | |
CORS_ALLOW_HEADERS= | |
CORS_EXPOSE_HEADERS= | |
CORS_SUPPORTS_CREDENTIALS= | |
CORS_MAX_AGE= |
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
GATEWAY_NAME={{ The name of the application gateway }} | |
REWRITE_RULE={{ The name of the rewrite rule set }} | |
RESOURCE_GROUP={{ The name of the resource group }} | |
az network application-gateway rewrite-rule set show --gateway-name $GATEWAY_NAME \ | |
--name $REWRITE_RULE \ | |
--resource-group $RESOURCE_GROUP |
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
# The below code snippet will output the expected hash of the script in the console | |
# error message to use as a hash in a Content Security Policy (CSP). The CSP Level | |
# 2 specification allows, sha256, sha384, and sha512 hash algorithms. | |
# | |
# Example: | |
# | |
# echo -n 'doSomething();' | openssl sha256 -binary | openssl base64 | |
# RFWPLDbv2BY+rCkDzsE+0fr8ylGr2R2faWMhq4lfEQc= | |
# | |
# Add the following to the script-src directive for your Content Security Policy. |
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 alpine:latest AS themes | |
ADD /themes /themes | |
WORKDIR /themes | |
RUN apk add openjdk11 && \ | |
jar cf custom.jar META-INF/ theme/ | |
# Example dockerfile from https://www.keycloak.org/server/containers. | |
FROM quay.io/keycloak/keycloak:latest as builder | |
ENV KC_HEALTH_ENABLED=true |
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
server { | |
listen 80 default_server; | |
listen [::]:80 default_server; | |
server_name {{ nginx_server_name }}; | |
rewrite ^ https://$server_name$request_uri? permanent; | |
#return 301 https://$host$request_uri; | |
} | |
server { | |
listen 443 ssl http2; | |
listen [::]:443 ssl http2; |
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
RESOURCE_GROUP={{ name }} | |
APPLICATION_GATEWAY={{ name }} | |
# Start application gateway | |
az network application-gateway start -g $RESOURCE_GROUP -n $APPLICATION_GATEWAY | |
# Stop application gateway | |
az network application-gateway stop -g $RESOURCE_GROUP -n $APPLICATION_GATEWAY |
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
# This is a template script, you can add additional simple fields to the schema, | |
# and replace the method to iterate over the original datasource. | |
import simplekml | |
# Initializes class to represent a KML file. | |
kml = simplekml.Kml() | |
# Creates a custom KML schema to be used to add custom data. |
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 functools import ( | |
partial | |
) | |
import pyproj | |
from shapely.geometry import ( | |
Point, | |
Polygon | |
) | |
from shapely.ops import ( | |
transform |