Skip to content

Instantly share code, notes, and snippets.

@znorris
znorris / foo
Created November 12, 2019 01:36
bar
0x31CC42b23c7E6846Ca44722Ae5128Df16A0eFC28
@znorris
znorris / example.yaml
Last active April 18, 2018 23:08
Kubernetes Proxy Sidecar Example
spec:
restartPolicy: Never
initContainers:
- name: init
image: busybox
command: ["/bin/sh"]
args: ["-c",
"touch /tmp/shared-volume/migration.lock"]
volumeMounts:
- name: shared-volume
# This config block will check if the current public IP of the host is 8.8.8.8
# If this is true, we can assume we're on the same network as our server, bob. In this case we should use it's local IP.
# If this is false, we can assume we're not on the same network as our server, bob. In this case we should use it's public IP.
Match OriginalHost bob Exec "curl -s 'https://api.ipify.org?format=text' | grep '8.8.8.8'"
Hostname 192.168.1.2
Host bob
Hostname 8.8.8.8
@znorris
znorris / .profile
Created December 9, 2017 00:03 — forked from zombiezen/.profile
zsh on Google Cloud Shell
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@znorris
znorris / nearby-autovirtualenv.plugin.zsh
Created February 14, 2017 01:02
[WIP] nearby auto-virtualenv plugin for oh my zsh.
##
## Looks for python virtualenv directories and activates them.
## If you've left a project directory where there is no
## virtualenv folder, the env will be disabled.
##
VENV_DIR=".venv"
CLOSEST_VENV=""
@znorris
znorris / google.py
Created September 28, 2016 21:43 — forked from alexcasalboni/google.py
Google Prediction API - Train a classification model and generate a new Prediction
import httplib2, argparse, os, sys, json
from oauth2client import tools, file, client
from oauth2client.service_account import ServiceAccountCredentials
from googleapiclient import discovery
from googleapiclient.errors import HttpError
#Project and model configuration
project_id = '132567073760'
model_id = 'HAR-model'
@znorris
znorris / Gemfile
Last active April 14, 2016 22:24 — forked from mcrumm/Gemfile
Sloth, gentle load testing
source 'https://rubygems.org'
gem 'httparty'