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
Latest versions of these scripts are available in git repository https://github.com/jcmvbkbc/esp32-linux-build |
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
<# | |
References: | |
- https://docs.microsoft.com/en-us/dotnet/api/system.net.websockets.clientwebsocket?view=netframework-4.5 | |
- https://github.com/poshbotio/PoshBot/blob/master/PoshBot/Implementations/Slack/SlackConnection.ps1 | |
- https://www.leeholmes.com/blog/2018/09/05/producer-consumer-parallelism-in-powershell/ | |
#> | |
$client_id = [System.GUID]::NewGuid() | |
$recv_queue = New-Object 'System.Collections.Concurrent.ConcurrentQueue[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
$base64data = "insert compressed and base64 data here" | |
$data = [System.Convert]::FromBase64String($base64data) | |
$ms = New-Object System.IO.MemoryStream | |
$ms.Write($data, 0, $data.Length) | |
$ms.Seek(0,0) | Out-Null | |
$sr = New-Object System.IO.StreamReader(New-Object System.IO.Compression.DeflateStream($ms, [System.IO.Compression.CompressionMode]::Decompress)) | |
while ($line = $sr.ReadLine()) { |