Skip to content

Instantly share code, notes, and snippets.

View qmaruf's full-sized avatar
🤖
Training robot

Quazi Marufur Rahman qmaruf

🤖
Training robot
View GitHub Profile
repos:
- repo: https://github.com/avilaton/add-msg-issue-prefix-hook
rev: v0.0.11
hooks:
- id: add-msg-issue-prefix
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.2.2
hooks:
- id: ruff
args: [--fix, --output-format=full, --show-fixes, --select, I001, --select, F401]
def update_lambda(function_name):
response = lambda_client.update_function_code(
FunctionName=function_name,
ZipFile=open(f'{function_name}.zip', 'rb').read()
)
def lambda_function_exist(function_name):
try:
lambda_client.get_function(FunctionName=function_name)
return True
except lambda_client.exceptions.ResourceNotFoundException:
return False
def create_zip(function_name):
with zipfile.ZipFile(f'{function_name}.zip', 'w') as zf:
zf.write(f'{function_name}.py')
lambda_client = boto3.client('lambda')
parser = argparse.ArgumentParser()
parser.add_argument('--function_name', type=str, required=True)
parser.add_argument('--handler_name', type=str, required=True)
parser.add_argument('--role', type=str, required=True)
args = parser.parse_args()
function_name = args.function_name
handler_name = args.handler_name
role = args.role
from loguru import logger
import boto3
import zipfile
import argparse
def response(event, context):
response = {
"statusCode": 200,
"body": None
}
if event["message"] == "ping":
response["body"] = "pong"
else:
response["body"] = "Unknown message"
return response
def response(event, context):
response = {
"statusCode": 200,
"body": None
}
if event["message"] == "ping":
response["body"] = "pong"
else:
response["body"] = "Unknown message"
return response
sudo bash NVIDIA-Linux-x86_64-465.31.run
sudo dpkg -i libcudnn8_8.2.0.53-1+cuda11.3_amd64.deb
sudo dpkg -i libcudnn8-dev_8.2.0.53-1+cuda11.3_amd64.deb
sudo dpkg -i libcudnn8-samples_8.2.0.53-1+cuda11.3_amd64.deb