常用命令

常用命令

重启网络

service networking restart/stop/start

允许通过eth0来转发10.8.2.0/16的流量

iptables -t nat -A POSTROUTING -s 10.8.2.0/16 -o eth0 -j MASQUERADE

linux查找文件

find [path] -name "name*"

功能:杀死进程名称中包含qemu的所有进程

aux|grep qemu|awk '{print $2}'|xargs kill -9
pkill -f qemu -e

nginx 启用https并且自动从http跳往https

server {
    listen       443 ssl;
    server_name simiki.xulog.com;

    ssl_certificate     /etc/nginx/cert/simiki.xulog.com.crt;
    ssl_certificate_key /etc/nginx/cert/simiki.xulog.com.key;

    add_header Strict-Transport-Security "max-age=31536000";

    location / {
        root   /home/simiki/output;
        index  index.html index.htm;
    }
}

server {
       listen         80;
       server_name    simiki.xulog.com;
       return         301 https://$server_name$request_uri;
}

acme.sh 签发证书

acme.sh --issue -d simiki.xulog.com -w /home/simiki/output

acme.sh --installcert -d simiki.xulog.com \
--keypath  /etc/nginx/cert/simiki.xulog.com.key  \
--fullchainpath /etc/nginx/cert/simiki.xulog.com.crt \
--reloadcmd  "service nginx reload"