Appearance
1. Debian lxc初始化
bash
# 换源
bash <(wget -qO- https://linuxmirrors.cn/main.sh)
#bash <(curl -sSL https://cdn.jsdelivr.net/gh/SuperManito/LinuxMirrors@main/ChangeMirrors.sh)
#bash <(curl -sSL https://linuxmirrors.cn/main.sh)
apt install -y tmux git zsh tar zip unzip vim curl wget openssh-server lsof gpg locales
systemctl enable --now ssh
dkpg-reconfigure locales # 需要自己选择需要的 locale
timedatectl set-timezone Asia/Shanghai # 修改时区
mkdir -p /usr/local/nvm
sed -i '$a\
# NVM 环境变量\
export NVM_BIN="/usr/local/nvm/versions/node" # node安装地址\
export NVM_DIR="/usr/local/nvm" # nvm安装地址\
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # 加载nvm\
# End NVM 环境变量' /etc/profile
# ohmyzsh
# sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# ohmyzsh 国内
sh -c "$(curl -fsSL https://gitee.com/mirrors/oh-my-zsh/raw/master/tools/install.sh \
| sed 's|^REPO=.*|REPO=${REPO:-mirrors/oh-my-zsh}|g' \
| sed 's|^REMOTE=.*|REMOTE=${REMOTE:-https://gitee.com/${REPO}.git}|g')"
sh -c "$(curl -fsSL https://gitee.com/mirrors/oh-my-zsh/raw/master/tools/install.sh)"
sed -i 's/^ZSH_THEME=.*/ZSH_THEME="ys"/' ~/.zshrc
# 禁止ohmyzsh自动更新
sed -i "s/^# \?zstyle ':omz:update' mode disabled/zstyle ':omz:update' mode disabled/" ~/.zshrc
#禁止ohmyzsh自动更新-旧版本用下边这个,两个都操作一下比较好
sed -i 's/^#\?\s*DISABLE_AUTO_UPDATE=.*/DISABLE_AUTO_UPDATE="true"/' ~/.zshrc
# 使zsh加载/etc/profile
#sed -i '$a\
#if [ -f /etc/profile ]; then\
# source /etc/profile\
#fi' ~/.zshrc
echo '[[ -e /etc/profile ]] && emulate sh -c "source /etc/profile"' >> ~/.zprofile
source ~/.zprofile
source ~/.zshrc
# nvm
# curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.2/install.sh | bash
# nvm gitlab
# 改用gitlab来安装nvm githubusercontent.com在国内被墙,安装起来比较麻烦一点
export NVM_SOURCE=https://gitlab.com/mirrorx/nvm.git
curl -o- https://gitlab.com/mirrorx/nvm/-/raw/master/install.sh | bash
echo 'export NVM_NODEJS_ORG_MIRROR=https://npmmirror.com/mirrors/node/' >> ~/.zshrc
source ~/.zshrc
nvm install v22.22.3
# 设置命令行默认node版本
nvm alias default v22.22.3
npm config set registry https://registry.npmmirror.com/
# 更新 npm 并安装常用运行时
npm i -g npm@latest yarn bun deno pm2 pnpm
pnpm config set registry https://registry.npmmirror.com/
# 替换npm
cat << 'EOF' >> /etc/profile
# 将 npm 自动替换为 pnpm
alias npm="pnpm"
alias npx="pnpx"
EOF
source ~/.zprofile
source ~/.zshrcsury php源
curl -sSL https://packages.sury.org/php/README.txt | bash -x
sh -c 'echo "deb https://mirror.sjtu.edu.cn/sury/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
apt install -y php5.6-fpm php5.6-cli php5.6-gd php5.6-xml php5.6-mysql php5.6-mcrypt php5.6-sodium php5.6-bcmath php5.6-curl php5.6-msgpack php5.6-intl php5.6-bz2 php5.6-oauth php5.6-gmp php5.6-zip php5.6-redis php5.6-sqlite3 php5.6-dev
apt install -y php7.4-fpm php7.4-cli php7.4-gd php7.4-xml php7.4-mysql php7.4-mcrypt php7.4-bcmath php7.4-curl php7.4-msgpack php7.4-intl php7.4-bz2 php7.4-oauth php7.4-gmp php7.4-zip php7.4-redis php7.4-sqlite3 php7.4-dev切换php
update-alternatives --query php
update-alternatives --set php /usr/bin/php7.4
update-alternatives --set php-config /usr/bin/php-config7.4
update-alternatives --set phpdbg /usr/bin/phpdbg7.4
update-alternatives --set phpize /usr/bin/phpize7.4
update-alternatives --set php /usr/bin/php5.6
update-alternatives --set php-config /usr/bin/php-config5.6
update-alternatives --set phpdbg /usr/bin/phpdbg5.6
update-alternatives --set phpize /usr/bin/phpize5.6如果需要bt
bash
url=https://download.bt.cn/install/install_panel.sh;if [ -f /usr/bin/curl ];then curl -sSO $url;else wget -O install_panel.sh $url;fi;bash install_panel.sh ed8484bec
url=https://download.bt.cn/install/install_panel.sh;if [ -f /usr/bin/curl ];then curl -sSO $url;else wget -O install_panel.sh $url;fi;bash install_panel.sh la1027112bash
rm -f /www/server/panel/data/admin_path.pl