Skip to content

Instantly share code, notes, and snippets.

View dcwangmit01's full-sized avatar

David Wang dcwangmit01

View GitHub Profile
@dcwangmit01
dcwangmit01 / embed-markdown.html
Last active November 11, 2020 19:46
Embedding Markdown within HTML
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
</head>
<body>

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

@dcwangmit01
dcwangmit01 / main.go
Last active March 2, 2024 14:54
Self-templating with golang text/template and gomplate
/*
Demo program illustrating usage of gomplate as a library.
This program will accept an input file and run it through the templating
engine as both the values dictionary as well as the template file. It will
repeat the process until the templating result stops changing, and print
the result to STDOUT.
This program add the gomplate datasources and functions to the golang
text/template engine. This requires the input to be have the gomplate
@dcwangmit01
dcwangmit01 / .tmux.conf
Created April 19, 2018 16:58
20180419 tmux.conf
# Set the terminal type so colors get rendered correctly
set -g default-terminal "screen-256color"
# window numbering
# start window numbers at 1 to match keyboard order with tmux window order
set -g base-index 1
set-window-option -g pane-base-index 1
set -g renumber-windows on
# increase scrollback lines
@dcwangmit01
dcwangmit01 / keybase.md
Created October 17, 2017 16:55
keybase.md

Keybase proof

I hereby claim:

  • I am dcwangmit01 on github.
  • I am dcwangmit01 (https://keybase.io/dcwangmit01) on keybase.
  • I have a public key ASCbCx6rTyXVS-TuqqSZ_wD01PO-9L5nUNUjlwai7Ya2aAo

To claim this, I am signing this object:

How Kolla and Kolla-Kubernetes Work

Let's consider how the mariadb kolla container is configured and run in both kolla and kolla-kubernetes, as of today 2016/06/08.

Common Steps:

  • Operator edits /etc/kolla/globals.yml and sets the interface to which API services will bind. By default, the setting is: network_interface: "eth0".
  • Operator edits the ansible inventory file within ./ansible/inventory/{inventory_file}, and sets the target hostgroups which will run the mariadb kolla container.
  • Operator runs 'kolla-ansible genconfig' which gathers networking facts on each host and resolves the 'network_interface' setting as the IP address to which the service to bind. This IP address is hard-coded within configuration files deposited on each host in the directory '/etc/kolla/{component}'.
@dcwangmit01
dcwangmit01 / .envrc
Last active March 30, 2016 01:58
Direnv .envrc for Python Virtualenv
# direnv file: https://github.com/direnv/direnv
# Automatically sets the gopath to the directory wherever this .envrc
# file lives, even from subdirectories
OLD_PYTHON=`which python`
VENV_PATH=`pwd`/.venv/`hostname`
if [ ! -d "$VENV_PATH" ]; then
virtualenv $VENV_PATH
fi
@dcwangmit01
dcwangmit01 / gcloudInstanceTemplateResize.py
Last active July 9, 2017 07:00
Python script for resizing a gcloud instance template
"""Resize a gcloud instanceTemplate by creating a new one
Given an existing instanceTemplate name, copy it to a new name and
optionally set a new size and machineType.
This script can be used to resize google cloud container kubernetes
node instance templates. It is necessary because the gcloud container
instanceTemplate UI does not allow the resizing of disks for
kubernetes nodes, and the curl and REST examples don't seem to work as
of 03/28/2016.