Skip to content

Instantly share code, notes, and snippets.

View kedwards's full-sized avatar
🏠
Working from home

Kevin Edwards kedwards

🏠
Working from home
View GitHub Profile
@kedwards
kedwards / cloudfront.sh
Created July 31, 2024 13:14 — forked from ahmed-abdelazim/cloudfront.sh
Bash script to update coudfront origin using aws cli
#!/bin/bash
CLOUDFRONT_DISTRIBUTION_ID=E2C3RNL2F4MRMQ
NEW_ORIGIN="origin2-zaid.s3.us-west-2.amazonaws.com"
ETAG=`aws cloudfront get-distribution --id $CLOUDFRONT_DISTRIBUTION_ID | jq -r .ETag`
aws cloudfront get-distribution --id $CLOUDFRONT_DISTRIBUTION_ID | \
jq --arg NEW_ORIGIN "$NEW_ORIGIN" '.Distribution.DistributionConfig.Origins.Items[0].Id=$NEW_ORIGIN' | \
jq --arg NEW_ORIGIN "$NEW_ORIGIN" '.Distribution.DistributionConfig.Origins.Items[0].DomainName=$NEW_ORIGIN' | \
jq --arg NEW_ORIGIN "$NEW_ORIGIN" '.Distribution.DistributionConfig.DefaultCacheBehavior.TargetOriginId=$NEW_ORIGIN' | \
jq .Distribution.DistributionConfig > config.json
aws cloudfront update-distribution --id $CLOUDFRONT_DISTRIBUTION_ID --distribution-config "file://config.json" --if-match $ETAG > /dev/null
@kedwards
kedwards / ansible-summary.md
Created March 12, 2022 15:23 — forked from andreicristianpetcu/ansible-summary.md
This is an ANSIBLE Cheat Sheet from Jon Warbrick

An Ansible summary

Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)

Configuration file

intro_configuration.html

First one found from of

@kedwards
kedwards / docker-compose.yml
Created November 12, 2021 18:48 — forked from crapthings/docker-compose.yml
docker-compose rs init
version: '3'
services:
mongo1:
hostname: mongo1
container_name: localmongo1
image: mongo
restart: always
expose:
- 27017
ports:
@kedwards
kedwards / bump-version.sh
Last active July 28, 2023 18:38 — forked from jv-k/bump-version.sh
This script automates bumping the git software project's version using automation.
#!/bin/bash
#
# β–ˆβ–„β–„ β–ˆβ–‘β–ˆ β–ˆβ–€β–„β–€β–ˆ β–ˆβ–€β–ˆ β–„β–„ β–ˆβ–‘β–ˆ β–ˆβ–€β–€ β–ˆβ–€β–ˆ β–ˆβ–€ β–ˆ β–ˆβ–€β–ˆ β–ˆβ–„β–‘β–ˆ
# β–ˆβ–„β–ˆ β–ˆβ–„β–ˆ β–ˆβ–‘β–€β–‘β–ˆ β–ˆβ–€β–€ β–‘β–‘ β–€β–„β–€ β–ˆβ–ˆβ–„ β–ˆβ–€β–„ β–„β–ˆ β–ˆ β–ˆβ–„β–ˆ β–ˆβ–‘β–€β–ˆ
#
# Description:
# - This script automates bumping the git software project's version using automation.
# - It does several things that are typically required for releasing a Git repository, like git tagging,
# automatic updating of CHANGELOG.md, and incrementing the version number in various JSON files.
@kedwards
kedwards / repos.yaml
Created July 19, 2020 18:45 — forked from angeloskaltsikis/Dockerfile
A less verbose terragrunt (both plan & apply supported)
terragrunt:
plan:
steps:
- env:
name: TERRAGRUNT_TFPATH
command: 'echo "terraform${ATLANTIS_TERRAFORM_VERSION}"'
- run: node ~/terragrunt_light.js plan $PLANFILE
apply:
steps:
- env:
@kedwards
kedwards / terragrunt_light.js
Created July 19, 2020 17:13 — forked from dmattia/terragrunt_light.js
A less verbose terragrunt
/**
* Wrapper around terragrunt to display output succinctly on Atlantis.
*
* Terragrunt is notoriously verbose, which can cause Atlantis to output
* hundreds of comments on single PRs, which can be annoying.
*
* This script will output just the final plan for resources to update on
* successful terragrunt runs, but will output all terragrunt output on
* errors.
*/
@kedwards
kedwards / README.md
Last active October 18, 2021 13:16 — forked from LongLiveCHIEF/README.md
Run node, npm, npx, yarn as container

Developing with Node, without installing node!

Note: currently only works on *nix systems (until a powershell script can be created)

With the technique below, you can run node, npm, npx, or yarn commands as if the programs were installed natively on your system, and you won't even know the difference! This includes any ports that your app or dev process will start up and use for development, as well as compatibility with persistent npm config --global cli usage.

See more in the Usage section below.

// create a bookmark and use this code as the URL, you can now toggle the css on/off
// thanks+credit: https://dev.to/gajus/my-favorite-css-hack-32g3
javascript: (function() {
var domStyle = document.createElement("style");
domStyle.append(
'* { color:#0f0!important;outline:solid #f00 1px!important; background-color: rgba(255,0,0,.2) !important; }\
* * { background-color: rgba(0,255,0,.2) !important; }\
* * * { background-color: rgba(0,0,255,.2) !important; }\
* * * * { background-color: rgba(255,0,255,.2) !important; }\
* * * * * { background-color: rgba(0,255,255,.2) !important; }\
@kedwards
kedwards / Makefile
Created June 22, 2019 15:07 — forked from isaacs/Makefile
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.