Skip to content

Instantly share code, notes, and snippets.

@Stephenitis
Stephenitis / mongo_replica_member_status_check.js
Created February 24, 2016 18:00
This script polls the rs.status() to check for the state of the various replica sets.
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
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
@Stephenitis
Stephenitis / .worker
Created September 17, 2014 19:06
IronWorker .worker file using shellscript and ffmpeg stack
runtime "binary"
stack "ffmpeg-2.3"
exec "ffmpeg_shell.sh"
@Stephenitis
Stephenitis / composer.json
Created September 17, 2014 19:00
IronWorker .worker file using PHP and ffmpeg stack
{
"require": {
"php-ffmpeg/php-ffmpeg": "0.5.*@dev",
"codescale/ffmpeg-php": "dev-master",
"pulse00/ffmpeg-bundle": "dev-master",
"php-ffmpeg/extras": "0.3.*@dev"
}
}
@Stephenitis
Stephenitis / ffmpeg_python.worker
Last active August 29, 2015 14:06
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"
@Stephenitis
Stephenitis / ffmpeg_node.worker
Last active August 29, 2015 14:06
IronWorker .worker file using node and ffmpeg stack
# declare runtime
runtime "node"
# define IronWorker stack
stack "ffmpeg-2.3"
# include your package.json and build command
file "package.json"
build "npm install"
@Stephenitis
Stephenitis / Gemfile
Last active October 18, 2015 04:46
IronWorker .worker file using ruby and ffmpeg stack
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
@Stephenitis
Stephenitis / get_video_info.worker
Created September 11, 2014 23:23
Video Processing in 3 simple steps with IronWorker's new FFMPEG stack .worker file
runtime "ruby"
stack "ffmpeg-2.3"
file "harddrivespinning.mp4"
gem "streamio-ffmpeg"
exec "get_video_info.rb"
@Stephenitis
Stephenitis / get_video_info.rb
Last active August 29, 2015 14:06
Video Processing in 3 simple steps with IronWorker's new FFMPEG stack
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} "
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'