admin-scripts/justfile
2024-07-14 18:51:57 -05:00

101 lines
3.5 KiB
Makefile

## Justfile (https://github.com/casey/justfile)
distro := `grep -G "\bID\b" /etc/os-release | awk -F= '{print $2}'`
release := `grep "VERSION_CODENAME" /etc/os-release | awk -F= '{print $2}'`
run_user := env_var("USER")
default: common
common:
sudo apt update
sudo apt dist-upgrade -y
sudo apt install -y \
apt-file \
apt-listchanges \
apt-utils \
atop \
autoconf \
automake \
build-essential \
byobu \
cmake \
curl \
firewalld \
git \
htop \
httpie \
ifplugd \
iotop \
less \
libpam-systemd \
lynis \
man-db \
manpages \
nfs-common \
nmon \
pipx \
python3-dev \
python3-pip \
rclone \
rsync \
unattended-upgrades \
vim \
wget \
zsh
sudo systemctl enable man-db.timer
caddy-install:
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update
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:
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
tailscale-install:
curl -fsSL https://tailscale.com/install.sh | sh
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:
mkdir ~/scihub-torrent-urls
lynx -dump -nonumbers -listonly=on https://libgen.rs/repository_torrent/ | grep "\.torrent" | tee ~/scihub-torrent-urls/urls.txt
cd ~/scihub-torrent-urls && split -l 60 ~/scihub-torrent-urls/urls.txt torrent-
rm -fv ~/scihub-torrent-urls/urls.txt
docker-install:
for pkg in docker.io docker-doc docker-compose podman-docker containerd runc; do sudo apt remove $pkg; done
sudo apt update
sudo apt install -y ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/{{distro}}/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/{{distro}} {{release}} stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
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 usermod -aG docker {{run_user}}