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
| # https://docs.microsoft.com/en-us/graph/powershell/installation | |
| # https://docs.microsoft.com/en-us/graph/powershell/get-started | |
| # https://developer.microsoft.com/en-us/graph/graph-explorer | |
| # https://tech.nicolonsky.ch/exploring-the-new-microsoft-graph-powershell-modules/ | |
| Connect-MgGraph -Scopes "User.Read.All", "GroupMember.Read.All", "Group.Read.All", "Directory.Read.All" | |
| $GROUP_NAME = 'Workspace' | |
| $group = Get-MgGroup -Filter "DisplayName eq '$GROUP_NAME'" |
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
| # https://tower.hardwario.com/en/latest/hardware/about-climate-module/ | |
| # | |
| # MariaDB database setup | |
| # | |
| # create database climate; | |
| # create user 'python'@'localhost' identified by 'Pyth0n'; | |
| # grant all privileges on climate.* to 'python'@'localhost'; | |
| # FLUSH PRIVILEGES; | |
| # | |
| # create table temperature( |
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
| # https://docs.microsoft.com/en-us/azure/storage/blobs/storage-blob-static-website-how-to?tabs=azure-portal | |
| # https://tower.hardwario.com/en/latest/hardware/about-climate-module/ | |
| import os | |
| import datetime | |
| from paho.mqtt import client as mqtt | |
| from azure.storage.blob import BlobClient | |
| from azure.storage.blob import ContentSettings |
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
| # https://pypi.org/project/azure-iot-device/ | |
| from azure.iot.device import IoTHubDeviceClient, Message | |
| from sense_hat import SenseHat | |
| sense = SenseHat() | |
| t = sense.get_temperature() | |
| h = sense.get_humidity() | |
| p = sense.get_pressure() |
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
| // https://docs.microsoft.com/en-us/azure/cognitive-services/Custom-Vision-Service/quickstarts/image-classification?tabs=visual-studio&pivots=programming-language-javascript | |
| const util = require('util'); | |
| const fs = require('fs'); | |
| const TrainingApi = require("@azure/cognitiveservices-customvision-training"); | |
| const PredictionApi = require("@azure/cognitiveservices-customvision-prediction"); | |
| const msRest = require("@azure/ms-rest-js"); | |
| const trainingKey = ""; | |
| const predictionKey = ""; |
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
| // https://docs.microsoft.com/en-us/azure/cognitive-services/Custom-Vision-Service/quickstarts/object-detection?tabs=visual-studio&pivots=programming-language-javascript | |
| const util = require('util'); | |
| const fs = require('fs'); | |
| const TrainingApi = require("@azure/cognitiveservices-customvision-training"); | |
| const PredictionApi = require("@azure/cognitiveservices-customvision-prediction"); | |
| const msRest = require("@azure/ms-rest-js"); | |
| const trainingKey = ""; | |
| const predictionKey = ""; |
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
| /* | |
| You neeed to create App.config file with this content | |
| <?xml version="1.0" encoding="utf-8"?> | |
| <configuration> | |
| <appSettings> | |
| <add key="storage" value="YOUR CONNECTION SRING TO AZURE STORAGE ACCOUNT" /> | |
| </appSettings> | |
| </configuration> |
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
| import requests | |
| from pprint import pprint | |
| subscription_key = '' | |
| endpoint = '' | |
| api_url = endpoint + 'vision/v3.1/analyze' | |
| image_url = '' | |
| headers = {'Ocp-Apim-Subscription-Key': subscription_key, | |
| 'Content-Type': 'application/json'} |
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
| from picamera import PiCamera | |
| from azure.storage.blob import BlobServiceClient, BlobClient, BlobSasPermissions, generate_blob_sas | |
| from datetime import datetime, timedelta | |
| # You need to create container first | |
| container_name = '' | |
| account_name = '' | |
| key = '' | |
| connection_string = 'DefaultEndpointsProtocol=https;AccountName=' + account_name + ';AccountKey=' + key + ';EndpointSuffix=core.windows.net' |
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
| export RESOURCE_GROUP="" | |
| export RESOURCE_NAME="" | |
| export LOCATION="" | |
| export DB_NAME="" | |
| export COLLECTION="" | |
| export PARTITION_KEY="" | |
| az group create --name $RESOURCE_GROUP --location $LOCATION | |
| az cosmosdb create --name $RESOURCE_NAME --kind GlobalDocumentDB --resource-group $RESOURCE_GROUP | |
| az cosmosdb sql database create --name $DB_NAME --account-name $RESOURCE_NAME --resource-group $RESOURCE_GROUP |