常用的一些环境包括编译环境
sudo apt install -y curl proxychains-ng vim openssh-server net-tools make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev llvm libncurses5-dev libncursesw5-dev xz-utils liblzma-dev tk-dev python3-pip tree
下面有某些软件可能国内无法访问,所以先配置代理
sudo sed -i 's/socks4[[:space:]]*127.0.0.1 9050/socks5\t192.168.3.104 10808/' /etc/proxychains4.conf
sudo sed -i '1i\nameserver 8.8.8.8' /etc/resolv.conf
update-alternatives --config editor
允许root登陆
sudo sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
设置开机启动
sudo systemctl enable --now ssh
sudo apt install git -y
git config --global user.name "名字"
git config --global user.email "邮箱地址"
ssh-keygen -t rsa -C '邮箱地址'
cat ~/.ssh/id_rsa.pub
sudo apt install zsh -y
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
国内DNS可能有污染,若失败试试换DNS
2. 配置插件
下载插件的插件
## 自动提示
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
## 高亮
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
~/.zshrc
# 分别找到这两行代码
ZSH_THEME="robbyrussell"
plugins=(git)
# 分别替换成下面的
## 自定义随机主题(几个好用的)
THEMES=(darkblood bira duellj fino-time fox gnzh xiong-chiamiov-plus jonathan random)
## zsh中读取数组是从一开始算
ZSH_THEME=${THEMES[$((1 + ($RANDOM % ${#THEMES[*]})))]}
plugins=(git z zsh-syntax-highlighting zsh-autosuggestions)
或者执行命令
sed -i 's/ZSH_THEME="robbyrussell"/ZSH_THEME="jonathan"/' ~/.zshrc
sed -i 's/plugins=(git)/plugins=(git z zsh-syntax-highlighting zsh-autosuggestions)/' ~/.zshrc
source ~/.zshrc
%Y-%m-%d %H:%M:%S'
格式export TIME_STYLE='+%Y-%m-%d %H:%M:%S'
wget https://repo.anaconda.com/archive/Anaconda3-2023.03-Linux-x86_64.sh
bash Anaconda3-2023.03-Linux-x86_64.sh
# 之后根据提示输入
curl https://pyenv.run | bash
编辑~/.zprofile
和~/.zshrc
,添加
export PYENV_ROOT="$HOME/.pyenv"
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
在~/.zshrc
添加
eval "$(pyenv virtualenv-init -)"
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
pyenv install 3.8.16
pyenv global 3.8.16
pyenv uninstall 3.8.16
pyenv virtualenv 3.8.16 my_env
pyenv virtualenvs
pyenv activate my_env
地址: https://github.com/fatedier/frp
下载: https://github.com/fatedier/frp/releases
wget https://github.com/fatedier/frp/releases/download/v0.48.0/frp_0.48.0_linux_amd64.tar.gz
tar -zxvf frp_0.48.0_linux_amd64.tar.gz
cd frp_0.48.0_linux_amd64
sudo cp frpc /usr/bin/frpc
sudo cp frps /usr/bin/frps
/etc/frp/
sudo vim /etc/frp/frpc.ini
[common]
server_addr = 你的服务端IP
server_port = 你的服务端端口
token = 连接密码
[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 22022
/lib/systemd/system/frpc.service
[Unit]
Description=Frp Client Service
After=network.target
[Service]
Type=simple
User=nobody
Restart=on-failure
RestartSec=5s
ExecStart=/usr/bin/frpc -c /etc/frp/frpc.ini
ExecReload=/usr/bin/frpc reload -c /etc/frp/frpc.ini
LimitNOFILE=1048576
[Install]
WantedBy=multi-user.target
systemctl enable --now frpc.service
在先装windows后装ubuntu的情况下,执行下面的命令会自动识别windows引导项
sudo update-grub2
挑一个好看的主题下载,地址:https://www.gnome-look.org/browse?cat=109&ord=latest
我下载的是Distro
sudo mkdir -p /boot/grub/themes/distro
sudo tar -xvf ubuntu.tar -C /boot/grub/themes/distro/
编辑/etc/default/grub
插入下面内容
GRUB_THEME="/boot/grub/themes/distro/theme.txt"
注释GRUB_TIMEOUT_STYLE=hidden
更新配置
sudo update-grub
地址:https://github.com/lyswhut/lx-music-desktop