Skip to content

Instantly share code, notes, and snippets.

View pastewka's full-sized avatar

Lars Pastewka pastewka

View GitHub Profile
@pastewka
pastewka / matplotlibrc
Last active September 21, 2016 13:49
My matplotlibrc
# Place in $HOME/.config/matplotlib/matplotlibrc
backend : Qt4Agg
font.family : sans-serif
font.sans-serif : Arial Unicode MS
font.size : 10.0
svg.fonttype : none
xtick.labelsize : 8 # fontsize of the tick labels
ytick.labelsize : 8 # fontsize of the tick labels
pdf.fonttype : 42 # Output Type 3 (Type3) or Type 42 (TrueType)
legend.frameon : False
@pastewka
pastewka / cuda_idle.c
Last active July 6, 2026 20:24
Print a list of free CUDA devices on screen. This is useful to select a free GPU in a job submission script.
/*
* cuda_idle.c — print the index of each GPU with no compute process running.
*
* Build: gcc -O2 -Wall -o gpu_idle gpu_idle.c -I/usr/local/cuda/include -lnvidia-ml
*
* MIT License
*
* Copyright (c) 2013-2026 Lars Pastewka
*
* Permission is hereby granted, free of charge, to any person obtaining a copy