This example is part of this article.
This is an example for an HLS delivery with basic security. Nginx compiled with nginx-rtmp-module & secure-link is used as media server. Features:
- Domain filtering
- Referrer filtering
- Embed buster
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
{% block head %} | |
{% endblock %} | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"> | |
{% block style %} |
''' | |
Based on https://gist.github.com/enjalot/2904124 (in Python 2) -> quick-migrated to Python 3 | |
Usage: python server-cors | |
''' | |
import http.server as httpserver | |
class CORSHTTPRequestHandler(httpserver.SimpleHTTPRequestHandler): | |
def send_head(self): | |
"""Common code for GET and HEAD commands. |
# input: fullchain.pem and privkey.pem as generated by the "letsencrypt-auto" | |
sudo letsencrypt certonly --standalone | |
sudo su | |
cd /etc/letsencrypt/live/{domain name} | |
# convert certificate chain + private key to the PKCS#12 file format | |
openssl pkcs12 -export -out keystore.pkcs12 -in fullchain.pem -inkey privkey.pem |
# setting up irq affinity according to /proc/interrupts | |
# 2008-11-25 Robert Olsson | |
# 2009-02-19 updated by Jesse Brandeburg | |
# 2012-12-21 fix for systems with >32 cores by Andrey K. | |
# | |
# > Dave Miller: | |
# (To get consistent naming in /proc/interrups) | |
# I would suggest that people use something like: | |
#char buf[IFNAMSIZ+6]; | |
# |
This example is part of this article.
This is an example for an HLS delivery with basic security. Nginx compiled with nginx-rtmp-module & secure-link is used as media server. Features:
/* | |
* Handling Errors using async/await | |
* Has to be used inside an async function | |
*/ | |
try { | |
const response = await axios.get('https://your.site/api/v1/bla/ble/bli'); | |
// Success 🎉 | |
console.log(response); | |
} catch (error) { | |
// Error 😨 |
#!/bin/bash | |
# | |
# This script configures WordPress file permissions based on recommendations | |
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions | |
# | |
# Author: Michael Conigliaro | |
# | |
WP_OWNER=changeme # <-- wordpress owner | |
WP_GROUP=changeme # <-- wordpress group | |
WP_ROOT=/home/changeme # <-- wordpress root directory |
package com.example.MigrationService; | |
import io.quarkus.arc.Arc; | |
import io.quarkus.arc.InstanceHandle; | |
import io.quarkus.flyway.runtime.FlywayContainer; | |
import io.quarkus.flyway.runtime.FlywayContainerProducer; | |
import io.quarkus.flyway.runtime.QuarkusPathLocationScanner; | |
import io.quarkus.runtime.StartupEvent; | |
import org.eclipse.microprofile.config.inject.ConfigProperty; | |
import org.flywaydb.core.Flyway; |
running:
bash create-vod-hls.sh beach.mkv
will produce:
beach/
|- playlist.m3u8
|- 360p.m3u8