Skip to content

Instantly share code, notes, and snippets.

@gildas
gildas / start-athens.sh
Created June 19, 2020 03:07
Start Athens GO Proxy in Docker
#!/usr/bin/env bash
ATHENS_PORT=9090
echo "Starting Athens GO Proxy on port $ATHENS_PORT"
docker run --name athens \
--publish $ATHENS_PORT:3000 \
--env ATHENS_GONOSUM_PATTERNS="bitbucket.org/sim-hub/*,bitbucket.org/gildas_cherruel/*" \
--env ATHENS_STORAGE_TYPE=disk \
--env ATHENS_DISK_STORAGE_ROOT=/var/lib/athens \
@gildas
gildas / sstun.sh
Created June 10, 2020 01:46
Easy SSH Tunneling
#!/usr/bin/env bash
THERE=
LOCAL_PORT=0
REMOTE_PORT=0
SSH_PORT=22
VERBOSE=0
NOOP=
ARGS=()
apiVersion: install.istio.io/v1alpha2
kind: IstioControlPlane
spec:
# Use the default profile as the base
# More details at: https://istio.io/docs/setup/additional-setup/config-profiles/
profile: default
values:
global:
# Ensure that the Istio pods are only scheduled to run on Linux nodes
defaultNodeSelector:
#!/usr/bin/env bash
VERBOSE=0
NOOP=
ARGS=()
MONGODB=
HOSTARG=
CONTAINER=
COLLECTIONS=()

What I want to achieve here...

The idea is to get kubectl on my linux box to talk to Kubernetes deployed in Docker for Mac on my macos.

Unless I can find a way to expose the Kubernetes API on Docker for Mac to the outside world, I have to tunnel. Docker for Mac runs Kubernetes API on the localhost only...

Forward Local traffic to a remote host/port

Running this on my linux box:

@gildas
gildas / win-openssh.md
Last active May 28, 2025 16:38
Deploy OpenSSH on Windows 2019 Full and Core

Deploy OpenSSH on Windows Server 2019

Goals

We want to install OpenSSH on a Windows Server 2019, so we can remote access it with ssh myuser@win2019.

We want also to turn on PowerShell Remoting over SSH, so we can create PSSession objects from PowerShell Core on Linux/MacOs/Windows.

Acknowledgments

#!/usr/bin/env bash
shopt -s extglob
set -o errtrace
#set -o errexit
set +o noclobber
# Defaults {{{
ARGS=()
ASSUMEYES=0
@gildas
gildas / heat-docker.yaml
Last active May 8, 2019 07:55
Heat Orchestration Template for Docker
heat_template_version: 2018-03-02 # queens
description: Docker on OpenStack
parameters:
key:
type: string
description: Keypair name to inject in instances
constraints:
- custom_constraint: nova.keypair
@gildas
gildas / create-k8s.sh
Created April 26, 2019 09:17
Create a Kubernetes on OpenStack (client side)
#!/usr/bin/env bash
OSKEY=$1
K8SNAME=$2
if ! openstack stack show -c id -f value $K8SNAME >& /dev/null; then
echo "Creating Kubernetes cluster ${K8SNAME}..."
time openstack stack create \
--tags kubernetes,microk8s \
--template https://tinyurl.com/heat-microk8s \
@gildas
gildas / heat-microk8s.yaml
Last active May 9, 2019 01:25
Heat Orchestration Template for MicroK8S
heat_template_version: 2018-03-02 # queens
description: Micro K8S on OpenStack
parameters:
key:
type: string
description: Keypair name to inject in instances
constraints:
- custom_constraint: nova.keypair