This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{'': [{'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}}]} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db.QRGs.createIndex( { manufacturer: 1, terminalType: 1, productNumber: 1, version: 1 }, { unique: true } ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Amanuel's Bio</title> | |
</head> | |
<body> | |
<div> |