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/apt-extend-mx b/apt-extend-mx index 5d8eb9e..bc4b662 100755 --- a/apt-extend-mx +++ b/apt-extend-mx @@ -3,11 +3,13 @@ # # 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" 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" @@ -16,7 +18,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 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() diff --git a/gitconfig b/gitconfig index e0bed2e..795ccab 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 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..c968192 --- /dev/null +++ b/nas_halt @@ -0,0 +1,8 @@ +#!/bin/bash +# +if [ $# == 0 ] +then + ssh nas sudo /usr/sbin/shutdown -P 5 +else + ssh nas sudo /usr/sbin/shutdown -P $1 +fi 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