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
# 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 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 | |
Command line utility for scheduled DR backups to an isolated offsite AWS account. | |
Logs to .\dailySnapShotLogs | |
.EXAMPLE | |
.\dailySnapShots.ps1 | |
Starts the long running script | |
.NOTES |
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
#accepted format: instanceId,Instance Name,Group,startTime,stopTime | |
#example (uncomment actual entries): | |
#i-c6e7bc27,LMS WebHead Golden Image,EVEN,1000,0100 | |
i-bc13aa91,OpenVPN,ALL,1100,2259 | |
i-80957b6c,SchoolPointe Jenkins 3.0,ALL,1100,2259 | |
#i-659e3f03,SchoolPointe Script Host I,ALL,0630,0930 | |
i-878ac3a6,SPWEB0A,EVEN,0900,1429 | |
i-24431c0a,SPWEB0D,ODD,0900,0100 | |
i-23eb9e09,SPWEB11,ODD,0900,0100 | |
i-7624515c,SPWEB12,EVEN,0900,1434 |
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
######################################################################################################################### | |
# 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 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 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" | |
<# |
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
""" | |
wally.py - version 1.0 tested using Python 2.7.5 [MSC v.1500 32 bit (Intel)] on Windows 7 x64 | |
- Accepts command line arguments | |
- Opens simple IP:socket on a 4U2SEE LED wallboard | |
- Sends messages to control the behaviour of the 4U2SEE LED wallboard, defined by command line arguments and stdin | |
- Closes the socket | |
###################### | |
TODO | |
- add some minimal try/except error handling | |
- add minor debug verbose output |
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
$locations = @( | |
@('3747','Plaza One'), | |
@('3743','Plaza Three') | |
) | |
$restaurants = @( | |
'Claddagh''s Irish Pub', | |
'Mikey''s Late Night Slice', | |
'Greek Street', | |
'Phy Pho Phom', |
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
# Note: the script below is to determine the SMB version of a standalone Windows system | |
# If you are checking a file server or other system with known active SMB connections, simply run Get-SmbConnection in admin shell, | |
# and observe the various negotiated SMB dialects of the individual sessions | |
$loopBack = dir \\localhost\c$ | |
$smbVer = Get-SmbConnection -ServerName localhost | Select Dialect | Sort-Object -Unique | |
$smbVer | |
<# | |
This will return something like: |
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
<# | |
.SYNOPSIS | |
deletes files on login by file age and a list of file name regular expressions | |
.DESCRIPTION | |
srsly man, that's all it does. | |
.EXAMPLE | |
.\dloadCleanup.ps1 | |
#> |
OlderNewer