I regularly have to create new Google Kubernetes Engine (GKE) clusters (via Google Cloud Shell). I use the bash snippets below to do so.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"fmt" | |
"os" | |
"cloud.google.com/go/translate" | |
"golang.org/x/text/language" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install Node dependencies. | |
FROM node:16-slim AS builder-stage | |
WORKDIR /app | |
COPY package.json package.json | |
COPY package-lock.json package-lock.json | |
RUN npm install | |
# Compile our TypeScript code. | |
COPY src/ src/ | |
COPY tsconfig.json tsconfig.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Check the suffix of the istiod-asm-* Service. | |
kubectl get service --namespace=istio-system |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set the version of Python you want to use here. | |
FROM python:3.12.2-slim@sha256:36d57d7f9948fefe7b6092cfe8567da368033e71ba281b11bb9eeffce3d45bc6 as base | |
# Ignore this. This is needed to build Online Boutique's recommendationservice. | |
# RUN apt-get -qq update \ | |
# && apt-get install -y --no-install-recommends \ | |
# wget g++ \ | |
# && rm -rf /var/lib/apt/lists/* | |
# This Dockerfile assumes that the requirements.in file is in the same folder as this Dockerfile. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# If you're not using Cloud Shell, make sure to replace $GOOGLE_CLOUD_PROJECT with your Project ID. | |
# Cloud Shell is a small virtual machine (in Google Cloud) that's tied to your Google Cloud account. | |
export PROJECT_ID=$GOOGLE_CLOUD_PROJECT | |
export CLUSTER_NAME=my-cluster-with-in-cluster-asm-1 | |
export KUBECONTEXT_NAME=${CLUSTER_NAME} | |
export ZONE=us-central1-b | |
export PROJECT_NUMBER=$(gcloud projects describe ${PROJECT_ID} --format='get(projectNumber)') | |
export ASM_VERSION=1.14 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# If you're not using Cloud Shell, make sure to replace $GOOGLE_CLOUD_PROJECT with your Project ID. | |
# Cloud Shell is a small virtual machine (in Google Cloud) that's tied to your Google Cloud account. | |
export PROJECT_ID=$GOOGLE_CLOUD_PROJECT | |
export CLUSTER_NAME=my-cluster-3 | |
export KUBECONTEXT_NAME=my-cluster-3 | |
export ZONE=us-central1-b | |
export PROJECT_NUMBER=$(gcloud projects describe ${PROJECT_ID} --format='get(projectNumber)') | |
echo "🏗️ Enabling necessary Google Cloud APIs..." |
The information below in now out-dated. If your address change is within the same country, you can use the "Contact Information" page to update your address.
I wanted to update my address on the schwab.com web app, but I couldn't find proper instructions anywhere. So I called them, and here's what they said (I had to do):
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This script could be used to test whether an endpoint could handle an overload | |
* of HTTP requests. | |
*/ | |
{ | |
const URL = "https://example.com"; | |
const MILLISEC_WAIT_PER_REQUEST = 100; | |
function bombardWithHttpRequest() { | |
fetch(URL) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
let things = []; | |
let thingsElement = $0.children; // Select the DOM element that contains the list. | |
for (let i = 0; i < thingsElement.length; i++) { | |
const thing = thingsElement[i].children[1].innerHTML; // Change this. Extract the item from its HTML element. | |
things.push(thing); | |
} | |
let glue = "\",\n \""; // Change this. | |
console.log(things.join(glue)); | |
} |