Skip to content

Instantly share code, notes, and snippets.

View kskilling's full-sized avatar

Katherine Skilling kskilling

View GitHub Profile
@kskilling
kskilling / Pi_WeatherProject_InfluxDB.py
Created March 18, 2021 20:19
Raspberry Pi Python Script to Send Data to InfluxDB
import serial, time
from time import gmtime, strftime
from datetime import datetime
import bme280
import smbus2
import sys
import rx
from rx import operators as ops
from influxdb_client import InfluxDBClient, Point, WritePrecision, WriteOptions
from influxdb_client.client.write_api import SYNCHRONOUS
@kskilling
kskilling / Raspberry Pi Environmental Sensors.txt
Last active February 16, 2023 16:52
Python code for a Raspberry Pi to collect data from multiple sensors and upload them to different dashboards
import serial, time
from time import gmtime, strftime
from datetime import datetime
import bme280
import smbus2
from Adafruit_IO import Client
ser = serial.Serial('/dev/ttyUSB0')
from wavefront_sdk import WavefrontProxyClient
@kskilling
kskilling / SRMGetNamesOfInventoryObjects.txt
Created May 27, 2019 17:34
Code to retrieve the names of the protection group and recovery plan created within SRM
protectionGroupName = protectionGroup.name;
recoveryPlanName = recoveryPlan.name;
@kskilling
kskilling / SRMLogoutRESTContentTemplate.txt
Created May 27, 2019 17:24
Template for the REST operation content for the SRM Logout operation
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><SrmLogoutLocale xmlns="urn:srm0"><_this type="SrmServiceInstance">SrmServiceInstance</_this></SrmLogoutLocale></soap:Body></soap:Envelope>
@kskilling
kskilling / SRMsetRecoverySettingsFullSOAPOperationCode.txt
Last active May 27, 2019 15:02
Full code to execute the SOAP operation SetRecoverySettings on SRM using values retrieved from earlier workflows
var host = Server.findForType("SOAP:Host", "5116c12a-84be-430a-a4d9-e191af5a68ac");
if (host == null) throw "Host '5116c12a-84be-430a-a4d9-e191af5a68ac' not found!";
var operation = host.getOperation("SetRecoverySettings");
if (operation == null) throw "Operation 'SetRecoverySettings' not found!";
function formatDate(inDate){
if (!inDate) {
return null;
}
@kskilling
kskilling / SRMgetRecoverySettingsAdditionalCode.txt
Last active May 27, 2019 14:57
Additional code to capture the current recovery settings of a SRM protected VM from the output of a SOAP operation
status = response.getOutParameter("returnval.status");
recoveryPriority = response.getOutParameter("returnval.recoveryPriority");
skipGuestShutdown = response.getOutParameter("returnval.skipGuestShutdown");
powerOffTimeoutSeconds = response.getOutParameter("returnval.powerOffTimeoutSeconds");
finalPowerState = response.getOutParameter("returnval.finalPowerState");
localFaultToleranceState = response.getOutParameter("returnval.localFaultToleranceState");
remoteFaultToleranceState = response.getOutParameter("returnval.remoteFaultToleranceState");
powerOnTimeoutSeconds = response.getOutParameter("returnval.powerOnTimeoutSeconds");
powerOnDelaySeconds = response.getOutParameter("returnval.powerOnDelaySeconds");
@kskilling
kskilling / SRMgetRecoveryPlanAdditionalCode.txt
Created May 27, 2019 14:38
Additional code to capture the SRM Recovery Plan name and type values from the SOAP operation output
recoveryPlan= response.getOutParameter("returnval");
recoveryPlanType = response.getOutParameterAttribute("returnval","type")
@kskilling
kskilling / SRMgetRecoveryPlanRootFolderAdditionalCode.txt
Created May 27, 2019 14:35
Additional code to capture the SRM Recovery Plan Root Folder name and type values from the SOAP operation output
recoveryPlanRootFolder= response.getOutParameter("returnval");
recoveryPlanRootFolderType=response.getOutParameterAttribute("returnval","type")
@kskilling
kskilling / SRMgetProtectedVMFromProtectionGroupAdditionalCode.txt
Last active May 27, 2019 14:26
Additional code to capture the protected VM deployed from vRA into the SRM Protection Group
protectedVM = response.getOutParameter("returnval[0].vm");
protectedVMType = response.getOutParameterAttribute("returnval[0].vm","type");
@kskilling
kskilling / SRMgetProtectionGroupByNameExtraCode.txt
Created May 27, 2019 13:56
Additional code to capture the SRM Protection Group from the SOAP operation output
protectionGroup= response.getOutParameter("returnval");
protectionGroupType = response.getOutParameterAttribute("returnval","type")