This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
linux_skodi [2020/01/28 22:04] ww [Práce s virtuálkami] |
linux_skodi [2024/06/13 15:31] (current) ww |
||
|---|---|---|---|
| Line 22: | Line 22: | ||
| <code bash> | <code bash> | ||
| - | certbot certonly --webroot -w / | + | certbot certonly |
| - | -m hostmaster@example.com [--dry-run] | + | --webroot |
| + | -w / | ||
| + | -d example.com | ||
| + | -d www.example.com \ | ||
| + | -m hostmaster@example.com | ||
| + | [--dry-run] | ||
| </ | </ | ||
| Line 94: | Line 99: | ||
| addresses: [1.1.1.1, | addresses: [1.1.1.1, | ||
| </ | </ | ||
| + | |||
| + | Seznam typů OS | ||
| + | <code bash> | ||
| + | |||
| Vytvořit virtuálku | Vytvořit virtuálku | ||
| Line 194: | Line 203: | ||
| === Automatické spouštění virtuálky po startu === | === Automatické spouštění virtuálky po startu === | ||
| <code bash> | <code bash> | ||
| + | |||
| + | === Seznam virtuálek, které se automaticky spouštějí po startu === | ||
| + | < | ||
| === Odstranění virtuálky === | === Odstranění virtuálky === | ||
| Line 223: | Line 235: | ||
| Doplnit do ''/ | Doplnit do ''/ | ||
| < | < | ||
| + | |||
| + | === Import OVA === | ||
| + | < | ||
| ---- | ---- | ||
| + | |||
| + | ===== SMTP relay pro tupé tiskárny ===== | ||
| + | |||
| + | - '' | ||
| + | - Nastavit postfix jako " | ||
| + | - Vytvořit soubor '' | ||
| + | - '' | ||
| + | - Spustit '' | ||
| + | - Nastavit práva pro '' | ||
| + | - '' | ||
| + | - '' | ||
| + | - Upravit ''/ | ||
| + | - Přidat/ | ||
| + | - Do '' | ||
| + | - Na konec konfiguráku připsat: < | ||
| + | # enable SASL authentication | ||
| + | smtp_sasl_auth_enable = yes | ||
| + | # disallow methods that allow anonymous authentication. | ||
| + | smtp_sasl_security_options = noanonymous | ||
| + | # where to find sasl_passwd | ||
| + | smtp_sasl_password_maps = hash:/ | ||
| + | # Enable STARTTLS encryption | ||
| + | smtp_use_tls = yes | ||
| + | # where to find CA certificates | ||
| + | smtp_tls_CAfile = / | ||
| + | </ | ||
| + | - Restart postfix | ||
| + | - ??? | ||
| + | - Profit | ||
| + | |||
| + | **Důležité**: | ||
| + | - U Office 365 je při posílání mailu potřeba mít "'' | ||
| + | |||
| + | Otestování konfigurace | ||
| + | * '' | ||
| + | Variantně přes balík '' | ||
| + | - < | ||
| + | set mta=smtp:// | ||
| + | - '' | ||
| + | |||
| + | Zdroj: https:// | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ===== Borg Backup ===== | ||
| + | |||
| + | <code bash> | ||
| + | #!/bin/sh | ||
| + | |||
| + | # Setting this, so the repo does not need to be given on the commandline: | ||
| + | export BORG_REPO=ssh://< | ||
| + | |||
| + | export BORG_PASSPHRASE="< | ||
| + | |||
| + | # some helpers and error handling: | ||
| + | info() { printf "\n%s %s\n\n" | ||
| + | trap 'echo $( date ) Backup interrupted >&2; exit 2' INT TERM | ||
| + | |||
| + | info " | ||
| + | |||
| + | # Backup the most important directories into an archive named after | ||
| + | # the machine this script is currently running on: | ||
| + | |||
| + | borg create | ||
| + | --verbose | ||
| + | --filter AME \ | ||
| + | --list | ||
| + | --show-rc | ||
| + | --stats | ||
| + | --compression lz4 \ | ||
| + | --exclude-caches | ||
| + | --exclude '/ | ||
| + | --exclude '/ | ||
| + | --exclude '/ | ||
| + | --exclude '/ | ||
| + | --exclude '/ | ||
| + | --exclude ' | ||
| + | \ | ||
| + | ::' | ||
| + | /etc \ | ||
| + | /home \ | ||
| + | /root \ | ||
| + | /var \ | ||
| + | |||
| + | backup_exit=$? | ||
| + | |||
| + | info " | ||
| + | |||
| + | # Use the `prune` subcommand to maintain 7 daily, 4 weekly and 6 monthly | ||
| + | # archives of THIS machine. The ' | ||
| + | # limit prune' | ||
| + | # other machines' | ||
| + | |||
| + | borg prune \ | ||
| + | --list | ||
| + | --prefix ' | ||
| + | --show-rc | ||
| + | --keep-daily | ||
| + | --keep-weekly | ||
| + | --keep-monthly | ||
| + | |||
| + | prune_exit=$? | ||
| + | |||
| + | # use highest exit code as global exit code | ||
| + | global_exit=$(( backup_exit > prune_exit ? backup_exit : prune_exit )) | ||
| + | |||
| + | if [ ${global_exit} -eq 1 ]; | ||
| + | then | ||
| + | info " | ||
| + | fi | ||
| + | |||
| + | if [ ${global_exit} -gt 1 ]; | ||
| + | then | ||
| + | info " | ||
| + | fi | ||
| + | |||
| + | exit ${global_exit} | ||
| + | |||
| + | </ | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ===== fstab - příklad ===== | ||
| + | |||
| + | < | ||
| + | fstab | ||
| + | |||
| + | # <file system> | ||
| + | proc / | ||
| + | |||
| + | UUID=27d259c9-f4a8-4749-b8a7-b9a0f019a3c4 | ||
| + | </ | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ===== Docker ===== | ||
| + | |||
| + | === Instalace Ubuntu === | ||
| + | < | ||
| + | # Adding an ASCII Armored key (.asc key) | ||
| + | curl -fsSL https:// | ||
| + | gpg --dearmor | \ | ||
| + | sudo tee / | ||
| + | /dev/null | ||
| + | |||
| + | # Or if you prefer a one-liner | ||
| + | curl -fsSL https:// | ||
| + | |||
| + | # Breakdown of each part | ||
| + | # | ||
| + | # curl | ||
| + | # gpg --dearmor | ||
| + | # sudo tee | ||
| + | # / | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | echo \ | ||
| + | "deb [arch=$(dpkg --print-architecture) signed-by=/ | ||
| + | sudo tee / | ||
| + | /dev/null | ||
| + | |||
| + | |||
| + | # Of if you prefer a one-liner | ||
| + | echo "deb [arch=$(dpkg --print-architecture) signed-by=/ | ||
| + | </ | ||
| + | |||
| + | === One-time rychlovka bouračka === | ||
| + | <code bash> | ||
| + | ('' | ||
| + | |||
| + | ===== Výpis síťových zařízení ===== | ||
| + | |||
| + | < | ||
| + | |||
| + | H/W path Device | ||
| + | ==================================================================== | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | /4 enp46s0d1 | ||
| + | |||
| + | ===== Rychlost síťových rozhraní ===== | ||
| + | |||
| + | < | ||
| + | |||
| + | ===== Shellovinky ===== | ||
| + | |||
| + | === Poslání mailu z shellu, specifikace odesílatele (" | ||
| + | <code bash> | ||
| + | |||
| + | === rsync === | ||
| + | <code bash> | ||