Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python3
"""
Slurm Job Timeline Visualizer
Generates a Gantt chart from sacct output showing job execution and idle periods.
"""
import sys
import argparse
from datetime import datetime
import matplotlib.pyplot as plt
@papamoose
papamoose / sort_sacctmgr_structure.py
Last active December 22, 2025 05:47
Sort sacctmgr lines
#!/usr/bin/env python3
import sys
from collections import defaultdict, OrderedDict
def main():
# Read all lines and track original order
lines = [line.strip() for line in sys.stdin if line.strip()]
# Build hierarchy while preserving order
hierarchy = defaultdict(OrderedDict)
@papamoose
papamoose / pytorch_bench.py
Created October 3, 2025 20:19
pytorch code to make nvidia gpus do work
#!/usr/bin/env python3
"""
pytorch_bench.py – Multi‑GPU stress test with safety checks
Install
-------
python3 -m venv ./venv
python3 -m pip install tqdm
python3 -m pip install torch torchvision --index-url https://download.pytorch.org/whl/cu129
@papamoose
papamoose / vram_test.cu
Last active March 8, 2025 19:53
CUDA GPU VRAM Test
/* Compile in any of the following ways
nvcc vram_test.cu -o vram_test
nvcc -Wno-deprecated-gpu-targets vram_test.cu -o vram_test
nvcc -arch=sm_86 vram_test.cu -o vram_test
nvcc -arch=sm_75 -gencode=arch=compute_86,code=sm_86 vram_test.cu -o vram_test
*/
#include <cuda_runtime.h>
#include <iostream>
#include <cstdlib>
<!-- not working yet -->
<?xml version="1.0"?>
<!DOCTYPE profile>
<profile xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns">
<general t="map">
<mode t="map">
<confirm t="boolean">false</confirm>
</mode>
<self_update config:type="boolean">false</self_update>
</general>
#!/bin/bash
url="https://discord.com/api/download?platform=linux"
remote_version=$(curl -sIL $url | grep location: | cut -d/ -f7 | sed -ne 's/discord-\([0-9.]*\)\.deb/\1/p' | tr -d '\r$')
local_version=$(dpkg-query -W -f'${Version}\n' discord)
rc=$(dpkg --compare-versions "${local_version}" "lt" "${remote_version}"; echo $?)
if [ $rc -eq 0 ]; then
#!/bin/bash
total_rss=0
total_vsz=0
total_size=0
while read -r size rss vsz user command; do
total_rss=$((total_rss+rss))
total_vsz=$((total_vsz+vsz))
total_size=$((total_size+size))
@papamoose
papamoose / One line to rebuild all DKMS modules on Ubuntu
Last active February 4, 2023 19:44 — forked from Brainiarc7/One line to rebuild all DKMS modules on Ubuntu
One line to rebuild all DKMS modules on Ubuntu
#!/bin/bash
ls -d /usr/src/linux-headers-* \
| sed -e 's/.*linux-headers-//' \
| grep generic \
| sort -V \
| tac \
| sudo xargs -n1 /usr/lib/dkms/dkms_autoinstaller start
#!/bin/bash
umask 022
{% if letsencrypt_eab %}
server={{ letsencrypt_server }}
kid={{ letsencrypt_eab_kid }}
hmac={{ letsencrypt_eab_hmac }}
acmeurl={{ letsencrypt_acmeurl }}
{% elif letsencrypt_testmode %}
server=acme-staging-v02.api.letsencrypt.org
@papamoose
papamoose / README.md
Last active February 13, 2022 16:19
RobinLinus-snapdrop using docker-compose and traefik

Assumes you run Traefik.

You need to checkout the repository so you can mount the server and client directories into the container.

git clone https://github.com/RobinLinus/snapdrop.git

Then modify docker-compose.yml and create templates/default.conf.template.