|
#!/bin/bash |
|
|
|
set -x |
|
|
|
source /etc/os-release |
|
|
|
sudo sed -e 's|^metalink=|#metalink=|g' \ |
|
-e 's|^#baseurl=http://download.example/pub/fedora/linux|baseurl=https://mirrors.ustc.edu.cn/fedora|g' \ |
|
-i.bak \ |
|
/etc/yum.repos.d/fedora.repo \ |
|
/etc/yum.repos.d/fedora-modular.repo \ |
|
/etc/yum.repos.d/fedora-updates.repo \ |
|
/etc/yum.repos.d/fedora-updates-modular.repo |
|
|
|
sudo dnf install -y https://mirrors.ustc.edu.cn/rpmfusion/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.ustc.edu.cn/rpmfusion/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm |
|
sudo dnf update -y |
|
|
|
sudo dnf install -y https://mirrors.tuna.tsinghua.edu.cn/remi/fedora/remi-release-$VERSION_ID.rpm |
|
sudo dnf config-manager --set-enabled remi |
|
sudo dnf module reset php -y |
|
|
|
sudo dnf -y install dnf-plugins-core |
|
sudo dnf config-manager \ |
|
--add-repo \ |
|
https://mirrors.ustc.edu.cn/docker-ce/linux/fedora/docker-ce.repo |
|
sudo sed -i 's|download.docker.com|mirrors.ustc.edu.cn/docker-ce|g' /etc/yum.repos.d/docker-ce.repo |
|
|
|
sudo dnf groupinstall -y "Development Tools" "Development Libraries" |
|
sudo dnf install -y micro xclip zsh tox nodejs go php php74 \ |
|
java-1.8.0-openjdk-devel java-11-openjdk-devel java-17-openjdk-devel \ |
|
java-latest-openjdk-devel maven gdb python proxychains-ng alien enca \ |
|
figlet asciinema socat htop screen tmux wireguard-tools android-tools \ |
|
mariadb mariadb-server sqlite postgresql postgresql-server \ |
|
docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin |
|
|
|
curl https://sh.rustup.rs -sSf | sh -s -- -y --profile complete --default-toolchain nightly |
|
|
|
sudo dnf install -y qemu qemu-user-static qemu-kvm libvirt virt-install bridge-utils libvirt-devel virt-top libguestfs-tools guestfs-tools |
|
|
|
sudo dnf install -y @virtualization |
|
|
|
sudo usermod -aG docker $USER |
|
|
|
sudo systemctl enable docker --now |
|
sudo systemctl enable mariadb --now |
|
sudo systemctl enable libvirtd --now |
|
|
|
sudo mysql_secure_installation |
|
|
|
mkdir -p ~/.ssh |
|
ssh-keygen -t ed25519 -N "" -f ~/.ssh/id_ed25519 |
|
|
|
pip install -i https://mirrors.ustc.edu.cn/pypi/web/simple pip -U |
|
pip config set global.index-url https://mirrors.ustc.edu.cn/pypi/web/simple |
|
pip install requests impacket |
|
|
|
bash -c "$(curl -fsSL https://gef.blah.cat/sh)" |
|
|
|
sh -c "$(curl -fsSL https://ghproxy.com/https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended |
|
|
|
sudo chsh -s /usr/bin/zsh $USER |
|
|
|
git clone https://ghproxy.com/https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting |
|
git clone https://ghproxy.com/https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions |
|
|
|
sed -i 's|plugins=(git)|plugins=(sudo git per-directory-history zsh-autosuggestions zsh-syntax-highlighting)|g' ~/.zshrc |
|
sed -i 's|ZSH_THEME="robbyrussell"|ZSH_THEME="suvash"|g' ~/.zshrc |
|
sed -i 's|# export PATH=$HOME/bin:/usr/local/bin:$PATH|export PATH=$HOME/bin:/usr/local/bin:$HOME/.local/bin:$PATH|g' ~/.zshrc |
|
|
|
echo 'alias sudo="sudo "' >> ~/.zshrc |
|
echo 'alias mc="micro"' >> ~/.zshrc |