From d293f4dffad10a21b7583c3d657e69a18470ecef Mon Sep 17 00:00:00 2001 From: Marcel Schwarz Date: Sun, 23 Jul 2023 19:28:30 +0200 Subject: [PATCH] Add some scripts --- scripts/apt-install-basics.sh | 2 ++ scripts/apt-update.sh | 5 +++++ scripts/top-used-commands.sh | 1 + scripts/update-all-docker-images.sh | 1 + scripts/wsl-free-mem.sh | 6 ++++++ 5 files changed, 15 insertions(+) create mode 100644 scripts/apt-install-basics.sh create mode 100644 scripts/apt-update.sh create mode 100644 scripts/top-used-commands.sh create mode 100644 scripts/update-all-docker-images.sh create mode 100644 scripts/wsl-free-mem.sh diff --git a/scripts/apt-install-basics.sh b/scripts/apt-install-basics.sh new file mode 100644 index 0000000..086a043 --- /dev/null +++ b/scripts/apt-install-basics.sh @@ -0,0 +1,2 @@ +# this installs tools which I would say are alrounders on all systems +apt install bleachbit nano xrdp htop bash-completion dialog powertop tree tmux \ No newline at end of file diff --git a/scripts/apt-update.sh b/scripts/apt-update.sh new file mode 100644 index 0000000..5b6e910 --- /dev/null +++ b/scripts/apt-update.sh @@ -0,0 +1,5 @@ +apt update +apt upgrade +apt dist-upgrade +apt autoremove +apt autoclean \ No newline at end of file diff --git a/scripts/top-used-commands.sh b/scripts/top-used-commands.sh new file mode 100644 index 0000000..ae104cb --- /dev/null +++ b/scripts/top-used-commands.sh @@ -0,0 +1 @@ +history | awk '{$1=""}1' | awk '{$1=$1}1' | sort | uniq -c | sort -bgr | more \ No newline at end of file diff --git a/scripts/update-all-docker-images.sh b/scripts/update-all-docker-images.sh new file mode 100644 index 0000000..865661d --- /dev/null +++ b/scripts/update-all-docker-images.sh @@ -0,0 +1 @@ +docker images --format "{{.Repository}}:{{.Tag}}" | xargs -L1 docker pull \ No newline at end of file diff --git a/scripts/wsl-free-mem.sh b/scripts/wsl-free-mem.sh new file mode 100644 index 0000000..c2240c2 --- /dev/null +++ b/scripts/wsl-free-mem.sh @@ -0,0 +1,6 @@ +# WSL2 Linux Module to free up caches and compact memory +# See Microsoft Blog (https://devblogs.microsoft.com/commandline/memory-reclaim-in-the-windows-subsystem-for-linux-2/) +# needs to run as root (sudo doesn't work) + +echo 1 > /proc/sys/vm/drop_caches +echo 1 > /proc/sys/vm/compact_memory