设置系统时区

1
2
3
4
5
# 查看当前系统时区
timedatectl

# 修改当前系统时区
sudo timedatectl set-timezone Asia/Shanghai

Proxychains4

安装及修改配置文件

1
2
3
4
5
sudo apt install proxychains4 -y
sudo vim /etc/proxychains4.conf
# socks4 127.0.0.1 9050 # 默认 Tor 隧道
+ socks5 192.168.233.1 10810 # 修改为 V2Ray 隧道
: wq # 保存退出

测试结果

1
2
3
4
5
6
7
8
9
10
11
ahost@localhost:~/Downloads$ proxychains4 curl google.com
[proxychains] config file found: /etc/proxychains4.conf
[proxychains] preloading /usr/lib/x86_64-linux-gnu/libproxychains.so.4
[proxychains] DLL init: proxychains-ng 4.16
[proxychains] Strict chain ... 192.168.233.1:10810 ... google.com:80 ... OK
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>301 Moved</TITLE></HEAD><BODY>
<H1>301 Moved</H1>
The document has moved
<A HREF="http://www.google.com/">here</A>.
</BODY></HTML>

Go (Golang)

APT 方式安装

1
sudo apt install golang  # 需要注意安装的版本是否满足自身需求

Linux 二进制软件包安装

(暂无需求,略记)

1
2
wget https://golang.google.cn/dl/go1.19.1.linux-amd64.tar.gz
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.19.1.linux-amd64.tar.gz

源码编译安装

(看官方文档吧…)
Installing Go from source - The Go Programming Language

配置 Go 模考代理

Goproxy.cn

1
2
go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.cn,direct

Goproxy.cn For Windows

1
2
C:\> $env:GO111MODULE = "on"
C:\> $env:GOPROXY = "https://goproxy.cn"

或者

  1. 打开“开始”并搜索“env”
  2. 选择“编辑系统环境变量”
  3. 点击“环境变量…”按钮
  4. 在“<你的用户名> 的用户变量”章节下(上半部分)
  5. 点击“新建…”按钮
  6. 选择“变量名”输入框并输入“GO111MODULE”
  7. 选择“变量值”输入框并输入“on”
  8. 点击“确定”按钮
  9. 点击“新建…”按钮
  10. 选择“变量名”输入框并输入“GOPROXY”
  11. 选择“变量值”输入框并输入“https://goproxy.cn
  12. 点击“确定”按钮

Goproxy.cn For macOS or Linux

1
2
export GO111MODULE=on
export GOPROXY=https://goproxy.cn

或者

1
2
3
echo "export GO111MODULE=on" >> ~/.profile
echo "export GOPROXY=https://goproxy.cn" >> ~/.profile
source ~/.profile

阿里云Go Module代理仓库服务

1
export GOPROXY=https://mirrors.aliyun.com/goproxy/

链接

The Go Programming Language (google.cn)
Go modules services (golang.org)
七牛云 - Goproxy.cn
阿里云Go Module代理服务

设置系统代理

(临时,重启后失效)

1
2
export http_proxy=http://192.168.233.1:10811
export https_proxy=http://192.168.233.1:10811

SSH 上传和下载文件

1
2
3
4
5
6
7
8
# 安装 lrzsz (CentOS)
sudo yum install lrzsz

# 下载
sz filename

# 上传
rz

Docker

手动安装

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# 更新包索引并安装需要的软件
sudo apt update
sudo apt instal ca-certificates cur gnupg lsb-release

# 添加 GPG 密钥
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg

# 设置 repository
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

# 安装 Dockers
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin

脚本安装

1
2
3
4
5
6
7
8
9
10
11
12
13
curl -fsSL https://get.docker.com -o get-docker.sh

# DRY_RUN=1 用于展示安装细节,不会真正执行安装
DRY_RUN=1 sh ./get-docker.sh

# 一键安装
sudo sh get-docker.sh

# 将当前用户添加到 docker 组以非 root 权限启动 docker,执行完后注销并重新登录即可
sudo usermod -aG docker $USER

# 测试是否能够运行, 注意是不带 sudo 的
docker run hello-world

Docker compose

1
2
sudo apt update
sudo apt install docker-compose

Docker 镜像加速

Ubuntu 16.04+、Debian 8+、CentOS 7

写入如下内容,如该文件不存在创建即可:

1
2
3
sudo vim /etc/docker/daemon.json
+ {"registry-mirrors":["https://docker.mirrors.ustc.edu.cn/"]}
: wq

重启服务:

1
2
sudo systemctl daemon-reload
sudo systemctl restart docker

查看加速是否生效:

1
docker info | grep -A 1 Mirrors

官方文档

Install Docker Engine on Ubuntu | Docker Documentation
Install on Linux | Docker Documentation