Skip to content

Instantly share code, notes, and snippets.

View anjilinux's full-sized avatar
💭
Hi this is ANJIREDDY

ANJIREDDY -Architect - AI-ML [ BNYMELLON.COM -PUNE] anjilinux

💭
Hi this is ANJIREDDY
View GitHub Profile
@anjilinux
anjilinux / train.py
Created July 8, 2025 11:51 — forked from xaviervasques/train.py
Build and Run a Docker Container for your Machine Learning Model (train.py - code 8)
#!/usr/bin/python3
# train.py
# Xavier Vasques 13/04/2021
import platform; print(platform.platform())
import sys; print("Python", sys.version)
import numpy; print("NumPy", numpy.__version__)
import scipy; print("SciPy", scipy.__version__)
import os
@anjilinux
anjilinux / Dockerfile
Created July 7, 2025 16:10 — forked from hidetatz/Dockerfile
Docker + Pytorch + Python3.11.6 + Poetry environment
FROM nvidia/cuda:11.8.0-cudnn8-devel-ubuntu20.04
ENV NVIDIA_VISIBLE_DEVICES=all
ENV NVIDIA_DRIVER_CAPABILITIES=all
ENV DEBIAN_FRONTEND=noninteractive
# configure locale
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
@anjilinux
anjilinux / Dockerfile
Created July 7, 2025 15:22 — forked from kamwoh/Dockerfile
My dockerfile for pytorch
FROM pytorch/pytorch:1.9.0-cuda11.1-cudnn8-devel
RUN apt-get update & apt-get -y install bc unzip git htop vim ffmpeg libsm6 libxext6 libgl1-mesa-glx
RUN pip install jupyterlab
RUN pip install matplotlib
RUN pip install opencv-python
RUN pip install scikit-image
RUN pip install scikit-learn
RUN pip install seaborn
@anjilinux
anjilinux / gist:62f2ff37613e85c41400561e1aa84e16
Created July 7, 2025 15:20 — forked from stonehye/gist:56de90d54a915e23b3202a77bebe2c56
Dockerfile - pytorch-ubuntu16.04 with only pip (without conda)
FROM nvidia/cuda:9.0-cudnn7-devel-ubuntu16.04
RUN apt-get update && apt-get -y upgrade
RUN apt-get install -y --no-install-recommends git wget
RUN apt-get install -y software-properties-common vim ssh
RUN apt-get install -y python3
RUN apt-get install -y python3-dev python3-pip build-essential
@anjilinux
anjilinux / DiskCheck.sh
Created June 11, 2024 09:27 — forked from tedheich/DiskCheck.sh
How to check disk level in Linux and mail an alert
ADMIN="[email protected]"
# set alert-level 90 % standard
ALERT=10
df -h | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{ print $5 " " $6 }' | while read output;
do
usep=$(echo $output | awk '{ print $1}' | cut -d'%' -f1 )
partition=$(echo $output | awk '{ print $2 }' )
if [ $usep -ge $ALERT ]; then
echo "space low on \"$partition ($usep%)\", on server $(hostname) at $(date)" |
mail -s "Alert: Free space low, $usep % used on $partition" $ADMIN
@anjilinux
anjilinux / alert_disk_space.sh
Created June 11, 2024 09:25 — forked from troygnichols/alert_disk_space.sh
Check disk space, send email when low. Put this in a cron job.
#!/bin/sh
[email protected] [email protected]
df -H | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{ print $5 " " $1 }' | while
read output;
do
echo $output
usep=$(echo $output | awk '{ print $1}' | cut -d'%' -f1 )
parition=$(echo $output | awk '{ print $2 }' )
if [ $usep -ge 75 ]; then
@anjilinux
anjilinux / gist:c23cfc76d41867bd3201026f2d689d9f
Created June 11, 2024 09:24 — forked from fduran/gist:1870429
Linux disk space email alert
#!/bin/bash
# www.fduran.com
# script that will send an email to EMAIL when disk use in partition PART is bigger than %MAX
# adapt these 3 parameters to your case
MAX=95
[email protected]
PART=sda1
USE=`df -h |grep $PART | awk '{ print $5 }' | cut -d'%' -f1`
if [ $USE -gt $MAX ]; then
@anjilinux
anjilinux / disk-usage-alert.sh
Created June 11, 2024 09:18 — forked from M1ke/disk-usage-alert.sh
A shell script to check your disk usage and alert you if it hits a limit. Change the value (percentage) in the "if" statement on line 7 to alter the threshold. Change the email address to your email address. See readme for mail.cf instructions and crontab.
#!/bin/sh
df -H | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{ print $5 " " $1 }' | while read output;
do
echo $output
used=$(echo $output | awk '{ print $1}' | cut -d'%' -f1 )
partition=$(echo $output | awk '{ print $2 }' )
if [ $usep -ge 80 ]; then
echo "The partition \"$partition\" on $(hostname) has used $used% at $(date)" | mail -s "Disk space alert: $used% used" [email protected]
fi
done
@anjilinux
anjilinux / Dockerfile1
Created April 9, 2024 05:20 — forked from xeoncross/Dockerfile1
Examples of using multi-stage builds with docker and Go to reduce the final image size / attack surface.
# Sample from @citizen428 https://dev.to/citizen428/comment/6cmh
FROM golang:alpine as build
RUN apk add --no-cache ca-certificates
WORKDIR /build
ADD . .
RUN CGO_ENABLED=0 GOOS=linux \
go build -ldflags '-extldflags "-static"' -o app
FROM scratch
COPY --from=build /etc/ssl/certs/ca-certificates.crt \
@anjilinux
anjilinux / Dockerfile
Created April 6, 2024 13:52 — forked from nandanrao/Dockerfile
Multi-stage build Dockerfile for Go and Kafka with confluent-kafka-go and Alpine
FROM golang:alpine AS build
RUN sed -i -e 's/v[[:digit:]]\..*\//edge\//g' /etc/apk/repositories
RUN apk upgrade --update-cache --available
RUN apk add --no-cache \
gcc \
libc-dev \
librdkafka-dev=1.3.0-r0 \
pkgconf
RUN mkdir /app
WORKDIR /app