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
@suneshgovind
suneshgovind / playbook-to-migrate-to-imdsv2.yml
Created December 31, 2019 07:24
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:
@Philmod
Philmod / gcb-kubernetes.yaml
Last active July 25, 2021 05:34
Deploy a new image from Google Cloud Container Builder to Kubernetes, by storing GKE credentials in GCS.
steps:
- name: 'gcr.io/cloud-builders/npm'
args: ['install']
- name: 'gcr.io/cloud-builders/npm'
args: ['test']
- name: 'gcr.io/cloud-builders/docker'
args: ["build", "-t", "gcr.io/$PROJECT_ID/frontend:$REVISION_ID", "."]
- name: 'gcr.io/cloud-builders/docker'
args: ["push", "gcr.io/$PROJECT_ID/frontend:$REVISION_ID"]
- name: 'gcr.io/cloud-builders/gcloud'
@Philmod
Philmod / google-container-kubernetes.js
Last active November 26, 2018 18:10
Deploy a new image from Google Cloud Container Builder to Kubernetes, using Google Cloud Functions.
const async = require('async');
const google = require('googleapis');
const k8s = require('kubernetes-client');
const container = google.container('v1');
const PROJECT_ID = 'node-example-gke';
const ZONE = 'us-east1-b';
const CLUSTER_ID = 'node-example-cluster';
const NAMESPACE = 'default';
@PyYoshi
PyYoshi / WORKSPACE
Created February 27, 2017 13:14
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",
)
@ehernandez-xk
ehernandez-xk / upload-file-s3.go
Last active January 31, 2021 00:56
Uploading a file to AWS S3 using aws-sdk-go
/*
https://www.youtube.com/watch?v=iOGIKG3EptI
https://github.com/awslabs/aws-go-wordfreq-sample/blob/master/cmd/uploads3/main.go
https://docs.aws.amazon.com/sdk-for-go/api/aws/
- first configure your aws credentials run: aws configure
- go get -u github.com/aws/aws-sdk-go/aws
- login to UI web aws s3 interface
- go to S3 service
@imbriaco
imbriaco / 00-README.md
Last active May 26, 2018 08:02
Example deployment descriptor for running Cog on Kubernetes. Uses the secret store as well as persistent disks for Postgres, Cog, and Relay data.

Cog on Kubernetes

This experiment was originally built on Google Cloud's Kubernetes and makes use of gcePersistentDisk. If you are not using Google Cloud, you'll need to adjust the gcePersistentDisk volumes to use the persistent disk technology available in your cluster.

At a high level the steps look something like this, though there may be subtle errors. This experiment happened a few weeks ago and I'm creating these from memory along with the test descriptors I used.

  1. Setup Kubernetes and create the necessary persistent disks that are referenced in the deployment.
@theobolo
theobolo / kube-status.log
Last active December 18, 2016 01:12
IngressController
Test
@mvadu
mvadu / grafana custom.ini
Last active November 11, 2023 18:26
nginx config for using grafana, Influxdb via reverse proxy with authentication
# The full public facing url
#root_url = %(protocol)s://%(domain)s:%(http_port)s/
root_url = http://localhost:80/grafana/
@rowanmanning
rowanmanning / README.md
Last active February 18, 2024 21:12
Writing a Friendly README. This a companion-gist to the post: http://rowanmanning.com/posts/writing-a-friendly-readme/
@ddragosd
ddragosd / api-gateway-marathon-setup.sh
Last active April 9, 2018 04:31
API Gateway setup in Mesos and Marathon
# PREREQUISITES:
# Setup a Mesos cluster and install Marathon framework
MARATHON_HOST="http://<marathon_host>/marathon"
# this could be an internal ELB that the Gateway nodes can use to auto-discover services
INTERNAL_MARATHON_HOST="http://<internal_marathon_host>/marathon"
# a wildcard domain configured with *.api.anydomain
API_DOMAIN="api.<my-domain>"
# -------------------------