This file contains 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
#!/bin/bash | |
# Prerequisites: curl, jq, termgraph | |
curl 'https://wabi-us-gov-virginia-api.analysis.usgovcloudapi.net/public/reports/querydata?synchronous=true' \ | |
--data-raw '{"version":"1.0.0","queries":[{"Query":{"Commands":[{"SemanticQueryDataShapeCommand":{"Query":{"Version":2,"From":[{"Name":"c","Entity":"cases_date","Type":0}],"Select":[{"Column":{"Expression":{"SourceRef":{"Source":"c"}},"Property":"Date"},"Name":"cases_date.Date"},{"Aggregation":{"Expression":{"Column":{"Expression":{"SourceRef":{"Source":"c"}},"Property":"New_cases"}},"Function":0},"Name":"Sum(cases_date.New_cases)"},{"Aggregation":{"Expression":{"Column":{"Expression":{"SourceRef":{"Source":"c"}},"Property":"New_cases_7davg"}},"Function":0},"Name":"Sum(cases_date.New_cases_7davg)"}]},"Binding":{"Primary":{"Groupings":[{"Projections":[0,1,2]}]},"DataReduction":{"DataVolume":4,"Primary":{"Sample":{}}},"Version":1}}}]},"QueryId":""}],"cancelQueries":[],"modelId":344055}' \ | |
--compressed | jq '.results[0].result.data.dsr.DS[0].PH[0].D |
This file contains 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/python | |
# | |
# Pre-push hook which aborts the push if it does not find current user's username in the remote path. | |
# To set up, copy into a folder of git hooks and mark as executable. To apply globally (starting with Git v2.9) | |
# use: | |
# git config --global core.hooksPath=/path/to/hooks | |
import sys | |
import getpass |
This file contains 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 pickle, os, sys, logging | |
from httplib import HTTPConnection, socket | |
from smtplib import SMTP | |
import pynotify | |
import time | |
pynotify.init("Monitoring") | |
def show_message(message): | |
n = pynotify.Notification("Status", message) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
from fexpect import expect, expecting, run, sudo |
This file contains 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 re | |
def parse_lonlat(coord): | |
""" Pass in string in degrees like "( 24d37'55.25\"W, 73d42'10.75\"S)" | |
Returns decimal tuple (lon, lat) | |
""" | |
latlon_regex = r"\(\s*(\d+)d(\d+)'([\d.]+)\"([WE]),\s*(\d+)d(\d+)'([\d.]+)\"([NS])\s*\)" | |
m = re.match(latlon_regex, coord) | |
parts = m.groups() | |
lat = int(parts[0]) + float(parts[1]) / 60 + float(parts[2]) / 3600 |