Zde můžete vidět rozdíly mezi vybranou verzí a aktuální verzí dané stránky.
Obě strany předchozí revize Předchozí verze Následující verze | Předchozí verze | ||
software:linux:commands [2018/12/12 15:51] mwk |
software:linux:commands [2021/11/23 13:27] (aktuální) mwk |
||
---|---|---|---|
Řádek 1: | Řádek 1: | ||
+ | ====== Commands ====== | ||
+ | ===== badblocks ===== | ||
+ | <code bash> | ||
+ | * verbose | ||
+ | * force | ||
+ | * write | ||
+ | * show progress | ||
+ | |||
===== tail ===== | ===== tail ===== | ||
vypis logu v realnem case | vypis logu v realnem case | ||
Řádek 33: | Řádek 41: | ||
s = the substitute command | s = the substitute command | ||
g = global (i.e. replace all and not just the first occurrence) | g = global (i.e. replace all and not just the first occurrence) | ||
+ | |||
+ | ===== awk ===== | ||
+ | <code bash> | ||
+ | najde numericke hodnoty za " | ||
===== OPENSSL na Debianu ===== | ===== OPENSSL na Debianu ===== | ||
Řádek 83: | Řádek 95: | ||
<code bash> | <code bash> | ||
- | ===== ssh key pro vzdalene prihlasovani klientu pres ssh ===== | ||
- | ssh rsa key generovani - nezadavat passphrase | ||
- | <code bash> | ||
- | prekopirovani na server | ||
- | <code bash> | ||
- | ===== ssh klice 2 ===== | ||
- | **server**: jako root | ||
- | <code bash> | ||
- | heslo nechame prazdne | ||
- | <code bash>scp / | ||
- | **cilovy stroj** | ||
- | <code bash> | ||
- | touch / | ||
- | chmod 700 ~/.ssh | ||
- | chmod 600 ~/ | ||
- | cat / | ||
- | ===== symlink zmena targetu bez smazani ===== | ||
- | <code bash>ln -f -s /home/zdroj / | ||
- | ===== SED ===== | ||
- | <code bash>sed -i ' | ||
- | -i = in-place (i.e. save back to the original file) | ||
- | s = the substitute command | ||
- | g = global (i.e. replace all and not just the first occurrence) | ||
- | |||
- | ===== OPENSSL na Debianu ===== | ||
- | |||
- | <code bash>apt install certbot python-certbot-apache</ | ||
- | |||
- | zkontrolovat /etc/hosts, jestli je cele jmeno na lokalni IP a generujeme: | ||
- | |||
- | <code bash> | ||
- | |||
- | Pak to chce zkusit na automatickou obnovu udelat skript a dat do cronu pomoci | ||
- | |||
- | <code bash> | ||
- | |||
- | |||
- | ===== Rdiff-backup ===== | ||
- | **backup - server** a nasledne i klient jako root | ||
- | |||
- | <code bash> | ||
- | rdiff-backup --version</ | ||
- | |||
- | * verze server - klient by se mely shodovat | ||
- | * vygenerujeme klice pro roota, dle ssh klic 2 a budeme distribuovat na klienty nasledne | ||
- | |||
- | <code bash> | ||
- | |||
- | **priklad zalohy** | ||
- | |||
- | <code bash> | ||
- | |||
- | takhle s tim do cronu | ||
- | <file bash gpiobackup.sh> | ||
- | !/bin/bash | ||
- | ## gpiobackup script | ||
- | # Backup | ||
- | rdiff-backup --exclude /tmp --exclude /mnt --exclude /proc --exclude /sys --exclude /run --exclude /dev --exclude /var/backup -v5 root@10.133.$ | ||
- | sleep 5 | ||
- | rdiff-backup --exclude /tmp --exclude /mnt --exclude /proc --exclude /sys --exclude /run --exclude /dev --exclude /var/backup -v5 root@10.133.$ | ||
- | sleep 5 | ||
- | rdiff-backup --exclude /tmp --exclude /mnt --exclude /proc --exclude /sys --exclude /run --exclude /dev --exclude /var/backup -v5 root@10.133.$ | ||
- | # Clean Increments | ||
- | rdiff-backup --force --remove-older-than 4B / | ||
- | rdiff-backup --force --remove-older-than 4B / | ||
- | rdiff-backup --force --remove-older-than 4B / | ||
- | </ |