mirror of
https://codeberg.org/hyperreal/admin-scripts
synced 2024-11-25 09:03:41 +01:00
Update justfile
This commit is contained in:
parent
94b6bcc6bb
commit
fe5bc5dd04
85
justfile
85
justfile
@ -1,4 +1,6 @@
|
|||||||
## Justfile (https://github.com/casey/justfile)
|
## Justfile (https://github.com/casey/justfile)
|
||||||
|
##
|
||||||
|
## Helps automate various homelab tasks.
|
||||||
|
|
||||||
distro := `grep -G "\bID\b" /etc/os-release | awk -F= '{print $2}'`
|
distro := `grep -G "\bID\b" /etc/os-release | awk -F= '{print $2}'`
|
||||||
release := `grep "VERSION_CODENAME" /etc/os-release | awk -F= '{print $2}'`
|
release := `grep "VERSION_CODENAME" /etc/os-release | awk -F= '{print $2}'`
|
||||||
@ -7,11 +9,12 @@ run_user := env_var("USER")
|
|||||||
default: common
|
default: common
|
||||||
|
|
||||||
common:
|
common:
|
||||||
sudo apt update
|
sudo apt update -t {{release}}-backports
|
||||||
sudo apt dist-upgrade -y
|
sudo apt dist-upgrade -y -t {{release}}-backports
|
||||||
sudo apt install -y \
|
sudo apt install -y -t {{release}}-backports \
|
||||||
apt-file \
|
apt-file \
|
||||||
apt-listchanges \
|
apt-listchanges \
|
||||||
|
apt-transport-https \
|
||||||
apt-utils \
|
apt-utils \
|
||||||
atop \
|
atop \
|
||||||
autoconf \
|
autoconf \
|
||||||
@ -23,7 +26,6 @@ common:
|
|||||||
firewalld \
|
firewalld \
|
||||||
git \
|
git \
|
||||||
htop \
|
htop \
|
||||||
httpie \
|
|
||||||
ifplugd \
|
ifplugd \
|
||||||
iotop \
|
iotop \
|
||||||
less \
|
less \
|
||||||
@ -31,6 +33,7 @@ common:
|
|||||||
lynis \
|
lynis \
|
||||||
man-db \
|
man-db \
|
||||||
manpages \
|
manpages \
|
||||||
|
neovim \
|
||||||
nfs-common \
|
nfs-common \
|
||||||
nmon \
|
nmon \
|
||||||
pipx \
|
pipx \
|
||||||
@ -39,10 +42,22 @@ common:
|
|||||||
rclone \
|
rclone \
|
||||||
rsync \
|
rsync \
|
||||||
unattended-upgrades \
|
unattended-upgrades \
|
||||||
vim \
|
|
||||||
wget \
|
wget \
|
||||||
zsh
|
zsh
|
||||||
sudo systemctl enable man-db.timer
|
sudo systemctl enable man-db.timer
|
||||||
|
pipx install glances
|
||||||
|
pipx install gmcapsule
|
||||||
|
|
||||||
|
copy:
|
||||||
|
find "${PWD}/bin" -maxdepth 1 -type f -exec sudo cp -fv {} /usr/local/bin \;
|
||||||
|
find "${PWD}/systemd/system" -maxdepth 1 -type f -exec sudo cp -fv {} /etc/systemd/system \;
|
||||||
|
mkdir -p "${HOME}/.config/systemd/user"
|
||||||
|
find "${PWD}/systemd/user" -maxdepth 1 -type f -exec cp -fv {} "${HOME}/.config/systemd/user" \;
|
||||||
|
|
||||||
|
cleanup:
|
||||||
|
sudo find /usr/local/bin -type f -delete
|
||||||
|
for item in "$(ls "${PWD}/systemd/system")"; do sudo rm -fv "/etc/systemd/system/$item"; done
|
||||||
|
for item in "$(ls "${PWD}/systemd/user")"; do rm -fv "${HOME}/.config/systemd/user/$item"; done
|
||||||
|
|
||||||
caddy-install:
|
caddy-install:
|
||||||
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl
|
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl
|
||||||
@ -51,33 +66,15 @@ caddy-install:
|
|||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt install caddy
|
sudo apt install caddy
|
||||||
|
|
||||||
archivebox-install:
|
|
||||||
sudo apt install -y pipx python3-dev python3-pip nodejs npm curl wget git ripgrep
|
|
||||||
pipx install archivebox
|
|
||||||
pipx install yt-dlp
|
|
||||||
pipx install playwright
|
|
||||||
playwright install --with-deps chromium
|
|
||||||
|
|
||||||
archivebox-init:
|
|
||||||
cd {{archivebox_data}} && archivebox init --setup
|
|
||||||
|
|
||||||
archivebox-setup:
|
|
||||||
cd {{archivebox_data}} && archivebox setup
|
|
||||||
|
|
||||||
thelounge-install:
|
thelounge-install:
|
||||||
curl -s https://api.github.com/repos/thelounge/thelounge-deb/releases/latest | grep "browser_download_url.*deb" | cut -d : -f 2,3 | tr -d \" | wget -qi -
|
curl -s https://api.github.com/repos/thelounge/thelounge-deb/releases/latest | grep "browser_download_url.*deb" | cut -d : -f 2,3 | tr -d \" | wget -qi -
|
||||||
sudo apt install -y ./thelounge*.deb
|
sudo apt install -y ./thelounge*.deb
|
||||||
|
rm -fv ./thelounge*.deb
|
||||||
|
|
||||||
tailscale-install:
|
tailscale-install:
|
||||||
curl -fsSL https://tailscale.com/install.sh | sh
|
curl -fsSL https://tailscale.com/install.sh | sh
|
||||||
sudo tailscale up
|
sudo tailscale up
|
||||||
|
|
||||||
qbt-install:
|
|
||||||
curl -1sLf 'https://dl.cloudsmith.io/public/qbittorrent-cli/qbittorrent-cli/gpg.F8756541ADDA2B7D.key' | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/qbittorrent-cli.gpg
|
|
||||||
sudo wget https://repos.fedarovich.com/{{distro}}/{{release}}/qbittorrent-cli.list -O /etc/apt/sources.list.d/qbittorrent-cli.list
|
|
||||||
sudo apt update
|
|
||||||
sudo apt install -y qbittorrent-cli
|
|
||||||
|
|
||||||
scihub-setup:
|
scihub-setup:
|
||||||
mkdir ~/scihub-torrent-urls
|
mkdir ~/scihub-torrent-urls
|
||||||
lynx -dump -nonumbers -listonly=on https://libgen.rs/repository_torrent/ | grep "\.torrent" | tee ~/scihub-torrent-urls/urls.txt
|
lynx -dump -nonumbers -listonly=on https://libgen.rs/repository_torrent/ | grep "\.torrent" | tee ~/scihub-torrent-urls/urls.txt
|
||||||
@ -98,3 +95,43 @@ docker-install:
|
|||||||
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose docker-compose-plugin
|
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose docker-compose-plugin
|
||||||
sudo systemctl enable --now docker.service
|
sudo systemctl enable --now docker.service
|
||||||
sudo usermod -aG docker {{run_user}}
|
sudo usermod -aG docker {{run_user}}
|
||||||
|
|
||||||
|
rustup:
|
||||||
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
||||||
|
|
||||||
|
rustup-root:
|
||||||
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sudo sh
|
||||||
|
|
||||||
|
rust-tools:
|
||||||
|
source "${HOME}/.cargo/env"
|
||||||
|
cargo install cargo-binstall
|
||||||
|
for pkg in "arp-scan" "bandwhich" "bat" "diskonaut" "du-dust" "fblog" "fd" "hyperfine" "procs" "ripgrep" "skim"; do \
|
||||||
|
cargo-binstall -y "$pkg"; \
|
||||||
|
done
|
||||||
|
|
||||||
|
rust-tools-root:
|
||||||
|
sudo /root/.cargo/bin/cargo install cargo-binstall
|
||||||
|
for pkg in "arp-scan" "bandwhich" "bat" "diskonaut" "du-dust" "fblog" "fd-find" "hyperfine" "procs" "ripgrep" "skim"; do \
|
||||||
|
sudo /root/.cargo/bin/cargo-binstall -y "$pkg"; \
|
||||||
|
done
|
||||||
|
echo 'source "${HOME}/.cargo/env"' | sudo tee -a /root/.bashrc
|
||||||
|
echo 'source "${HOME}/.cargo/env"' | sudo tee -a /root/.zshrc
|
||||||
|
|
||||||
|
neovim:
|
||||||
|
sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
|
||||||
|
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
|
||||||
|
|
||||||
|
mkdir -p "${HOME}/.config/nvim"
|
||||||
|
wget https://cdn.hyperreal.coffee/init.vim -O "${HOME}/.config/nvim/init.vim"
|
||||||
|
|
||||||
|
neovim-root:
|
||||||
|
sudo sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
|
||||||
|
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
|
||||||
|
|
||||||
|
sudo mkdir -p "${HOME}/.config/nvim"
|
||||||
|
sudo wget https://cdn.hyperreal.coffee/init.vim -O "${HOME}/.config/nvim/init.vim"
|
||||||
|
|
||||||
|
zshrc:
|
||||||
|
sudo wget https://cdn.hyperreal.coffee/zshrc -O /etc/zsh/zshrc
|
||||||
|
touch "${HOME}/.zshrc"
|
||||||
|
sudo touch /root/.zshrc
|
||||||
|
Loading…
Reference in New Issue
Block a user