This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # This script enumerates current GPUs and Docker containers, matches running compute processes to the GPU they run on, and prints a tabular summary including the process ID, owner, memory usage, and the container context (container ID, name, and image) when available. Enables diagnosing GPU-accelerated workloads and their container associations. Copy to /usr/local/bin/gpu2container and make it executable. | |
| set -euo pipefail | |
| CMDLEN="${GPU2CONTAINER_CMDLEN:-140}" # override via env var if desired | |
| command -v nvidia-smi >/dev/null || { echo "ERROR: nvidia-smi not found"; exit 1 | |
| ; } | |
| command -v docker >/dev/null || { echo "ERROR: docker not found"; exit 1; } | |
| command -v column >/dev/null || { echo "ERROR: column not found (util-linux)"; e |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Replace lowercase in title, journal and booktitle in BibTeX entries with titlecase | |
| e.g., 'The greatest title of the all time' to 'The Greatest Title of All Time'. | |
| Extends https://www.dlgreenwald.com/miscellanea/capitalizing-titles-in-bibtex | |
| to process all *.bib files in a directory recursively. | |
| """ | |
| import shutil | |
| import regex as re |