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 / ami-clean.sh
Last active January 9, 2017 19:05 — forked from jdowning/ami-clean.sh
Script to clean up Ubuntu EC2 instance before packaging as an AMI
#!/bin/bash
# This script cleans up your EC2 instance before baking a new AMI.
# Run the following command in a root shell:
#
# Updated for Debianism's
#
# bash <(curl -s https://gist.githubusercontent.com/kedwards/ad2feb78188e21bc513c0b1586c3bf87/raw/c2c0e3f914f7b00ab677a4549c19d0d8a9ebed78/ami-clean.sh)
function print_green {
#!/bin/bash
##################################################################################
# 1 - Create the base container
SUITE=squeeze
RELEASE=$SUITE
sudo lxc-create -n ${RELEASE}-base -t debian
rootfs="/var/lib/lxc/${RELEASE}-base/rootfs"
@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.
// 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 / 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.

Keybase proof

I hereby claim:

  • I am kedwards on github.
  • I am kaedwards (https://keybase.io/kaedwards) on keybase.
  • I have a public key ASBpEgyK5Jsjr_bsNSWMO5QAxen57zItnUd4Hti2QRP6rAo

To claim this, I am signing this object:

@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 / 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 / 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 / getopt.sh
Last active March 27, 2023 01:38
A [ba]sh template
#!/bin/bash
set -e
script_name=${0##*/}
script_dir="$( cd "$( dirname "$0" )" && pwd )"
script_path=${script_dir}/${script_name}
script_date=$(date +%Y%m%d)
# NOTE: This requires GNU getopt.