Knowte

A learning notes.


  • 首页

  • 分类

  • 归档

  • 标签

  • 关于

  • 主站

Linux TCP阻塞控制算法BBR

发表于 2019-04-20 | 分类于 comments-config
字数统计:

启动Linux阻塞控制算法BBR。

阅读全文 »

Nginx 启用HTTP2

发表于 2019-04-19 | 分类于 notes-doc
字数统计:

指定默认端口443、传输加密ssl、http2等;
指定SSL版本为目前安全的TLSv1.2。

1
2
3
4
5
6
7
8
9
10
# cat /etc/nginx/conf.d/default.conf

...
server {
listen 443 ssl http2 default_server;
server_name [host_domain];
ssl_protocols TLSv1.2;
ssl_certificate /path/to/public.crt;
ssl_certificate_key /path/to/private.key;
...

Nginx 启用HTTPS

发表于 2019-04-18 | 分类于 notes-doc
字数统计:

网站使用Let's Encrypt的免费证书,通过默认推荐的Certbot自动配置。

阅读全文 »

Linux 时区

发表于 2019-04-17 | 分类于 notes-doc
字数统计:

Linux时区设置。

timedatectl

1
timedatectl set-timezone Asia/Shanghai

直接创建软链接

1
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

Bash 设置CMD字符编码

发表于 2019-03-24 | 分类于 notes-script
字数统计:

字符转换

iconv

iconv [OPTION…] [-f ENCODING] [-t ENCODING] [INPUTFILE…]

1
iconv -f gbk

切换编码

chcp change code page number

1
2
3
chcp.com 65001 # utf8
chcp.com 936 # gbk
chcp.com 437 # en

Docker 安装

发表于 2019-03-14 | 分类于 notes-cli
字数统计:

安装Docker容器。

阅读全文 »

Nginx 安装

发表于 2019-03-14 | 分类于 notes-doc
字数统计:

Debian

Install the prerequisites:

1
sudo apt install curl gnupg2 ca-certificates lsb-release

To set up the apt repository for stable nginx packages, run the following command:

1
2
echo "deb http://nginx.org/packages/debian `lsb_release -cs` nginx" \
| sudo tee /etc/apt/sources.list.d/nginx.list

If you would like to use mainline nginx packages, run the following command instead:

1
2
echo "deb http://nginx.org/packages/mainline/debian `lsb_release -cs` nginx" \
| sudo tee /etc/apt/sources.list.d/nginx.list

Next, import an official nginx signing key so apt could verify the packages authenticity:

1
curl -fsSL https://nginx.org/keys/nginx_signing.key | sudo apt-key add -

Verify that you now have the proper key:

1
sudo apt-key fingerprint ABF5BD827BD9BF62

The output should contain the full fingerprint 573B FD6B 3D8F BC64 1079 A6AB ABF5 BD82 7BD9 BF62 as follows:

1
2
3
pub   rsa2048 2011-08-19 [SC] [expires: 2024-06-14]
573B FD6B 3D8F BC64 1079 A6AB ABF5 BD82 7BD9 BF62
uid [ unknown] nginx signing key <signing-key@nginx.com>

To install nginx, run the following commands:

1
2
sudo apt update
sudo apt install nginx
1
2
3
apt install nginx -y
service nginx start
# systemctl start nginx

Centos

1
2
3
4
rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
yum install nginx -y
# service nginx start
systemctl start nginx

Android Captive Portal

发表于 2019-02-12 | 分类于 notes-doc
字数统计:

Android Captive Portal setting。

1
settings put global captive_portal_https_url https://www.noisyfox.cn/generate_204

Android Wake Lock

发表于 2019-02-11 | 分类于 notes-doc
字数统计:

Android 凑合地控制唤醒锁。
唤醒与休眠可以通过 /sys/power/ 下的 wake_lock 与 wake_unlock 文件临时性地控制系统休眠与否。在两个文件中分别追加写入字符相当于获得或抵消锁,锁不会重复。

1
echo 'deemedlock' > /sys/power/wake_lock

Portable VS Code 便携模式

发表于 2018-11-01 | 分类于 waredocs-portable
字数统计:

开启

安装目录创建 data 文件夹开启 Portable 模式。

1
2
3
4
|- VSCode-win32-x64-1.25.0-insider
| |- Code.exe (or code executable)
| |- data
| |- ...

迁移

1
2
%APPDATA%\Code                      --->    data\user-data
%USERPROFILE%\.vscode\extensions ---> data
1
2
3
4
5
6
7
8
|- VSCode-win32-x64-1.25.0-insider
| |- Code.exe (or code executable)
| |- data
| | |- user-data
| | | |- ...
| | |- extensions
| | | |- ...
| |- ...

引用

Portable Mode in VS Code

123…5

Velne Wang

Insist on not lazy.

50 文章
12 分类
65 标签
© 2017 — 2020 Velne Wang
由 Hexo 强力驱动
|
主题 — TxeN v5.1.4
0%