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
| 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
| 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
| 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
| 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
| def reverse_4(s: str) -> str: | |
| return ''.join(reversed(s)) |
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_3(s: str) -> str: | |
| s_list = list(s) | |
| s_list.reverse() | |
| return ''.join(s_list) |
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_2(s: str) -> str: | |
| s_length = len(s) | |
| s_list = list(s) | |
| j = s_length-1 | |
| for i in range(s_length-1): | |
| swap_var = s_list[j] | |
| s_list[j] = s_list[i] | |
| s_list[i] = swap_var | |
| j=j-1 | |
| if (j<i): |
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_1(s: str) -> str: | |
| reversed_output = "" | |
| for c in s: | |
| reversed_output = c + reversed_output | |
| return reversed_output |
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_0(s: str) -> str: | |
| reversed_output = "" | |
| s_length = len(s) | |
| for i in range(s_length-1, 0-1, -1): | |
| reversed_output = reversed_output + s[i] | |
| return reversed_output |