This commit is contained in:
Dirk Alders 2025-08-04 19:46:09 +02:00
commit c14e55eb1a
11 changed files with 9 additions and 86 deletions

3
.gitmodules vendored
View File

@ -4,6 +4,3 @@
[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

4
loggy Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
#
~/my_apps/loggy/loggy $*

View File

@ -1,3 +0,0 @@
#!/bin/sh
clear
/opt/mqtt_sniffer/venv/bin/python /opt/mqtt_sniffer/mqtt_sniffer.py -f localhost -n

View File

@ -12,5 +12,5 @@ for s in $(tmux list-sessions -F '#{session_name}'); do
fi
done
tmux attach-session -t mqtt_smarthome || tmux new-session -s mqtt_smarthome "/opt/mqtt_sniffer/venv/bin/python /opt/mqtt_sniffer/mqtt_sniffer.py -f mqtt.home"
tmux attach-session -t mqtt_smarthome || tmux new-session -s mqtt_smarthome "~/my_apps/mqtt_sniffer/venv/bin/python ~/my_apps/mqtt_sniffer/mqtt_sniffer.py -f mqtt.home"

View File

@ -1,4 +1,4 @@
#!/bin/bash
#
/opt/mqtt_sniffer/venv/bin/python /opt/mqtt_sniffer/mqtt_sniffer.py $*
~/my_apps/mqtt_sniffer/mqtt_sniffer $*

View File

@ -12,5 +12,5 @@ for s in $(tmux list-sessions -F '#{session_name}'); do
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"
tmux attach-session -t mqtt_test_smarthome || tmux new-session -s mqtt_test_smarthome "~/my_apps/mqtt_sniffer/venv/bin/python ~/my_apps/mqtt_sniffer/mqtt_sniffer.py -f mqtt.home -p 1884 -n"

4
netst
View File

@ -1,6 +1,4 @@
#!/bin/bash
#
BASEDIR=$(dirname $0)
$BASEDIR/netst.src/venv/bin/python $BASEDIR/netst.src/netst.py $*
~/my_apps/netst/netst $*

View File

@ -1,67 +0,0 @@
import dns.resolver
import ifcfg
import json
import socket
import struct
import sys
import time
interfaces = ifcfg.interfaces()
def exit_device():
print("Possible devices:", ", ".join(interfaces.keys()))
sys.exit(1)
def gateway(device):
with open("/proc/net/route") as fh:
# skip header
next(fh)
for line in fh:
routes = line.strip().split()
if routes[0] == device:
destination = socket.inet_ntoa(struct.pack("<L", int(routes[1], 16)))
if destination != "0.0.0.0":
continue
return socket.inet_ntoa(struct.pack("<L", int(routes[2], 16)))
try:
DEVICE = sys.argv[1]
except IndexError:
print("You need to give the device name as first argument!\n")
exit_device()
HRN = { # Human Readable Name
'MAC': 'ether',
'MTU': 'mtu',
'IP': 'inet',
'Netmask': 'netmask',
}
try:
info = interfaces[DEVICE]
except KeyError:
print("Unknown device:", DEVICE, "\n")
exit_device()
try:
dns_resolver = dns.resolver.Resolver()
except dns.resolver.NoResolverConfiguration:
dns_server = []
else:
dns_server = dns_resolver.nameservers
print('+' + 27 * '-' + '+')
print("|%9s: %s" % ('Device', DEVICE) + (16 - len(DEVICE)) * ' ' + '|')
print('+' + 27 * '-' + '+')
for name in HRN:
print("%10s: %s" % (name, info[HRN[name]]))
print("%10s: %s" % ('Gateway', gateway(DEVICE)))
try:
print("%10s: %s" % ("Domain", socket.getfqdn().split('.', 1)[1]))
except IndexError:
print("%10s: None" % "Domain")
for i, dns in enumerate(dns_server):
print("%10s: %s" % ("DNS_%d" % (i + 1), dns))

View File

@ -1,3 +0,0 @@
ifcfg
dnspython

4
pyrip
View File

@ -1,6 +1,4 @@
#!/bin/bash
#
BASEDIR=$(dirname $0)
$BASEDIR/pyrip.src/venv/bin/python $BASEDIR/pyrip.src/pyrip.py $*
~/my_apps/pyrip/pyrip $*

@ -1 +0,0 @@
Subproject commit 64d42cdc57d03b323ebcbc8a29cf8f0aa2a96a58