Skip to content

Instantly share code, notes, and snippets.

View pristavu's full-sized avatar

Andrei Pristavu pristavu

View GitHub Profile
@pristavu
pristavu / video-thumbnail-display.html
Last active August 29, 2015 14:27 — forked from ispedals/video-thumbnail-display.html
Experiment creating thumbnails of MP4 videos using the HTML5 Filereader API. Currently, the loading of videos in rapid succession fails with a decoding error, and if too many videos are processed concurrently, the display driver crashes.
<!DOCTYPE html>
<html lang="en">
<head>
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css" rel="stylesheet">
<script src="http://code.jquery.com/jquery.js"></script>
<script src="https://rawgithub.com/caolan/async/master/lib/async.js"></script>
<script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/js/bootstrap.min.js"></script>
<script>
window.URL = window.URL || window.webkitURL;
@pristavu
pristavu / install_ffmpeg_ubuntu.sh
Created October 13, 2015 02:00 — forked from xdamman/install_ffmpeg_ubuntu.sh
Install latest ffmpeg on ubuntu 12.04 or 14.04
#!/bin/bash
# Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 12.04 or 14.04
# Inspired from https://gist.github.com/faleev/3435377
# Remove any existing packages:
sudo apt-get -y remove ffmpeg x264 libav-tools libvpx-dev libx264-dev
# Get the dependencies (Ubuntu Server or headless users):
sudo apt-get update
<?php
error_reporting(E_ALL & ~E_NOTICE);
ini_set('display_errors', 1);
$_HTTP = !empty($_SERVER['HTTPS']) ? 'https://' : 'http://';
// change this by country (gls-hungary.com, gls-slovakia.sk, gls-czech.com, gls-romania.ro, gls-slovenia.com, gls-croatia.com)
$wsdl_path = $_HTTP.'online.gls-slovakia.sk'.'/webservices/soap_server.php?wsdl&ver=14.11.03.01';
$client = new SoapClient($wsdl_path);
@pristavu
pristavu / install_php71.sh
Created July 9, 2018 15:27 — forked from wayanjimmy/install_php71.sh
Install php7.1 ubuntu 16.04 EC2
sudo apt-get update -y
sudo apt-get install -y nginx
sudo apt-get install -y python-software-properties
sudo add-apt-repository -y ppa:ondrej/php
sudo apt-get update -y
sudo apt-get install -y php7.1 php7.1-fpm php7.1-cli php7.1-common php7.1-mbstring php7.1-gd php7.1-intl php7.1-xml php7.1-mysql php7.1-mcrypt php7.1-zip
sudo apt-get install php-curl
@pristavu
pristavu / install_php71.sh
Created July 9, 2018 15:27 — forked from wayanjimmy/install_php71.sh
Install php7.1 ubuntu 16.04 EC2
sudo apt-get update -y
sudo apt-get install -y nginx
sudo apt-get install -y python-software-properties
sudo add-apt-repository -y ppa:ondrej/php
sudo apt-get update -y
sudo apt-get install -y php7.1 php7.1-fpm php7.1-cli php7.1-common php7.1-mbstring php7.1-gd php7.1-intl php7.1-xml php7.1-mysql php7.1-mcrypt php7.1-zip
sudo apt-get install php-curl
@pristavu
pristavu / default
Created July 20, 2018 09:55 — forked from dtomasi/default
Brew Nginx PHP7
server {
listen 80;
server_name localhost;
root /Users/YOUR_USERNAME/Sites;
access_log /Library/Logs/default.access.log main;
location / {
include /usr/local/etc/nginx/conf.d/php-fpm;
}
@pristavu
pristavu / directions.sh
Created March 9, 2019 14:34 — forked from hhff/directions.sh
SSL Proxy for Multi Tenant Sites on AWS
ssh -i your_key.pem ec2-user@YOUR_EC2_IP
sudo yum-config-manager --add-repo https://openresty.org/package/amazon/openresty.repo
sudo yum install openresty
sudo yum install openresty-resty
# if https://openresty.org/package/amazon/2/x86_64/repodata/repomd.xml: \[Errno 14\] HTTPS Error 404 - Not Found
# sudo vim /etc/yum.repos.d/openresty.repo
# exchange the $releasever placeholder of the baseurl to “latest” baseurl=https://openresty.org/package/amazon/latest/$basearch.
@pristavu
pristavu / beautifier.js
Created April 17, 2019 21:54 — forked from fzldn/beautifier.js
VS Code Laravel Blade formatter using extension Beautify 1.4.11 by HookyQR with js-beautify hacks
...
Beautifier.prototype.beautify = function() {
...
var source_text = this._source_text;
// BEGIN
source_text = source_text.replace(/\{\{(--)?((?:(?!(--)?\}\}).)+)(--)?\}\}/g, function(m, ds, c, dh, de) {
@pristavu
pristavu / README.md
Created May 30, 2019 00:46 — forked from mrbar42/README.md
Secured HLS setup with Nginx as media server

Secured HLS setup with Nginx as media server

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
@pristavu
pristavu / ffmpeg-livestream-to-streaming-sites-vaapi-nvenc.md
Created March 13, 2020 17:01 — forked from Brainiarc7/ffmpeg-livestream-to-streaming-sites-vaapi-nvenc.md
ffmpeg livestreaming to youtube via Nvidia's NVENC and Intel's VAAPI on supported hardware

Streaming your Linux desktop to Youtube and Twitch via Nvidia's NVENC and VAAPI:

Considerations to take when live streaming:

The following best practice observations apply when using a hardware-based encoder for live streaming to any platform:

  1. Set the buffer size (-bufsize:v) equal to the target bitrate (-b:v). You want to ensure that you're encoding in CBR mode.

  2. Set up the encoders as shown: