Compare commits

..

No commits in common. "master" and "84582af" have entirely different histories.

32 changed files with 282 additions and 359 deletions

3
.gitignore vendored
View File

@ -1,6 +1,3 @@
venv
*/venv
# ---> Linux # ---> Linux
*~ *~

9
.gitmodules vendored
View File

@ -1,9 +0,0 @@
[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

5
add_my_git_ca_certs Executable file
View File

@ -0,0 +1,5 @@
#!/bin/bash
#
echo -n | openssl s_client -showcerts -connect git.mount-mockery.de:443 2>/dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee /usr/local/share/ca-certificates/mount-mockery.crt
sudo update-ca-certificates

View File

@ -1,22 +0,0 @@
#!/bin/bash
#
if [[ $UID != 0 ]]; then
echo "You need to be root to execute that script"
exit 1
fi
if [[ $# != 2 ]]; then
echo "You need to give at least 2 parameters <network_interface> <vlan_id>."
exit 1
fi
apt install vlan
modprobe 8021q
ip link add link $1 name $1.$2 type vlan id $2
if [[ $2 == 10 ]]; then
ip addr add 192.168.0.217/24 dev $1.$2
else
ip addr add 192.168.$2.217/24 dev $1.$2
fi
ip link set up $1.$2

View File

@ -3,23 +3,48 @@
# #
# Additional Packages # Additional Packages
COMMON="keepassx systemd-sysv openssh-server vim-nox tree" COMMON="joe keepass2 xdotool powerline fonts-powerline powerline-gitstatus curlftpfs libstdc++6"
# 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" _COMMON="
MULTIMEDIA="$MULTIMEDIA lame" joe git tmux
MULTIMEDIA="$MULTIMEDIA qjackctl carla carla-lv2 carla-vst ardour calf-plugins eq10q fluid-soundfont-gm fluid-soundfont-gs lame" keepass2 xdotool
brasero
sshfs curlftpfs openssh-server
fonts-powerline powerline python3-powerline python3-powerline-gitstatus
lib32stdc++6
"
TOOLS="wavemon evolution retext gnuplot latexmk texlive-latex-recommended texlive-latex-extra texlive-lang-german texlive-plain-generic texlive-fonts-recommended" MULTIMEDIA="qjackctl ardour calf-plugins eq10q fluid-soundfont-gm fluid-soundfont-gs lame kodi"
PROGRAMMING="python-is-python3 python3-venv python3-wxgtk4.0 pkgconf libgtk2.0-dev jq meld" _MULTIMEDIA="
ffmpeg
kodi kodi-pvr-hts
spotify-client
"
TOOLS="evolution latexmk texlive-generic-recommended texlive-latex-extra texlive-lang-german texlive-fonts-recommended"
_TOOLS="
evolution
gnuplot
gnome-boxes
gvncviewer
texlive-binaries texlive-latex-extra texlive-lang-german texlive-fonts-recommended texstudio
gimp
"
PROGRAMMING="virtualenv python3-wxgtk4.0 qt5dxcb-plugin"
_PROGRAMMING="
pycodestyle
virtualenv
python-coverage python3-coverage python-jinja2 python3-jinja2
python-wxtools python3-wxgtk4.0
python3-evdev python3-serial
python3-sphinx python3-sphinx-rtd-theme
meld
retext
"
ALL=$COMMON\ $MULTIMEDIA\ $TOOLS\ $PROGRAMMING ALL=$COMMON\ $MULTIMEDIA\ $TOOLS\ $PROGRAMMING

30
apt-extend-raspi Executable file
View File

@ -0,0 +1,30 @@
#!/bin/sh
#
#
# Additional Packages
COMMON="
zsh zsh-syntax-highlighting zsh-autosuggestions
vim vim-python-jedi vim-autopep8 git tmux
neofetch figlet powerline
"
ALL=$COMMON
echo The followin packages and their required depending packages will be installed:
echo ------------------------------------------------------------------------------
echo $ALL
echo ------------------------------------------------------------------------------
read -r -p "Are you sure? [y/N] " response
echo ------------------------------------------------------------------------------
case "$response" in
[yY][eE][sS]|[yY])
sudo apt-get -y install $ALL
#
echo
echo
;;
*)
echo Installation aborted!
;;
esac

73
apt-extend-ubuntustudio Executable file
View File

@ -0,0 +1,73 @@
#!/bin/sh
#
#
# Additional Packages
COMMON="
joe
neofetch
tlp tlp-rdw
keepass2
synaptic
owncloud-client
dolphin-owncloud
"
_COMMON_="
git tmux
sshfs curlftpfs libneon27
openssh-server
nfs-kernel-server
lib32stdc++6
powerline powerline-gitstatus fonts-powerline
gnome-tweaks chrome-gnome-shell caffeine
"
MULTIMEDIA="
kodi kodi-pvr-hts
ubuntu-restricted-extras libdvd-pkg
"
_MULTIMEDIA_="
ubuntu-restricted-extras libdvd-pkg
ardour ubuntustudio-controls calf-plugins eq10q fluid-soundfont-gm fluid-soundfont-gs guitarix-ladspa swh-plugins
gxtuner
lame
"
_TOOLS_="
evolution
gnuplot
gvncviewer
texlive-binaries texlive-latex-extra texlive-lang-german texlive-fonts-recommended latexila
gimp
kicad kicad-packages3d
openscad freecad
"
_PROGRAMMING_="
arduino
minicom
virtualenv
libgtk-3-dev
python3-pip
meld
"
ALL=$COMMON\ $MULTIMEDIA\ $TOOLS\ $PROGRAMMING
echo The followin packages and their required depending packages will be installed:
echo ------------------------------------------------------------------------------
echo $ALL
echo ------------------------------------------------------------------------------
read -r -p "Are you sure? [y/N] " response
echo ------------------------------------------------------------------------------
case "$response" in
[yY][eE][sS]|[yY])
sudo apt-get -y install $ALL
;;
*)
echo Installation aborted!
;;
esac

View File

@ -1,7 +1,6 @@
#!/bin/python3 #!/bin/python3
# #
import subprocess import subprocess
import sys
import time import time
class host(object): class host(object):
@ -88,22 +87,7 @@ with open('/var/lib/misc/dnsmasq.leases', 'r') as fh:
if h.mac not in hl: if h.mac not in hl:
hl.append(h) 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(hl.vlan_list(vlan))
print() print()

3
ftail Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
clear
/opt/ftail/venv/bin/python /opt/ftail/ftail.py $*

3
garage Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
#
python3 ~/prj/clients/garage/tcp_client.py

View File

@ -3,12 +3,7 @@
git config --global user.name "Dirk Alders" git config --global user.name "Dirk Alders"
git config --global user.email dirk@mount-mockery.de git config --global user.email dirk@mount-mockery.de
# #
git config --global pull.rebase false
#
git config --global diff.tool meld git config --global diff.tool meld
git config --global merge.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 --add difftool.prompt false
# git config --global pull.rebase false
git config --global credential.helper store

226
giti
View File

@ -1,51 +1,13 @@
#!/bin/bash #!/bin/bash
# #
# DEFINITIONS ##################################################################################### #
COLOR_BACKGROUND="\033[48;2;48;64;72m" # RGB BACKGROUND # command line arguments
COLOR_FOR_AS_BACKGROUND="\033[38;2;48;64;72m" # RGB FOREGROUND LIKE BACKGROUND #
usage="Usage: $0 [-p | output for prompt]"
COLOR_DARKGREEN="\033[0;32m" # PROMPT LINES while getopts "hp" options; do
COLOR_NORMAL="\033[0m" # RESET
SYMBOL_START="$COLOR_NORMAL$COLOR_FOR_AS_BACKGROUND\Ue0b2$COLOR_BACKGROUND "
SYMBOL_END="$COLOR_BACKGROUND $COLOR_NORMAL$COLOR_FOR_AS_BACKGROUND\Ue0b0"
SYMBOL_SPLIT=" "
SYMBOL_BRANCH="\Ue0a0\x00"
SYMBOL_NEW="…\x00"
SYMBOL_AHEAD="↑\x00"
SYMBOL_BEHIND="↓\x00"
SYMBOL_CHANGED="✚\x00"
SYMBOL_COMMITED="●\x00"
SYMBOL_STASH="⚑\x00"
COLOR_BRANCH_CLEAN="\033[38;2;0;192;0m"
COLOR_BRANCH_CHANGED="\033[38;2;255;192;8m"
COLOR_BRANCH_OUTDATED="\033[38;2;152;152;152m"
COLOR_BRANCH_COMMIT="\033[38;2;208;168;224m"
COLOR_BRANCH_BRANCH="\033[38;2;140;208;240m"
COLOR_NEW="\033[38;2;224;48;8m"
COLOR_AHEAD="\033[38;2;192;192;192m"
COLOR_BEHIND="$COLOR_AHEAD"
COLOR_CHANGED="\033[38;2;224;128;8m"
COLOR_COMMITED="\033[38;2;8;224;160m"
COLOR_STASH="\033[38;2;0;32;224m"
COLOR_URL="\033[38;2;0;224;192m"
BRANCH_VAL="unknown"
AHEAD_VAL="0"
BEHIND_VAL="0"
NEW_VAL="0"
CHANGED_VAL="0"
COMMITED_VAL="0"
# COMMAND LINE ARGUMENTS ##########################################################################
usage="Usage: $0 [-p | output for prompt] [-s | short output]"
while getopts "hps" options; do
case $options in case $options in
p ) PROMPT="True";; p ) PROMPT="True";;
s ) SHORT="True";;
h ) echo $usage h ) echo $usage
exit 0 exit 0
;; ;;
@ -55,121 +17,93 @@ while getopts "hps" options; do
esac esac
done done
# GIT COMMANDS #################################################################################### #
GIT_URL="$(LANGUAGE='en_US.UTF-8 git' git config --get remote.origin.url 2> /dev/null)" # color definitions
GIT_STATUS="$(LANGUAGE='en_US.UTF-8 git' git status -sb 2> /dev/null)" #
GIT_FILES="$(LANGUAGE='en_US.UTF-8 git' git status -s 2> /dev/null)" COLOR_WHITE="\033[00m"
BRANCH_VAL="$(LANGUAGE='en_US.UTF-8 git' git branch 2> /dev/null | sed --quiet 's/* \(.*\)/\1/p')" COLOR_CYAN="\033[1;36m"
STASH_VAL=$(LANGUAGE='en_US.UTF-8 git' git stash list 2> /dev/null | wc -l) COLOR_RED="\033[1;31m"
COLOR_YELLOW="\033[1;33m"
COLOR_DARKYELLOW="\033[0;33m"
COLOR_GREEN="\033[1;32m"
COLOR_DARKGREEN="\033[0;32m"
COLOR_OCHRE="\033[38;5;95m"
#
# git information storage
#
git_status="$(LANGUAGE='en_US.UTF-8 git' git status 2> /dev/null)"
git_diff="$(git status --porcelain 2> /dev/null)"
#
# decision for git output (path is repository) # decision for git output (path is repository)
if [ -z "$GIT_STATUS" ]; then #
if [ -z "$git_status" ]; then
# No GIT repository # No GIT repository
exit exit
fi fi
# GIT MAGIC ####################################################################################### #
# BEHIND_VAL, AHEAD_VAL # git preparations
BEHIND_VAL=$(echo $GIT_STATUS | grep -Po "behind\s+\K\w+") #
AHEAD_VAL=$(echo $GIT_STATUS | grep -Po "ahead\s+\K\w+") git_branch="$(git branch 2> /dev/null | sed --quiet 's/* \(.*\)/\1/p')"
git_url="$(git config --get remote.origin.url 2> /dev/null)"
# NEW_VAL, MODIFIED_VAL, COMMITED_VAL if [[ ! $git_status =~ "working tree clean" ]] && [[ ! $git_status =~ "working directory clean" ]]; then
GIT_STATUS_DETAILS="" git_status_color="$COLOR_RED"
if [[ ! -z "$GIT_FILES" ]]; then git_status_text="local changes"
while IFS= read -r line ;do elif [[ $git_status =~ "Your branch is behind" ]]; then
FILES_STATUS=${line:0:2} git_status_color="$COLOR_YELLOW"
FILES_STATUS_COMMITED=${FILES_STATUS:0:1} git_status_text="pull required"
FILES_STATUS_CHANGED=${FILES_STATUS:1:1} elif [[ $git_status =~ "Your branch is ahead of" ]]; then
FILES_NAME=$(echo $line | awk '{print $2}') git_status_color="$COLOR_YELLOW"
# NEW FILE increase git_status_text="push required"
if [[ $FILES_STATUS == "??" ]]; then elif [[ $git_status =~ "nothing to commit" ]]; then
((NEW_VAL++)) git_status_color="$COLOR_DARKGREEN"
fi git_status_text="clean "
# CHANGED
if [[ $FILES_STATUS_CHANGED != "?" && $FILES_STATUS_CHANGED != " " && $FILES_STATUS_CHANGED != "" ]]; then
((CHANGED_VAL++))
fi
# COMMITED
if [[ $FILES_STATUS_COMMITED != "?" && $FILES_STATUS_COMMITED != " " && $FILES_STATUS_COMMITED != "" ]]; then
((COMMITED_VAL++))
fi
done <<< "$GIT_FILES"
fi
# GIT STATUS COLOR ################################################################################
if [[ $BRANCH_VAL == "master" || $BRANCH_VAL == "main" ]]; then
COLOR_BRANCH=$COLOR_BRANCH_CLEAN
elif [[ $BRANCH_VAL == *"HEAD detached at"* ]]; then
COLOR_BRANCH=$COLOR_BRANCH_COMMIT
BRANCH_VAL=$(echo $BRANCH_VAL | awk '{print $4}')
BRANCH_VAL=${BRANCH_VAL::-1}
else else
COLOR_BRANCH=$COLOR_BRANCH_BRANCH git_status_color="$COLOR_OCHRE"
git_status_text="unknown "
fi fi
if [[ $COMMITED_VAL > 0 || $CHANGED_VAL > 0 ]]; then
COLOR_BRANCH="$COLOR_BRANCH_CHANGED"
elif [[ $BEHIND_VAL > 0 || $AHEAD_VAL > 0 || $NEW_VAL > 0 ]]; then
COLOR_BRANCH="$COLOR_BRANCH_OUTDATED"
fi
# GIT GATHERING ################################################################################### #
BRANCH="$COLOR_BRANCH$COLOR_BACKGROUND$SYMBOL_BRANCH$BRANCH_VAL" # Start of console output
BEHIND="$COLOR_BEHIND$COLOR_BACKGROUND$SYMBOL_BEHIND$BEHIND_VAL" #
AHEAD="$COLOR_AHEAD$COLOR_BACKGROUND$SYMBOL_AHEAD$AHEAD_VAL"
NEW="$COLOR_NEW$COLOR_BACKGROUND$SYMBOL_NEW$NEW_VAL"
CHANGED="$COLOR_CHANGED$COLOR_BACKGROUND$SYMBOL_CHANGED$CHANGED_VAL"
COMMITED="$COLOR_COMMITED$COLOR_BACKGROUND$SYMBOL_COMMITED$COMMITED_VAL"
STASH="$COLOR_STASH$COLOR_BACKGROUND$SYMBOL_STASH$STASH_VAL"
# GIT OUTPUT ###################################################################################### ## STATUS AND INFO ######
GIT_STATUS_SUMMARY="$BRANCH" if [[ $PROMPT ]]; then
if [[ $BEHIND_VAL > 0 ]]; then # print status
GIT_STATUS_SUMMARY=$GIT_STATUS_SUMMARY$SYMBOL_SPLIT$BEHIND echo -e "$git_status_color├──$COLOR_GREEN($git_branch)$git_status_color - $git_status_text - $COLOR_CYAN$git_url$COLOR_WHITE"
fi else
if [[ $AHEAD_VAL > 0 ]]; then # print status and
GIT_STATUS_SUMMARY=$GIT_STATUS_SUMMARY$SYMBOL_SPLIT$AHEAD echo -e "$git_status_color┌───┤ $git_status_text ├────────────────────────────────────────────────────────────────"
fi echo -e "$git_status_color│ $COLOR_GREEN($git_branch) $COLOR_CYAN$git_url"
if [[ $COMMITED_VAL > 0 ]]; then
GIT_STATUS_SUMMARY=$GIT_STATUS_SUMMARY$SYMBOL_SPLIT$COMMITED
fi
if [[ $CHANGED_VAL > 0 ]]; then
GIT_STATUS_SUMMARY=$GIT_STATUS_SUMMARY$SYMBOL_SPLIT$CHANGED
fi
if [[ $NEW_VAL > 0 ]]; then
GIT_STATUS_SUMMARY=$GIT_STATUS_SUMMARY$SYMBOL_SPLIT$NEW
fi
if [[ $STASH_VAL > 0 ]]; then
GIT_STATUS_SUMMARY=$GIT_STATUS_SUMMARY$SYMBOL_SPLIT$STASH
fi
if [[ $PROMPT == "True" ]]; then if [[ ! $git_diff == "" ]]; then
if [[ $SHORT == "True" ]]; then echo -e "$git_status_color├────────────────────────────────────────────────────────────────────────────────────"
echo -ne " $SYMBOL_START$GIT_STATUS_SUMMARY$SYMBOL_END"
else else
echo -e "$COLOR_DARKGREEN├$SYMBOL_START$GIT_STATUS_SUMMARY $COLOR_NORMAL$COLOR_BACKGROUND- $COLOR_URL$GIT_URL$SYMBOL_END" echo -e "$git_status_color└────────────────────────────────────────────────────────────────────────────────────$COLOR_WHITE\n \b"
if [[ $GIT_PROMPT_DETAILS == "on" && ! -z "$GIT_FILES" ]]; then
while IFS= read -r line ;do
FILES_STATUS=${line:0:2}
FILES_STATUS_CHANGED=${FILES_STATUS:1:1}
if [[ $FILES_STATUS_CHANGED != "?" && $FILES_STATUS_CHANGED != " " ]]; then
echo -e "$COLOR_DARKGREEN│ $COLOR_BRANCH$line"
fi fi
done <<< "$GIT_FILES" fi
fi
echo -ne "$COLOR_NORMAL\b" ## FILE INFO ############
fi if [[ ! $git_diff == "" ]]; then
else if [[ ! $PROMPT || "$GIT_PROMPT_DETAILS" == "on" ]]; then
echo -e "$SYMBOL_START$GIT_STATUS_SUMMARY $COLOR_NORMAL$COLOR_BACKGROUND- $COLOR_URL$GIT_URL$SYMBOL_END" IFS=$'\n'
if [[ ! -z "$GIT_FILES" ]]; then for ENTRY in $git_diff; do
while IFS= read -r line ;do if [[ $ENTRY = "D "* ]] || [[ $ENTRY = "A "* ]] || [[ $ENTRY = "M "* ]] || [[ $ENTRY = "MM"* ]] || [[ $ENTRY = "R "* ]]; then
if [[ $line != "??"* ]]; then echo -e "$git_status_color│ $COLOR_DARKYELLOW$ENTRY"
echo -e " $COLOR_BRANCH$line" else
fi echo -e "$git_status_color│ $COLOR_YELLOW$ENTRY"
done <<< "$GIT_FILES" fi
fi done
echo -ne "$COLOR_NORMAL" fi
fi
## CLOSING ##############
if [[ $PROMPT ]]; then
echo -e " \b"
else
echo -e "$git_status_color└────────────────────────────────────────────────────────────────────────────────────$COLOR_WHITE\n \b"
fi fi

2
gitt
View File

@ -1,3 +1,3 @@
#!/bin/sh #!/bin/sh
# #
git log --graph --oneline --all --decorate --topo-order $* git log --graph --oneline --all --decorate --topo-order

3
leyk Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
#
python3 ~/prj/clients/leyk/tcp_client.py

View File

@ -1,16 +1,4 @@
#!/bin/sh #!/bin/sh
clear clear
/opt/mqtt_sniffer/venv/bin/python /opt/mqtt_sniffer/mqtt_sniffer.py -f mqtt.home
#!/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_smarthome || tmux new-session -s mqtt_smarthome "/opt/mqtt_sniffer/venv/bin/python /opt/mqtt_sniffer/mqtt_sniffer.py -f mqtt.home"

View File

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

View File

@ -1,16 +0,0 @@
#!/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"

@ -1 +0,0 @@
Subproject commit 8726b19639832d3ce0653bb91bd74e2e2a64bc3f

View File

@ -1,10 +0,0 @@
#!/bin/sh
#
BASEDIR=$(dirname $0)
if [ $# -eq 0 ]; then
python3 $BASEDIR/nagios.src/status.py nagios.home
else
python3 $BASEDIR/nagios.src/status.py $*
fi

View File

@ -1,8 +0,0 @@
#!/bin/bash
#
if [ $# == 0 ]
then
ssh nas sudo /usr/sbin/shutdown -P 5
else
ssh nas sudo /usr/sbin/shutdown -P $1
fi

View File

@ -1,4 +0,0 @@
#!/bin/sh
#
wakeonlan 38:ea:a7:a6:03:9d

6
netst
View File

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

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

10
pdns-get Executable file
View File

@ -0,0 +1,10 @@
#!/bin/bash
#
IP=`wget -O - stdout http://pdns.mount-mockery.de 2> /dev/null|jq .$1`
if [[ "$IP" = "null" ]]; then
echo No IP found for host $1.
exit 1
else
echo $IP
fi

8
pdns-proxy Executable file
View File

@ -0,0 +1,8 @@
#/bin/bash
#
HOST=`pdns-get $1`
if [[ $? -eq 0 ]]; then
socat stdio tcp:$HOST:22
else
>&2 echo CONNECTION ERROR: IP of host $1 is unknown.
fi

4
pdns-register Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
#
wget -O - stdout http://pdns.mount-mockery.de/pdns/$(hostname) 2> /dev/null 1> /dev/null

6
pyrip
View File

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

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

8
reposinit Executable file
View File

@ -0,0 +1,8 @@
#!/bin/sh
#
echo "* Creating virtual env"
./mkvenv
echo "* Creating link in homedirectory"
ln -s `pwd` ~/bin

9
terminal_exec Executable file
View File

@ -0,0 +1,9 @@
#!/bin/sh
#
if ! gnome-terminal -- $*; then
if ! konsole -e $*; then
if ! xfce4-terminal -e $*; then
$*
fi
fi
fi

1
upload2etrex Executable file
View File

@ -0,0 +1 @@
sudo gpsbabel -t -i gpx -f "$1" -o garmin -F usb: