Inhaltsverzeichnis

New Linux Stuff

MDM, RAID, SMART

WinDirStat

Internet auf FritzBox ustellen

:td: bash-Komplettierung einschalten

Vortragsfolien

:yt: Video dazu

Quick-Tipps

systemd

Allgemeine Infos zu systemd

Logging in systemd

Backup-Script

backup.sh
#!/bin/bash
 
base_dir="/home/ivo/test"
 
year=`date +"%y"`
month=`date +"%m"`
day=`date +"%d"`
 
target="${base_dir}/${year}/${month}/${day}"
 
if [ ! -d "${target}" ]; then
    mkdir -p "${target}";
fi
 
cp -a /tmp/schnack ${target} || logger "xxx backup Mist ..." && logger "vvv Backup done ..."

BASH-Prompt

# roter Prompt für root
if [ "$LOGNAME" == "root" ]
then
	echo "ROOT! AUFPASSEN!"
	PS1="\[\e[31m\]ROOT\[\e[m\]\[\e[31m\]@\[\e[m\]\[\e[31m\]\h\[\e[m\]\[\e[31m\]:\[\e[m\]\[\e[31m\]\w\[\e[m\]\[\e[31m\]>\[\e[m\] "
else
	echo "NICHT ROOT! ALLES EASY!"
	PS1="\[\e[32m\]\u\[\e[m\]\[\e[32m\]@\[\e[m\]\[\e[32m\]\h\[\e[m\]\[\e[32m\]:\[\e[m\]\[\e[32m\]\w\[\e[m\]\[\e[32m\]>\[\e[m\] "
fi

tmux

mtr

ip

ripgrep

ranger

sudo

Cmnd_Alias ADMINISTRATION = /usr/bin/apt-get, /usr/bin/dpkg, /bin/systemctl, /bin/journalctl
ivo ALL = NOPASSWD: ADMINISTRATION

pdmenu

datei.in
menu:main:Ivo's Menü
        exec:_systemctl::systemctl
        exec:l_s:truncate:ls -lahs
        show:_Neues Untermenü...::library
        exec:_IP Show:truncate:/sbin/ip addr show
 
menu:library:Schnick Schnack Überschrift?
        exec:top::top
        exec:In welchem Verzeichnis bin ich?:display:pwd

ssmtp

revaliases
# /etc/ssmtp/revaliases
root:ivo@ivo-s.de:v033xxx.kasserver.com:465
ivo:ivo@ivo-s.de:v033xxx.kasserver.com:465
ssmtp.conf
#
# Config file for sSMTP sendmail
#
# The person who gets all mail for userids < 1000
# Make this empty to disable rewriting.
root=ivo
 
# The place where the mail goes. The actual machine name is required no 
# MX records are consulted. Commonly mailhosts are named mail.domain.com
mailhub=v033xxx.kasserver.com
 
# Where will the mail seem to come from?
rewriteDomain=ivo-s.de
 
# The full hostname
hostname=ivo-s.de
UseTLS=YES
 
# ACHTUNG in kasserver nach Benutzer schauen.
# ACHTUNG 8 (ACHT) Ziffern!
AuthUser=v033xxxxx
 
# ACHTUNG!
AuthPass=XXXXXXXXXXXX
 
# Are users allowed to set their own From: address?
# YES - Allow the user to specify their own From: address
# NO - Use the system generated From: address
# WICHTIG!
FromLineOverride=NO

port knocking

knockd.conf
[options]
        UseSyslog
 
[SSH]
        sequence        =       7000,8000,9000
        seq_timeout     =       5
        start_command   =       ufw allow from %IP% to any port 22
        tcpflags        =       syn
        cmd_timeout     =       10
        stop_command    =       ufw delete allow from %IP% to any port 22
knockd
# /etc/default/knockd
 
# control if we start knockd at init or not
# 1 = start
# anything else = don't start
# PLEASE EDIT /etc/knockd.conf BEFORE ENABLING
START_KNOCKD=1
 
# command line options
KNOCKD_OPTS="-i enp0s3"
knockd.service
# /lib/systemd/system/knockd.service
 
[Unit]
Description=Port-Knock Daemon
After=network.target
Documentation=man:knockd(1)
 
[Service]
EnvironmentFile=-/etc/default/knockd
ExecStart=/usr/sbin/knockd $KNOCKD_OPTS
ExecReload=/bin/kill -HUP $MAINPID
KillMode=mixed
SuccessExitStatus=0 2 15
######################
# Disable if error not writable
# ProtectSystem=full
######################
CapabilityBoundingSet=CAP_NET_RAW CAP_NET_ADMIN

IP-Adresse auf den Webserver

curl -s ipinfo.io/ip > ip.txt && curl -s -T ip.txt ftp://xyz.de –user benutzer_name:passwort

x11vnc

knockd.conf
# /etc/knockd.conf
[VNC]
 
	sequence	=	6000,7000,8000
	seq_timeout	=	5
	start_command	=	ufw allow from %IP% to any port 5900
	tcpflags	=	syn
	cmd_timeout	=	10
	stop_command	=	ufw delete allow from %IP% to any port 5900

erweiterte Attribute für samba/DC (rsync und rsnapshot)