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
| #cloud-config | |
| package_update: true | |
| package_upgrade: true | |
| password: root | |
| chpasswd: | |
| expire: false | |
| users: | |
| - name: ubuntu |
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
| export GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1 | |
| export GRPC_PYTHON_BUILD_SYSTEM_ZLIB=1 | |
| pip install grpcio |
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
| # syntax=docker/dockerfile:1 | |
| FROM python:3.8-slim-buster | |
| WORKDIR /app | |
| ENV ACCEPT_EULA=Y | |
| RUN apt-get update -y && apt-get update \ | |
| && apt-get install -y --no-install-recommends curl gcc g++ gnupg unixodbc-dev |
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
| class AttrDict(dict): | |
| def __init__(self, *args, **kwargs): | |
| super(AttrDict, self).__init__(*args, **kwargs) | |
| self.__dict__ = self | |
| config = AttrDict() | |
| # Example | |
| config['name'] |
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 | |
| import logging | |
| from botocore.exceptions import ClientError | |
| class S3Imgs: | |
| def __init__(self, aws_access_key_id, aws_secret_access_key, region_name): | |
| """S3 secrests config. |
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 logging | |
| from http.client import HTTPConnection | |
| def httpclient_logging(): | |
| HTTPConnection.debuglevel = 1 | |
| requests_log = logging.getLogger("urllib3") | |
| requests_log.setLevel(logging.WARNING) |
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 clean_empty_or_none(d): | |
| """ | |
| Clean empty or None values from dict | |
| """ | |
| clean = {} | |
| for k, v in d.items(): | |
| if isinstance(v, dict): | |
| nested = clean_empty_or_none(v) | |
| if len(nested.keys()) > 0: | |
| clean[k] = nested |
NewerOlder