This file contains hidden or 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
| - name: Decode OIDC Token | |
| run: | | |
| # Request the OIDC token | |
| OIDC_TOKEN=$(curl -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" \ | |
| "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=sts.amazonaws.com" | jq -r '.value') | |
| # Decode the JWT (it's base64url encoded) | |
| echo "=== OIDC Token Header ===" | |
| echo $OIDC_TOKEN | cut -d. -f1 | base64 -d 2>/dev/null | jq . |
This file contains hidden or 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
| get the IP addresses of a pod or pods | |
| kubectl get pods [POD] -o=custom-columns=NAME:.metadata.name,PODIP:.status.podIP | |
| get the name of the node a pod is scheduled on | |
| kubectl get pods [POD] -o=custom-columns=name:.metadata.name,node:.spec.nodeName | |
| get the resource requests and limits for a deployment | |
| kubectl get deployment [DEPLOYMENT] -o go-template --template="{{range .spec.template.spec.containers}}{{printf \"%s %s\n\" .name .resources}}{{end}}" | |
| get pods that have a >0 restart count |
This file contains hidden or 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
| import json | |
| import os | |
| from bravado_core.spec import Spec | |
| from bravado_core.validate import validate_object | |
| from yaml import load, Loader, dump, Dumper | |
| def validate_car(car): | |
| validate_object(spec, Car, car) |
This file contains hidden or 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
| import json | |
| import os | |
| import syslog | |
| import validator | |
| from flask import Flask, request, make_response | |
| from jsonschema.exceptions import ValidationError | |
| class BadRequestError(Exception): | |
| """ Signals a malformed request body |
This file contains hidden or 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
| paths: | |
| /swagger: | |
| get: | |
| summary: Return swagger API specification | |
| description: | | |
| Returns the My Cars API spec as a json swagger doc. | |
| tags: | |
| - Meta | |
| responses: | |
| '200': |
This file contains hidden or 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
| Car: | |
| type: object | |
| required: | |
| ... | |
| properties: | |
| ... | |
| registration: | |
| $ref: '#/definitions/Registration' |
This file contains hidden or 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
| definitions: | |
| Registration: | |
| type: object | |
| required: | |
| - state | |
| - plate_number | |
| properties: | |
| state: | |
| type: string | |
| description: Two letter state abbreviation code |
This file contains hidden or 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
| swagger: '2.0' | |
| info: | |
| title: My Cars API | |
| description: Simple API for demonstrating json validation | |
| version: 1.0.0 | |
| host: localhost | |
| schemes: | |
| - http | |
| produces: | |
| - application/json |
This file contains hidden or 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
| import threading | |
| from contextlib import closing | |
| import requests | |
| from Queue import Queue | |
| input_file = u"test_input.txt" | |
| def on_download_complete(url, file_name): |
This file contains hidden or 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
| curl https://raw.githubusercontent.com/docker/docker/master/contrib/check-config.sh | bash | |
| # yes, I know |
NewerOlder