teleren/devto huggingface dataset:
Introduction to Zero Trust Security Models
Tags: webdev, javascript, beginners, programming
Published: 2024-05-13 00:32:17

## Introduction

Zero Trust Security Models are a relatively new concept in the world of cybersecurity. It is a security framework that emphasizes the concept of "never trust, always verify." In simple terms, it means that instead of assuming trust within a network, every user, device, and application must be continuously verified before being granted access. This approach differs from traditional security models, where once a user is granted access, they are trusted to move freely within the network. Let us delve deeper and understand the advantages, disadvantages, and features of Zero Trust Security Models.

## Advantages

One of the biggest advantages of Zero Trust Security Models is its ability to prevent lateral movement within a network. As all devices and users are continuously verified, any unauthorized access attempts are immediately identified and stopped. This provides an additional layer of security, reducing the risk of data breaches. It also ensures that only authorized users have access to sensitive data, preventing data leaks.

## Disadvantages

Implementing a Zero Trust Security Model can be a complex and resource-intensive task. It requires a complete overhaul of the existing network architecture, and many organizations may not have the necessary resources or expertise to do so. It can also result in increased network latency and user frustration due to the continuous verification process.

## Features

Zero Trust Security Models rely heavily on multi-factor authentication, granular access controls, and strong encryption to ensure network security. It also utilizes network segmentation to divide the network into smaller, more manageable segments, reducing the potential impact of a security breach.

### Key Technologies in Zero Trust

- **Multi-Factor Authentication (MFA):** Ensures that user identities are confirmed through multiple verification methods before access is granted.
  
- **Granular Access Controls:** Specify who can access which resources within the network under what conditions.

- **Network Segmentation:** Divides the network into secure zones, each requiring separate authentication, thereby limiting the spread of breaches.

## Conclusion

In today's digital age, where cyber threats are constantly evolving, traditional security models are no longer sufficient. Zero Trust Security Models provide a proactive approach to cybersecurity and are becoming increasingly popular among organizations of all sizes. Although it has its challenges, the benefits of implementing a Zero Trust Security Model far outweigh the drawbacks, making it a valuable addition to any organization's cybersecurity framework.
Leitura comentada - Arquitetura Limpa - Princípios de Design - Capítulos 7
Published: 2024-05-13 00:09:53

## S.O.L.I.D

"Bons sistemas de software começam com um código limpo. Por um lado, se os tijolos não são bem feitos, a arquitetura da construção perde a importância. Por outro lado, você pode fazer uma bagunça considerável com tijolos bem feitos. É ai que entram os princípios SOLID."

Bob defende que os princípios SOLID nos diz como organizar as funções e estruturas de dados em classes e como essas classes devem se relacionar.

### Single Responsibility Principle - S.R.P

Um módulo deve ser responsável por apenas um ator. Um módulo pode ser entendido como sendo um grupo coeso de funções e estruturas de dados. A forma de identificar a violação desse principio, é observando se uma classe faz o que não deve. Exemplo: classe Funcionário tem método para calcularPagamento, algo que deveria ser feito por um departamento de contabilidade, etc. Basicamente, o SRP diz para separarmos o código que diferentes atores dependam dele.

Caso um módulo tenha suas partes quebradas em muitas outras para atender a esse princípio, talvez o padrão _Facade_ seja uma solução.

Em um nível arquitetural, esse princípio aparece como o "Eixo de mudança (_Axis of change_)", responsável pela criação de limites arquiteturais.

### Open Closed Principle - O.C.P

O princípio do aberto-fechado defende que algo deve estar aberto para crescimento mas fechado para mudanças. Um exemplo disso, é considerarmos uma interface que gera relatórios financeiros. Essa interface não deve depender de mudanças em classes de baixo nível usadas para satisfazer a necessidade de gerar relatórios, digo, claro que são elas que fazem o trabalho pesado, mas a interface não deve mudar em detrimento do código contido nas classes de baixo nível. Todavia, essa interface deve estar aberta para carregar novos comportamentos.

O objetivo da OCP consiste em fazer com que o sistema seja fácil de entender sem que a mudança cause um alto impacto. Para isso, organizamos um sistema em uma hierarquia de dependência que proteja os níveis mais altos das mudanças dos componentes de nível mais baixo.

--- 

WIP.
James Webb Image Gallery
Tags: netlifychallenge, devchallenge, webdev, javascript
Published: 2024-05-12 23:59:15

## What I Built
For the Netlify Challenge, I decided to use my limited time to submit a Visual Feast.

I decided to make a simple gallery with React for some of my favorite images from the James Webb Telescope.

I acquired the images from the official James Webb [Flickr](https://www.flickr.com/people/nasawebbtelescope/) page.

## Demo
Here is my demo:

https://james-webb-gallery.netlify.app/
Simplifying Imports in React with Base URL Configuration
Tags: react, baseurl, javascript
Published: 2024-05-12 23:52:05

 

Managing imports in a React project can get tricky, especially as your application scales and directories get deeper. Struggling with this myself, I asked chatGPT for some advise and discovered base URLs. 

Using a base URL allows you to use absolute paths instead of relative ones, making your code cleaner and easier to maintain.

## Why Use a Base URL?

Using complex relative paths like **`../../../../components/MyComponent`** is error-prone and hard to maintain. With a base URL, you can import components using straightforward paths:

```
import MyComponent from 'components/MyComponent';

```

## How to Set Up a Base URL

You can configure a base URL in your React project by editing the **jsconfig.json**. (Sidenote: when using 'create-react-app' the file is not automatically created so you will need to create one at the base of your project.) 

Here's a simple config for **jsconfig.json**.

```
{
  "compilerOptions": {
    "baseUrl": "src"
  },
  "include": ["src/**/*"]
}
```
This configuration tells your compiler that any imports should be resolved starting from the src directory, simplifying your import statements across the project.

Hope this helps, have a great day!
DPI - Career Development
Tags: todayilearned, tdil
Published: 2024-05-12 23:37:08

Today I learned valuable skills in regard to my career development. Such skills include:

1. Elevator Pitches
2. Resume Building
3. Tips for Effective Writing

Being able to learn, grow, and establish these important career building skills has allowed me to gain an introspective view on my current professional career. I am eager to build upon these skills to enhance my future as a Software Engineer.
How to convert python byte string to byte array c-sharp/Java
Published: 2024-05-12 23:09:28

---
title: How to convert python byte string to byte array c-sharp/Java
published: true
description: python, c#, Java, aes, cryptograpy
tags: 
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2024-05-12 22:17 +0000
---


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4bbu5d996yid4o4io4vo.jpg)

1. Convert from python byte string to Hex.

2. Convert Hex to byte Array and Volia!!! Encryption continues.
Making payments with Stripe
Tags: stripe, flask, react, docker
Published: 2024-05-12 23:04:54

> Disclaimer: This is not to reference any past blogs as bad, just documenting an issue I encountered and a straightforward solution.

What brought me here? Good question. After working for sometimes on some "X" codebase, providing the tool for free, I had to integrate a payment method to it. Being a novice into these payment technologies, I got stuck on the right tutorial meant for this. Calm down, let me drag you in the more. There is this tutorial I met over the internet which was done in a few years back(I guess it was up to date but working by then), but see what the tutorial resulted to?

![Stripe Card details alert](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nuqojsi6krgqm7mu56bz.png)

## What did I you?
I did a straight integration of the Stripe code at the backend level and provided a serializer for the frontend to consume.
![Old Stripe Code integration](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/14bfja4zpwhvy0cuwujh.png)

## What I was to do
Shift to a more secure and modern integration using Stripe.js and Elements to handle card information directly on the client side. This approach should generate tokens in the browser, which are then sent to the backend. This method avoids passing sensitive card details through the backend, enhancing security, reducing PCI compliance burdens, and aligning with best practices for handling payments securely.

## Demo
![Demo gif](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/le6a0cx70qwzmbxb9mj6.gif)

## Cutting it Short
This post highlights the importance of utilizing Stripe.js and Stripe Elements for securely handling card details directly on the client-side. By implementing these tools, you can generate tokens in the browser, enhancing payment security and minimizing PCI compliance scope. 

For a complete implementation guide and best practices, refer to the [Stripe.js documentation](https://stripe.com/docs/js) and the [Stripe API documentation](https://stripe.com/docs/api).

For more detailed examples and integration patterns, please visit our [GitHub repository](https://github.com/yokwejuste/stripe-payment).

## Finally
In conclusion, as we strive to provide secure and efficient payment solutions, it's crucial to leverage the tools and features offered by platforms like Stripe. Always ensure to follow the latest practices by consulting the [official Stripe documentation](https://stripe.com/docs). This approach not only keeps your integrations secure but also ensures that you're taking full advantage of the innovations in payment technology. Stay updated, stay secure, and keep exploring the vast resources available to enhance your applications.
My first Smart Contract
Tags: blockchain
Published: 2024-05-12 22:35:51

**_This is my first Smart contract_**

GitHub link: https://github.com/astroleaf/blockchain-dev/blob/main/voting_smart_contract.sol
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3l8zq3kpjy1nd38im1id.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wpc1rg865w81bgku81lb.png)

Reinventing Democracy: Introducing Blockchain Voting

Dear All,

Exciting news! We're unveiling a game-changing solution: Blockchain Voting. This system promises transparent, secure elections by leveraging blockchain's immutability.

**_Transparent and Secure_**

Each vote is securely recorded on the blockchain, ensuring tamper-proof results. Transparent verification processes guarantee every vote's integrity.

**_Empowering Voters_**

With user-friendly interfaces and cryptographic privacy measures, voters can cast their ballots securely from anywhere. Features like vote delegation enhance inclusivity.

**_Efficient and Accountable_**

Smart contracts automate tasks, reducing costs and human error. This ensures efficient, accountable electoral processes.

**_Towards a Better Democracy_**

Join us in reshaping democracy for the digital age. Let's create a future where every voice is heard and every vote truly counts.
How to Add VSCode path to Mac path permanently
Tags: vscode, mac, zshrc
Published: 2024-05-12 22:16:46

---
title: How to Add VSCode path to Mac path permanently
published: true
description: __code .__ not found in mac terminal
tags: vscode, mac, zshrc
# cover_image:
# Use a ratio of 100:42 for best results.
# published_at: 2024-05-11 08:17 +0000
---
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6rcesl5bj47aftbvy6kn.png)

# 1. Open ~/.zshrc using the below command
_vi ~/.zshrc_

# 2. Add the following path
_export PATH="$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin"_

# 3. Source it using below command
_source ~/.zshrc_
github actions vs gitlab runners
Published: 2024-05-12 22:10:38

GitLab CI/CD and GitHub Actions both allow you to create workflows that automatically build, test, publish, release, and deploy code.

GitHub Actions and GitLab CI/CD share several configuration similarities, which makes migrating to GitHub Actions relatively straightforward.

GitLab CI/CD and GitHub Actions both allow you to create workflows that automatically build, test, publish, release, and deploy code. GitLab CI/CD and GitHub Actions share some similarities in workflow configuration:

Workflow configuration files are written in YAML and are stored in the code's repository.
Workflows include one or more jobs.
Jobs include one or more steps or individual commands.
Jobs can run on either managed or self-hosted machines.
There are a few differences, and this guide will show you the important differences so that you can migrate your workflow to GitHub Actions.

More details:
https://docs.github.com/en/actions/migrating-to-github-actions/manually-migrating-to-github-actions/migrating-from-gitlab-cicd-to-github-actions
Leitura comentada - Arquitetura Limpa - Capítulo 3, 4, 5 e 6 - Panorama dos Paradigmas
Published: 2024-05-12 21:48:13

# Descrição 

Neste capítulo, o Bob Martin busca dar uma visão geral sobre os paradigmas de programação.

## Programação Estruturada

Se refere ao uso de _if/then/else_ e _do/while/until_ em vez do uso de declarações _goto_. A programação estruturada impõe disciplina sobre a transferência direta do controle. A programação estruturada nos força a decompor um programa em um conjunto de pequenas funções comprováveis. Temos que testar essas pequenas funções para comprovar que atendem aos nossos propósitos. A programação estruturada é o motivo arquitetural de considerarmos decomposição funcional como uma boa prática.

## Programação Orientada a Objetos (P.O.O)
Descobriram que a memória _heap_ poderia armazenar um valor muito depois do retorno de uma função. Nisso, entenderam que era possível fazer uma função que instancia uma classe, variáveis locais se transformaram em variáveis de instância, e funções aninhadas se tornaram métodos. A consequência disso foi a descoberta do polimorfismo através do uso disciplinado de ponteiros de função. De forma geral, a P.O.O pode ser resumida em: a programação orientada a objetos impõe disciplina sobre a transferência indireta do controle. Uma interface pode servir para ser executada de forma que independa da implementação.

A programação orientada a objetos se sustenta a algumas coisas que existem, como encapsulamento, herança e polimorfismo. Contudo, Bob defende que essas coisas não existem por causa da P.O.O. 

Inversão de dependência também é citada como sendo efeito do polimorfismo, de forma a ressaltar a dependência de interfaces ao invés de implementações - o fluxo de controle é delegado para a implementação, enquanto a única dependência é a interface. Para Martin, OO se trata da possibilidade de ter controle absoluto através do polimorfismo, sobre cada dependência do código de um sistema.


## Programação Funcional
A programação funcional foi pensada partindo do principio de que valores dos símbolos não mudam, isso significa que uma linguagem funcional não tem nenhuma declaração de atribuição. A programação funcional impõe disciplina sobre a atribuição.

O Tio Bob diz que cada um dos paradigmas removem capacidades de um programador, considerando que cada um deles impõe algum tipo de disciplina, dizendo o que não fazer. Removem declarações _goto_, ponteiros de função e atribuições.

---
funny-selkie-dce386.netlify.app/
Tags: netlifychallenge, devchallenge, webdev, javascript
Published: 2024-05-12 21:30:42

*This is a submission for the [Netlify Dynamic Site Challenge](https://dev.to/challenges/netlify): Clever Caching*


## What I Built
<!-- Share an overview about your project. -->

## Demo
<!-- Share a link to your Netlify app and include some screenshots here. -->

## Platform Primitives
<!-- Tell us how you leveraged Netlify Cache Control. -->

<!-- Did you implement additional platform primitives like the Netlify Image CDN or Blobs? Tell us about that too! You may qualify for more than one prompt. -->

<!-- Team Submissions: Please pick one member to publish the submission and credit teammates by listing their DEV usernames directly in the body of the post. -->


<!-- Don't forget to add a cover image (if you want). -->


<!-- Thanks for participating! -->
Minify your images and save the planet 🌍🙏
Tags: netlifychallenge, devchallenge, webdev, javascript
Published: 2024-05-12 21:28:29

*This is a submission for the Netlify Dynamic Site Challenge: Visual Feast, Build with Blobs*


## What I Built

I have created a tool to optimize your images, which also analyzes how much CO2 we will save by transferring reduced images!

The idea is simple, you can upload your images and download them after optimization, thanks to which your content will be more optimal and ecological! I made sure that it is possible to upload many files at once and download them all with one click 😎

Additionally, we count how much we potentially managed to reduce CO2 emissions 🌲 by reducing the energy needed to send content! Cool! After optimization, you have a chance to become contributors in the fight against co2 emissions 🏅

## Demo

[Link to demo](https://main--optimizer-netlify-challange.netlify.app)

{% embed https://github.com/pavelee/optimizer-netlify-challenge %}

![app screen](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h0ulqw17f35epzvvwjvd.png)



## Platform Primitives

This challenge was not easy to start, initially I had no idea how to creatively use the indicated tools. The obvious idea is an image gallery, but as I'm not a great designer, I wanted to make something that would have a little more logic in it 😎

After some time, I came up with an idea **how to combine storage blob and CDN** to enable the user to optimize images? Such tools exist on the market, so there must be a problem! 👏

Additionally, to diversify the topic a bit, I thought that an incentive for optimization could be the belief that the smaller the images, the less energy is needed to transfer them. Therefore, less energy, less CO2!

> As for co2 counting, I use the library https://www.npmjs.com/package/bytes-to-co2 👏
As you can see, the problem is simplified for challenge purposes, in practice we have different co2 emissions depending on the country, it's not that simple! 🫣

To perform the optimization underneath I query Netlify's CDN to perform the optimization and then I store it in a Blob. The user can set a lower quality to perform even greater image optimization 🥳

Additionally, I use Blob as a Database 😅, I keep three objects there:

- Image (basic information about file, size etc.)
- Asset (consists of images and information about them) 
- AssetGroup (aggregates assets)

I was curious how it would work and it's good! 👏 Suitable for a simplified database. This allowed me to model a system for calculating reduced weight and CO2 after optimization.

Interestingly, when you upload, your AssetGroup will be created and its ID will appear in the link. This will allow you to return to your photos after refreshing the page! You can even share the link with someone else! 👏

See you in the next challenge! 🚂♥️
funny-selkie-dce386.netlify.app/
Tags: netlifychallenge, devchallenge, webdev, javascript
Published: 2024-05-12 21:26:17

*This is a submission for the [Netlify Dynamic Site Challenge](https://dev.to/challenges/netlify): Visual Feast.*


## What I Built
<!-- Share an overview about your project. -->

## Demo
<!-- Share a link to your Netlify app and include some screenshots here. -->


## Platform Primitives
<!-- Tell us how you leveraged the Netlify Image CDN. -->

<!-- Did you implement additional platform primitives like Netlify Blobs or Cache Control? Tell us about that too! You may qualify for more than one prompt. -->

<!-- Team Submissions: Please pick one member to publish the submission and credit teammates by listing their DEV usernames directly in the body of the post. -->


<!-- Don't forget to add a cover image (if you want). -->


<!-- Thanks for participating! -->
Firebase Needs More Compatibility for JavaScript Environments
Tags: discuss, javascript, firebase, webdev
Published: 2024-05-12 20:51:08

After writing dozens of articles for Firebase (see my [Firebase Course](https://code.build/)), I realize there is a bigger reason I haven't jumped back on board with it: Firebase JS SDKs don't run on all server environments.

## Lack of Deployment Options
Firebase only runs on **NodeJS**. This means it is incompatible with Cloudflare Workers (which Vercel Edge Functions use), Bun, Deno, or any other non-NodeJS JavaScript environments.

I don't know about you, but I don't want to run Firebase on Serverless environments with cold starts. 

## Workarounds
- [Firestore Lite](https://code.build/p/firestore-query-and-mutation-patterns-w5vhl7#edge-functions) - No Session Management or Authentication Management. Will only work for Public Fetches.
- [REST API](https://firebase.google.com/docs/reference/firebase-management/rest) - Complex fetching, manually convert JSON objects for manual tying
- [Firebase Admin REST](https://github.com/Moe03/firebase-admin-rest) - UNOFFICIAL package, still in development

## Feature Request
- [GitHub](https://github.com/firebase/firebase-admin-node/issues/1879)
- [UserVoice](https://firebase.uservoice.com/forums/948424-general/suggestions/48355772-firebase-admin-lite)
- [Issue Tracker](https://issuetracker.google.com/issues/339838695)

Is this preventing you from using Firebase? Do you use Firebase on Serverless anyway?

(Please don't post about other Firebase opinions)

J