+ SSH agent

+ Kubectl
changes in review description
This commit is contained in:
theadam 2025-01-12 16:41:28 +01:00
parent a77d65270a
commit 14925b27c1
3 changed files with 59 additions and 0 deletions

21
kubectl.md Executable file
View file

@ -0,0 +1,21 @@
# kubectl
## Installation
### Install on Debian Linux
```
sudo apt install -y apt-transport-https ca-certificates curl gnupg
curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.32/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg
sudo chmod 644 /etc/apt/keyrings/kubernetes-apt-keyring.gpg # allow unprivileged APT programs to read this keyring
echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.32/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list
sudo chmod 644 /etc/apt/sources.list.d/kubernetes.list # helps tools such as command-not-found to work correctly
sudo apt update
sudo apt install -y kubectl
```
### Shell completion
Source the `kubectl completion bash` in the ~/.bashrc file on every login. A simple line which does it after pasting into CMd:
```
echo 'source <(kubectl completion bash)' >> ~/.bashrc
```
[source](https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/)

View file

@ -4,6 +4,8 @@ Mivel vakon elég ergya kezelni a diff view-es pull request-et, célszerűbb hel
Ehhez a git diff parancsa használható, valahogy így:
`git diff branch1 branch2`
> Mindig az első helyen van a kiinduló brandch, másodikon meg az eltérő. Ez azért fontos, hogy így legyen, mert így az új sorok lesznek +-osak, míg, ha megfordul, akkor a meglévő kód lesz +-os, ami nem célszerű.
Tehát például `git diff main feature/pullpull`.
# Ha a pr nem egy másik branch-ről érkezett
Meg kell nézni, honnan jött és azt kell hozzáadni, mint remote, valahogy így:
@ -11,8 +13,15 @@ Meg kell nézni, honnan jött és azt kell hozzáadni, mint remote, valahogy íg
Itt le kell húzni az adatot a távoli repóból, célszerűen a módosított branch-et elég, valahogy így
`git fetch my_review/feature`
> Nem nyerő mindent lehúzkodni, mert több fork-nál például sok branch-ünk lehet és a helyfoglaláson túl még szemetelni is fog.
Most pedig diffelhető megint csak a két ág
`git diff origin/master my_review/feature > out.txt`
> Célszerű kiíratni fájlba az output-ot, hogy jobban át lehessen tekinteni.
Ha mi adjuk be a PR-t, akkor célszerű rebase-elni a szülő ágat, pl. main a munkaágra, hogy meglegyen a konfliktuskezelés plusz lekövessük a korábbi változásokat.
` git rebase main`
HA nincs conflict, akkor összefésülődnek a dolgok vidáman.
Utána git diff és mehet a rebase, mert itt már le van követve az eredeti változáslista.

29
ssh-agent-in-wsl.md Executable file
View file

@ -0,0 +1,29 @@
# SSH agent in WSL
There are a plenty of ways to enable the SSH agent in WSL to avoid the password ask at every connect to a remote host.
One of them is the following.
Add these lines to the ~/.profile file
```
ssh_pid=$(pidof ssh-agent)
# If the agent is not running, start it, and save the environment to a file
if [ "$ssh_pid" = "" ]; then
ssh_env="$(ssh-agent -s)"
echo "$ssh_env" | head -n 2 | tee ~/.ssh_agent_env > /dev/null
init=1
fi
# Load the environment from the file
if [ -f ~/.ssh_agent_env ]; then
eval "$(cat ~/.ssh_agent_env)"
fi
```
After every start of WSL, add the key to the SSH agent and unlock it with the password. For example when starting the day, after WSL start
`ssh-add ~/.ssh/id_ed25519`
## todo
- Add the ability to ask the key password on login
- Store the SSH key between restarts (probably requires external packages)