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
{ | |
"Id": "ActionTemplates-81", | |
"Name": "Slack - Notify Deployment", | |
"Description": "Notifies Slack of deployment status. Uses the Octopus Deploy system variable to determine whether a deployment was successful.", | |
"ActionType": "Octopus.Script", | |
"Version": 1, | |
"Properties": { | |
"Octopus.Action.Script.ScriptBody": "function Slack-Rich-Notification ($notification)\n{\n $payload = @{\n channel = $OctopusParameters['Channel']\n username = $OctopusParameters['Username'];\n icon_url = $OctopusParameters['IconUrl'];\n attachments = @(\n @{\n fallback = $notification[\"fallback\"];\n color = $notification[\"color\"];\n fields = @(\n @{\n title = $notification[\"title\"];\n title_link = $notification[\"title_link\"];\n value = $notification[\"value\"];\n });\n };\n );\n }\n\n Invoke-RestMethod -Method POST -Body ($payload | ConvertTo-Js |
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
#!/bin/bash | |
# Create a CNAME record in the appropriate DNS zone on AWS Route 53 | |
# Requires kubectl and cli53 from https://github.com/barnybug/cli53 | |
# Ensure AWS profile is configured with access to update DNS records (e.g. AmazonRoute53FullAccess policy) | |
# | |
# Aaron Roydhouse <aaron@roydhouse.com> | |
# https://github.com/whereisaaron | |
# https://gist.github.com/whereisaaron/bc6c71bec99c493b1fc1ca3f9e8db4c1 | |
# |
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
# | |
# Must run in an Administrator shell to be able to export the keys | |
# Adjust the -Path, Where-Object clauses, and -FilePath to suit | |
# | |
$Password = Read-Host -Prompt "Enter password" -AsSecureString | |
Get-ChildItem -Path cert:\LocalMachine\My | Where-Object -Property FriendlyName -Like "Foo*" | Where-Object -Property Subject -Like "CN=www*" | ForEach-Object { Export-PfxCertificate -FilePath "$($_.FriendlyName) 2017-2018.pfx".Replace(" ","-").ToLower() -Cert $_ -ChainOption BuildChain -Password $Password } |
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
#!/bin/bash | |
#------------------ | |
# Extract the key, certficiate, and chain in PEM format from a PFX format file | |
# | |
# Must supply the input pfx file | |
PFX_PATH="$1" | |
if [ "${PFX_PATH}" == "" ]; then | |
echo "Must supply pfx file path" | |
exit 1 |
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
#!/bin/bash | |
# Read password if not in environment variable | |
if [[ ! ${PFXPASSWORD+x} ]]; then | |
echo -n "Password: " | |
read -s PFXPASSWORD | |
echo | |
export PFXPASSWORD | |
fi |
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
#!/bin/bash | |
# Uses trick to get openssl to display all certificates from a PEM file, rather than only the first | |
# http://comments.gmane.org/gmane.comp.encryption.openssl.user/43587 | |
${1?Must supply filename for PEM file} | |
openssl crl2pkcs7 -nocrl -certfile $1 | openssl pkcs7 -print_certs |
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
#!/bin/bash | |
# | |
# Check the age and size of the latest file in a particular directory matching a pattern | |
# e.g. | |
# check_download_age /the/path/to/the/directory/ 'FILE_NAME_OR_GLOB*' -c 86400 -w 43200 -C 0 -W 10000 | |
# | |
cfa=/usr/lib/nagios/plugins/check_file_age |
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
--- | |
# VPC template for housing EKS clusters | |
# Based on VPC template by Levon Becker v20161125-1430 | |
# https://github.com/stelligent/cloudformation_templates | |
# | |
AWSTemplateFormatVersion: '2010-09-09' | |
Description: Create a VPC with per-AZ NAT and public/private subnets | |
Parameters: | |
# Cluster Names | |
ClusterName1: |
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
#!/bin/bash | |
json_to_values() { | |
json=$1 | |
echo "env:" | |
jq -r 'to_entries | .[] | " - name: \(.key)\n value: '"'"'\(.value)'"'"'"' <<<$json | |
} | |
read -r -d '' foo << END | |
{ |
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
Get-ChildItem –Path "C:\temp" -Recurse | | |
Where-Object -Property Extension -EQ '.zip' | | |
Foreach-Object { | |
Write-Output $_.FullName | |
$command = "7z x ""$($_.FullName)"" -o""$($_.Directory)"" -aos -bso0 -bsp2" | |
Write-Output $command |
OlderNewer