Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am kris-lab on github.
  • I am krislab (https://keybase.io/krislab) on keybase.
  • I have a public key whose fingerprint is 01FD 82B5 CFC4 A296 C2C8 19F7 7481 0164 3432 F986

To claim this, I am signing this object:

@kris-lab
kris-lab / gist:28060a51c122b4da08b9
Last active March 31, 2016 22:52
ffmpeg benchmarking
# tested on Debian
# require ffmpeg@2.6.3 with --enable-libfreetype for drawtext extension
# ffmpeg streaming to ffserver feed
# file -> ffmpeg (playback) -> ffmpeg (add timestamp) -> ffmpeg (add timestamp) -> ffserver (FFM delivery)
ffmpeg -i your-file.mp4 -tune zerolatency -filter:v "setpts=1.0*PTS" -f nut pipe:1 \
| ffmpeg -re -i pipe:0 -vf "drawtext=expansion=normal:fontfile=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf:reload=1:textfile=test.txt: x=50: y=50: fontcolor=white" -tune zerolatency -f nut pipe:1 \
| ffmpeg -y -i pipe:0 -tune zerolatency http://ffserver-ip:7000/feed1.ffm
@kris-lab
kris-lab / gist:339b373e4cf30b2e9916
Last active August 29, 2015 14:06
Pulsar MMS:RESTORE task
$ pulsar -c . sk sandbox mongo:mms:restore
* 2014-09-26 12:53:51 executing `mongo:mms:restore'
* 2014-09-26 12:53:51 executing `mongo:mms:snapshots'
2014-09-15 07:11:29 54169140e4b02815a46785d9 parts: ["rep2 (256.00 MiB)", "rep1 (448.00 MiB)", "CONFIG_SERVER (192.00 MiB)"] nosql.mongo.sandbox
2014-09-12 13:12:50 5412f159e4b06aa4ea5f6422 parts: ["rep2 (256.00 MiB)", "rep1 (448.00 MiB)", "CONFIG_SERVER (192.00 MiB)"] nosql.mongo.sandbox
2014-09-12 07:12:50 54129cf4e4b0105c39eccc7b parts: ["rep2 (256.00 MiB)", "rep1 (448.00 MiB)", "CONFIG_SERVER (192.00 MiB)"] nosql.mongo.sandbox
2014-09-12 01:12:50 541248a4e4b088bf987f2dd0 parts: ["rep2 (256.00 MiB)", "rep1 (448.00 MiB)", "CONFIG_SERVER (192.00 MiB)"] nosql.mongo.sandbox
2014-09-11 13:12:50 54119fd4e4b06aa4ea582e36 parts: ["rep2 (256.00 MiB)", "rep1 (448.00 MiB)", "CONFIG_SERVER (192.00 MiB)"] nosql.mongo.sandbox
@kris-lab
kris-lab / gist:06d38265ed8037d8f1b3
Last active August 29, 2015 14:05
Pulsar task example for mms-api client
require 'mms'
namespace :mongo do
set :mms_settings, {
:username => 'username',
:apikey => 'apikey',
:group_id => 'group-id',
:cluster_id => 'cluster-id'
}
@kris-lab
kris-lab / gist:dfb169d5ccafcfb155a7
Last active August 29, 2015 14:05
Pulsar mongo:health sandbox example
$ pulsar myapp sandbox mongo:health
* 2014-12-18 12:14:26 executing `mongo:health'
* 2014-12-18 12:14:26 executing `mongo:health:check'
** ✔ common: Same engine version
** ✔ common: Journaling (durability)
** ✔ router: Router processes are the mongos
** ✔ router: Balancing enabled
** ✔ config: chunk list in sync
** ✔ config: database list in sync
** ✔ config: setting list in sync
@kris-lab
kris-lab / gist:2d39c520c101b0e0e359
Last active August 29, 2015 14:05
Pulsar mongodb tasks
mycompany@monkey:/tmp$ pulsar myapp production --tasks
cap mongo:config:restart # Restart all config servers
cap mongo:config:start # Start all config servers
cap mongo:config:status # General cluster config status
cap mongo:config:status:locks # Distributed locks list
cap mongo:config:status:oplog # Oplog status
cap mongo:config:status:routers # Routers list
cap mongo:config:status:settings # Settings list
cap mongo:config:status:shards # Shards list
cap mongo:config:status:sync # Config server sync status
@kris-lab
kris-lab / gist:2991b31064da1353a277
Last active August 29, 2015 14:05
Hiera mongodb cluster config
{
"puppet::common::basemodulepath": "/etc/puppet/modules:/tmp/vagrant-puppet-2/modules-0:/tmp/vagrant-puppet-2/modules-1",
"puppet::agent::server": "master.sandbox",
"puppet::agent::cpu_shares": "1024",
"network::host::advertise::interface" : "eth1",
"company::mongodb::cluster_config": {
"members": {