使用 letsencrypt

  • 获取代码

    git clone https://github.com/certbot/certbot
    
  • 生成证书
      ./certbot-auto certonly --standalone --email [email protected] -d www.example.com -d example.com
    

    成功后的输出:

    IMPORTANT NOTES:
     - Congratulations! Your certificate and chain have been saved at:
       /etc/letsencrypt/live/wangsijie.me/fullchain.pem
       Your key file has been saved at:
       /etc/letsencrypt/live/wangsijie.me/privkey.pem
       Your cert will expire on 2019-08-04. To obtain a new or tweaked
       version of this certificate in the future, simply run certbot-auto
       again. To non-interactively renew *all* of your certificates, run
       "certbot-auto renew"
     - If you like Certbot, please consider supporting our work by:
      
       Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
       Donating to EFF:                    https://eff.org/donate-le
    

    如果出现下面的错误,请先关闭占用了 80 端口的程序

    Problem binding to port 80: Could not bind to IPv4 or IPv6.
    
  • NGINX 配置 SSL

    server {
        listen 443;
        server_name wangsijie.me;
      
        root /var/www/blogs;
      
        ssl on;
        ssl_certificate /etc/letsencrypt/live/wangsijie.me/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/wangsijie.me/privkey.pem;
        ssl_ciphers "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_prefer_server_ciphers on;
        ssl_session_cache shared:SSL:10m;
        ssl_stapling on;
        ssl_stapling_verify on;
        ... ...
        ... ...
     }
    

matplotlib 中文显示

#coding:utf-8
import matplotlib.pyplot as plt
plt.rcParams['font.sans-serif']=['SimHei']
plt.rcParams['axes.unicode_minus']=False

后续的中文显示使用 unicode标记

u'测试'

2019 春雪

2019 年春天下了两场雪,一场下了一白天,一场下了一黑夜

alt none

FFMPEG 常用命令

打印视频帧类型

ffprobe -select_streams v -show_frames -show_entries frame=pict_type -of csv input
ffprobe -select_streams v -show_frames -show_entries frame=pict_type -of csv input | grep -n I

Remove Gerrit Group

Gerrit UI 上无法删除已建立的组,所有需要从 Command Line 操作:

  1. 查询组是否存在
    ssh -p port [email protected]  gerrit ls-groups -q DemoGroup
    
  2. 删除 Gerrit 组

    ssh -p port [email protected]  gerrit gsql
    
    gerrit> delete from ACCOUNT_GROUP_NAMES where name='DemoGroup';
    
    gerrit> delete from ACCOUNT_GROUPS where name='DemoGroup';