#!/usr/bin/env bash set -e export DEBIAN_FRONTEND=noninteractive INSTALL_PREPARE="ca-certificates openssl gpg dirmngr chrony tzdata" INSTALL_UTILITY="fish tmux micro mc coreutils moreutils jq sd fzf zip unzip rsync ncdu duf chafa glances procps lsof cron" INSTALL_NETWORK="curl httpie hey iproute2 dnsutils mtr iputils-ping dnsutils tcpdump nmap socat netcat-openbsd" INSTALL_DEVELOP="gcc g++ make cmake binutils pkg-config libssl-dev rustup git git-lfs docker.io docker-compose-v2" # setup if [ ! -f /.dockerenv ]; then sudo update-locale LANG=C.UTF-8 sudo update-locale LC_ALL=C.UTF-8 source /etc/default/locale fi sudo apt update sudo apt install -y $INSTALL_PREPARE $INSTALL_UTILITY $INSTALL_NETWORK $INSTALL_DEVELOP # tweak curl -fsSL https://bash.cc/setup/tmux.conf --create-dirs -o ~/.tmux.conf curl -fsSL https://bash.cc/setup/loadenv.fish --create-dirs -o ~/.config/fish/functions/loadenv.fish curl -fsSL https://bash.cc/setup/fish_prompt.fish --create-dirs -o ~/.config/fish/functions/fish_prompt.fish sudo curl -fsSL https://bash.cc/setup/sysctl.conf -o /etc/sysctl.d/99-tweak.conf LIMITS=$(curl -fsSL https://bash.cc/setup/limits.conf) echo "${LIMITS//\{CURRENT_USER\}/$(whoami)}" | sudo tee /etc/security/limits.d/99-tweak.conf >/dev/null if [ ! -f /.dockerenv ]; then sudo sysctl --system fi sudo chsh -s /usr/bin/fish "$(whoami)" fish -c "set -Ux fish_features qmark-noglob" fish -c "alias --save serve='python3 -m http.server'" mkdir -p ~/.config/micro (cat ~/.config/micro/settings.json 2>/dev/null || echo '{}') | jq '. + {"autosu":true,"mkparents":true}' | sponge ~/.config/micro/settings.json mkdir -p ~/.config/mc [ -f ~/.config/mc/mc.ext.ini ] || cp /etc/mc/mc.ext.ini ~/.config/mc/mc.ext.ini sd '(?m)^\[Include/image\]\n[^\[]*' '[Include/image]\nOpen=chafa %f | less -R\nView=chafa %f | less -R\n\n' ~/.config/mc/mc.ext.ini git lfs install git config --global core.autocrlf false git config --global status.showUntrackedFiles all sudo mkdir -p /etc/docker (cat /etc/docker/daemon.json 2>/dev/null || echo '{}') | jq '. + {"userland-proxy": false}' | sudo sponge /etc/docker/daemon.json sudo usermod -aG docker "$(whoami)" if [ ! -f /.dockerenv ] && [ -z "$(docker ps -q 2>/dev/null)" ]; then sudo systemctl daemon-reload sudo systemctl restart docker fi # final sudo mkdir -p /app sudo chown "$(whoami):$(id -gn)" /app echo "Done"