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
$cert='rds-combined-ca-bundle.p7b' | |
$certDownload='https://s3.amazonaws.com/rds-downloads/rds-combined-ca-bundle.p7b' | |
Invoke-WebRequest -Uri $certDownload -OutFile $cert | |
Import-Certificate -FilePath $cert -CertStoreLocation Cert:\LocalMachine\Root |
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
var out = require('./out.json').Parameters | |
var eachLimit = require('async').eachLimit | |
var AWS = require("aws-sdk"); | |
var ssm = new AWS.SSM(); | |
// Copy parameters locally | |
// aws ssm get-parameters-by-path --path /your/path/ --recursive --with-decryption > out.json | |
eachLimit(out, 2, function({Name, Value, Type}, callback) { | |
console.log('parm:', Name) |
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
var out = require('./out.json').Parameters | |
var eachLimit = require('async').eachLimit | |
var AWS = require("aws-sdk"); | |
var ssm = new AWS.SSM(); | |
eachLimit(out, 2, function({Name, Value, Type}, callback) { | |
console.log('parm:', Name) |
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
FROM node:10 | |
WORKDIR /usr/src/app | |
COPY package*.json ./ | |
RUN npm install | |
COPY . . |
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
#------------------------------------------------------------------------------ | |
# Dockerfile used to help run ansible commands to keep things in spec | |
# build: cd | |
# prune: docker rmi jengland/local | |
# run from windows command line: docker run --rm -it -w /usr/src/project -v "~/.aws":/root/.aws -v "%cd%":/usr/src/project jengland/local bash | |
# run from powershell: docker run --rm -it -w /usr/src/project -v ~/.aws:/root/.aws -v ${PWD}:/usr/src/project jengland/local bash | |
# windows terminal override: "cmd.exe" /k ""docker" run --rm -it -w /usr/src/project -v "~/share":/home/hurdler/share -v "~/.aws":/home/hurdler/.aws -v "%cd%":/usr/src/project jengland/local bash" | |
# windows cleanup: FOR /f "tokens=*" %i IN ('docker ps -a -q') DO docker kill %i then docker system prune | |
#------------------------------------------------------------------------------ | |
# Refactored to a base image, because I got sick of build the prereqs |
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"rds-db:connect" | |
], | |
"Resource": [ | |
"arn:aws:rds-db:region:account-id:dbuser:dbi-resource-id/database-user-name" |
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
# Create EC2 Instance Role | |
$ec2RoleTrustPolicyDocument = '{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Principal":{"Service":"ec2.amazonaws.com"},"Action":"sts:AssumeRole"}]}' | |
$iamRole = New-IAMRole -AssumeRolePolicyDocument $ec2RoleTrustPolicyDocument -RoleName MyEC2Role | |
Register-IAMRolePolicy -RoleName $iamRole.RoleName -PolicyArn arn:aws:iam::aws:policy/CloudWatchLogsFullAccess | |
$instanceProfile = New-IAMInstanceProfile -InstanceProfileName MyEC2InstanceRole | |
Add-IAMRoleToInstanceProfile -RoleName $iamRole.RoleName -InstanceProfileName $instanceProfile.InstanceProfileName | |
# Attach to existing instance | |
Register-EC2IamInstanceProfile -InstanceId i-0a5c81b759851230c -IamInstanceProfile_Name $instanceProfile.InstanceProfileName |
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
Function Cleanup { | |
<# | |
.CREATED BY: | |
Matthew A. Kerfoot | |
.CREATED ON: | |
10\17\2013 | |
.Synopsis | |
Aautomate cleaning up a C: drive with low disk space | |
.DESCRIPTION | |
Cleans the C: drive's Window Temperary files, Windows SoftwareDistribution folder, ` |
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
$userName = Read-Host "Enter Name of user or <CR> for complete list" | |
$DomainControllers = Get-ADDomainController -Filter * | |
$PDCEmulator = ($DomainControllers | Where-Object {$_.OperationMasterRoles -contains "PDCEmulator"}) | |
foreach($pdc in $PDCEmulator){ | |
$pdcName = $pdc.HostName #[System.DirectoryServices.ActiveDirectory.Domain]::GetDomain((New-Object System.DirectoryServices.ActiveDirectory.DirectoryContext('Domain', "time-inc-corp"))).PdcRoleOwner.name | |
write-host "Checking PDCEmulator: $pdcName" | |
Get-WinEvent -ComputerName $pdcName -FilterHashtable @{LogName='Security';Id=4740;StartTime=(Get-Date).AddDays(-1)} | Where-Object {$_.Properties[0].Value -like "*$userName*"} | Select-Object -Property TimeCreated, @{Label='UserName';Expression={$_.Properties[0].Value}},@{Label='ClientName';Expression={$_.Properties[1].Value}} | Ft -autosize | |
} |
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
$domain = 'someADDomain.local' | |
$userName = 'somename' | |
$newPassword = "P@ssword1" | ConvertTo-SecureString -AsPlainText -Force | |
Set-ADAccountPassword -Server $domain -Identity $userName -NewPassword $newPassword |
NewerOlder