📚 我的文章

Rematrix is needed between 10 channels and 7.1(wide) but there is not enough

解决办法

将10个声道拆分成10个音轨

ffmpeg -i INPUTFILE -filter_complex “[0:a]pan=mono|c0=c0[…

解决办法 #

将10个声道拆分成10个音轨

ffmpeg -i INPUTFILE  -filter_complex "[0:a]pan=mono|c0=c0[a0];[0:a]pan=mono|c0=c1[a1];[0:a]pan=mono|c0=c2[a2];[0:a]pan=mono|c0=c3[a3];[0:a]pan=mono|c0=c4[a4];[0:a]pan=mono|c0=c5[a5];[0:a]pan=mono|c0=c6[a6];[0:a]pan=mono|c0=c7[a7];[0:a]pan=mono|c0=c8[a8];[0:a]pan=mono|c0=c9[a9]" -map "[a0]" -map "[a1]" -map "[a2]" -map "[a3]" -map "[a4]" -map "[a5]" -map "[a6]" -map "[a7]" -map "[a8]" -map "[a9]" -vn -c:a pcm_s24le  OUTPUTFILE

ffmpeg -i INPUTFILE -vn -c:a pcm_s24le -map 0:1 -filter:a:0 "pan=mono|c0=c0" -map 0:1 -filter:a:1 "pan=mono|c0=c1" -map 0:1 -filter:a:2 "pan=mono|c0=c2" -map 0:1 -filter:a:3 "pan=mono|c0=c3" -map 0:1 -filter:a:4 "pan=mono|c0=c4" -map 0:1 -filter:a:5 "pan=mono|c0=c5" -map 0:1 -filter:a:6 "pan=mono|c0=c6" -map 0:1 -filter:a:7 "pan=mono|c0=c7" -map 0:1 -filter:a:8 "pan=mono|c0=c8" -map 0:1 -filter:a:9 "pan=mono|c0=c9" OUTPUTFILE

Ubuntu 阿里云镜像源

准备工作 #

sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak #备份

修改配置 #

14.04 #

sudo vim /etc/apt/sources.list #修改
deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse

16.04 #

sudo vim /etc/apt/sources.list #修改
deb-src http://archive.ubuntu.com/ubuntu xenial main restricted #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties
deb http://archive.canonical.com/ubuntu xenial partner
deb-src http://archive.canonical.com/ubuntu xenial partner
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse

更新缓存 #

sudo apt-get update #更新列表

ubuntu编译安装vim及配制方法

一个非常好用的vim配置文件

vim简介 #

Vim是一个类似于Vi的著名的功能强大、高度可定制的文本编辑器,在Vi的基础上改进和增加了很多特性。VIM是自由软件。

...

vim 快速入门手册

vim常见操作

图示 #

![vi-vim-cheat-sheet-sch.png](/static/uploads/BJ8I8E9U0M/img/vi-vim-cheat-
sheet-sch_SyLsV8yY4.png)

一、移动光标 #

1、左移h、右移l、下移j、上移k

2、向下翻页ctrl + f,向上翻页ctrl + b

3、向下翻半页ctrl + d,向上翻半页ctrl + u

...

vsftpd 配置方法及访问控制

vsftpd 详细配置说明

vsftpd常用配置 #

#关闭匿名用户访问权限
anonymous_enable=NO
#开启本地用户权限
local_enable=YES
#开启写权限
write_enable=YES
#设置侦听端口
listen_port=21
#写文件时的umask
local_umask=002
#被动模式及开放端口段
#pasv_enable=yes
#pasv_min_port=30000
#pasv_max_port=50000
#超时时间
#idle_session_timeout=6000000
#data_connection_timeout=6000000
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=YES
chroot_local_user=YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd/chroot_list
listen=YES
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
use_localtime=YES
reverse_lookup_enable=NO
#convert_charset_enable=0
#local_charset=UTF8
#remote_charset=GB2312
#double_377=1

创建账户

useradd -M -s /sbin/nologin -d /mnt/usernamefile/ username
for i in name1 name2 name3;do useradd -M -s /sbin/nologin -d /mnt/$i/ $i;done
for i in name1 name2 name3;do echo "$i"123 | passwd --stdin $i ;done

创建目录 #

mkdir usernamefile
chown username:username usernamefile
for i in name1 name2 name3;do mkdir /mnt/$i;done
for i in name1 name2 name3;do chown $i:$i /mnt/$i/;done
chmod -R 770 *

vsftpd被动模式 #

1、开启被动模式 #

vim vsftpd.conf

pasv_enable=YES #开启被动模式
pasv_min_port=3000 #随机最小端口
pasv_max_port=4000 #随机最大端口

2、加载内核 #

modprobe ip_conntrack_ftp
modprobe ip_nat_ftp

3、防火墙 #

vim /etc/sysconfig/iptables 在*filter下加入下
  -A OUTPUT -p tcp --sport 3000:4000 -j ACCEPT
  -A INPUT -p tcp --dport 3000:4000 -j ACCEPT

iptables-restore < /etc/sysconfig/iptables 加载iptables配置

vsftpd虚拟用户 #

1、vsftpd安装 #

yum -y install vsftpd #vsftpd软件
yum -y install db4-utils #生成虚拟用户认证数据文件命令

2、配置vsftp #

vim /etc/vsftpd/vsftpd.conf
  listen=YES #独立运行vsftpd
  anonymous_enable=NO #限制匿名用户登录
  dirmessage_enable=YES
  xferlog_enable=YES
  xferlog_file=/var/log/vsftpd.log
  xferlog_std_format=YES
  chroot_list_enable=YES #限制虚拟用户切换目录
  chroot_list_file=/etc/vsftpd/chroot_list #限制切换目录的用户列表
  chroot_local_user=YES
  guest_enable=YES #开启虚拟用户认证
  guest_username=ftp #映射的真实用户
  user_config_dir=/etc/vsftpd/vsftpd_user_conf #虚拟用户配置目录
  pam_service_name=vsftpd.vu #vsftpd认证的pam认证模块
  local_enable=YES

3、虚拟用户db #

cd /etc/vsftpd
vim user.txt
  yuangang #用户名
  123456 #密码

db_load -T -t hash -f user.txt /etc/vsftpd/vsftpd_login.db
chmod 600 /etc/vsftpd/vsftpd_login.db

# 配置pam认证
vim /etc/pam.d/vsftpd.vu
  auth required /lib/security/pam_userdb.so db=/etc/vsftpd/vsftpd_login
  account required /lib/security/pam_userdb.so db=/etc/vsftpd/vsftpd_login

vim /etc/vsftpd/chroot_list #限制虚拟用户切换目录
  ftp
  yuangang

4、配置虚拟用户 #

cd /etc/vsftpd/vsftpd_user_conf
vim yuangang
  write_enable=YES
  anon_world_readable_only=NO
  anon_upload_enable=YES
  anon_mkdir_write_enable=YES
  anon_other_write_enable=YES
  local_root=/data/httpd/yuangang

# 建立虚拟用户ftp目录
mkdir /data/httpd/yuangang
chown -R ftp.root /data/httpd
chmod o+rw /data/httpd/yuangang

vsftpd cmds_allowed #

cmds_allowed=ABOR,CWD,LIST,MDTM,MKD,NLST,
PASS,PASV,PORT,PWD,QUIT,RETR,RMD,RNFR,
RNTO,SITE,SIZE,STOR,TYPE,USER,ACCT,
APPE,CDUP,HELP,MODE,NOOP,REIN,STAT,STOU,STRU,SYST

注意:一定不能使用换行和空格,不然就没效果..

...

web运维相关查询命令

none

1. 查看TCP连接状态 #

netstat -nat |awk '{print $6}'|sort|uniq -c|sort -rn
netstat -n | awk '/^tcp/ {++S[$NF]};END {for(a in S) print a, S[a]}' 或
netstat -n | awk '/^tcp/ {++state[$NF]}; END {for(key in state) print key,"\t",state[key]}'
netstat -n | awk '/^tcp/ {++arr[$NF]};END {for(k in arr) print k,"\t",arr[k]}'
netstat -n |awk '/^tcp/ {print $NF}'|sort|uniq -c|sort -rn
netstat -ant | awk '{print $NF}' | grep -v '[a-z]' | sort | uniq -c

(以上每一行实现的效果基本相同,在此列出不同的写法,方便对脚本写法的更深理解)

...

zabbix之无法启动问题及解决办法

none

1、

错误提示

zabbix_agentd [1749]: cannot create PID file [/var/run/zabbix/zabbix_agentd.pid]: [2] No such file or directory

解决方法

mkdir /var/run/zabbix/
chown zabbix.zabbix /var/run/zabbix/
chmod g+w /var/run/zabbix/
touch /var/run/zabbix/zabbix_agentd.pid
/etc/init.d/zabbix-agent restart
ps aux | grep zabbix

简析Android集成FFMPEG推流

如今,视频直播行业在中国算是比较热门。在刚刚过去的2015年,视频直播成为互联网行业最抢眼的领域之一。从游戏到秀场,从传统的网页端到移动互联网,各大直播平台包括…

...