Skip to content

Instantly share code, notes, and snippets.

View Mohammed-Sunasra's full-sized avatar

Mohammed Sunasra Mohammed-Sunasra

View GitHub Profile
@Mohammed-Sunasra
Mohammed-Sunasra / docker-compose.yaml
Created September 27, 2022 07:33
Grafana and Prometheus using docker-compose and running behind NGINX reverse proxy
version: '3.8'
services:
prometheus:
image: prom/prometheus
container_name: prometheus
restart: 'no'
volumes:
- prometheus_data:/prometheus
- ./prometheus.yml:/etc/prometheus/prometheus.yml
@Mohammed-Sunasra
Mohammed-Sunasra / dashboard-ingress.yaml
Last active September 16, 2022 09:21
Kubernetes Ingress object exposing mongo-express service and kubernetes dashboard service
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: dashboard-ingress
namespace: kubernetes-dashboard
annotations:
kubernetes.io/ingress.class: "nginx"
spec:
defaultBackend:
service:
@Mohammed-Sunasra
Mohammed-Sunasra / dataset.py
Last active September 16, 2022 09:21
Custom PyTorch Dataset and Data Loader
#Custom data generator class
class CactusDataset(Dataset):
"""
Dataset to generate batches of multiple images and labels from a CSV file.
Purpose: To work with CSV files where the format is (file_name, cclass_label)
and generate batches of data(images, labels) on-the-fly.
"""
def __init__(self, df_data, image_path, image_size, transform=None):
self.data = df_data
self.image_path = image_path
@Mohammed-Sunasra
Mohammed-Sunasra / Makefile
Created January 7, 2019 18:25
Makefile for running jupyter notebook
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
run:
jupyter notebook --port=8080 --no-browser
@Mohammed-Sunasra
Mohammed-Sunasra / supervisor.conf
Created December 30, 2018 07:08
Supervisor Configuration with Conda Python environment
[program:{program_name}]
directory=/home/{project_name}/api/falcon_api/app
environment=PATH=/home/anaconda3/envs/{env_name}/bin
command=/home/anaconda3/envs/{env_name}/bin/gunicorn app:api -b 0.0.0.0
autostart=true
autorestart=true
stderr_logfile=/var/log/{project_name}/{filename}.err.log
stdout_logfile=/var/log/{project_name}/{filename}.out.log
NOTE: