echo -e "net.ipv4.ip_forward=1" >> /etc/sysctl.conf
sysctl -p
首先我们设置一下iptables 防火墙的开机启动自动载入规则功能。
# 背景: | |
> 有一台A服务器不能上网,和B服务器通过内网来连接,B服务器可以上网,要实现A服务器也可以上网。 | |
内网主机: A eth1:172.16.1.8 | |
外网主机: B eth0:10.0.0.6 外网主机: B eth1:172.16.1.6 | |
SNAT:改变数据包的源地址。防火墙会使用外部地址,替换数据包的本地网络地址。这样使网络内部主机能够与网络外部通信。 | |
## 在可以上网那台服务器B上,开启内核路由转发功能 | |
### 临时 |
for f in *.mp4; | |
do | |
ffmpeg -i "$f" -vcodec libx264 -crf 28 cpmmp4/"${f%.mp4}".mp4 | |
done |
hostnamectl --static set-hostname qqmm |
select concat('optimize table ',table_schema,'.',table_name,';'),data_free,engine | |
from information_schema.tables | |
where data_free>0 and engine !='MEMORY' | |
ORDER BY data_free DESC ; |
<?php | |
namespace Deployer; | |
require 'recipe/laravel.php'; | |
$repo_url = ''; | |
$branch = 'master'; | |
$server_url = ''; | |
$user = ''; |
# ffmpeg -i rain-drops.ogg -i pouring-rains.ogg -i distant-thounder.ogg -i close-thounder.ogg -i frogs.ogg -filter_complex amix=inputs=5:duration=shortest -acodec libmp3lame rain-thounder.mp3 -y | |
# 把ogg音频文件重复到1800秒,并压缩成为mp3。增加逐渐音量减小到0,也逐渐增加到正常音量 | |
for f in *.ogg; | |
do | |
ffmpeg -i "$f" -vn -sn -c:a mp3 -ab 192k -acodec libmp3lame mp3src/"${f%.ogg}".mp3 -y \ | |
&& ffmpeg -stream_loop 60 -i "$f" -vn -sn -c:a mp3 -ab 192k -t 1800 -acodec libmp3lame mp3src/"${f%.ogg}"-normal.mp3 -y \ | |
&& ffmpeg -stream_loop 60 -i "$f" -vn -sn -c:a mp3 -ab 192k -t 1800 -af "afade=t=out:st=0:d=1800" -acodec libmp3lame mp3src/"${f%.ogg}"-evening.mp3 -y \ | |
&& ffmpeg -stream_loop 60 -i "$f" -vn -sn -c:a mp3 -ab 192k -t 1800 -af "afade=t=in:ss=0:d=1800" -acodec libmp3lame mp3src/"${f%.ogg}"-morning.mp3 -y | |
done |
<?php | |
namespace App\Traits; | |
use App\User; | |
use DateTime; | |
use GuzzleHttp\Psr7\Response; | |
use Illuminate\Events\Dispatcher; | |
use Laravel\Passport\Bridge\AccessToken; | |
use Laravel\Passport\Bridge\AccessTokenRepository; |
server { | |
listen 443 http2 ssl; | |
server_name example.com www.example.com; | |
ssl_certificate /home/user/.acme.sh/example.com_ecc/fullchain.cer; | |
ssl_certificate_key /home/user/.acme.sh/example.com_ecc/example.com.key; | |
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | |
ssl_stapling on; | |
ssl_stapling_verify on; |
.responsive-bg { | |
display: block; | |
width: 100%; | |
background-color: #fff; | |
background-position: center; | |
background-size: cover; | |
background-repeat: no-repeat; | |
overflow: hidden; | |
} | |
.responsive-bg:after { |