Skip to content

Commit 3f32b3c

Browse files
committed
Sync latest changes from Christian
1 parent c4a68a4 commit 3f32b3c

12 files changed

+254
-23
lines changed

apps/argocd.md

+7
Original file line numberDiff line numberDiff line change
@@ -145,3 +145,10 @@ spec:
145145
server: '{{server}}'
146146
namespace: default
147147
```
148+
149+
## Further information
150+
151+
More examples and tutorials regarding ArgoCD can be found in the link list below:
152+
153+
- Basic tutorial for installation and configuration: [Let loose the squid - Deploy ArgoCD the declarative way](https://thedatabaseme.de/2022/06/05/let-loose-the-squid-deploy-argocd-the-declarative-way/)
154+
- Writing ArgoCD Plugins: [ArgoCD Custom Plugins](https://dev.to/tylerauerbeck/argocd-custom-plugins-creating-a-custom-plugin-to-process-openshift-templates-4p5m)

apps/proxmox.md

+7
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,10 @@ qemu-img resize -f raw vm-100.raw 10G
2020
```
2121
qemu-img convert -p -O qcow2 vm-100.raw vm-100.qcow2
2222
```
23+
24+
## Further information
25+
26+
More examples and tutorials regarding Proxmox can be found in the link list below:
27+
28+
- Ansible playbook that automates Linux VM updates running on Proxmox (including snapshots): [TheDatabaseMe - update_proxmox_vm](https://github.com/thedatabaseme/update_proxmox_vm)
29+
- Manage Proxmox VM templates with Packer: [Use Packer to build Proxmox images](https://thedatabaseme.de/2022/10/16/what-a-golden-boy-use-packer-to-build-proxmox-images/)

databases/postgres.md

+17-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,28 @@
11
# PostgreSQL Cheat-Sheet
22
PostgreSQL or also known as Postgres, is a free and open-source relational database management system. PostgreSQL features transactions with Atomicity, Consistency, Isolation, Durability (ACID) properties automatically updatable views, materialized views, triggers, foreign keys, and stored procedures. It is designed to handle a range of workloads, from single machines to data warehouses or web services with many concurrent users.
33

4-
## Install PostgreSQL 12 on Ubuntu 20.04 LTS
4+
## Installation
5+
6+
### Install PostgreSQL 12 on Ubuntu 20.04 LTS
57
```bash
68
sudo apt update
79
sudo apt install -y postgresql postgresql-contrib postgresql-client
810
sudo systemctl status postgresql.service
911
```
1012

13+
### Install / deploy Postgres on Kubernetes with Zalando Postgres Operator
14+
15+
Postgres is probably the database which is most common on Cloud platforms and also, running
16+
on Kubernetes environments. There are several so called "Kubernetes Operators" which handle
17+
the deployment of Postgres clusters for you. One of it is the [Postgres Operator by Zalando](https://github.com/zalando/postgres-operator).
18+
19+
You can find some tutorials regarding deployment of the operator and how to work with it,
20+
in the link list below:
21+
22+
- [Deploy Zalando Postgres Operator on your Kubernetes cluster](https://thedatabaseme.de/2022/03/13/keep-the-elefants-in-line-deploy-zalando-operator-on-your-kubernetes-cluster/)
23+
- [Configure Zalando Postgres Operator Backup with WAL-G](https://thedatabaseme.de/2022/03/26/backup-to-s3-configure-zalando-postgres-operator-backup-with-wal-g/)
24+
- [Configure Zalando Postgres Operator Restore with WAL-G](https://thedatabaseme.de/2022/05/03/restore-and-clone-from-s3-configure-zalando-postgres-operator-restore-with-wal-g/)
25+
1126
## Initial database connection
1227

1328
A local connection (from the database server) can be done by the following command:
@@ -104,4 +119,4 @@ To change the owner of an existing database later, you can use the following com
104119
```sql
105120
postgres=# alter database dbname owner to myuser;
106121
ALTER DATABASE
107-
```
122+
```

docker/docker.md

+16-4
Original file line numberDiff line numberDiff line change
@@ -140,12 +140,24 @@ COMMAND | DESCRIPTION
140140
`docker volume prune` | Delete all volumes (not referenced by any container)
141141

142142
### Backup a container
143-
Backup docker data from inside container volumes and package it in a tarball archive.
144-
`docker run --rm --volumes-from CONTAINER -v $(pwd):/backup busybox tar cvfz /backup/backup.tar CONTAINERPATH`
143+
144+
Backup docker data from inside container volumes and package it in a tarball archive:
145+
146+
```shell
147+
docker run --rm --volumes-from CONTAINER -v $(pwd):/backup busybox tar cvfz /backup/backup.tar CONTAINERPATH
148+
```
149+
150+
An automated backup can be done also by this [Ansible playbook](https://github.com/thedatabaseme/docker_backup). The output is also a (compressed) tar. The playbook can also manage the backup retention. So older backups will get deleted automatically.
151+
152+
To also create and backup the container configuration itself, you can use `docker-replay`for that. If you lose the entire container, you can recreate it with the export from `docker-replay`. A more detailed tutorial on how to use docker-replay can be found [here](https://thedatabaseme.de/2022/03/18/shorty-generate-docker-run-commands-using-docker-replay/).
145153

146154
### Restore container from backup
147-
Restore the volume with a tarball archive.
148-
`docker run --rm --volumes-from CONTAINER -v $(pwd):/backup busybox sh -c "cd CONTAINERPATH && tar xvf /backup/backup.tar --strip 1"`
155+
156+
Restore the volume with a tarball archive:
157+
158+
```shell
159+
docker run --rm --volumes-from CONTAINER -v $(pwd):/backup busybox sh -c "cd CONTAINERPATH && tar xvf /backup/backup.tar --strip 1"
160+
```
149161

150162
## Networks
151163

kubernetes/kind.md

+94
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# Kind
2+
3+
Using the Kind project, you are able to easily deploy a Kubernetes cluster on top of Docker as Docker containers. Kind will spawn separate containers which be shown as the Kubernetes nodes. In this documentation, you can find some examples, as well as a link to a Ansible playbook which can do the cluster creation / deletion for you. This document only describes the basics of Kind. To find more detailed information, you can check the [official Kind documentation](https://kind.sigs.k8s.io/docs/user/quick-start/).
4+
5+
Kind is ideal to use in a local development environment or even during a build pipeline run.
6+
7+
## Installation on Linux
8+
9+
Since Kind deploys Docker containers, it needs to have a Container engine (like Docker) installed.
10+
11+
Installing Kind can be done by downloading the latest available release / binary for your platform:
12+
13+
```bash
14+
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.16.0/kind-linux-amd64
15+
chmod +x ./kind
16+
sudo mv ./kind /usr/local/bin/kind
17+
```
18+
19+
## Cluster management
20+
21+
### Cluster creation
22+
23+
You have to provide a configuration file which tells Kind how you want your Kubernetes cluster to be deployed. Find an example configuration file below:
24+
25+
```yaml
26+
kind: Cluster
27+
apiVersion: kind.x-k8s.io/v1alpha4
28+
name: testcluster
29+
# 1 control plane node and 2 workers
30+
nodes:
31+
# the control plane node config
32+
- role: control-plane
33+
# the two workers
34+
- role: worker
35+
- role: worker
36+
```
37+
38+
Create the cluster by the following command:
39+
40+
```bash
41+
kind create cluster --config kind-cluster-config.yaml
42+
Creating cluster "testcluster" ...
43+
Ensuring node image (kindest/node:v1.25.2)
44+
Preparing nodes
45+
Writing configuration
46+
Starting control-plane
47+
Installing CNI
48+
Installing StorageClass
49+
Joining worker nodes
50+
51+
Set kubectl context to "kind-testcluster"
52+
You can now use your cluster with:
53+
kubectl cluster-info --context kind-testcluster
54+
55+
Not sure what to do next? Check out https://kind.sigs.k8s.io/docs/user/quick-start/
56+
```
57+
58+
Checking for Docker containers running, you can see the following:
59+
60+
```bash
61+
docker ps -a
62+
63+
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
64+
ac14d8c7a3c9 kindest/node:v1.25.2 "/usr/local/bin/entr..." 2 minutes ago Up About a minute testcluster-worker2
65+
096dd4bf1718 kindest/node:v1.25.2 "/usr/local/bin/entr..." 2 minutes ago Up About a minute 127.0.0.1:42319->6443/tcp testcluster-control-plane
66+
e1ae2d701394 kindest/node:v1.25.2 "/usr/local/bin/entr..." 2 minutes ago Up About a minute testcluster-worker
67+
```
68+
69+
### Interacting with your cluster
70+
71+
You may have multiple Kind clusters deployed at the same time. To get a list of running clusters, you can use the following command:
72+
73+
```bash
74+
kind get clusters
75+
kind
76+
kind-2
77+
```
78+
79+
After cluster creation, the Kubernetes context is set automatically to the newly created cluster. In order to set the currently used kubeconfig, you may use some tooling like [kubectx](https://github.com/ahmetb/kubectx). You may also set the current context used by `kubectl` with the `--context` option, which refers to the Kind cluster name.
80+
81+
### Cluster deletion
82+
83+
To delete a Kind cluster, you can use the following command. Kind will also delete the kubeconfig of the deleted cluster. So you don't need to do this on your own.
84+
85+
```bash
86+
kind delete cluster -n testcluster
87+
Deleting cluster "testcluster" ...
88+
```
89+
90+
## Further information
91+
92+
More examples and tutorials regarding Proxmox can be found in the link list below:
93+
94+
- Creating an Ansible playbook to manage Kind cluster: [Lightweight Kubernetes cluster using Kind and Ansible](https://thedatabaseme.de/2022/04/22/lightweight-kubernetes-cluster-using-kind-and-ansible/)

kubernetes/kubernetes.md

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Github Repository: https://github.com/kubernetes/kubernetes
2828
- [k3s-install-ha-externaldb](k3s-install-ha-externaldb.md)
2929
- [k3s-install-single](k3s-install-single.md)
3030
- [k9s](k9s.md)
31+
- [kind](kind.md)
3132
- [kubernetes-automation](kubernetes-automation.md)
3233
- [kubernetes-dns](kubernetes-dns.md)
3334
- [docker](../docker/docker.md)

kubernetes/kubernetes_index.md

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Index of kubernetes category
99
- [K3s-install-single](k3s-install-single.md)
1010
- [K3s](k3s.md)
1111
- [K9s](k9s.md)
12+
- [Kind](kind.md)
1213
- [Kubectl](kubectl.md)
1314
- [Kubernetes-automation](kubernetes-automation.md)
1415
- [Kubernetes-dns](kubernetes-dns.md)

macos/chrome-on-macos.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Google Chrome
2+
3+
## Advanced
4+
5+
### No "Proceed Anyway" Option
6+
7+
Chrome on MacOS won't show a "Proceed Anyway" Option on `NE:ERR_CERT_INVALID` invalid SSL Certificates. Use the secret passphrase as a workaround.
8+
9+
1. Make sure the website is selected
10+
2. Just type in `thisisunsafe`

macos/macos_index.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
Index of macos category
44

5-
- [Docker-on-macos-silicon](docker-on-macos-silicon.md)
6-
- [Macos](macos.md)
7-
- [Macos-shortcuts](macos-shortcuts.md)
8-
- [Vscode-macos-shortcuts](vscode-macos-shortcuts.md)
5+
- [Chrome on Mac OS](chrome-on-macos.md)
6+
- [Docker on Mac OS Silicon](docker-on-macos-silicon.md)
7+
- [Mac OS](macos.md)
8+
- [Macos Shortcuts](macos-shortcuts.md)
9+
- [Vscode Mac OS Shortcuts](vscode-macos-shortcuts.md)

tools/git.md

+88-13
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,76 @@ Repository: https://git.kernel.org/pub/scm/git/git.git
1818

1919
Website: https://git-scm.com/
2020

21-
## Usage
21+
## Installation
22+
23+
Git can easily be installed on Linux systems with the available package managers (e.g. for Debian based systems by `apt install git`).
24+
25+
For other systems, see the [git download page](https://git-scm.com/downloads).
26+
27+
## Configuration
28+
29+
Git can be configured from the command line using the `git config` command. For first configuration it is necessary to configure at least the parameters `user.name` and `user.email`. This can be done with the following commands:
30+
31+
```bash
32+
git config --global user.name "MyFancyUser"
33+
```
34+
35+
```bash
36+
git config --global user.email "developer@mydomain.com"
37+
```
38+
39+
## Using Git
40+
41+
The following commands can be helpful for working with `git`.
42+
43+
| git command | Comment |
44+
| ---------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
45+
| `git init` | Initialize a directory as git managed repository |
46+
| `git clone <repo_url>` | Clone a remote repository to your local client |
47+
| `git status` | Shows uncommited changes, new files etc. |
48+
| `git add <wildcard_or_filename>` | Stage an updated / new file to the next commit |
49+
| `git rm <wildcard_or_filename>` | Remove a file and stage the removal for the next commit |
50+
| `git commit -m "<commit message">` | Commit staged changes under a new commit |
51+
| `git commit` | Will open an editor to write more descriptive commit messages.<br> See [here](https://cbea.ms/git-commit/) for a guide on good commit messages |
52+
| `git checkout <branch_name>` | Switch to another branch |
53+
| `git branch` | Shows a list of existing branches |
54+
| `git branch <branch_name>` | Creates a new branch (from the currently checked out branch) |
55+
| `git merge <branch_name>` | Merge changes from `branch_name` to the currently checked out branch |
56+
| `git push` | Push commited changes to the remote repository |
57+
| `git pull` | Pull current state from the remote repository to your local repo |
58+
59+
### Working with git-flow
60+
61+
Git-flow assists you by combining multiple steps of `git` commands to one `git-flow` command which will do a workflow of steps. Although `git-flow` makes live easier in some cases, it makes it also more complex sometimes and you need to execute some steps before or after using a `git-flow` command as regular `git` command. (See below)
62+
63+
As an example, here is the comparison between the regular `git` commands and the appropriate `git-flow` command for creating a release.
64+
65+
| git-flow command | git command |
66+
| --------------------------------------------------- | ----------------------------------------------------- |
67+
| `git-flow feature start <feature_name>` | `git checkout -b feature/<feature_name> develop` |
68+
| `git-flow feature finish <feature_name> [--squash]` | `git checkout develop` |
69+
| | `git merge [--squash] --no-ff feature/<feature_name>` |
70+
| | `git branch -d feature/<feature_name>` |
71+
72+
Another `git-flow` cheat sheet can be found [here](https://danielkummer.github.io/git-flow-cheatsheet/).
73+
74+
## Using git-crypt
75+
76+
Having secret or sensitive information in your git repository is never a good choice. But sometimes it's necessary. Never push unencrypted data to your remote repository.
77+
78+
Git-crypt is a transparent encryption tool that works seamless with your Git repository. All sensitive information is encrypted before pushed to the remote repository. Once you've unlocked the repository locally, all data will be decrypted automatically when pulling from the remote repo. This makes development with encrypted data effortless.
79+
80+
To install git-crypt, you can use the distribution package manager (e.g. `apt`):
81+
82+
```bash
83+
sudo apt install git-crypt
84+
```
85+
86+
To initialize a new repository with git-crypt, you can use `git-crypt init` when located in the repository directory. An already encrypted git repository can be unlocked by `git-crypt unlock`. This requires you to have either the repository encryption key in your GPG keychain, or that your private GPG key has been added to the allowed keys in the repository. For more details, see the links below.
87+
88+
For more information, check out the [official Github repository](https://github.com/AGWA/git-crypt). A tutorial on git-crypt can be found [here](https://thedatabaseme.de/2022/04/13/lets-keep-this-our-secret-transparent-git-encryption-using-git-crypt/).
89+
90+
## Example usage
2291

2392
### Create a Repository
2493
Create a new local repository
@@ -288,18 +357,24 @@ A `.gitignore` file specifies intentionally untracked files that Git should igno
288357
## Git Tricks
289358

290359
### Rename branch
291-
- #### **Renamed** to `new_name`
292-
```bash
293-
git branch -m <new_name>
294-
```
295-
- #### **Push** and reset
296-
```bash
297-
git push origin -u <new_name>
298-
```
299-
- #### **Delete** remote branch
300-
```bash
301-
git push origin --delete <old>
302-
```
360+
361+
#### **Renamed** to `new_name`
362+
363+
```bash
364+
git branch -m <new_name>
365+
```
366+
367+
#### **Push** and reset
368+
369+
```bash
370+
git push origin -u <new_name>
371+
```
372+
373+
#### **Delete** remote branch
374+
375+
```bash
376+
git push origin --delete <old>
377+
```
303378

304379
### Log
305380
Search change by content

tools/vagrant.md

+4
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,7 @@ COMMAND | DESCRIPTION
3434
`vagrant box outdated` | Check for updates vagrant box update
3535
`vagrant box remove <BOXNAME>` | Deletes a box from the machine
3636
`vagrant package` | Packages a running virtualbox env in a reusable box
37+
38+
## Vagrant with WSL2
39+
40+
Vagrant is able to run inside your Windows Subsystem for Linux environment. A tutorial on how to install and use it with your Windows installed Virtualbox can be found [here](https://thedatabaseme.de/2022/02/20/vagrant-up-running-vagrant-under-wsl2/).

tools/wsl.md

+4
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,7 @@ netsh advfirewall firewall delete rule name=$port
6565
```powershell
6666
netsh interface portproxy show v4tov4
6767
```
68+
69+
## Linux desktop in WSL2
70+
71+
With WSL2 it's possible to install and run a Linux desktop environment (XFCE). A tutorial on how to implement that, can be found [here](https://thedatabaseme.de/2022/05/15/shorty-running-xfce-linux-desktop-on-wsl2/).

0 commit comments

Comments
 (0)