Skip to content

Instantly share code, notes, and snippets.

View davidvuong's full-sized avatar
spaghetti mgmt

David Vuong davidvuong

spaghetti mgmt
View GitHub Profile
terraform/
├── backend.tf
└── components
├── component_a
│ ├── exports.tf
│ └── main.tf
├── component_b
│ ├── exports.tf
│ └── main.tf
└── shared
# backend.tf
bucket = "studio.voltron.project.tfstate"
region = "ap-southeast-2"
key = "terraform.tf"
dynamodb_table = "terraform-state-locks"
profile = "voltronstudio-master"
# Backends must be baked in during the initialization step:
#
# terraform init --backend-config=backend.tf
data "terraform_remote_state" "vpc" {
backend = "s3"
config {
bucket = "networking-terraform-state-files"
key = "vpc-prod.terraform.tfstate"
region = "us-east-1"
}
}
data.terraform_remote_state.vpc.private_subnet_ids
resource "aws_ssm_parameter" "sqs_http_proxy_id" {
name = "/voltron/shared/sqs/http-proxy/id"
type = "String"
value = module.sqs_http_proxy.id
overwrite = true
}
data "aws_ssm_parameter" "sqs_http_proxy_queue_url" {
name = "/voltron/shared/sqs/http-proxy/id"
}
terraform {
required_version = ">= 0.13"
}
provider "aws" {
version = "~> 3.0"
region = "ap-southeast-2"
}
resource "aws_s3_bucket" "b" {
@davidvuong
davidvuong / test.py
Created January 9, 2018 22:15
Python 3 (no dependency) authenticated request to NetworkOptix (demo)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import base64
import urllib.request
url_request = urllib.request.Request('http://demo.networkoptix.com:7001/ec2/getCamerasEx')
url_request.add_header('Authorization', f'Basic {base64.b64encode(b"demo:nxwitness").decode("utf-8")}')
response = urllib.request.urlopen(url_request)
@davidvuong
davidvuong / TakeHomeTest.md
Last active July 27, 2017 02:14
Image Intelligence TakeHomeTest

Image Intelligence TakeHome Assignment

Your task is to build an image processing service. A client may send one or many images to your service in the form of JSON. Your service makes an API call to a deep learning platform to detect classes in a set of images. Once the detection is complete, the client gets back a JSON object containing the classes and confidence values of each image sent. For example:

Request:

{
  "images": [
    "http://example.com/image1",
@davidvuong
davidvuong / TakeHomeTest.md
Last active July 4, 2018 00:10
Tamagotchi Take-home test

Bring back the 90's.

You're lonely and bored. Your doritos are stale and no one is online, this loneliness you feel has a cure...A TAMAGOTCHI!

For those of you who have never heard of a Tamagotchi, here's a quick summary:

A tamagotchi is a virtual pet whose life you must sustain through various activities including eating, playing, making it sleep etc. Tamagotchi's go through several life cycles, most notably, egg/infant, teen, adult, elderly. Tamagotchi's can die from lack of attention (in the classic ones, half a day of neglect would kill it) and also from age. For more information check the wiki http://en.wikipedia.org/wiki/Tamagotchi

Your job is to create a tamagotchi via the command line. The goal is to see how you handle open ended design requirements.

@davidvuong
davidvuong / commit_message_guidelines.md
Created April 12, 2016 14:04
Commit message guidelines

This gist describes my commit message structure. Its primarily based off AngularJS's commit message guidelines with a few alterations. You can check out their guidelines for more information here.

Overview

type(scope): [<id>] <message>
<new_line>
[<body>]