1. 生成 SSH 密钥
迁移旧资料
2. 更换软件源
sudo bash -c "cat << EOF > /etc/apt/sources.list && apt update
deb http://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse
EOF"
预装软件库
sudo apt install -y git vim autossh aptitude curl rsync locate net-tools
redis / mysql 等中间件,只安装 client
sudo apt install -y default-mysql-client redis-tools
配置及界面工具
sudo apt install -y gnome-tweaks papirus-icon-theme numix-gtk-thme numix-icon-theme
安装 python
sudo apt install -y python3 python3-pip python-is-python3
mkdir -p ~/.pip
cat <<EOF | sudo tee ~/.pip/pip.conf
[global]
index-url=https://pypi.tuna.tsinghua.edu.cn/simple/
EOF
sudo mkdir -p /root/.pip
cat <<EOF | sudo tee /root/.pip/pip.conf
[global]
index-url=https://pypi.tuna.tsinghua.edu.cn/simple/
EOF
sudo python -m pip install virtualenv virtualenvwrapper
系统配置
挂载配置
修改 /etc/fstab,注释掉 swapfile 这一行,然后添加 .host 行,否则虚拟文件夹自动挂不进去。
#/swapfile none swap sw 0 0
.host:/ /mnt/hgfs fuse.vmhgfs-fuse allow_other,defaults 0 0
然后 sudo mount -a 应用配置。
加速关机
关机或重启会遇到 A stop job is running for snappy daemon 这问题, 为了能够快速重启或关机修改配置文件
修改 /etc/systemd/system.conf
DefaultTimeoutStartSec=3s
DefaultTimeoutStopSec=3s
然后:systemctl daemon-reload
安装字体
下载 Sarasa Mono SC 字体
github.com/be5invis/Sa… 下载 TTF 版本即可,解压提取 Mono SC 的版本:
# 先将 ttf 字体文件解压到共享文件夹的 sarasa 目录下
mkdir -p ~/.local/share/fonts
cp /mnt/hgfs/share/sarasa/sarasa-mono-sc-*.ttf ~/.local/share/fonts
界面配置
打开“优化(gnome-tweaks)”,将所有字体设置为“等距更纱黑体”。
外观界面改成 Numix,图标改成 Papirus:
安装 IDE
准备好目录,IDE 全部装在 ~/ide 目录里面。
mkdir ~/ide
cd ~/ide
安装 JetBrains 系列 IDE
GoLand:
PyCharm:
WebStorm:
设置 vimrc 偏好
涉及这几个文件:
touch ~/.vimrc
ln -s ~/.vimrc ~/.ideavimrc
vim ~/.vimrc
编辑一下内容:
"echo "Hello friend, This is the VimScript Configuration\n"
"echo "The configuration file is under ~/.vimrc\n"
"echo "\n"
"echo "=============== ATTENTION!!!! ===============\n"
"echo "The vimscript has been configured to a special\n"
"echo "mode, the initial arrow key is disabled. And\n"
"echo "the <esc> key is also disabled, to escape from\n"
"echo "insert mode, press <jk> instead."
" syntax on " 自动语法高亮
" colorscheme molokai " 配色方案
" set nocompatable " 关闭 vi 兼容模式
set number " 显示行号
" set cursorline " 突出显示当前行
set ruler " 显示标尺栏
set shiftwidth=4 " 设定 << 和 >> 移动宽度为 4
set softtabstop=4 " 设定退格时一次删掉四个空格
set nobackup " 覆盖文件时不备份
set autochdir " 自动切换当前目录为文件所在目录
set nowrap " 不换行
set backspace=indent,eol,start " 退格键删除自动锁紧/删除上一行回车
set expandtab " 使用空格替换 tab
set autoindent " 自动缩进
set encoding=utf-8 "
set clipboard+=unnamed " 添加系统剪贴板到 vim
set paste
" set leader
let mapleader = ','
" edit and source the .vimrc file
nnoremap <leader>ev :split ~/.ideavimrc<cr>
nnoremap <leader>sv :source ~/.ideavimrc<cr>
" exit edit mode key
inoremap jk <esc>
inoremap <esc> <nop>
" disable normal direction keys
inoremap <up> <nop>
inoremap <down> <nop>
inoremap <left> <nop>
inoremap <right> <nop>
nnoremap <up> <nop>
nnoremap <down> <nop>
nnoremap <left> <nop>
nnoremap <right> <nop>
安装浏览器
安装 Chromium
sudo aptitude install chromium-browser
彻底卸载 Firefox
sudo apt remove --purge firefox
sudo snap remove --purge firefox
3. 搭建代理
安装 docker
参考:zhuanlan.zhihu.com/p/588264423
# Step 1. 添加阿里的 Docker 镜像仓库证书
curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/aliyun-docker.gpg
# Step 2. 添加仓库
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/aliyun-docker.gpg] https://mirrors.aliyun.com/docker-ce/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
# Step 3. 安装
sudo apt update
sudo apt install -y docker-ce
# Step 4. 将当前用户加入 docker 组
sudo usermod -aG docker $USER
newgrp docker