Skip to content

Instantly share code, notes, and snippets.

View toolboc's full-sized avatar

Paul DeCarlo toolboc

View GitHub Profile
@toolboc
toolboc / DeepStreamAnalytics.sql
Last active May 8, 2020 20:48
DeepStreamAnalytics.sql
WITH
FlattenedDetections AS
(
SELECT
DeepStreamInput.sensorId,
(SUBSTRING (arrayElement.ArrayValue, REGEXMATCH(arrayElement.ArrayValue, '\|[a-z]') + 1, LEN(arrayElement.ArrayValue))) as object,
DeepStreamInput.[@timestamp], COUNT(DeepStreamInput.[@timestamp]) as matches
FROM
[DeepStreamInput] AS DeepStreamInput TIMESTAMP BY DeepStreamInput.[@timestamp]
CROSS APPLY GetArrayElements(objects) AS arrayElement
@toolboc
toolboc / k8sbomb
Created August 23, 2019 21:22
A deployment sure to cause k8s to croak
apiVersion: apps/v1
kind: Deployment
metadata:
name: stress-deployment
labels:
app: stress
spec:
replicas: 1
selector:
matchLabels:
@toolboc
toolboc / GWAB Denver
Last active April 26, 2019 22:12
Endpoint for connecting to shared input and output hubs
Endpoint=sb://cloudcity-sharedeventhub.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=uk67xjrxsDtPIszaec0N5WROwX3q78U9YSZDDcRZIrE=;EntityPath=flysim-shared-input-hub
@toolboc
toolboc / AzureDevOpsAgent-NvidiaJetsonTX2.sh
Last active January 28, 2020 22:02
Script to allow for install of Azure Pipelines Agent on Nvidia JetsonTX2 with support for IoT Edge build tasks
#!/bin/bash
#
# Setup Azure Dev-Ops ARM32
#
### update your system with the latest drivers
sudo apt-get update
### Install the ARM32 gcc toolchain
sudo apt-get -y install gcc-arm-linux-gnueabihf
@toolboc
toolboc / WebRadio.ino
Created December 29, 2018 20:42
Talking Web Radio with ESP8266 and Sony Spresense
/*
WebRadio Example
Very simple HTML app to control web streaming
Copyright (C) 2017 Earle F. Philhower, III
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
@toolboc
toolboc / audio_through_main.cxx
Created December 29, 2018 18:18
Audio Through for Sony Spresense I2S->Speaker
/****************************************************************************
* audio_through/audio_through_main.cxx
*
* Copyright 2018 Sony Semiconductor Solutions Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
@toolboc
toolboc / edgeProvision.sh
Last active May 2, 2019 01:39
Provision edge runtime for GPU / CPU platorms on Ubuntu 16.04 (Requires az-cli & jq)
#!/bin/bash
usage(){
echo "***Azure IoT Edge GPU Provisioning Script***"
echo "Usage: ./edgeprovision.sh <iothub.name> <environment> <platform>”
}
provision(){
install_docker
if [ $platform == "gpu" ]
@toolboc
toolboc / sas.c
Last active August 31, 2018 23:21
SAS token generation in C; compile with `gcc -o sas sas.c -lm -lssl -lcrypto`
#include <openssl/bio.h>
#include <openssl/evp.h>
#include <openssl/hmac.h>
#include <openssl/crypto.h>
#include <time.h>
#include <string.h>
#include <openssl/buffer.h>
#include <stdint.h>
#include <ctype.h>
#include <math.h>
#!/bin/bash
usage(){
echo "***Azure IoT Edge GPU Provisioning Script***"
echo "Usage: ./edgeprovision.sh <iothub.name> <environment> <platform> <acr.host> <acr.username> <acr.password>"
}
provision(){
install_docker
if [ $platform == "gpu" ]
@toolboc
toolboc / WordPress_Migration_Azure.md
Last active October 13, 2017 01:28
WordPress_Migration_Azure.md

Migrating WordPress to Ubuntu VM in Azure

Deploy Ubuntu VM

Take note of the ip address given to the VM

DNS

If you wish to use a custom domain, obtain your VM ip address from the Azure Portal and create an A record that points @ to the ip of the VM