Skip to content

Instantly share code, notes, and snippets.

@davexpro
davexpro / LNMP_ONE_KEY.sh
Created March 22, 2017 11:17
One Key Install LNMP Environment
rpm -Uvh https://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
rpm -Uvh http://dev.mysql.com/get/mysql57-community-release-el6-8.noarch.rpm
yum -y install make zlib zlib-devel gcc-c++ libtool openssl openssl-devel libxml2 libxml2-devel openssl openssl-devel curl-devel libjpeg-devel libpng-devel freetype-devel libmcrypt-devel mysql-community-server
service mysqld start
chkconfig mysqld on
yum -y install php70w php70w-cli php70w-common php70w-gd php70w-ldap php70w-mbstring php70w-mcrypt php70w-mysql php70w-pdo php70w-pecl-imagick php70w-pecl-redis php70w-opcache php70w-fpm
service php-fpm start
chkconfig php-fpm on
yum -y install redis nginx
@davexpro
davexpro / make_parallel.py
Created August 1, 2017 14:46 — forked from ypwhs/make_parallel.py
Keras 多 GPU 同步训练
from keras.layers.merge import Concatenate
from keras.layers.core import Lambda
from keras.models import Model
import tensorflow as tf
def make_parallel(model, gpu_count):
def get_slice(data, idx, parts):
shape = tf.shape(data)
size = tf.concat([ shape[:1] // parts, shape[1:] ],axis=0)
@davexpro
davexpro / waya-dl-setup.sh
Created October 23, 2017 11:15 — forked from mjdietzx/waya-dl-setup.sh
Install CUDA Toolkit v8.0 and cuDNN v6.0 on Ubuntu 16.04
#!/bin/bash
# install CUDA Toolkit v8.0
# instructions from https://developer.nvidia.com/cuda-downloads (linux -> x86_64 -> Ubuntu -> 16.04 -> deb (network))
CUDA_REPO_PKG="cuda-repo-ubuntu1604_8.0.61-1_amd64.deb"
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/${CUDA_REPO_PKG}
sudo dpkg -i ${CUDA_REPO_PKG}
sudo apt-get update
sudo apt-get -y install cuda
@davexpro
davexpro / git_toturial
Created November 4, 2017 07:32 — forked from guweigang/git_toturial
git命令大全
git init # 初始化本地git仓库(创建新仓库)
git config --global user.name "xxx" # 配置用户名
git config --global user.email "xxx@xxx.com" # 配置邮件
git config --global color.ui true # git status等命令自动着色
git config --global color.status auto
git config --global color.diff auto
git config --global color.branch auto
git config --global color.interactive auto
git config --global --unset http.proxy # remove proxy configuration on git
git clone git+ssh://git@192.168.53.168/VT.git # clone远程仓库

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

截图片