Skip to content

Instantly share code, notes, and snippets.

@mariogeiger
mariogeiger / lsgpu
Last active April 25, 2023 09:28
GPU memory and user usage
#!/usr/bin/env /usr/bin/python
# location: ~/.local/bin/lsgpu
import subprocess
import re
# ps -aux
raw_stdout = subprocess.run(["ps", "-aux"], stdout=subprocess.PIPE).stdout.decode(
"utf-8"
)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
from pybtex.database.input import bibtex
import argparse
def main():
args = argparse.ArgumentParser()
args.add_argument("path")
args = args.parse_args()
parser = bibtex.Parser()
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.