This file contains hidden or 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
######################################################################################################################### | |
# Script name: instanceScheduler.ps1 | |
# Version: v0.1 | |
# Date: 08Nov2014 | |
# Author: Eric Miller | |
# Purpose: start/stop ec2 instances on a schedule, with retries and SNS notifications on WARNING/FATAL events | |
# Usage: ./instanceScheduler.ps1 | |
# Dependencies: aws.ps1, logging.ps1 | |
# Notes: | |
# In order to give the retries sufficient time to process, |
This file contains hidden or 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
# config | |
clear | |
$accessKey = "your AK" # these keys are for an IAM user with read/write access only to the -dr S3 account | |
$secretKey = "your SK" | |
$bucketName = "your bucketname" | |
$dataVol = "D:" # omit \ | |
$dataDirs = $null | |
function initializeAwsSession |
This file contains hidden or 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
<# | |
.SYNOPSIS | |
Dumps the last 24h of message history from all [NM]Slack channels | |
to [NM]Google Group in a daily digest email. | |
Run it nightly as a scheduled task. | |
.NOTES | |
AUTHOR: ezee | |
VERSION: 1.0.1 | |
DATE: 19FEB2015 |
This file contains hidden or 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
# IMPORTANT: start this script in a fresh session to prevent previous exceptions from carrying over in $Error | |
function folderClass | |
{ | |
param | |
( | |
[Parameter(Mandatory=$true)] | |
[String]$path, | |
[Parameter(Mandatory=$true)] | |
[double]$origSize |
This file contains hidden or 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
// Gray text are just helpful comments, you don’t need to type them. :) | |
/******* -----=====!! EASY STUFF TO MESS WITH !!=====------ ******/ | |
// What analog pin should we use to read the value from the potentiometer? | |
int analogPin = 2; // Yep, you heard right: The coolest of the Analog pins... | |
// What pin is the LED connected to? | |
int ledPin = 13; // Contains a built in resistor! | |
This file contains hidden or 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
# Initialize AWS session w/ specific IAM role for this script. | |
# Redact access/secret keys in commits, or do not include this file. | |
log INFO "initializing AWS session" | |
$accessKey = "AK for user with IAM role below" | |
$secretKey = "SK for user with IAM role below" | |
Initialize-AWSDefaults -AccessKey $accessKey -SecretKey $secretKey -Region us-east-1 | |
log INFO "initializing AWS complete" | |
<# |
NewerOlder