This example is part of this article.
This is an example for an HLS delivery with basic security. Nginx compiled with nginx-rtmp-module & secure-link is used as media server. Features:
- Domain filtering
- Referrer filtering
- Embed buster
Using MongoDB in golang with mgo |
This example is part of this article.
This is an example for an HLS delivery with basic security. Nginx compiled with nginx-rtmp-module & secure-link is used as media server. Features:
// Implementation in ES6 | |
function pagination(c, m) { | |
var current = c, | |
last = m, | |
delta = 2, | |
left = current - delta, | |
right = current + delta + 1, | |
range = [], | |
rangeWithDots = [], | |
l; |
package main | |
import ( | |
"context" | |
"flag" | |
"fmt" | |
"log" | |
"net/http" | |
"os" | |
"os/signal" |
#!/usr/bin/env python | |
# | |
# Converts any integer into a base [BASE] number. I have chosen 62 | |
# as it is meant to represent the integers using all the alphanumeric | |
# characters, [no special characters] = {0..9}, {A..Z}, {a..z} | |
# | |
# I plan on using this to shorten the representation of possibly long ids, | |
# a la url shortenters | |
# |
ffmpeg功能极其强大,堪比图像处理的ImageMagik。下面是一些常用的命令,记下备用。 | |
1:得到视频信息 | |
ffmpeg -i input.xxx | |
2: 将图像序列转换为视频 | |
ffmpeg -f image2 -i prefix%d.jpg output.xxx | |
3:将视频转换为图像序列 | |
ffmpeg -i input.xxx -r FPS -qscale 1 -vsync 0 $prefix%d.jpg | |
其中FPS为每秒抽多少帧 | |
4:将视频转换为yuv格式 | |
ffmpeg -i input.avi ouput.yuv |
ffmpeg -i "Apache Sqoop Tutorial Part 1.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts
ffmpeg -i "Apache Sqoop Tutorial Part 2.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate2.ts
ffmpeg -i "Apache Sqoop Tutorial Part 3.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate3.ts
ffmpeg -i "Apache Sqoop Tutorial Part 4.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate4.ts
ffmpeg -i "concat:intermediate1.ts|intermediate2.ts|intermediate3.ts|intermediate4.ts" -c copy -bsf:a aac_adtstoasc "Apache Sqoop Tutorial.mp4"
#!/usr/bin/env bash | |
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin | |
export PATH | |
cur_dir=$(pwd) | |
if [ $(id -u) != "0" ]; then | |
echo "Error: You must be root to run this script, please use root to install lnmp" | |
exit 1 | |
fi | |
clear | |
echo "=========================================================================" |
#查看当前TCP链接状态 | |
netstat -n | awk '/^tcp/ {++state[$NF]} END {for(key in state) print key,"\t",state[key]}' | |
#CLOSED: 无连接是活动的或正在进行 | |
#LISTEN: 服务器在等待进入呼叫 | |
#SYN_RECV: 一个连接请求已经到达,等待确认 | |
#SYN_SENT: 应用已经开始,打开一个连接 | |
#ESTABLISHED:正常数据传输状态 | |
#FIN_WAIT1: 应用说它已经完成 | |
#FIN_WAIT2: 另一边已同意释放 | |
#ITMED_WAIT: 等待所有分组死掉 |
#!/usr/bin/perl -w | |
# $Header: /CVSROOT/yahoo/ops/software/hwconfig/hwconfig,v 1.51.2.1 2008/11/06 01:01:10 filo Exp $ | |
use strict 'vars'; | |
use Getopt::Std; | |
use POSIX; | |
# constants | |
$ENV{PATH} = "/etc/bin:/sbin:/usr/sbin:/bin:/usr/bin:/home/y/bin:/usr/local/bin:/usr/local/sbin:/home/opt:/opt/MegaRAID/MegaCli:/usr/StorMan"; |