Skip to content

Instantly share code, notes, and snippets.

View lrbison's full-sized avatar

Luke Robison lrbison

  • Nvidia
  • Austin, TX
View GitHub Profile
# Version-specific commands [grumble, grumble]
# See https://stackoverflow.com/questions/35016458
# See: https://github.com/tmux/tmux/blob/master/CHANGES
run-shell 'tmux setenv -g TMUX_VERSION $(tmux -V | \
sed -En "s/^tmux[^0-9]*([.0-9]+).*/\1/p")'
set-environment -g COLORTERM "truecolor"
#set -g default-terminal "screen-256color"
@lrbison
lrbison / malloc_test.c
Last active May 30, 2024 15:27
Test malloc latency behavior for tip-of-stack alloc/free loop
#include <malloc.h>
#include <stdlib.h>
#include <time.h>
#include <inttypes.h>
static void inline tick(struct timespec *tp) {
clock_gettime(CLOCK_MONOTONIC, tp);
}
static double inline tock(struct timespec *tp) {
struct timespec tp2;
@lrbison
lrbison / test_session_scope.py
Created August 1, 2022 14:36
pytests Session Scope
import pytest
import inspect
nfruits = 0
nvegetables = 0
@pytest.fixture(scope="session", params=["apple", "banana", "strawberry"])
def make_fruit(request):
global nfruits
nfruits += 1
@lrbison
lrbison / reserve.sh
Created July 6, 2022 21:56
Reserve Instances with SLURM
#!/bin/bash
#SBATCH --nodes=2
echo "Reserving Nodes"
scontrol show hostname $SLURM_JOB_NODELIST > ~/hostfile.txt
echo "File Written"
sleep 3600
#now: sbatch reserve.sh