学习grep

1
$ grep [-acinv] [--color=auto] 'string' filename
参数 注释
-a 将二进制文件以字符串形式搜索
-c 计算搜索到目标字符串的次数
-i 无视大小写
-n 输出行号
-v 搜索不带目标字符串的结果
--color=auto 搜索到的关键字添加颜色

git-stash学习

背景

昨天继续部署hexo的时候发现自己使用的主题fexo在Github上有新的commit,于是想对主题进行升级。

更新仓库文件

查看fexo文件夹

1
$ tree -L 1 .
.
├── _config.yml
├── gulpfile.js
├── languages
├── layout
├── LICENSE
├── package.json
├── README.md
├── scripts
├── source
└── yarn.lock

直接使用git pull命令发现_config.yml因被修改过而引起冲突,不能直接将仓库进行pull更新,上网搜索“hexo更新主题”,发现了git stash命令。

……

树莓派使用清华源

Welcome to Ubuntu 19.10 (GNU/Linux 5.3.0-1014-raspi2 aarch64)

1
$ sudo vim /etc/apt/sources.list.d/tsinghua.source.list
# 默认注释了源码镜像以提高 apt update 速度如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ eoan main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ eoan main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ eoan-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ eoan-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ eoan-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ eoan-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ eoan-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ eoan-security main restricted universe multiverse
1
2
$ uname -a
Linux ubuntu 5.3.0-1014-raspi2 #16-Ubuntu SMP Tue Nov 26 11:18:23 UTC 2019 aarch64 aarch64 aarch64 GNU/Linux

V2ray使用QUIC

配置文件

服务端配置config.json

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
{
  "log": {
    "access": "/var/log/v2ray/access.log",
    "error": "/var/log/v2ray/error.log",
    "loglevel": "warning"
  },
  "inbound": {
    "port": 11942,
    "protocol": "vmess",
    "settings": {
      "clients": [
        {
          "id": "********-****-****-****-************",
          "alterId": 64
        }
      ]
    },
    "streamSettings": {
      "network": "quic",
      "security": "tls",
      "quicSettings": {
        "security": "aes-128-gcm",
        "header": {
          "type": "srtp"
        },
        "key": "0"
      },
      "tlsSettings": {
        "serverName": "quic.littleghost.cn",
        "alpn": [
          "http/1.1"
        ],
        "certificates": [
          {
            "certificateFile": "/etc/nginx/certificate/1_quic.littleghost.cn_bundle.crt",
            "keyFile": "/etc/nginx/certificate/2_quic.littleghost.cn.key"
          }
        ]
      }
    }
  },
  "outbound": {
    "protocol": "freedom",
    "settings": {}
  },
  "outboundDetour": [
    {
      "protocol": "blackhole",
      "settings": {},
      "tag": "blocked"
    }
  ],
  "routing": {
    "strategy": "rules",
    "settings": {
      "rules": [
        {
          "type": "field",
          "ip": [
            "0.0.0.0/8",
            "10.0.0.0/8",
            "100.64.0.0/10",
            "127.0.0.0/8",
            "169.254.0.0/16",
            "172.16.0.0/12",
            "192.0.0.0/24",
            "192.0.2.0/24",
            "192.168.0.0/16",
            "198.18.0.0/15",
            "198.51.100.0/24",
            "203.0.113.0/24",
            "::1/128",
            "fc00::/7",
            "fe80::/10"
          ],
          "outboundTag": "blocked"
        }
      ]
    }
  }
}

客户端配置quicConfig.json

……