pip换源
配置文件地址:
~/.config/pip/pip.conf
文件内容:
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
命令行操作:
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
附清华大学开源镜像站pypi帮助:
https://mirrors.tuna.tsinghua.edu.cn/help/pypi/
.vimrc
Github项目地址:
git clone --depth=1 https://github.com/amix/vimrc.git ~/.vim_runtime
sh ~/.vim_runtime/install_awesome_vimrc.sh
~/.vim_runtime/vimrcs/extended.vim中 可以禁用主题和背景色,搭配终端配置透明终端
.zshrc
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
if [[ ! -f $HOME/.zi/bin/zi.zsh ]]; then
print -P "%F{33}▓▒░ %F{160}Installing (%F{33}z-shell/zi%F{160})…%f"
command mkdir -p "$HOME/.zi" && command chmod g-rwX "$HOME/.zi"
command git clone -q --depth=1 --branch "main" https://github.com/z-shell/zi "$HOME/.zi/bin" && \
print -P "%F{33}▓▒░ %F{34}Installation successful.%f%b" || \
print -P "%F{160}▓▒░ The clone has failed.%f%b"
fi
source "$HOME/.zi/bin/zi.zsh"
autoload -Uz _zi
(( ${+_comps} )) && _comps[zi]=_zi
# examples here -> https://z-shell.pages.dev/docs/gallery/collection
zicompinit # <- https://z-shell.pages.dev/docs/gallery/collection#minimal zi light-mode for \ z-shell/z-a-meta-plugins \ @annexes @molovo zi light romkatv/powerlevel10k zi light zsh-users/zsh-syntax-highlighting zi load zsh-users/zsh-completions # To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh alias ls="ls --color" alias ll="ls -al" eval $(thefuck --alias) alias proxy='http_proxy="127.0.0.1:10809" https_proxy="127.0.0.1:10809"' alias vi=vim # >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/usr/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/usr/etc/profile.d/conda.sh" ]; then
. "/usr/etc/profile.d/conda.sh"
else
export PATH="/usr/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
alias s=sudo
alias sv="sudo vim"
alias spm="sudo pacman"
alias sc="sudo cat"
Debian/Ubuntu/Raspbian/Armbian换源
软件源配置文件地址:
/etc/apt/sources.list
系统源配置文件地址:
/etc/apt/sources.list.d/***
Debian:
https://mirrors.tuna.tsinghua.edu.cn/help/debian/
Ubuntu:
https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/
Raspbian:
https://mirrors.tuna.tsinghua.edu.cn/help/raspbian/
Armbian:
借鉴Debian源
Arch/Manjaro换源
archlinuxcn配置文件地址:
/etc/pacman.conf
文件末尾添加配置内容:
[archlinuxcn]
SigLevel=Never
Server = https://mirrors.ustc.edu.cn/archlinuxcn/$arch
清华源
Server = https://mirrors.tuna.tsinghua.edu.cn/archlinuxcn/$arch
系统仓库镜像配置文件地址:
/etc/pacman.conf/mirrorlist
文件首添加:
Server = https://mirrors.tuna.tsinghua.edu.cn/archlinux/$repo/os/$arch
Arch/Manjaro安装yay
pacman -S --needed git base-devel
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si
Arch/Manjaro配置fcitx5
参考Archwiki
https://wiki.archlinux.org/title/Fcitx5_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)
#安装基本框架
sudo pacman -S fcitx5-im
#安装中文输入法引擎
sudo pacman -S fcitx5-chinese-addons
#配置环境变量
/etc/environment
GTK_IM_MODULE=fcitx QT_IM_MODULE=fcitx XMODIFIERS=@im=fcitx INPUT_METHOD=fcitx SDL_IM_MODULE=fcitx GLFW_IM_MODULE=ibus
#安装中文词库
sudo pacman -S fcitx5-pinyin-zhwiki
Gnome插件
安装相关依赖
sudo pacman -S gnome-tweeks chrome-gnome-shell gnome-shell-extensions
Google chrome 安装插件
插件推荐
AppIndicator and KStatusNotifierItem Support
更改用户默认的shell为zsh
chsh -s /bin/zsh
或
usermod -s /bin/zsh mln
添加用户到新的用户组
usermod -aG docker mln
tar
打包
tar -cvf ***.tar ***
tar 打包并压缩
tar -zcvf ***.tar.gz ***
tar 解压缩
解压缩.tar.gz
tar -zxvf ***.tar.gz
tar -xvf ***.tar.gz
解压缩.tar.xz
tar -xvf.tar.xz
zip
压缩
zip ***.zip ***
zip -r ***.zip *** 压缩一个目录
解压缩
unzip ***.zip
解压缩到指定目录
unzip -d dir ***.zip
Python虚拟环境管理
conda
Arch/Manjaro python-conda
Raspbian miniconda(不推荐)
初始化
conda init zsh
创建虚拟环境
conda create -n 环境名 python=version
激活虚拟环境
conda activate 环境名
退出虚拟环境
conda deactivate
删除虚拟环境
conda remove -n 环境名 --all
查询所有虚拟环境
conda info -e
virtualenv
pip install virtualenv
创建虚拟环境,须在项目目录下
virtualenv venv
激活虚拟环境
source venv/bin/activate
退出虚拟环境
deactivate