Skip to content

Instantly share code, notes, and snippets.

@raiscui
raiscui / gunjstrustsharekey.js
Created August 5, 2019 22:49 — forked from Lightnet/gunjstrustsharekey.js
gunjstrustsharekeyv1.js
/*
Self contain Sandbox Gun Module:
version: 1.0
Created by: Lightnet
Credit: amark ( https://github.com/amark/gun)
License: MIT

video subtitle

ffmpeg -i *.mp4 -vf subtitles=*.srt output.mp4

element stream to ts

  • ffmpeg -i audio.aac -i ch2.h264 -acodec copy -vcodec copy -f mpegts out.ts

rtsp 2 rtmp

  • ffmpeg -rtsp_transport tcp -i rtsp://fuck.com/fuck/fuck -c copy -f flv rtmp://shit.com/shit/shit

截图片

@raiscui
raiscui / callback-to-promise.js
Created January 14, 2018 08:36 — forked from TheDeveloper/callback-to-promise.js
A little function to convert a callback-style function to Promises
// usage: promisify(function([args..., cb]) { /* do stuff with args then cb */ })()
exports.promisify = function(fn) {
return function(...args) {
return new Promise((resolve, reject) => {
fn(...args, (err, result) => {
if (err) return reject(err);
resolve(result);
});
});
};
@raiscui
raiscui / install_nvidia_driver_in_ubuntu1604.md
Created November 10, 2017 08:23 — forked from terrydang/install_nvidia_driver_in_ubuntu1604.md
Ubuntu 16.04 安装英伟达(Nvidia)显卡驱动

Ubuntu 16.04 安装英伟达(Nvidia)显卡驱动

配有英伟达显卡的主机,装完 Ubuntu 16.04 后出现闪屏现象,是由于没有安装显卡驱动。

显卡型号
NVIDIA Corporation GM204 [GeForce GTX 970]

@raiscui
raiscui / install_tensorflow_form_source_Ubuntu_16_04.md
Created November 10, 2017 08:22 — forked from terrydang/install_tensorflow_form_source_Ubuntu_16_04.md
Ubuntu 16.04 安装 tensorflow with GPU support(源码编译安装)

Ubuntu 16.04 安装 tensorflow with GPU support(源码编译安装)

显卡型号
NVIDIA Corporation GM204 [GeForce GTX 970]

1. 安装依赖
const isArray = (a) => {
return (!!a) && (a.constructor === Array);
};
const isObject = (a) => {
return (!!a) && (a.constructor === Object);
};
const gunToObj = (obj,getKey,putKey) => {
getKey = (typeof(getKey) === 'undefined') ? '_title' : getKey;
putKey = (typeof(putKey) === 'undefined') ? 'title' : putKey;
@raiscui
raiscui / Api.elm
Created May 30, 2017 14:36 — forked from maxhoffmann/Api.elm
Effect Manager for token authentication in Elm
-- Api Effect Manager
effect module Api where { command = MyCmd } exposing (request, Response)
import Task exposing (..)
import Http
import Process
import Json.Decode as Json exposing ((:=))
import Native.Api
@raiscui
raiscui / pi2.js
Created January 25, 2017 07:26
pi2 接收
var Gpio = require('pigpio').Gpio,
led = new Gpio(17, { mode: Gpio.OUTPUT }),
led2 = new Gpio(18, { mode: Gpio.OUTPUT });
led.pwmFrequency(50)
led2.pwmFrequency(50)
led.pwmWrite(0);
const PWRUN = 110;
const PWSTOP = 90;
led2.pwmWrite(PWSTOP);
echo “<request><mode>1</mode></request>” | curl -X POST -H “__RequestVerificationToken:1099746139” -H “Content-type: text/xml” -d @- http://192.168.8.1/api/device/mode
@raiscui
raiscui / install_ffmpeg_ubuntu.sh
Created July 6, 2016 13:08 — forked from xdamman/install_ffmpeg_ubuntu.sh
Install latest ffmpeg on ubuntu 12.04 or 14.04
#!/bin/bash
# Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 12.04 or 14.04
# Inspired from https://gist.github.com/faleev/3435377
# Remove any existing packages:
sudo apt-get -y remove ffmpeg x264 libav-tools libvpx-dev libx264-dev
# Get the dependencies (Ubuntu Server or headless users):
sudo apt-get update