This file contains hidden or 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
| #!/usr/bin/env bash | |
| set -u | |
| set -o pipefail | |
| # ======================================================= | |
| # Minimalist Colors | |
| # ======================================================= | |
| BOLD=$'\033[1m' | |
| RESET=$'\033[0m' | |
| FG_RED=$'\033[31m' |
This file contains hidden or 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
| #!/usr/bin/env bash | |
| RESOURCE_GROUP=$(az group list --query "[0].name" -o tsv) | |
| TA_ACCT_NAME="TweetAnalytics" | |
| TA_LOCATION=$(shuf -n1 -e $(az cognitiveservices account list-skus --query "[?tier=='Free' && kind=='TextAnalytics'].locations[]" | jq -r '.[]' | sed '/EUAP$/d')) | |
| echo "Creating Text Analytics account..." | |
| az cognitiveservices account create --name "$TA_ACCT_NAME" --resource-group "$RESOURCE_GROUP" --kind TextAnalytics --sku F0 --location "$TA_LOCATION" --yes | |
| TA_KEY=$(az cognitiveservices account keys list --name $TA_ACCT_NAME --resource-group "$RESOURCE_GROUP" --query key1 -o tsv) | |
| TA_ENDPOINT=$(az cognitiveservices account show --name $TA_ACCT_NAME --resource-group "$RESOURCE_GROUP" --query endpoint -o tsv) | |
| echo "Done!" | |
| echo |
This file contains hidden or 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
| #!/usr/bin/env bash | |
| RESOURCE_GROUP=$(az group list --query "[0].name" -o tsv) | |
| SQL_LOCATION=$(az group show --name "$RESOURCE_GROUP" --query location -o tsv) | |
| SQL_LOCATION=WESTUS | |
| SQL_SERVERNAME="mslearn-exercise-sqlserver-$(openssl rand -hex 5)" | |
| SQL_PWD="Ab#1$(openssl rand -hex 10)" | |
| SQL_USERNAME=sqladmin | |
| SQL_DBNAME=PositiveTweetDatabase | |
| echo | |
| echo "Creating SQL Server..." |
This file contains hidden or 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 an adaptable example script for using selenium across multiple webbrowsers simultaneously. This makes use of | |
| two queues - one to store idle webworkers and another to store data to pass to any idle webworkers in a selenium function | |
| """ | |
| from multiprocessing import Queue, cpu_count | |
| from threading import Thread | |
| from selenium import webdriver | |
| from time import sleep | |
| from numpy.random import randint |