This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# bash generate random alphanumeric string | |
# | |
# bash generate random 32 character alphanumeric string (upper and lowercase) and | |
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) | |
# bash generate random 32 character alphanumeric string (lowercase only) | |
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is based on https://trac.ffmpeg.org/wiki/UbuntuCompilationGuide and this script is revised a little bit so it'd recompile h246 into libav before compiling FFMPEG. | |
Bash shell script | |
Ubuntu 12.04 12.10 13.04 13.10 | |
x64 = success | |
x32 = debugging | |
Location of build: /home/yourhome/ffmpeg_src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Configuring Apache2 for webhosting multiples of websites on one ip address by using | |
Apache2's "Name-Domain-Based" virtual hosting websites. | |
This httpd.dat holds configurations for 2 websites, simply copy lines between | |
<VirtualHost *:80></VirtualHost>. | |
BIG EMPHASIS TO LEAVE *:80 untouched or whole system will fail. | |
you will see ## EDIT THIS ## which define the line that you can | |
edit whatever you like accordingly. But any lines without that notch, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ ! -d bye ] | |
then | |
mkdir bye | |
fi | |
if [ ! -d lib ] | |
then | |
mkdir lib | |
fi | |
file=$(find ./ -type f ! -name "ffmpeg*" | sort | head -1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var app = require('express')(); | |
var GridStore = require('mongodb').GridStore; | |
var ObjectID = require('mongodb').ObjectID; | |
var MongoClient = require('mongodb').MongoClient; | |
var Server = require('mongodb').Server; | |
var dbConnection; | |
MongoClient.connect("mongodb://localhost:27017/ersatz?auto_reconnect", {journal: true}, function(err, db) { | |
dbConnection = db; | |
app.listen(3000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Inspired by: http://stackoverflow.com/questions/4360060/video-streaming-with-html-5-via-node-js | |
*/ | |
var http = require('http'), | |
fs = require('fs'), | |
util = require('util'); | |
http.createServer(function (req, res) { | |
var path = 'video.mp4'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Live video stream management for HTML5 video. Uses FFMPEG to connect to H.264 camera stream, | |
// Camera stream is remuxed to a MP4 stream for HTML5 video compatibility and segments are recorded for later playback | |
var liveStream = function (req, resp) { // handle each client request by instantiating a new FFMPEG instance | |
// For live streaming, create a fragmented MP4 file with empty moov (no seeking possible). | |
var reqUrl = url.parse(req.url, true) | |
var cameraName = typeof reqUrl.pathname === "string" ? reqUrl.pathname.substring(1) : undefined; | |
if (cameraName) { | |
try { | |
cameraName = decodeURIComponent(cameraName); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
/* | |
* Inspired by: http://stackoverflow.com/questions/4360060/video-streaming-with-html-5-via-node-js | |
* Modified from https://gist.github.com/paolorossi/1993068 | |
*/ | |
var http = require('http') | |
, fs = require('fs') | |
, util = require('util') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var app = require('express')(); | |
var GridStore = require('mongodb').GridStore; | |
var ObjectID = require('mongodb').ObjectID; | |
var MongoClient = require('mongodb').MongoClient; | |
var Server = require('mongodb').Server; | |
var dbConnection; | |
MongoClient.connect("mongodb://localhost:27017/ersatz?auto_reconnect", {journal: true}, function(err, db) { | |
dbConnection = db; | |
app.listen(3000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
/* | |
* Inspired by: http://stackoverflow.com/questions/4360060/video-streaming-with-html-5-via-node-js | |
* Modified from https://gist.github.com/paolorossi/1993068 | |
*/ | |
var http = require('http') | |
, fs = require('fs') | |
, util = require('util') |
OlderNewer