Skip to content

Instantly share code, notes, and snippets.

View cdgraff's full-sized avatar

AlejandroF cdgraff

View GitHub Profile
@cdgraff
cdgraff / livestreammonitor.py
Created August 12, 2022 02:16 — forked from sinkers/livestreammonitor.py
Script for live video streaming monitoring with notifications
#!/usr/bin/python
'''
Script to monitor live streams and send an Amazon SNS if the stream is down (and possibly take restorative action)
Future:
Black detect: ffmpeg -i out.mp4 -vf blackdetect -f null -
Note the following doesn't seem to fully work without looking at the debug logs
On live ffmpeg -y -i rtmp://cp30129.live.edgefcs.net/live/videoops-videoops@50541 -vf blackdetect -t 10 -loglevel debug -f null -
'''
@cdgraff
cdgraff / check.liq
Created March 6, 2022 19:48 — forked from giflw/check.liq
Playlist check function used with the logs in Liquidsoap
set("log.file.path", "/tmp/test.log")
set("server.socket.path","/tmp/<script>.sock")
set("server.socket",true)
# Simple check function to match any "Finished with ...." line in the logs
def checker(n)
# get info from upcoming request
m = request.metadata(n)
# command to find if the file was played according to the log
command = 'grep -F'
$ git clone -b 1.23 https://github.com/crosstool-ng/crosstool-ng.git
$ cd crosstool-ng
$ ./bootstrap
$ ./configure --prefix=/usr/local
$ make
$ sudo make install
$ cd ..
$ mkdir ctng
$ ct-ng menuconfig
@cdgraff
cdgraff / gist:654d839f455e8f838c997fce2eb60cc7
Created March 8, 2018 18:11 — forked from sgergely/gist:3793166
Midnight Commander Keyboard Shortcuts for Mac OSX
----- Esc -----
Quick change directory: Esc + c
Quick change directory history: Esc + c and then Esc + h
Quick change directory previous entry: Esc + c and then Esc + p
Command line history: Esc + h
Command line previous command: Esc + p
View change: Esc + t (each time you do this shortcut a new directory view will appear)
Print current working directory in command line: Esc + a
Switch between background command line and MC: Ctrl + o
Search/Go to directory in active panel: Esc + s / Ctrl + s then start typing directory name
rtl_fm, a simple narrow band FM demodulator for RTL2832 based DVB-T receivers
Use: rtl_fm -f freq [-options] [filename]
-f frequency_to_tune_to [Hz]
use multiple -f for scanning (requires squelch)
ranges supported, -f 118M:137M:25k
[-M modulation (default: fm)]
fm, wbfm, raw, am, usb, lsb
wbfm == -M fm -s 170k -o 4 -A fast -r 32k -l 0 -E deemp
raw mode outputs 2x16 bit IQ pairs
kubectl get pods | grep Evicted | awk '{print $1}' | xargs kubectl delete pod
@cdgraff
cdgraff / install.md
Last active January 7, 2018 03:30 — forked from floehopper/install.md
Install rtl-sdr on Raspian on Raspberry Pi
jamesmead@floehopper.local:~$ sudo dd bs=1m if=/Users/jamesmead/Downloads/2015-02-16-raspbian-wheezy.img of=/dev/disk2
pi@raspberrypi ~ $ sudo raspi-config
# Choose option 1 to "Expand Filesystem" - Ensures that all of the SD card storage is available to the OS
# Choose Finish & reboot

pi@raspberrypi ~ $ sudo apt-get update
@cdgraff
cdgraff / gist:0c4b699ef84b8436bf3cd2919862a6f1
Created November 23, 2017 20:14 — forked from kurokikaze/gist:350fe1713591641b3b42
install chrome from powershell
(new-object System.Net.WebClient).DownloadFile('http://dl.google.com/chrome/install/375.126/chrome_installer.exe', 'c:/temp/chrome.exe');. c:/temp/chrome.exe /silent /install;rm c:/temp -rec
@cdgraff
cdgraff / AWS Swarm cluster.md
Created April 2, 2017 00:20 — forked from ghoranyi/AWS Swarm cluster.md
Create a Docker 1.12 Swarm cluster on AWS

This gist will drive you through creating a Docker 1.12 Swarm cluster (with Swarm mode) on AWS infrastructure.

Prerequisites

You need a few things already prepared in order to get started. You need at least Docker 1.12 set up. I was using the stable version of Docker for mac for preparing this guide.

$ docker --version
Docker version 1.12.0, build 8eab29e

You also need Docker machine installed.

@cdgraff
cdgraff / audioAds.xml
Last active July 20, 2016 05:36 — forked from KelvinJin/audioAds.xml
The xml file for audio ads. VAST format.
<VAST xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" version="2.0">
<Ad id="2967">
<InLine>
<AdSystem>Mixberry Media</AdSystem>
<Impression>
http://imp.mixberrymedia.com/impressions/capture?parameters=4UV3V8gq_qFhxdSloAjDv2sFtu6uQta0vRQG7haMxCYjgvBFmZx0vphz4-SbbX4KW6OMs9BvMUaEBoSltBh1ETMvRb8qAj_w0vIRlPyNwm35i1v9AFfhz-U2joq7A1bT
</Impression>
<Creatives>
<Creative AdID="2967">
<Linear>