From 9929539860761a8af03d8e25443885e1d33e1058 Mon Sep 17 00:00:00 2001 From: Dirk Alders Date: Mon, 6 Jan 2025 15:08:11 +0100 Subject: [PATCH 1/6] nas related changes + some updates --- .gitmodules | 6 ++++++ gitconfig | 7 ++++++- mqtt_sniffer | 4 ++++ mqtt_test_smarthome | 16 ++++++++++++++++ nas_halt | 3 +++ nas_wake | 4 ++++ pyrip | 6 ++++++ pyrip.src | 1 + 8 files changed, 46 insertions(+), 1 deletion(-) create mode 100755 mqtt_sniffer create mode 100755 mqtt_test_smarthome create mode 100755 nas_halt create mode 100755 nas_wake create mode 100755 pyrip create mode 160000 pyrip.src diff --git a/.gitmodules b/.gitmodules index edc8155..9dff86e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,9 @@ [submodule "nagios"] path = nagios.src url = https://git.mount-mockery.de/pylib/nagios.git +[submodule "pyrip"] + path = pyrip + url = https://git.mount-mockery.de/application/pyrip.git +[submodule "pyrip.src"] + path = pyrip.src + url = https://git.mount-mockery.de/application/pyrip.git diff --git a/gitconfig b/gitconfig index e0bed2e..3d7b83a 100755 --- a/gitconfig +++ b/gitconfig @@ -3,7 +3,12 @@ git config --global user.name "Dirk Alders" git config --global user.email dirk@mount-mockery.de # +git config --global pull.rebase false +# git config --global diff.tool meld git config --global merge.tool meld +git config --global merge.tool.cmd 'meld --auto-merge "$LOCAL" "$BASE" "$REMOTE" --output "$MERGED"' git config --global --add difftool.prompt false -git config --global pull.rebase false +# +git config --global config credential.helper store + diff --git a/mqtt_sniffer b/mqtt_sniffer new file mode 100755 index 0000000..0d23514 --- /dev/null +++ b/mqtt_sniffer @@ -0,0 +1,4 @@ +#!/bin/bash +# +/opt/mqtt_sniffer/venv/bin/python /opt/mqtt_sniffer/mqtt_sniffer.py $* + diff --git a/mqtt_test_smarthome b/mqtt_test_smarthome new file mode 100755 index 0000000..0c30de5 --- /dev/null +++ b/mqtt_test_smarthome @@ -0,0 +1,16 @@ +#!/bin/sh +clear + +#!/bin/sh +# + +for s in $(tmux list-sessions -F '#{session_name}'); do + p=$(tmux list-panes -F '#{pane_tty}' -t "$s") + if [ "$p" = "$(tty)" ]; then + # Session already running + exit 0 + fi +done + +tmux attach-session -t mqtt_test_smarthome || tmux new-session -s mqtt_test_smarthome "/opt/mqtt_sniffer/venv/bin/python /opt/mqtt_sniffer/mqtt_sniffer.py -f mqtt.home -p 1884 -n" + diff --git a/nas_halt b/nas_halt new file mode 100755 index 0000000..42db789 --- /dev/null +++ b/nas_halt @@ -0,0 +1,3 @@ +#!/bin/bash +# +ssh nas sudo /usr/sbin/shutdown -P 5 diff --git a/nas_wake b/nas_wake new file mode 100755 index 0000000..b6a8fa8 --- /dev/null +++ b/nas_wake @@ -0,0 +1,4 @@ +#!/bin/sh +# +wakeonlan 38:ea:a7:a6:03:9d + diff --git a/pyrip b/pyrip new file mode 100755 index 0000000..69cc7ae --- /dev/null +++ b/pyrip @@ -0,0 +1,6 @@ +#!/bin/bash +# +BASEDIR=$(dirname $0) + +$BASEDIR/pyrip.src/venv/bin/python $BASEDIR/pyrip.src/pyrip.py $* + diff --git a/pyrip.src b/pyrip.src new file mode 160000 index 0000000..48dc481 --- /dev/null +++ b/pyrip.src @@ -0,0 +1 @@ +Subproject commit 48dc481f268e1ecdcd8d5e0126df553781e40a78 From b536b751cdce768cdce0a6e787bb24d4b18b5db9 Mon Sep 17 00:00:00 2001 From: Dirk Alders Date: Mon, 27 Jan 2025 13:15:19 +0100 Subject: [PATCH 2/6] nas_halt adaption (call with parameter) --- nas_halt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nas_halt b/nas_halt index 42db789..c968192 100755 --- a/nas_halt +++ b/nas_halt @@ -1,3 +1,8 @@ #!/bin/bash # -ssh nas sudo /usr/sbin/shutdown -P 5 +if [ $# == 0 ] +then + ssh nas sudo /usr/sbin/shutdown -P 5 +else + ssh nas sudo /usr/sbin/shutdown -P $1 +fi From 1d30668b5ac66ee0e9eac07cc44514a6977ab190 Mon Sep 17 00:00:00 2001 From: Dirk Alders Date: Wed, 29 Jan 2025 13:29:25 +0100 Subject: [PATCH 3/6] dnsleases improved --- dnsleases | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/dnsleases b/dnsleases index f4301a8..502dc01 100755 --- a/dnsleases +++ b/dnsleases @@ -1,6 +1,7 @@ #!/bin/python3 # import subprocess +import sys import time class host(object): @@ -87,7 +88,22 @@ with open('/var/lib/misc/dnsmasq.leases', 'r') as fh: if h.mac not in hl: hl.append(h) -for vlan in [20, 30, 40, 50, 60, 90]: - print("Hosts in VLAN %d" % vlan) + + +VLANs = { + 20: "Network Devices - Switch, AP, ...", + 30: "Private VLAN", + 40: "Smarthome with Internet", + 50: "Smarthome no Internet", + 60: "Guest VLAN", +} + +try: + PRINT_LIST = [int(sys.argv[1]), ] +except (IndexError, ValueError) as e: + PRINT_LIST = VLANs.keys() + +for vlan in PRINT_LIST: + print(f"Hosts in VLAN {vlan} - {VLANs.get(vlan, 'Unknown')}") print(hl.vlan_list(vlan)) print() From 3068d4330b32960c9b9597f8978501e1c97a2460 Mon Sep 17 00:00:00 2001 From: Dirk Alders Date: Fri, 14 Feb 2025 14:47:21 +0100 Subject: [PATCH 4/6] mx software collection improved --- apt-extend-mx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apt-extend-mx b/apt-extend-mx index 5d8eb9e..82bdc06 100755 --- a/apt-extend-mx +++ b/apt-extend-mx @@ -3,7 +3,7 @@ # # Additional Packages -COMMON="keepass2 xdotool systemd-sysv openssh-server vim-nox tree" +COMMON="keepassx systemd-sysv openssh-server vim-nox tree" # COMMON="$COMMON curlftpfs" COMMON="$COMMON tlp tlp-rdw" COMMON="$COMMON fonts-powerline" @@ -16,7 +16,7 @@ MULTIMEDIA="$MULTIMEDIA qjackctl carla carla-lv2 carla-vst ardour calf-plugins e TOOLS="wavemon evolution retext gnuplot latexmk texlive-latex-recommended texlive-latex-extra texlive-lang-german texlive-plain-generic texlive-fonts-recommended" -PROGRAMMING="python-is-python3 python3-venv pkgconf libgtk2.0-dev jq meld" +PROGRAMMING="python-is-python3 python3-venv python3-wxgtk4.0 pkgconf libgtk2.0-dev jq meld" ALL=$COMMON\ $MULTIMEDIA\ $TOOLS\ $PROGRAMMING From 92dfe01700f0df5691517c78fbecd81e54f642bd Mon Sep 17 00:00:00 2001 From: root Date: Wed, 19 Feb 2025 19:22:21 +0100 Subject: [PATCH 5/6] Fix gitconfig --- gitconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitconfig b/gitconfig index 3d7b83a..795ccab 100755 --- a/gitconfig +++ b/gitconfig @@ -10,5 +10,5 @@ git config --global merge.tool meld git config --global merge.tool.cmd 'meld --auto-merge "$LOCAL" "$BASE" "$REMOTE" --output "$MERGED"' git config --global --add difftool.prompt false # -git config --global config credential.helper store +git config --global credential.helper store From 494620210e9db240f1d108fe176b9bd8d7a207f4 Mon Sep 17 00:00:00 2001 From: Dirk Alders Date: Thu, 20 Feb 2025 06:50:22 +0100 Subject: [PATCH 6/6] mx extended for surface touch issues --- apt-extend-mx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apt-extend-mx b/apt-extend-mx index 82bdc06..bc4b662 100755 --- a/apt-extend-mx +++ b/apt-extend-mx @@ -8,6 +8,8 @@ COMMON="keepassx systemd-sysv openssh-server vim-nox tree" COMMON="$COMMON tlp tlp-rdw" COMMON="$COMMON fonts-powerline" COMMON="$COMMON nextcloud-desktop dolphin-nextcloud" +# Use KDE-Wayland and activate maliit under System (Search Virtual Keyboard) +COMMON="$COMMON maliit-keyboard" # COMMON="$COMMON fonts-powerline powerline powerline-gitstatus" MULTIMEDIA="rhythmbox ario kodi kodi-pvr-hts"