Skip to content

Instantly share code, notes, and snippets.

Stephen Nguyen Stephenitis

Block or report user

Report or block Stephenitis

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Stephenitis
Stephenitis / mongo_replica_member_status_check.js
Created Feb 24, 2016
This script polls the rs.status() to check for the state of the various replica sets.
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
@Stephenitis
Stephenitis / .worker
Created Sep 17, 2014
IronWorker .worker file using shellscript and ffmpeg stack
View .worker
runtime "binary"
stack "ffmpeg-2.3"
exec "ffmpeg_shell.sh"
@Stephenitis
Stephenitis / composer.json
Created Sep 17, 2014
IronWorker .worker file using PHP and ffmpeg stack
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"
}
}
@Stephenitis
Stephenitis / ffmpeg_python.worker
Last active Aug 29, 2015
ffmpeg_python.worker
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"
@Stephenitis
Stephenitis / ffmpeg_node.worker
Last active Aug 29, 2015
IronWorker .worker file using node and ffmpeg stack
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"
@Stephenitis
Stephenitis / Gemfile
Last active Oct 18, 2015
IronWorker .worker file using ruby and ffmpeg stack
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
@Stephenitis
Stephenitis / get_video_info.worker
Created Sep 11, 2014
Video Processing in 3 simple steps with IronWorker's new FFMPEG stack .worker file
View get_video_info.worker
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 Aug 29, 2015
Video Processing in 3 simple steps with IronWorker's new FFMPEG stack
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'
You can’t perform that action at this time.