Skip to content

Instantly share code, notes, and snippets.

View esonderegger's full-sized avatar

Evan Sonderegger esonderegger

View GitHub Profile
@esonderegger
esonderegger / pod_alarm.py
Created January 31, 2019 03:06
Script for downloading the latest episode of NPR's "Up First" podcast and playing it on a Raspberry Pi
import feedparser
from urllib import urlretrieve
import subprocess
upfirst = 'https://www.npr.org/rss/podcast.php?id=510318'
feed = feedparser.parse(upfirst)
href = feed.entries[0].links[0].href
urlretrieve(href, '/home/pi/upfirst.mp3')
p = subprocess.call(['mpg123', '/home/pi/upfirst.mp3'])
@esonderegger
esonderegger / webcam.sh
Created August 19, 2018 22:53
Blackmagic webcam
# still has buffer overrun issues
pactl load-module module-pipe-source source_name=virtmic file=/home/evan/nullaudio/virtmic format=s16le rate=48000 channels=1
sudo modprobe v4l2loopback
./ffmpeg -y -format_code hp59 -f decklink -i 'DeckLink SDI' \
-vn -f s16le -ar 48000 -ac 1 /home/evan/nullaudio/virtmic \
-pix_fmt yuv420p -s 1280x720 -r 60000/1001 -timestamps abs -f v4l2 /dev/video0
@esonderegger
esonderegger / gist:bff60196e4d1f8324c71b12963129bf4
Created July 9, 2018 00:59
ffmpeg commands for decklink to v4l2loopback
sudo modprobe v4l2loopback
ffmpeg -y -format_code Hp25 -f decklink -i 'DeckLink SDI' -pix_fmt yuyv422 -timestamps abs -f v4l2 /dev/video0
@esonderegger
esonderegger / janus-install.sh
Created February 16, 2018 19:22
Janus installation script
apt-get update
apt install -y nginx letsencrypt libmicrohttpd-dev libjansson-dev libnice-dev libssl-dev libsofia-sip-ua-dev libglib2.0-dev libopus-dev libogg-dev libcurl4-openssl-dev pkg-config gengetopt libtool automake
wget https://github.com/cisco/libsrtp/archive/v2.1.0.tar.gz
tar xfv v2.1.0.tar.gz
cd libsrtp-2.1.0
./configure --prefix=/usr --enable-openssl
make shared_library && sudo make install
cd ..
git clone https://github.com/meetecho/janus-gateway.git
cd janus-gateway

Keybase proof

I hereby claim:

  • I am esonderegger on github.
  • I am esonderegger (https://keybase.io/esonderegger) on keybase.
  • I have a public key whose fingerprint is 4D2A EE95 4E21 4E7D 8C5E 668C 5395 2486 D0EE B5B5

To claim this, I am signing this object:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>CORS Demo</title>
</head>
<body>
<h1>Affordable Care Act Votes</h1>
<button id="httpWithCors">HTTP with CORS enabled</button>
<button id="httpNoCors">HTTP with CORS disabled</button>
{
"bill": {
"congress": 111,
"number": 3590,
"title": "An act entitled The Patient Protection and Affordable Care Act.",
"type": "hr"
},
"category": "passage",
"chamber": "s",
"congress": 111,
@esonderegger
esonderegger / 2012-04-07-sample-001.html
Created April 8, 2012 02:37
Modal photo gallery for Bootstrap and Jekyll
---
layout: modalPhoto
category: photo-sample
title: Sample Title
name: sample-1
caption: This is a sample photo.
largeImage: /photography/other/large/sample-1.jpg
thumbImage: /photography/other/thumb/sample-thumb-1.jpg
previousPhoto: other-5
nextPhoto: other-2