Skip to content

Instantly share code, notes, and snippets.

View BretStateham's full-sized avatar

Bret Stateham BretStateham

View GitHub Profile
@BretStateham
BretStateham / obdii_info.sh
Last active August 22, 2023 04:17
Dump OBDII Info via cansend and candump
# --------- SCRIPT BEGIN ----------
# By Bret Stateham
# This script assumes
# - You are running on a linux machine
# - You have the can-utils installed and working. See:
# - https://github.com/linux-can/can-utils
# - https://www.kernel.org/doc/Documentation/networking/can.txt
# - You have a can device attached and configured as can0 (you can change the targetbus variable to match if otherwise)
# - The can device is attached to your running target vehicle
@BretStateham
BretStateham / AzIoTSimDevPy37OnMac.md
Last active May 2, 2019 01:36
Running the Azure IoT Device Client for Python Simulated Device Quickstart with Python 3.7 on macOS
@BretStateham
BretStateham / AzIoTSimDevPy27OnMac.md
Last active May 2, 2019 01:38
Running the Azure IoT Device Client for Python Simulated Device Quickstart with Python 2.7 on macOS
@BretStateham
BretStateham / cloud-init-azmobyedge-bionic.yaml
Last active February 28, 2024 13:32
Create an Ubuntu 18.04 VM in Azure and provision it with the Azure CLI, Moby and the Azure IoT Edge Runtime using Cloud-Init
#cloud-config
apt_sources:
- source: "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ bionic main"
key: |
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.7 (GNU/Linux)
mQENBFYxWIwBCADAKoZhZlJxGNGWzqV+1OG1xiQeoowKhssGAKvd+buXCGISZJwT
LXZqIcIiLP7pqdcZWtE9bSc7yBY2MalDp9Liu0KekywQ6VVX1T72NPf5Ev6x6DLV
7aVWsCzUAF+eb7DC9fPuFLEdxmOEYoPjzrQ7cCnSV4JQxAqhU4T6OjbvRazGl3ag

Create a particle account at: https://login.particle.io/

Install the particle CLI

npm install -g particle-cli

Login to the CLI using the account you created above:

MX Chip Dev Kit Fix Steps

These steps are documented here: https://aka.ms/devkitfix

  1. Open the Board Manager in the Arduino IDE (had problems in code, not sure why), and removed the AZ3166 package.
  2. Delete the files:
  • %USERPROFILE%\AppData\Local\Arduino15\package_azureboard_index.json
  • %USERPROFILE%\AppData\Local\Arduino15\package_azureboard_index.json.sig.tmp
  1. Delete the %USERPROFILE%\AppData\Local\Arduino15\Packages\AZ3166 folder
  2. Delete the %USERPROFILE\azure-board-cli folder
@BretStateham
BretStateham / ConnectionStrings.txt
Last active March 25, 2018 14:41
FlySim Namespace Connection String
Use this event hub connection string in the Function:
Endpoint=sb://flysimbssns.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=gFSsWDqKq+i147KnZ0MSrSd4JUvYwDHYVZn6zJp7TNo=;EntityPath=flysim-shared-input-hub
@BretStateham
BretStateham / IoTEdgeV1NpmPackagesOnRaspbianJessie.md
Last active September 1, 2017 20:00
Running the IoT Edge (v1) npm Package Samples on Raspbian Jessie

Running the IoT Edge (v1) NPM Package Samples on Raspbian Jessie

Currently, on 09/01/2017, the latest Raspbian Stretch release does not work with the Node.js packages. Stretch appears to have a later version of OpenSSL with breaks the gateway. I imagine that dependency will be corrected in the future. For that reason I am specifically using Raspbian Jessie

  1. Flash the last version of Raspbian Jessie (http://downloads.raspberrypi.org/raspbian/images/raspbian-2017-07-05/2017-07-05-raspbian-jessie.zip) to your SD card using http://etcher.io

  2. Boot the Pi using the flashed SD card and login as pi/raspberry

  3. Connect the pi to your wifi network if it isn't hardwired

@BretStateham
BretStateham / GuestBook_Data.GuestBookDataContext.cs
Created October 2, 2013 13:25
"Introduction to Cloud Services" Hands-On Lab Completed Code
using Microsoft.WindowsAzure.Storage.Table;
using Microsoft.WindowsAzure.Storage.Table.DataServices;
using System.Linq;
namespace GuestBook_Data
{
public class GuestBookDataContext : TableServiceContext
{
public GuestBookDataContext(CloudTableClient client) : base(client)
@BretStateham
BretStateham / Contact.cs
Created October 1, 2013 16:46
"Windows Azure Web Sites and Virtual Machines using ASP.NET and SQL Server" Hands-On Lab Completed Code.
namespace ContactManager.Web.Models
{
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
public class Contact
{
public int Id { get; set; }
[Required]