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
openssl pkcs12 -in key.pfx -out key.pem -nodes |
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
$c = New-SelfSignedCertificate -Subject "CN=RidoEdgeBox" -CertStoreLocation "Cert:\CurrentUser\My" | |
Export-Certificate -Cert $c -FilePath RidoEdgeBox.cer -Type CERT | |
certutil -encode .\RidoEdgeBox.cer .\RidoEdgeBox.der | |
bash -c "openssl x509 -in RidoEdgeBox.der -out RidoEdgeBox.cer.pem" | |
$mypwd = ConvertTo-SecureString -String "1234" -Force -AsPlainText | |
Export-PfxCertificate -Cert $c -FilePath RidoEdgeBox.pfx -Password $mypwd | |
bash -c "openssl pkcs12 -in RidoEdgeBox.pfx -out RidoEdgeBox.key.pem -nodes" |
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
process.argv.push("-mk:MASTERKEY") | |
process.argv.push("-di:DEVICEID") | |
var dpsKeygen = require("dps-keygen") |
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
var logger = LoggerFactory.Create(builder => { builder.AddConsole(); }).CreateLogger("Cat1"); |
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
node_modules/ | |
.vscode/ |
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
Function AddTo-SystemPath { | |
Param( | |
[array]$PathToAdd | |
) | |
$VerifiedPathsToAdd = $Null | |
Foreach($Path in $PathToAdd) { | |
if($env:Path -like "*$Path*") { | |
Write-Host "Currnet item in path is: $Path" |
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
{ | |
"@context": "dtmi:dtdl:context;2", | |
"@id": "dtmi:com:example:mypnpdevice;1", | |
"displayName": "MyPnPDevice", | |
"@type": "Interface", | |
"contents": [ | |
{ | |
"@type": "Property", | |
"name": "myProperty", | |
"schema": "string" |
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
"Add DTDL Property" : { | |
"prefix": ["dtp"], | |
"body" : ["{ \n\t\"@type\" : \"Property\", \n\t\"name\" : \"$1\", \n\t\"schema\" : \"$0\" \n},"], | |
"description": "Adds a DTDL property" | |
}, | |
"Add DTDL Telemetry" : { | |
"prefix": ["dtt"], | |
"body" : ["{ \n \t\"@type\" : \"Telemetry\", \n\t\"name\" : \"$1\", \n\t\"schema\" : \"$0\" \n},"], | |
"description": "Adds a DTDL Telemetry" | |
}, |
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
{ | |
"@context": "dtmi:dtdl:context;2", | |
"@id": "dtmi:com:example:mydevice;1", | |
"@type": "Interface", | |
"displayName": "mydevice", | |
"contents": [ | |
{ | |
"@type": "Telemetry", | |
"name": "workingSet", | |
"schema": "double" |
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
const https = require('https') | |
const crypto = require('crypto') | |
const hubUrl = 'xxx.azure-devices.net' | |
const path = '/devices?api-version=2020-09-30' | |
const key = 'xxxxxxxxxxxx' | |
const generateSasToken = (resourceUri, signingKey, policyName, expiresInMins) => { | |
resourceUri = encodeURIComponent(resourceUri); |