Grundfassung
This commit is contained in:
commit
425d37a5ae
48 files changed
+2875
No files matched your search
@@ -0,0 +1,4 @@
|
||||
FROM squidfunk/mkdocs-material
|
||||
|
||||
# Optional: Install additional tools if needed
|
||||
# RUN apk add --no-cache <package-name>
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"name": "MkDocs DevContainer",
|
||||
"build": {
|
||||
"dockerfile": "Dockerfile",
|
||||
"context": "."
|
||||
},
|
||||
"runArgs": ["--init"],
|
||||
"settings": {},
|
||||
"extensions": [],
|
||||
"forwardPorts": [8000],
|
||||
"postCreateCommand": "mkdocs serve -a 0.0.0.0:8000",
|
||||
"mounts": [
|
||||
"source=${localWorkspaceFolder},target=/docs,type=bind"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
services:
|
||||
mkdocs:
|
||||
image: squidfunk/mkdocs-material
|
||||
ports:
|
||||
- "8005:8000"
|
||||
volumes:
|
||||
- ./:/docs
|
||||
stdin_open: true
|
||||
tty: true
|
||||
@@ -0,0 +1,173 @@
|
||||
# BIND9
|
||||
|
||||
BIND9 (Berkeley Internet Name Domain Version 9) ist ein Open-Source-[[DNS]] (Domain Name System) Softwaresystem. Es ist die am weitesten verbreitete DNS-Server-Software im Internet und wird vom Internet Systems Consortium (ISC) gepflegt. BIND9 bietet eine robuste und skalierbare Plattform zur Auflösung von Domainnamen in IP-Adressen und umgekehrt und unterstützt erweiterte DNS-Funktionen wie [[DNSSEC]] (DNS Security Extensions), dynamische Updates und inkrementelle Zonentransfers. BIND9 läuft auf einer Vielzahl von Betriebssystemen, einschließlich [[Linux]], [[Unix]] und [[Windows]], und ist hochgradig konfigurierbar und erweiterbar durch die Verwendung von Plugins und Modulen.
|
||||
|
||||
Project Homepage: https://www.isc.org/bind/
|
||||
|
||||
---
|
||||
## Installation
|
||||
|
||||
ISC stellt ausführbare Dateien für Windows und Pakete für [Ubuntu](../linux/distros/ubuntu.md), [CentOS](../linux/distros/centos.md), [Fedora](../linux/distros/fedora.md) und [Debian](../linux/distros/debian.md) bereit - BIND 9 ESV, Debian - BIND 9 Stable, Debian - BIND 9 Development Version. Die meisten Betriebssysteme bieten auch BIND 9-Pakete für ihre Benutzer an. Diese können mit einer anderen Standardkonfiguration als der Standard-BIND 9-Distribution erstellt worden sein, und einige von ihnen fügen eine eigene Versionsnummer hinzu, die nicht genau der BIND 9-Version entspricht.
|
||||
|
||||
### Ubuntu Linux
|
||||
|
||||
BIND9 ist im Main-Repository verfügbar. Es muss kein zusätzliches Repository für BIND9 aktiviert werden.
|
||||
|
||||
```sh
|
||||
sudo apt install bind9
|
||||
```
|
||||
|
||||
|
||||
### Ubuntu Docker
|
||||
|
||||
Als Teil der [Long Term Supported OCI Images](https://ubuntu.com/security/docker-images), bietet Canonical Bind9 als gehärtetes und gewartetes [Docker-Image](../docker/docker.md) an.
|
||||
|
||||
```sh
|
||||
docker run -d --name bind9-container -e TZ=UTC -p 30053:53 ubuntu/bind9:9.18-22.04_beta
|
||||
```
|
||||
|
||||
|
||||
## Configuration
|
||||
|
||||
BIND 9 verwendet eine einzige Konfigurationsdatei namens `named.conf`, die sich typischerweise entweder in `/etc/bind`, `/etc/namedb` oder `/usr/local/etc/namedb` befindet.
|
||||
|
||||
Die named.conf besteht aus `logging-` und `options`-Blöcken sowie `category-`, `channel-`, `directory-`, `file-` und `severity-`Anweisungen.
|
||||
|
||||
### Named Config
|
||||
|
||||
```conf
|
||||
options {
|
||||
...
|
||||
};
|
||||
|
||||
zone "domain.tld" {
|
||||
type primary;
|
||||
file "domain.tld";
|
||||
};
|
||||
```
|
||||
|
||||
### Zone File
|
||||
|
||||
Je nach Funktionalität des Systems ist eine oder mehrere Zonendateien erforderlich.
|
||||
|
||||
```conf
|
||||
; base zone file for domain.tld
|
||||
$TTL 2d ; default TTL for zone
|
||||
|
||||
$ORIGIN domain.tld. ; base domain-name
|
||||
|
||||
; Start of Authority RR defining the key characteristics of the zone (domain)
|
||||
@ IN SOA ns1.domain.tld. hostmaster.domain.tld. (
|
||||
2022121200 ; serial number
|
||||
12h ; refresh
|
||||
15m ; update retry
|
||||
3w ; expiry
|
||||
2h ; minimum
|
||||
)
|
||||
|
||||
; name server RR for the domain
|
||||
IN NS ns1.domain.tld.
|
||||
|
||||
; mail server RRs for the zone (domain)
|
||||
3w IN MX 10 mail.domain.tld.
|
||||
|
||||
; domain hosts includes NS and MX records defined above
|
||||
; plus any others required
|
||||
; for instance a user query for the A RR of joe.domain.tld will
|
||||
; return the IPv4 address 192.168.254.6 from this zone file
|
||||
ns1 IN A 192.168.254.2
|
||||
mail IN A 192.168.254.4
|
||||
joe IN A 192.168.254.6
|
||||
www IN A 192.168.254.7
|
||||
|
||||
```
|
||||
|
||||
#### SOA (Start of Authority)
|
||||
|
||||
Ein Start of Authority-Eintrag ist eine Art Ressourceneintrag im Domain Name System ([DNS](../networking/dns.md)) der administrative Informationen über die Zone enthält, insbesondere in Bezug auf Zonentransfers. Das SOA-Eintragsformat ist in RFC 1035 spezifiziert.
|
||||
|
||||
```conf
|
||||
@ IN SOA ns1.domain.tld. hostmaster.domain.tld. (
|
||||
2022121200 ; serial number
|
||||
12h ; refresh
|
||||
15m ; update retry
|
||||
3w ; expiry
|
||||
2h ; minimum
|
||||
)
|
||||
```
|
||||
|
||||
|
||||
---
|
||||
## Forwarders (Weiterleitungen)
|
||||
|
||||
DNS-Weiterleitungen sind Server, die DNS-Abfragen im Namen eines anderen DNS-Servers auflösen.
|
||||
|
||||
Um bind9 als weiterleitenden DNS-Server zu konfigurieren, muss eine `forwarders-`Klausel innerhalb des `options-`Blocks hinzugefügt werden. Die `forwarders-`Klausel gibt eine Liste von IP-Adressen anderer DNS-Server an, an die bind9 Abfragen weiterleiten wird.
|
||||
|
||||
```conf
|
||||
options {
|
||||
// ... other options ...
|
||||
forwarders {
|
||||
8.8.8.8; // Google Public DNS
|
||||
1.1.1.1; // Cloudflare DNS
|
||||
};
|
||||
};
|
||||
```
|
||||
|
||||
---
|
||||
## Access Control (Zugriffskontrolle)
|
||||
|
||||
Um Berechtigungen in BIND9 zu konfigurieren, können Sie die “acl”-Anweisung verwenden, um Zugriffskontrolllisten zu definieren, und dann die Anweisungen “allow-query” und “allow-transfer” verwenden, um anzugeben, welche Hosts oder Netzwerke Abfragen oder Zonen übertragen dürfen.
|
||||
|
||||
```conf
|
||||
acl "trusted" {
|
||||
192.168.1.0/24;
|
||||
localhost;
|
||||
};
|
||||
|
||||
options {
|
||||
// ...
|
||||
allow-query { any; };
|
||||
allow-transfer { "trusted"; };
|
||||
// ...
|
||||
};
|
||||
|
||||
zone "example.com" {
|
||||
// ...
|
||||
allow-query { "trusted"; };
|
||||
// ...
|
||||
};
|
||||
```
|
||||
|
||||
In diesem Beispiel definieren wir eine ACL namens “trusted”, die das Netzwerk 192.168.1.0/24 und den lokalen Host umfasst. Wir geben dann an, dass Hosts in dieser ACL Zonen übertragen dürfen und dass jeder Host Abfragen durchführen darf.
|
||||
|
||||
Für die Zone “example.com” geben wir an, dass nur Hosts in der ACL “trusted” Abfragen durchführen dürfen.
|
||||
|
||||
Sie können auch andere ACL-Funktionen verwenden, wie “allow-recursion” und “allow-update”, um den Zugriff auf Ihren DNS-Server weiter zu kontrollieren.
|
||||
|
||||
---
|
||||
## Dynamic Updates
|
||||
|
||||
Dynamische Updates in BIND ermöglichen die Änderung von DNS-Einträgen in Echtzeit, ohne Zonendateien manuell bearbeiten zu müssen.
|
||||
|
||||
### Secure DNS updates with TSIG Key
|
||||
|
||||
Dynamische Updates in BIND ermöglichen die Änderung von DNS-Einträgen in Echtzeit, ohne Zonendateien manuell bearbeiten zu müssen.
|
||||
|
||||
Um einen TSIG-Schlüssel für die Verwendung mit dynamischen Updates zu erstellen, kann der Befehl `tsig-keygen` verwendet werden.
|
||||
|
||||
```
|
||||
tsig-keygen -a hmac-sha256
|
||||
```
|
||||
|
||||
Um den TSIG-Schlüssel zur Zonenkonfiguration hinzuzufügen, muss die “key”-Anweisung zur “allow-update”-Anweisung in der named.conf-Datei hinzugefügt werden. Zum Beispiel:
|
||||
|
||||
```
|
||||
zone "example.com" {
|
||||
type master;
|
||||
file "example.com.zone";
|
||||
allow-update { key "tsig-key"; };
|
||||
};
|
||||
```
|
||||
|
||||
In diesem Beispiel verwendet die “allow-update”-Anweisung nun den TSIG-Schlüssel, um Updates für die Zone “example.com” zuzulassen.
|
||||
Executable
+47
@@ -0,0 +1,47 @@
|
||||
# Grafana
|
||||
|
||||
Grafana ist eine Open-Source-Analyse- und Überwachungsplattform, die für die Erstellung von Dashboards und die Visualisierung von Metriken aus verschiedenen Datenquellen verwendet wird. Es ist besonders nützlich für die Überwachung von Anwendungen, Servern, Netzwerken und anderen IT-Infrastrukturen.
|
||||
|
||||
## Funktionen
|
||||
|
||||
- **Dashboards**: Grafana ermöglicht die Erstellung interaktiver und anpassbarer Dashboards.
|
||||
- **Datenquellen**: Unterstützt eine Vielzahl von Datenquellen wie Prometheus, InfluxDB, Graphite, Elasticsearch, MySQL, PostgreSQL und viele mehr.
|
||||
- **Benachrichtigungen**: Integration von Benachrichtigungen bei bestimmten Ereignissen oder Schwellenwerten.
|
||||
- **Benutzerverwaltung**: Verwaltung von Benutzerrechten und Teams, um den Zugriff auf Dashboards und Datenquellen zu steuern.
|
||||
- **Plug-in-Architektur**: Erweiterbar durch eine Vielzahl von Plug-ins für neue Datenquellen, Visualisierungen und Anwendungen.
|
||||
|
||||
## Installation
|
||||
|
||||
### Docker
|
||||
|
||||
Um Grafana mit Docker zu installieren, führen Sie den folgenden Befehl aus:
|
||||
|
||||
```sh
|
||||
docker run -d -p 3000:3000 --name=grafana grafana/grafana
|
||||
```
|
||||
|
||||
## Verwendung
|
||||
|
||||
Nach der Installation und dem Starten des Grafana-Dienstes können Sie über einen Webbrowser auf das Dashboard zugreifen:
|
||||
```
|
||||
http://localhost:3000
|
||||
```
|
||||
|
||||
Der Standardbenutzername und das Standardpasswort sind admin. Nach dem ersten Login werden Sie aufgefordert, das Passwort zu ändern.
|
||||
|
||||
### Hinzufügen einer Datenquelle
|
||||
|
||||
Um eine neue Datenquelle hinzuzufügen, gehen Sie zu Configuration -> Data Sources -> Add data source und wählen Sie den gewünschten Datentyp aus.
|
||||
|
||||
#### Erstellung eines Dashboards
|
||||
|
||||
1. Gehen Sie zu Create -> Dashboard.
|
||||
2. Fügen Sie ein neues Panel hinzu.
|
||||
3. Wählen Sie die Datenquelle und die Metriken aus, die Sie visualisieren möchten.
|
||||
4. Konfigurieren Sie die Visualisierungsoptionen nach Ihren Wünschen.
|
||||
|
||||
#### Dokumentation und Unterstützung
|
||||
|
||||
Für weitere Informationen und detaillierte Anleitungen besuchen Sie die offizielle Dokumentation:
|
||||
|
||||
[Grafana Dokumentation](https://grafana.com/docs/)
|
||||
Executable
+48
@@ -0,0 +1,48 @@
|
||||
# Prometheus
|
||||
|
||||
Prometheus ist ein Open-Source-System zur Überwachung und Alarmierung, das ursprünglich von SoundCloud entwickelt wurde. Es wurde entwickelt, um Metriken aus verschiedenen Zielen effizient zu erfassen und zu speichern und ermöglicht das Erstellen umfangreicher Dashboards und Benachrichtigungen basierend auf diesen Metriken.
|
||||
|
||||
## Funktionen
|
||||
|
||||
- **Multi-dimensionales Datenmodell**: Metriken werden anhand von Schlüssel-Wert-Paaren (Labels) identifiziert.
|
||||
- **Flexible Abfragesprache**: PromQL (Prometheus Query Language) ermöglicht komplexe Abfragen und Analysen.
|
||||
- **Eigenständige Zeitreihendatenbank**: Speichert alle gesammelten Daten.
|
||||
- **Pushing und Pulling von Metriken**: Unterstützt sowohl das Pulling von Metriken über HTTP als auch das Pushing von Metriken über das Pushgateway.
|
||||
- **Service Discovery**: Automatische Erkennung von Diensten zur Überwachung.
|
||||
- **Alertmanager**: Verwaltung und Versenden von Benachrichtigungen basierend auf konfigurierten Regeln.
|
||||
|
||||
## Installation
|
||||
|
||||
### Docker
|
||||
|
||||
Um Prometheus mit Docker zu installieren, führen Sie den folgenden Befehl aus:
|
||||
|
||||
```sh
|
||||
docker run -d -p 9090:9090 --name=prometheus prom/prometheus
|
||||
```
|
||||
### Konfiguration
|
||||
|
||||
Die Standardkonfigurationsdatei für Prometheus ist `prometheus.yml`, die sich typischerweise in `/etc/prometheus` befindet. Diese Datei definiert, welche Ziele überwacht werden sollen und wie lange Daten aufbewahrt werden.
|
||||
#### Basiskonfiguration
|
||||
```yaml
|
||||
global:
|
||||
scrape_interval: 15s
|
||||
evaluation_interval: 15s
|
||||
|
||||
scrape_configs:
|
||||
- job_name: 'prometheus'
|
||||
static_configs:
|
||||
- targets: ['localhost:9090']
|
||||
```
|
||||
|
||||
### Verwendung
|
||||
#### Zugriff auf da Dashboard
|
||||
Nach der Installation und dem Starten des Prometheus-Dienstes können Sie über einen Webbrowser auf das Dashboard zugreifen:
|
||||
```
|
||||
http://localhost:9090
|
||||
```
|
||||
|
||||
### Dokumentation
|
||||
Für weitere Informationen und detaillierte Anleitungen besuchen Sie die offizielle Dokumentation:
|
||||
|
||||
[Prometheus Documentation](https://prometheus.io/docs/introduction/overview/)
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 668 B |
Binary file not shown.
|
After Width: | Height: | Size: 962 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 672 KiB |
@@ -0,0 +1,19 @@
|
||||
window.MathJax = {
|
||||
tex: {
|
||||
inlineMath: [["\\(", "\\)"]],
|
||||
displayMath: [["\\[", "\\]"]],
|
||||
processEscapes: true,
|
||||
processEnvironments: true
|
||||
},
|
||||
options: {
|
||||
ignoreHtmlClass: ".*|",
|
||||
processHtmlClass: "arithmatex"
|
||||
}
|
||||
};
|
||||
|
||||
document$.subscribe(() => {
|
||||
MathJax.startup.output.clearCache()
|
||||
MathJax.typesetClear()
|
||||
MathJax.texReset()
|
||||
MathJax.typesetPromise()
|
||||
})
|
||||
@@ -0,0 +1,10 @@
|
||||
/* Extra CSS to use full width dynamically */
|
||||
.md-main__inner {
|
||||
max-width: 100%;
|
||||
padding-left: 20px;
|
||||
padding-right: 20px;
|
||||
}
|
||||
|
||||
.md-content {
|
||||
max-width: 100%;
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
# MariaDB Cheat-Sheet
|
||||
|
||||
MariaDB Server is one of the most popular open source relational databases. It’s made by the original developers of MySQL and guaranteed to stay open source. It is part of most cloud offerings and the default in most Linux distributions.
|
||||
|
||||
It is built upon the values of performance, stability, and openness, and MariaDB Foundation ensures contributions will be accepted on technical merit. Recent new functionality includes advanced clustering with Galera Cluster 4, compatibility features with Oracle Database and Temporal Data Tables, allowing one to query the data as it stood at any point in the past.
|
||||
|
||||
Project Homepage: [MariaDB](https://mariadb.org/)
|
||||
Documentation: [MariaDB Docs](https://mariadb.org/documentation/)
|
||||
|
||||
---
|
||||
## Installation
|
||||
|
||||
### Install MariaDB on Debian/Ubuntu/Mint/Zorin/forks
|
||||
|
||||
```bash
|
||||
sudo apt update
|
||||
sudo apt install -y mariadb-server mycli --install-recommends
|
||||
sudo mysql_secure_installation
|
||||
```
|
||||
|
||||
### Install MariaDB on RHEL/Fedora/CentOS/Alma/Rocky
|
||||
|
||||
```bash
|
||||
sudo dnf update
|
||||
sudo dnf install -y mariadb-server mycli
|
||||
sudo mysql_secure_installation
|
||||
```
|
||||
|
||||
### Install MariaDB on Arch/Manjaro/Arco/forks
|
||||
|
||||
```bash
|
||||
sudo pacman -Syyu
|
||||
sudo pacman -S mariadb-server mycli --noconfirm
|
||||
sudo mysql_secure_installation
|
||||
```
|
||||
|
||||
### Deploy MariaDB in Docker
|
||||
- [https://hub.docker.com/_/mariadb](https://hub.docker.com/_/mariadb)
|
||||
- [https://docs.linuxserver.io/images/docker-mariadb/](https://docs.linuxserver.io/images/docker-mariadb/)
|
||||
|
||||
### Deploy MariaDB in Kubernetes
|
||||
- [https://mariadb.org/start-mariadb-in-k8s/](https://mariadb.org/start-mariadb-in-k8s/)
|
||||
- [https://kubedb.com/kubernetes/databases/run-and-manage-mariadb-on-kubernetes/](https://kubedb.com/kubernetes/databases/run-and-manage-mariadb-on-kubernetes/)
|
||||
|
||||
## Access Database from outside
|
||||
|
||||
Open `/etc/mysql/mariadb.conf.d/50-server.cnf` and change the line containing `bind-address` to `bind-address = 0.0.0.0`.
|
||||
|
||||
---
|
||||
## Create Administrative User
|
||||
|
||||
Access the MySQL command line by entering `mysql -u root -p` in the shell followed by the Database `root` password.
|
||||
|
||||
Create a new user `newuser` for the host `localhost` with a new `password`:
|
||||
|
||||
```sql
|
||||
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
|
||||
```
|
||||
|
||||
Grant all permissions to the new user
|
||||
|
||||
```sql
|
||||
GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost';
|
||||
```
|
||||
|
||||
Update permissions
|
||||
|
||||
```sql
|
||||
FLUSH PRIVILEGES
|
||||
```
|
||||
@@ -0,0 +1,88 @@
|
||||
# MySQL Community Edition (CE) Cheat-Sheet
|
||||
|
||||
MySQL Community Edition is the freely downloadable version of the world's most popular open source database.
|
||||
|
||||
Project Homepage: [MySQL Community Edition](https://www.mysql.com/products/community/)
|
||||
Documentation: [MySQL Docs](https://dev.mysql.com/doc/)
|
||||
|
||||
>_Editor's note:_ The MariaDB Project was forked from MySQL when [Sun Microsystems](https://en.wikipedia.org/wiki/Sun_Microsystems)' intellectual property [was acquired](https://en.wikipedia.org/wiki/Acquisition_of_Sun_Microsystems_by_Oracle_Corporation) by [Oracle](https://en.wikipedia.org/wiki/Oracle_Corporation). MariaDB still shares enormous inter-compatibility with MySQL functions and software interoperability, and performance at most scales is arguably indiscernible from MySQL CE. In this writers' opinion it is **not beneficial** in most cases to favor Oracle's monetized option over the GPL's MariaDB alternative.
|
||||
|
||||
---
|
||||
## Installation
|
||||
|
||||
### Install MySQL on Debian/Ubuntu/Mint/Zorin/Deb forks
|
||||
|
||||
>[!warning]
|
||||
> Common Debian repositories don't populate MySQL CE and require a vendor-provided repository available [here](https://dev.mysql.com/downloads/repo/apt/). The repo file in this example is current as of 2024-01-20.
|
||||
|
||||
```bash
|
||||
sudo apt update
|
||||
sudo apt install -y lsb-release gnupg
|
||||
wget https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb
|
||||
sudo dpkg -i mysql-apt-config_0.8.29-1_all.deb
|
||||
sudo mkdir /var/lib/mysql
|
||||
sudo apt update
|
||||
sudo apt install -y mysql-community-server mysql-common mycli --install-recommends
|
||||
sudo mysql_secure_installation
|
||||
```
|
||||
|
||||
### Install MySQL on RHEL/Fedora/CentOS/Alma/Rocky
|
||||
|
||||
```bash
|
||||
sudo dnf update
|
||||
sudo dnf install -y mysql-server mysql-common mycli
|
||||
sudo mysql_secure_installation
|
||||
```
|
||||
|
||||
### Install MySQL on Arch/Manjaro/Arco/ Arch forks
|
||||
|
||||
>[!warning]
|
||||
> Common Arch repositories don't populate MySQL CE and the vendor doesn't provide one. The packages are available in the [AUR](https://aur.archlinux.org/) but this is \***not recommended**\* for a production environment!!
|
||||
|
||||
##### Enable the AUR (if not already available)
|
||||
|
||||
>[!notice]
|
||||
>_This **must** be done by a non-root user!_
|
||||
```shell
|
||||
git clone https://aur.archlinux.org/yay.git
|
||||
cd yay
|
||||
makepkg -si
|
||||
```
|
||||
##### Proceed with installation from the AUR
|
||||
|
||||
```bash
|
||||
yay pacman -Syyu
|
||||
yay -S mysql mysql-utilities mycli --noconfirm
|
||||
sudo mysql_secure_installation
|
||||
```
|
||||
|
||||
### Deploy MySQL in Docker
|
||||
- [https://hub.docker.com/_/mysql/](https://hub.docker.com/_/mysql/)
|
||||
- [https://dev.mysql.com/doc/mysql-installation-excerpt/8.0/en/docker-mysql-getting-started.html](https://dev.mysql.com/doc/mysql-installation-excerpt/8.0/en/docker-mysql-getting-started.html)
|
||||
|
||||
### Deploy MySQL in Kubernetes
|
||||
- [https://dev.mysql.com/doc/mysql-operator/en/](https://dev.mysql.com/doc/mysql-operator/en/)
|
||||
- [https://kubernetes.io/docs/tasks/run-application/run-single-instance-stateful-application/](https://kubernetes.io/docs/tasks/run-application/run-single-instance-stateful-application/)
|
||||
|
||||
---
|
||||
## Create Administrative User
|
||||
|
||||
Access the MySQL command line by entering `mysql -u root -p` in the shell followed by the Database `root` password.
|
||||
|
||||
Create a new user `newuser` for the host `localhost` with a new `password`:
|
||||
|
||||
```sql
|
||||
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
|
||||
```
|
||||
|
||||
Grant all permissions to the new user
|
||||
|
||||
```sql
|
||||
GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost';
|
||||
```
|
||||
|
||||
Update permissions
|
||||
|
||||
```sql
|
||||
FLUSH PRIVILEGES
|
||||
```
|
||||
@@ -0,0 +1,206 @@
|
||||
# PostgreSQL Cheat-Sheet
|
||||
|
||||
[PostgreSQL](https://www.postgresql.org/) 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.
|
||||
|
||||
---
|
||||
## Installation
|
||||
|
||||
### Install PostgreSQL on Debian/Ubuntu/Mint/Zorin/forks
|
||||
|
||||
```bash
|
||||
sudo apt update
|
||||
sudo apt install -y postgresql postgresql-contrib postgresql-client
|
||||
sudo systemctl status postgresql.service
|
||||
```
|
||||
|
||||
### Install PostgreSQL on RHEL/Fedora/CentOS/Alma/Rocky
|
||||
|
||||
```bash
|
||||
sudo dnf update
|
||||
sudo dnf install -y postgresql-server
|
||||
```
|
||||
|
||||
### Install PostgreSQL on Arch/Manjaro/Arco/forks
|
||||
|
||||
```bash
|
||||
sudo pacman -Syyu
|
||||
sudo pacman -S postgresql --noconfirm
|
||||
```
|
||||
|
||||
### Deploy PostgreSQL in Docker
|
||||
- [https://hub.docker.com/_/postgres/](https://hub.docker.com/_/postgres/)
|
||||
- [https://github.com/postgres/postgres](https://github.com/postgres/postgres)
|
||||
### Deploy PostgreSQL on Kubernetes with Zalando Postgres Operator
|
||||
|
||||
Postgres is probably the database which is most common on Cloud platforms and also, running on Kubernetes environments. There are several so called "Kubernetes Operators" which handle the deployment of Postgres clusters for you. One of it is the [Postgres Operator by Zalando](https://github.com/zalando/postgres-operator).
|
||||
|
||||
You can find some tutorials regarding deployment of the operator and how to work with it, in the link list below:
|
||||
|
||||
- [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/)
|
||||
- [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/)
|
||||
- [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/)
|
||||
|
||||
---
|
||||
## Connecting to Postgres
|
||||
|
||||
### Connect to local Postgres instance
|
||||
|
||||
A local connection (from the database server) can be done by the following command:
|
||||
|
||||
```sh
|
||||
sudo -u postgres psql
|
||||
```
|
||||
|
||||
### Connect to remote Postgres instance
|
||||
|
||||
Note, that you first have to install the `postgresql-client` package, (`postgresql` via Homebrew on macOS) on the client machine. A connection from a remote host can be done by the following command:
|
||||
|
||||
```sh
|
||||
psql -h {pg_host} -U {username} -d {database} -p {port}
|
||||
```
|
||||
|
||||
|
||||
## Set password for postgres database user
|
||||
|
||||
The password for the `postgres` database user can be set the the quickcommand `\password` or by `alter user postgres password 'Supersecret'`. A connection using the `postgres` user is still not possible from the "outside" hence to the default settings in the `pg_hba.conf`.
|
||||
|
||||
### Update pg_hba.conf to allow postgres user connections with password
|
||||
|
||||
In order to allow connections of the `postgres` database user not using OS user authentication, you have to update the `pg_hba.conf` which can be found under `/etc/postgresql/12/main/pg_hba.conf`.
|
||||
|
||||
```sh
|
||||
sudo vi /etc/postgresql/12/main/pg_hba.conf
|
||||
|
||||
...
|
||||
local all postgres peer
|
||||
...
|
||||
```
|
||||
|
||||
Change the last section of the above line to `md5`.
|
||||
|
||||
```sh
|
||||
local all postgres md5
|
||||
```
|
||||
|
||||
A restart is required in order to apply the new configuration:
|
||||
|
||||
```sh
|
||||
sudo systemctl restart postgresql
|
||||
```
|
||||
|
||||
Now a connection from outside the database host is possible e.g.
|
||||
|
||||
```sh
|
||||
psql -U postgres -d postgres -h databasehostname
|
||||
```
|
||||
|
||||
|
||||
## Creation of additional database users
|
||||
|
||||
A database user can be created by the following command:
|
||||
|
||||
```sql
|
||||
create user myuser with encrypted password 'Supersecret';
|
||||
CREATE ROLE
|
||||
|
||||
postgres=# \du
|
||||
List of roles
|
||||
Role name | Attributes | Member of
|
||||
-----------+------------------------------------------------------------+-----------
|
||||
myuser | | {}
|
||||
postgres | Superuser, Create role, Create DB, Replication, Bypass RLS | {}
|
||||
```
|
||||
|
||||
## Creation of additional databases
|
||||
|
||||
One can create new Postgres databases within an instance. Therefore you can use the `psql` command to login (see above).
|
||||
|
||||
```sql
|
||||
CREATE DATABASE dbname OWNER myuser;
|
||||
CREATE DATABASE
|
||||
|
||||
postgres=# \l
|
||||
List of databases
|
||||
Name | Owner | Encoding | Collate | Ctype | Access privileges
|
||||
-----------+----------+----------+-------------+-------------+-----------------------
|
||||
dbname | myuser | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
|
||||
postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
|
||||
template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres +
|
||||
| | | | | postgres=CTc/postgres
|
||||
template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres +
|
||||
| | | | | postgres=CTc/postgres
|
||||
```
|
||||
|
||||
You can leave the `OWNER` section of the command, when doing so, the current user will become owner of the newly created database.
|
||||
|
||||
To change the owner of an existing database later, you can use the following command:
|
||||
|
||||
```sql
|
||||
postgres=# alter database dbname owner to myuser;
|
||||
ALTER DATABASE
|
||||
```
|
||||
|
||||
## Backup and Restore
|
||||
|
||||
There are near to endless combinations in tools and parameters to backup postgres databases. Below you can find some examples using the Postgres built-in tools `pgdump`, `pg_basebackup` and `pg_restore`.
|
||||
|
||||
### pg_dump / pg_dumpall
|
||||
|
||||
Using `pg_dump` or `pg_dumpall` enables you to extract / export a PostgreSQL database(s) into a (SQL) script file or a custom archive file.
|
||||
|
||||
#### pg_dump
|
||||
|
||||
The following command creates a custom archive file from a database specified with `-d`. To export data in custom format, you have to specify so with the `-F c` option. Custom file dumps have the benefit, that they are compressed by default.
|
||||
|
||||
```bash
|
||||
Using the `--create` option will include the SQL commands in the dump script that will create the database before importing it later. The `-Z 9` option in this example compresses the SQL script created with the highest available compression rate (`0-9`).
|
||||
|
||||
```bash
|
||||
pg_dump -h vmdocker -U awx -d awx --create -f -Z 9 /tmp/awx_dump.sql.gz
|
||||
```
|
||||
|
||||
The following command creates a custom archive file from a database specified with `-d`. To export data in custom format, you have to specify so with the `-F c` option. Custom file dumps have the benefit, that they are compressed by default.
|
||||
|
||||
```bash
|
||||
pg_dump -h {pg_host} -U {username} -d {database} -F c -f /pg_dump/dumpfile.dmp
|
||||
```
|
||||
|
||||
Custom format files can only be restored by `pg_restore` (see below). A SQL dump can be restored by using `psql`.
|
||||
|
||||
```bash
|
||||
psql -d newdb -f db.sql
|
||||
```
|
||||
|
||||
A complete guide of `pg_dump` from the official documentation can be found [here](https://www.postgresql.org/docs/current/app-pgdump.html).
|
||||
|
||||
#### pg_dumpall
|
||||
|
||||
A full dump of all databases of a Postgres instance can be done by `pg_dumpall`. It will include also user creation information.
|
||||
A difference to `pg_dump`, you cannot choose for different output formats. `pg_dumpall` will always create a SQL script as output. Therefore,
|
||||
you don't need `pg_restore` for restoring a "full" dump. Only `psql` is needed (see below).
|
||||
|
||||
```bash
|
||||
pg_dumpall -h {pg_host} -U postgres > database.out
|
||||
```
|
||||
|
||||
If you use password authentication it will ask for a password each time. It is convenient to have a `~/.pgpass` file or `PGPASSWORD` environment variable set.
|
||||
|
||||
So importing a full dump is really easy by the following `psql` command:
|
||||
|
||||
```bash
|
||||
psql -h {pg_host} -f databaseb.out -U postgres
|
||||
```
|
||||
|
||||
A complete guide of `pg_dumpall` from the official documentation can be found [here](https://www.postgresql.org/docs/current/app-pg-dumpall.html).
|
||||
|
||||
### pg_restore
|
||||
|
||||
`pg_restore` can be used to restore custom file dumps created by `pg_dump`.
|
||||
|
||||
The following command will create the database (which has been dumped before).
|
||||
|
||||
```bash
|
||||
pg_restore -h {pg_host} -U {pg_user} -d postgres --create -F c /tmp/db.dmp -v
|
||||
```
|
||||
|
||||
A complete guide of `pg_restore` from the official documentation can be found [here](https://www.postgresql.org/docs/current/app-pgrestore.html).
|
||||
@@ -0,0 +1,12 @@
|
||||
# SQLite Cheat-Sheet
|
||||
|
||||
SQLite is a relational database contained in a C library. In contrast to many other databases, SQLite is not a client-server database engine. Rather, it's embedded into an end program.
|
||||
|
||||
SQLite generally follows the [PostgreSQL](databases/postgres.md) syntax but does not enforce type checking.
|
||||
|
||||
You can open a SQLite Database with `sqlite3 <filename>` directly.
|
||||
|
||||
---
|
||||
## Commands
|
||||
|
||||
`.help` Shows all commands `.databases` Show all existing databases `.quit` Exists `.tables` Shows all tables `.backup` Backups current database
|
||||
@@ -0,0 +1,113 @@
|
||||
# Docker-Compose
|
||||
|
||||
...
|
||||
|
||||
## Networking
|
||||
|
||||
By default Docker-Compose will create a new network for the given compose file. You can change the behavior by defining custom networks in your compose file.
|
||||
|
||||
### Create and assign custom network
|
||||
|
||||
...
|
||||
*Example:*
|
||||
|
||||
```yaml
|
||||
networks:
|
||||
custom-network:
|
||||
|
||||
services:
|
||||
app:
|
||||
networks:
|
||||
- custom-network
|
||||
```
|
||||
|
||||
### Use existing networks
|
||||
|
||||
If you want to use an existing Docker network for your compose files, you can add the `external: true` parameter in your compose file
|
||||
*Example:*
|
||||
|
||||
```yaml
|
||||
networks:
|
||||
existing-network:
|
||||
external: true
|
||||
```
|
||||
|
||||
## Volumes
|
||||
|
||||
Volumes are data storage objects that Docker containers can use for persistent storage.
|
||||
|
||||
### Create and map static volume(s)
|
||||
|
||||
```yaml
|
||||
volumes:
|
||||
my-volume:
|
||||
|
||||
services:
|
||||
app:
|
||||
volumes:
|
||||
- my-volume:/path-in-container
|
||||
```
|
||||
|
||||
These volumes are stored in `/var/lib/docker/volumes`.
|
||||
|
||||
### Create volume that is a CIFS mount to external share
|
||||
|
||||
```yaml
|
||||
# Variables that will need to be changed:
|
||||
# <PUID> - User id for folder/file permissions
|
||||
# <PGID> - Group id for folder/file permissions
|
||||
# <PATH_TO_CONFIG> - Path where Unmanic will store config files
|
||||
# <PATH_TO_ENCODE_CACHE> - Cache path for in-progress encoding tasks
|
||||
# <REMOTE_IP> - Remote IP address of CIFS mount
|
||||
# <PATH_TO_LIBRARY> - Path in remote machine to be mounted as your library
|
||||
# <USERNAME> - Remote mount username
|
||||
# <PASSWORD> - Remote mount password
|
||||
#
|
||||
|
||||
---
|
||||
version: '2.4'
|
||||
services:
|
||||
app:
|
||||
container_name: app_name
|
||||
image: repo/app:tag
|
||||
ports:
|
||||
- 1234:1234
|
||||
environment:
|
||||
- PUID=<PUID>
|
||||
- PGID=<PGID>
|
||||
volumes:
|
||||
- cifs_mount:/path-in-container
|
||||
|
||||
volumes:
|
||||
cifs_mount:
|
||||
driver: local
|
||||
driver_opts:
|
||||
type: cifs
|
||||
device: //<REMOTE_IP>/<PATH_TO_LIBRARY>
|
||||
o: "username=<USERNAME>,password=<PASSWORD>,vers=3.0,uid=<PUID>,gid=<PGID>"
|
||||
```
|
||||
|
||||
## Environment Variables
|
||||
|
||||
Environment variables can be defined in the `environment` section of a service in a Docker Compose file.
|
||||
|
||||
### Define environment variables
|
||||
|
||||
```yaml
|
||||
services:
|
||||
app:
|
||||
environment:
|
||||
- ENV_VAR=value
|
||||
```
|
||||
|
||||
### Interpolate environment variables
|
||||
|
||||
| Variable | Description |
|
||||
| --- | --- |
|
||||
| `${ENV_VAR}` | Value of `ENV_VAR` |
|
||||
| `${ENV_VAR:-default}` | Value of `ENV_VAR` if set and non-empty, otherwise `default`|
|
||||
| `${ENV_VAR-default}` | Value of `ENV_VAR` if set, otherwise `default`|
|
||||
| `${ENV_VAR:?error}` | Value of `ENV_VAR` if set and non-empty, otherwise exit with `error` |
|
||||
| `${ENV_VAR?error}` | Value of `ENV_VAR` if set, otherwise exit with `error` |
|
||||
| `${ENV_VAR:+replacement}` | `replacement` if `ENV_VAR` is set and non-empty, otherwise empty |
|
||||
| `${ENV_VAR+replacement}` | `replacement` if `ENV_VAR` is set, otherwise empty |
|
||||
@@ -0,0 +1,15 @@
|
||||
# Docker Desktop
|
||||
|
||||
Docker Desktop is a software application that enables developers to build, package, and run applications using Docker containers on their local machines. It provides an easy-to-use graphical interface and includes the necessary tools and components for managing Docker containers, such as the Docker engine, images, and networking capabilities.
|
||||
|
||||
## Installing Docker Desktop
|
||||
|
||||
Docker Desktop is available for Windows and macOS. You can download the installer from the [Docker website](https://www.docker.com/products/docker-desktop).
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
The `com.docker.diagnose check` command can be used to run a diagnostic check on Docker Desktop for Mac.
|
||||
|
||||
```sh
|
||||
/Applications/Docker.app/Contents/MacOS/com.docker.diagnose check
|
||||
```
|
||||
@@ -0,0 +1,90 @@
|
||||
# Dockerfile
|
||||
|
||||
|
||||
## What is a Dockerfile?
|
||||
|
||||
Docker builds images automatically by reading the instructions from a Dockerfile which is a text file that contains all commands, in order, needed to build a given image. A Dockerfile adheres to a specific format and set of instructions which you can find at [Dockerfile reference](https://docs.docker.com/engine/reference/builder/).
|
||||
|
||||
A Docker image consists of read-only layers each of which represents a Dockerfile instruction. The layers are stacked and each one is a delta of the changes from the previous layer.
|
||||
|
||||
```Go
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
FROM ubuntu:22.04
|
||||
COPY . /app
|
||||
RUN make /app
|
||||
CMD python /app/app.py
|
||||
```
|
||||
|
||||
In the example above, each instruction creates one layer:
|
||||
|
||||
* FROM creates a layer from the ubuntu:22.04 Docker image.
|
||||
* COPY adds files from your Docker client's current directory.
|
||||
* RUN builds your application with make.
|
||||
* CMD specifies what command to run within the container.
|
||||
|
||||
|
||||
# BuildKits
|
||||
|
||||
BuildKit supports loading frontends dynamically from container images. To use an external Dockerfile frontend, the first line of your Dockerfile needs to set the syntax directive pointing to the specific image you want to use:
|
||||
|
||||
```
|
||||
# syntax=docker/dockerfile:1
|
||||
```
|
||||
|
||||
# New feature in 1.4 Here-Documents
|
||||
|
||||
```GO
|
||||
RUN <<EOF
|
||||
apt-get update
|
||||
apt-get upgrade -y
|
||||
apt-get install -y ...
|
||||
EOF
|
||||
```
|
||||
|
||||
## Example running a multi-line script (Python)
|
||||
|
||||
```GO
|
||||
# syntax=docker/dockerfile:1
|
||||
FROM debian
|
||||
RUN <<EOT bash
|
||||
set -ex
|
||||
apt-get update
|
||||
apt-get install -y vim
|
||||
EOT
|
||||
```
|
||||
|
||||
## Multi-Stage Dockerfile Example (SpringBoot)
|
||||
|
||||
```GO
|
||||
# syntax=docker/dockerfile:1
|
||||
#Start with a base image containing Maven & Java runtime
|
||||
FROM maven:3.9.6-eclipse-temurin-21-alpine7 AS build
|
||||
|
||||
#Information about who maintains the image
|
||||
MAINTAINER John Doe
|
||||
|
||||
ENV HOME=/home/app
|
||||
COPY src /home/app/src
|
||||
COPY pom.xml $HOME
|
||||
RUN mkdir -p /root/.m2 \
|
||||
&& mkdir /root/.m2/repository
|
||||
|
||||
# Subsequent runs will use local dependencies and execute much faster. (https://www.baeldung.com/ops/docker-cache-maven-dependencies)
|
||||
RUN --mount=type=cache,target=/root/.m2 mvn -f $HOME/pom.xml clean package -DskipTests
|
||||
|
||||
#
|
||||
# Package stage
|
||||
#
|
||||
FROM clipse-temurin:21.0.2_13-jre-alpine
|
||||
VOLUME /tmp
|
||||
RUN groupadd -r -g 2000 mygroup && useradd -m -d /home/myuser -u 2000 -r -g mygroup myuser
|
||||
|
||||
# Add the application's jar to the container
|
||||
COPY --from=build ${HOME}/target/demo-0.0.1-SNAPSHOT.jar /usr/local/lib/demo.jar
|
||||
USER myuser
|
||||
EXPOSE 8080
|
||||
|
||||
#execute the application
|
||||
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/usr/local/lib/demo.jar"]
|
||||
```
|
||||
@@ -0,0 +1,148 @@
|
||||
# Docker
|
||||
|
||||
Docker is a containerization platform that encapsulates an application and its dependencies into a container, ensuring consistent operation across different computing environments. It leverages OS-level virtualization to deliver software in packages called containers, providing isolation and resource efficiency, and facilitating CI/CD practices by streamlining deployment and scaling.
|
||||
|
||||
## Installation
|
||||
|
||||
Docker can be installed on different operating systems. For local workstations, Docker Desktop is the recommended installation. For servers, Docker Engine is the recommended installation.
|
||||
|
||||
### Docker Desktop
|
||||
|
||||
Docker Desktop is a software application that enables developers to build, package, and run applications using Docker containers on their local machines. It provides an easy-to-use graphical interface and includes the necessary tools and components for managing Docker containers, such as the Docker engine, images, and networking capabilities.
|
||||
|
||||
For more information, see [Docker Desktop](docker-desktop.md)
|
||||
|
||||
### Install Docker Engine
|
||||
|
||||
One click installation script:
|
||||
|
||||
```sh
|
||||
curl -fsSL https://get.docker.com -o get-docker.sh
|
||||
sudo sh get-docker.sh
|
||||
```
|
||||
|
||||
Run docker as non root user:
|
||||
|
||||
```sh
|
||||
sudo groupadd docker
|
||||
sudo usermod -aG docker $USER
|
||||
```
|
||||
|
||||
For more information, see [Install Docker Engine](https://docs.docker.com/engine/install/)
|
||||
|
||||
## Using Docker
|
||||
|
||||
### Running Containers
|
||||
|
||||
| COMMAND | DESCRIPTION |
|
||||
| --- | --- |
|
||||
| `docker run <image>` | Start a new container from an image |
|
||||
| `docker run -it <image>` | Start a new container in interactive mode |
|
||||
| `docker create <image>` | Create a new container |
|
||||
| `docker start <container>` | Start a container |
|
||||
| `docker stop <container>` | Graceful stop a container |
|
||||
| `docker kill <container>` | Kill (SIGKILL) a container |
|
||||
| `docker restart <container>` | Graceful stop and restart a container |
|
||||
| `docker pause <container>` | Suspend a container |
|
||||
| `docker unpause <container>` | Resume a container |
|
||||
| `docker rm <container>` | Destroy a container |
|
||||
|
||||
### Container Bulk Management
|
||||
|
||||
| COMMAND | DESCRIPTION |
|
||||
| --- | --- |
|
||||
| `docker stop $(docker ps -q)` | To stop all the running containers |
|
||||
| `docker stop $(docker ps -a -q)` | To stop all the stopped and running containers |
|
||||
| `docker kill $(docker ps -q)` | To kill all the running containers |
|
||||
| `docker kill $(docker ps -a -q)` | To kill all the stopped and running containers |
|
||||
| `docker restart $(docker ps -q)` | To restart all running containers |
|
||||
| `docker restart $(docker ps -a -q)` | To restart all the stopped and running containers |
|
||||
| `docker rm $(docker ps -q)` | To destroy all running containers |
|
||||
| `docker rm $(docker ps -a -q)` | To destroy all the stopped and running containers |
|
||||
| `docker pause $(docker ps -q)` | To pause all running containers |
|
||||
| `docker pause $(docker ps -a -q)` | To pause all the stopped and running containers |
|
||||
| `docker start $(docker ps -q)` | To start all running containers |
|
||||
| `docker start $(docker ps -a -q)` | To start all the stopped and running containers |
|
||||
| `docker rm -vf $(docker ps -a -q)` | To delete all containers including its volumes use |
|
||||
| `docker rmi -f $(docker images -a -q)` | To delete all the images |
|
||||
| `docker system prune` | To delete all dangling and unused images, containers, cache and volumes |
|
||||
| `docker system prune -a` | To delete all used and unused images |
|
||||
| `docker system prune --volumes` | To delete all docker volumes |
|
||||
|
||||
### Inspect Containers
|
||||
|
||||
| COMMAND | DESCRIPTION |
|
||||
| --- | --- |
|
||||
`docker ps` | List running containers
|
||||
`docker ps --all` | List all containers, including stopped
|
||||
`docker logs <container>` | Show a container output
|
||||
`docker logs -f <container>` | Follow a container output
|
||||
`docker top <container>` | List the processes running in a container
|
||||
`docker diff` | Show the differences with the image (modified files)
|
||||
`docker inspect` | Show information of a container (json formatted)
|
||||
|
||||
### Executing Commands
|
||||
|
||||
| COMMAND | DESCRIPTION |
|
||||
| --- | --- |
|
||||
| `docker attach <container>` | Attach to a container |
|
||||
| `docker cp <container>:<container-path> <host-path>` | Copy files from the container |
|
||||
| `docker cp <host-path> <container>:<container-path>` | Copy files into the container |
|
||||
| `docker export <container>` | Export the content of the container (tar archive) |
|
||||
| `docker exec <container>` | Run a command inside a container |
|
||||
| `docker exec -it <container> /bin/bash` | Open an interactive shell inside a container (there is no bash in some |images, use /bin/sh)
|
||||
| `docker wait <container>` | Wait until the container terminates and return the exit code |
|
||||
|
||||
### Images
|
||||
|
||||
| COMMAND | DESCRIPTION |
|
||||
| --- | --- |
|
||||
| `docker image ls` | List all local images |
|
||||
| `docker history <image>` | Show the image history |
|
||||
| `docker inspect <image>` | Show information (json formatted) |
|
||||
| `docker tag <image> <tag>` | Tag an image |
|
||||
| `docker commit <container> <image>` | Create an image (from a container) |
|
||||
| `docker import <url>` | Create an image (from a tarball) |
|
||||
| `docker rmi <image>` | Delete images |
|
||||
| `docker pull <user>/<repository>:<tag>` | Pull an image from a registry |
|
||||
| `docker push <user>/<repository>:<tag>` | Push and image to a registry |
|
||||
| `docker search <test>` | Search an image on the official registry |
|
||||
| `docker login` | Login to a registry |
|
||||
| `docker logout` | Logout from a registry |
|
||||
| `docker save <user>/<repository>:<tag>` | Export an image/repo as a tarball |
|
||||
| `docker load` | Load images from a tarball |
|
||||
|
||||
### Volumes
|
||||
|
||||
| COMMAND | DESCRIPTION |
|
||||
| --- | --- |
|
||||
| `docker volume ls` | List all vol1umes |
|
||||
| `docker volume create <volume>` | Create a volume |
|
||||
| `docker volume inspect <volume>` | Show information (json formatted) |
|
||||
| `docker volume rm <volume>` | Destroy a volume |
|
||||
| `docker volume ls --filter="dangling=true"` | List all dangling volumes (not referenced by any container) |
|
||||
| `docker volume prune` | Delete all volumes (not referenced by any container) |
|
||||
|
||||
### Backup a container
|
||||
|
||||
Backup docker data from inside container volumes and package it in a tarball archive.
|
||||
`docker run --rm --volumes-from <container> -v $(pwd):/backup busybox tar cvfz /backup/backup.tar <container-path>`
|
||||
|
||||
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.
|
||||
|
||||
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/).
|
||||
|
||||
### Restore container from backup
|
||||
|
||||
Restore the volume with a tarball archive.
|
||||
`docker run --rm --volumes-from <container> -v $(pwd):/backup busybox sh -c "cd <container-path> && tar xvf /backup/backup.tar --strip 1"`
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Networking
|
||||
|
||||
`docker run --name netshoot --rm -it nicolaka/netshoot /bin/bash`
|
||||
@@ -0,0 +1,30 @@
|
||||
# Welcome to MkDocs
|
||||
|
||||
For full documentation visit [mkdocs.org](https://www.mkdocs.org).
|
||||
|
||||
## Commands
|
||||
|
||||
* `mkdocs new [dir-name]` - Create a new project.
|
||||
* `mkdocs serve` - Start the live-reloading docs server.
|
||||
* `mkdocs build` - Build the documentation site.
|
||||
* `mkdocs gh-deploy` - Deploy documentation to GitHub Pages.
|
||||
|
||||
## Project layout
|
||||
|
||||
mkdocs.yml # The configuration file.
|
||||
docs/
|
||||
index.md # The documentation homepage.
|
||||
... # Other markdown pages, images and other files.
|
||||
|
||||
## Diagramm
|
||||
|
||||
Test
|
||||
|
||||
``` mermaid
|
||||
graph LR
|
||||
A[Start] --> B{Error?};
|
||||
B -->|Yes| C[Hmm...];
|
||||
C --> D[Debug];
|
||||
D --> B;
|
||||
B ---->|No| E[Yay!];
|
||||
```
|
||||
@@ -0,0 +1,11 @@
|
||||
# ARP in Linux
|
||||
|
||||
The **arp** command in Linux allows you to view and modify the [ARP table](../networking/arp-protocol.md), which contains information about devices on the local network. It can be used to view the IP addresses and MAC addresses of devices on the network, and to add or remove entries from the [ARP table](../networking/arp-protocol.md).
|
||||
|
||||
| Command | Description |
|
||||
| --- | --- |
|
||||
| `arp` | View the ARP table |
|
||||
| `arp -a` | View the ARP table |
|
||||
| `arp -n` | View the ARP table (don't resolve names) |
|
||||
| `arp -d <ip-address>` | Delete an entry from the ARP table |
|
||||
| `arp -s <ip-address> <mac-address>` | Add an entry to the ARP table |
|
||||
@@ -0,0 +1,328 @@
|
||||
# AWK
|
||||
AWK (awk) is a domain-specific language designed for text processing and typically used as a data extraction and reporting tool. Similar to the **[Sed](sed)** and **[Grep](grep)** commands, it is a filter, and is a standard feature of most Unix-like operating systems, like **[Linux](linux)**.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
### Unix/Linux
|
||||
|
||||
```bash
|
||||
awk '/pattern/ {print "$1"}' # standard Unix shells
|
||||
```
|
||||
|
||||
### DOS/Win
|
||||
|
||||
```bash
|
||||
awk '/pattern/ {print "$1"}' # compiled with DJGPP, Cygwin
|
||||
awk "/pattern/ {print \"$1\"}" # GnuWin32, UnxUtils, Mingw
|
||||
```
|
||||
|
||||
Note that the DJGPP compilation (for DOS or Windows-32) permits an awk
|
||||
script to follow Unix quoting syntax `'/like/ {"this"}'`. HOWEVER, if the
|
||||
command interpreter is `CMD.EXE` or `COMMAND.COM`, single quotes will not
|
||||
protect the redirection arrows `(<, >)` nor do they protect pipes `(|)`.
|
||||
These are special symbols which require "double quotes" to protect them
|
||||
from interpretation as operating system directives. If the command
|
||||
interpreter is bash, ksh, zsh or another Unix shell, then single and double
|
||||
quotes will follow the standard Unix usage.
|
||||
|
||||
Users of MS-DOS or Microsoft Windows must remember that the percent
|
||||
sign `(%)` is used to indicate environment variables, so this symbol must
|
||||
be doubled `(%%)` to yield a single percent sign visible to awk.
|
||||
|
||||
To conserve space, use `'1'` instead of `'{print}'` to print each line.
|
||||
Either one will work.
|
||||
|
||||
## Handy one-line Awk scripts
|
||||
|
||||
### File Spacing
|
||||
|
||||
```bash
|
||||
# double space a file
|
||||
awk '1;{print ""}'
|
||||
awk 'BEGIN{ORS="\n\n"};1'
|
||||
|
||||
# double space a file which already has blank lines in it. Output file
|
||||
# should contain no more than one blank line between lines of text.
|
||||
# NOTE: On Unix systems, DOS lines which have only CRLF (\r\n) are
|
||||
# often treated as non-blank, and thus 'NF' alone will return TRUE.
|
||||
awk 'NF{print $0 "\n"}'
|
||||
|
||||
# triple space a file
|
||||
awk '1;{print "\n"}'
|
||||
```
|
||||
|
||||
### Numbering and Calculations
|
||||
|
||||
```bash
|
||||
# precede each line by its line number FOR THAT FILE (left alignment).
|
||||
# Using a tab (\t) instead of space will preserve margins.
|
||||
awk '{print FNR "\t" $0}' files*
|
||||
|
||||
# precede each line by its line number FOR ALL FILES TOGETHER, with tab.
|
||||
awk '{print NR "\t" $0}' files*
|
||||
|
||||
# number each line of a file (number on left, right-aligned)
|
||||
# Double the percent signs if typing from the DOS command prompt.
|
||||
awk '{printf("%5d : %s\n", NR,$0)}'
|
||||
|
||||
# number each line of file, but only print numbers if line is not blank
|
||||
# Remember caveats about Unix treatment of \r (mentioned above)
|
||||
awk 'NF{$0=++a " :" $0};1'
|
||||
awk '{print (NF? ++a " :" :"") $0}'
|
||||
|
||||
# count lines (emulates "wc -l")
|
||||
awk 'END{print NR}'
|
||||
|
||||
# print the sums of the fields of every line
|
||||
awk '{s=0; for (i=1; i<=NF; i++) s=s+$i; print s}'
|
||||
|
||||
# add all fields in all lines and print the sum
|
||||
awk '{for (i=1; i<=NF; i++) s=s+$i}; END{print s}'
|
||||
|
||||
# print every line after replacing each field with its absolute value
|
||||
awk '{for (i=1; i<=NF; i++) if ($i < 0) $i = -$i; print }'
|
||||
awk '{for (i=1; i<=NF; i++) $i = ($i < 0) ? -$i : $i; print }'
|
||||
|
||||
# print the total number of fields ("words") in all lines
|
||||
awk '{ total = total + NF }; END {print total}' file
|
||||
|
||||
# print the total number of lines that contain "Beth"
|
||||
awk '/Beth/{n++}; END {print n+0}' file
|
||||
|
||||
# print the largest first field and the line that contains it
|
||||
# Intended for finding the longest string in field #1
|
||||
awk '$1 > max {max=$1; maxline=$0}; END{ print max, maxline}'
|
||||
|
||||
# print the number of fields in each line, followed by the line
|
||||
awk '{ print NF ":" $0 } '
|
||||
|
||||
# print the last field of each line
|
||||
awk '{ print $NF }'
|
||||
|
||||
# print the last field of the last line
|
||||
awk '{ field = $NF }; END{ print field }'
|
||||
|
||||
# print every line with more than 4 fields
|
||||
awk 'NF > 4'
|
||||
|
||||
# print every line where the value of the last field is > 4
|
||||
awk '$NF > 4'
|
||||
```
|
||||
|
||||
### String Creation
|
||||
|
||||
```bash
|
||||
# create a string of a specific length (e.g., generate 513 spaces)
|
||||
awk 'BEGIN{while (a++<513) s=s " "; print s}'
|
||||
|
||||
# insert a string of specific length at a certain character position
|
||||
# Example: insert 49 spaces after column #6 of each input line.
|
||||
gawk --re-interval 'BEGIN{while(a++<49)s=s " "};{sub(/^.{6}/,"&" s)};1'
|
||||
```
|
||||
|
||||
### Array Creation
|
||||
|
||||
```bash
|
||||
# These next 2 entries are not one-line scripts, but the technique
|
||||
# is so handy that it merits inclusion here.
|
||||
|
||||
# create an array named "month", indexed by numbers, so that month[1]
|
||||
# is 'Jan', month[2] is 'Feb', month[3] is 'Mar' and so on.
|
||||
split("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec", month, " ")
|
||||
|
||||
# create an array named "mdigit", indexed by strings, so that
|
||||
# mdigit["Jan"] is 1, mdigit["Feb"] is 2, etc. Requires "month" array
|
||||
for (i=1; i<=12; i++) mdigit[month[i]] = i
|
||||
```
|
||||
|
||||
### Text Conversion and Substitution
|
||||
|
||||
```bash
|
||||
# IN UNIX ENVIRONMENT: convert DOS newlines (CR/LF) to Unix format
|
||||
awk '{sub(/\r$/,"")};1' # assumes EACH line ends with Ctrl-M
|
||||
|
||||
# IN UNIX ENVIRONMENT: convert Unix newlines (LF) to DOS format
|
||||
awk '{sub(/$/,"\r")};1'
|
||||
|
||||
# IN DOS ENVIRONMENT: convert Unix newlines (LF) to DOS format
|
||||
awk 1
|
||||
|
||||
# IN DOS ENVIRONMENT: convert DOS newlines (CR/LF) to Unix format
|
||||
# Cannot be done with DOS versions of awk, other than gawk:
|
||||
gawk -v BINMODE="w" '1' infile >outfile
|
||||
|
||||
# Use "tr" instead.
|
||||
tr -d \r <infile >outfile # GNU tr version 1.22 or higher
|
||||
|
||||
# delete leading whitespace (spaces, tabs) from front of each line
|
||||
# aligns all text flush left
|
||||
awk '{sub(/^[ \t]+/, "")};1'
|
||||
|
||||
# delete trailing whitespace (spaces, tabs) from end of each line
|
||||
awk '{sub(/[ \t]+$/, "")};1'
|
||||
|
||||
# delete BOTH leading and trailing whitespace from each line
|
||||
awk '{gsub(/^[ \t]+|[ \t]+$/,"")};1'
|
||||
awk '{$1=$1};1' # also removes extra space between fields
|
||||
|
||||
# insert 5 blank spaces at beginning of each line (make page offset)
|
||||
awk '{sub(/^/, " ")};1'
|
||||
|
||||
# align all text flush right on a 79-column width
|
||||
awk '{printf "%79s\n", $0}' file*
|
||||
|
||||
# center all text on a 79-character width
|
||||
awk '{l=length();s=int((79-l)/2); printf "%"(s+l)"s\n",$0}' file*
|
||||
|
||||
# substitute (find and replace) "foo" with "bar" on each line
|
||||
awk '{sub(/foo/,"bar")}; 1' # replace only 1st instance
|
||||
gawk '{$0=gensub(/foo/,"bar",4)}; 1' # replace only 4th instance
|
||||
awk '{gsub(/foo/,"bar")}; 1' # replace ALL instances in a line
|
||||
|
||||
# substitute "foo" with "bar" ONLY for lines which contain "baz"
|
||||
awk '/baz/{gsub(/foo/, "bar")}; 1'
|
||||
|
||||
# substitute "foo" with "bar" EXCEPT for lines which contain "baz"
|
||||
awk '!/baz/{gsub(/foo/, "bar")}; 1'
|
||||
|
||||
# change "scarlet" or "ruby" or "puce" to "red"
|
||||
awk '{gsub(/scarlet|ruby|puce/, "red")}; 1'
|
||||
|
||||
# reverse order of lines (emulates "tac")
|
||||
awk '{a[i++]=$0} END {for (j=i-1; j>=0;) print a[j--] }' file*
|
||||
|
||||
# if a line ends with a backslash, append the next line to it (fails if
|
||||
# there are multiple lines ending with backslash...)
|
||||
awk '/\\$/ {sub(/\\$/,""); getline t; print $0 t; next}; 1' file*
|
||||
|
||||
# print and sort the login names of all users
|
||||
awk -F ":" '{print $1 | "sort" }' /etc/passwd
|
||||
|
||||
# print the first 2 fields, in opposite order, of every line
|
||||
awk '{print $2, $1}' file
|
||||
|
||||
# switch the first 2 fields of every line
|
||||
awk '{temp = $1; $1 = $2; $2 = temp}' file
|
||||
|
||||
# print every line, deleting the second field of that line
|
||||
awk '{ $2 = ""; print }'
|
||||
|
||||
# print in reverse order the fields of every line
|
||||
awk '{for (i=NF; i>0; i--) printf("%s ",$i);print ""}' file
|
||||
|
||||
# concatenate every 5 lines of input, using a comma separator
|
||||
# between fields
|
||||
awk 'ORS=NR%5?",":"\n"' file
|
||||
```
|
||||
|
||||
### Selective Printing of Certain Lines
|
||||
|
||||
```bash
|
||||
# print first 10 lines of file (emulates behavior of "head")
|
||||
awk 'NR < 11'
|
||||
|
||||
# print first line of file (emulates "head -1")
|
||||
awk 'NR>1{exit};1'
|
||||
|
||||
# print the last 2 lines of a file (emulates "tail -2")
|
||||
awk '{y=x "\n" $0; x=$0};END{print y}'
|
||||
|
||||
# print the last line of a file (emulates "tail -1")
|
||||
awk 'END{print}'
|
||||
|
||||
# print only lines which match regular expression (emulates "grep")
|
||||
awk '/regex/'
|
||||
|
||||
# print only lines which do NOT match regex (emulates "grep -v")
|
||||
awk '!/regex/'
|
||||
|
||||
# print any line where field #5 is equal to "abc123"
|
||||
awk '$5 == "abc123"'
|
||||
|
||||
# print only those lines where field #5 is NOT equal to "abc123"
|
||||
# This will also print lines which have less than 5 fields.
|
||||
awk '$5 != "abc123"'
|
||||
awk '!($5 == "abc123")'
|
||||
|
||||
# matching a field against a regular expression
|
||||
awk '$7 ~ /^[a-f]/' # print line if field #7 matches regex
|
||||
awk '$7 !~ /^[a-f]/' # print line if field #7 does NOT match regex
|
||||
|
||||
# print the line immediately before a regex, but not the line
|
||||
# containing the regex
|
||||
awk '/regex/{print x};{x=$0}'
|
||||
awk '/regex/{print (NR==1 ? "match on line 1" : x)};{x=$0}'
|
||||
|
||||
# print the line immediately after a regex, but not the line
|
||||
# containing the regex
|
||||
awk '/regex/{getline;print}'
|
||||
|
||||
# grep for AAA and BBB and CCC (in any order on the same line)
|
||||
awk '/AAA/ && /BBB/ && /CCC/'
|
||||
|
||||
# grep for AAA and BBB and CCC (in that order)
|
||||
awk '/AAA.*BBB.*CCC/'
|
||||
|
||||
# print only lines of 65 characters or longer
|
||||
awk 'length > 64'
|
||||
|
||||
# print only lines of less than 65 characters
|
||||
awk 'length < 64'
|
||||
|
||||
# print section of file from regular expression to end of file
|
||||
awk '/regex/,0'
|
||||
awk '/regex/,EOF'
|
||||
|
||||
# print section of file based on line numbers (lines 8-12, inclusive)
|
||||
awk 'NR==8,NR==12'
|
||||
|
||||
# print line number 52
|
||||
awk 'NR==52'
|
||||
awk 'NR==52 {print;exit}' # more efficient on large files
|
||||
|
||||
# print section of file between two regular expressions (inclusive)
|
||||
awk '/Iowa/,/Montana/' # case sensitive
|
||||
```
|
||||
|
||||
### Selective Deletion of Certain Lines
|
||||
|
||||
```bash
|
||||
# delete ALL blank lines from a file (same as "grep '.' ")
|
||||
awk NF
|
||||
awk '/./'
|
||||
|
||||
# remove duplicate, consecutive lines (emulates "uniq")
|
||||
awk 'a !~ $0; {a=$0}'
|
||||
|
||||
# remove duplicate, nonconsecutive lines
|
||||
awk '!a[$0]++' # most concise script
|
||||
awk '!($0 in a){a[$0];print}' # most efficient script
|
||||
```
|
||||
|
||||
## References
|
||||
|
||||
For additional syntax instructions, including the way to apply editing
|
||||
commands from a disk file instead of the command line, consult:
|
||||
|
||||
"sed & awk, 2nd Edition," by Dale Dougherty and Arnold Robbins
|
||||
(O'Reilly, 1997)
|
||||
|
||||
"UNIX Text Processing," by Dale Dougherty and Tim O'Reilly (Hayden
|
||||
Books, 1987)
|
||||
|
||||
"GAWK: Effective awk Programming," 3d edition, by Arnold D. Robbins
|
||||
(O'Reilly, 2003) or at http://www.gnu.org/software/gawk/manual/
|
||||
|
||||
To fully exploit the power of awk, one must understand "regular
|
||||
expressions." For detailed discussion of regular expressions, see
|
||||
"Mastering Regular Expressions, 3d edition" by Jeffrey Friedl (O'Reilly,
|
||||
2006).
|
||||
|
||||
The info and manual ("man") pages on Unix systems may be helpful (try
|
||||
"man awk", "man nawk", "man gawk", "man regexp", or the section on
|
||||
regular expressions in "man ed").
|
||||
|
||||
USE OF '\t' IN awk SCRIPTS: For clarity in documentation, I have used
|
||||
'\t' to indicate a tab character (0x09) in the scripts. All versions of
|
||||
awk should recognize this abbreviation.
|
||||
@@ -0,0 +1,48 @@
|
||||
# Cron
|
||||
|
||||
A CRON expression is simply a string consisting of six fields that each define a specific unit of time.
|
||||
|
||||
They are written in the following format:
|
||||
|
||||
```
|
||||
{second} {minute} {hour} {day} {month} {day of the week}
|
||||
```
|
||||
|
||||
---
|
||||
## Values
|
||||
|
||||
The following values are allowed within each date/time unit placeholder.
|
||||
|
||||
| Field | Allowed Values | Description |
|
||||
|---|---|---|
|
||||
| {second} | 0-59 | Trigger every {second} second(s) |
|
||||
| {minute} | 0-59 | Trigger every {minute} minute(s) |
|
||||
| {hour} | 0-23 | Trigger every {hour} hour(s) |
|
||||
| {day} | 1-31 | Trigger every {day} day(s) of month |
|
||||
| {month} | 1-12 | Trigger every {month} month(s) |
|
||||
| {day of week} | 0-6 | MON-SUN Trigger on specific {day of week} |
|
||||
|
||||
---
|
||||
## Special Characters
|
||||
|
||||
Additionally you can also use the following special characters to build more advanced expressions:
|
||||
|
||||
| Special Character | Description |
|
||||
|---|---|
|
||||
| `*` | Trigger on tick of every time unit |
|
||||
| `,` | List separator |
|
||||
|`–` | Specifies a range |
|
||||
| `/` | Defines an increment |
|
||||
|
||||
---
|
||||
## Examples
|
||||
|
||||
`0 * * * * *` - Executes every minute
|
||||
`0 0 * * * *` - Executes every hour
|
||||
`0 0 0 * * *` - Executes every day
|
||||
`0 0 0 0 * *` - Executes every month
|
||||
`0 0 0 1 1 *` - Executes on first day of Jan each year
|
||||
`30 20 * * SAT` - Executes at 08:30pm every Saturday
|
||||
`30 20 * * 6` - Executes at 08:30pm every Saturday
|
||||
`0 */5 * * * *` - Executes every five minutes
|
||||
`0 0 8-10/1 * * *` - Executes every hour between 8am and 10am
|
||||
@@ -0,0 +1,4 @@
|
||||
# CentOS
|
||||
|
||||
CentOS, from Community Enterprise Operating System; also known as CentOS Linux) is a Linux distribution that provides a free and open-source community-supported computing platform, functionally compatible with its upstream source, Red Hat Enterprise Linux (RHEL). CentOS announced the official joining with Red Hat while staying independent from RHEL, under a new CentOS governing board.
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
# Debian
|
||||
|
||||
Debian also known as Debian GNU/Linux, is a [Linux](../linux.md) distribution composed of free and open-source software, developed by the community-supported Debian Project. The Debian Stable branch is the most popular edition for personal computers and servers. Debian is also the basis for many other distributions, most notably [Ubuntu](ubuntu.md).
|
||||
@@ -0,0 +1,107 @@
|
||||
# Fedora
|
||||
|
||||
Fedora Linux is a Linux distribution developed by the Fedora Project. Fedora contains software distributed under various free and open-source licenses and aims to be on the leading edge of open-source technologies. Fedora is the upstream source for Red Hat Enterprise Linux.
|
||||
|
||||
Since the release of Fedora 35, six different editions are made available tailored to personal computer, server, cloud computing, container and Internet of Things installations. A new version of Fedora Linux is released every six months.
|
||||
|
||||
Project Homepage: [Home - Fedora](https://getfedora.org/en/)
|
||||
Documentation: [Fedora Documentation](https://docs.fedoraproject.org/en-US/docs/)
|
||||
|
||||
---
|
||||
## Post Install Steps
|
||||
|
||||
### 1- Enable Caching in dnf Package Manager
|
||||
Caching is Enabled to increase dnf speed
|
||||
|
||||
Edit dnf configuration:
|
||||
```shell
|
||||
sudo nano /etc/dnf/dnf.conf
|
||||
```
|
||||
Add this lines add the end:
|
||||
```shell
|
||||
# Added for speed:
|
||||
fastestmirror=True
|
||||
#change to 10 if you have fast internet speed
|
||||
max_parallel_downloads=5
|
||||
#when click enter the default is yes
|
||||
defaultyes=True
|
||||
#Keeps downloaded packages in the cache
|
||||
keepcache=True
|
||||
```
|
||||
To clean dnf cache periodically:
|
||||
```shell
|
||||
sudo dnf clean dbcache
|
||||
#or
|
||||
sudo dnf clean all
|
||||
```
|
||||
for more configuration options: [DNF Configuration Reference](https://dnf.readthedocs.io/en/latest/conf_ref.html)
|
||||
|
||||
### 2- System Update
|
||||
|
||||
Run the following command:
|
||||
```shell
|
||||
sudo dnf update
|
||||
```
|
||||
|
||||
## 3- Enable RPM Fusion
|
||||
|
||||
RPM Fusion **provides software that the Fedora Project or Red Hat doesn't want to ship**. That software is provided as precompiled RPMs for all current Fedora versions and current Red Hat Enterprise Linux or clones versions; you can use the RPM Fusion repositories with tools like yum and PackageKit.
|
||||
|
||||
Installing both free and non-free RPM Fusion:
|
||||
```shell
|
||||
sudo dnf install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
|
||||
```
|
||||
|
||||
### AppStream metadata
|
||||
to enable users to install packages using Gnome Software/KDE Discover. Please note that these are a subset of all packages since the metadata are only generated for GUI packages.
|
||||
|
||||
The following command will install the required packages:
|
||||
```shell
|
||||
sudo dnf groupupdate core
|
||||
```
|
||||
|
||||
## 4- Adding Flatpak
|
||||
|
||||
Flatpak, formerly known as xdg-app, is a utility for software deployment and package management for Linux. It is advertised as offering a sandbox environment in which users can run application software in isolation from the rest of the system.
|
||||
|
||||
Flatpak is installed by default on Fedora Workstation, Fedora Silverblue, and Fedora Kinoite. To get started, all you need to do is enable **Flathub**, which is the best way to get Flatpak apps. Just download and install the [Flathub repository file](https://flathub.org/repo/flathub.flatpakrepo)
|
||||
|
||||
The above links should work on the default GNOME and KDE Fedora installations, but if they fail for some reason you can manually add the Flathub remote by running:
|
||||
```shell
|
||||
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
||||
```
|
||||
|
||||
## 5- Change Hostname
|
||||
|
||||
Run the following command:
|
||||
```shell
|
||||
sudo hostnamectl set-hostname #your-name
|
||||
```
|
||||
|
||||
## 6- Add Multimedia Codecs
|
||||
|
||||
Run the following commands:
|
||||
```shell
|
||||
sudo dnf groupupdate multimedia --setop="install_weak_deps=False" --exclude=PackageKit-gstreamer-plugin
|
||||
|
||||
sudo dnf groupupdate sound-and-video
|
||||
```
|
||||
|
||||
## 7- Make it More Customizable
|
||||
|
||||
Open GNOME software installer and install the following:
|
||||
- GNOME Tweaks
|
||||
- Extensions
|
||||
|
||||
Consider the following GNOME Extensions:
|
||||
- Vitals
|
||||
- ArcMenu
|
||||
- Custom Hot Corners - Extended
|
||||
- Dash to Panel
|
||||
- Sound input & ouput Device Chooser
|
||||
- OpenWeather
|
||||
- Impatience
|
||||
- Screenshot Tool
|
||||
- Tiling Assistant
|
||||
- Extension List
|
||||
- Clipboard Indicator
|
||||
@@ -0,0 +1,32 @@
|
||||
# Ubuntu
|
||||
|
||||
Ubuntu is a Linux distribution based on Debian and composed mostly of free and open-source software.Ubuntu is officially released in three editions: Desktop, Server, and Core for Internet of things devices and robots. Ubuntu is a popular operating system for cloud computing, with support for OpenStack.
|
||||
|
||||
## How to enable sudo without a password for a user
|
||||
|
||||
Open a Terminal window and type:
|
||||
|
||||
```
|
||||
sudo visudo
|
||||
```
|
||||
|
||||
In the bottom of the file, add the following line:
|
||||
|
||||
```
|
||||
$USER ALL=(ALL) NOPASSWD: ALL
|
||||
```
|
||||
|
||||
Where `$USER` is your username on your system. Save and close the sudoers file (if you haven't changed your default terminal editor (you'll know if you have), press Ctl + x to exit `nano` and it'll prompt you to save).
|
||||
|
||||
---
|
||||
## Networking
|
||||
|
||||
In Ubuntu, networking can be managed using various tools and utilities, including the following:
|
||||
|
||||
1. **NetworkManager**: NetworkManager is a system service that manages network connections and devices. It provides a graphical user interface (GUI) for configuring network settings, as well as a command-line interface (CLI) for advanced configuration. NetworkManager is the default network management tool in Ubuntu.
|
||||
|
||||
2. **Netplan**: [Netplan](../netplan) is a command-line utility for configuring network interfaces in modern versions of Ubuntu. It uses YAML configuration files to describe network interfaces, IP addresses, routes, and other network-related parameters. [Netplan](../netplan) generates the corresponding configuration files for the underlying network configuration subsystem, such as systemd-networkd or NetworkManager.
|
||||
|
||||
3. **ifupdown**: ifupdown is a traditional command-line tool for managing network interfaces in Ubuntu. It uses configuration files located in the /etc/network/ directory to configure network interfaces, IP addresses, routes, and other network-related parameters.
|
||||
|
||||
To manage networking in **Ubuntu**, you can use one or more of these tools depending on your needs and preferences. For example, you can use the NetworkManager GUI to configure basic network settings and use [Netplan](../netplan) or ifupdown for advanced configuration. You can also use the command-line tools to automate network configuration tasks or to configure networking on headless servers.
|
||||
@@ -0,0 +1 @@
|
||||
# Environment Variables in Linux
|
||||
@@ -0,0 +1,15 @@
|
||||
# Etherwake
|
||||
|
||||
Etherwake is a command-line utility for sending [Wake-on-LAN (WoL)](../networking/wakeonlan.md) magic packets to wake up a device over a network connection. It allows you to wake up a device by specifying its MAC address as an argument, and it sends the magic packet to the broadcast address of the network interface that is specified.
|
||||
|
||||
Here's an example of how to use Etherwake to wake up a device with a specific MAC address:
|
||||
|
||||
```sh
|
||||
sudo etherwake -i eth0 00:11:22:33:44:55
|
||||
```
|
||||
|
||||
In this example, `sudo` is used to run the command with administrative privileges, `-i eth0` specifies the network interface to use (in this case, `eth0`), and `00:11:22:33:44:55` is the MAC address of the device to wake up.
|
||||
|
||||
The command sends a Wake-on-LAN magic packet to the broadcast address of the `eth0` network interface, which should wake up the device with the specified MAC address if Wake-on-LAN is enabled on the device.
|
||||
|
||||
Note that the exact syntax and options for `etherwake` may vary depending on your operating system and version of the utility. You can usually find more information and examples in the `etherwake` manual page (`man etherwake`).
|
||||
@@ -0,0 +1,60 @@
|
||||
# Ethtool
|
||||
|
||||
**Ethtool** is a command-line utility used in [Linux](../linux/linux.md) systems to query and control network interface settings. It provides information about the network interface cards (NICs) installed on a system, such as link status, driver information, speed, duplex mode, and more, and allows you to modify certain settings of a network interface.
|
||||
|
||||
## Using Ethtool to view network interface information
|
||||
|
||||
To view general information about a specific network interface (e.g., eth0), use the following command:
|
||||
|
||||
```sh
|
||||
ethtool interface_name
|
||||
```
|
||||
|
||||
If you want to retrieve only the link status of an interface, you can use the -i option followed by the interface name:
|
||||
|
||||
```sh
|
||||
ethtool -i interface_name
|
||||
```
|
||||
|
||||
## Using Ethtool to change network interface settings
|
||||
|
||||
**Ethtool** allows you to modify certain settings of a network interface. For example, you can manually set the speed and duplex mode, enable or disable features like [Wake-on-LAN](../networking/wakeonlan.md) or [autonegotiation](../networking/autonegotiation.md), configure flow control settings, and adjust ring buffer sizes.
|
||||
|
||||
### Manually set the speed and duplex mode of a network interface
|
||||
|
||||
To manually set the speed and duplex mode of a network interface (e.g., eth0) to a specific value, use the following command:
|
||||
|
||||
```sh
|
||||
ethtool -s interface_name speed interface_speed duplex interface_duplex
|
||||
```
|
||||
|
||||
If you want to enable or disable autonegotiation on a specific interface, you can use the following command:
|
||||
|
||||
```sh
|
||||
ethtool -s interface_name autoneg on
|
||||
ethtool -s interface_name autoneg off
|
||||
```
|
||||
|
||||
### Enable Wake On LAN (WoL) on the network adapter
|
||||
|
||||
Use the following command to check if your network interface supports Wake On LAN (WoL):
|
||||
|
||||
```sh
|
||||
sudo ethtool interface_name | grep "Wake-on"
|
||||
```
|
||||
|
||||
If the output shows "Wake-on: d", it means that Wake On LAN (WoL) is disabled.
|
||||
|
||||
To enable Wake On LAN (WoL), use the following command:
|
||||
|
||||
```sh
|
||||
sudo ethtool -s interface_name wol g
|
||||
```
|
||||
|
||||
### Make the Wake On LAN (WoL) setting persistent across reboots
|
||||
|
||||
To make the Wake On LAN (WoL) setting persistent across reboots, add the following line to the `/etc/network/interfaces` file:
|
||||
|
||||
```sh
|
||||
post-up /usr/sbin/ethtool -s interface_name wol g
|
||||
```
|
||||
@@ -0,0 +1,2 @@
|
||||
# Grep
|
||||
Grep is a command-line utility for searching plain-text data sets for lines that match a regular expression. Its name comes from the ed command g/re/p (globally search for a regular expression and print matching lines), which has the same effect. grep was originally developed for the Unix operating system like **Linux ([[linux]])**, but later available for all Unix-like systems and some others such as OS-9.
|
||||
Executable
+2
@@ -0,0 +1,2 @@
|
||||
# IPTables
|
||||
Iptables is a user-space utility program that allows a system administrator to configure the IP packet filter rules of the **Linux ([[linux]])** kernel firewall, implemented as different Netfilter modules. The filters are organized in different tables, which contain chains of rules for how to treat network traffic packets. Different kernel modules and programs are currently used for different protocols; iptables applies to IPv4, ip6tables to IPv6, arptables to ARP, and ebtables to Ethernet frames.
|
||||
Whitespace-only changes.
@@ -0,0 +1,75 @@
|
||||
# LSPCI
|
||||
|
||||
**Lspci** is a command-line utility in Linux and Unix operating systems that is used to display information about all the [PCI](../hardware/pci.md) (Peripheral Component Interconnect) buses and devices connected to the system. It provides detailed information about the hardware components, including their vendor and device IDs, subsystems, and other attributes. The **lspci** command is often used for diagnosing hardware-related issues and identifying the specific hardware components installed in a system.
|
||||
|
||||
---
|
||||
## How to use LSPCI
|
||||
|
||||
Here is an example of using the **lspci** command in a Linux terminal:
|
||||
|
||||
```sh
|
||||
$ lspci
|
||||
00:00.0 Host bridge: Intel Corporation 8th Gen Core Processor Host Bridge/DRAM Registers (rev 07)
|
||||
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor PCIe Controller (x16) (rev 07)
|
||||
00:02.0 VGA compatible controller: Intel Corporation UHD Graphics 630 (Desktop)
|
||||
00:08.0 System peripheral: Intel Corporation Xeon E3-1200 v5/v6 / E3-1500 v5 / 6th/7th/8th Gen Core Processor Gaussian Mixture Model
|
||||
00:14.0 USB controller: Intel Corporation 200 Series/Z370 Chipset Family USB 3.0 xHCI Controller
|
||||
00:14.2 Signal processing controller: Intel Corporation 200 Series PCH Thermal Subsystem
|
||||
...
|
||||
```
|
||||
|
||||
This output shows information about various hardware components in the system, including the vendor and device IDs, the device type, and the revision number.
|
||||
|
||||
|
||||
### Show details about devices
|
||||
|
||||
To show detailed information about a specific device using **lspci**, you can specify the device’s bus address using the `lspci -s` option.
|
||||
|
||||
```sh
|
||||
$ lspci -s 00:02.0
|
||||
00:02.0 VGA compatible controller: Intel Corporation UHD Graphics 630 (Desktop) (rev 02)
|
||||
Subsystem: ASRock Incorporation Device 3977
|
||||
Flags: bus master, fast devsel, latency 0, IRQ 131
|
||||
Memory at a0000000 (64-bit, non-prefetchable) [size=16M]
|
||||
Memory at 90000000 (64-bit, prefetchable) [size=256M]
|
||||
I/O ports at 5000 [size=64]
|
||||
[virtual] Expansion ROM at 000c0000 [disabled] [size=128K]
|
||||
Capabilities: <access denied>
|
||||
Kernel driver in use: i915
|
||||
Kernel modules: i915
|
||||
```
|
||||
|
||||
This output shows detailed information about the VGA compatible controller, including its subsystem, memory addresses, I/O ports, and kernel driver.
|
||||
|
||||
|
||||
### Verbose output of lspci
|
||||
|
||||
The `-v` (verbose) and `-vv` (very verbose) parameters in **lspci** are used to increase the level of detail in the output.
|
||||
|
||||
• The `-v` option provides additional information about the devices, including the vendor and device IDs, subsystem IDs, and more.
|
||||
• The `-vv` option provides even more detailed information, including the device’s capabilities, IRQ settings, and ASPM (Active State Power Management) settings.
|
||||
|
||||
For example, to show the [ASPM](../hardware/aspm.md) settings for the [PCI Express](../hardware/pci-express.md) device with bus address 00:1c.0, you can run the following command:
|
||||
|
||||
```sh
|
||||
$ lspci -s 00:1c.0 -vv | grep -i aspm
|
||||
ASPM L1 Enabled; L0s Enabled
|
||||
```
|
||||
|
||||
---
|
||||
## Most useful commands
|
||||
|
||||
| Command | Description |
|
||||
| ------- | ----------- |
|
||||
| `lspci` | List all PCI devices in the system. |
|
||||
| `lspci -v` | List all PCI devices in the system with verbose output, including vendor and device IDs, subsystem IDs, and more. |
|
||||
| `lspci -vv` | List all PCI devices in the system with very verbose output, including device capabilities, IRQ settings, and ASPM (Active State Power Management) settings. |
|
||||
| `lspci -s <bus_address>` | Display information for a specific PCI device with the specified bus address. |
|
||||
| `lspci -k` | Show kernel driver in use for each device. |
|
||||
| `lspci -n` | Show numeric IDs for vendor and device instead of names. |
|
||||
| `lspci -nn` | Show numeric IDs for vendor, device, subsystem vendor, and subsystem device instead of names. |
|
||||
| `lspci -t` | Display a tree-like diagram of the PCI bus hierarchy. |
|
||||
| `lspci -D` | Show only PCI devices that are not behind a bridge. |
|
||||
| `lspci -H1` | Show device numbers in hexadecimal format instead of decimal. |
|
||||
| `lspci -x` | Show hex dump of the PCI configuration space for each device. |
|
||||
|
||||
@@ -0,0 +1,169 @@
|
||||
# LVM2 (Logical Volume Manager 2)
|
||||
|
||||
**LVM2 (Logical Volume Manager 2)** is a utility for managing disk storage in [Linux](linux.md). It allows you to manage disk space efficiently by abstracting physical storage devices into logical volumes. It provides features like volume resizing, snapshotting, and striping, making it flexible and scalable for various storage needs.
|
||||
|
||||
1. Physical Volume: Represents the physical storage devices (e.g., hard drives, SSDs) that are part of the storage pool managed by LVM.
|
||||
|
||||
2. Volume Group: Combines multiple physical volumes into a unified storage pool, enabling easy management and allocation of logical volumes.
|
||||
|
||||
3. Logical Volume: Serves as a virtual disk that can be used for various purposes, such as creating partitions, mounting file systems, or even setting up RAID configurations.
|
||||
|
||||
4. File System: Represents the data organization and access methods used to store and retrieve data on a logical volume. Common file systems include EXT4, XFS, and Btrfs.
|
||||
|
||||
## Physical Volume (PV)
|
||||
|
||||
A Physical Volume (PV) in LVM is a physical storage device or partition used by LVM. It is a building block for creating Volume Groups and Logical Volumes, allowing you to manage storage efficiently. This command creates the PV on the devices, you can do multiple at a time.
|
||||
|
||||
```bash
|
||||
sudo pvcreate /dev/Device /dev/Device2
|
||||
```
|
||||
|
||||
The `pvdisplay` command provides a output for each physical volume. It displays physical properties like size, extents, volume group, and so on in a fixed format.
|
||||
|
||||
```bash
|
||||
sudo pvdisplay
|
||||
```
|
||||
|
||||
The pvscan command scans all physical volumes (PVs) on the system and displays information about them.
|
||||
|
||||
```bash
|
||||
sudo pvscan
|
||||
```
|
||||
|
||||
Moves the allocated physical extents from one physical volume to another. Useful when you need to redistribute space between physical volumes in a volume group. After a crash or power failure this can be finished without a problem.
|
||||
|
||||
```bash
|
||||
sudo pvmove /dev/source_device /dev/target_device
|
||||
```
|
||||
|
||||
## Volume Group (VG)
|
||||
|
||||
A Volume Group (VG) in LVM is a collection of one or more Physical Volumes (PVs) combined into a single storage pool. It allows flexible and efficient management of disk space, enabling easy allocation to Logical Volumes (LVs) as needed.
|
||||
|
||||
Creates a volume group with a specified name.
|
||||
|
||||
```bash
|
||||
sudo vgcreate Volume_Name /dev/Device1 /dev/Device2 ...
|
||||
```
|
||||
|
||||
The `vgdisplay` command displays volume group properties (such as size, extents, number of physical volumes, and so on) in a fixed form.
|
||||
|
||||
```bash
|
||||
sudo vgdisplay
|
||||
```
|
||||
|
||||
The `vgs` command provides volume group information in a configurable form, displaying one line per volume group. The `vgs` command provides a great deal of format control, and is useful for scripting.
|
||||
|
||||
```bash
|
||||
sudo vgs
|
||||
```
|
||||
|
||||
## Logical Volume (LV)
|
||||
|
||||
A logical volume in LVM is a flexible virtual partition that separates storage management from physical disks. This creates a logical volume out of the Volume Group with the specified name and size (5GB).
|
||||
|
||||
```bash
|
||||
sudo lvcreate -n Volume -L 5g Group
|
||||
```
|
||||
|
||||
Extends the logical volume by all the available space from the volume group. U can also extend it to a fixed size if u don't use the `+`.
|
||||
|
||||
```bash
|
||||
sudo lvextend -L +100%FREE Group/Volume
|
||||
```
|
||||
|
||||
Same as above but in the other direction.
|
||||
|
||||
```bash
|
||||
sudo lvreduce -L -5g Group/Volume
|
||||
```
|
||||
|
||||
This is how u rename a logical volume.
|
||||
|
||||
```bash
|
||||
sudo lvrename /dev/Group/old_LV_name new_LV_name
|
||||
```
|
||||
|
||||
This removes a logical volume. Use this command with extreme caution, as it will permanently delete the data on the logical volume.
|
||||
|
||||
```bash
|
||||
sudo lvremove /dev/Group/Volume
|
||||
```
|
||||
|
||||
The `lvs` command provides logical volume information in a configurable form, displaying one line per logical volume. The `lvs` command provides a great deal of format control, and is useful for scripting.
|
||||
|
||||
```bash
|
||||
sudo lvs
|
||||
```
|
||||
|
||||
The `lvdisplay` command displays logical volume properties (such as size, layout, and mapping) in a fixed format.
|
||||
|
||||
```bash
|
||||
sudo lvdisplay
|
||||
```
|
||||
|
||||
### File System
|
||||
|
||||
After extending a logical volume, use this command to expand the file system to use the new space.
|
||||
|
||||
```bash
|
||||
sudo resize2fs /dev/Group/Volume
|
||||
```
|
||||
|
||||
## Snapshots
|
||||
|
||||
Snapshots in LVM are copies of a logical volume at a specific time, useful for backups and data recovery. This creates a snapshot named "snap" with 5GB. Snapshots store only the changes made since their creation and are independent of the original volume.
|
||||
|
||||
```bash
|
||||
sudo lvcreate -s -n snap -L 5g Group/Volume
|
||||
```
|
||||
|
||||
Merges the snapshot with the original volume. Useful after a faulty update; requires a reboot.
|
||||
|
||||
```bash
|
||||
sudo lvconvert --merge Group/snap
|
||||
```
|
||||
|
||||
## Cache
|
||||
|
||||
This creates a cache logical volume with the "writethrough" cache mode using 100% of the free space. Caching improves disk read/write performance. Writethrough ensures that any data written will be stored both in the cache and on the origin LV. The loss of a device associated with the cache in this case would not mean the loss of any data. A second cache mode is "writeback". Writeback delays writing data blocks from the cache back to the origin LV.
|
||||
|
||||
```bash
|
||||
sudo lvcreate --type cache --cachemode writethrough -l 100%FREE -n root_cachepool MyVolGroup/rootvol /dev/fastdisk
|
||||
```
|
||||
|
||||
This removes the cache from the specified logical volume.
|
||||
|
||||
```bash
|
||||
sudo lvconvert --uncache MyVolGroup/rootvol
|
||||
```
|
||||
|
||||
## RAID
|
||||
|
||||
> LVM Is Using md Under the Hood
|
||||
|
||||
This configuring below will still use "md" behind the scenes. It just saves you the trouble of using "mdadm".
|
||||
|
||||
#### RAID 0
|
||||
|
||||
RAID 0 is a data storage configuration that stripes data across multiple drives to improve performance, but offers no data redundancy, meaning a single drive failure can result in data loss. This creates a RAID 0 logical volume with a specified name using 100% of the free space in the volume group, with the specified stripe size (2GB).
|
||||
|
||||
```bash
|
||||
sudo lvcreate -i Stripes -I 2G -l 100%FREE -n Volume Group
|
||||
```
|
||||
|
||||
#### RAID 1
|
||||
|
||||
RAID 1 is a data storage configuration that mirrors data across multiple drives for data redundancy, providing fault tolerance in case of drive failure but without the performance improvement of RAID 0. This creates a RAID 1 logical volume with a specified name using 100% of the free space in the volume group. The `--nosync` option skips initial sync.
|
||||
|
||||
```bash
|
||||
sudo lvcreate --mirrors 1 --type raid1 -l 100%FREE --nosync -n Volume VGName
|
||||
```
|
||||
|
||||
#### RAID 5
|
||||
|
||||
RAID 5 is a data storage configuration that combines striping and parity to provide both performance improvement and data redundancy, allowing for continued data access even if a single drive fails. This creates a RAID 5 logical volume with a specified name using 100% of the free space in the volume group. RAID 5 offers both data striping and parity for fault tolerance.
|
||||
|
||||
```bash
|
||||
sudo lvcreate --type raid5 -l 100%FREE -n LVName VGName
|
||||
```
|
||||
@@ -0,0 +1,14 @@
|
||||
# Mount
|
||||
In **Linux ([[linux]])**, mount is a command in various operating systems. Before a user can access a file on a Unix-like machine, the file system on the device which contains the file needs to be mounted with the mount command. Frequently mount is used for SD card, USB storage, DVD and other removable storage devices.
|
||||
|
||||
---
|
||||
List mount-points
|
||||
```
|
||||
findmnt (optional)<device/directory>
|
||||
```
|
||||
|
||||
Unmount
|
||||
```
|
||||
umount <device/directory>
|
||||
```
|
||||
|
||||
@@ -0,0 +1,149 @@
|
||||
# Netplan
|
||||
|
||||
Netplan is a utility for configuring network interfaces in modern versions of [Ubuntu](distros/ubuntu.md) and other Linux distributions. Netplan generates the corresponding configuration files for the underlying network configuration subsystem, such as systemd-networkd or NetworkManager.
|
||||
|
||||
---
|
||||
## How to use
|
||||
|
||||
Netplan uses YAML configuration files in the `/etc/netplan/` to describe network interfaces, IP addresses, routes, and other network-related parameters.
|
||||
|
||||
**Example: `/etc/netplan/01-netcfg.yaml`**
|
||||
```yaml
|
||||
network:
|
||||
version: 2
|
||||
renderer: networkd
|
||||
ethernets:
|
||||
enp0s3:
|
||||
dhcp4: true
|
||||
```
|
||||
|
||||
This configuration sets up a DHCP client for the `enp0s3` Ethernet interface, using the systemd-networkd renderer.
|
||||
|
||||
To apply this configuration, run the following command.
|
||||
|
||||
```sh
|
||||
sudo netplan apply.
|
||||
```
|
||||
|
||||
You can also test a new Netplan configuration without applying it permanently. This is useful if you want to try out a new network configuration without disrupting your current network connection.
|
||||
|
||||
```sh
|
||||
sudo netplan try
|
||||
```
|
||||
|
||||
---
|
||||
## Static IP addresses
|
||||
|
||||
To define a static IP address in Netplan, you can use the addresses key in the configuration file for the relevant network interface. Here’s an example configuration file that sets a static IP address of 192.168.1.10 with a net mask of 24 bits for the `enp0s3` Ethernet interface:
|
||||
|
||||
```yaml
|
||||
network:
|
||||
version: 2
|
||||
renderer: networkd
|
||||
ethernets:
|
||||
enp0s3:
|
||||
addresses:
|
||||
- 192.168.1.10/24
|
||||
gateway4: 192.168.1.1
|
||||
nameservers:
|
||||
addresses: [8.8.8.8, 8.8.4.4]
|
||||
```
|
||||
|
||||
In this configuration, the addresses key sets the static IP address and net mask for the `enp0s3` interface. The gateway4 key sets the default gateway, and the nameserver's key sets the DNS servers.
|
||||
|
||||
---
|
||||
## VLANs
|
||||
|
||||
**Example 1: Simple VLAN configuration**
|
||||
```yaml
|
||||
network:
|
||||
version: 2
|
||||
renderer: networkd
|
||||
ethernets:
|
||||
enp0s3:
|
||||
dhcp4: true
|
||||
vlans:
|
||||
vlan10:
|
||||
id: 10
|
||||
link: enp0s3
|
||||
dhcp4: true
|
||||
```
|
||||
|
||||
In this configuration, the `enp0s3` Ethernet interface is configured to use DHCP to obtain an IP address. A VLAN with ID 10 is also configured on the `enp0s3` interface, and DHCP is enabled for this VLAN as well. The link key specifies that the VLAN is associated with the `enp0s3` interface.
|
||||
|
||||
**Example 2: Advanced VLAN configuration**
|
||||
```yaml
|
||||
network:
|
||||
version: 2
|
||||
renderer: networkd
|
||||
ethernets:
|
||||
enp0s3:
|
||||
dhcp4: true
|
||||
vlans:
|
||||
vlan10:
|
||||
id: 10
|
||||
link: enp0s3
|
||||
addresses:
|
||||
- 192.168.10.2/24
|
||||
routes:
|
||||
- to: 0.0.0.0/0
|
||||
via: 192.168.10.1
|
||||
nameservers:
|
||||
addresses: [8.8.8.8, 8.8.4.4]
|
||||
```
|
||||
|
||||
In this configuration, a VLAN with ID 10 is configured on the `enp0s3` interface, and a static IP address of `192.168.10.2` with a net mask of `24` bits is assigned to the VLAN interface. The routes key specifies a default route via the gateway at `192.168.10.1`. The nameserver's key sets the DNS servers to `8.8.8.8` and `8.8.4.4`.
|
||||
|
||||
## Bridges and Bonding
|
||||
|
||||
Bridging and bonding are two techniques used to combine multiple network interfaces into a single logical interface.
|
||||
|
||||
### Bonding
|
||||
|
||||
Bonding involves combining two or more physical interfaces into a single logical interface, called a bond interface. The bond interface acts like a single network interface, providing higher bandwidth and redundancy. Bonding is often used in high-performance computing environments, where multiple network interfaces are required to handle the high volume of network traffic.
|
||||
|
||||
Example 1: Bonding configuration
|
||||
```yaml
|
||||
network:
|
||||
version: 2
|
||||
renderer: networkd
|
||||
ethernets:
|
||||
enp0s3:
|
||||
dhcp4: true
|
||||
enp0s4:
|
||||
dhcp4: true
|
||||
bonds:
|
||||
bond0:
|
||||
interfaces:
|
||||
- enp0s3
|
||||
- enp0s4
|
||||
dhcp4: true
|
||||
parameters:
|
||||
mode: active-backup
|
||||
```
|
||||
|
||||
In this configuration, two Ethernet interfaces (enp0s3 and enp0s4) are configured with DHCP to obtain IP addresses. A bond interface (bond0) is also configured, which combines the two Ethernet interfaces into a single logical interface. The interfaces key specifies the physical interfaces to include in the bond, and the mode key specifies the bonding mode (in this case, active-backup).
|
||||
|
||||
### Bridging
|
||||
|
||||
Bridging involves creating a bridge interface that connects two or more physical interfaces. The bridge interface acts like a virtual switch, allowing devices connected to any of the physical interfaces to communicate with each other as if they were on the same network segment. Bridging is often used to connect two separate network segments or to provide redundancy in case one physical interface fails.
|
||||
|
||||
Example 2: Bridging configuration
|
||||
```yaml
|
||||
network:
|
||||
version: 2
|
||||
renderer: networkd
|
||||
ethernets:
|
||||
enp0s3:
|
||||
dhcp4: true
|
||||
enp0s4:
|
||||
dhcp4: true
|
||||
bridges:
|
||||
br0:
|
||||
interfaces:
|
||||
- enp0s3
|
||||
- enp0s4
|
||||
dhcp4: true
|
||||
```
|
||||
|
||||
In this configuration, two Ethernet interfaces (enp0s3 and enp0s4) are configured with DHCP to obtain IP addresses. A bridge interface (br0) is also configured, which combines the two Ethernet interfaces into a single logical interface. The interfaces key specifies the physical interfaces to include in the bridge.
|
||||
Executable
+23
@@ -0,0 +1,23 @@
|
||||
# NFS
|
||||
Network File System (NFS) is a distributed file system protocol originally developed by Sun Microsystems (Sun), available in **Linux ([[linux]])**, allowing a user on a client computer to access files over a computer network much like local storage is accessed. NFS, like many other protocols, builds on the Open Network Computing Remote Procedure Call (ONC RPC) system. NFS is an open IETF standard defined in a Request for Comments (RFC), allowing anyone to implement the protocol.
|
||||
|
||||
---
|
||||
## Install NFS
|
||||
Install NFS Client on Ubuntu
|
||||
```
|
||||
sudo apt -y update
|
||||
sudo apt -y install nfs-common
|
||||
```
|
||||
|
||||
## Client Configuration
|
||||
|
||||
|
||||
## Server Configuration
|
||||
### Configuration
|
||||
*TEMP EXAMPLE*:
|
||||
`/srv/nfs 192.168.1.2(rw,sync,no_root_squash,subtree_check)`
|
||||
|
||||
### root rw permissions
|
||||
Note the **root_squash** mount option. This option is set by default and must be disabled if not wanted.
|
||||
*Fix:* enable `no_root_squash`in the `/etc/exports` file and reload the permissions with `sudo exportfs -ra`
|
||||
|
||||
Executable
+8
@@ -0,0 +1,8 @@
|
||||
# SED Cheat-Sheet
|
||||
**sed** ("stream editor") is a **Linux ([[linux]])**, and Unix utility that parses and transforms text, using a simple, compact programming language.
|
||||
|
||||
TMP
|
||||
replace pattern:
|
||||
```
|
||||
sed -i 's/Steven/Kate/' file
|
||||
```
|
||||
@@ -0,0 +1,113 @@
|
||||
Use UFW to lock down an Ubuntu server
|
||||
Any server on the public internet is bound to be attacked by bots looking for weak or leaked passwords and unsafely configured services. Even security experts can misconfigure a database, or an unwitting member of the team can accidentally open up a vulnerability, leaving your devices or network open to attack.
|
||||
If you have an existing server, you can view this bot traffic by running sudo less /var/log/auth.log. If your server is like many on the web, you'll see lots of "invalid user admin" or "invalid user test".
|
||||
Tailscale simplifies network security by letting you keep your servers away from the public web, while keeping it easy to connect.
|
||||
The best way to secure a server with Tailscale is to accept connections from Tailscale, and ignore any public internet traffic. Since your Tailscale network is invisible, except to those in your network, attackers won't even be able to find it.
|
||||
Prerequisites
|
||||
|
||||
Before you begin this guide, you'll need an Ubuntu server to secure. This guide assumes you're setting up a DigitalOcean Ubuntu 18.04 server, but the steps should be similar for most hosting providers and versions of Ubuntu.
|
||||
You’ll also need a Tailscale network, known as a tailnet. For information about creating a tailnet, see the Tailscale quickstart.
|
||||
Next, you'll need to install the Tailscale client on your local machine and log in.
|
||||
Download Tailscale
|
||||
We'll follow the same steps on the Ubuntu server next.
|
||||
Step 1: ssh into your new Ubuntu server
|
||||
|
||||
After spinning up a new server, ssh into it with your account details.
|
||||
|
||||
ssh <username>@<server host ip>
|
||||
Step 2: Install Tailscale on your Ubuntu server
|
||||
|
||||
Install Tailscale using the one-line script below, or read our detailed install instructions for Ubuntu
|
||||
|
||||
curl -fsSL https://tailscale.com/install.sh | sh
|
||||
Authenticate and connect your machine to your Tailscale network
|
||||
|
||||
sudo tailscale up
|
||||
(Optional) If you signed in with a custom domain (not a @gmail.com address) visit the admin console and authorize your new endpoint.
|
||||
(Optional) Disable key expiry for this server
|
||||
As a security feature, Tailscale requires periodic reauthentication. To prevent getting locked out, you may want to disable expiry on certain endpoints, such as this trusted server. Disable key expiry by following these instructions.
|
||||
If you leave key expiry on, be familiar with how to regain server access. For example, DigitalOcean provides access via a droplet console.
|
||||
Step 3: ssh over Tailscale
|
||||
|
||||
An important step — since we're about to restrict ssh access to be only over Tailscale, we'll exit the machine and re-ssh with our Tailscale IP.
|
||||
First, find and copy your machine's Tailscale IP. The easiest way to do this is to run
|
||||
|
||||
tailscale ip -4
|
||||
And copy the 100.x.y.z shown.
|
||||
Once you've found it, exit your ssh session, and start a new one with your newly copied Tailscale IP.
|
||||
|
||||
ssh <username>@<copied 100.x.y.z address>
|
||||
Step 4: Enable UFW
|
||||
|
||||
For this guide, we'll use UFW (Uncomplicated Firewall) to restrict non-Tailscale traffic to our server. It comes pre-installed on Ubuntu 18.04, so no installation is needed.
|
||||
Before we continue editing rules, you'll need to enable UFW if it isn't already enabled.
|
||||
|
||||
sudo ufw enable
|
||||
Step 5: Restrict all other traffic
|
||||
|
||||
Next, we'll set up rules to reject all incoming non-Tailscale traffic, and allow all outgoing traffic by default.
|
||||
|
||||
sudo ufw default deny incoming
|
||||
sudo ufw default allow outgoing
|
||||
Now that we've set these defaults check your existing firewall rules you might need to keep.
|
||||
|
||||
sudo ufw status
|
||||
You might see a list of firewall rules, like this:
|
||||
|
||||
To Action From
|
||||
-- ------ ----
|
||||
22/tcp ALLOW IN Anywhere
|
||||
80/tcp ALLOW IN Anywhere
|
||||
443/tcp ALLOW IN Anywhere
|
||||
Anywhere on tailscale0 ALLOW IN Anywhere
|
||||
22/tcp (v6) ALLOW IN Anywhere (v6)
|
||||
80/tcp (v6) ALLOW IN Anywhere (v6)
|
||||
443/tcp (v6) ALLOW IN Anywhere (v6)
|
||||
Anywhere (v6) on tailscale0 ALLOW IN Anywhere (v6)
|
||||
All other connections are denied by default and so not listed above. We want to limit this list to the minimum set needed.
|
||||
To completely lock down your server while retaining ssh access, you could delete every rule except for the "Anywhere on tailscale0" rule.
|
||||
For the example above, we'll delete all "22/tcp" rules, which will remove the ability to ssh over regular connections:
|
||||
|
||||
sudo ufw delete 22/tcp
|
||||
Now, only "Anywhere on tailscale0" remains, meaning ssh can only occur over Tailscale.
|
||||
|
||||
To Action From
|
||||
-- ------ ----
|
||||
80/tcp ALLOW Anywhere
|
||||
443/tcp ALLOW Anywhere
|
||||
Anywhere on tailscale0 ALLOW IN Anywhere
|
||||
80/tcp (v6) ALLOW Anywhere (v6)
|
||||
443/tcp (v6) ALLOW Anywhere (v6)
|
||||
Anywhere (v6) on tailscale0 ALLOW IN Anywhere (v6)
|
||||
If you expose a public web service (80/tcp, 443/tcp), you'll want to keep those rules around. For less public services like FTP (21/tcp) or a database, consider connecting devices that rely on those services over Tailscale too.
|
||||
This guide assumes ssh is running on the default port, port 22. If you've changed your ssh port, you may need to change these instructions as well.
|
||||
Step 6: Restart ufw and ssh
|
||||
|
||||
Once you've set up firewall rules to restrict all non-Tailscale connections, restart ufw and ssh
|
||||
|
||||
sudo ufw reload
|
||||
sudo service ssh restart
|
||||
Done! Now your server will ignore any ssh requests that don't come from users authenticated to your private Tailscale network.
|
||||
Step 7: Test and verify
|
||||
|
||||
Let's make sure that everything is working as expected.
|
||||
First, let's exit the existing ssh session.
|
||||
Then, let's try to connect with the public IP address from earlier.
|
||||
You should see that we're not able to connect, and the operation times out.
|
||||
|
||||
ssh <username>@<server host ip>
|
||||
ssh: connect to host <server host ip> port 22: Operation timed out
|
||||
Now, let's try to ssh in using the Tailscale IP address (starting with 100.x.y.z) from earlier.
|
||||
|
||||
ssh <username>@<copied 100.x.y.z address>
|
||||
We're able to connect! Everything is working as expected. exit the ssh connection again.
|
||||
This time, quit the Tailscale client on your local machine.
|
||||
If you try to ssh to the Ubuntu server again, you'll see that the operation now times out and we are no longer able to connect.
|
||||
|
||||
ssh <username>@<copied 100.x.y.z address>
|
||||
ssh: connect to host <copied 100.x.y.z address> port 22: Operation timed out
|
||||
We've now verified that we can only connect when we're successfully authenticated to the Tailscale client running on our local machine.
|
||||
Optional: enable multi-factor authentication (MFA) for all ssh connections
|
||||
|
||||
Now that your server can only be accessed via Tailscale, you can enforce login rules in using your Tailscale network's identity provider, knowing they will apply to all your ssh connections too.
|
||||
For example, you may want to configure your identity provider to require multi-factor authentication (MFA) for every sign-in.
|
||||
@@ -0,0 +1,28 @@
|
||||
# UFW (uncomplicated firewall)
|
||||
UFW (uncomplicated firewall) is a firewall configuration tool for **Linux ([[linux]])** that runs on top of IPTables ([[iptables]]), included by default within Ubuntu distributions. It provides a streamlined interface for configuring common firewall use cases via the command line.
|
||||
|
||||
## Enable UFW
|
||||
|
||||
To check if ufw is enabled, run:
|
||||
```bash
|
||||
sudo ufw status
|
||||
```
|
||||
|
||||
To enable UFW on your system, run:
|
||||
```bash
|
||||
sudo ufw enable
|
||||
```
|
||||
|
||||
If for some reason you need to disable UFW, you can do so with the following command:
|
||||
```bash
|
||||
sudo ufw disable
|
||||
```
|
||||
|
||||
Block an IP Address
|
||||
|
||||
## Block an IP Address/Subnet
|
||||
|
||||
```bash
|
||||
sudo ufw deny from 203.0.113.0/24
|
||||
```
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
# User Management
|
||||
|
||||
COMMAND | DESCRIPTION
|
||||
---|---
|
||||
`sudo adduser username` | Create a new user
|
||||
`sudo userdel username` | Delete a user
|
||||
`sudo usermod -aG groupname username` | Add a user to group
|
||||
`sudo deluser username groupname` | Remove a user from a group
|
||||
@@ -0,0 +1,225 @@
|
||||
# MacOS keyboard shortcuts
|
||||
|
||||
# Table of contents
|
||||
- [MacOS keyboard shortcuts](#macos-keyboard-shortcuts)
|
||||
- [Table of contents](#table-of-contents)
|
||||
- [Mac Keyboard Modifier keys](#mac-keyboard-modifier-keys)
|
||||
- [Cut, copy, paste, and other common shortcuts](#cut-copy-paste-and-other-common-shortcuts)
|
||||
- [Sleep, log out, and shut down shortcuts](#sleep-log-out-and-shut-down-shortcuts)
|
||||
- [Finder and system shortcuts](#finder-and-system-shortcuts)
|
||||
- [Document shortcuts](#document-shortcuts)
|
||||
|
||||
## Mac Keyboard Modifier keys
|
||||
| key | description |
|
||||
| :--- | :------------- |
|
||||
| ⌘ | ⌘ + / Cmd |
|
||||
| ⌃ | Control / Ctrl |
|
||||
| ⌥ | ⌥ + s / Alt |
|
||||
| ⇧ | Shift |
|
||||
| ⇪ | Caps Lock |
|
||||
| Fn | Function key |
|
||||
|
||||
_- On Windows keyboards use the Alt key instead of ⌥ + , and the Windows logo key instead of ⌘ + ._
|
||||
|
||||
|
||||
|
||||
## Cut, copy, paste, and other common shortcuts
|
||||
|
||||
| keys | description |
|
||||
| :------------ | :------------------------------------------------------------------------------------------------------------ |
|
||||
| ⌘ + x | Cut the selected item and copy it to the Clipboard |
|
||||
| ⌘ + c | Copy the selected item to the Clipboard. This also works for files in the Finder |
|
||||
| ⌘ + v | Paste the contents of the Clipboard into the current document or app. This also works for files in the Finder |
|
||||
| ⌘ + z | Undo the previous comamnd |
|
||||
| ⇧ + ⌘ + z | Redo, reversing the undo command |
|
||||
| ⌘ + a | Select All items |
|
||||
| ⌘ + f | Find items in a document or open a Find window |
|
||||
| ⌘ + g | Find Again: Find the next occurrence of the item previously found |
|
||||
| ⇧ + ⌘ + G | Find the previous occurrence |
|
||||
| ⌘ + h | Hide the windows of the front app |
|
||||
| ⌥ + ⌘ + h | View the front app but hide all other apps |
|
||||
| ⌘ + m | Minimize the front window to the Dock |
|
||||
| ⌥ + ⌘ + m | Minimize all windows of the front app |
|
||||
| ⌘ + o | Open the selected item, or open a dialog to select a file to open |
|
||||
| ⌘ + p | Print the current document |
|
||||
| ⌘ + s | Save the current document |
|
||||
| ⌘ + t | Open a new tab |
|
||||
| ⌘ + w | Close the front window |
|
||||
| ⌥ + ⌘ + w | Close all windows of the app |
|
||||
| ⌥ + ⌘ + Esc | Force quit an app |
|
||||
| ⌘ + Space | Show or hide the Spotlight search field |
|
||||
| ⌘ + ⌥ + Space | Perform a Spotlight search from a Finder window |
|
||||
| ⌃ + ⌘ + Space | Show the Character Viewer, from which you can choose emoji and other symbols |
|
||||
| ⌃ + ⌘ + f | Use the app in full screen, if supported by the app |
|
||||
| Space | Use Quick Look to preview the selected item |
|
||||
| ⌘ + Tab | Switch to the next most recently used app among your open apps |
|
||||
| ⇧ + ⌘ + 5 | In macOS Mojave or later, take a screenshot or make a screen recording |
|
||||
| ⇧ + ⌘ + 3 | Take whole display screenshot |
|
||||
| ⇧ + ⌘ + 4 | Take custom screenshot |
|
||||
| ⇧ + ⌘ + n | Create a new folder in the Finder |
|
||||
| ⌘ + , | Open preferences for the front app |
|
||||
|
||||
|
||||
## Sleep, log out, and shut down shortcuts
|
||||
_* You might need to press and hold some of these shortcuts for slightly longer than other shortcuts. This helps you to avoid using them unintentionally._
|
||||
|
||||
| keys | description |
|
||||
| :---------------- | :---------------------------------------------------------------------------------- |
|
||||
| Power button | Press to turn on your Mac or wake it from sleep |
|
||||
| Power button | Press and hold for 1.5 seconds to put your Mac to sleep |
|
||||
| Power button | Press and continue holding to force your Mac to turn off |
|
||||
| ⌥ + ⌘ + Power | Put your Mac to sleep |
|
||||
| ⌥ + ⌘ + Eject | Put your Mac to sleep |
|
||||
| ⌃ + ⇧ + Power | Put your displays to sleep |
|
||||
| ⌃ + ⇧ + Eject | Put your displays to sleep |
|
||||
| ⌃ + Power | Display a dialog asking whether you want to restart, sleep, or shut down |
|
||||
| ⌃ + Eject | Display a dialog asking whether you want to restart, sleep, or shut down |
|
||||
| ⌃ + ⌘ + Power | Force your Mac to restart, without prompting to save any open and unsaved documents |
|
||||
| ⌃ + ⌘ + Eject | Quit all apps, then restart your Mac |
|
||||
| ⌃ + ⌥ + ⌘ + Power | Quit all apps, then shut down your Mac |
|
||||
| ⌃ ⌥ + ⌘ + Eject | Quit all apps, then shut down your Mac |
|
||||
| ⌃ + ⌘ + q | Immediately lock your screen |
|
||||
| ⇧ + ⌘ + q | Log out of your macOS user account. You will be asked to confirm |
|
||||
| ⌥ + ⇧ + ⌘ + q | Log out immediately without confirming |
|
||||
|
||||
|
||||
## Finder and system shortcuts
|
||||
| keys | description |
|
||||
| :------------------------------ | :----------------------------------------------------------------------------------------- |
|
||||
| ⌘ + d | Duplicate the selected files |
|
||||
| ⌘ + e | Eject the selected disk or volume |
|
||||
| ⌘ + f | Start a Spotlight search in the Finder window |
|
||||
| ⌘ + i | Show the Get Info window for a selected file |
|
||||
| ⌘ + r | (1) When an alias is selected in the Finder: show the original file for the selected alias |
|
||||
| ⌘ + r | (2) In some apps, such as Calendar or Safari, refresh or reload the page |
|
||||
| ⌘ + r | (3) In Software Update preferences, check for software updates again |
|
||||
| ⇧ + ⌘ + c | Open the Computer window |
|
||||
| ⇧ + ⌘ + d | Open the desktop folder |
|
||||
| ⇧ + ⌘ + f | Open the Recents window, showing all of the files you viewed or changed recently |
|
||||
| ⇧ + ⌘ + g | Open a Go to Folder window |
|
||||
| ⇧ + ⌘ + h | Open the Home folder of the current macOS user account |
|
||||
| ⇧ + ⌘ + i | Open iCloud Drive |
|
||||
| ⇧ + ⌘ + k | Open the Network window |
|
||||
| ⌥ + ⌘ + l | Open the Downloads folder |
|
||||
| ⇧ + ⌘ + n | Create a new folder |
|
||||
| ⇧ + ⌘ + o | Open the Documents folder |
|
||||
| ⇧ + ⌘ + p | Show or hide the Preview pane in Finder windows |
|
||||
| ⇧ + ⌘ + r | Open the AirDrop window |
|
||||
| ⇧ + ⌘ + t | Show or hide the tab bar in Finder windows |
|
||||
| ⌃ + ⇧ + ⌘ + t | Add selected Finder item to the Dock (OS X Mavericks or later) |
|
||||
| ⇧ + ⌘ + u | Open the Utilities folder |
|
||||
| ⌥ + ⌘ + d | Show or hide the Dock |
|
||||
| ⌃ + ⌘ + t | Add the selected item to the sidebar (OS X Mavericks or later) |
|
||||
| ⌥ + ⌘ + p | Hide or show the path bar in Finder windows |
|
||||
| ⌥ + ⌘ + s | Hide or show the Sidebar in Finder windows |
|
||||
| ⌘ + / | Hide or show the status bar in Finder windows |
|
||||
| ⌘ + j | Show View Options |
|
||||
| ⌘ + k | Open the Connect to Server window |
|
||||
| ⌃ + ⌘ + a | Make an alias of the selected item |
|
||||
| ⌘ + n | Open a new Finder window |
|
||||
| ⌥ + ⌘ + n | Create a new Smart Folder |
|
||||
| ⌘ + t | Show or hide the tab bar when a single tab is open in the current Finder window |
|
||||
| ⌥ + ⌘ + t | Show or hide the toolbar when a single tab is open in the current Finder window |
|
||||
| ⌥ + ⌘ + v | Move the files in the Clipboard from their original location to the current location |
|
||||
| ⌘ + y | Use Quick Look to preview the selected files |
|
||||
| ⌥ + ⌘ + v | View a Quick Look slideshow of the selected files |
|
||||
| ⌘ + 1 | View the items in the Finder window as icons |
|
||||
| ⌘ + 2 | View the items in a Finder window as a list |
|
||||
| ⌘ + 3 | View the items in a Finder window in columns |
|
||||
| ⌘ + 4 | View the items in a Finder window in a gallery |
|
||||
| ⌘ + [ | Go to the previous folder |
|
||||
| ⌘ + ] | Go to the next folder |
|
||||
| ⌘ + ↑ | Open the folder that contains the current folder |
|
||||
| ⌃ + ⌘ + ↑ | Open the folder that contains the current folder in a new window |
|
||||
| ⌘ + ↓ | Open the selected item |
|
||||
| → | Open the selected folder. This works only when in list view |
|
||||
| ← | Close the selected folder. This works only when in list view |
|
||||
| ⌘ + Delete | Move the selected item to the Trash |
|
||||
| ⇧ + ⌘ + Delete | Empty the Trash |
|
||||
| ⌥ + ⇧ + ⌘ + Delete | Empty the Trash without confirmation dialog |
|
||||
| ⌘ + Brightness Down | Turn video mirroring on or off when your Mac is connected to more than one display |
|
||||
| ⌥ + Brightness Up | Open Displays preferences. This works with either Brightness key |
|
||||
| ⌃ + Brightness Up/Down | Adjust brightness of your external display, if supported by your display |
|
||||
| ⌥ + ⇧ + Brightness Up/Down | Adjust display brightness in smaller steps |
|
||||
| ⌃ + ⌥ + ⇧ + Brightness Up/Down | Adjust external display brightness in smaller steps, if supported by display |
|
||||
| ⌥ + Mission Control | Open Mission Control preferences |
|
||||
| ⌃ + Mission Control | Show the desktop |
|
||||
| ⌃ + ↓ | Show all windows of the front app |
|
||||
| ⌥ + Volume Up | Open Sound preferences. This works with any of the volume keys |
|
||||
| ⌥ + ⇧ + Volume up/Down | Adjust the sound volume in smaller steps |
|
||||
| ⌥ + Brightness Up | Open Keyboard preferences. This works with either Keyboard Brightness key |
|
||||
| ⌥ + ⇧ + Brightness Up/Down | Adjust the keyboard brightness in smaller steps |
|
||||
| ⌥ + double-clicking | Open the item in a separate window, then close the original window |
|
||||
| ⌘ + double-clicking | Open a folder in a separate tab or window |
|
||||
| ⌘ + dragging to another volume | Move the dragged item to the other volume, instead of copying it |
|
||||
| ⌥ + dragging | Copy the dragged item. The pointer changes while you drag the item |
|
||||
| ⌥ + ⌘ + while dragging | Make an alias of the dragged item. The pointer changes while you drag the item |
|
||||
| ⌥ + click a disclosure triangle | Open all folders within the selected folder. This works only when in list view |
|
||||
| ⌘ + click a window title | See the folders that contain the current folder |
|
||||
|
||||
|
||||
## Document shortcuts
|
||||
_*The behavior of these shortcuts may vary with the app you're using_
|
||||
|
||||
| keys | description |
|
||||
| :------------ | :--------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| ⌘ + b | Boldface the selected text, or turn boldfacing on or off |
|
||||
| ⌘ + i | Italicize the selected text, or turn italics on or off |
|
||||
| ⌘ + k | Add a web link |
|
||||
| ⌘ + u | Underline the selected text, or turn underlining on or off |
|
||||
| ⌘ + t | Show or hide the Fonts window |
|
||||
| ⌘ + d | Select the Desktop folder from within an Open dialog or Save dialog |
|
||||
| ⌃ + ⌘ + d | Show or hide the definition of the selected word |
|
||||
| ⇧ + ⌘ + : | Display the Spelling and Grammar window |
|
||||
| ⌘ + ; | Find misspelled words in the document |
|
||||
| ⌥ + Delete | Delete the word to the left of the insertion point |
|
||||
| ⌃ + h | Delete the character to the left of the insertion point. Or use Delete |
|
||||
| ⌃ + d | Delete the character to the right of the insertion point |
|
||||
| Fn + Delete | Forward delete on keyboards that don't have a Forward Delete key |
|
||||
| ⌃ + k | Delete the text between the insertion point and the end of the line or paragraph |
|
||||
| Fn + ↑ | Page Up: Scroll up one page |
|
||||
| Fn + ↓ | Page Down: Scroll down one page. |
|
||||
| Fn + ← | Home: Scroll to the beginning of a document. |
|
||||
| Fn + → | End: Scroll to the end of a document. |
|
||||
| ⌘ + ↑ | Move the insertion point to the beginning of the document |
|
||||
| ⌘ + ↓ | Move the insertion point to the end of the document. |
|
||||
| ⌘ + ← | Move the insertion point to the beginning of the current line. |
|
||||
| ⌘ + → | Move the insertion point to the end of the current line. |
|
||||
| ⌥ + ← | Move the insertion point to the beginning of the previous word |
|
||||
| ⌥ + → | Move the insertion point to the end of the next word |
|
||||
| ⇧ + ⌘ + ↑ | Select the text between the insertion point and the beginning of the document |
|
||||
| ⇧ + ⌘ + ↓ | Select the text between the insertion point and the end of the document |
|
||||
| ⇧ + ⌘ + ← | Select the text between the insertion point and the beginning of the current line |
|
||||
| ⇧ + ⌘ + → | Select the text between the insertion point and the end of the current line |
|
||||
| ⇧ + ↑ | Extend text selection to the nearest character at the same horizontal location on the line above |
|
||||
| ⇧ + ↓ | Extend text selection to the nearest character at the same horizontal location on the line below |
|
||||
| ⇧ + ← | Extend text selection one character to the left |
|
||||
| ⇧ + → | Extend text selection one character to the right |
|
||||
| ⌥ + ⇧ + ↑ | Extend text selection to the beginning of the current paragraph, then to the beginning of the following paragraph if pressed again |
|
||||
| ⌥ + ⇧ + ↓ | Extend text selection to the end of the current paragraph, then to the end of the following paragraph if pressed again |
|
||||
| ⌥ + ⇧ + ← | Extend text selection to the beginning of the current word, then to the beginning of the following word if pressed again |
|
||||
| ⌥ + ⇧ + → | Extend text selection to the end of the current word, then to the end of the following word if pressed again |
|
||||
| ⌃ + a | Move to the beginning of the line or paragraph |
|
||||
| ⌃ + e | Move to the end of a line or paragraph |
|
||||
| ⌃ + f | Move one character forward |
|
||||
| ⌃ + b | Move one character backward |
|
||||
| ⌃ + l | Center the cursor or selection in the visible area |
|
||||
| ⌃ + p | Move up one line |
|
||||
| ⌃ + n | Move down one line |
|
||||
| ⌃ + o | Insert a new line after the insertion point |
|
||||
| ⌃ + t | Swap the character behind the insertion point with the character in front of the insertion point |
|
||||
| ⌘ + { | Left align |
|
||||
| ⌘ + } | Right align |
|
||||
| ⇧ + ⌘ + \| | Center align |
|
||||
| ⌥ + ⌘ + f | Go to the search field |
|
||||
| ⌥ + ⌘ + t | Show or hide a toolbar in the app |
|
||||
| ⌥ + ⌘ + c | Copy Style: Copy the formatting settings of the selected item to the Clipboard |
|
||||
| ⌥ + ⌘ + v | Paste Style: Apply the copied style to the selected item |
|
||||
| ⌥ + ⇧ + ⌘ + v | Paste and Match Style: Apply the style of the surrounding content to the item pasted within that content |
|
||||
| ⌥ + ⌘ + i | Show or hide the inspector window |
|
||||
| ⇧ + ⌘ + p | Page setup: Display a window for selecting document settings |
|
||||
| ⇧ + ⌘ + s | Display the Save As dialog, or duplicate the current document |
|
||||
| ⇧ + ⌘ + (-) | Decrease the size of the selected item |
|
||||
| ⇧ + ⌘ + (+) | Increase the size of the selected item |
|
||||
| ⌘ + = | performs the same function |
|
||||
| ⇧ + ⌘ + ? | Open the Help menu |
|
||||
@@ -0,0 +1,109 @@
|
||||
# MacOS Terminal aufsetzen und mit Oh-MyZsh konfigurieren
|
||||
|
||||
## Homebrew installieren
|
||||
Terminal öffnen und folgenden Command ausführen
|
||||
```sh
|
||||
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
||||
```
|
||||
## Homebrew zum Fahd hinzufügen
|
||||
Nach der Installation, ACHTUNG: ”[username]” mit dem aktuellen Usernamen ersetzen
|
||||
```sh
|
||||
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/[username]/.zprofile
|
||||
eval "$(/opt/homebrew/bin/brew shellenv)"
|
||||
```
|
||||
|
||||
## iTerm2 installieren
|
||||
Für die Installation:
|
||||
```sh
|
||||
brew install --cask iterm2
|
||||
```
|
||||
|
||||
## Git installieren
|
||||
Für die Installaation:
|
||||
```sh
|
||||
brew install git
|
||||
```
|
||||
|
||||
## Oh My Zsh installieren
|
||||
Im Terminal folgende Befehl ausführen:
|
||||
```sh
|
||||
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
|
||||
```
|
||||
|
||||
## Istallation PowerLevel10K Theme für Oh My Zsh
|
||||
Theme herunterladen
|
||||
|
||||
```sh
|
||||
git clone https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k
|
||||
```
|
||||
|
||||
Nach dem Download das File ”~/.zshrc” öffnen. und den Wert von “ZSH_THEME" abändern wie unten gezeigt:
|
||||
```sh
|
||||
ZSH_THEME="powerlevel10k/powerlevel10k"
|
||||
```
|
||||
Dann die Datei speichern und Terminal neu starten oder den folgenden Command ausführen:
|
||||
|
||||
```sh
|
||||
source ~/.zshrc
|
||||
```
|
||||
|
||||
## Meslo Nerd Font installieren
|
||||
Font installieren mit "y" bestätigen und iTerm2 schliessen.
|
||||
|
||||
## Update VSCode TerminalFont (Optional)
|
||||
Einstellungen öffnen und in Terminal FontFamili den Wert "MesloLGS NF" eintragen oder im settings.json den folgenden Wert hinzufügen:
|
||||
|
||||
```json
|
||||
"terminal.integrated.fontFamily": "MesloLGS NF"
|
||||
```
|
||||
## Configure PowerLevel10K
|
||||
iTerm2 restarten. Man sollte jetzt den PowerLevel10K Configurations-Prozess sehen. Wenn nicht, den Proezss mit dem folgenden Command starten:
|
||||
|
||||
|
||||
```sh
|
||||
p10k configure
|
||||
```
|
||||
|
||||
Mit den foglenden Einstellungen kann das Terminal angepasst werden.
|
||||
|
||||
### Schritgrösse
|
||||
1. Einstellungen von iTerm2 öffnen
|
||||
2. Auf Profiles -> Text
|
||||
3. Schriftgrösse auf ca. 20 stellen
|
||||
|
||||
### Wechel der Farbgebung
|
||||
1. iTerm2 öffnen
|
||||
2. Download den Theme
|
||||
```sh
|
||||
curl https://raw.githubusercontent.com/josean-dev/dev-environment-files/main/coolnight.itermcolors --output ~/Downloads/coolnight.itermcolors
|
||||
```
|
||||
3. Einstellungen von iTerm2 öffnen
|
||||
4. Auf Profile -> Colors githubusercontent
|
||||
5. Den heruntergeladenen Theme importieren (coolnight)
|
||||
6. Das Profil auswählen (collnight)
|
||||
|
||||
## ZSH Plugins installieren
|
||||
|
||||
Install zsh-augosuggestions:
|
||||
```sh
|
||||
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
|
||||
```
|
||||
|
||||
Install zsh-syntax-highlighting:
|
||||
```sh
|
||||
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
|
||||
```
|
||||
|
||||
Öffnen von ”~/.zshrc” und die Plugins hinzufügen. Die Zeile sollte dann so aussehen:
|
||||
```sh
|
||||
plugins=(git zsh-autosuggestions zsh-syntax-highlighting web-search)
|
||||
```
|
||||
|
||||
Die Plugins Laden mit dem Command:
|
||||
```sh
|
||||
source ~/.zshrc
|
||||
```
|
||||
|
||||
### Fertig!
|
||||
|
||||
Quelle: https://www.josean.com/posts/terminal-setup
|
||||
@@ -0,0 +1,34 @@
|
||||
# SSH Key erstellen und auf einen Server kopieren
|
||||
|
||||
1. SSH-Schlüssel erstellen
|
||||
Öffnen Sie das Terminal auf Ihrem macOS-System und geben Sie den folgenden Befehl ein, um einen neuen SSH-Schlüssel zu erstellen. Es wird empfohlen, einen RSA-Schlüssel mit einer Länge von 4096 Bits zu verwenden, um eine gute Sicherheit zu gewährleisten:
|
||||
|
||||
```sh
|
||||
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
|
||||
```
|
||||
|
||||
Ersetzen Sie your_email@example.com mit Ihrer E-Mail-Adresse. Dieser Schritt wird dazu verwendet, Ihren öffentlichen Schlüssel zu identifizieren, ist aber nicht zwingend erforderlich.
|
||||
|
||||
Sie werden aufgefordert, den Speicherort für den Schlüssel zu wählen (normalerweise ~/.ssh/id_rsa) und ein Passwort einzugeben, um den Schlüssel zu schützen.
|
||||
|
||||
2. SSH-Schlüssel auf Ubuntu kopieren
|
||||
Nachdem Sie den SSH-Schlüssel erstellt haben, können Sie ihn auf Ihre Ubuntu-Maschine kopieren. Dieser Vorgang wird üblicherweise mit dem Befehl ssh-copy-id durchgeführt. Führen Sie im Terminal auf Ihrem macOS-System den folgenden Befehl aus:
|
||||
```sh
|
||||
ssh-copy-id -i ~/.ssh/id_rsa.pub username@ubuntu-server
|
||||
```
|
||||
|
||||
Ersetzen Sie username mit dem Benutzernamen auf der Ubuntu-Maschine und ubuntu-server mit der IP-Adresse oder dem Hostnamen des Ubuntu-Servers. Dieser Befehl überträgt Ihren öffentlichen SSH-Schlüssel auf den Ubuntu-Server und fügt ihn zur Datei ~/.ssh/authorized_keys des entsprechenden Benutzers hinzu, wodurch Sie sich zukünftig ohne Passworteingabe anmelden können.
|
||||
|
||||
3. Test der SSH-Verbindung
|
||||
Nachdem Sie den Schlüssel kopiert haben, können Sie testen, ob Sie sich ohne Passwort über SSH verbinden können. Verwenden Sie dazu den folgenden Befehl:
|
||||
|
||||
```sh
|
||||
ssh username@ubuntu-server
|
||||
```
|
||||
Wenn alles richtig eingerichtet wurde, sollten Sie ohne Passworteingabe auf den Ubuntu-Server zugreifen können.
|
||||
|
||||
|
||||
# Sicherheitshinweise
|
||||
- *Schlüssel mit Passwort schützen*: Wählen Sie ein starkes Passwort für Ihren privaten Schlüssel.
|
||||
- *Regelmäßige Überprüfung*: Überprüfen Sie regelmäßig die Datei ~/.ssh/authorized_keys auf Ihren Servern, um sicherzustellen, dass keine unbefugten Schlüssel vorhanden sind.
|
||||
- *Einschränkung der SSH-Zugriffsrechte*: Überlegen Sie, ob Sie in der SSH-Konfigurationsdatei (/etc/ssh/sshd_config) Einstellungen wie AllowUsers oder AllowGroups verwenden, um den Zugriff weiter zu beschränken.
|
||||
@@ -0,0 +1,89 @@
|
||||
# VSCode shortcuts
|
||||
|
||||
- [MacOS vscode keyboard shortcuts](https://code.visualstudio.com/shortcuts/keyboard-shortcuts-macos.pdf)
|
||||
- [Howto vscode custom shortcuts](https://code.visualstudio.com/docs/getstarted/keybindings)
|
||||
- [Learn vscode keyboard shortcuts](https://blog.logrocket.com/learn-these-keyboard-shortcuts-to-become-a-vs-code-ninja/)
|
||||
|
||||
|
||||
## Side Menu
|
||||
| shortcut | description |
|
||||
| :-------- | :------------------- |
|
||||
| ⌘ + B | Hide show side menu |
|
||||
| ⌘ + ⇧ + E | Explorer window |
|
||||
| ⌘ + ⇧ + F | Find window |
|
||||
| ⌘ + ⇧ + J | Find in files window |
|
||||
| ⌃ + ⇧ + G | Git window |
|
||||
| ⌘ + ⇧ + D | Debug window |
|
||||
| ⌘ + ⇧ + X | Extension window |
|
||||
|
||||
## Multi-Cursor Editing
|
||||
| shortcut | description |
|
||||
| :-------- | :-------------------------------------------- |
|
||||
| ⌘ + ⌥ + ↓ | add a new cursor below |
|
||||
| ⌥ + Click | add a new cursor at the mouse click |
|
||||
| ⌘ + ⇧ + L | add new cursor behind all instances of a word |
|
||||
|
||||
## Split editor
|
||||
| shortcut | description |
|
||||
| :------- | :---------- |
|
||||
| ⌘ + \ | split |
|
||||
|
||||
## Split Window focusing
|
||||
| shortcut | description |
|
||||
| :------- | :------------------------------------ |
|
||||
| ⌘ + 0 | explorer panel |
|
||||
| ⌘ + 1 | 1st window split window |
|
||||
| ⌘ + 2 | 2nd window split window |
|
||||
| ⌃ + ~ | terminal window |
|
||||
| ^ + tab | switch between tabs |
|
||||
| ⌘ + ~ | switch between VS code editor windows |
|
||||
|
||||
## IntelliSense
|
||||
| shortcut | description |
|
||||
| :-------- | :--------------------- |
|
||||
| ⌃ + Space | to invoke IntelliSense |
|
||||
|
||||
## Line Action
|
||||
| shortcut | description |
|
||||
| :-------- | :----------------------------- |
|
||||
| ⇧ + ⌥ + ↓ | copy the line and insert below |
|
||||
| ⇧ + ⌥ + ↑ | copy the line and insert above |
|
||||
| ⌥ + ↓ | move entire line below |
|
||||
| ⌥ + ↑ | move entire line above |
|
||||
| ⌘ + ⇧ + K | delete entire line |
|
||||
|
||||
## Rename Refactoring
|
||||
| shortcut | description |
|
||||
| :--------------------------------- | :----------------------------------- |
|
||||
| F2 (Fn + F2) | Rename Symbol in the current project |
|
||||
| Right Mouse Click -> Rename Symbol | Rename Symbol in the current project |
|
||||
|
||||
## Formatting
|
||||
| shortcut | description |
|
||||
| :------------ | :--------------------- |
|
||||
| ⇧ + ⌥ + F | format entire document |
|
||||
| ⌘ + K and ⌘ F | format selected text |
|
||||
|
||||
## Transform selected
|
||||
| shortcut | description |
|
||||
| :------------ | :------------------------------ |
|
||||
| ^ + ⇧ + ⌥ + L | transform selected to lower |
|
||||
| ^ + ⇧ + ⌥ + U | transform selected to upper |
|
||||
| ^ + ⇧ + ⌥ + S | transform selected to snake |
|
||||
| ^ + ⇧ + ⌥ + T | transform selected to titelcase |
|
||||
|
||||
## Code Folding
|
||||
| shortcut | description |
|
||||
| :---------- | :------------ |
|
||||
| ⌘ + ⌥ + [ | fold |
|
||||
| ⌘ + ⌥ + ] | unfold |
|
||||
| ⌘ K and ⌘ 0 | fold all |
|
||||
| ⌘ K and ⌘ J | unfold all |
|
||||
| ⌘ K and ⌘ 1 | fold 1 level |
|
||||
| ⌘ K and ⌘ 2 | fold 2 levels |
|
||||
| ⌘ K and ⌘ 5 | fold 5 levels |
|
||||
|
||||
## Errors and Warnings
|
||||
| shortcut | description |
|
||||
| :------- | :--------------------- |
|
||||
| F8 | navigate across errors |
|
||||
@@ -0,0 +1,24 @@
|
||||
# Infoverantstaltung 25.06.24 CAS Cloud und Plattform Manager
|
||||
|
||||
Link zur Webseite: [CAS Cloud und Plattform Manger](https://www.hslu.ch/de-ch/informatik/weiterbildung/technologies-and-methods/cas-cloud/)
|
||||
|
||||
## Fakten
|
||||
|
||||
Fakt | Wert
|
||||
-------- | --------
|
||||
Beginn | 24. Oktober 2024
|
||||
Ende | 14. März 2024
|
||||
Kosten | 7'900.--
|
||||
Unterrichtstage | Freitag und Samstag vor Ort 09:00 - 16:45h
|
||||
Arbeitspensum | 80 - 100% im Beruf
|
||||
|
||||
Abgabe Transverarbeit 9. März 2024
|
||||
|
||||
|
||||
## Notizen
|
||||
|
||||
Dotzent: Nisanth
|
||||
|
||||
|
||||
Kene Programmierkenntnisse
|
||||
|
||||
+97
@@ -0,0 +1,97 @@
|
||||
site_name: rwcloud.ch - Wiki
|
||||
theme:
|
||||
name: 'material'
|
||||
palette:
|
||||
scheme: 'slate'
|
||||
primary: red
|
||||
features:
|
||||
- navigation.expand
|
||||
- navigation.sections
|
||||
- navigation.tabs
|
||||
- toc.integrate
|
||||
- content.code.annotate
|
||||
- content.code.select
|
||||
- content.code.copy
|
||||
- content.tabs.link
|
||||
- navigation.footer
|
||||
font:
|
||||
text: Roboto
|
||||
code: Roboto Mono
|
||||
logo: assets/images/logo2.png
|
||||
favicon: assets/images/favicon.ico
|
||||
nav:
|
||||
- Home: index.md
|
||||
- Applikationen:
|
||||
- bind9: apps/bind9.md
|
||||
- Grafana: apps/grafana.md
|
||||
- Prometheus: apps/prometheus.md
|
||||
- Datenbanken:
|
||||
- mariadb: databases/mariadb.md
|
||||
- mysql: databases/mysql.md
|
||||
- postgres: databases/postgres.md
|
||||
- sqlite: databases/sqlite.md
|
||||
- Docker:
|
||||
- docker-compose: docker/docker-compose.md
|
||||
- docker-desktop: docker/docker-desktop.md
|
||||
- docker-file: docker/docker-file.md
|
||||
- docker: docker/docker.md
|
||||
- Linux:
|
||||
- Distros:
|
||||
- Centos: linux/distros/centos.md
|
||||
- debian: linux/distros/debian.md
|
||||
- fedora: linux/distros/fedora.md
|
||||
- ubuntu: linux/distros/ubuntu.md
|
||||
- arp: linux/arp.md
|
||||
- awk: linux/awk.md
|
||||
- cron: linux/cron.md
|
||||
- Umgebungsvariablen: linux/environment-variables-in-linux.md
|
||||
- etherwake: linux/etherwake.md
|
||||
- ethtool: linux/ethtool.md
|
||||
- grep: linux/grep.md
|
||||
- iptables: linux/iptables.md
|
||||
- linux: linux/linux.md
|
||||
- lspci: linux/lspci.md
|
||||
- lvm2: linux/lvm2.md
|
||||
- mount: linux/mount.md
|
||||
- netplan: linux/netplan.md
|
||||
- nfs: linux/nfs.md
|
||||
- sed: linux/sed.md
|
||||
- tailscale-hardening: linux/uff-tailscale-hardening.md
|
||||
- ufw: linux/ufw.md
|
||||
- user: linux/user.md
|
||||
- macOS:
|
||||
- shortcuts: macos/macos-shortcuts.md
|
||||
- setup terminal: macos/setup_terminal.md
|
||||
- sshkey-gen: macos/sshkey-gen.md
|
||||
- VSCode Shortcuts: macos/vscode-macos-shortcuts.md
|
||||
- Weiterbildung:
|
||||
- HSLU:
|
||||
- CAS Cloud-Plattform Manager: weiterbildung/hslu/cas-cloudmanager.md
|
||||
markdown_extensions:
|
||||
- abbr
|
||||
- admonition
|
||||
- attr_list
|
||||
- tables
|
||||
- pymdownx.highlight:
|
||||
linenums: true
|
||||
pygments_style: monokai
|
||||
- pymdownx.details
|
||||
- pymdownx.inlinehilite
|
||||
- pymdownx.snippets
|
||||
- pymdownx.superfences:
|
||||
custom_fences:
|
||||
- name: mermaid
|
||||
class: mermaid
|
||||
format: !!python/name:pymdownx.superfences.fence_code_format
|
||||
- pymdownx.arithmatex:
|
||||
generic: true
|
||||
- pymdownx.tabbed:
|
||||
alternate_style: true
|
||||
|
||||
plugins:
|
||||
- search
|
||||
#- privacy
|
||||
extra:
|
||||
generator: false
|
||||
|
||||
copyright: Copyright © 2024 René Walther
|
||||
Reference in new issue
Block a user