Pictures and stuff.
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
# Reusable Functions | |
def azuread_auth(tenant_id: str, client_id: str, client_secret: str, resource_url: str): | |
""" | |
Authenticates Service Principal to the provided Resource URL, and returns the OAuth Access Token | |
""" | |
url = f"https://login.microsoftonline.com/{tenant_id}/oauth2/token" | |
payload= f'grant_type=client_credentials&client_id={client_id}&client_secret={client_secret}&resource={resource_url}' | |
headers = { | |
'Content-Type': 'application/x-www-form-urlencoded' | |
} |
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
param( | |
[string] | |
$gatewayKey | |
) | |
# init log setting | |
$logPath = "$PWD\tracelog.log" | |
"Start to excute SHIRInstall.ps1. `n" | Out-File $logPath | |
function Now-Value() |
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 deep_ls(path: str, max_depth=1): | |
""" | |
List all files and folders in specified path and | |
subfolders within maximum recursion depth. | |
""" | |
# List all files in path and apply sorting rules | |
li = mssparkutils.fs.ls(path) | |
# Return all files |
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
graph TD | |
subgraph SqlServerInstancePrimary1 | |
createEndpoint1 | |
grantConnectOnEndpoint1 | |
createAvailabilityGroup1 | |
end | |
subgraph SqlServerInstanceSecondary2 | |
createEndpoint2 |
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
{ | |
"id": "/subscriptions/d4aa0040-6651-443d-a078-728ce72a87ab/resourcegroups/rakirahman.me/providers/Microsoft.Cdn/profiles/rakirahman/endpoints/rakirahman", | |
"type": "Microsoft.Cdn/profiles/endpoints", | |
"name": "rakirahman", | |
"location": "Global", | |
"tags": {}, | |
"properties": { | |
"hostName": "rakirahman.azureedge.net", | |
"originHostHeader": "rakirahman.z9.web.core.windows.net", | |
"originPath": null, |
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 | |
# Continue on error | |
set +e | |
# Params | |
resource_group="arcdata-ci-direct" | |
days_to_keep=7 | |
# Get current date and calculate 7 days ago in seconds |
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
# Calculate Eviction Signals - Current State vs Threshold: | |
# | |
# https://kubernetes.io/docs/concepts/scheduling-eviction/node-pressure-eviction/#eviction-signals | |
# https://medium.com/kubernetes-tutorials/efficient-node-out-of-resource-management-in-kubernetes-67f158da6e59 | |
# | |
NODES=($(kubectl get nodes -o jsonpath='{.items[*].metadata.name}')) | |
NODE_COUNT=${#NODES[@]} | |
while true; | |
do |
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
########################################################## | |
# APPLY | |
########################################################## | |
# Apply workflow | |
# | |
kubectl apply -f sqlinstance-ha.yaml | |
# Get primary | |
# | |
kubectl get pods -l=role.ag.mssql.microsoft.com/chaos-bc-chaos-bc=primary -n ns1669830131581917320 |
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
# ========================================================================== | |
# SQLINSTANCE-HA | |
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | |
# WORKFLOW DURATION: 18m | |
# -------------------------------------------------------------------------- | |
# CHAOS DESCRIPTION | |
# -------------------------------------------------------------------------- | |
# In this chaos simulation we target a 2 or 3 replica MIAA: | |
# | |
# 1. Setup a User DB |
NewerOlder