git.lirion.de

Of git, get, and gud

aboutsummaryrefslogtreecommitdiffstats
path: root/documentation/aux
diff options
context:
space:
mode:
Diffstat (limited to 'documentation/aux')
-rwxr-xr-xdocumentation/aux/block-inventory10
-rwxr-xr-xdocumentation/aux/ctrl-c7
-rwxr-xr-xdocumentation/aux/dnf-history21
-rwxr-xr-xdocumentation/aux/git-inventory13
-rwxr-xr-xdocumentation/aux/kvm-inventory18
5 files changed, 69 insertions, 0 deletions
diff --git a/documentation/aux/block-inventory b/documentation/aux/block-inventory
new file mode 100755
index 0000000..c8dc3f3
--- /dev/null
+++ b/documentation/aux/block-inventory
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+SCDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+source "$SCDIR/ctrl-c"||exit 1
+ODETFIL="$SCDIR/../blockdevices"
+
+echo -n "Fetching blocks..."
+true>"$ODETFIL";[ "$?" -ne 0 ]&&echo "failed."&&exit 1||echo -n "."
+echo -n ".";lsblk -im -o+FSTYPE,MIN-IO,MOUNTPOINT 2>/dev/null|sed 's/luks-[^\ ]\+/luks-<uuid> /g' >"$ODETFIL"
+[ "$?" -ne 0 ]&&echo ".failed."||echo ".done."
diff --git a/documentation/aux/ctrl-c b/documentation/aux/ctrl-c
new file mode 100755
index 0000000..b7530b2
--- /dev/null
+++ b/documentation/aux/ctrl-c
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+function ctrl_c() {
+ echo " CUNT PUNT!" >&2
+ exit 187
+}
+trap ctrl_c INT
diff --git a/documentation/aux/dnf-history b/documentation/aux/dnf-history
new file mode 100755
index 0000000..716d22c
--- /dev/null
+++ b/documentation/aux/dnf-history
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+# we need to use sudo, better fetch the session now so it doesn't feck up our
+# nice output later on, tee hee.
+sudo echo -n ""
+[ "$?" -ne 0 ]&&echo "Not allowed to proceed :("&&exit 1
+SCDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+#SCDIR="$HOME"
+source "$SCDIR/ctrl-c"||exit 1
+ODETFIL="$SCDIR/../packages-raw"
+
+echo -n "Fetching dnf history"
+true>"$ODETFIL";[ "$?" -ne 0 ]&&echo "failed."&&exit 1||echo -n "."
+LCNT=0
+for i in $(sudo dnf history|sed 's/^[\ \t]\+\([0-9]\+\).*/\1/g'|grep -vP -- '^--|^ID');do
+ ((++LCNT))
+ [ "$(($LCNT % 3))" -eq 0 ]&&echo -n "."||true
+ sudo dnf history info "$i" 2>>"$ODETFIL"|grep -i Command\ line>>"$ODETFIL"
+ #[ "$?" -ne 0 ]&&break
+done;echo "done."
+#[ "$?" -ne 0 ]&&echo "failed."||echo "done."
diff --git a/documentation/aux/git-inventory b/documentation/aux/git-inventory
new file mode 100755
index 0000000..182812a
--- /dev/null
+++ b/documentation/aux/git-inventory
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+SCDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+source "$SCDIR/ctrl-c"||exit 1
+GITSYSFILE="$SCDIR/../git-system-repos"
+
+echo -n "Fetching system git stuff"
+(
+ true>"$GITSYSFILE";[ "$?" -ne 0 ]&&echo "...failed."&&exit 1||true
+ for i in $(find /usr/src -type d -name ".git"|sed 's|/[^/]\+$||g');do echo -n ".";echo "$i" >> "$GITSYSFILE";cd "$i";CDRETVAL=$?;git remote show origin 2>/dev/null|grep Fetch\ URL >> "$GITSYSFILE";[ "$CDRETVAL" -eq 0 ]&&cd - >/dev/null 2>&1;done
+)
+
+[ "$?" -ne 0 ]&&echo "failed."||echo "done."
diff --git a/documentation/aux/kvm-inventory b/documentation/aux/kvm-inventory
new file mode 100755
index 0000000..c739514
--- /dev/null
+++ b/documentation/aux/kvm-inventory
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+SCDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+source "$SCDIR/ctrl-c"||exit 1
+ODETFIL="$SCDIR/../kvm_overview"
+ODETDIR="$SCDIR/../kvm-details"
+
+echo -n "Fetching KVM config"
+(
+ echo -n ".";>"$ODETFIL";[ "$?" -ne 0 ]&&echo "failed."&&exit 1||true
+ echo -n ".";virsh list --all --title>>"$ODETFIL" 2>/dev/null;[ "$?" -ne 0 ]&&exit 1||true
+ echo -n ".";echo "" >> "$ODETFIL";virsh net-list --all>>"$ODETFIL" 2>/dev/null;[ "$?" -ne 0 ]&&exit 1||true
+ echo -n ".";echo "" >> "$ODETFIL";virsh pool-list --all --details>>"$ODETFIL" 2>/dev/null;[ "$?" -ne 0 ]&&exit 1||true
+ echo -n ".";for i in $(virsh list --all --name);do virsh dumpxml "$i">"$ODETDIR"/domain-"$i".xml||break;done;[ "$?" -ne 0 ]&&exit 1||true
+ echo -n ".";for i in $(virsh net-list --all --name);do virsh net-dumpxml "$i">"$ODETDIR"/net-"$i".xml||break;done;[ "$?" -ne 0 ]&&exit 1||true
+ echo -n ".";for i in $(virsh pool-list --all --name);do virsh pool-dumpxml "$i">"$ODETDIR"/pool-"$i".xml||break;done;[ "$?" -ne 0 ]&&exit 1||true
+)
+[ "$?" -ne 0 ]&&echo "failed."||echo "done."