Skip to content

Instantly share code, notes, and snippets.

View chr5tphr's full-sized avatar

Christopher chr5tphr

  • Technically a University in Berlin
  • There's no place like 0x7f000001
View GitHub Profile
@chr5tphr
chr5tphr / cudamemstat.c
Last active February 9, 2022 10:33
Print CUDA-info in JSON using the Nvidia Management Library (NVML) to avoid parsing of nvidia-smi
#include <stdio.h>
#include <unistd.h>
#include <sys/stat.h>
#include <nvml.h>
#include <time.h>
#define MAXINFO 32
#define MAXCBUF 64
// compile with:
@chr5tphr
chr5tphr / bcrypt.py
Created May 9, 2018 20:20
CLI to hash passwords using bcrypt
#!/usr/bin/env python3
from getpass import getpass
from bcrypt import gensalt, hashpw
from argparse import ArgumentParser
parser = ArgumentParser()
parser.add_argument('-r', '--rounds', type=int, default=12)
parser.add_argument('-p', '--prefix', default='2b')