Skip to content

Instantly share code, notes, and snippets.

View chrisz100's full-sized avatar
🐺
breaking things

Christian Jantz chrisz100

🐺
breaking things
View GitHub Profile
#!/bin/bash
while sleep 5; do
if [ -z \$(curl -Isf http://169.254.169.254/latest/meta-data/spot/termination-time)];then
/bin/false
else
logger "[spot-instance-termination-notice-handler.sh]: spot instance terminationnotice detected"
STATUS=DRAINING
ECS_CLUSTER=\$(curl -s http://localhost:51678/v1/metadata | jq .Cluster | tr -d \")
CONTAINER_INSTANCE=\$(curl -s http://localhost:51678/v1/metadata | jq .ContainerInstanceArn| tr -d \")
logger "[spot-instance-termination-notice-handler.sh]: putting instance in state\$STATUS"

Keybase proof

I hereby claim:

  • I am chrjantz on github.
  • I am cjantz (https://keybase.io/cjantz) on keybase.
  • I have a public key whose fingerprint is F8C6 2E26 E20D 76F9 C418 65F9 8C95 66C3 6343 CAFE

To claim this, I am signing this object:

@chrisz100
chrisz100 / fizzbuzz.go
Last active August 29, 2015 14:13
Simple FizzBuzz in golang
package main
import "fmt"
func main() {
for i := 1; i <= 100; i++ {
switch {
case i%3 == 0:
// check if matching i%5 as well (FizzBuzz)