From 9da84a69f2a8fc7a5257e17f446837acad9f1a4f Mon Sep 17 00:00:00 2001 From: AnthonyAxenov Date: Sat, 8 Feb 2025 12:10:23 +0800 Subject: [PATCH 01/12] free-space misc --- tools/free-space.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/free-space.sh b/tools/free-space.sh index 64b8b8e..d2511dd 100755 --- a/tools/free-space.sh +++ b/tools/free-space.sh @@ -13,12 +13,14 @@ sudo apt autoclean sudo apt clean echo "" -echo "[2/5] Removing old journalctl logs" +echo "[2/5] Removing old system logs" echo "" sudo journalctl --vacuum-time=1d sudo rm -rf /var/log/journal/user-*@* sudo rm -rf /var/log/journal/system*@* +sudo rm /var/log/{syslog,dmesg,btmp}.* +sudo rm /var/log/{auth,dpkg,kern,alternatives,dmesg}.log.* echo "" echo "[3/5] Cleaning user trash and thumbnails" @@ -43,6 +45,10 @@ sudo snap list --all | awk '/disabled/{print $1, $3}' | sudo snap remove "$snapname" --revision="$revision" done + + + + echo "" echo "" df -h From 8da2059d1ee0e04f2a34e454c8d4cbea96d22610 Mon Sep 17 00:00:00 2001 From: AnthonyAxenov Date: Sat, 8 Feb 2025 13:19:16 +0800 Subject: [PATCH 02/12] basic.sh new functions --- helpers/basic.sh | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/helpers/basic.sh b/helpers/basic.sh index e3e9ed4..e301d32 100644 --- a/helpers/basic.sh +++ b/helpers/basic.sh @@ -5,6 +5,34 @@ source $( dirname $(readlink -e -- "${BASH_SOURCE}"))/io.sh || exit 255 # Little handy helpers for scripting ######################################################## +is_bash() { + [[ "$(basename "$SHELL")" != "bash" ]] +} + +is_sourced() { + [[ "${BASH_SOURCE[0]}" != "$0" ]] +} + +is_root() { + [[ "$(id -u)" -ne 0 || $(ps -o comm= -p $PPID) == "sudo" ]] +} + +get_os() { + case "$(uname -s)" in + Linux*) echo Linux ;; + Darwin*) echo Macos ;; + CYGWIN*) echo Cygwin ;; + MINGW*) echo MinGw ;; + MSYS_NT*) echo Git ;; + *) return 1 ;; + esac +} + +get_os_id() { + [ -f /etc/os-release ] && source /etc/os-release + echo "$ID" +} + # convert relative path $1 to full one abspath() { echo $(realpath -q "${1/#\~/$HOME}") @@ -93,3 +121,7 @@ is_int() { is_number() { [[ "$1" =~ ^[0-9]+([.,][0-9]+)?$ ]] } + +trim() { + echo "$1" | xargs +} From 3696cc06af7488b1f2c1675f146168738ecdd2ac Mon Sep 17 00:00:00 2001 From: AnthonyAxenov Date: Sat, 8 Feb 2025 13:21:31 +0800 Subject: [PATCH 03/12] new traps example --- helpers/traps.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 helpers/traps.sh diff --git a/helpers/traps.sh b/helpers/traps.sh new file mode 100644 index 0000000..f96de90 --- /dev/null +++ b/helpers/traps.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +#TODO source basic.sh +#TODO source args-parser/args.sh + +######################################################## +# Trap usage examples +######################################################## + +# for sig in SIGHUP SIGINT SIGQUIT SIGABRT SIGKILL SIGTERM SIGTSTP; do +# # shellcheck disable=SC2064 +# trap "set +x && echo && echo && echo '*** Прервано сигналом $sig, остановка ***' && exit" $sig +# done + +for sig in SIGHUP SIGINT SIGQUIT SIGABRT SIGKILL SIGTERM SIGTSTP; do + trap "myfunc" $sig +done + +myfunc() { + echo "trapped!" + exit +} From 66126167c81dfaa64630267c0a333c102d2a1044 Mon Sep 17 00:00:00 2001 From: AnthonyAxenov Date: Sat, 8 Feb 2025 13:23:48 +0800 Subject: [PATCH 04/12] io misc --- helpers/io.sh | 60 +++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 49 insertions(+), 11 deletions(-) diff --git a/helpers/io.sh b/helpers/io.sh index 724dadb..d599bb9 100644 --- a/helpers/io.sh +++ b/helpers/io.sh @@ -76,9 +76,14 @@ ask() { } print() { + # if [ -n "$SPINNER_PID" ] && ps -p $SPINNER_PID > /dev/null; then kill $SPINNER_PID > /dev/null; fi echo -e "$*${FRESET}" } +link() { + echo -e "\e]8;;$2\a$1\e]8;;\a" +} + debug() { if [ "$2" ]; then print "${FDIM}${FBOLD}${FRESET}${FDIM}$(now)${IDEBUG} ${FUNCNAME[1]:-?}():${BASH_LINENO:-?}\t$1 " >&2 @@ -141,20 +146,53 @@ die() { exit ${2:-255} } -var='test var_dump' -var_dump var -debug 'test debug' -verbose 'test verbose' -info 'test info' -note 'test note' -success 'test success' -warn 'test warn' -error 'test error' -fatal 'test fatal' -die 'test die' +# var='test var_dump' +# var_dump var +# debug 'test debug' +# verbose 'test verbose' +# info 'test info' +# note 'test note' +# success 'test success' +# warn 'test warn' +# error 'test error' +# fatal 'test fatal' +# die 'test die' # experiments ============================================================================== +# spinner() { +# local frames=('⠋' '⠙' '⠹' '⠸' '⠼' '⠴' '⠦' '⠧' '⠇' '⠏') +# local spin_i=0 +# local interval=0.1 +# printf "\e[?25l" + +# local color="${FGREEN}" + +# while true; do +# printf "\r ${color}%s${CL}" "${frames[spin_i]}" +# spin_i=$(( (spin_i + 1) % ${#frames[@]} )) +# sleep "$interval" +# done +# } + +# echo "lorem ipsum dolor sit amet" +# spinner & +# SPINNER_PID=$! + + + + + + + + + + + + +# =========== + + # https://unix.stackexchange.com/a/269085 # https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit # https://linuxcommand.org/lc3_adv_tput.php From 526dade1f847b7b87f45e139457a0c8b7f6591c1 Mon Sep 17 00:00:00 2001 From: AnthonyAxenov Date: Sat, 8 Feb 2025 13:24:30 +0800 Subject: [PATCH 05/12] new help examples --- helpers/help.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 helpers/help.sh diff --git a/helpers/help.sh b/helpers/help.sh new file mode 100644 index 0000000..2572a23 --- /dev/null +++ b/helpers/help.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash +#TODO source basic.sh +#TODO source args-parser/args.sh + +######################################################## +# Help functions +######################################################## + +process_help_arg() { + command="${FUNCNAME[1]}" + need_help=$(arg help 1) + [[ "$need_help" -eq 0 ]] && need_help=$(argl help 1) + [[ "$need_help" -eq 1 ]] && help "$command" +} + +help() { + is_function "help.$1" && help."$1" && exit + echo "Main help message" +} + +help.example() { + echo "Example help message" +} + +example() { + process_help_arg + echo "Example command" +} From 29e5c960dee588e6f7f723c7e638cf01380a1ec6 Mon Sep 17 00:00:00 2001 From: AnthonyAxenov Date: Sat, 8 Feb 2025 13:25:41 +0800 Subject: [PATCH 06/12] docker, network and others --- helpers/docker.sh | 31 ++++++++++++++++++++++++++++ helpers/misc.sh | 47 +++++-------------------------------------- helpers/net.sh | 51 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 87 insertions(+), 42 deletions(-) create mode 100644 helpers/net.sh diff --git a/helpers/docker.sh b/helpers/docker.sh index 3fa8229..85382b9 100644 --- a/helpers/docker.sh +++ b/helpers/docker.sh @@ -46,3 +46,34 @@ docker.exec() { debug "Команда: $cmd" $cmd } + +# Выводит информацию о контейнере +docker.inspect() { + cmd="docker inspect $*" + debug "Команда: $cmd" + $cmd 2>/dev/null +} + +docker.ip() { # not finished + if [ "$1" ]; then + if [ "$1" = "-a" ]; then + docker ps -aq \ + | xargs -n 1 docker inspect --format '{{.Name}}{{range .NetworkSettings.Networks}} {{.IPAddress}}{{end}}' \ + | sed -e 's#^/##' \ + | column -t + elif [ "$1" = "-c" ]; then + docker-compose ps -q \ + | xargs -n 1 docker inspect --format '{{.Name}}{{range .NetworkSettings.Networks}} {{.IPAddress}}{{end}}' \ + | sed -e 's#^/##' \ + | column -t + else + docker inspect --format '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' "$1" + docker port "$1" + fi + else + docker ps -q \ + | xargs -n 1 docker inspect --format '{{.Name}}{{range .NetworkSettings.Networks}} {{.IPAddress}}{{end}}' \ + | sed -e 's#^/##' \ + | column -t + fi +} diff --git a/helpers/misc.sh b/helpers/misc.sh index 199d335..00cd46d 100644 --- a/helpers/misc.sh +++ b/helpers/misc.sh @@ -6,10 +6,10 @@ # https://askubuntu.com/a/30414 is_full_screen() { - local WINDOW=$(echo $(xwininfo -id $(xdotool getactivewindow) -stats | \ - egrep '(Width|Height):' | \ - awk '{print $NF}') | \ - sed -e 's/ /x/') + local WINDOW=$(xwininfo -id "$(xdotool getactivewindow)" -stats \ + | grep -E '(Width|Height):' \ + | awk '{print $NF}' \ + | sed -e 's/ /x/') local SCREEN=$(xdpyinfo | grep -m1 dimensions | awk '{print $2}') if [ "$WINDOW" = "$SCREEN" ]; then return 0 @@ -17,19 +17,6 @@ is_full_screen() { return 1 } -curltime() { - curl -w @- -o /dev/null -s "$@" <<'EOF' - time_namelookup: %{time_namelookup} sec\n - time_connect: %{time_connect} sec\n - time_appconnect: %{time_appconnect} sec\n - time_pretransfer: %{time_pretransfer} sec\n - time_redirect: %{time_redirect} sec\n - time_starttransfer: %{time_starttransfer} sec\n - ---------------\n - time_total: %{time_total} sec\n -EOF -} - ytm() { youtube-dl \ --extract-audio \ @@ -38,29 +25,5 @@ ytm() { --format bestaudio \ --write-info-json \ --output "$HOME/Downloads/ytm/%(playlist_title)s/%(channel)s - %(title)s.%(ext)s" \ - $* -} - -docker.ip() { # not finished - if [ "$1" ]; then - if [ "$1" = "-a" ]; then - docker ps -aq \ - | xargs -n 1 docker inspect --format '{{.Name}}{{range .NetworkSettings.Networks}} {{.IPAddress}}{{end}}' \ - | sed -e 's#^/##' \ - | column -t - elif [ "$1" = "-c" ]; then - docker-compose ps -q \ - | xargs -n 1 docker inspect --format '{{.Name}}{{range .NetworkSettings.Networks}} {{.IPAddress}}{{end}}' \ - | sed -e 's#^/##' \ - | column -t - else - docker inspect --format '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' "$1" - docker port "$1" - fi - else - docker ps -q \ - | xargs -n 1 docker inspect --format '{{.Name}}{{range .NetworkSettings.Networks}} {{.IPAddress}}{{end}}' \ - | sed -e 's#^/##' \ - | column -t - fi + "$@" } diff --git a/helpers/net.sh b/helpers/net.sh new file mode 100644 index 0000000..fe77de7 --- /dev/null +++ b/helpers/net.sh @@ -0,0 +1,51 @@ +#!/usr/bin/env bash + +######################################################## +# Networking functions +######################################################## + +get_current_ip() { + local CURRENT_IP + [ -f /etc/os-release ] && source /etc/os-release + case "$ID" in + debian|ubuntu) CURRENT_IP=$(hostname -I | awk '{print $1}') ;; + alpine) CURRENT_IP=$(ip -4 addr show eth0 | awk '/inet / {print $2}' | cut -d/ -f1 | head -n 1) ;; + *) CURRENT_IP="Unknown" ;; + esac + echo "$CURRENT_IP" +} + +get_external_ip() { + local ip="$(curl -s https://api.myip.com | jq .ip)" + echo "$ip" | tr -d '"' +} + +is_valid_ipv4() { + local ip="$1" + local regex="^([0-9]{1,3}\.){3}[0-9]{1,3}$" + + if [[ $ip =~ $regex ]]; then + IFS='.' read -r -a parts <<< "$ip" + for part in "${parts[@]}"; do + if ! [[ $part =~ ^[0-9]+$ ]] || ((part < 0 || part > 255)); then + return 1 + fi + done + return 0 + fi + return 1 +} + +curltime() { + curl -w @- -o /dev/null -s "$@" <<'EOF' + time_namelookup: %{time_namelookup} sec\n + time_connect: %{time_connect} sec\n + time_appconnect: %{time_appconnect} sec\n + time_pretransfer: %{time_pretransfer} sec\n + time_redirect: %{time_redirect} sec\n + time_starttransfer: %{time_starttransfer} sec\n + ---------------\n + time_total: %{time_total} sec\n +EOF +} + From 16075cdd617f5562e28becd378f656c4b52ede1f Mon Sep 17 00:00:00 2001 From: AnthonyAxenov Date: Sat, 8 Feb 2025 13:25:52 +0800 Subject: [PATCH 07/12] new links in readme --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index b7cf136..62e1ba4 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,9 @@ where: * https://lug.fh-swf.de/vim/vim-bash/StyleGuideShell.en.pdf * https://www.thegeekstuff.com/2010/06/bash-array-tutorial/ * https://www.distributednetworks.com/linux-network-admin/module4/ephemeral-reserved-portNumbers.php +* https://github.com/community-scripts/ProxmoxVE/tree/main/install +* https://github.com/community-scripts/ProxmoxVE/tree/main/misc +* https://faculty.cs.niu.edu/~hutchins/csci480/signals.htm ## License From 47827282a9c2c9e6452c404d770d5305db8e3c6b Mon Sep 17 00:00:00 2001 From: AnthonyAxenov Date: Mon, 10 Feb 2025 21:30:24 +0800 Subject: [PATCH 08/12] free-space misc --- tools/free-space.sh | 44 ++++++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/tools/free-space.sh b/tools/free-space.sh index d2511dd..a1a1f10 100755 --- a/tools/free-space.sh +++ b/tools/free-space.sh @@ -3,18 +3,23 @@ # https://gist.github.com/anthonyaxenov/02c00c965be4eb5bb163a153abdf4c2b # https://itsfoss.com/free-up-space-ubuntu-linux/ -df -h -echo "" + +echo +echo +df -hx tmpfs +echo + +echo echo "[1/5] Removing apt caches and unused packages" -echo "" +echo sudo apt autoremove --purge sudo apt autoclean sudo apt clean -echo "" +echo echo "[2/5] Removing old system logs" -echo "" +echo sudo journalctl --vacuum-time=1d sudo rm -rf /var/log/journal/user-*@* @@ -22,33 +27,36 @@ sudo rm -rf /var/log/journal/system*@* sudo rm /var/log/{syslog,dmesg,btmp}.* sudo rm /var/log/{auth,dpkg,kern,alternatives,dmesg}.log.* -echo "" +echo echo "[3/5] Cleaning user trash and thumbnails" -echo "" +echo rm -rf ~/.local/share/Trash/files/* rm -rf ~/.cache/thumbnails/* -echo "" +echo echo "[4/5] Cleaning out dangling docker objects" -echo "" +echo docker system prune -f # docker system prune -af -echo "" +echo echo "[5/5] Removing disabled unused snaps" -echo "" +echo -sudo snap list --all | awk '/disabled/{print $1, $3}' | - while read snapname revision; do - sudo snap remove "$snapname" --revision="$revision" - done +sudo snap list --all \ + | awk '/disabled/{print $1, $3}' \ + | while read snapname revision; do + sudo snap remove "$snapname" --revision="$revision" + done -echo "" -echo "" -df -h +echo +echo +df -hx tmpfs +echo +echo From 31ddf3a6d2e448be46dfe80b69a580687f1e9262 Mon Sep 17 00:00:00 2001 From: AnthonyAxenov Date: Mon, 10 Feb 2025 21:30:36 +0800 Subject: [PATCH 09/12] notification helpers --- helpers/notif.sh | 63 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 helpers/notif.sh diff --git a/helpers/notif.sh b/helpers/notif.sh new file mode 100644 index 0000000..2bd0e05 --- /dev/null +++ b/helpers/notif.sh @@ -0,0 +1,63 @@ +#!/usr/bin/env bash + +######################################################## +# Notifications +######################################################## + +TITLE="$0" +NTFY_CHANNEL="example" + +# отправляет простую нотификацию +ntfy_info() { + require ntfy + ntfy send \ + --title "$TITLE" \ + --message "$1" \ + --priority 1 \ + "$NTFY_CHANNEL" +} + +# отправляет нотификацию с предупреждением +ntfy_warn() { + require ntfy + ntfy send \ + --title "$TITLE" \ + --tags "warning" \ + --message "$1" \ + --priority 5 \ + "$NTFY_CHANNEL" +} + + +notify () { + if ! installed "notify-send"; then + warning "Notifications toggled on, but 'notify-send' is not installed!" + return 1 + fi + [ -n "$1" ] && local title="$1" + local text="$2" + local level="$3" + local icon="$4" + case "$level" in + critical) local timeout=0 ;; + low) local timeout=5000 ;; + *) local timeout=10000 ;; + esac + debug "$title / $text / $level / $icon / $timeout" + notify-send "$title" "$text" -a "$0" -u "$level" -i "$icon" -t $timeout +} + +# TODO: docblock +notify_error() { + notify "Error" "$1" "critical" "dialog-error" +} + +# TODO: docblock +notify_warning() { + notify "Warning" "$1" "normal" "dialog-warning" +} + +# TODO: docblock +notify_info() { + notify "" "$1" "low" "dialog-information" +} From cbb493b5c4a192d14af22c09f39c4eed17899b92 Mon Sep 17 00:00:00 2001 From: AnthonyAxenov Date: Mon, 10 Feb 2025 21:32:52 +0800 Subject: [PATCH 10/12] ClamAV (WIP) --- install/clamav | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100755 install/clamav diff --git a/install/clamav b/install/clamav new file mode 100755 index 0000000..d8672a4 --- /dev/null +++ b/install/clamav @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +##makedesc: ClamAV (WIP) + +sudo apt install clamav -y && \ + echo "DatabaseMirror packages.microsoft.com/clamav" | sudo tee -a /etc/clamav/freshclam.conf && \ + sudo freshclam From e9a6f4dddae332526d927fd447104cf5f24bdc00 Mon Sep 17 00:00:00 2001 From: AnthonyAxenov Date: Thu, 20 Feb 2025 10:22:25 +0800 Subject: [PATCH 11/12] docker-volume-snapshot --- tools/docker-volume-snapshot.sh | 47 +++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 tools/docker-volume-snapshot.sh diff --git a/tools/docker-volume-snapshot.sh b/tools/docker-volume-snapshot.sh new file mode 100644 index 0000000..d620032 --- /dev/null +++ b/tools/docker-volume-snapshot.sh @@ -0,0 +1,47 @@ +#!/usr/bin/env bash +# Original filename: docker-volume-snapshot +# Author: Juned Khatri +# License: MIT +# Repo: https://github.com/junedkhatri31/docker-volume-snapshot + +set -e -o pipefail + +programname=`basename "$0"` + +display_usage() { + echo "usage: $programname (create|restore) source destination" + echo " create create snapshot file from docker volume" + echo " restore restore snapshot file to docker volume" + echo " source source path" + echo " destination destination path" + echo + echo "Tip: Supports tar's compression algorithms automatically" + echo " based on the file extention, for example .tar.gz" + echo + echo "Examples:" + echo "docker-volume-snapshot create xyz_volume xyz_volume.tar" + echo "docker-volume-snapshot create xyz_volume xyz_volume.tar.gz" + echo "docker-volume-snapshot restore xyz_volume.tar xyz_volume" + echo "docker-volume-snapshot restore xyz_volume.tar.gz xyz_volume" +} + +case "$1" in + "create") + if [[ -z "$2" || -z "$3" ]]; then display_usage; exit 1; fi + directory=`dirname "$3"` + if [ "$directory" == "." ]; then directory=$(pwd); fi + filename=`basename "$3"` + docker run --rm -v "$2:/source" -v "$directory:/dest" busybox tar cvaf "/dest/$filename" -C /source . + ;; + "restore") + if [[ -z "$2" || -z "$3" ]]; then display_usage; exit 1; fi + directory=`dirname "$2"` + if [ "$directory" == "." ]; then directory=$(pwd); fi + filename=`basename "$2"` + docker run --rm -v "$3:/dest" -v "$directory:/source" busybox tar xvf "/source/$filename" -C /dest + ;; + *) + display_usage + exit 1 # Command to come out of the program with status 1 + ;; +esac From e05b47ae52a2bd500b2a2d3aa26af185897be381 Mon Sep 17 00:00:00 2001 From: AnthonyAxenov Date: Thu, 20 Feb 2025 10:22:39 +0800 Subject: [PATCH 12/12] ubuntu server scripts misc --- ...de-ubuntu.sh => ubuntu-desktop-upgrade.sh} | 0 .../{basic-ubuntu-lemp.sh => ubuntu-lemp.sh} | 3 +- ...it-home-mediasrv.sh => ubuntu-mediasrv.sh} | 7 --- tools/ubuntu-server.sh | 51 +++++++++++++++++++ 4 files changed, 53 insertions(+), 8 deletions(-) rename tools/{upgrade-ubuntu.sh => ubuntu-desktop-upgrade.sh} (100%) rename tools/{basic-ubuntu-lemp.sh => ubuntu-lemp.sh} (92%) rename tools/{init-home-mediasrv.sh => ubuntu-mediasrv.sh} (95%) create mode 100644 tools/ubuntu-server.sh diff --git a/tools/upgrade-ubuntu.sh b/tools/ubuntu-desktop-upgrade.sh similarity index 100% rename from tools/upgrade-ubuntu.sh rename to tools/ubuntu-desktop-upgrade.sh diff --git a/tools/basic-ubuntu-lemp.sh b/tools/ubuntu-lemp.sh similarity index 92% rename from tools/basic-ubuntu-lemp.sh rename to tools/ubuntu-lemp.sh index 3777638..2a5b87a 100644 --- a/tools/basic-ubuntu-lemp.sh +++ b/tools/ubuntu-lemp.sh @@ -29,4 +29,5 @@ apt install -y \ mariadb-server \ mariadb-client \ nginx \ - certbot + certbot \ + python3-certbot-nginx diff --git a/tools/init-home-mediasrv.sh b/tools/ubuntu-mediasrv.sh similarity index 95% rename from tools/init-home-mediasrv.sh rename to tools/ubuntu-mediasrv.sh index 01f548b..4a351c7 100644 --- a/tools/init-home-mediasrv.sh +++ b/tools/ubuntu-mediasrv.sh @@ -41,13 +41,6 @@ sudo apt install -y \ notify-osd \ fonts-open-sans \ libnotify-bin \ - gnome-software \ - gnome-software-plugin-flatpak \ - gnome-software-plugin-snap \ - terminator \ - geoclue-2.0 \ - redshift \ - redshift-gtk \ samba \ dkms diff --git a/tools/ubuntu-server.sh b/tools/ubuntu-server.sh new file mode 100644 index 0000000..fe146d8 --- /dev/null +++ b/tools/ubuntu-server.sh @@ -0,0 +1,51 @@ +#!/usr/bin/env bash + +sudo apt install -y ca-certificates curl && \ + sudo install -m 0755 -d /etc/apt/keyrings && \ + sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc && \ + sudo chmod a+r /etc/apt/keyrings/docker.asc && \ + source /etc/os-release && \ + echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ + $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \ + sudo tee /etc/apt/sources.list.d/docker.list > /dev/null && \ + sudo apt update && \ + sudo apt upgrade -y --autoremove && \ + sudo apt install -y \ + apt-transport-https \ + build-essential \ + ca-certificates \ + git \ + cmake \ + curl \ + dialog \ + gettext \ + gnupg \ + htop \ + libcurl4-gnutls-dev \ + libexpat1-dev \ + libghc-zlib-dev \ + libssl-dev \ + lsb-release \ + make \ + mc \ + meld \ + nano \ + neofetch \ + net-tools \ + nmap \ + p7zip-full \ + unzip \ + ffmpeg \ + inotify-tools \ + notify-osd \ + fonts-open-sans \ + libnotify-bin \ + tree \ + nginx \ + certbot \ + python3-certbot-nginx \ + docker-ce \ + docker-ce-cli \ + containerd.io \ + docker-buildx-plugin \ + docker-compose-plugin