Skip to content

Instantly share code, notes, and snippets.

View mikerenfro's full-sized avatar

Mike Renfro mikerenfro

View GitHub Profile
@mikerenfro
mikerenfro / Vagrantfile
Last active October 27, 2021 14:56
Vagrantfile for building Docker images and converting them to Singularity
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
# EPEL has a fairly recent Singularity, no need to build from source
# Geerling's box uses LVM, so its root filesystem can be expanded
config.vm.box = "geerlingguy/centos7"
config.vm.hostname = "docker-singularity"
# VM specs (200 GB required for Vitis-AI build, others may need more or less)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Dec 9 15:47:44 2018
@author: renfro
"""
from PIL import Image, ImageDraw, ImageFont
@mikerenfro
mikerenfro / job_submit.lua
Last active April 28, 2022 14:42
Newer job_submit.lua
--[[
For use, this script should be copied into a file name "job_submit.lua"
in the same directory as the SLURM configuration file, slurm.conf.
--]]
function fix_undefined_partition(job_desc)
if (job_desc.partition == nil) then
local default_partition = "batch"
job_desc.partition = default_partition
slurm.log_info(
@mikerenfro
mikerenfro / nvidia.sh
Last active May 16, 2020 15:12 — forked from innovia/nvidia.sh
download nvidia drivers and CUDA libs
# This script is built on kops bootstrap
# https://github.com/dcwangmit01/kops/blob/ef958a7f870eb3dc20981617859b8ad69057bb2a/hooks/nvidia-bootstrap/image/run.sh
mkdir nvidia
cd nvidia
DRIVER_VERSION="440.82"
ARCH="Linux-x86_64"
DRIVER_FILE="NVIDIA-${ARCH}-${DRIVER_VERSION}.run"
DRIVER_URL="http://us.download.nvidia.com/XFree86/${ARCH}/${DRIVER_VERSION}/${DRIVER_FILE}"
@mikerenfro
mikerenfro / msys_shellshare.sh
Created April 21, 2020 18:43
Script to download busybox and shellshare for a Windows system running mays (as used in Git bash)
#!/bin/bash
#
# if file is accessible from the web:
# /bin/bash -c "$(curl -fsSL https://location.to/file/get_shellshare)"
pushd () {
command pushd "$@" > /dev/null
}
popd () {
#!/bin/bash
if [ "${USER}" == "root" ]; then
USERNAME=$1
else
USERNAME=$USER
fi
REQUESTED=525600000
JOBID=""
# Identify smallest blocked job, it should be the next one to start
@mikerenfro
mikerenfro / job_submit.lua
Created October 15, 2018 20:46
job_submit.lua (routes based off gres and cpus per node)
--[[
For use, this script should be copied into a file name "job_submit.lua"
in the same directory as the SLURM configuration file, slurm.conf.
--]]
function slurm_job_submit(job_desc, part_list, submit_uid)
test_enabled = (submit_uid == __ENTER_UID_HERE__) -- user is 'renfro'
-- test_enabled = false
if (test_enabled) then