From 39565abee9037bbc0966b54939d3421cfb3ef5fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikl=C3=B3s=20T=C3=B3th?= <tothmiklostibor@gmail.com> Date: Sun, 21 Mar 2021 19:13:16 +0100 Subject: [PATCH] eloadas beta 1 --- eloadas.md | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) diff --git a/eloadas.md b/eloadas.md index 318cd0f..4e477d0 100644 --- a/eloadas.md +++ b/eloadas.md @@ -65,3 +65,95 @@ curl https://git.sch.bme.hu/mikewashere.keys >> .ssh/authorized_keys - shell automatizĂĄlĂĄsa - mintha soronkĂŠnt kiadnĂĄnk a parancsokat + +```shell-session +[mike@thinkyboi tmp]$ vi test.sh +[mike@thinkyboi tmp]$ cat test.sh +echo "ez simĂĄn mĹąkĂśdik" | cowsay +curl "https://home.sch.bme.hu/~mikewashere/linux/eloadas.md" | grep "soronkĂŠnt" | cowsay + +[mike@thinkyboi tmp]$ bash test.sh + _____________________ +< ez simĂĄn mĹąkĂśdik > + --------------------- + \ ^__^ + \ (oo)\_______ + (__)\ )\/\ + ||----w | + || || + % Total % Received % Xferd Average Speed Time Time Time Current + Dload Upload Total Spent Left Speed +100 1596 100 1596 0 0 69391 0 --:--:-- --:--:-- --:--:-- 69391 + _________________________________ +/ - mintha soronkĂŠnt kiadnĂĄnk a \ +\ parancsokat / + --------------------------------- + \ ^__^ + \ (oo)\_______ + (__)\ )\/\ + ||----w | + || || +[mike@thinkyboi tmp]$ +``` + +# shebang + +- file futtatĂĄsakor a kernel meglesi mi van az elejĂŠn +- el tudunk indĂtani scripteket programkĂŠnt +- `#!<program>` + +```shell-session +[mike@thinkyboi tmp]$ vi test.sh +[mike@thinkyboi tmp]$ cat test.sh +#!/bin/bash +echo "ez simĂĄn mĹąkĂśdik" | cowsay +curl "https://home.sch.bme.hu/~mikewashere/linux/eloadas.md" | grep "soronkĂŠnt" | cowsay + +[mike@thinkyboi tmp]$ chmod +x test.sh +[mike@thinkyboi tmp]$ ./test.sh + _____________________ +< ez simĂĄn mĹąkĂśdik > + --------------------- + \ ^__^ + \ (oo)\_______ + (__)\ )\/\ + ||----w | + || || + % Total % Received % Xferd Average Speed Time Time Time Current + Dload Upload Total Spent Left Speed +100 1596 100 1596 0 0 11319 0 --:--:-- --:--:-- --:--:-- 11319 + _________________________________ +/ - mintha soronkĂŠnt kiadnĂĄnk a \ +\ parancsokat / + --------------------------------- + \ ^__^ + \ (oo)\_______ + (__)\ )\/\ + ||----w | + || || +[mike@thinkyboi tmp]$ +``` + +# tĹązfal + +- a kernel belsejĂŠben -> gyors, de low-level +- iptables +- kĂŠnyelmesebb egy tĹązfal-kezelĹ + +## UFW + +- uncomplicated firewall +- egyszerĹą + +```shell-session +[mike@thinkyboi tmp]$ sudo ufw allow 80 +Rules updated +Rules updated (v6) +[mike@thinkyboi tmp]$ sudo ufw allow https +Rules updated +Rules updated (v6) +[mike@thinkyboi tmp]$ sudo ufw enable +``` + +# SSH kulcsok + -- GitLab