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 / 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
Created July 9, 2025 19:05
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-status.sh
Created March 28, 2025 11:37
SLURM Management
#!/bin/bash
# Function to check the status of a service
check_service_status() {
local service=$1
while true; do
sudo systemctl status "$service" --no-pager
if [ $? -eq 0 ]; then
break
fi
@prerakmody
prerakmody / gping.md
Created March 28, 2025 08:48
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",
@prerakmody
prerakmody / dicomweb.json
Created October 28, 2024 09:32
Orthanc config JSONs
{
"DicomWeb" :
{
"Enable" : true, // Whether DICOMweb support is enabled
"Root" : "/dicom-web/", // Root URI of the DICOMweb API (for QIDO-RS, STOW-RS and WADO-RS)
"EnableWado" : true, // Whether WADO-URI (aka. WADO) support is enabled
"WadoRoot" : "/wado", // Root URI of the WADO-URI (aka. WADO) API
"Host" : "localhost:8042", // Hard-codes the name of the host for subsequent WADO-RS requests
"Ssl" : false, // Whether HTTPS should be used for subsequent WADO-RS requests
"Servers" : {
@prerakmody
prerakmody / getContourScribbleForBinarySlice.py
Last active October 27, 2024 16:33
Scribble Generation (in an auto segmentation editing scenario)
import skimage
import skimage.morphology
import voxynth as voxynth # https://github.com/dalcalab/voxynth
import numpy as np
import matplotlib.pyplot as plt
def getContourScribbleForBinarySlice(mask, show=False):
"""
Params
------
@prerakmody
prerakmody / dataloaderCompare.py
Last active June 1, 2024 14:12
TORCH MULTIPROCESSING
import torchDataloader
import myDataloader
import pdb
import copy
import time
import tqdm
import pprint
import traceback
import numpy as np