Skip to content

Instantly share code, notes, and snippets.

View maddox's full-sized avatar

Jon Maddox maddox

View GitHub Profile
@maddox
maddox / switches.yaml
Created September 30, 2016 03:05
MQTT Switches for Harmony Activities for Home Assistant
- switch
- platform: mqtt
name: "TV"
state_topic: "harmony-api/hubs/family-room/state"
command_topic: "harmony-api/hubs/family-room/activities/watch-apple-tv/command"
qos: 0
optimistic: true
payload_on: "on"
payload_off: "off"
- platform: mqtt
@maddox
maddox / switches.yaml
Created November 3, 2016 14:10
HA MQTT Switches for Harmony API
switch:
- platform: mqtt
name: "Family Room TV"
state_topic: "harmony-api/hubs/family-room/state"
command_topic: "harmony-api/hubs/family-room/activities/watch-apple-tv/command"
qos: 0
optimistic: true
payload_on: "on"
payload_off: "off"
- platform: mqtt
@maddox
maddox / README.md
Last active April 8, 2018 01:56
XBMC crashes. Use this. #tvops

Keep XBMC Alive on OS X

XBMC is great, but it kinda randomly crashes a lot. There's nothing worse than turning on your TV and seeing that XBMC isn't running anymore. It's even worse when its your significant other or roomate and you're out of town. #tvops.

So just install this launchd script to keep XBMC always running. This will launch it on boot, and if it crashes, it'll re-launch it.

Install

mkdir ~/Library/LaunchAgents

Subject: I have a questions about Mozilla Rust Seattle Meetup?

Hi Jon

I hope this email finds you well.

Are you in charge of event organization for Mozilla Rust Seattle Meetup? I am not sure if you're the right person to speak with. I was a researcher in computer science in UCSD and started the company to provide a mobile app to make organizers' job easier and more efficient by helping the event run smoother, and giving attendees better networking experiences.

#EXTM3U
#EXT-X-TARGETDURATION:3
#EXT-X-VERSION:3
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-PLAYLIST-TYPE:EVENT
#EXTINF:2.9614,
http://desky.local:9393/fileSequence102.ts
#EXTINF:2.961,
http://desky.local:9393/fileSequence103.ts
#EXTINF:2.961,

This guide is mirrored from http://miro.oorganica.com/raspberry-pi-mpd/ because it's down for me. Instead of relying on Google's cache, I figured I'd just store it here for life.

I’ve just setup MPD (Music Player Daemon) on my Rpi and it works beautifully.

Let get down to it:

Taking advantage of debian APT it is very simple to set it up:

Process: Propane [411]
Path: /Applications/Tools/*/Propane.app/Contents/MacOS/Propane
Identifier: com.protocool.Propane
Version: 1.2.0 (1.2.0.9ec0791)
Code Type: X86 (Native)
Parent Process: launchd [226]
Date/Time: 2012-02-16 20:48:22.577 -0500
OS Version: Mac OS X 10.7.3 (11D50b)
Report Version: 9
@maddox
maddox / server.rb
Last active April 8, 2018 01:56
Just some experimentation in creating a live transcoding HTTP Live Streaming server for accessing an HDHomeRun
ffmpeg -i http://PRIMEIP:5004/auto/v1004 -async 1 -ss 00:00:05 -acodec libfdk_aac -vbr 3 \
-b:v \3000k -ac 2 -vcodec libx264 -preset superfast -tune zerolatency -threads 2 -s 1280x720 \
-flags -global_header -map 0:0 -map 0:1 -f segment -segment_time 10 -segment_list stream.m3u8 \
-segment_format mpegts -segment_wrap 10 -segment_list_size 6 -segment_list_flags live stream%03d.ts
/sbin/ipfw add 100 pipe 1 ip from any 80 to any out
/sbin/ipfw add 200 pipe 2 ip from any 80 to any in
/sbin/ipfw pipe 1 config bw 64Kbit/s queue 64Kbytes delay 250ms
/sbin/ipfw pipe 2 config bw 64Kbit/s queue 64Kbytes delay 250ms
Process: Propane [1522]
Path: /Applications/Tools/*/Propane.app/Contents/MacOS/Propane
Identifier: com.protocool.Propane
Version: 1.2.0 (1.2.0.9ec0791)
Code Type: X86 (Native)
Parent Process: launchd [225]
Date/Time: 2012-02-16 16:58:01.958 -0500
OS Version: Mac OS X 10.7.3 (11D50b)
Report Version: 9