Skip to content

Instantly share code, notes, and snippets.

@codyhazelwood
codyhazelwood / ecs-service.tf
Created May 19, 2022 21:56 — forked from damscott/ecs-service.tf
Using CI/CD for deployment of ECS task definitions and images causes drift between the tfstate and AWS. Using a bash script in a Terraform External Data Source to pull the current task definition revision and container image tag from AWS keeps the state in sync with changes from CI. This does not currently support multiple containers in a single…
resource "aws_ecs_service" "service" {
name = "${var.app}"
cluster = "${var.cluster}"
# Use task revision in AWS if it is greater than task revision in tfstate
# Prevents rolling back revision when it has been incremented by CI
task_definition = "${aws_ecs_task_definition.app.family}:${data.external.task_definition.result["task_definition_revision"] > aws_ecs_task_definition.app.revision ? data.external.task_definition.result["task_definition_revision"] : aws_ecs_task_definition.app.revision }"
desired_count = "${var.task_count}"
depends_on = [
"aws_ecs_task_definition.app"
@codyhazelwood
codyhazelwood / yubikey4-ssh-macos.md
Created July 8, 2021 02:58 — forked from ixdy/yubikey4-ssh-macos.md
Setting up ssh public key authentication on macOS using a YubiKey 4

Setting up ssh public key authentication on macOS using a YubiKey 4

I largely followed Florin's blog post, but have a few notes to add regarding issues I encountered:

Basic setup notes

  1. I used a YubiKey 4, while the blog describes using a YubiKey NEO. I'm sure a YubiKey 5 would also work. I'm also running macOS 10.13.6.
  2. I installed GPGTools as recommended. However, as I'll note later, it seems that gpg-agent only automatically starts when gpg is used; for ssh, you'll need to ensure it's running.
  3. Before generating your keys, decide what key size you want to use. If you run the list command inside gpg --edit-card, look for the Key attributes line to see what is currently selected. On my YubiKey 4, it defaulted to 2048 bits for all keys:
Key attributes ...: rsa2048 rsa2048 rsa2048
@codyhazelwood
codyhazelwood / nesting.css
Created February 25, 2021 18:25 — forked from csswizardry/nesting.css
DOM Depth Visualiser
/**
* Tier 1 – Dotted
*/
* { outline: 2px dotted purple; }
* * { outline: 2px dotted blue; }
* * * { outline: 2px dotted green; }
* * * * { outline: 2px dotted yellow; }
* * * * * { outline: 2px dotted orange; }
* * * * * * { outline: 2px dotted red; }
@codyhazelwood
codyhazelwood / keybase.md
Last active December 25, 2018 20:42
Keybase proof

Keybase proof

I hereby claim:

  • I am codyhazelwood on github.
  • I am codyhazelwood (https://keybase.io/codyhazelwood) on keybase.
  • I have a public key ASCdqph-d1RSNtT8EcIDH42nt8nObtA81kdieOaGk76C2Ao

To claim this, I am signing this object: