Collection of solutions for streaming via DASH, Dynamic Adaptive Streaming over HTTP, as of November 2014.
Recommended client: Chrome 38
Tool used for encoding live streams: FFmpeg
| import json | |
| import logging | |
| from flask import Flask, g | |
| from flask_oidc import OpenIDConnect | |
| import requests | |
| logging.basicConfig(level=logging.DEBUG) | |
| app = Flask(__name__) |
| # Below are the dependencies required for installing the common combination of numpy, scipy, pandas and matplotlib | |
| # in an Alpine based Docker image. | |
| FROM alpine:3.4 | |
| RUN echo "http://dl-8.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories | |
| RUN apk --no-cache --update-cache add gcc gfortran python python-dev py-pip build-base wget freetype-dev libpng-dev openblas-dev | |
| RUN ln -s /usr/include/locale.h /usr/include/xlocale.h | |
| RUN pip install numpy scipy pandas matplotlib | |
| Question: | |
| . How to run Ansible without specifying the inventory but the host directly? | |
| . Run a playbook or command with arbitrary host not in the inventory hosts list? | |
| . run ansible with arbitrary host/ip without inventory? | |
| Answer: | |
| Surprisingly, the trick is to append a , | |
| The host parameter preceding the , can be either a hostname or an IPv4/v6 address. | |
| ansible all -i example.com, |
| server { | |
| listen 80 default deferred; | |
| server_name myapp.com; | |
| root /var/www/project-folder/; | |
| # Nginx and Angularjs with html mode 5 - https://gist.github.com/cjus/b46a243ba610661a7efb | |
| index index.html; |
| var findFundamentalFreq = function(buffer, sampleRate) { | |
| // We use Autocorrelation to find the fundamental frequency. | |
| // In order to correlate the signal with itself (hence the name of the algorithm), we will check two points 'k' frames away. | |
| // The autocorrelation index will be the average of these products. At the same time, we normalize the values. | |
| // Source: http://www.phy.mty.edu/~suits/autocorrelation.html | |
| // Assuming the sample rate is 48000Hz, a 'k' equal to 1000 would correspond to a 48Hz signal (48000/1000 = 48), | |
| // while a 'k' equal to 8 would correspond to a 6000Hz one, which is enough to cover most (if not all) | |
| // the notes we have in the notes.json file. | |
| var n = 1024, bestR = 0, bestK = -1; |