View mongo_replica_member_status_check.js
MAXSCRIPT_RUN_ITERATIONS = 1800 // approximately 30 minutes
for (var i = 0; i < MAXSCRIPT_RUN_ITERATIONS; i++) {
sleep(1000);
var currentdate = new Date();
var datetime = new Date().toLocaleString();
var rsStatus = rs.status()
var members = rsStatus.members
// Change this index depending on the # of members in your set
View ways to use flocker
docker run --volume-driver flocker -v myvolume:/data busybox sh -c "echo hello > /data/file.txt"
$ docker volume create -d flocker --name=myvolume
$ docker run -v myvolume:/data busybox sh -c "echo hello > /data/file.txt"
$ docker run -v myvolume:/data busybox sh -c "cat /data/file.txt"
# SWARM
docker -H tcp://$MASTER:2357 volume create -d flocker --name only3
View .worker
runtime "binary"
stack "ffmpeg-2.3"
exec "ffmpeg_shell.sh"
View composer.json
{
"require": {
"php-ffmpeg/php-ffmpeg": "0.5.*@dev",
"codescale/ffmpeg-php": "dev-master",
"pulse00/ffmpeg-bundle": "dev-master",
"php-ffmpeg/extras": "0.3.*@dev"
}
}
View ffmpeg_python.worker
# declare runtime
runtime "python"
# define IronWorker stack, note that this stack uses python 2.3
stack "ffmpeg-2.3"
# include your favorite python/ffmpeg dependencies via pip
pip "ffvideo"
pip "moviepy"
View ffmpeg_node.worker
# declare runtime
runtime "node"
# define IronWorker stack
stack "ffmpeg-2.3"
# include your package.json and build command
file "package.json"
build "npm install"
View Gemfile
source "http://rubygems.org"
gem "streamio-ffmpeg"
# general ffmpeg wrapper https://github.com/streamio/streamio-ffmpeg
gem "paperclip-ffmpeg"
# video handling to Paperclip via ffmpeg https://github.com/owahab/paperclip-ffmpeg
View get_video_info.worker
runtime "ruby"
stack "ffmpeg-2.3"
file "harddrivespinning.mp4"
gem "streamio-ffmpeg"
exec "get_video_info.rb"
View get_video_info.rb
require 'streamio-ffmpeg'
require "benchmark"
require 'open-uri'
p Benchmark.measure {
movie = FFMPEG::Movie.new("harddrivespinning.mp4")
p "movie.duration : #{movie.duration } "
p "movie.bitrate : #{movie.bitrate} "
p "movie.size : #{movie.size} "
p "movie.video_stream : #{movie.video_stream} "
p "movie.video_codec : #{movie.video_codec} "
View example_dot_worker_file.rb
runtime 'node'
stack 'node-0.10'
exec 'main_worker.js'
dir '../models'
dir '../config'
dir '../node_modules'
dir '../lib'
dir '../jobs'
dir '../main_worker'
name 'MainWorker'