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 find_duplicates(data, seen=None, duplicates=None): | |
""" | |
Recursively finds and returns duplicate values in a nested JSON-like structure. | |
This function traverses through the given data (which can be a dictionary, a list, | |
or a single value) and identifies values that appear more than once. | |
Parameters: | |
data (dict or list): The JSON-like structure (dict or list) to be checked for duplicates. | |
seen (set, optional): A set to keep track of values already encountered. |
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
jrunscript -e "java.util.Arrays.asList(javax.net.ssl.SSLServerSocketFactory.getDefault().getSupportedCipherSuites()).stream().forEach(println)" |
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
# $ snykchecktype "SQL Injection" | |
snykchecktype() { | |
local type="$1" | |
local output=$(snyk code test .) | |
echo "$output" | grep -A2 "$type" | |
} |
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
npm prune --production | |
zip -r app.zip . --exclude @.funcignore --exclude .funcignore | |
az functionapp deployment source config-zip -g ${MY_RESOURCE_GROUP} -n ${MY_APP_NAME} --src app.zip |
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
# Change the {{ host }} value in []matchConditions > {} 0 > [] matchValues to a array of host header | |
# values allowed and {{ remoteAddr }} value and []matchConditions > {} 2 > [] matchValues to an array | |
# of remote IP addresses allowed. | |
# For more information on exposed path recommendations in Keycloak, see | |
# https://www.keycloak.org/server/reverseproxy#_exposed_path_recommendations | |
{ | |
"action": "Block", | |
"matchConditions": [ |
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
{ | |
"action": "Block", | |
"matchConditions": [ | |
{ | |
"matchValues": [ | |
"\\/api\\/([^?&\\n]+)\\?code=([A-Za-z0-9+/=]+)" | |
], | |
"matchVariables": [ | |
{ | |
"variableName": "RequestUri" |
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
# Sets the network port the container listens on at runtime for NGINX reverse proxy. | |
NGINX_PORT_EXPOSE= | |
# Sets the network port the container listens on at runtime for Azure Functions. | |
AZURE_FUNCTIONS_PORT_EXPOSE= |
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 pyproj | |
from shapely.geometry import ( | |
Polygon | |
) | |
# Define the center point of the bounding box in latitude and longitude. | |
center_latitude = 40.7128 | |
center_longitude = -74.0060 | |
# Define the distance in meters to extend in each direction |
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 command used the Base64 encoding utility to encode the JSON document | |
# and return the encoded output required for the IDP_SERVICE_ACCOUNT value. | |
# | |
# The JSON document requires the following key/value pairs available from | |
# the app registration | |
# | |
# client_id: The unique identifier of the Application (client) ID. | |
# client_secret: The client secret value generated in certificates & secrets. | |
# directory_id: The unique identifier of the Directory (tenant) ID. |
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
# Dockerfile for building a PostgreSQL container image. | |
FROM postgres:14.7-bullseye | |
# Copies the init.sql file from the local './postgres'directory to the | |
# '/docker-entrypoint-initdb.d' directory in the container. This directory | |
# is where PostgreSQL will look for initialization scripts to run when the | |
# container is first started. | |
ADD ./postgres/init.sql /docker-entrypoint-initdb.d/init.sql | |
# Retrieves new list of packages and installs the pg_cron extension |
NewerOlder