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
/** | |
* securesocks encryptor | |
* Name Alias KeySize Salt Size Nonce Size Tag Size | |
* AEAD_AES_256_GCM aes-256-gcm 32 32 12 16 | |
* AEAD_AES_192_GCM aes-192-gcm 24 24 12 16 | |
* AEAD_AES_128_GCM aes-128-gcm 16 16 12 16 | |
*/ | |
import * as crypto from 'crypto'; | |
export const EncryptMethod = { |
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
package main | |
import ( | |
"fmt" | |
"time" | |
"runtime" | |
) | |
func fibonacci(num int) int { | |
if num < 2 { |
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
/** | |
* Created by vd on 10/01/18. | |
*/ | |
'use strict'; | |
const shell = require('shelljs'); | |
/** | |
* rsync file (must config public key, passport is not supported) | |
* |
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
/** | |
* Created by vd on 10/01/18. | |
*/ | |
'use strict'; | |
const Promise = require('bluebird'); | |
async function demoAsyncFun() { | |
return Promise.resolve([1,2,3]); | |
} |
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 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 | |
# ************************************************************ |
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
--------------- 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; |