View set-env.sh
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 | |
eval `ssh-agent -s` | |
{ sleep .1; echo PASSPHRASE } | script -q /dev/null -c 'ssh-add' |
View CPUs-monitor.sh
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 | |
function getCPU(){ | |
LCPU=`grep "^processor" /proc/cpuinfo | sort -u | wc -l` | |
echo -n $LCPU-1 | |
} | |
function getCpuUtilizationByCore(){ | |
# Format: cpu<Number> | |
local CoreName="$1" |
View ffmpeg-build.sh
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
# Watch video: https://youtu.be/qLw6ZWUXy7U | |
#Require for Compiler | |
apt-get install -y autoconf automake build-essential cmake git-core libass-dev libfreetype6-dev libgnutls28-dev libsdl2-dev libtool libva-dev libvdpau-dev libvorbis-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev meson ninja-build pkg-config texinfo wget yasm zlib1g-dev | |
#Require for FFmpeg | |
apt-get install nasm libx264-dev libx265-dev libnuma-dev libvpx-dev libfdk-aac-dev libmp3lame-dev libopus-dev libunistring-dev | |
mkdir ~/ffmpeg_sources | |
cd ~/ffmpeg_sources |
View show-ms.html
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
<!DOCTYPE html> | |
<html> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<!-- | |
modidfy from https://codepen.io/jasonleewilson/pen/gPrxwX | |
--> | |
<head> | |
<title>OBS - show time milliseconds</title> |
View Redis benchmark - 2vCPU 4GB (CPU-Optimized)
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
# CPU-Optimized | |
# 2 vCPUs | |
# 4GB / 25GB Disk | |
# ($40/mo) | |
# | |
====== PING_INLINE ====== | |
100000 requests completed in 1.54 seconds | |
50 parallel clients | |
3 bytes payload | |
keep alive: 1 |
View web-backup.sh
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 | |
DATE=$(date +%Y-%m-%d) | |
BACKUP_DIR="/mnt/backup-web/" | |
# To create a new directory into backup directory location. | |
#mkdir -p $BACKUP_DIR/$DATE | |
# take each website backup in separate name, use below format. | |
tar -zcvpf $BACKUP_DIR/my-website-$DATE.tar.gz /my-website |
View simple-php-load-test.php
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
<?php | |
$time = microtime(); | |
$time = explode(' ', $time); | |
$time = $time[1] + $time[0]; | |
$start = $time; | |
for ($i=0 ; $i<1000000 ; $i++) { | |
serialize($list); | |
} |
View ffmpeg_v3.3_flv_hevc.patch
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
From 88287f270df660645b3f6c813ab3fd7ad522e64c Mon Sep 17 00:00:00 2001 | |
From: KSC-VBU-SR <KSC-VBU-SRE@kingsoft.com> | |
Date: Wed, 14 Jun 2017 21:33:54 +0800 | |
Subject: [PATCH] The RTMP protocol extensions for H.265/HEVC | |
--- | |
libavformat/flv.h | 1 + | |
libavformat/flvdec.c | 16 +++++++++++++--- | |
libavformat/flvenc.c | 29 ++++++++++++++++++++--------- | |
3 files changed, 34 insertions(+), 12 deletions(-) |
View sysctl.conf
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
## tuning by patrickz ## | |
## inspire from https://klaver.it/linux/sysctl.conf | |
## inspire from https://gist.github.com/voluntas/bc54c60aaa7ad6856e6f6a928b79ab6c | |
fs.file-max = 209708 | |
fs.suid_dumpable = 0 | |
kernel.core_uses_pid = 1 | |
kernel.exec-shield = 1 | |
kernel.kptr_restrict = 1 | |
kernel.maps_protect = 1 |
View sysctl.conf
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
## tuning by patrickz ## | |
## inspire from https://klaver.it/linux/sysctl.conf | |
## inspire from https://gist.github.com/voluntas/bc54c60aaa7ad6856e6f6a928b79ab6c | |
fs.file-max = 209708 | |
fs.suid_dumpable = 0 | |
kernel.core_uses_pid = 1 | |
kernel.exec-shield = 1 | |
kernel.kptr_restrict = 1 | |
kernel.maps_protect = 1 |
NewerOlder