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
gcloud --project $project container clusters list --format json \ | |
| jq -r '.[] | "\(.name):\(.location)"' \ | |
| xargs -I @ bash -c \ | |
"name=\$(echo @ | cut -d ':' -f 1) \ | |
&& region=\$(echo @ | cut -d ':' -f 2) \ | |
&& gcloud --project $project container clusters get-credentials \$name --region \$region" |
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
''' | |
Based on https://gist.github.com/enjalot/2904124 (in Python 2) -> quick-migrated to Python 3 | |
Usage: python server-cors | |
''' | |
import http.server as httpserver | |
class CORSHTTPRequestHandler(httpserver.SimpleHTTPRequestHandler): | |
def send_head(self): | |
"""Common code for GET and HEAD commands. |
OlderNewer