Skip to content

Instantly share code, notes, and snippets.

View prerakmody's full-sized avatar
🏠
Working from home

pmod prerakmody

🏠
Working from home
View GitHub Profile
@prerakmody
prerakmody / python.md
Last active December 23, 2025 11:30
Agentic Coding Instructions

General Coding Instructions

  1. Response Structure & Workflow
  • Every response must follow this specific sequence:
    • File Hierarchy: Provide a visual tree of the file structure and a one-line description for each file involved.
    • Class & Inheritance (if applicable): Briefly explain the inheritance structure and how files relate to one another.
    • The Code Implementation: (See "Code Formatting" for style rules).
    • Summary of Changes: A concise list of what was modified or added.
    • Execution Commands: Provide the specific PowerShell command to run the script and a JSON code block for the VSCode launch.json configuration.
  • Agent Learnings: A section titled "Learnings & Improvements" summarizing logic hurdles or prompt refinements for future sessions.
@prerakmody
prerakmody / pyinstaller_sample.py
Created December 22, 2025 08:29
Pyinstaller commands
import os
import subprocess
import sys
import site
import shutil
from pathlib import Path
# Find the Magika models directory
def find_magika_models():
try:
@prerakmody
prerakmody / bashrc
Last active September 16, 2025 12:46
Multiple Conda environments
# >>> conda initialize >>>
CONDA_BASE_PATH="/<path>/to/anaconda3}" # make sure to include ananconda3 or miniconda3 in this path
__conda_setup="$("${CONDA_BASE_PATH}/bin/conda" 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "${CONDA_BASE_PATH}/etc/profile.d/conda.sh" ]; then
. "${CONDA_BASE_PATH}/etc/profile.d/conda.sh"
else
@prerakmody
prerakmody / launch.json
Created July 24, 2025 16:25
VSCode Hacks
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: cupdate",
"type": "debugpy",
"request": "launch",
"python": "C:\\Users\\Prerak\\AppData\\Local\\miniconda3\\python.exe",
"program": "C:\\Users\\Prerak\\Documents\\file.py",
"args": [
  1. 3D Slicer is often installed in C:\Users\<username>\AppData\Local\slicer.org\Slicer.x.y
    • within this folder checkout slicer.org\Slicer-ABCDE (a configuration file)
[Extensions]
LastServerAPI=Girder_v1
ManagerEnabled=true
ServerUrl=https://slicer-packages.kitware.com
FrontendServerUrl=https://extensions.slicer.org
InstallPath=slicer.org/Extensions-33241
@prerakmody
prerakmody / basic-skills.md
Last active August 13, 2025 15:01
Basic MSc internship guidelines
  1. Powershell vs git-bash on windows
    • ls vs dir, ...
  2. Learn unix commands
    • cd, ls, ls -l, .bashrc (for alias), ln -s
  3. Learng git commands
    • git status, git commit, git push, git branch
  4. Learn how to setup SSH keys
    • ssh-keygen, setting keys in web UI of git (github, gitlab, bitbucket etc) system, .ssh/authorized_keys
  5. VSCode/Pycharm setup
  • debugger
@prerakmody
prerakmody / docker.md
Last active June 17, 2025 10:17
Docker + WSL (Windows Subsystem for Linux) Commands
  1. Status/Start/Restart
    • systemctl {status, start, stop, restart} docker.service
  2. Cleanup cache
    • docker system prune -a
  3. Config
    • sudo vim /etc/default/docker
  4. docker0 interface
    • ifconfig | grep docker0 (docker0 is Docker's bridge network)
    • Only if firewalls are installed
  • First: check for all services: sudo systemctl list-units --type=service
@prerakmody
prerakmody / slurm-script.slurm
Last active July 30, 2025 17:25
SLURM Management
#!/bin/bash
#SBATCH --job-name=<script-name>
#SBATCH --partition=highmemgpu
#SBATCH --gres=gpu:1
#SBATCH --nodelist=res-hpc-gpu08
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=11
#SBATCH --mem-per-cpu=8G
#SBATCH --time=14-20:00:00
#SBATCH --mail-type=end
@prerakmody
prerakmody / gping.md
Last active August 7, 2025 12:37
Windows Powershell

1 - Install gping

  1. Launch Powershell in Administrator mode
  2. First install chocolatey
  3. Install gping: choco install gping

1.1 - Sample command

  • gping google.com reddit.com <local-server>

2 - Make it a powershell alias

  1. notepad $PROFILE
@prerakmody
prerakmody / uv-monai-torchsummary.py
Last active January 18, 2025 15:50
UV - fast Python package installer and resolver
"""
>> pip install uv # OR https://docs.astral.sh/uv/getting-started/installation/
>> uv run -p 3.11 uv-monai-torchsummary.py
"""
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "monai==1.3.2",
# "torchsummary==1.5.1",