Skip to content

Instantly share code, notes, and snippets.

View shadministrator's full-sized avatar

shadministrator

View GitHub Profile
@shadministrator
shadministrator / LoraSendAndReceive-Helium.ino
Last active April 24, 2022 18:07
Modified Arduino MKRWAN 1300 LoraSendAndReceive.ino example for use with Helium Network
/*
Lora Send And Receive
This sketch demonstrates how to send and receive data with the MKR WAN 1300/1310 LoRa module.
This example code is in the public domain.
*/
#include <MKRWAN.h>
#include <CayenneLPP.h>
DynamicJsonDocument jsonBuffer(4096);
@shadministrator
shadministrator / PowerCLI-Initial-VM-Config-Ubuntu.ps1
Last active January 24, 2022 00:04
This script connects to your VMWare vSphere/ESXI environment, copies a bash configuration script to the user directory on the guest, executes that script, and then imports the ssh public key from your management system (for remote SSH).
# PREREQUISITE: Install the VMWare PowerCLI module on your system
$presentDir = Get-Location | Select-Object -ExpandProperty Path
$vmwEnviHostname = "ESXI01"
$vmName = Read-Host "Enter the name of the Virtual Machine to connect to"
$sshKeyPath = Read-Host "Enter path to the private key (including the key file name) to use for ssh connection to this VM"
# Put contents of public ssh key into variable
$sshPubKeyContents = Get-Content "$sshKeyPath.pub"
$vmwCred = Get-Credential -Message "Enter your vSphere or ESXI host credentials"
$guestOSCred = Get-Credential -Message "Enter the username and password of the inital guest OS user"
@shadministrator
shadministrator / lambda_function.py
Created March 22, 2021 00:17
Low Temperature Alert
import json
import boto3
import requests
import http.client
def lambda_handler(event, context):
# Instantiate SNS
sns = boto3.client('sns')
# Call OpenWeatherMap API and get low temperature for tomorrow
url = "https://api.openweathermap.org/data/2.5/onecall?lat=41.720380&lon=-70.003700&exclude=current,minutely,alerts&units=imperial&appid=[api_key_here_no_brackets]"
@shadministrator
shadministrator / lambda_function.py
Last active October 4, 2020 12:10
Additional Library Imports for isleFinder Skill
# -*- coding: utf-8 -*-
# This sample demonstrates handling intents from an Alexa skill using the Alexa Skills Kit SDK for Python.
# Please visit https://alexa.design/cookbook for additional examples on implementing slots, dialog management,
# session persistence, api calls, and more.
# This sample is built using the handler classes approach in skill builder.
import logging
import ask_sdk_core.utils as ask_utils
from ask_sdk_core.skill_builder import SkillBuilder