summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2023-04-11 19:13:20 +0200
committerRaymaekers Luca <raymaekers.luca@gmail.com>2023-04-11 19:13:20 +0200
commitaa4bdbfc369db3174d39bacc6b26a593a9ec3376 (patch)
tree0b2eb4aea4d26aa914646d211b8cd2be6442fe15
parente1a8eba0df45adc85a90714c951d0dfad717efdb (diff)
parent3a1ffa19028a529bef7110aea3370b3bc279ed79 (diff)
Merge branch 'main' of /var/git/dotfiles
-rw-r--r--.gitignore7
-rwxr-xr-xbin/common/drop_cache8
-rw-r--r--config/essentials/zsh/functions.zsh17
3 files changed, 32 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..4e42516
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,7 @@
+config/essentials/zsh/.zcompdump
+config/essentials/zsh/histfile
+config/essentials/gnupg/*
+config/X/mpv/watch_later/*
+config/common/mpd/database
+config/essentials/nvim/plugin/
+config/common/newsboat/urls
diff --git a/bin/common/drop_cache b/bin/common/drop_cache
new file mode 100755
index 0000000..4833597
--- /dev/null
+++ b/bin/common/drop_cache
@@ -0,0 +1,8 @@
+#!/bin/sh
+if [ "$(id -u)" -ne 0 ]
+then
+ echo "Please run as root."
+ exit 1
+fi
+echo 3 | tee /proc/sys/vm/drop_caches >/dev/null
+echo "cache cleared."
diff --git a/config/essentials/zsh/functions.zsh b/config/essentials/zsh/functions.zsh
index 4226362..f21ce9b 100644
--- a/config/essentials/zsh/functions.zsh
+++ b/config/essentials/zsh/functions.zsh
@@ -161,3 +161,20 @@ ngenable ()
{
ln -sf /etc/nginx/sites-available/$1 /etc/nginx/sites-enabled/
}
+
+vbsr ()
+{
+ vboxmanage snapshot "$1" restore "$2" &&
+ vboxmanage startvm "$1" ||
+ vboxmanage controlvm "$1" poweroff
+}
+vbsrr ()
+{
+ vbsr "$1" "$2"
+ sleep 3
+ vbsr "$1" "$2"
+}
+vbst ()
+{
+ vboxmanage snapshot "$1" take "$2"
+}