teleren/devto huggingface dataset:
Comment générer une clé SSH RSA ?
Tags: howto, tutorial, french
Published: 2023-05-15 13:16:00

Pour générer une clé SSH RSA, il vous faudra utiliser votre **Terminal sous linux** ou utiliser **WSL ou le terminal Git sous Windows**.

Une fois que vous avez votre terminal de prêt, exécutez la commande suivante :
```bash
ssh-keygen -t rsassh-keygen -t rsa
```

Directement, quelques questions vous seront posées.

La première est pour savoir **à quel endroit vous voulez stocker la clé** *(ce qui inclue le chemin où sera stocké la clé, ainsi que son nom)*
```
Enter file in which to save the key (/home/dummy/.ssh/id_rsa):
```

Ensuite, il vous sera demandé une **passphrase**, un mot de passe pour protéger utilisation de cette clé
```
Enter passphrase (empty for no passphrase):
```
puis la confirmation de cette passphrase
```
Enter same passphrase again:
```

> **Il est vivement conseillé de définir une passphrase pour des raisons de sécurité.**  Après en fonction de votre contexte, il peut être plus utile de ne pas en avoir, mais reposez-vous quand même la question pour être sûr de vous.

Ensuite vous devriez avoir quelque chose comme ce qui suit qui devrait apparaître
```
Your public key has been saved in /home/dummy/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:IP109CmXCOaMvnu2UXbnoJuiVFmh3u6aN7DLalg4uJQ dummy@dummy
The key's randomart image is:
+---[RSA 3072]----+
|        o o      |
|     . = + + o   |
|    . + = = =    |
|     o = = o     |
|   o .. S + o .  |
|  E o .o.+ o +   |
| . . +o .oo   .  |
|  . ...o=+oo     |
|     .+=**+.     |
+----[SHA256]-----+
```
Bien évidemment les informations contenues seront complètement différentes.

Une fois fait, vous allez pouvoir trouver **2 fichiers**:
- `id_rsa.pub` *(vu que j'ai nommé ma clé id_rsa)* qui est la **clé publique**
- `id_rsa`  qui est la **clé privée**

> **Assurez-vous de conserver votre clé privée dans un endroit sûr et de ne pas la partager!**

---

J'espère que ça vous aidera! 🍺

---

<center><h3>Vous voulez me supporter?</h3></center>
<a href="https://www.buymeacoffee.com/mxguilbert7" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" height="41" width="174"></a>
Set up WordPress with Docker compose
Tags: webdev, tutorial, docker, wordpress
Published: 2023-05-15 13:14:55

Docker compose is a tool for defining and running multi-container Docker applications. With Compose, you use a YAML file to configure your application’s services. Then, with a single command, you create and start all the services from your configuration.

Itʼs worth noting that all required images are acquired from [Docker Hub](https://hub.docker.com/):
- [WordPress](https://hub.docker.com/_/wordpress) - the official WordPress Docker image with all WordPress files, Apache server and PHP;
- [MySQL](https://hub.docker.com/_/mysql) - required for MySQL root user, password, and database connection variables;
- [phpMyAdmin](https://hub.docker.com/_/phpmyadmin) - a web application for managing databases.

**Check Docker Compose version**
Open your favorite command line interface and check the Docker Compose installation version:
`docker compose version`

This will confirm that the Compose module is working correctly.

**Create a project folder**
Create a new project directory for WordPress application and navigate to it with the following command:
`mkdir ~/wordpress && cd ~/wordpress`

**Create the docker-compose.yml file**
Using your preferred text editor, create a new **docker-compose.yml** file and add the contents below:

```
version: "3" 
# Defines which compose version to use
services:
  # Services line define which Docker images to run. In this case, it will be MySQL server and WordPress image.
  db:
    image: mysql:5.7
    # image: mysql:5.7 indicates the MySQL database container image from Docker Hub used in this installation.
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: MyR00tMySQLPa$$5w0rD
      MYSQL_DATABASE: MyWordPressDatabaseName
      MYSQL_USER: MyWordPressUser
      MYSQL_PASSWORD: Pa$$5w0rD
      # Previous four lines define the main variables needed for the MySQL container to work: database, database username, database user password, and the MySQL root password.
  wordpress:
    depends_on:
      - db
    image: wordpress:latest
    restart: always
    # Restart line controls the restart mode, meaning if the container stops running for any reason, it will restart the process immediately.
    ports:
      - "8000:80"
      # The previous line defines the port that the WordPress container will use. After successful installation, the full path will look like this: http://localhost:8000
    environment:
      WORDPRESS_DB_HOST: db:3306
      WORDPRESS_DB_USER: MyWordPressUser
      WORDPRESS_DB_PASSWORD: Pa$$w0rD
      WORDPRESS_DB_NAME: MyWordPressDatabaseName
# Similar to MySQL image variables, the last four lines define the main variables needed for the WordPress container to work properly with the MySQL container.
    volumes:
      ["./:/var/www/html"]
volumes:
  mysql: {}
```

**Run Docker compose**
With the **docker-compose.yml** created, run the following command in the same wordpress directory to create and start the containers:
`docker compose up -d`
Padrão Give-When-Then: Organizando Testes com Clareza
Tags: testing, csharp, beginners, tutorial
Published: 2023-05-15 12:24:41


O padrão Give-When-Then, também conhecido como Dado-Quando-Então, é uma abordagem comumente utilizada em testes unitários para organizar o código do teste de forma clara e concisa. Esse padrão divide o teste em três seções distintas, cada uma delas desempenhando um papel importante na estruturação e legibilidade do teste.

## Give (Dado)

Na seção "Give" (Dado), preparamos o ambiente de teste e definimos o estado inicial necessário para o teste. Aqui, configuramos as condições iniciais, instanciamos objetos, fornecemos entradas e criamos qualquer outro contexto necessário para a execução do teste.

## When (Quando)

Na seção "When" (Quando), executamos a ação ou o comportamento específico que está sendo testado. Essa etapa envolve a chamada de um método ou a execução de uma operação específica do sistema que desejamos testar. É importante manter essa etapa focada e direcionada ao objetivo do teste, evitando a realização de ações desnecessárias ou não relacionadas.

## Then (Então)

Na seção "Then" (Então), verificamos se o resultado da ação realizada corresponde ao resultado esperado. Aqui, comparamos o valor retornado, o estado atual dos objetos ou qualquer outro aspecto relevante do sistema ou método em teste com o comportamento desejado. Essa verificação é feita utilizando asserções ou afirmações, garantindo que o teste valide corretamente o comportamento esperado.

## Exemplo:

```csharp
using Xunit;
using FluentAssertions;

public class CalculatorTests
{
    private Calculator calculator;

    public CalculatorTests()
    {
        calculator = new Calculator();
    }

    [Fact]
    public void GiveTwoNumbers_WhenCalled_ThenShouldReturnSumOfNumbers()
    {
        // Give
        int x = 5;
        int y = 3;

        // When
        int result = calculator.Add(x, y);

        // Then
        result.Should().Be(8);
    }
}
```

No exemplo acima, estamos testando o método `Add` de uma calculadora. Através do uso do padrão Give-When-Then, conseguimos estruturar o teste de forma clara:

- Na seção "Give", definimos os valores `x` e `y` como 5 e 3, respectivamente.
- Na seção "When", chamamos o método `Add` da calculadora, passando os valores `x` e `y` como argumentos.
- Na seção "Then", verificamos se o resultado retornado pelo método `Add` é igual a 8, utilizando a asserção `result.Should().Be(8)`.

A utilização do padrão Give-When-Then proporciona uma estrutura clara para os testes, facilitando a leitura e entendimento das diferentes etapas envolvidas. Além disso, ajuda a manter o foco do teste em cada ação específica, tornando-o mais legível e fácil de dar manutenção. Ao aplicar esse padrão, é possível obter testes mais claros, confiáveis e de fácil compreensão para toda a equipe de desenvolvimento.
How to install WordPress with Docker
Tags: webdev, tutorial, docker, wordpress
Published: 2023-05-15 13:08:44

Lately, for a technical interview, I have been asked the following task: install WordPress with Docker and explain how you do it.

Before jumping on how I have done it, let's clarify what is Docker and its composition.

### What is Docker?

Docker is a platform that allows containerisation of software packages (e.g. build, ship, run the software anywhere) based on Linux kernel (but Windows and MacOS are also supported).

**What does it contain?**

Docker is composed of:
- a client
- a host
- a registry

![Docker composition](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kosbqxvl7l7po7jm70vw.png)

The **client** is Docker CLI (Command Line Interface), this app runs in the terminal.
The **host** runs in the background, it manages the containers and images.
The **registry** is where the images are pushed to.


### WordPress

I don't think I need to introduce WordPress, but if you don't know it, you can check the following [link](https://kinsta.com/knowledgebase/what-is-wordpress/).

However, I need to spend more time explaining how to install WordPress with Docker.

There are two methods available to install and set up WordPress on Docker:
- [with the CLI](https://dev.to/ant1ne/set-up-wordpress-with-docker-cli-3oj6),
- [with Docker compose](https://dev.to/ant1ne/set-up-wordpress-with-docker-compose-13o0)
The Internals of PostgreSQL: Query Processing - Part 2
Tags: postgres, apacheage, age, apache
Published: 2023-05-15 13:06:05

We will be discussing rest of the three subsystems in detail in this article.

Rewriter
Planner
Executor

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/splgvde6fpj4buo9vhnl.png)

## Rewriter
The rewriter is responsible for implementing the rule system and modifying a query tree based on the rules stored in the pg_rules system catalog, if required.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2ive7sweifyuk7tt03bq.png)

## Planner
After receiving the query tree from the rewriter, the planner in PostgreSQL undertakes the task of generating a plan tree that can be executed by the executor in the most efficient manner.
It's important to note that the planner in PostgreSQL exclusively relies on cost-based optimization and does not support rule-based optimization or hints.
A plan tree is composed of elements called plan nodes, and it is connected to the plantree list of the PlannedStmt structure. These elements are defined in plannodes.h.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p9bs5ei23841a5sjyp8k.png)

## Executor
The executor in PostgreSQL relies on information provided by each plan node to carry out the processing tasks. In the case of a single-table query, the executor processes the plan tree from the end to the root.

For instance, consider the plan tree illustrated for a simple plan tree above, consisting of a sort node followed by a sequential scan node. In this scenario, the executor scans the table "tbl_a" using a sequential scan and subsequently sorts the obtained result.
To interact with tables and indexes within the database cluster, the executor utilizes the buffer manager. During query processing, the executor makes use of pre-allocated memory areas such as temp_buffers and work_mem, and creates temporary files as necessary.
Moreover, PostgreSQL employs a concurrency control mechanism to ensure consistency and isolation of running transactions when accessing tuples. 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dngaofcha39l7x0iukic.png)
Directive Composition API
Tags: angular, webdev, tutorial, programming
Published: 2023-05-15 13:02:17

The directive composition API lets you apply directives to a component's host element from within the component TypeScript class.

**Adding directives to a component**

You apply directives to a component by adding a hostDirectives property to a component's decorator. We call such directives host directives.

In this example, we apply the directive **MenuBehavior** to the host element of AdminMenu. This works similarly to applying the** MenuBehavior** to the <admin-menu> element in a template.

`@Component({
  selector: 'admin-menu',
  template: 'admin-menu.html',
  hostDirectives: [MenuBehavior],
})
export class AdminMenu { }`

- When the framework renders a component, Angular also creates an instance of each host directive. The directives' host bindings apply to the component's host element. By default, host directive inputs and outputs are not exposed as part of the component's public API. See Including inputs and outputs below for more information.

- Angular applies host directives statically at compile time. You cannot dynamically add directives at runtime.

- Directives used in hostDirectives must be standalone: true.

- Angular ignores the selector of directives applied in the hostDirectives property.

**Including inputs and outputs**

When you apply hostDirectives to your component, the inputs and outputs from the host directives are not included in your component's API by default. You can explicitly include inputs and outputs in your component's API by expanding the entry in hostDirectives:

`@Component({
  selector: 'admin-menu',
  template: 'admin-menu.html',
  hostDirectives: [{
    directive: MenuBehavior,
    inputs: ['menuId'],
    outputs: ['menuClosed'],
  }],
})
export class AdminMenu { }`

By explicitly specifying the inputs and outputs, consumers of the component with hostDirective can bind them in a template:

`<admin-menu menuId="top-menu" (menuClosed)="logMenuClosed()">`

 you can alias inputs and outputs from hostDirective to customize the API of your component:

`@Component({
  selector: 'admin-menu',
  template: 'admin-menu.html',
  hostDirectives: [{
    directive: MenuBehavior,
    inputs: ['menuId: id'],
    outputs: ['menuClosed: closed'],
  }],
})
export class AdminMenu { }`

`<admin-menu id="top-menu" (closed)="logMenuClosed()">`
What Was Your Toughest Coding Concept in python?
Published: 2023-05-15 12:58:18

Understanding the complexities of OOP, Decorators, Generators, Multithreading, Exception Handling, Regular Expressions, Async/Await, Functional Programming, Meta-Programming, and Network Programming in Python makes you a hard level coder in python.

Some people do not agree with this choices but if you do, you must check https://www.udemy.com/course/python-the-complete-python-developer-course/?.

Thanks for reading, and I hope this source will help you gain a better understanding of the most challenging Python concepts!
The Internals of PostgreSQL: Query Processing - Part 1
Tags: apache, postgres, age
Published: 2023-05-15 12:50:07

Query processing is a critical aspect of any database management system, and PostgreSQL excels in this domain with its efficient and versatile query processing capabilities. In this article, we delve into some valuable insights to gain a comprehensive understanding of PostgreSQL's query processing mechanisms.

## Backend Subsystems
We cover the first two systems in this part 1.

Parser
The parser generates a parse tree from an SQL statement in plain text.

Analyzer
The analyzer carries out a semantic analysis of a parse tree and generates a query tree.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p5vp53bvb50lrbc141xz.png)

## Parser
The parser in PostgreSQL is responsible for transforming an SQL statement written in plain text into a parse tree. This parse tree serves as a structured representation of the SQL statement, allowing subsequent subsystems to interpret and analyze it. The root node of the parse tree is the SelectStmt structure, defined in parsenodes.h.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/keeljis7zucfdwup76d1.png)
The numbering of elements in the SELECT query and the corresponding parse tree elements are identical. For instance, the first item in the target list, which is the column 'id' of the table, is numbered (1), while the WHERE clause is numbered (4), and so on.
The parser is responsible for checking the syntax of the input query when generating a parse tree. Therefore, it only reports an error if there is a syntax error in the query.
However, the parser does not verify the semantics of the input query. For example, if the query contains a table name that does not exist, the parser does not report an error. The analyzer is responsible for performing semantic checks.

## Analyzer
After the parser generates a parse tree, the analyzer performs a semantic analysis and produces a query tree.
The Query structure, which is defined in parsenodes.h, serves as the root of the query tree. This structure contains metadata about the query.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/35k42uud1d2kapk8lnkr.png)

Here is a brief description of the query tree:
The targetlist is a list of columns that represent the output of the query. In this example, the targetlist consists of two columns: 'id' and 'data'. If the input query tree uses the '*' (asterisk) symbol, the analyzer/analyser will replace it with all of the columns explicitly.
The range table is a list of relations that are used in the query.
The join tree stores the FROM and WHERE clauses.
The sort clause is a list of SortGroupClause.
Exploring the Pros and Cons of Pursuing an MBBS Abroad
Tags: tensorinternational
Published: 2023-05-15 12:42:43

Becoming a medical doctor is a dream of many students across the world. However, the admission process for MBBS programs in top medical colleges and universities is highly competitive and challenging. Due to the limited number of seats available in these institutions, many students opt to pursue an MBBS degree abroad.

Pursuing an MBBS degree abroad can offer numerous advantages. For instance, students can get admission to reputed medical universities without going through the intense competition that characterizes the admission process of their home country's top medical colleges. Moreover, studying MBBS abroad can expose students to diverse cultures, medical practices, and languages, which can broaden their horizons and enhance their cross-cultural competencies.

One of the most significant advantages of studying MBBS abroad is the lower cost of tuition fees. In many countries, especially in Europe and Asia, the cost of medical education is significantly lower than in the United States or Canada. This means that students can save a substantial amount of money while still obtaining an internationally recognized medical degree.

However, pursuing an MBBS degree abroad also comes with its challenges and risks. One of the biggest challenges is the language barrier. In many countries, the language of instruction for MBBS programs is not English. This can be a significant obstacle for international students, especially those who are not proficient in the local language.

Additionally, some countries have different healthcare systems, medical practices, and regulations than what students are familiar with in their home country. This can lead to cultural shock and can affect their overall learning experience. Furthermore, some employers and medical boards may not recognize medical degrees obtained from certain countries, which could limit career opportunities.

**In conclusion **
pursuing an **[MBBS degree abroad](https://tensorinternational.com/)** can be an excellent opportunity for students to obtain a high-quality medical education at a lower cost and experience diverse cultures. However, students must carefully weigh the pros and cons of studying abroad and conduct thorough research before making a decision. Ultimately, the decision to pursue an MBBS degree abroad depends on individual circumstances, preferences, and goals.
How to Minify CSS and JavaScript in WordPress?
Tags: css, wordpress, javascript, developer
Published: 2023-05-15 12:32:14

Do you want to prevent your WordPress website from loading slowly? Minifying your CSS and JavaScript files is a good method to increase speed. The manual and plugin techniques to minify CSS and JavaScript in WordPress are discussed in this article. You will be familiar with the resources to increase the functionality and speed of your website by the conclusion of this tutorial.

**What is CSS Minification WordPress?**

CSS minification in WordPress decreases the size of the website's CSS files by removing unused characters like comments, whitespace, and line breaks from CSS code. As a consequence, the loading time of the website is shortened, which ultimately improves user experience by making the website quicker.

**What is JavaScript Minification WordPress?**

WordPress's minification function removes unnecessary characters from JavaScript code, including whitespace, comments, and line breaks. This procedure minimizes the size of the JavaScript files, which speeds up the user experience by decreasing the time it takes for the website to load.

**Why Should You Minify Your Files?**
1. Improved Page Load Speed
2. Better User Experience
3. Improved SEO
4. Reduced Bandwidth Usage

**How to do CSS & JavaScript Minification in WordPress?**
1. Use Plugins
2. WP Super Minify
3. W3 Total Cache
4. Autoptimize
5. Use Online Tools
6. Use Software Development Tools
7. Manually Minify Your Files

**Tips for Optimizing Performance after Minification**
1. Caching Options
2. Content Delivery Network (CDN)
3. Image Optimization

Using this method, you may minify your CSS and JavaScript files to improve user experience and speed up your website's loading. Take action right now to increase your website's speed and effectiveness to prevent long loading times from turning off visitors and customers. Our detailed tutorials will provide you the knowledge and abilities you need to succeed whether you manually minify your files or use a plugin. So, [This article](https://www.organizedthemes.com/how-to-minify-css-and-javascript-in-wordpress/) will help you to find Minify CSS and JavaScript in WordPress.