Skip to content

Instantly share code, notes, and snippets.

View GeekenDev's full-sized avatar

Justin B. Watson GeekenDev

  • Birmingham, Alabama USA
  • X @Geeken
View GitHub Profile
@GeekenDev
GeekenDev / embed.html
Last active March 22, 2022 17:57
brime_embed
<iframe
src="https://player.brime.tv/?channel=churrho"
height="400"
width="800"
frameBorder="0"
allowfullscreen="true"
allow="autoplay">
</iframe>
worker_processes 1; #should be 1 for Windows, for it doesn't support Unix domain socket
#worker_processes auto; #from versions 1.3.8 and 1.2.5
#worker_cpu_affinity 0001 0010 0100 1000; #only available on FreeBSD and Linux
#worker_cpu_affinity auto; #from version 1.9.10
error_log /var/log/nginx/error.log error;
#if the module is compiled as a dynamic module and features relevant
#to RTMP are needed, the command below MUST be specified and MUST be
#!/bin/bash
sudo curl https://gist.githubusercontent.com/geekenMD/7d8a1c5bf242c824fdebbdb5ad5c423a/raw/126faa39260e553d3fb00c74d34bad5e7b0b23ae/webook-start.sh -o /etc/nginx/webook-start.sh
sudo curl https://gist.githubusercontent.com/geekenMD/732582dab5528b45e8573d1b818c0926/raw/caf47725b5a633a3c15c101f8940f4a1dcc25757/webook-stop.sh -o /etc/nginx/webook-stop.sh
sudo curl https://gist.githubusercontent.com/geekenMD/c6b625515e3ba2b75c0a5ab38c0ec37f/raw/3449050f30ec81d6d0610a1decf8deaa62d3b666/vod-processor.sh -o /etc/nginx/vod-processor.sh
sudo curl https://github.com/mutschler/mt/releases/download/1.0.11/mt-1.0.11-linux_amd64.tar.gz -o /etc/nginx/sprite
sudo chown -R nginx:nginx /etc/nginx
@GeekenDev
GeekenDev / vod-processor.sh
Last active July 27, 2021 23:53
vod-processor.sh
#!/bin/bash
channel=$1
dirname=$2
filename=$3
basename=$4
event="vod-ready"
vod_id=$(curl https://internal-api.brime.tv/ID)
# Convert .flv to .mp4
ffmpeg -y -i $dirname/$filename -c copy $dirname/${basename}.mp4 2> ${dirname}/test.txt
@GeekenDev
GeekenDev / webook-stop.sh
Created July 27, 2021 23:39
webook-stop.sh
channel=$1
timestamp="$(date +%s)"
action="stream-stop"
json='{"action":"'"$action"'","channel":"'"$channel"'","timestamp":"'"$timestamp"'"}'
curl -X POST -H "Content-Type: application/json" -d $json https://internal-api.brime.tv/webhook/stream/stop
@GeekenDev
GeekenDev / webook-start.sh
Created July 27, 2021 23:38
webook-start.sh
channel=$1
ip=$2
region=sanjose
ingest_node="sanjose-001"
server="150.230.40.161"
timestamp="$(date +%s)"
action="stream-start"
json='{"action":"'"$action"'","channel":"'"$channel"'","ip":"'"$ip"'","region":"'"$region"'","ingest_node":"'"$ingest_node"'","server_IP":"'"$server"'","timestamp":"'"$timestamp"'"}'
curl -X POST -H "Content-Type: application/json" -d $json https://internal-api.brime.tv/webhook/stream/start
@GeekenDev
GeekenDev / nginx.conf
Created July 27, 2021 22:26
nginx.conf
worker_processes 1; #should be 1 for Windows, for it doesn't support Unix domain socket
#worker_processes auto; #from versions 1.3.8 and 1.2.5
#worker_cpu_affinity 0001 0010 0100 1000; #only available on FreeBSD and Linux
#worker_cpu_affinity auto; #from version 1.9.10
error_log /var/log/nginx/error.log error;
#if the module is compiled as a dynamic module and features relevant
#to RTMP are needed, the command below MUST be specified and MUST be
@GeekenDev
GeekenDev / brime-nginx.sh
Last active July 27, 2021 22:28
brime-nginx.sh
sudo apt update && sudo apt upgrade -y
sudo apt install -y software-properties-common ufw
sudo apt install -y build-essential git tree
wget https://nginx.org/download/nginx-1.19.0.tar.gz && tar zxvf nginx-1.19.0.tar.gz
# PCRE version 8.44
wget https://ftp.pcre.org/pub/pcre/pcre-8.44.tar.gz && tar xzvf pcre-8.44.tar.gz
@GeekenDev
GeekenDev / nginx
Created July 27, 2021 22:13
nginx
/var/log/nginx/*.log {
daily
missingok
rotate 52
compress
delaycompress
notifempty
create 640 nginx adm
sharedscripts
postrotate
@GeekenDev
GeekenDev / nginx.service
Created July 27, 2021 22:10
nginx.service
[Unit]
Description=nginx - high performance web server
Documentation=https://nginx.org/en/docs/
After=network-online.target remote-fs.target nss-lookup.target
Wants=network-online.target
[Service]
Type=forking
PIDFile=/var/run/nginx.pid
ExecStartPre=/usr/sbin/nginx -t -c /etc/nginx/nginx.conf