Merge pull request #115 from MrReginaldKray/main

Create 01-en.md
This commit is contained in:
Christoph 2023-06-06 14:49:32 +02:00 committed by GitHub
commit 625c5cbe57
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 1714 additions and 0 deletions

View file

@ -0,0 +1,94 @@
---
title: How to Create a New User Account in Linux
description: This tutorial explains all the necessary steps for creating a new user account in Linux using the command line interface.
level: [beginner]
updated_at: 2023-04-19
slug: how-to-create-a-new-user-account-in-linux
author_name: Peter Mesiha
author_url: [add a link to your Github profile here](https://github.com/MrReginaldKray)
author_image:
author_bio:
tags: [shell, ssh, linux, user]
netcup_product_url: https://www.netcup.de/bestellen/produkt.php?produkt=2884 with server in vienna
language: en
available_languages: [de, en]
---
# Introduction
Creating a new user account in Linux can be done easily using the command line interface. In this tutorial, we will go through all the steps that are required to create a new user account in Linux.
# Requirements
Before starting, you should have the following:
- Access to a Linux machine with sudo privileges
- Basic knowledge of the Linux command line interface
# Step 1 - Open the terminal
To create a new user account, we need to use the command line interface. Open the terminal by pressing `Ctrl+Alt+T` on your keyboard or by searching for "Terminal" in the application launcher.
# Step 2 - Create a new user account
To create a new user account, we will use the `useradd` command. The basic syntax of the `useradd` command is as follows:
``` bash
sudo useradd username
```
Replace `username` with the desired username for the new user account. For example, to create a new user account named `john`, use the following command:
``` bash
sudo useradd john
```
By default, the new user account will not have a password and will not be able to log in to the system. To set a password for the new user account, use the `passwd` command as follows:
``` bash
sudo passwd john
```
Enter and confirm the new password when prompted.
# Step 3 - Add user to groups
By default, the new user account will not have any special privileges or permissions. To add the new user account to a specific group, use the `usermod` command as follows:
``` bash
sudo usermod -aG groupname username
```
Replace `groupname` with the name of the group you want to add the user to, and `username` with the username of the new user account. For example, to add user `john` to the `sudo` group, use the following command:
``` bash
sudo usermod -aG sudo john
```
# Conclusion
Creating a new user account in Linux is a simple process that can be executed from the command line interface. By following the steps outlined in this tutorial, you can create a new user account and, if desired, grant administrative privileges.
# License
[MIT](https://github.com/netcup-community/community-tutorials/blob/main/LICENSE)
Copyright (c) 2021 netcup
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# Contributor's Certificate of Origin
By making a contribution to this project, I certify that:
1) The contribution was created in whole or in part by me and I have the right to submit it under the license indicated in the file; or
2) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same license (unless I am permitted to submit under a different license), as indicated in the file; or
3) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it.
4) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the license(s) involved.

View file

@ -0,0 +1,203 @@
---
title: How to Install Dockerized nginx with MariaDB
description: This tutorial explains how to install docker and nginx with a mariaDB database in just a few minutes.
level: [beginner]
updated_at: 2023-04-19
slug: how-to-install-dockerized-nginx-with-mariadb
author_name: Peter Mesiha
author_url: [add a link to your Github profile here](https://github.com/MrReginaldKray)
author_image:
author_bio:
tags: [shell, ssh, linux, docker, nginx, mariadb]
netcup_product_url: https://www.netcup.de/bestellen/produkt.php?produkt=2884 with server in vienna
language: en
available_languages: [de, en]
---
# Introduction
In this "how to" tutorial you are going to set up your own nginx instance with a mariaDB.
Nginx [engine x] is an HTTP and reverse proxy server, a mail proxy server, and a generic TCP/UDP proxy server, and as an open source project is free to use.
First we are going to uninstall any old docker engine and install the latest (can be skipped), then we'll create/edit the docker-compose file, and check all the containers and the setup.
# Requirements
- Docker
- Docker Compose or docker-compose
- Linux server
# Step 1 - Uninstall old Docker Engine, CLI, containerd, and Docker Compose packages
``` bash
sudo apt-get purge docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-ce-rootless-extras
```
# Step 2 - Curl the script for installation from docker
``` bash
curl -fsSL https://get.docker.com -o get-docker.sh
```
# Step 3 - Dry run the script to check for complications
``` bash
sudo sh ./get-docker.sh --dry-run
```
# Step 4 - Run the script
``` bash
sudo sh ./get-docker.sh
```
# Step 5 - Verify the installation
``` bash
docker --version
```
# Step 6 - Create a folder to save the docker-compose file and cd into that folder
``` bash
mkdir nginx-with-postgres
```
``` bash
cd nginx-with-postgres
```
# Step 7 - Copy the docker-compose file to your system
``` bash
vim docker-compose.yml
```
Paste the content inside this file.
``` yml
---
version: "3.8"
services:
app:
hostname: 'nginx'
image: 'jc21/nginx-proxy-manager:latest'
container_name: 'nginx-app'
restart: 'unless-stopped'
ports:
# These ports are in format <host-port>:<container-port>
- '80:80' # Public HTTP Port
- '443:443' # Public HTTPS Port
- '81:81' # Admin Web Port
# Add any other Stream port you want to expose
# - '21:21' # FTP
environment:
DB_MYSQL_HOST: "db"
DB_MYSQL_PORT: 3306
DB_MYSQL_USER: "nginx-user"
DB_MYSQL_PASSWORD: "changeMe.aHighlyComplexPasswordToKeepYouSecure"
DB_MYSQL_NAME: "npm"
# Uncomment this if IPv6 is not enabled on your host
# DISABLE_IPV6: 'true'
networks:
- 'nginx-network'
volumes:
- 'nginx-app-data-vol:/data'
- 'nginx-app-letsencrypt-vol:/etc/letsencrypt'
depends_on:
- db
db:
image: 'jc21/mariadb-aria:latest'
container_name: 'nginx-db'
restart: 'unless-stopped'
environment:
MYSQL_DATABASE: 'npm'
MYSQL_USER: 'nginx-user'
MYSQL_PASSWORD: 'changeMe.aHighlyComplexPasswordToKeepYouSecure'
MYSQL_ROOT_PASSWORD: 'changeMe.aHighlyComplexPasswordToKeepYouSecure'
networks:
- 'nginx-network'
volumes:
- 'nginx-db-data-vol:/var/lib/mysql'
volumes:
nginx-app-data-vol:
name: 'nginx-app-data-vol'
nginx-app-letsencrypt-vol:
name: 'nginx-app-letsencrypt-vol'
nginx-db-data-vol:
name: 'nginx-db-data-vol'
networks:
nginx-network:
name: 'nginx-network'
```
# Step 8 - Edit the docker-compose file
Edit the parts with 'changeMe.' and of course any other parts you want to modify, such as the ports exposed on the host machine.
# Step 9 - Check the configuration
Make sure you have changed all the 'changeMe.' parts. Now you are good to go.
# Step 10 - Create the containers
With docker-compose, it's fairly easy to set everything up.
*Type:*
``` bash
docker compose up -d
```
# Step 11 - Check the containers
Deployment should take a maximum of 2 minutes to be up and running as the app waits for the db and a successful health check.
*Type:*
``` bash
docker ps -a
```
You should wait till the nginx-db container is up and healthy and the nginx-app is running.
# Step 12 - Check the URL
Now you can check your port 80 (or another port if you have changed the left side) with your browser at localhost:80, or serverIP:80 if you run it on a server in a different network or your provided URL inside the docker-compose file.
If you cannot reach the URL after a few minutes (3 to 4), you should check your ufw/ufw-docker to expose the ports through the firewall or check your proxy manager, if you use one.
Congratulations, you have created your own nginx server with its own db in just a few minutes.
You can now access the server on the 81 port to open the admin panel and start configuring the proxy.
# Conclusion
As you have seen, setting up nginx with its own db instance is quite simple and straightforward.
# License
[MIT](https://github.com/netcup-community/community-tutorials/blob/main/LICENSE)
Copyright (c) 2021 netcup
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# Contributor's Certificate of Origin
By making a contribution to this project, I certify that:
1) The contribution was created in whole or in part by me and I have the right to submit it under the license indicated in the file; or
2) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same license (unless I am permitted to submit under a different license), as indicated in the file; or
3) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it.
4) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the license(s) involved.

View file

@ -0,0 +1,208 @@
---
title: How to Install Dockerized OneDev with Postgres Database
description: This tutorial explains how to install docker and OneDev with a database in just a few minutes.
level: [beginner]
updated_at: 2023-04-19
slug: how-to-install-dockerized-onedev-with-postgres-database
author_name: Peter Mesiha
author_url: [add a link to your Github profile here](https://github.com/MrReginaldKray)
author_image:
author_bio:
tags: [shell, ssh, linux, docker, onedev, postgresql]
netcup_product_url: https://www.netcup.de/bestellen/produkt.php?produkt=2884 with server in vienna
language: en
available_languages: [de, en]
---
# Introduction
In this "how to" tutorial you are going to set up your own OneDev git server with CI/CD and Kanban.
The server will contain a lot of extra features, such as symbol navigation and code search, customizable issue fields and workflow, visual editor for CI/CD pipeline files, service desk for customer support, and code annotation with static analysis results.
And the best part is that it is easy to use, maintain and set up.
First we are going to uninstall any old docker engine and install the latest (can be skipped), then we'll create/edit the docker-compose file, and check all the containers and the setup.
# Requirements
- Docker
- Docker Compose or docker-compose
- Linux server
# Step 1 - Uninstall old Docker Engine, CLI, containerd, and Docker Compose packages
``` bash
sudo apt-get purge docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-ce-rootless-extras
```
# Step 2 - Curl the script for installation from docker
``` bash
curl -fsSL https://get.docker.com -o get-docker.sh
```
# Step 3 - Dry run the script to check for complications
``` bash
sudo sh ./get-docker.sh --dry-run
```
# Step 4 - Run the script
``` bash
sudo sh ./get-docker.sh
```
# Step 5 - Verify the installation
``` bash
docker --version
```
# Step 6 - Create a folder to save the docker-compose file and cd into that folder
``` bash
mkdir onedev-with-postgres
```
``` bash
cd onedev-with-postgres
```
# Step 7 - Copy the docker-compose file to your system
``` bash
vim docker-compose.yml
```
Paste the content inside this file.
``` yml
---
version: '3.8'
services:
app:
hostname: 'onedev'
image: '1dev/server:latest'
container_name: 'onedev-app'
restart: unless-stopped
environment:
- hibernate_dialect=io.onedev.server.persistence.PostgreSQLDialect
- hibernate_connection_driver_class=org.postgresql.Driver
- hibernate_connection_url=jdbc:postgresql://onedev-db:5432/onedev
- hibernate_connection_username=onedev-user
- hibernate_connection_password=changeMe.aHighlyComplexPasswordToKeepYouSecure
- initial_user=changeMe.user
- initial_password=changeMe.password
- initial_email=changeMe.email@example.com
- initial_server_url=https://changeMe.example.com
- initial_ssh_root_url=ssh://changeMe.example.com
volumes:
- 'onedev-app-data-vol:/opt/onedev'
- '/var/run/docker.sock:/var/run/docker.sock'
networks:
- 'onedev-network'
ports:
# left side is host side - right side is container side and should not be changed
- '6610:6610'
depends_on:
db:
condition: service_healthy
db:
hostname: 'postgresql'
image: 'postgres:latest'
container_name: 'onedev-db'
restart: 'unless-stopped'
networks:
- 'onedev-network'
environment:
- POSTGRES_USER=onedev-user
- POSTGRES_PASSWORD=changeMe.aHighlyComplexPasswordToKeepYouSecure
- POSTGRES_DB=onedev
volumes:
- 'onedev-db-postgresql-vol:/var/lib/postgresql'
- 'onedev-db-postgresql-data-vol:/var/lib/postgresql/data'
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 1m
timeout: 5s
retries: 5
volumes:
onedev-app-data-vol:
name: 'onedev-app-data-vol'
onedev-db-postgresql-vol:
name: 'onedev-db-postgresql-vol'
onedev-db-postgresql-data-vol:
name: 'onedev-db-postgresql-data-vol'
networks:
onedev-network:
name: 'onedev-network'
```
# Step 8 - Edit the docker-compose file
Edit the parts with 'changeMe.' and of course any other parts you want to modify, such as the ports exposed on the host machine.
# Step 9 - Check the configuration
Make sure you have changed all the 'changeMe.' parts. Now you are good to go.
# Step 10 - Create the containers
With docker-compose, it's fairly easy to set everything up.
*Type:*
``` bash
docker compose up -d
```
# Step 11 - Check the containers
Deployment should take a maximum of 2 minutes to be up and running as the app waits for the db and a successful health check.
*Type:*
``` bash
docker ps -a
```
You should wait till the onedev-db container is up and healthy and the onedev-app is running.
# Step 12 - Check the URL
Now you can check your port 6610 (or another port if you have changed the left side) with your browser at localhost:6610, or serverIP:6610 if you run it on a server in a different network or your provided URL inside the docker-compose file.
If you cannot reach the URL after a few minutes (3 to 4), you should check your ufw/ufw-docker to expose the ports through the firewall or check your proxy manager, if you use one.
Congratulations, you have created your own onedev server with its own db in just a few minutes.
# Conclusion
As you have seen, setting up OneDev with its own db instance is quite simple and straightforward.
# License
[MIT](https://github.com/netcup-community/community-tutorials/blob/main/LICENSE)
Copyright (c) 2021 netcup
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# Contributor's Certificate of Origin
By making a contribution to this project, I certify that:
1) The contribution was created in whole or in part by me and I have the right to submit it under the license indicated in the file; or
2) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same license (unless I am permitted to submit under a different license), as indicated in the file; or
3) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it.
4) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the license(s) involved.

View file

@ -0,0 +1,209 @@
---
title: How to Install Dockerized SonarQube with a Postgres Database
description: This tutorial explains how to install docker and SonarQube with a database in just a few minutes.
level: [beginner]
updated_at: 2023-04-19
slug: how-to-install-dockerized-sonarqube-with-postgres-database
author_name: Peter Mesiha
author_url: [add a link to your Github profile here](https://github.com/MrReginaldKray)
author_image:
author_bio:
tags: [shell, ssh, linux, docker, sonarqube, postgresql]
netcup_product_url: https://www.netcup.de/bestellen/produkt.php?produkt=2884 with server in vienna
language: en
available_languages: [de, en]
---
# Introduction
In this "how to" tutorial you are going to set up your SonarQube instance with db.
SonarQube is the leading tool for continuously inspecting the code quality and security of your codebases, and guiding development teams during code reviews. Covering 27 programming languages, while pairing-up with your existing software pipeline, SonarQube provides clear remediation guidance for developers to understand and fix issues, and for teams overall to deliver better and safer software. With over 225,000 deployments helping small development teams as well as global organizations, SonarQube provides the means for all teams and companies around the world to own and impact their code quality and security.
First we are going to uninstall any old docker engine and install the latest (can be skipped), then we'll create/edit the docker-compose file, and check all the containers and the setup.
# Requirements
- Docker
- Docker Compose or docker-compose
- Linux server
# Step 1 - Uninstall old Docker Engine, CLI, containerd, and Docker Compose packages
``` bash
sudo apt-get purge docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-ce-rootless-extras
```
# Step 2 - Curl the script for installation from docker
``` bash
curl -fsSL https://get.docker.com -o get-docker.sh
```
# Step 3 - Dry run the script to check for complications
``` bash
sudo sh ./get-docker.sh --dry-run
```
# Step 4 - Run the script
``` bash
sudo sh ./get-docker.sh
```
# Step 5 - Verify the installation
``` bash
docker --version
```
# Step 6 - Create a folder to save the docker-compose file and cd into that folder
``` bash
mkdir sonarqube-with-postgres
```
``` bash
cd sonarqube-with-postgres
```
# Step 7 - Copy the docker-compose file to your system
``` bash
vim docker-compose.yml
```
Paste the content inside this file.
``` yml
---
version: '3.8'
services:
app:
hostname: 'sonarqube'
image: 'sonarqube:lts-community'
container_name: 'sonar-app'
restart: 'unless-stopped'
networks:
- 'sonar-network'
environment:
- SONAR_JDBC_URL=jdbc:postgresql://sonar-db:5432/sonarqube
- SONAR_JDBC_USERNAME=sonar-user
- SONAR_JDBC_PASSWORD=changeMe.aHighlyComplexPasswordToKeepYouSecure
volumes:
- 'sonar-app-conf-vol:/opt/sonarqube/conf'
- 'sonar-app-data-vol:/opt/sonarqube/data'
- 'sonar-app-extension-vol:/opt/sonarqube/extensions'
- 'sonar-app-bundled-plugin-vol:/opt/sonarqube/lib/bundled-plugins'
ports:
# left side is host side - right side is container side and should not be changed
- '9000:9000'
depends_on:
db:
condition: service_healthy
db:
hostname: 'postgresql'
image: 'postgres:latest'
container_name: 'sonar-db'
restart: 'unless-stopped'
networks:
- 'sonar-network'
environment:
- PGUSER=sonar-user
- PGPASSWORD=changeMe.aHighlyComplexPasswordToKeepYouSecure
- PGDATABASE=sonarqube
volumes:
- 'sonar-db-postgresql-vol:/var/lib/postgresql'
- 'sonar-db-postgresql-data-vol:/var/lib/postgresql/data'
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 10s
timeout: 5s
retries: 5
volumes:
sonar-app-conf-vol:
name: 'sonar-app-conf-vol'
sonar-app-data-vol:
name: 'sonar-app-data-vol'
sonar-app-extension-vol:
name: 'sonar-app-extension-vol'
sonar-app-bundled-plugin-vol:
name: 'sonar-app-bundled-plugin-vol'
sonar-db-postgresql-vol:
name: 'sonar-db-postgresql-vol'
sonar-db-postgresql-data-vol:
name: 'sonar-db-postgresql-data-vol'
networks:
sonar-network:
name: 'sonar-network'
```
# Step 8 - Edit the docker-compose file
Edit the parts with 'changeMe.' and of course any other parts you want to modify, such as the ports exposed on the host machine.
# Step 9 - Check the configuration
Make sure you have changed all the 'changeMe.' parts. Now you are good to go.
# Step 10 - Create the containers
With docker-compose, it's fairly easy to set everything up.
*Type:*
``` bash
docker compose up -d
```
# Step 11 - Check the containers
Deployment should take a maximum of 2 minutes to be up and running as the app waits for the db and a successful health check.
*Type:*
``` bash
docker ps -a
```
You should wait till the sonarqube-db container is up and healthy and the sonarqube-app is running.
# Step 12 - Check the URL
Now you can check your port 9000 (or another port if you have changed the left side) with your browser at localhost:9000, or serverIP:9000 if you run it on a server in a different network or your provided URL inside the docker-compose file.
If you cannot reach the URL after a few minutes (3 to 4), you should check your ufw/ufw-docker to expose the ports through the firewall or check your proxy manager, if you use one.
Congratulations, you have created your own SonarQube server with its own db in a few minutes.
# Conclusion
As you have seen, setting up SonarQube with its own db instance is quite simple and straightforward.
# License
[MIT](https://github.com/netcup-community/community-tutorials/blob/main/LICENSE)
Copyright (c) 2021 netcup
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# Contributor's Certificate of Origin
By making a contribution to this project, I certify that:
1) The contribution was created in whole or in part by me and I have the right to submit it under the license indicated in the file; or
2) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same license (unless I am permitted to submit under a different license), as indicated in the file; or
3) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it.
4) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the license(s) involved.

View file

@ -0,0 +1,171 @@
---
title: How to Install Dockerized Synapse Admin
description: This tutorial explains how to install Synapse Admin in just a few minutes.
level: [beginner]
updated_at: 2023-04-19
slug: how-to-install-dockerized-synapse-admin
author_name: Peter Mesiha
author_url: [add a link to your Github profile here](https://github.com/MrReginaldKray)
author_image:
author_bio:
tags: [shell, ssh, linux, docker, synapse]
netcup_product_url: https://www.netcup.de/bestellen/produkt.php?produkt=2884 with server in vienna
language: en
available_languages: [de, en]
---
# Introduction
In this "how to" tutorial you are going to set up your own Synapse Admin instance.
<here>
First we are going to uninstall any old docker engine and install the latest (can be skipped), then we'll create/edit the docker-compose file, and check all the containers and the setup.
# Requirements
- Docker
- Docker Compose or docker-compose
- Linux server
- Access to the following endpoints: /_matrix AND /_synapse/admin
# Step 1 - Uninstall old Docker Engine, CLI, containerd, and Docker Compose packages
``` bash
sudo apt-get purge docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-ce-rootless-extras
```
# Step 2 - Curl the script for installation from docker
``` bash
curl -fsSL https://get.docker.com -o get-docker.sh
```
# Step 3 - Dry run the script to check for complications
``` bash
sudo sh ./get-docker.sh --dry-run
```
# Step 4 - Run the script
``` bash
sudo sh ./get-docker.sh
```
# Step 5 - Verify the installation
``` bash
docker --version
```
# Step 6 - Create a folder to save the docker-compose file and cd into that folder
``` bash
mkdir synapse-admin
```
``` bash
cd synapse-admin
```
# Step 7 - Copy the docker-compose file to your system
``` bash
vim docker-compose.yml
```
Paste the content inside this file.
``` yml
---
version: '3.8'
services:
app:
hostname: 'synapse-admin'
image: 'awesometechnologies/synapse-admin:0.8.7'
container_name: 'synapse-admin-app'
restart: 'unless-stopped'
build:
context: https://github.com/Awesome-Technologies/synapse-admin.git
args:
# Optionally define your matrix url
- REACT_APP_SERVER=https://changeMe.example.com
networks:
# Change to your matrix network
- 'matrix-network'
ports:
# left side is host side - right side is container side and should not be changed
- '80:80'
networks:
# Change to your matrix network
matrix-network:
external: true
name: 'matrix-network'
```
# Step 8 - Edit the docker-compose file
Edit the parts with 'changeMe.' and of course networks and any other parts you want to modify, such as the ports exposed on the host machine.
# Step 9 - Check the configuration
Make sure that you have changed all the 'changeMe.' parts. Now you are good to go.
# Step 10 - Create the containers
With docker-compose, it's fairly easy to set everything up.
*Type:*
``` bash
docker compose up -d
```
# Step 11 - Check the containers
Deployment should take a maximum of 2 minutes to be up and running.
*Type:*
``` bash
docker ps -a
```
# Step 12 - Check the URL
Now you can check your port 80 (or another port if you have changed the left side) with your browser at localhost:80, or serverIP:80 if you run it on a server in a different network or your provided URL inside the docker compose-file.
If you cannot reach the URL after few minutes (1 to 2), you should check your ufw/ufw-docker to expose the ports through the firewall or check your proxy manager if you use one.
Congratulations, you have created your own synapse-admin in just a few minutes.
# Conclusion
As you have seen, setting up synapse-admin is quite simple and straightforward.
# License
[MIT](https://github.com/netcup-community/community-tutorials/blob/main/LICENSE)
Copyright (c) 2021 netcup
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# Contributor's Certificate of Origin
By making a contribution to this project, I certify that:
1) The contribution was created in whole or in part by me and I have the right to submit it under the license indicated in the file; or
2) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same license (unless I am permitted to submit under a different license), as indicated in the file; or
3) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it.
4) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the license(s) involved.

View file

@ -0,0 +1,84 @@
---
title: How to Install the latest Docker Engine via Docker Script
description: <her>
level: [beginner]
updated_at: 2023-04-20
slug: how-to-install-the-latest-docker-engine-via-docker-script
author_name: Peter Mesiha
author_url: add a link to your Github profile here
author_image:
author_bio:
tags: [shell, ssh, linux, docker]
netcup_product_url: https://www.netcup.de/bestellen/produkt.php?produkt=2884 with server in vienna
language: en
available_languages: [de, en]
---
# Introduction
This tutorial describes how to install the latest Docker Engine on your server.
# Requirements
- Linux based server
# Step 1 - Uninstall old Docker Engine, CLI, containerd, and Docker Compose packages
``` bash
sudo apt-get purge docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-ce-rootless-extras
```
``` bash
sudo apt-get update
```
# Step 2 - Curl the script for installation from docker
``` bash
curl -fsSL https://get.docker.com -o get-docker.sh
```
# Step 3 - Dry run the script to check for complications
``` bash
sudo sh ./get-docker.sh --dry-run
```
# Step 4 - Finally run the script
``` bash
sudo sh ./get-docker.sh
```
# Step 4 - Verify the installation
``` bash
docker --version
```
# Conclusion
As you have seen installing the latest Docker Engine is quite simple with the Docker Script provided by Docker directly.
# Licence
[MIT](https://github.com/netcup-community/community-tutorials/blob/main/LICENSE)
Copyright (c) 2021 netcup
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicence, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# Contributor's Certificate of Origin
By making a contribution to this project, I certify that:
1) The contribution was created in whole or in part by me and I have the right to submit it under the licence indicated in the file; or
2) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate licence and I have the right under that licence to submit that work with modifications, whether created in whole or in part by me, under the same licence (unless I am permitted to submit under a different licence), as indicated in the file; or
3) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it.
4) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the licence(s) involved.

View file

@ -0,0 +1,115 @@
---
title: How to Navigate the Linux File System using the Command Line Interface
description: This is a detailed tutorial on how to navigate the Linux file system using basic command line interface commands.
level: [beginner]
updated_at: 2023-04-19
slug: how-to-navigate-the-linux-file-system-using-the-command-line-interface
author_name: Peter Mesiha
author_url: [add a link to your Github profile here](https://github.com/MrReginaldKray)
author_image:
author_bio:
tags: [shell, ssh, linux]
netcup_product_url: https://www.netcup.de/bestellen/produkt.php?produkt=2884 with server in vienna
language: en
available_languages: [de, en]
---
# Introduction
In Linux, the file system is organized in a hierarchical structure, with directories (folders) containing files and other directories. Navigating the file system is an essential skill for any Linux user. In this tutorial, we will cover basic command line interface commands to navigate the Linux file system.
# Requirements
To follow this tutorial, you will need:
A Linux machine (or virtual machine) with a terminal or console interface
Basic knowledge of Linux command line interface
# Step 1 - The pwd command
The pwd (print working directory) command is used to display the current working directory.
``` bash
pwd
```
The output will show the full path of the current directory.
# Step 2 - The cd command
The cd (change directory) command is used to change the current working directory.
To change to a directory, simply type cd followed by the directory name:
``` bash
cd directory_name
```
To go up one directory level, use cd ..:
``` bash
cd ..
```
# Step 3 - The ls command
The ls (list) command is used to list the contents of a directory.
To list the files and directories in the current working directory, type:
``` bash
ls
```
To list the contents of a specific directory, type ls followed by the directory name:
``` bash
ls directory_name
```
# Step 4 - The mkdir command
The mkdir (make directory) command is used to create a new directory.
To create a new directory, type mkdir followed by the directory name:
``` bash
mkdir directory_name
```
# Step 5 - The rmdir command
The rmdir (remove directory) command is used to remove an empty directory.
To remove a directory, type rmdir followed by the directory name:
``` bash
rmdir directory_name
```
# Conclusion
In this tutorial, we have covered basic command line interface commands to navigate the Linux file system. With these commands, you can navigate, list, create, and remove directories in the Linux file system. Practice using these commands to become more comfortable with the Linux file system.
# License
[MIT](https://github.com/netcup-community/community-tutorials/blob/main/LICENSE)
Copyright (c) 2021 netcup
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicence, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# Contributor's Certificate of Origin
By making a contribution to this project, I certify that:
1) The contribution was created in whole or in part by me and I have the right to submit it under the license indicated in the file; or
2) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same license (unless I am permitted to submit under a different license), as indicated in the file; or
3) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it.
4) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the license(s) involved.

View file

@ -0,0 +1,89 @@
---
title: How to Use and Install the Nano Text Editor
description: Learn how to install and use the nano text editor in this step-by-step tutorial.
level: [beginner]
updated_at: 2023-04-19
slug: how-to-use-and-install-the-nano-text-editor
author_name: Peter Mesiha
author_url: [add a link to your Github profile here](https://github.com/MrReginaldKray)
author_image:
author_bio:
tags: [shell, ssh, linux, nano]
netcup_product_url: https://www.netcup.de/bestellen/produkt.php?produkt=2884 with server in vienna
language: en
available_languages: [de, en]
---
# Introduction
The nano text editor is a simple, user-friendly text editor that is commonly used in Unix and Linux operating systems. It is lightweight, fast, and easy to use, making it an ideal choice for beginners and advanced users alike. In this tutorial, we will guide you through the process of installing and using nano on your Unix or Linux system.
# Requirements
Before we begin, make sure you have access to a Unix or Linux operating system. Additionally, you will need root or sudo privileges to install packages on your system.
# Step 1 - Install nano
The first step to using nano is to install it on your system. You can do this by running the following command in your terminal:
``` bash
sudo apt-get update
sudo apt-get install -y nano
```
This will update your package manager and install the nano text editor on your system.
# Step 2 - Open a file with nano
To open a file with nano, simply type `nano` followed by the name of the file you want to edit. For example, to open a file called `example.txt`, you would run the following command:
``` bash
nano example.txt
```
This will open the file in the nano text editor, allowing you to make changes to it.
# Step 3 - Editing text with nano
Once you have a file open in nano, you can start editing it. Nano uses keyboard shortcuts for most of its commands, making it easy to learn and use. Here are some of the most common commands you will need to know:
- To move the cursor: use the arrow keys or the `Page Up` and `Page Down` keys.
- To enter text: simply start typing.
- To save changes: press `Ctrl + O` and then `Enter`.
- To exit nano: press `Ctrl + X`.
# Step 4 - Additional nano commands
In addition to the basic commands we've already covered, nano has many other commands that can be useful when editing text. Here are a few more commands you might find helpful:
- To search for text: press `Ctrl + W` and then enter the text you want to search for.
- To replace text: press `Ctrl + \` and then enter the text you want to replace and the replacement text.
- To cut or copy text: use the `Ctrl + K` or `Ctrl + U` commands.
- To paste text: use the `Ctrl + U` command.
# Conclusion
Congratulations! You now know how to install and use the nano text editor on your Unix or Linux system. With its simple interface and powerful editing features, nano is an excellent choice for anyone who needs to edit text files regularly.
# License
[MIT](https://github.com/netcup-community/community-tutorials/blob/main/LICENSE)
Copyright (c) 2021 netcup
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# Contributor's Certificate of Origin
By making a contribution to this project, I certify that:
1) The contribution was created in whole or in part by me and I have the right to submit it under the license indicated in the file; or
2) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same license (unless I am permitted to submit under a different license), as indicated in the file; or
3) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it.
4) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the license(s) involved.

View file

@ -0,0 +1,92 @@
---
title: How to Use and Install the Vim Text Editor
description: Learn how to install and use the Vim text editor on Linux-based systems in this step-by-step tutorial.
level: [beginner]
updated_at: 2023-04-19
slug: how-to-use-and-install-the-vim-text-editor
author_name: Peter Mesiha
author_url: [add a link to your Github profile here](https://github.com/MrReginaldKray)
author_image:
author_bio:
tags: [shell, ssh, linux]
netcup_product_url: https://www.netcup.de/bestellen/produkt.php?produkt=2884 with server in vienna
language: en
available_languages: [de, en]
---
# Introduction
Vim is a powerful text editor that is popular among programmers and Linux users. It has a wide range of features and can be used for editing code, writing scripts, and more. This tutorial will guide you through the process of installing and using Vim on Linux-based systems.
# Requirements
- A Linux-based operating system
- A terminal emulator (e.g. GNOME Terminal, Konsole, or xterm)
# Step 1 - Installing Vim
Vim is typically installed by default on most Linux-based systems. To check if Vim is installed on your system, open a terminal emulator and type the following command:
``` bash
vim --version
```
If Vim is not installed, you can install it using the package manager for your Linux distribution. For example, on Debian-based systems, you can install Vim by running the following command:
``` bash
sudo apt-get install vim
```
# Step 2 - Basic Vim Commands
Once Vim is installed, you can open it by typing the following command in your terminal emulator:
``` bash
vim
```
This will open Vim in command mode. In command mode, you can use the following basic commands:
- `i`: Enter insert mode to start editing the document.
- `Esc`: Return to command mode from insert mode.
- `:w`: Save the changes made to the document.
- `:q`: Quit Vim.
To insert text into the document, first enter insert mode by pressing the `i` key, then start typing. To return to command mode, press the `Esc` key.
# Step 3 - Advanced Vim commands
Vim has many advanced features that can be used to improve productivity when editing documents. Some of these features include:
- Search and replace: Use the `:/` command to search for a specific string and replace it with another string.
- Multiple buffers: Use the `:ls` command to list all open buffers, and `:b <buffer>` to switch to a specific buffer.
- Macros: Use the `q` command to start recording a macro, and the `@` command to play it back.
To learn more about Vim's advanced features, you can read the documentation by typing `:help` in Vim.
# Conclusion
Vim is a powerful text editor that can improve your productivity when editing documents. By following this tutorial, you should now have a basic understanding of how to install and use Vim on Linux-based systems. With practice, you can become proficient in using Vim's advanced features to edit documents more efficiently.
# License
[MIT](https://github.com/netcup-community/community-tutorials/blob/main/LICENSE)
Copyright (c) 2021 netcup
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# Contributor's Certificate of Origin
By making a contribution to this project, I certify that:
1) The contribution was created in whole or in part by me and I have the right to submit it under the license indicated in the file; or
2) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same license (unless I am permitted to submit under a different license), as indicated in the file; or
3) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it.
4) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the license(s) involved.

View file

@ -0,0 +1,163 @@
---
title: How to Use the Chmod and Chown Commands to Change File Permissions
description: Learn how to use the chmod and chown commands in Linux to change file permissions in this step-by-step tutorial.
level: [beginner]
updated_at: 2023-04-19
slug: how-to-use-the-chmod-and-chown-command-to-change-file-permissions
author_name: Peter Mesiha
author_url: https://github.com/MrReginaldKray
author_image:
author_bio:
tags: [shell, ssh, linux, chmod, chown]
netcup_product_url: https://www.netcup.de/bestellen/produkt.php?produkt=2884
language: en
available_languages: [de, en]
---
# Introduction
File permissions are an important aspect of managing files in Linux. Permissions define who can read, write, and execute files. In this tutorial, we'll explain how to use the chmod and chown commands in Linux to change file permissions.
# Requirements
To follow along with this tutorial, you'll need:
- A Linux-based operating system (such as Ubuntu, CentOS, or Debian)
- Basic knowledge of the Linux command line
- A file to test the chmod and chown commands on
# Step 1 - Understanding file permissions
Before we dive into the "chmod" and "chown" commands, it's important to understand how file permissions work in Linux.
In Linux, files have three types of permissions: read (r), write (w), and execute (x). These permissions are assigned to three groups: the owner of the file, the group that the file belongs to, and everyone else (also known as "others").
The permissions for each group are represented by a string of three letters. For example, the permissions for a file might be "rw-r--r--". This means that the owner of the file has read and write permissions, the group that the file belongs to has read permissions, and everyone else has read permissions.
To view the permissions of a file, you can use the "ls" command with the "-l" option:
``` bash
ls -l foldername
```
This will display the permissions, owner, group, size, and modification date of the file.
# Step 2 - Changing file permissions with chmod
Now that we understand file permissions, let's look at how to change them using the "chmod" command.
The "chmod" command allows you to add or remove permissions for the owner, group, and others. The basic syntax for the "chmod" command is:
``` bash
chmod [options] mode filename
```
The "mode" parameter specifies the permissions to be set, and can be represented in one of two ways:
A string of three or four numbers (such as 755 or 644)
A string of letters (such as "rwxr-xr--")
To use the numeric method, you'll need to understand how each digit represents a specific set of permissions.
The first digit represents the permissions for the owner of the file, the second digit represents the permissions for the group, and the third digit represents the permissions for everyone else. Each digit can be a number from 0 to 7, with the following values:
0 = no permissions
1 = execute only
2 = write only
3 = write and execute
4 = read only
5 = read and execute
6 = read and write
7 = read, write, and execute
For example, the permissions "rw-r--r--" would be represented as 644 using the numeric method (because the owner has read and write permissions, and the group and others have only read permissions).
To use the letter method, you'll need to understand how each letter represents a specific set of permissions.
The letters are "r" for read, "w" for write, and "x" for execute. Each set of permissions is represented by a string of three letters, one for the owner, one for the group, and one for everyone else. For example, "rw-r--r--" would be represented using the letter method as "644".
To add permissions to a file, you can use the "+" operator followed by the permission you wish to add. For example, to add execute permission for everyone to a file, you can use the following command:
``` bash
chmod +x filename
```
This will add execute permission for everyone to the file "filename". You can also add permissions for specific user groups. For example, to add write permission for the group "users" to a file, you can use the following command:
``` bash
chmod g+w filename
```
This will add write permission for the group "users" to the file "filename". You can also use the "u" and "o" options to add permissions for the owner and everyone else, respectively.
To remove permissions from a file, you can use the "-" operator followed by the permission you wish to remove. For example, to remove write permission for the group "users" from a file, you can use the following command:
``` bash
chmod g-w filename
```
This will remove write permission for the group "users" from the file "filename".
You can also set permissions using the numeric method. To do this, you need to assign a number to each set of permissions. The number is calculated by adding up the values for each permission. The value for each permission is as follows:
r = 4
w = 2
x = 1
For example, if you want to set read and write permissions for the owner, read-only permissions for the group, and no permissions for everyone else, you would use the following command:
``` bash
chmod 640 filename
```
This sets the owner's permissions to 6 (4 + 2), the group's permissions to 4 (read-only), and everyone else's permissions to 0.
# Step 2 - Changing file ownership with chown
You can also use the "chown" command to change the owner and group of a file. To change the owner of a file, you can use the following command:
``` bash
chown newowner filename
```
This changes the owner of the file "filename" to "newowner". To change the group of a file, you can use the following command:
``` bash
chown :newgroup filename
```
This changes the group of the file "filename" to "newgroup". You can also change both the owner and group at the same time by combining the two commands:
``` bash
chown newowner:newgroup filename
```
This command can be useful if you need to transfer ownership of a file to a different user or group. However, it's important to note that you should use this command with caution as changing ownership of system files can have unintended consequences and potentially compromise the security of your system.
In addition, when changing ownership of a file, make sure that the user or group you are transferring ownership to has the necessary permissions to access and modify the file. Otherwise, you may run into issues with permission errors.
It's also worth noting that you can use the "chown" command recursively by adding the "-R" flag before the user and group arguments. This will change the ownership of all files and directories within the specified directory, including all subdirectories.
Overall, the "chown" command is a powerful tool for managing file ownership and group permissions in Linux. With a basic understanding of its syntax and options, you can easily modify permissions and ensure that your files are accessible to the appropriate users and groups.
# License
[MIT](https://github.com/netcup-community/community-tutorials/blob/main/LICENSE)
Copyright (c) 2021 netcup
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# Contributor's Certificate of Origin
By making a contribution to this project, I certify that:
1) The contribution was created in whole or in part by me and I have the right to submit it under the license indicated in the file; or
2) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same license (unless I am permitted to submit under a different license), as indicated in the file; or
3) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it.
4) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the license(s) involved.

View file

@ -0,0 +1,286 @@
---
title: Setup and Usage of Oh My Zsh
description: Learn how to set up zsh and some components in this step-by-step tutorial.
level: [beginner]
updated_at: 2023-04-18
slug: oh-my-zsh-setup-with-components
author_name: Peter Mesiha
author_url: https://github.com/MrReginaldKray
author_image:
author_bio:
tags: [shell, oh-my-zsh, linux]
netcup_product_url: https://www.netcup.eu/bestellen/produkt.php?produkt=2992
language: en
available_languages: [de, en]
---
# Introduction
This tutorial describes how to set up Oh My Zsh with some very useful components to pimp up your shell and increase your productivity with many features.
Oh my Zsh is a delightful, open source, community-driven framework for managing your zsh configuration. It comes bundled with thousands of helpful functions, helpers, plugins and themes.
# Requirements
- shell
- internet connection
# Step 1 - Install zsh/oh-my-zsh
``` bash
sudo apt install -y zsh
```
**OR**
``` bash
wget "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
```
# Step 2 - Install zsh-syntax-highlighting
``` bash
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH_CUSTOM/plugins/zsh-syntax-highlighting
```
# Step 3 - install zsh-autosuggestions
``` bash
git clone https://github.com/zsh-users/zsh-autosuggestions.git $ZSH_CUSTOM/plugins/zsh-autosuggestions
```
# Step 4 - Install autojump
``` bash
sudo apt install -y autojump
```
**OR**
``` bash
git clone git://github.com/wting/autojump.git
```
``` bash
cd autojump
```
``` bash
./install.py
```
# Step 5 - Install nerd (I will install ProFont but you can choose any nerd fornt)
``` bash
git clone https://github.com/ryanoasis/nerd-fonts.git
```
It's a big repo, time to grab a coffee. :-)
``` bash
cd nerd-fonts
```
``` bash
./install.sh ProFont
```
# Step 6 - Install colorls
``` bash
sudo apt install -y ruby ruby-dev ruby-colorize rbenv
```
``` bash
sudo gem install colorls
```
# Step 7 - Edit config (.zshrc file)
``` bash
vim .zshrc
```
*Edit .zshrc file:*
``` bash
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
#ZSH_THEME="robbyrussell"
#ZSH_THEME="agnoster"
ZSH_THEME="powerlevel10k/powerlevel10k"
# Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
# a t½Cheme from this variable instead of looking in $ZSH/themes/
# If set to an empty array, this variable will have no effect.
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable.
# ½CHYPHEN_INSENSITIVE="true"
# Uncomment one of the following lines to change the auto-update behavior
# zs½Ctyle ':omz:update' mode disabled # disable automatic updates
# zstyle ':omz:update' mode auto # update automatically without asking
# zstyle ':omz:update' mode reminder # just remind me to update when it's time
# Uncomment the following line to change how often to auto-update (in days).
# zstyle ':omz:update' frequency 13
# Uncomment the following line if pasting URLs and other text is messed up.
# DISABLE_MAGIC_FUNCTIONS="true"
# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"
# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
# You can also set it to another string to have that shown instead of the default red dots.
# e.g. COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f"
# Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765)
# COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
HIST_STAMPS="yyyy-mm-dd"
# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder
# Which plugins would you like to load?
# Standard plugins can be found in $ZSH/plugins/
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
#plugins=(git)
plugins=(
git
autojump
zsh-autosuggestions
zsh-syntax-highlighting
zsh-completions
copyfile
copypath
copybuffer
history
dirhistory
sudo
)
source $ZSH/oh-my-zsh.sh
# User configuration
# export MANPATH="/usr/local/man:$MANPATH"
# You may need to manually set your language environment
# export LANG=en_US.UTF-8
# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# fi
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
source ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
alias cl='ls'
alias ls='colorls'
alias la='colorls -a'
alias ll='colorls -l'
alias lla='colorls -la'
alias con='docker ps --format "table {{.ID}}\t{{.Status}}\t{{.Names}}\t{{.Image}}\t{{.Ports}}"'
```
# Step 8 - Install powerlevel10k
``` bash
git clone https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k
```
``` bash
exec zsh
```
# Step 9 - Configure it to fit your usecase
``` bash
p10k configure
```
ENJOY!!!
# Conclusion
As you can see, installing Oh My Zsh is quite simple, but it can significantly increase your productivity.
# License
[MIT](https://github.com/netcup-community/community-tutorials/blob/main/LICENSE)
Copyright (c) 2021 netcup
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# Contributor's Certificate of Origin
By making a contribution to this project, I certify that:
1) The contribution was created in whole or in part by me and I have the right to submit it under the license indicated in the file; or
2) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same license (unless I am permitted to submit under a different license), as indicated in the file; or
3) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it.
4) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the license(s) involved.