teleren/devto huggingface dataset:
My personal experience using kubecost in the Kubernetes environment
Tags: kubecost, kubernetes, costmonitoring
Published: 2023-03-21 19:57:27

## What is Kubernetes?
 Kubernetes which is also referred to as k8. k8 is an open-source container orchestration platform that automates deployment, scaling, and management of the containerized application. k8 was developed by Google and it is now currently maintained by the Cloud Native Computing Foundation (CNCF).

> k8 is currently the de facto standard for container orchestration and it is widely adopted in the industry. Kubernetes provides a platform-agnostic framework that allows developers to run containers on different cloud providers or on-premise infrastructure.

k8 architecture is based on a master-slave model, where the master node manages the overall state of the cluster and the slave nodes (also known as worker nodes) run the application workloads.

The four major Kubernetes providers are Amazon Elastic Kubernetes Service (Amazon EKS), Google Kubernetes Engine (GKE), Azure Kubernetes Service (AKS), and DigitalOcean Kubernetes (DOKS).

We also need to ensure we are not spending above our budget while running the k8 environment. Although using cloud providers gives us the flexibility of putting nodes offline and autoscaling groups ensures we don't have nodes online if not in use. However, tools like kubecost can help us to create visibility in our Kubernetes cluster.

**What is Kubecost?** Kubecost is a platform that provides cost optimization and visibility in Kubernetes clusters. Kubecost can be used in Kubernetes cluster for the following:

Cost Management: It assists to identify the cost of running the Kubernetes cluster, including the cost of infrastructure resources and other services running in the cluster.

Resource Allocation: Kubecost can help us to identify which resources in the cluster are being overutilized or underutilized.

it can also be used in capacity planning which includes forecasting resource needs for your Kubernetes cluster based on historical usage patterns.

_You can also use kubecost as an addon while using EKS. For more information https://aws-ia.github.io/terraform-aws-eks-blueprints/v4.12.1/add-ons/kubecost/ and https://docs.aws.amazon.com/eks/latest/userguide/cost-monitoring.html_

_For more general information on kubecost. kindly follow this link https://www.kubecost.com/_
Blazor Best Practices Borrowed From React
Tags: blazor, dotnet, aspnet
Published: 2023-03-21 16:26:01

_This article was originally published on_ https://www.brandonpugh.com/blog/blazor-best-practices/

Blazor took a lot of design decisions from React and other frontend frameworks and as a stateful component-based UI framework there is quite a bit of experience that can be transferred from one to the other.

I gave this talk earlier this year at KCDC and then last week I presented an updated version as a Jetbrains webinar. Special thanks to [Khalid](https://khalidabuhakmeh.com/) for inviting me on and being an excellent host!

I hope to write up the content in a more in depth post sometime soon, but in the mean time you can watch the recording on [Youtube][1] and view the slides at [brandonpugh.com/blazor-talk](https://www.brandonpugh.com/blazor-talk/#/).

Some of the points I cover:

* State management
* Reusable components
* Accessibility
* Testing


{% embed https://www.youtube.com/watch?v=q7qgSzAALLg %}
[Blazor Best Practices Borrowed from React][1]

[1]: https://www.youtube.com/watch?v=q7qgSzAALLg
Understanding Version Control with Git
Tags: webdev, beginners, git, programming
Published: 2023-03-21 19:56:47

## Introduction

Version control is a system used for managing changes to files and documents. It is an essential part of software development, where multiple developers work on the same codebase. Git is one of the most widely used version control systems. In this blog post, we will discuss what Git is, how it works, and its benefits.

## What is Git?

Git is a distributed version control system developed by Linus Torvalds in 2005. Git is a free and open-source tool that allows developers to keep track of changes made to code. It is designed to handle projects of all sizes and supports non-linear workflows. Git is easy to use and is supported on all major operating systems.
## How Does Git Work?

Git works by creating a local repository on a developer's machine. The repository contains all the files and directories of a project, along with a complete history of changes made to them. Whenever a developer makes changes to the code, Git creates a new version of the project. These versions are stored in the local repository, along with a message describing the changes made.

In addition to the local repository, Git also supports remote repositories. Developers can push their changes to a remote repository, where other developers can access and review them. This makes collaboration easier and reduces the chances of conflicts between developers.
## Benefits of Using Git

Git offers several benefits to developers. Firstly, it allows developers to work on different features of a project simultaneously without interfering with each other's work. Git also makes it easy to track changes and revert to a previous version of the project if necessary. This is especially useful when a project is in its testing phase, and developers need to identify and fix bugs quickly.

Another significant benefit of using Git is that it provides a complete history of changes to a project. This makes it easy to identify who made changes, when they made them, and why. This information is helpful when debugging a project or identifying issues that may arise in the future.

## Conclusion

Git is an essential tool for software development. It enables developers to work efficiently on projects of all sizes and ensures that changes to code are tracked and documented. Git is easy to use, supports non-linear workflows, and is supported on all major operating systems. Whether you are working alone or in a team, Git is a must-have tool in your arsenal.
FREE AWS Cloud Project Bootcamp Week 5 Part 1
Tags: aws, cloud, awscommunity, 100daysofcloud
Published: 2023-03-21 19:42:51

[80/100] #100DaysOfCloud Today, I started the Week 5 of the FREE AWS Cloud Project Bootcamp by Andrew Brown.

I watched Ashish's Week 5 - Security Considerations video - How to use Amazon DynamoDB for security and speed. He talks about Non-Relational Databases or NoSQL Databases namely DynamoDB. NoSQL DB gives the same performance level irrespective of the workload. Then he talks about the various use cases like banking and finance, gaming, media and entertainment, etc.
Then he talks about the Business use case of it and shows a demo on creating a DynamoDB Database and connect to it securely. He even implements DynamoDB Accelerator (DAX). 
He later talks about the Network Access Types to DynamoDB. Using Internet Gateway or NAT Gateway but it is not recommended best practice. Other ways are using VPC/Gateway endpoint which doesn't need to go outside to the Internet for other services to access the DB, DAX, cross account with IAM role, etc

A few of the security best practices are:
- Use VPC to create a private network from your application or Lambda to a DynamoDB. It helps to prevent unauthorized access to our instance from public internet.
- DynamoDD should only be in AWS regions that you are legally allowed to be holding user data in.
- Enable CloudTrail to monitor alerts on malicious DynamoDB behavior.
- Don't let the DynamoDB be internet accessible.
- Use appropriate IAM authentications.
- Use Organizations SCP to manage DynamoDB Table deletion, creation, region lock, etc

I still have an error in Week 4 with creating activities. Tried to solve it today and spent quite a lot of time on it but still could'nt figure it out. In the process, I came across a few silly errors and corrected them. Need to solve this as soon as possible to get on with the rest of Week 5

[GitHub](https://github.com/aaditunni/100DaysOfCloud/blob/main/Journey/080/Readme.md)

You can watch the Bootcamp through this YouTube playlist : [FREE AWS Cloud Project Bootcamp playlist](https://youtube.com/playlist?list=PLBfufR7vyJJ7k25byhRXJldB5AiwgNnWv)
Blockchain Software Development
Tags: blockchain, crypto, centralized, exchange
Published: 2023-03-21 19:10:41

[Beleaf Technologies](https://beleaftechnologies.com/) is situated at the cutting-edge of the [blockchain development](https://beleaftechnologies.com/blockchain-development-company) landscape and its practical applications. We harness our robust blockchain proficiency and amalgamate it with other technologies to deliver bespoke solutions such as [white label cryptocurrency exchange development](https://beleaftechnologies.com/white-label-cryptocurrency-exchange-software), [peer-to-peer](https://beleaftechnologies.com/p2p-cryptocurrency-exchange-development-company
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gzerhg6lyg1bin4i82mk.png)) [exchange development](https://beleaftechnologies.com/centralized-cryptocurrency-exchange-development), security token development and marketing, and initial coin offering development. Our foresighted perspectives, arduous investigations, and personalized consultations equip businesses to detect and capitalize on unprecedented opportunities within a decentralized ecosystem. Our pioneering approach and unparalleled profundity and extent of knowledge are propelling enterprises towards the forthcoming wave of digital entrepreneurship, engendering advancement and propelling substantial and affirmative changes.
How to Design Metrics With Prometheus Metric Types: the USE Method
Tags: kubernetes, tutorial, prometheus
Published: 2023-03-21 19:08:16

This is the third part of a series about designing metrics for event-driven systems. You can check [the first part](https://rnemet.dev/posts/k8s/metrics/) and [the second part](https://rnemet.dev/posts/k8s/metrics_types/) of this series before proceeding.

While I discussed the general principles of designing metrics in the first part, I explained Prometheus metric types in the second part. I applied them as the RED method in the second part. In this article, I'll explain the USE method with Prometheus. Finally, a short discussion about the Four Golden Signals and a conclusion about all the methods.

Let's go...

## The USE Method

[The USE method by Brendan Gregg](http://www.brendangregg.com/usemethod.html) is a set of rules for designing metrics mainly used for the system not exposed to the users, like databases, message brokers, streaming platforms, etc.
Its key metrics are:

* **U**tilization - the level to which a resource has been used
* **E**rrors - distribution of the number of errors per time
* **S**aturation - the level to which a resource has extra work which can not be handled. It has to wait or drop extra work.

## Implementation

I'll make an example of the USE method observing a CPU, memory, and network to simplify things and be close to what we use in daily work. I did examples using docker-compose, Prometheus, and Grafana. To get metrics from the system, I'm using the [node-exporter](https://prometheus.io/docs/guides/node-exporter/). The complete example is in my [github repo](https://github.com/robert-nemet/dc-playground).

### CPU Utilization

CPU utilization is the percentage of time the CPU is busy. The node-exporter provides the `node_cpu_seconds_total` metrics. This metric is a counter which counts the number of seconds the CPU has spent in each mode. One of the modes is `idle`, which is when the CPU is not busy.

In a period, say 1m, observe an average change in the `idle` counter. When subtracting a previously calculated value
from 1, we get the CPU utilization:

```promql
1 - avg(rate(node_cpu_seconds_total{mode="idle"}[1m]))
```

It is the same principle as in the RED method. We use counters, observe the rate of change, and then calculate the average.

If you are interested, continue to the [rest on my blog](https://rnemet.dev/posts/k8s/metrics_use_method/).
Modern Next.js starter + folder architecture
Tags: nextjs, architecture, productivity, typescript
Published: 2023-03-21 18:49:43

A modern [Next.js](https://nextjs.org/) starter fully configured with a solution for Tailwind, ESLint, Prettier, file structure, paths aliases, and more

Github template: https://github.com/sam-621/nextjs-starter

This template is designed to maintain medium and large frontend applications thanks to modularization by concepts and entities which allows us to have the business logic, the internal logic of the application, and the markup organized by entities or concepts of our system making easier the files searching, naming and system understanding.


There is a deeper explanation in the [README](https://github.com/sam-621/nextjs-starter#readme) and also in each directory with examples of folder structure and files
Goodbye create-react-app
Tags: react, createreactapp, vite
Published: 2023-03-21 18:43:06

React developer team recently removed `create-react-app` from the official documentation. This means it is no longer the default method of setting up a new project in React. According to [this](https://github.com/reactjs/react.dev/pull/5487) pull request on Github, `create-react-app` is finally gone.

### The problem with CRA

For far too long,`create-react-app` or CRA has had problems with its performance. It is slow and bulky compared to the modern methods. The initial setup is quite bulky as there are a lot of dependencies to be installed. It also is outdated as the dependencies themselves suffer from warnings during installation. These problems have troubled developers for far too long. Since CRA was the officially supported way, beginners had a hard time solving these issues.

### What are the alternatives?

There are various ways to setup a new React project. In fact, the official documentation now mentions [frameworks like NEXT-JS, Remix etc for beginners](https://react.dev/learn/start-a-new-react-project). In this post however, we will look into using *Vite* to setup our React app in under a minute.

### Why Vite?

Vite is one of the fastest ways to start a project in react. It has faster server start time. It has better compatibility with plugins. It supports TypeScript, has better dependency resolving features out of the box. React projects created from Vite are just 20% the size of that created by CRA. You can read more about Vite [here](https://vitejs.dev/)

### Creating a new React project using Vite

Let's create a new React project using Vite. Run the following in the folder where you want your new app.

```
npm create vite@latest
```

![Vite setup](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/unym50u8fhr5om4leunk.jpg)

Name your project and select React from the type of project. Next select variant, here we are using JavaScript. 

![React Variant](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0hhtifqvjvfwdlecc5vm.jpg)

And it is done! Seriously, that's it. All of this takes less than a minute to setup. 
You can now run the app using
```
cd <project-root>
npm i
npm run dev
```

Your app is up and running

![React app running](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4hl543me0uwnnroljexc.jpg)

Congratulations!🎉🎉
Perform case-insensitive sorting in Solr
Tags: solr, java
Published: 2023-03-21 18:17:37

To perform case-insensitive sorting in Solr, you can create a custom field type that applies a lowercasing filter, so that the text is indexed in lowercase. This way, when you sort on this field, it will effectively ignore the case of the original text.

Here's an example of how you can create a custom field type that ignores case sensitivity:

```xml
<fieldType name="text_sort_ignore_case" class="solr.TextField" sortMissingLast="true" omitNorms="true">
  <analyzer>
    <tokenizer class="solr.KeywordTokenizerFactory"/>
    <filter class="solr.LowerCaseFilterFactory"/>
  </analyzer>
</fieldType>
```

Now, you can use this custom field type for fields that need case-insensitive sorting:

```xml
<field name="title_sort_ignore_case" type="text_sort_ignore_case" indexed="true" stored="false" multiValued="false"/>
```

When you want to sort your search results, you can use the **`sort`** parameter in your query:

- For ascending order: **`sort=title_sort_ignore_case asc`**
- For descending order: **`sort=title_sort_ignore_case desc`**

This will sort your search results in ascending or descending order while ignoring case sensitivity.

Applying a LowerCaseFilter in Solr does have a small impact on performance, but it is generally negligible. The LowerCaseFilter is a simple and lightweight filter that converts text to lowercase during the indexing process. The performance impact occurs only once during indexing and not during every search query.

However, if you have a very large dataset and you are concerned about the performance, you can always evaluate the filter's impact by benchmarking your Solr instance with and without the LowerCaseFilter applied. This will give you a better understanding of how the filter affects the performance of your specific use case.

In most situations, the benefit of case-insensitive sorting outweighs the minor performance hit introduced by the LowerCaseFilter. The filter is widely used and considered a standard part of text analysis pipelines in Solr and other search platforms.
O uso do FireBase no React Native
Tags: reactnative, programming
Published: 2023-03-21 18:02:19

O Firebase é uma plataforma em nuvem desenvolvida pela Google para ajudar os desenvolvedores a criar aplicativos móveis, web e de desktop com rapidez e eficiência. Ele oferece uma série de serviços, como autenticação de usuários, armazenamento de dados em tempo real, hospedagem de arquivos, análise de dados e muito mais. Neste artigo, vamos explorar como usar o Firebase API no React Native para criar aplicativos móveis.

**Instalação e configuração do Firebase**

Para utilizar o Firebase, é necessário criar uma conta e um projeto no Firebase Console. Em seguida, você deve habilitar o método de autenticação com e-mail e senha em Authentication > Sign-in method e criar uma aplicação do Android ou iOS. Para finalizar a configuração, baixe o arquivo de configuração gerado pelo Firebase e adicione-o ao seu projeto.

Com Firebase, é possível armazenar usuários, dados, arquivos, tokens para notificações por push e muito mais. Toda essa informação fica disponível nos clientes para dispositivos móveis a partir dos SDKs do Firebase, que são compatíveis com o React Native.

**Criando uma Autenticação de usuários**

O Firebase oferece uma API fácil de usar para autenticação de usuários, que inclui autenticação de e-mail/senha, autenticação do Google, autenticação do Facebook e muito mais. Para usar a API de autenticação do Firebase, você precisa importar o módulo de autenticação do Firebase e chamar os métodos apropriados para autenticar o usuário.

Para começar, é necessário instalar o pacote do Firebase no seu projeto React Native. Para isso, execute o comando npm install --save @react-native-firebase/app ou yarn add @react-native-firebase/app. Em seguida, crie um arquivo firebase.js na raiz do seu projeto e adicione as credenciais do seu projeto Firebase.

```
import firebase from 'firebase/app';
import 'firebase/auth';
import 'firebase/database';
import 'firebase/storage';

const firebaseConfig = {
  apiKey: "YOUR_API_KEY",
  authDomain: "YOUR_AUTH_DOMAIN",
  databaseURL: "YOUR_DATABASE_URL",
  projectId: "YOUR_PROJECT_ID",
  storageBucket: "YOUR_STORAGE_BUCKET",
  messagingSenderId: "YOUR_MESSAGING_SENDER_ID",
  appId: "YOUR_APP_ID"
};

firebase.initializeApp(firebaseConfig);

export default firebase;
```
O código acima importa os módulos necessários do Firebase, define as credenciais do projeto Firebase e inicializa o Firebase no aplicativo.

Em seguida, você pode autenticar o usuário usando a autenticação de e-mail/senha e a autenticação do Google. Depois de autenticar o usuário com sucesso, você pode acessar as informações do usuário usando `userCredential.user` ou `result.user`, respectivamente.

O Firebase é uma excelente opção para criar aplicativos já conectados à rede e com possibilidade de autenticação de usuários e outras ferramentas úteis. Experimente o Firebase API no React Native e veja como ele pode ajudar no desenvolvimento de seus aplicativos móveis.
Why maintenance planner software is important for your devices and plants
Published: 2023-03-21 17:12:41

You can manage repairs and maintenance for all of your tools and equipment with the help of the [PVS maintenance planning software](https://www.pvsid.com/wartungsplaner-software-digitale-wartungsplanung). 

To make sure you always have the appropriate certificates and documentation on hand, go digital with your maintenance programme.

You may schedule digital maintenance and organise upkeep tasks with maintenance tracking software.

Planning repairs and maintenance is made simple by the user interface's customizability and suitability for all systems.

Maintenance management is simple with PVS!
Subir aplicação web DJANGO em um servidor Linux 1/2
Tags: beginners, braziliandevs
Published: 2023-03-21 17:12:30

Colocar no ar uma aplicação web Django em um servidor Linux envolve várias etapas. Aqui está um passo a passo detalhado para ajudá-lo nesse processo:

Prepare o servidor Linux:

- Atualize o sistema operacional com os comandos **`sudo apt update`** e **`sudo apt upgrade`**.
- Instale dependências necessárias: **`sudo apt install python3-pip python3-venv python3-dev libpq-dev`**.

Transfira o código da aplicação Django para o servidor:

- Use um cliente SFTP, SCP ou Git para transferir o código-fonte do seu projeto Django para o servidor.

Configurar um ambiente virtual Python:

- Crie um ambiente virtual: **`python3 -m venv myenv`**.
- Ative o ambiente virtual: **`source myenv/bin/activate`**.
- Instale as dependências do projeto: **`pip install -r requirements.txt`**.

Configure o arquivo settings.py do Django:

- Modifique a variável **`ALLOWED_HOSTS`** para incluir o endereço IP ou domínio do seu servidor.
- Configure o banco de dados, se necessário. Por exemplo, para um banco de dados PostgreSQL, instale a biblioteca psycopg2 e configure a variável `DATABASES`.

Migre o banco de dados e colete arquivos estáticos:

- Execute as migrações: **`python manage.py migrate`**.
- Colete os arquivos estáticos: **`python manage.py collectstatic`**.

Instale e configure o servidor web Gunicorn:

Instale o Gunicorn no ambiente virtual: **`pip install gunicorn`**.
- Execute o Gunicorn para testar a aplicação: **`gunicorn --bind 0.0.0.0:8000 myproject.wsgi`**.

Configure o servidor web Nginx como proxy reverso:

- Instale o Nginx: **`sudo apt install nginx`**.
- Remova o link simbólico padrão do Nginx: **`sudo rm /etc/nginx/sites-enabled/default`**.
- Crie um arquivo de configuração para o seu projeto: **`sudo nano /etc/nginx/sites-available/myproject`**.
- Adicione a configuração do proxy reverso, substituindo "myproject" e "8000" pelos valores apropriados para o seu projeto:

```python
server {
    listen 80;
    server_name mydomain.com;

    location / {
        proxy_pass http://127.0.0.1:8000;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }

    location /static/ {
        alias /path/to/static/files/;
    }
}
```
- Crie um link simbólico para o arquivo de configuração: **`sudo ln -s /etc/nginx/sites-available/myproject /etc/nginx/sites-enabled/`**.
- Verifique se a configuração do Nginx está correta: **`sudo nginx -t`**.
- Reinicie o Nginx: `sudo systemctl restart nginx`.

Continuação: https://dev.to/feministech/subir-aplicacao-web-django-em-um-servidor-linux-22-300g
Fonte: ChatGPT4.0