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
# An example for a config file which a developer might while work. | |
# It allows the developer to have 1 user in 1 AWWS Account, | |
# and access multiple other accounts (which exist for different environments). | |
# The access to different environment is being done with AssumeRole protected with MFA. | |
# The `credential_process` allows simple usage of this config file by `aws --profile john` | |
# or IDEs, and in this example the session tokens for each profile will be returned from | |
# aws-vault which stores the long-lived credentials in a secure keychain. | |
[default] | |
region=us-east-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
"""A python example which shows the time complexity of the counting sort algorithm (O(n + k)). | |
The final output is a table showing the execution time of the counting sort algorithm for lists of different lengths. | |
Copied from my execution on my machine: | |
524288 (2**19) -> 0.25 | |
1048576 (2**20) -> 0.49 | |
2097152 (2**21) -> 0.92 | |
4194304 (2**22) -> 1.75 | |
8388608 (2**23) -> 3.47 |
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
"""As part of the 'Data Structures and Introduction to Algorithms' course, I was asked to solve the following problem: | |
Write a function that sorts five elements in seven comparisons in the worst case. | |
As I found this problem interesting, I decided to implement it in Python. For better understanding, I recommend | |
reading the answer from the link below, which explains the algorithm. | |
""" | |
import random | |
from typing import 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
name: Secrets trial | |
on: | |
workflow_dispatch: | |
inputs: | |
secrets_list: | |
required: true | |
description: 'List of secrets to pass to action' | |
jobs: | |
tmp-secrets: |
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 datetime | |
import os | |
import requests | |
from github import Github | |
REPO_NAME = 'some-repo' | |
REPO_OWNER = 'some-owner' | |
LAST_WF_DATE_TO_SHOW = datetime.datetime(2023, 7, 2, 9, 11) |
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
# A configured profile can already exist or not. If not, aws-vault will create the profile in `~/.aws/config`. | |
> aws-vault add some-developer | |
Enter Access Key Id: *** | |
Enter Secret Access Key: *** |
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
> aws sts get-session-token | |
{ | |
"Credentials": { | |
"AccessKeyId": "***", | |
"SecretAccessKey": "***", | |
"SessionToken": "***", | |
... | |
} | |
} |
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
> aws-vault exec dev -- aws lambda invoke --function-name some-function --payload '{}' | |
> aws-vault exec staging -- aws lambda list-functions |
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
[default] | |
region = us-east-1 | |
mfa_serial = arn:aws:iam::1000:mfa/some-developer | |
[profile some-developer] | |
Credential_process = aws-vault export --format=json some-developer | |
[profile dev] | |
role_arn = arn:aws:iam::2000:role/Admin | |
source_profile = some-developer |
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
> aws-vault list | |
Profile Credentials Sessions | |
======= =========== ======== | |
default - - | |
some-developer some-developer sts.GetSessionToken:8h29m31s | |
dev - - | |
staging - - | |
prod - - |
NewerOlder