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
| ##### for signor | |
| from s3bz.s3bz import S3 | |
| def presign (bucket:str, key:str, expiry:int)->dict: | |
| return S3.presignUpload(bucket=bucket, key = key, expiry = 1000) | |
| ``` | |
| {'url': 'https://inventory-bucket-dev-manual.s3-accelerate.amazonaws.com/', | |
| 'fields': {'key': 'test', |
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
| AWSTemplateFormatVersion: 2010-09-09 | |
| Resources: | |
| CloudFrontCachePolicy: | |
| Type: AWS::CloudFront::CachePolicy | |
| Properties: | |
| CachePolicyConfig: | |
| CachePolicyConfig | |
| cloudfrontdistribution: | |
| Type: AWS::CloudFront::Distribution | |
| Properties: |
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
| Parameters: | |
| BRANCH: | |
| Type: String | |
| Default: dev-blank |
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
| AWSTemplateFormatVersion: '2010-09-09' | |
| Transform: AWS::Serverless-2016-10-31 | |
| Description: > | |
| shortenLink | |
| Sample SAM Template for shortenLink | |
| Globals: | |
| Function: | |
| Timeout: 3 | |
| Runtime: python3.8 |
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
| ProductS3: | |
| Type: AWS::S3::Bucket | |
| Properties: | |
| AccelerateConfiguration: | |
| AccelerationStatus: Enabled | |
| BucketName: !Join [ "-" , ["product-bucket", !Ref BRANCH]] | |
| CorsConfiguration: | |
| CorsRules: | |
| - AllowedMethods: | |
| - GET |
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 | |
| from botocore.exceptions import ClientError | |
| bucket='filtered-df-sagemaker' | |
| s3 = boto3.client('s3') | |
| try: | |
| s3.create_bucket( | |
| Bucket=bucket, | |
| CreateBucketConfiguration={'LocationConstraint':'ap-southeast-1'}) | |
| except ClientError as e: |
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
| AWSTemplateFormatVersion: '2010-09-09' | |
| Description: Cognito Stack | |
| Parameters: | |
| AuthName: | |
| Type: String | |
| Description: Unique Auth Name for Cognito Resources | |
| Resources: | |
| # Creates a role that allows Cognito to send SNS messages | |
| SNSRole: |
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
| https://www.vembu.com/blog/increase-swap-memory-centos-7/ |
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
| AWSTemplateFormatVersion: '2010-09-09' | |
| Transform: AWS::Serverless-2016-10-31 | |
| Description: > | |
| shortenLink | |
| Sample SAM Template for shortenLink | |
| Globals: | |
| Function: | |
| Timeout: 3 | |
| Runtime: python3.8 |
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 pandas as pd | |
| import json | |
| df = pd.DataFrame({'hello':['1','2','2'], 'world':['1','2','3']}) | |
| df | |
| tableDict = df.to_dict(orient='list') | |
| json.dumps(tableDict) |