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
@qmaruf
qmaruf / my zshrc
Last active October 31, 2025 17:18
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:$HOME/.local/bin:/usr/local/bin:$PATH
# Path to your Oh My Zsh installation.
export ZSH="$HOME/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time Oh My Zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
sudo apt-get --purge remove "*cublas*" "cuda*" "nsight*"
sudo apt-get --purge remove "*nvidia*"
sudo rm -rf /usr/local/cuda*
sudo apt-get purge nvidia*
sudo apt-get autoremove
sudo apt-get autoclean
sudo rm -rf /usr/local/cuda*
# Installing the driver
sudo apt install libnvidia-common-535
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