Skip to content

Instantly share code, notes, and snippets.

@bmweiner
bmweiner / county.txt
Created December 14, 2020 23:31
covid by county
This file has been truncated, but you can view the full file.
Autauga County, AL 1001 Chilton County, AL 1021
Autauga County, AL 1001 Dallas County, AL 1047
Autauga County, AL 1001 Elmore County, AL 1051
Autauga County, AL 1001 Lowndes County, AL 1085
Autauga County, AL 1001 Montgomery County, AL 1101
Baldwin County, AL 1003 Clarke County, AL 1025
Baldwin County, AL 1003 Escambia County, AL 1053
Baldwin County, AL 1003 Mobile County, AL 1097
Baldwin County, AL 1003 Monroe County, AL 1099
Baldwin County, AL 1003 Washington County, AL 1129
# installs home assistant core on raspberry pi
#
# source: https://www.home-assistant.io/docs/installation/raspberry-pi/
#
# pre-requisite
# install Raspberry PI OS
# ssh into pi clone this script and execute
sudo apt-get update
sudo apt-get upgrade -y
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bmweiner
bmweiner / amcrest
Last active November 17, 2018 15:26
# Amcrest API
## change password
http://<server>/cgi-bin/userManager.cgi?action=modifyPassword&name=<username>&pwd=<newPwd>&pwdOld=<oldPwd>
## take snapshot
http://<server>/cgi-bin/snapshot.cgi
@bmweiner
bmweiner / compare_dataframes.ipynb
Last active September 30, 2017 14:21
Compare equality of two pandas dataframes
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bmweiner
bmweiner / array.py
Last active July 21, 2017 20:29
Common routines with numpy
from functools import reduce
import numpy as np
def mor(x):
"""x: iterable of np.array."""
return reduce(np.logical_or, x)
def mand(x):
"""x: iterable of np.array."""
return reduce(np.logical_and, x)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
<title></title>
<style>
html, body, #viewDiv {
padding: 0;
margin: 0;
@bmweiner
bmweiner / ts.r
Last active August 16, 2017 22:20
# Time Series Forecasting in R
## Example Datasets
# R Datasets package (e.g. AirPassengers, austres)
# https://stat.ethz.ch/R-manual/R-devel/library/datasets/html/00Index.html
# Census Time Series
# https://www.census.gov/econ/currentdata/dbsearch
# Data used for this demo:
@bmweiner
bmweiner / sonos_airplay.md
Last active December 30, 2023 19:30
Stream audio to any Sonos component via AirPlay using a Raspberry Pi.

Sonos Airplay

Stream audio to any Sonos component via AirPlay using a Raspberry Pi (Model B, Raspbian Jessie) and the following software:

  • Shairport Sync: configures the Raspberry Pi as an AirPlay audio player.
  • DarkIce: encodes audio received from AirPlay (system audio) and sends it to Icecast2.
  • Icecast2: serves streaming audio from DarkIce at a network URL.