Skip to content

Instantly share code, notes, and snippets.

View jnbdz's full-sized avatar
👨‍💻
None stop

JN Σ jnbdz

👨‍💻
None stop
View GitHub Profile
@jnbdz
jnbdz / gist:8eeb67a545794ab34c0dc9b7c520cbd6
Created April 26, 2017 19:41 — 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
@jnbdz
jnbdz / change-ssh-port.sh
Created February 24, 2017 20:18 — forked from worldadventurer/change-ssh-port.sh
Change SSH Port - prompts on command line for new port number
#!/bin/bash
# Copied from https://github.com/FreePBXHosting/freepbx-scripts/tree/master/sshport
#
# To run the script, login as root via SSH and run the following command:
# bash <(curl -Ls https://gist.github.com/worldadventurer/842f1a10762cba0ce27dc8f99a835377/raw)
#
#############################################
# FreePBXHosting.com - @freepbxhosting #
# VERSION 1.6 UPDATED JUN 25 2015 #
# DESC: CHANGES SSH PORT AND RESTARTS SSH #
@jnbdz
jnbdz / php-fpm-cli
Last active August 29, 2015 14:26 — forked from muhqu/php-fpm-cli
#!/bin/bash
#
# The MIT License (MIT)
#
# Copyright (c) 2014 Mathias Leppich <mleppich@muhqu.de>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@jnbdz
jnbdz / riemann.js
Last active August 29, 2015 14:26 — forked from sentinelleader/riemann.js
/*
*
* To enable this backend, include './backends/riemann' in the backends
* configuration array:
*
* Requires Riemann Node client
*
* backends: ['./backends/riemann']
*
*/
@jnbdz
jnbdz / rmq-publish-with-header.c
Last active August 29, 2015 14:26 — forked from sentinelleader/rmq-publish-with-header.c
rmq-publish-with-header.c for Mosquitto MQTT broker
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <clem_rmq.h>
#include <assert.h>
#include <amqp_tcp_socket.h>
#include <amqp.h>
@jnbdz
jnbdz / munin-graphite.rb
Last active August 29, 2015 14:26 — forked from sentinelleader/munin-graphite.rb
munin-graphite
#!/usr/bin/env ruby
#
# graphite-mdash client - build ontop of munin-graphite
#
# Copyright: Copyright (c) 2012, Jonas Genannt <jonas@brachium-system.net>
#
# Author:: Adam Jacob (<adam@hjksolutions.com>)
# Copyright:: Copyright (c) 2008 HJK Solutions, LLC
# License:: GNU General Public License version 2 or later
#
# First do a fresh install of CentOS 5.7 i386, server configuration (no GUI)
# This should be performed as root since it's going to be installing a bunch of stuff
# --- Update things to make sure we have the latest patches ---
# Add EPEL so we can get reasonably recent packages
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
# --- Install all the packages --- #
yum -y install python-whisper python-carbon graphite-web python-memcached python-ldap httpd memcached
#! /bin/bash
#
# This script needs "fpm". If you dont have it,
# run "gem install fpm"
#
# You also need to "apt-get install python-setuptools" (otherwise fpm fails)
clean() {
rm -rf whisper-0.9.9 carbon-0.9.9 graphite-web-0.9.9