https://github.com/lingsamuel/kubectl-life-saver/
Kubectl shortcuts general rule:
| # read api end point | |
| func doRequest(url string) ([]byte, error) { | |
| resp, err := http.Get(url) | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer resp.Body.Close() | |
| return ioutil.ReadAll(resp.Body) | |
| } |
| MIT License | |
| Copyright (c) 2021 Daniel Ethridge | |
| Permission is hereby granted, free of charge, to any person obtaining a copy | |
| of this software and associated documentation files (the "Software"), to deal | |
| in the Software without restriction, including without limitation the rights | |
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| copies of the Software, and to permit persons to whom the Software is | |
| furnished to do so, subject to the following conditions: |
| import asyncio | |
| import psycopg2 | |
| # dbname should be the same for the notifying process | |
| conn = psycopg2.connect(host="localhost", dbname="example", user="example", password="example") | |
| conn.set_isolation_level(psycopg2.extensions.ISOLATION_LEVEL_AUTOCOMMIT) | |
| cursor = conn.cursor() | |
| cursor.execute(f"LISTEN match_updates;") |
https://github.com/lingsamuel/kubectl-life-saver/
Kubectl shortcuts general rule:
| # MIT No Attribution | |
| # | |
| # Copyright 2022 Ben Kehoe | |
| # | |
| # Permission is hereby granted, free of charge, to any person obtaining a copy of this | |
| # software and associated documentation files (the "Software"), to deal in the Software | |
| # without restriction, including without limitation the rights to use, copy, modify, | |
| # merge, publish, distribute, sublicense, and/or sell copies of the Software, and to | |
| # permit persons to whom the Software is furnished to do so. | |
| # |
| # Put this function to your .bashrc file. | |
| # Usage: mv oldfilename | |
| # If you call mv without the second parameter it will prompt you to edit the filename on command line. | |
| # Original mv is called when it's called with more than one argument. | |
| # It's useful when you want to change just a few letters in a long name. | |
| # | |
| # Also see: | |
| # - imv from renameutils | |
| # - Ctrl-W Ctrl-Y Ctrl-Y (cut last word, paste, paste) |
| #!/usr/bin/env python | |
| import os, os.path, stat, sys, base64 | |
| # TOTP lib inlined | |
| import time, hmac, base64, hashlib, struct | |
| def pack_counter(t): | |
| return struct.pack(">Q", t) |
terraform initterraform apply -var="do_token=$(cat $HOME/digitalocean-access-token)"gateway_url = http://178.128.39.201:8080/
login_cmd = faas-cli login -g http://178.128.39.201:8080/ -p rvIU49CEcFcHmqxj
This gist has moved to the faasd repo
https://github.com/openfaas/faasd/blob/master/docs/MULTIPASS.md
Update: This gist has graduated to a full blog post over on my site -> https://blog.alexellis.io/get-private-kubectl-access-anywhere/
This tutorial shows you how to punch your private Kubernetes API server out to the Internet, so that you can manage your cluster from anywhere, just like you would with a cloud offering.
These steps have been tested with kubeadm, k3s and OpenShift.
You'll need: