Skip to content

Instantly share code, notes, and snippets.

<html>
<head>
</head>
<body>
<script>
alert('hello world');
</script>
</body>
</html>
@jdolitsky
jdolitsky / pull.go
Created December 21, 2018 21:47 — forked from cpuguy83/pull.go
package main
import (
"context"
"fmt"
"io/ioutil"
"os"
"github.com/containerd/containerd/content/local"
"github.com/containerd/containerd/images"
@jdolitsky
jdolitsky / helm-3-chart-command.md
Last active February 3, 2019 04:59
Current progress of Helm 3 changes related to working with registries

Helm 3 chart command

Note: this is a work in progress, and is subject to change soon.

Chart Subcommands

save

save a chart directory

@jdolitsky
jdolitsky / web-servers.md
Created February 12, 2019 22:21 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@jdolitsky
jdolitsky / kind-install.sh
Created March 21, 2019 08:09
kind install with helm and local-path-provisioner
#!/bin/bash -ex
CLUSTER_NAME=${CLUSTER_NAME:-mycluster}
go get -u sigs.k8s.io/kind
kind delete cluster --name=$CLUSTER_NAME || true
kind create cluster --name=$CLUSTER_NAME
SET_KUBE_CMD="export KUBECONFIG="$(kind get kubeconfig-path --name="$CLUSTER_NAME")""
$SET_KUBE_CMD
@jdolitsky
jdolitsky / install_helm3alpha1_mac.sh
Last active May 17, 2019 21:57
Simple script to install Helm v3.0.0-alpha.1 on macOS to /tmp
#!/bin/bash -ex
export HELM_HOME="/tmp/helm3"
mkdir -p "${HELM_HOME}/bin"
rm -f helm-release.tar.gz
wget -O helm-release.tar.gz https://get.helm.sh/helm-v3.0.0-alpha.1-darwin-amd64.tar.gz
if [[ "$(openssl dgst -sha256 helm-release.tar.gz | awk '{print $2}')" != "f562e5bbb5b8b8a6a46c080970c1fea35ff908a1402f56e5d4c8f327c9ff4835" ]]; then
echo "checksum does not match"
exit 1
#!/bin/bash -ex
export HELM_HOME="/tmp/helm3"
mkdir -p "${HELM_HOME}/bin"
rm -f helm-release.tar.gz
wget -O helm-release.tar.gz https://get.helm.sh/helm-v3.0.0-alpha.1-darwin-amd64.tar.gz
if [[ "$(openssl dgst -sha256 helm-release.tar.gz | awk '{print $2}')" != "w562e5bbb5b8b8a6a46c080970c1fea35ff908a1402f56e5d4c8f327c9ff4835" ]]; then
echo "checksum does not match"
exit 1
@jdolitsky
jdolitsky / helm3_redis_install.sh
Last active May 21, 2019 08:19
Installing Redis with Helm 3 (Note: this will also bootstrap Helm 3 on Mac)
#!/bin/bash -ex
#
# Magic Helm 3.0.0-alpha1 macOS install script here:
# https://gist.github.com/jdolitsky/0ec804b09f24a24b05acb681f01903c9
# --->
GIST_ID="${GIST_SLUG:-jdolitsky/0ec804b09f24a24b05acb681f01903c9}"
GIST_FILE="${GIST_FILE:-install_helm3alpha1_mac.sh}"
GIST_URL="https://gist.githubusercontent.com/${GIST_ID}/raw/${GIST_FILE}"
@jdolitsky
jdolitsky / octant-plugin-dev.sh
Last active November 16, 2019 23:31
Script to help with Octant plugin development. Watches .go files, rebuilds plugin, and automatically restarts Octant server. Requires fswatch.
#!/usr/bin/env bash
set -euo pipefail
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "${DIR}"
REQUIRED_SYSTEM_COMMANDS=(
"go"
"octant"
"fswatch"
@jdolitsky
jdolitsky / new_private_list_with_all_followed_users.go
Created February 12, 2020 20:56
Script to add everyone you follow on Twitter to a new private list
/*
new_private_list_with_all_followed_users.go
Script to add everyone you follow on Twitter to a new private list
Usage (requires Go 1.13+):
// Name of the Twitter list (should not exist yet, will be created)
export TW_LIST_NAME="<new_list_name>"