Skip to content

Instantly share code, notes, and snippets.

View cobookman's full-sized avatar

Colin Bookman cobookman

  • LinkedIn (Ex AWS/GCP)
  • San Francisco, CA
View GitHub Profile
# K8s service account for CSI Driver
apiVersion: v1
kind: ServiceAccount
metadata:
name: local-volume-provisioner-admin
namespace: kube-system
---
# List of Permissions
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
@cobookman
cobookman / server.py
Created April 28, 2020 22:15
Dummy HTTP Server for python2.7
import time
import BaseHTTPServer
HOST_NAME = '0.0.0.0'
PORT_NUMBER = 80
class MyHandler(BaseHTTPServer.BaseHTTPRequestHandler):
def do_HEAD(s):
@cobookman
cobookman / glue_metadata_dump.py
Last active September 8, 2020 07:20
Dump AWS Glue metadata
Lab Doc
https://docs.google.com/document/d/1Kw4dhhjFLvRXUMZzr9HsIDt8mQfccXopP9jbPdd5NX8/edit?usp=sharing
@cobookman
cobookman / Example VTT
Last active September 19, 2019 21:11
WebVTT Generation from Google Video Intelligence API
./captioner.py \
--video=gs://us-central1-cdn-test-files/static-mp4/stay_tuned.mp4 \
--service_account=service_account.json \
--out=stay_tuned.vtt
---
WEBVTT
0:0:1.500 --> 0:0:4.500
Is this a scene from an action movie where this wild
sudo apt-get update \
&& sudo apt-get upgrade -y \
&& sudo apt-get dist-upgrade \
&& sudo apt-get install python3-pip -y \
&& pip3 install google-cloud-bigquery \
&& wget https://gist.githubusercontent.com/cobookman/424670df4c1dca6e5c75a8df7b62e760/raw/eba0bfec3871089446ce6f31efbf066b83ed150f/forever.sh \
&& wget https://gist.githubusercontent.com/cobookman/424670df4c1dca6e5c75a8df7b62e760/raw/eba0bfec3871089446ce6f31efbf066b83ed150f/test.py \
&& chmod +x * \
&& sudo reboot -n
@cobookman
cobookman / README.md
Last active November 25, 2021 14:26
Speech API + Tornado + Python3 + WSS

How to setup this PoC. In this example we'll be using user credentials vs service accounts.

  1. Create a GCP Project. For example let's call it tivo-test

  2. In the cloud console, open VPC Network->Firewall Rules. Firewall Rule

  3. Enable the speech API. (Follow steps in slides)

  4. Create a VM in the GCP project running Ubuntu.

  5. SSH into the vm and run the following commands:

@cobookman
cobookman / index.html
Created August 3, 2017 01:31
Speech Streaming with Python & GRPC
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h2>Transcript</h2>
<div id="transcript"><?div>
<script>
var app = {
@cobookman
cobookman / package.json
Created July 24, 2017 18:02
Hello World - Sockets - HTTPS Load Balancer - Nodejs - Sticky Sessions
{
"name": "hello-sockets",
"version": "0.0.1",
"private": true,
"dependencies": {
"express": "~4.15.3",
"socket.io": "~2.0.3"
},
"engines": {
"node": "4.7.2"
@cobookman
cobookman / DatastoreToGcs.java
Created June 7, 2017 16:09
Working ShadowJar Build
package com.google.cloud.dataflow.teleport;
import org.apache.beam.sdk.Pipeline;
import org.apache.beam.sdk.PipelineResult;
import org.apache.beam.sdk.io.TextIO;
import org.apache.beam.sdk.io.gcp.datastore.DatastoreIO;
import org.apache.beam.sdk.io.gcp.datastore.DatastoreV1;
import org.apache.beam.sdk.options.Default;
package com.google.cloud.dataflow.teleport;
import org.apache.beam.sdk.Pipeline;
import org.apache.beam.sdk.PipelineResult;
import org.apache.beam.sdk.io.TextIO;
import org.apache.beam.sdk.io.gcp.datastore.DatastoreIO;
import org.apache.beam.sdk.io.gcp.datastore.DatastoreV1;
import org.apache.beam.sdk.options.Description;