Skip to content

Instantly share code, notes, and snippets.

export PS1="[\u@\h:\w]\n\\$ \[$(tput sgr0)\]"
@JohnKDay
JohnKDay / coder-ide.yaml
Last active April 24, 2019 22:33
Run coder IDE in k8s
# Command to run vscode server in Kubernetes.
# derived from
# docker run -it -p 127.0.0.1:8443:8443 -v "${PWD}:/home/coder/project" codercom/code-server --allow-http --no-auth
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: coder-ide-vol
spec:
accessModes:
@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:
@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 / cloudSettings
Created January 21, 2020 04:08
Visual Studio Code Settings Sync Gist
// Empty
@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 / 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 / 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 / [email protected]
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]
ccpVcenterRoles=(
Extension.Register
Extension.Unregister
Extension.Update
StorageProfile.View
System.Anonymous
System.Read
System.View