running:
bash create-vod-hls.sh beach.mkv
will produce:
beach/
|- playlist.m3u8
|- 360p.m3u8
#!/bin/bash | |
# Input file | |
input_file="${1}" | |
# Run ffprobe to analyze the input file and capture the output | |
output=$(ffprobe -v quiet -show_streams -print_format json "$input_file") | |
# Check if the output contains video and/or audio streams | |
if [[ $output == *'"codec_type": "video"'* && $output == *'"codec_type": "audio"'* ]]; then |
running:
bash create-vod-hls.sh beach.mkv
will produce:
beach/
|- playlist.m3u8
|- 360p.m3u8
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; |
#!/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 |
/* | |
* 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 😨 |
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:
# 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]; | |
# |
# 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 |
''' | |
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. |