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
| def reverse_5(s: str) -> str: | |
| return s[::-1] |
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 boto3 | |
| def lambda_handler(context, event): | |
| sts = boto3.client('sts') | |
| account_b = sts.assume_role( | |
| RoleArn="arn:aws:iam::222222222222:role/role-on-account-b", | |
| RoleSessionName="test_function" | |
| ) | |
| ACCESS_KEY = account_b['Credentials']['AccessKeyId'] | |
| SECRET_KEY = account_b['Credentials']['SecretAccessKey'] |
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
| boto3.client( | |
| "sts", | |
| region_name="eu-west-2", | |
| endpoint_url="https://sts.eu-west-2.amazonaws.com" | |
| ) |
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
| from flask import Flask, request, jsonify | |
| app = Flask(__name__) | |
| @app.route("/get", methods=["GET"]) | |
| def get(): | |
| response_data = {"parameters": []} | |
| request_args = request.args | |
| for key in request_args: | |
| obj = {"key": request_args.get(key), "value": request_args.getlist(key)} | |
| response_data['parameters'].append(obj) |
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
| fields @timestamp, `annotations.authorization.k8s.io/decision`, user.username, userAgent | |
| | sort @timestamp desc | |
| | filter ispresent(`annotations.authorization.k8s.io/decision`) and `annotations.authorization.k8s.io/decision` != "allow" |
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
| # ~/.zshrc | |
| # Find and set branch name var if in git repository. | |
| function git_branch_name() | |
| { | |
| branch=$(git symbolic-ref HEAD 2> /dev/null | awk 'BEGIN{FS="/"} {print $NF}') | |
| if [[ $branch == "" ]]; | |
| then | |
| : | |
| else |
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
| # ~/.zshrc | |
| # Enabling and setting git info var to be used in prompt config. | |
| autoload -Uz vcs_info | |
| zstyle ':vcs_info:*' enable git svn | |
| # This line obtains information from the vcs. | |
| zstyle ':vcs_info:git*' formats "- (%b) " | |
| precmd() { | |
| vcs_info | |
| } |
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
| apiVersion: v1 | |
| kind: Pod | |
| metadata: | |
| creationTimestamp: null | |
| name: host-docker-internal-demo | |
| spec: | |
| containers: | |
| - image: alpine | |
| name: alpine | |
| command: ["sh"] |
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
| print("Hello World") |
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
| set -eou pipefail | |
| namespace=$1 | |
| if [ -z "$namespace" ] | |
| then | |
| echo "This script requires a namespace argument input. None found. Exiting." | |
| exit 1 | |
| fi | |
| kubectl get namespace $namespace -o json | jq '.spec = {"finalizers":[]}' > rknf_tmp.json | |
| kubectl proxy & | |
| sleep 5 |