Very Windy

From 6bit.ch wiki
Revision as of 12:07, 18 February 2026 by Xbl (talk | contribs) (→‎openssl)
Jump to navigation Jump to search

lvm procedure

 Die VM-Disk /dev/sda wurde vergrössert
    1. Ist Zustand prüfen
        lsblk
    2. Disk "sda" neu einlesen
        echo 1 > /sys/block/sda/device/rescan
    3. Partition vergrössern
        growpart /dev/sda 3
    4. PV überprüfen
        pvs
        4a. allenfalls physical volume vergrössern
            pvresize /dev/sda3
    5. VG überprüfen
        vgs
    6. LV vergrössern und Filesystem vergrössern
        lvresize -rL+50G /dev/mapper/system-docker
        lvextend -rl +100%FREE /dev/mapper/vm208-root

git

git submodule update --init Submodule laden
git submodule update --init --recursive Submodule laden
git submodule update --remote Submodule aktualisieren

openssl

Check CSR:
openssl req -in sample.csr -noout -text
Bash to check private key against certificate:

 cn=files/reverseproxies/etc/haproxy/certs/www.sexybit.sh
crt="${cn:?Common Name fuer Key und Cert nicht angegebe...}.crt"
key="$cn.key"

crtmd5=$( openssl x509 -noout -modulus -in "$crt" | openssl md5 ) ; \
keymd5=$( openssl rsa  -noout -modulus -in "$key" | openssl md5 ) ; \
\
echo "crt: $crtmd5" ; echo "key: $keymd5" ; printf "Dateien: \"$crt\" & \"$key\" -- " ; \
[ "$crtmd5" = "$keymd5" ] && echo "passen zusammen  :)" || echo "passen NICHT zusammen  :("
<nowiki>

== ansible ==
<code>ansible-playbook -C -D playbooks/all.yml -u $USER -t nginx</code> -C (check, dry run), -D (diff, show differences) -u <remote user> -t <tags><br>
Tags let you run only specific tagged tasks in a playbook instead of executing everything. Multiple tags can be comma-separated.<br>
Tags can be skipped with <code>--skip-tags <tags></code><br>
Tasks tagged 'always' will run no matter what tags are selected.<br>
Tasks tagged 'never' only run if explicitly requested with <code>-t never</code><br>

== ln ==
<code>ln -s ../files</code>

== curl ==
<code>curl -v --resolve windy.verywindy.ch:443:192.168.161.1 https://windy.verywindy.ch</code> check connection with hardcoded dns<br>
<code>curl -x sexybit.sh https://apod.nasa.gov</code> check connection with proxy<br>
<code>curl -L https://apod.nasa.gov</code> follow redirects

== New Systems ==
Size: 2CPU, 2G RAM, 40G Disk<br>
VG Name: system<br>
/: 10G<br>
Swap: 4G<br>
/var-log: 4G<br>

== IPTables / firewalld ==
  <nowiki><?xml version="1.0" encoding="utf-8"?>
<direct>
  <rule ipv="ipv4" table="filter" chain="INPUT" priority="0">-p tcp --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT</rule>
  <rule ipv="ipv4" table="filter" chain="INPUT" priority="1">-p tcp --dport 21022 -m state --state NEW,ESTABLISHED -j ACCEPT</rule>
  <rule ipv="ipv4" table="filter" chain="INPUT" priority="5">-p icmp -j ACCEPT</rule>
  <rule ipv="ipv4" table="filter" chain="INPUT" priority="8">-p udp --sport 53 -j ACCEPT</rule>
  <rule ipv="ipv4" table="filter" chain="OUTPUT" priority="0">-p tcp --sport 22 -m state --state ESTABLISHED -j ACCEPT</rule>
  <rule ipv="ipv4" table="filter" chain="OUTPUT" priority="1">-p tcp --sport 21022 -m state --state ESTABLISHED -j ACCEPT</rule>
  <rule ipv="ipv4" table="filter" chain="OUTPUT" priority="5">-p icmp -j ACCEPT</rule>
  <rule ipv="ipv4" table="filter" chain="OUTPUT" priority="6">-p udp --dport 53 -j ACCEPT</rule>
  <rule ipv="ipv4" table="filter" chain="OUTPUT" priority="8">-p tcp --dport 80 -j ACCEPT</rule>
  <rule ipv="ipv4" table="filter" chain="OUTPUT" priority="9">-p tcp --dport 443 -j ACCEPT</rule>
  <rule ipv="ipv4" table="filter" chain="OUTPUT" priority="12">-p udp --dport 123 -j ACCEPT</rule>
  <rule ipv="ipv4" table="filter" chain="OUTPUT" priority="56">-p tcp --dport 5665 -j ACCEPT</rule>
  <rule ipv="ipv4" table="filter" chain="OUTPUT" priority="67">-p udp --dport 67:68 -j ACCEPT</rule>
  <rule ipv="ipv4" table="filter" chain="OUTPUT" priority="69">-m state --state ESTABLISHED,RELATED -j ACCEPT</rule>
  <rule ipv="ipv4" table="filter" chain="OUTPUT" priority="99">-j DROP</rule>
</direct>

Show all direct rules (/etc/firewalld/direct.xml):
firewall-cmd --get-all-rules --direct

Clear root Password / disable root login

-d --delete: delete user's password
-l --lock: lock user's password
# passwd -dl root

Start new git project

Create blank repo without README.md
Run ansible-init script

Monitoring

icinga-Server verbindet sich zum Agent über Port 5665.

Bei Wartungen Downtime erstellen.