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 pytest | |
| import moto | |
| from mock import mock, patch | |
| from moto import mock_lambda | |
| @pytest.fixture(scope='function') | |
| def aws_credentials(): | |
| """Mocked AWS Credentials for moto.""" |
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 os | |
| import time | |
| import asyncio | |
| import aiobotocore | |
| import aiofiles | |
| AWS_ACCESS_KEY_ID = '' # aws access key | |
| AWS_SECRET_ACCESS_KEY = '' # aws secret key | |
| READ_TIMEOUT = 500 |
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 asyncio | |
| import os | |
| from aiohttp import web | |
| from aiohttp import streamer | |
| @streamer | |
| async def file_sender(writer, file_path=None): | |
| """ |
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
| #!/usr/bin/env python3 | |
| """ | |
| credit: @gist.github.com/motebaya | |
| File: bar.py | |
| Size: 2116 Blocks: 8 IO Block: 4096 regular file | |
| Device: 18374h/89408d Inode: 243436 Links: 1 | |
| Access: (0777/-rwxrwxrwx) Uid: ( 1000/ mochino) Gid: ( 1000/ mochino) | |
| Access: 2023-06-21 01:55:32.428195500 +0700 | |
| Modify: 2023-06-21 01:55:32.353622000 +0700 | |
| Change: 2023-06-21 01:55:32.353622000 +0700 |
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 os | |
| import asyncio | |
| import aiohttp # pip install aiohttp | |
| import aiofile # pip install aiofile | |
| REPORTS_FOLDER = "reports" | |
| FILES_PATH = os.path.join(REPORTS_FOLDER, "files") | |
| def download_files_from_report(urls): |
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
| #!/usr/bin/env python3 | |
| # See https://gist.github.com/teasherm/bb73f21ed2f3b46bc1c2ca48ec2c1cf5 | |
| import argparse | |
| import os | |
| import boto3 | |
| class S3MultipartUpload(object): | |
| # AWS throws EntityTooSmall error for parts smaller than 5 MB |
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 argparse | |
| import os | |
| import boto3 | |
| class S3MultipartUpload(object): | |
| # AWS throws EntityTooSmall error for parts smaller than 5 MB | |
| PART_MINIMUM = int(5e6) |
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
| # Details https://skonik.me/uploading-large-file-to-s3-using-aiobotocore/ | |
| import asyncio | |
| import math | |
| import os | |
| import aiobotocore | |
| import aiofiles | |
| AWS_S3_HOST = 'http://localhost:9000' | |
| AWS_SECRET_ACCESS_KEY = 'SECRET_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
| # --- BaseSpace CLI Installation: | |
| # Mac: | |
| # brew tap basespace/basespace && brew install bs-cli | |
| # | |
| # Linux: | |
| # Download the following and then `chmod u+x` to make the file executable: | |
| # https://bintray.com/basespace/BaseSpaceCLI-EarlyAccess-BIN/latest/1.3.1#files/latest%2F1.3.1%2Famd64-linux | |
| # * Make sure the executable is in a directory in the PATH variable, e.g. add `export PATH=$PATH:/directory/with/executable` to $HOME/.bashrc | |
| # --- BaseSpace CLI Examples: |