Skip to content

Instantly share code, notes, and snippets.

View kidbrax's full-sized avatar

Braxton Beyer kidbrax

View GitHub Profile
@ampedandwired
ampedandwired / template.rb
Last active August 26, 2020 03:43
Splitting cfndsl templates into multiple files
require_relative "subtemplate.rb"
CloudFormation {
instance_type = external_parameters.fetch(:instance_type, "t2.micro")
my_instance(instance_type)
}
@Faheetah
Faheetah / Jenkinsfile.groovy
Last active March 6, 2024 18:14
Jenkinsfile idiosynchrasies with escaping and quotes
node {
echo 'Results included as an inline comment exactly how they are returned as of Jenkins 2.121, with $BUILD_NUMBER = 1'
echo 'No quotes, pipeline command in single quotes'
sh 'echo $BUILD_NUMBER' // 1
echo 'Double quotes are silently dropped'
sh 'echo "$BUILD_NUMBER"' // 1
echo 'Even escaped with a single backslash they are dropped'
sh 'echo \"$BUILD_NUMBER\"' // 1
echo 'Using two backslashes, the quotes are preserved'
sh 'echo \\"$BUILD_NUMBER\\"' // "1"
@totomz
totomz / send-to-cloudwatch.sh
Last active September 11, 2023 08:37
A simple script to push a JSON log to AWS CLoudWatch
#!/bin/bash
AWS_REGION="--region XXX_REGION"
AWS_PROFILE="--profile XXX_PROFILE"
LOG_GROUP="XXX_YOUR_LOG_GROUP"
LOG_STREAM="$(whoami)-$( date "+%Y%m%d-%H-%M-%S")"
aws logs create-log-stream --log-group-name $LOG_GROUP --log-stream-name $LOG_STREAM $AWS_REGION $AWS_PROFILE