Skip to content

Instantly share code, notes, and snippets.

View satendrakumar's full-sized avatar
:octocat:

Satendra Kumar satendrakumar

:octocat:
View GitHub Profile
@satendrakumar
satendrakumar / vLLM-non_root.md
Last active August 7, 2025 10:45
NON ROOT vLLM Docker Image

Dockerfile

FROM vllm/vllm-openai:v0.9.1

ENV PYTHONUNBUFFERED=1
ENV HF_HUB_CACHE=/api/models
ENV HF_HOME=/api/models

RUN mkdir -p /api/models/
@satendrakumar
satendrakumar / Jupyter-docker
Created February 28, 2025 06:05
Jupyter notebook docker with cuda library
docker run --name notebook --gpus all -d -it -p 80:8888 -v $(pwd):/home/jovyan/work -e GRANT_SUDO=no -e JUPYTER_ENABLE_LAB=yes --user root cschranz/gpu-jupyter:v1.8_cuda-12.5_ubuntu-22.04
@satendrakumar
satendrakumar / FastAPI-on-AWS-Lambda.md
Last active August 7, 2025 10:46
FAST API on AWS Lambda

Deploying a FastAPI app on AWS Lambda using AWS SAM

Step 1: Initialize a SAM Project

Create a new SAM project:

     sam init --runtime python3.11 --name fastapi-lambda
     Choose the Quick Start: Hello World Example template.
     Delete the default app.py and create your FastAPI app

Step 2: Create FastAPI App with Mangum

FastAPI requires an ASGI adapter to work with AWS Lambda. Use Mangum to bridge FastAPI and Lambda.

@satendrakumar
satendrakumar / gist:072e6f4d93cd74b877e8df5478806003
Created January 20, 2025 09:18
Set env variables into current shell
set -a; source .env; set +a
@satendrakumar
satendrakumar / AWS EBS mounting
Last active August 7, 2025 10:47
EBS mounting
#https://docs.aws.amazon.com/ebs/latest/userguide/ebs-using-volumes.html
df -h
lsblk
sudo mkfs -t xfs /dev/nvme1n1
sudo mkdir /workspace
sudo mount /dev/nvme1n1 /workspace
sudo cp /etc/fstab /etc/fstab.orig
sudo blkid
sudo vi /etc/fstab # copy UUID=4df3dee6-594c-4e9e-96ab-bd3a201a46b8 /workspace xfs defaults,nofail 0 2
@satendrakumar
satendrakumar / Nvidia-Cuda-and-docker-installation-on-ubuntu
Last active August 7, 2025 10:47
Nvidia and docker installation on ubuntu
Install the NVIDIA driver:
sudo apt-get install linux-headers-$(uname -r)
distribution=$(. /etc/os-release;echo $ID$VERSION_ID | sed -e 's/\.//g')
wget https://developer.download.nvidia.com/compute/cuda/repos/$distribution/x86_64/cuda-keyring_1.0-1_all.deb
sudo dpkg -i cuda-keyring_1.0-1_all.deb
sudo apt update
sudo apt-get -y install cuda-drivers
Install Docker:
sudo apt-get install ca-certificates curl
@satendrakumar
satendrakumar / app.py
Created October 3, 2023 10:37 — forked from btotharye/app.py
AWS CDK ECS Fargate with ALB and VPC Flow Logs Including Cloudwatch logs for ECS - Locked down to custom peer IP
from aws_cdk import (
aws_ec2 as ec2,
aws_ecs as ecs,
aws_iam as iam,
aws_logs as logs,
aws_elasticloadbalancingv2 as elbv2,
core,
)
apiVersion: druid.apache.org/v1alpha1
kind: Druid
metadata:
name: cluster
spec:
commonConfigMountPath: /opt/druid/conf/druid/cluster/_common
rollingDeploy: true
image: "apache/druid:0.19.0"
startScript: /druid.sh
log4j.config: |-
@satendrakumar
satendrakumar / s3_utils.py
Last active November 8, 2018 12:58
Upload and download from/to S3 using boto3 Api
import boto3
s3 = boto3.resource('s3')
def download(bucket_name, key, filePath):
try:
s3.meta.client.download_file(bucket_name, key, filePath)
except ValueError as err:
print('Error:', err)
@satendrakumar
satendrakumar / Authentication.scala
Created January 17, 2018 10:03 — forked from ian-kent/Authentication.scala
Akka based authentication and authorisation for Play Framework
package wrappers
import play.api._
import play.api.mvc._
import scala.concurrent._
import scala.concurrent.Future
import play.mvc.Http.Status
import ExecutionContext.Implicits.global
import play.libs.Akka
import akka.actor.{Actor, Props}