Skip to content

Instantly share code, notes, and snippets.

View joshgav's full-sized avatar

Josh Gavant joshgav

View GitHub Profile
@joshgav
joshgav / multitenancy_clusters.md
Last active May 16, 2022 14:54
Blog post on multitenancy with clusters

Clusters for all cloud tenants

A decision which faces many large organizations as they adopt cloud architecture is how to provide isolated spaces within the same environments and clusters for various teams and purposes. For example, marketing and sales applications may need to be isolated from an organization's customer-facing applications; and development teams building any app usually require extra spaces for tests and verification.

Namespace as unit of tenancy

To address this need, many organizations have started to use namespaces as units of isolation and tenancy, a pattern previously described by Google and Kubernetes contributors. But namespace-scoped isolation is often insufficient because some concerns are managed at cluster scope. In particular, installing new resource types (CRDs) is a cluster-scoped activity; and today independent te

@joshgav
joshgav / envsubst.sh
Last active August 10, 2020 19:49
A bash equivalent of gettext's envsubst executable.
# envsubst invokes all shell substitutions in a file
# use by first sourcing this file, e.g. `source envsubst.sh` or `. envsubst.sh`,
# and then invoking `envsubst` on STDIN or a specific file
# it should only be invoked on trusted or scrubbed files to avoid injection attacks
function envsubst {
local infile=${1}
if [[ "${SUPPRESS_ENVSUBST_WARNING}" != "1" ]]; then
>&2 echo "[WARNING] the envsubst function should only be used on trusted files because it is vulnerable to injection attacks"
fi
kubectl run myubuntu --image ubuntu --rm -ti --restart=Never --overrides='
{
"metadata": {
"labels": {
"diditwork": "itdid"
}
},
"spec": {
"containers": [
{

Node.js tooling: Engineering working notes

🏃 In-progress and incomplete: still trying to wrap my head around much of it, coordinating with partner teams to enable the right interfaces, etc., and there are a bunch of unanswered Qs, but just wanted to get the conversation started.

###Goal: Build Best-of-Breed Node.js Developer Experiences In particular, we'll be focusing on inner-loop development, but at the same time we'll want to ensure that the same awesome experience transcends product/service boundaries.

####Table Stakes First and foremost, it's important that we agree on a set of table stakes. These are the experiences that are really foundational - without them, it's a no-op.

  • Debugging (including sourcemaps) needs to be consistent and reliable
@Jaza
Jaza / Private-pypi-howto
Last active July 2, 2023 16:24
Guide for how to create a (minimal) private PyPI repo, just using Apache with directory autoindex, and pip with an extra index URL.
*
@joyrexus
joyrexus / README.md
Last active April 19, 2025 09:46 — forked from btoone/curl.md
curl tutorial

An introduction to curl using GitHub's API.

Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin

Includes HTTP-Header information in the output

@pmuellr
pmuellr / debug-when-do.js
Created May 23, 2013 03:15
another silly example of using v8's in-process debugger APIs
#!/usr/bin/env node
// run with `node --expose-debug-as=Debug fileName.js`
//------------------------------------------------------------------------------
// When the function f1 returns true, run function f2.
// f1 will be invoked at every debug step point.
//------------------------------------------------------------------------------
function whenDo(f1, f2) {
@pmuellr
pmuellr / trace-self.js
Created May 23, 2013 02:38
trace JavaScript using v8's --expose-debug-as= option
#!/usr/bin/env node
// run with `node --expose-debug-as=Debug fileName.js`
// traces all the code run after dummyFunc() invoked
// see v8/src/debug-debugger.js for some of the impl of the API
var debug = Debug.Debug
//------------------------------------------------------------------------------
@smoser
smoser / gist:4756561
Last active November 8, 2023 15:20
boot a cloud image in kvm
## Install a necessary packages
$ sudo apt-get install kvm cloud-utils genisoimage
## URL to most recent cloud image of 12.04
$ img_url="http://cloud-images.ubuntu.com/server/releases/12.04/release"
$ img_url="${img_url}/ubuntu-12.04-server-cloudimg-amd64-disk1.img"
## download the image
$ wget $img_url -O disk.img.dist
## Create a file with some user-data in it