Android N 禁止 StatusBar 下拉

frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java

   @Override
    public boolean onTouchEvent(MotionEvent event) {
        boolean barConsumedEvent = mBar.interceptTouchEvent(event);

        if (DEBUG_GESTURES) {
            if (event.getActionMasked() != MotionEvent.ACTION_MOVE) {
                EventLog.writeEvent(EventLogTags.SYSUI_PANELBAR_TOUCH,
                        event.getActionMasked(), (int) event.getX(), (int) event.getY(),
                        barConsumedEvent ? 1 : 0);
            }
        }

        /* bengin */
        //return barConsumedEvent || super.onTouchEvent(event);
        return false;
        /* end */
    }

frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java

        if (MULTIUSER_DEBUG) {
            mNotificationPanelDebugText = (TextView) mNotificationPanel.findViewById(
                    R.id.header_debug_info);
            mNotificationPanelDebugText.setVisibility(View.VISIBLE);
        }

        try {
            boolean showNav = mWindowManagerService.hasNavigationBar();
            if (DEBUG) Log.v(TAG, "hasNavigationBar=" + showNav);
            if (showNav) {
                /* Begin */
                //createNavigationBar();
                /* End */
            }
        } catch (RemoteException ex) {
            // no window manager? good luck with that
        }

        changeBarHideStatus();

禁止 oh-my-zsh 自动转义特殊字符

找到 oh-my-zsh 的配置文件夹,一般路径在 ~/.oh-my-zsh/lib/misc.zsh,打开,注释掉 if语句中的内容:

# *-magic is known buggy in some versions; disable if so
#if [[ $DISABLE_MAGIC_FUNCTIONS != true ]]; then
# for d in $fpath; do
#   if [[ -e "$d/url-quote-magic" ]]; then
#       if is-at-least 5.1; then
#           autoload -Uz bracketed-paste-magic
#           zle -N bracketed-paste bracketed-paste-magic
#       fi
#       autoload -Uz url-quote-magic
#       zle -N self-insert url-quote-magic
#      break
#   fi
#  done
#fi

使用 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