Skip to content

Instantly share code, notes, and snippets.

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

Gavin Zhou gavinzhou

🏠
Working from home
View GitHub Profile
@gavinzhou
gavinzhou / kube-status.log
Created December 18, 2016 01:12 — forked from theobolo/kube-status.log
IngressController
Test
@gavinzhou
gavinzhou / WORKSPACE
Created November 8, 2017 15:05 — forked from PyYoshi/WORKSPACE
bazel build docker-alpinelinux 3.5
# AlpineLinux 3.5
new_http_archive(
name = "docker_alpinelinux",
url = "https://nl.alpinelinux.org/alpine/v3.5/releases/x86_64/alpine-minirootfs-3.5.1-x86_64.tar.gz",
build_file = "alpinelinux.BUILD",
sha256 = "fa17f25ded0b29d94d8cc2d9aabb6f737f4b987c42fe8a6d11e05cfe2c52a64c",
)
@gavinzhou
gavinzhou / medium2md.go
Created August 3, 2018 03:39 — forked from clipperhouse/medium2md.go
A Go script to convert Medium export (HTML) to Markdown, for use with Hugo. It’s a one-use type of thing for me, so it ain’t beautiful.
// A quick script for converting Medium HTML files to Markdown, suitable for use in a static file generator such as Hugo or Jekyll
package main
import (
"fmt"
"io/ioutil"
"log"
"os"
"path/filepath"
"regexp"
@gavinzhou
gavinzhou / s3get.sh
Created September 29, 2018 03:05 — forked from jpillora/s3get.sh
S3 signed GET in plain bash (Requires openssl and curl)
#!/bin/bash
#set these in your environment/profile (NOT HERE)
AWS_ACCESS_KEY=""
AWS_SECRET_KEY=""
function s3get {
#helper functions
function fail { echo "$1" > /dev/stderr; exit 1; }
#dependency check
@gavinzhou
gavinzhou / playbook-to-migrate-to-imdsv2.yml
Created April 11, 2024 09:42 — forked from suneshgovind/playbook-to-migrate-to-imdsv2.yml
Ansible playbook to automate migration of AWS EC2 instances to Instance Metadata Service version 2 (IMDSv2)
---
- name: To enable IMDSv2 in AWS EC2 instances
hosts: localhost
vars:
regions: ["eu-north-1", "ap-south-1", "eu-west-3", "eu-west-2", "eu-west-1", "ap-northeast-2", "ap-northeast-1", "sa-east-1", "ca-central-1", "ap-southeast-1", "ap-southeast-2", "eu-central-1", "us-east-1", "us-east-2", "us-west-1", "us-west-2"]
shell_file: "modify_instance_metadata_options.sh"
tasks:
- name: get instance info
local_action: