From 0dc09bcc618fd2026859eef7c533e0ea2cc5369e Mon Sep 17 00:00:00 2001 From: TrudeEH Date: Wed, 3 Jan 2024 18:13:29 +0000 Subject: [PATCH] Added useful scripts --- scripts/codeAI_ollama.sh | 10 ++++++++++ scripts/maintenance.sh | 23 +++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 scripts/codeAI_ollama.sh create mode 100644 scripts/maintenance.sh diff --git a/scripts/codeAI_ollama.sh b/scripts/codeAI_ollama.sh new file mode 100644 index 00000000..a2471c06 --- /dev/null +++ b/scripts/codeAI_ollama.sh @@ -0,0 +1,10 @@ +#! /bin/bash + +ollama=$(pacman -Q ollama) +if [[ -n "$ollama" ]]; then + kgx -e "ollama serve" + sleep 1 + kgx -e "ollama run codellama" +else + kgx -e "sudo paru -S ollama; echo 'Run the script again...'" +fi diff --git a/scripts/maintenance.sh b/scripts/maintenance.sh new file mode 100644 index 00000000..900c86d7 --- /dev/null +++ b/scripts/maintenance.sh @@ -0,0 +1,23 @@ +#! /bin/bash + +echo -e "\e[31m[+] Upgrading Arch...\e[0m" +sudo paru -Syu + +echo -e "\e[31m[+] Cleaning orphaned (unneeded) packages...\e[0m" +sudo paru -Rsn $(paru -Qdtq) + +echo -e "\e[31m[+] Cleaning old pacman cache...\e[0m" +paccache -rk1 + +echo -e "\e[31m[+] Removing logs older than 7d...\e[0m" +sudo journalctl --vacuum-time=7d + +echo -e "\e[31m[I] Cleaning flatpak...:\e[0m" +flatpak remove --unused + +echo -e "\e[31m[I] AUR Packages installed:\e[0m" +pacman -Qim | awk '/^Name/{name=$3} /^Installed Size/{print $4$5, name}' | sort -h + +# Installed packages: pacman -Qen + +read -p "Press enter to exit."