- Use collections.Counter() for high performance containers as an alternative to dict(), userful for counting occurances. #Python https://docs.python.org/2/library/collections.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#install postgresql 9.5 | |
#========================================== | |
sudo vim /etc/apt/sources.list.d/postgresql.list | |
deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main 9.5 | |
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - | |
sudo apt-get update | |
sudo apt-get install postgresql-9.5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure(2) do |config| | |
config.vm.box = "ubuntu/trusty64" | |
config.vm.define "worker1" do |worker| | |
worker.vm.hostname = "worker1" | |
worker.vm.network "private_network", ip: "192.168.34.10" | |
worker.vm.provider "virtualbox" do |vb| | |
vb.memory = "2048" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### SETTINGS | |
NGINXDIR = /usr/local/openresty/nginx/ | |
NGXCONF = nginx_dummycustomer.conf | |
USER = ubuntu | |
REMOTE = ec2-54-224-138-186.compute-1.amazonaws.com | |
REMOTEDIR = /home/$(USER)/dummycustomer/ | |
PRIVATEKEY = /Users/victordg/.ssh/aws/vdg-3scale.pem | |
#### | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Watch current directory (recursively) for file changes, and execute | |
# a command when a file or directory is created, modified or deleted. | |
# | |
# Written by: Senko Rasic <[email protected]> | |
# | |
# Requires Linux, bash and inotifywait (from inotify-tools package). | |
# | |
# To avoid executing the command multiple times when a sequence of |
On mac:
- Download the latest release.
- Extract the binary and place it in
/usr/local/bin
.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ffmpeg -v verbose -f video4linux2 -vcodec mjpeg -s 640x480 -r 5 -i /dev/video0 -c:v libx264 -crf 18 -profile:v baseline -maxrate 400k -bufsize 1835k -pix_fmt yuv420p -flags -global_header -hls_time 10 -hls_list_size 6 -hls_wrap 10 -start_number 1 /var/www/live/mystream.m3u8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
See my DASH-IF presentation from October, 2014: | |
https://s3.amazonaws.com/misc.meltymedia/dash-if-reveal/index.html#/ | |
1. encode multiple bitrates with keyframe alignment: | |
ffmpeg -i ~/Movies/5D2_Portrait.MOV -s 1280x720 -c:v libx264 -b:v 1450k -bf 2 \ | |
-g 90 -sc_threshold 0 -c:a aac -strict experimental -b:a 96k -ar 32000 out.mp4 | |
My input was 30 fps = 3000 ms. If it were 29.97, then a GOP size of 90 frames will yield a base segment | |
size of 3003 milliseconds. You can make the segment size some multiple of this, e.g.: 6006, 9009, 12012. |