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
#!/bin/sh | |
# | |
## a POSIX-portable diagnostic for a Ziti identity's trust chain | |
# | |
# raise exceptions | |
set -e | |
set -u |
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
#!/usr/bin/env bash | |
set -o errexit | |
set -o nounset | |
set -o pipefail | |
# set -o xtrace | |
: "${ZITI_ALPN:=h2,http/1.1}" | |
: "${TMPDIR:=$(mktemp -d)}" | |
BASENAME="$(basename "${0}")" |
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
# | |
# companion gist for https://www.youtube.com/live/zWxjwCPuiXg | |
# | |
# set these variables in .env | |
# ZIGGY_UID - the numeric ID of the user that owns ~/.zrok on the Docker host | |
# ZIGGY_GID - the mumeric ID of the group that owns ~/.zrok on the Docker host | |
# ZROK_RESERVED_SHARE - the unique name of the zrok reserved public share | |
# MYSQL_ROOT_PASSWORD | |
# MYSQL_PASSWORD |
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
#!/usr/bin/env bash | |
set -euo pipefail | |
KNOW_SRC="$HOME/Sites/netfoundry/github" | |
: "${TMPDIR:=$(mktemp -d)}" | |
cd "$TMPDIR" | |
KNOW_DST="$TMPDIR/knowledge" | |
mkdir -p "$KNOW_DST" |
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
#!/usr/bin/env python3 | |
import os | |
import sys | |
import argparse | |
import requests | |
from urllib.parse import urljoin, quote | |
import base64 | |
import hashlib | |
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
printf 'Open\tSock\tUnix\tFile\tCommand\n' | |
for CMD in 'ziti router run' 'ziti controller run' 'ziti-edge-tunnel run' | |
do | |
for PID in $(pgrep -f "$CMD") | |
do | |
# Capture lsof output for the process | |
lsof_output=$(sudo lsof -Pnp "$PID" 2>/dev/null) | |
# Total open files | |
total_open=$(echo "$lsof_output" | wc -l) |
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
#!/usr/bin/env bash | |
# this one-shot script demonstrates how to use a ziti router as a transparent proxy sidecar | |
set -o errexit -o nounset -o pipefail #-o xtrace | |
function cleanup() { | |
if ! (( I_AM_ROBOT )) | |
then | |
echo "WARNING: destroying docker volumes in 30s; set I_AM_ROBOT=1 to suppress this message" >&2 |
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
zrok(){ | |
if [[ "$1" =~ ^(-p|--profile)$ ]] | |
then | |
shift | |
local profile="$1" | |
shift | |
else | |
/usr/bin/zrok ${@} | |
return $? | |
fi |
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
FROM openziti/ziti-cli AS ziti-cli | |
FROM ubuntu | |
COPY --from=ziti-cli /usr/local/bin/ziti /usr/local/bin/ziti | |
RUN apt-get update && apt-get install --yes \ | |
nano \ | |
vim \ | |
iputils-ping \ |
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
#!/usr/bin/env bash | |
_gen_ula(){ | |
# Generate a 40-bit random global ID | |
local random_id | |
random_id=$(od -An -N5 -tx1 /dev/urandom | xxd -p | tr -d '\n') | |
# Construct the ULA address prefix with the generated global ID | |
local ula_prefix="fd${random_id:0:2}:${random_id:2:4}:${random_id:6:4}" | |
echo "${ula_prefix}::1" | |
} |
NewerOlder