Skip to content

Instantly share code, notes, and snippets.

Nur Rony nmrony

Block or report user

Report or block nmrony

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
View how-to-run-apache-and-node.js-together-the-right-way.markdown

Step 1

Get a VPS that offers 2 or more IP addresses.

Step 2

From the WHM cPanel, find the menu item Service Configuration, select Apache Configuration and then click on Reserved IPs Editor.

Step 3

View gist:041613e98d9f1ca0aae4

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
View Gruntfile.js
/*!
* Grunt
* $ npm install grunt-contrib-uglify grunt-autoprefixer grunt-contrib-cssmin grunt-contrib-imagemin grunt-contrib-sass grunt-contrib-watch grunt-contrib-concat grunt-contrib-clean grunt-contrib-jshint grunt-notify --save-dev
*/
module.exports = function(grunt) {
grunt.initConfig({
// Sass
View statusCodes
100 Continue
101 Switching Protocols
102 Processing (WebDAV; RFC 2518)
200 OK
201 Created
202 Accepted
203 Non-Authoritative Information (since HTTP/1.1)
204 No Content
205 Reset Content
206 Partial Content
View install-ffmpeg-amazon-linux.sh
#!/bin/sh
# Based on instructions found here: http://wiki.razuna.com/display/ecp/FFMpeg+Installation+on+CentOS+and+RedHat#FFMpegInstallationonCentOSandRedHat-InstallX264
if [ "`/usr/bin/whoami`" != "root" ]; then
echo "You need to execute this script as root."
exit 1
fi
cat > /etc/yum.repos.d/centos.repo<<EOF
@nmrony
nmrony / nginx-centos
Last active Aug 29, 2015
Nginx Init.d Script
View nginx-centos
#! /bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: nginx init.d dash script for Ubuntu <=9.10.
# Description: nginx init.d dash script for Ubuntu <=9.10.
### END INIT INFO
@nmrony
nmrony / kibana-initd-script-for-centos6
Last active Aug 29, 2015
Correct and working Logstash-forwarder init script for CentOS 5/6+
View kibana-initd-script-for-centos6
#!/bin/bash
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="Kibana 4"
NAME=kibana
DAEMON=/opt/kibana/bin/$NAME
DAEMON_ARGS=""
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
LOG=/var/log/kibana.log
@nmrony
nmrony / install-aws-eb-cli.md
Last active Aug 29, 2015
AWS EB CLI installation
View install-aws-eb-cli.md

Install Python 2.7

sudo apt-get install python2.7

Install pip

cd
@nmrony
nmrony / restore-mongodb-collections
Last active Sep 16, 2015
Restore all MongoDB collections from directory contains BSON files
View restore-mongodb-collections
#!/usr/bin/env bash
#Author nmrony<pro.nmrony@gmail.com>
#you need to download it and give execution permission to run it
#handle errors
function die(){
echo $1;
exit 1;
}
@nmrony
nmrony / .eslintrc.js
Last active Sep 21, 2015 — forked from nkbt/.eslintrc.js
Strict ESLint config for React, ES6 (based on Airbnb Code style)
View .eslintrc.js
{
"env": {
"browser": true,
"node": true,
"es6": true
},
"plugins": ["react"],
"ecmaFeatures": {
You can’t perform that action at this time.