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
const client = require('aws-iot-device-sdk'); | |
// The options object to provision the MQTT client with. | |
// Update values between chevrons with the appropriate values. | |
const opts = { | |
host: "<aws-iot-endpoint>", | |
keyPath: "<path-to-private-key>", | |
certPath: "<path-to-device-certificate>", | |
caPath: "<path-to-root-ca>", | |
// We are specifying that we want to connect on the |
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
const {toProxyOpts, proxyConnect } = require("./proxy-connect") | |
// using it to connect to AWS IoT through a HTTP CONNECT proxy | |
const aws = require("aws-iot-device-sdk"); | |
const proxyUrl = process.env.http_proxy || "http://localhost:3128/"; | |
const opts = { | |
keyPath: "assets/device.private.key", | |
certPath: "assets/device.cert.pem", |
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
#!/usr/bin/env python | |
# Lambda Script for spot instances failover | |
# NOTE 1: Re-failover from on-demand to spot will be done if all desired ECS tasks are currently running | |
# NOTE 2: The maximum number of spot instances is taken from its DesiredCapacity | |
# WARNING: You cannot increase DesiredCapacity of on-demand from the console without changing this script, | |
# however, you can increase DesiredCapacity of spot instances from the console and if it fails, | |
# this script will start on-demand instead of spot instances | |
# | |
import boto3 | |
import json |
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
$Username = "su" | |
$Password = "password" | |
$group = "Administrators" | |
$adsi = [ADSI]"WinNT://$env:COMPUTERNAME" | |
$existing = $adsi.Children | where {$_.SchemaClassName -eq 'user' -and $_.Name -eq $Username } | |
if ($existing -eq $null) { |