This commit is contained in:
dongly 2022-12-21 10:31:22 +00:00
commit 8a90bbfd9c
2 changed files with 52 additions and 0 deletions

35
install-fastgithub.sh Normal file
View File

@ -0,0 +1,35 @@
# /bin/bash
# root 专用
get_github_latest_release() {
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value
}
# 获取最新版本号
tag_name=$(get_github_latest_release "dotnetcore/FastGithub")
echo tag_name = $tag_name
# 最新版地址:
url="https://gh.tj20.top/https://github.com/dotnetcore/FastGithub/releases/download/$tag_name/fastgithub_linux-x64.zip"
echo url = $url
sudo /usr/fastgithub_linux-x64/fastgithub stop
rm -rfv /usr/fastgithub_linux-x64
mkdir -p ~/bin
wget --no-check-certificate --content-disposition $url -O -|busybox unzip -d /usr -
# sudo chmod +x ~/bin/fastgithub_linux-x64/fastgithub
sudo /usr/fastgithub_linux-x64/fastgithub start
# 公用
sed -i '/^.*fastgithub.*$/d' ~/.zshrc
sed -i '/^\s*export\s\s*all_proxy.*$/d' ~/.zshrc
sed -i '/^\s*export\s\s*http[s]_proxy.*$/d' ~/.zshrc
cat << EOF >> ~/.zshrc
export all_proxy=http://127.0.0.1:38457
EOF
source ~/.zshrc

17
install-oh-my-zsh.sh Normal file
View File

@ -0,0 +1,17 @@
#!/bin/bash
# root 专用
sudo apt-get update
sudo apt-get install -y zsh git
# 公用
rm -rfv ~/.oh-my-zsh
REMOTE=https://gitee.com/mirrors/oh-my-zsh.git RUNZSH="no" sh -c "$(wget https://gitee.com/mirrors/oh-my-zsh/raw/master/tools/install.sh -O -)"
# REMOTE=https://gh.tj20.top/https://github.com/ohmyzsh/ohmyzsh.git RUNZSH="no" sh -c "$(wget https://gh.tj20.top/https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
echo modify ~/.zshrc
sed -i 's|# export PATH=$HOME/bin:/usr/local/bin|export PATH=$HOME/bin|g' ~/.zshrc
sed -i 's/^\s*ZSH_THEME="robbyrussell"/# ZSH_THEME="robbyrussell"\nZSH_THEME="agnoster"/g' ~/.zshrc
sed -i 's/^\s*plugins=\(.*\)/plugins=\(git z extract\)\n# plugins=\(git z extract docker docker-compose\)/g' ~/.zshrc
# sed -i 's/^\s*plugins=\(.*\)/plugins=\(git z extract docker docker-compose\)/g' ~/.zshrc # docker
# zsh (anon):12: character not in range
# sed -i 's|^\s*source \$ZSH/oh-my-zsh.sh|export LC_ALL=C.UTF-8\nexport LANG=C.UTF-8\n\nsource \$ZSH/oh-my-zsh.sh|g' ~/.zshrc
echo 'Starting zsh ...'
zsh -l