Skip to content

Instantly share code, notes, and snippets.

@jtbonhomme
jtbonhomme / jira-behing-nginx-ssl
Created September 26, 2015 07:49 — forked from alertor/jira-behing-nginx-ssl
Atlassian JIRA behind nginx + SSL
# force HTTP to HTTPS - /etc/nginx/conf.d/nonssl.conf
server {
listen 80;
server_name jira.example.com;
access_log off;
return 301 https://$server_name$request_uri;
}
# /etc/nginx/conf.d/jira.conf
server {
@jtbonhomme
jtbonhomme / telegraf
Last active October 16, 2015 21:21
telegraf launching
To have launchd start telegraf at login:
ln -sfv /usr/local/opt/telegraf/*.plist ~/Library/LaunchAgents
Then to load telegraf now:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.telegraf.plist
Or, if you don't want/need launchctl, you can just run:
telegraf -config /usr/local/etc/telegraf.conf
or
telegraf -sample-config > telegraf.conf to create an initial configuration
@jtbonhomme
jtbonhomme / iterm2-solarized.md
Created November 7, 2015 16:54 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + oh my zsh + solarized + Meslo powerline font (OSX)

Solarized

@jtbonhomme
jtbonhomme / gist:9d9c2acd2f1aa6cb0320
Created November 20, 2015 17:33 — forked from mharsch/gist:5188206
serve HLS (HTTP Live Streaming) content from node.js

HLS streaming from node

Provided that you already have a file or stream segmenter generating your .m3u8 playlist and .ts segment files (such as the ffmpeg 'hls' muxer), this little node server will serve up those files to an HLS compatible client (e.g. Safari). If you're using node for your streaming app already, this obviates the need to serve the HLS stream from a separate web server.

loosely based on https://gist.github.com/bnerd/2011232

// loosely based on https://gist.github.com/bnerd/2011232
// requires node.js >= v0.10.0
// assumes that HLS segmenter filename base is 'out'
// and that the HLS playlist and .ts files are in the current directory
@jtbonhomme
jtbonhomme / gist:3d3a907e5f0c2b3e97f0
Created December 5, 2015 21:01
ERROR [launcher]: No binary for PhantomJS browser on your platform. Please, set "PHANTOMJS_BIN" env variable.
npm uninstall -g phantomjs
npm cache clean -f
brew upgrade nodejs
rm -rf node_modules
npm install -g YOUR_GLOBAL_DEPENDENCIES
npm install
@jtbonhomme
jtbonhomme / promises_loop.js
Created January 7, 2016 15:32
Promises loop
var Promise = require('bluebird');
var promises = [];
for(var i = 0 ; i<10; i++) {
var that = this;
promises.push(new Promise(function(fulfill, reject) {
setTimeout(function(){
console.log('Fulfill ');
fulfill();
}, 1000+Math.random()*10000);
}));
@jtbonhomme
jtbonhomme / JFDI.md
Created January 16, 2016 08:32 — forked from v0lkan/JFDI.md
Jedis Feel Doin' It!
Nowadays, being really busy has become something worth bragging about or something you can't escape. 
You will probably even blame your commitments for stealing your time.

But is it truly impossible for you to make time for your "dream project"? 
Are you busy or is it avoidance?

Really. Look at your schedule; and put in a little "dream" time. 
Everything else would benefit more if you spend some time caring for your passions ;)

#JFDI™ (*):

@jtbonhomme
jtbonhomme / captureHls.sh
Created April 17, 2016 17:48
This script downloads a VOD multi profile HLS content in a local directory
#!/bin/bash
# ./captureHls.sh http://www.cdn.com/master.m3u8 DIRECTORY
URL=$1
OUTPUT=$2
# create output directory
if [ -d $OUTPUT ]
then
echo "Directory $OUTPUT already exists"
@jtbonhomme
jtbonhomme / js:scripts:bluebird.js
Created May 17, 2016 16:51 — forked from dhval/js:scripts:bluebird.js
Using bluebird promises
#!/usr/bin/env node
/**
Demostrate a practical use case with Bluebird promise api.
Read a line delimited file and store into sqlite3 db.
Promise.promisifyAll - Converting synchromous api's to Async.
Promise.using and Promise.disposer - Resource managment.
Promise.map and Promise.spread - Leveraging arrays in promises.

Open a new Terminal window and run the following command:

sudo gedit /etc/apt/sources.list.d/google.list

In the text file that opens edit the file so that the line reads:

deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main