Skip to content

Instantly share code, notes, and snippets.

View amanuel1995's full-sized avatar
👨‍💻
Dealing with issues

Amanuel Goshu amanuel1995

👨‍💻
Dealing with issues
  • 12:22 (UTC -07:00)
View GitHub Profile
@amanuel1995
amanuel1995 / rrdxmlpy3.py
Last active March 27, 2022 13:50 — forked from afternoon/rrdxml.py
Dump RRD XML to CSV
#!/usr/bin/env python
"""Export CSV from an RRD XML dump.
Usage: rrdxml.py file.xml rra
Where rra is the 0-based index for the RRA you want to dump.
"""
from csv import writer
from itertools import chain
@amanuel1995
amanuel1995 / parse_nvidia_smi.py
Created January 17, 2022 06:52 — forked from rueberger/parse_nvidia_smi.py
Simple script that parses and returns the output of nvidia-smi
import commands
import numpy as np
def fetch_gpu_status():
""" Run nvidia-smi and parse the output
requires Python 2 only dependency
"""
status_code, output = commands.getstatusoutput('nvidia-smi')
def is_leap(year):
leap = False
# Write your logic here
# The year can be evenly divided by 4, is a leap year, unless:
# The year can be evenly divided by 100, it is NOT a leap year, unless:
# The year is also evenly divisible by 400. Then it is a leap year.
if year < 100000 and year > 1900:
if year % 4 == 0:
leap = True
{'': [{'amanuel.goshu': {'totPosTime': 0, 'totNegTime': 0}}], '2019-01-04': [{'amanuel.goshu': {'totPosTime': 417400.56000000006, 'totNegTime': 0}}], '2019-01-03': [{'amanuel.goshu': {'totPosTime': 8.02, 'totNegTime': 0}}], '2018-12-28': [{'amanuel.goshu': {'totPosTime': 0.0, 'totNegTime': 0}}], '2018-12-21': [{'amanuel.goshu': {'totPosTime': 10.25, 'totNegTime': 2.0}}]}
db.QRGs.createIndex( { manufacturer: 1, terminalType: 1, productNumber: 1, version: 1 }, { unique: true } )
@amanuel1995
amanuel1995 / index.html
Last active May 22, 2017 20:52 — forked from anonymous/index.html
CAS 204
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Amanuel's Bio</title>
</head>
<body>
<div>