Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am johnkday on github.
  • I am jkday (https://keybase.io/jkday) on keybase.
  • I have a public key ASCo7NvAkuQs6w-mMb4DVoK3Z1weeLt2jrrQjcoCpSE_nwo

To claim this, I am signing this object:

@JohnKDay
JohnKDay / UbuntuMicroK8sSetup.sh
Last active April 23, 2024 11:34
Script and ansible playbook to setup K8s cluster on Ubuntu 20.04 or Debian 11
#!/usr/bin/env bash
set -v
# Auto setup of microk8s in Ubuntu 20.04 or Debian 11
sudo apt-get update && sudo apt-get upgrade -y ansible
curl -sL https://gist.github.com/JohnKDay/4dee71ace86f98d6e46026bf755b0a87/raw/df-demo-setup.yaml | ansible-playbook --extra-vars="$@" --connection=local -i "localhost," /dev/stdin
ccpVcenterRoles=(
Extension.Register
Extension.Unregister
Extension.Update
StorageProfile.View
System.Anonymous
System.Read
System.View
@JohnKDay
JohnKDay / xpra@.service
Created June 14, 2020 16:09
Startup for xpra service
[Unit]
Description=xpra display
[Service]
Type=simple
User=%i
EnvironmentFile=/etc/conf.d/xpra
ExecStart=/usr/bin/xpra --no-daemon start ${%i}
[Install]
@JohnKDay
JohnKDay / ccp_kibana_ingress_setup.sh
Last active August 31, 2023 03:46
Configure ingress for Kibana interface for EFK stack CCP 6.1
#!/bin/bash
# Set cluster config path
export KUBECONFIG=${KUBECONFIG:-~/.kube/config}
# Kibana username
KIBANA_USERNAME=admin
KIBANA_PASSWORD=superdooper
# Configure Kibana server.basePath param
@JohnKDay
JohnKDay / get-cluster-add-on-info.sh
Created June 10, 2020 22:54
get CCP 6.1 Addons info
#!/usr/bin/env bash
# Get the Cluster ingress IP
IP=$(kubectl get svc -n ccp nginx-ingress-controller -o jsonpath='{.spec.loadBalancerIP}')
printf "Harbor UI\n"
printf "https://%s/\n" ${IP}
printf "username: admin\n"
@JohnKDay
JohnKDay / getCCPTCkubeconfig.sh
Created June 10, 2020 22:53
Directly download a TC kubeconfig file
# Set variables
export CCP_CP=10.100.51.100
export CCP_LOGIN=admin
export CCP_PASS='Cisco123!' #space shouldn't record command in history and thus the password, but you can see it in env, doh!
# Get a v3 Token
export TOKEN=$(curl --http2 -v -k -X POST -H "Content-Type:application/x-www-form-urlencoded" -d "username=${CCP_LOGIN}&password=${CCP_PASS}" https://"${CCP_CP}/v3/system/login" 2>&1 | awk '$2~/[Xx]-[Aa]uth-[Tt]oken/{gsub("\r","",$3);printf "%s",$3}')
[ -n "$TOKEN" ] && echo "${TOKEN}" || echo "Bad LOGIN"
@JohnKDay
JohnKDay / cloudSettings
Created January 21, 2020 04:08
Visual Studio Code Settings Sync Gist
// Empty
@JohnKDay
JohnKDay / cloudSettings
Created January 21, 2020 03:50
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-01-21T03:50:42.094Z","extensionVersion":"v3.4.3"}
@JohnKDay
JohnKDay / datecheck.yaml
Created January 18, 2020 00:32
Compare date and time of all nodes from a Kubernetes container
---
apiVersion: apps/v1beta2
kind: DaemonSet
metadata:
name: datetimecheck
spec:
selector:
matchLabels:
name: datetimecheck
template: