Skip to content

Instantly share code, notes, and snippets.

@vnoder
vnoder / gist:97b1f0c812e2d1ddd25b
Created December 18, 2015 13:07 — forked from deandob/gist:8943268
Streaming MP4 to HTML5 clients
--------------- FFMPEG command line
ffmpeg = child_process.spawn("ffmpeg", [
"-i", rtsp , "-vcodec", "copy", "-f", "mp4", "-f", "segment", "-segment_time", recSeg, "-segment_wrap", 2, "-map", "0", "-segment_format", "mp4", "-reset_timestamps", "1", "-y", "plugins/security/videos/" + camName + "/rec-%01d.mp4"
], {detached: false});
---------------- Node.JS streamer
// Stream mp4 video file based on URL request from client player. Accept request for partial streams
// Code attribution: https://github.com/meloncholy/vid-streamer/blob/master/index.js (MIT license)
var recStream = function (req, resp) {
var stream;
@vnoder
vnoder / fail2ban-reset-log-db.sh
Created November 9, 2017 14:31 — forked from mitchellkrogza/fail2ban-reset-log-db.sh
Bash script to reset Fail2Ban - clears / truncates log file and deletes the sqlite database - stops and restarts service during this process.
#!/bin/bash
# Bash Script by https://gist.github.com/mitchellkrogza
# ************************************************************
# This script clears the log file and database of Fail2Ban
# This resets Fail2Ban to a completely clean state
# Useful to use after you have finished testing all your jails
# and completed your initial setup of Fail2Ban and are now
# putting the server into LIVE mode
# ************************************************************
@vnoder
vnoder / 常用变量缩写
Created February 25, 2021 08:16
常用变量缩写
We couldn’t find that file to show.