teleren/devto huggingface dataset:
Running and accessing a docker container locally from a Vitejs React app
Tags: docker, vite, react, javascript
Published: 2023-10-11 15:25:33

To follow those steps you will need to install or have previously installed docker, you can follow [this link](https://www.docker.com/get-started/)

Finally, we'll need to create a React app, for this case, I'll use Vitejs as an example.

`yarn create vite react-docker-aws --template react-ts`

run this command after the project has been created to install all dependencies

`yarn`

then run to make sure the project is running

`yarn dev`

Now we'll create the docker file called "Dockerfile" on the root of your react project, inside this file we need to add this block of code

`FROM node:18.17.0
WORKDIR /src
COPY package*.json .
RUN npm i
COPY . .
RUN npm run build
EXPOSE 3000
CMD ["npm", "run", "dev"]`

after that, open your terminal and access the root of your project, then run this command to create the docker image based on your Dockerfile.

`docker build -t react-docker-aws .`

check if the image was created running 

`docker image ls`

now, before running your docker container, considering that we are using Vitejs, add to your package.json file the code below, --host is required to expose and test if your project is running correctly

`"dev": "vite --host"`

now we can start your docker container running the commands

`docker container run react-docker-aws`

if everything is right, we will be able to see something similar to the image below, access the network link, and see your project running.


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


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g7w72huuvo08ikul2fzc.png)
Getting started in sql for data science
Published: 2023-10-11 15:19:01

This post encompasses some of the basic commands used in sql preciously in an environment such as mysql workbench.
The best way to achieve this, is try a simple task involving creating a new database, then create a couple of tables in it after which we'll try a few manipulations on them.
I will proceed assuming you've installed [mysql workbench](https://dev.mysql.com/downloads/workbench/).
Let's get started:

a. **create a database:**

```
create database ds_sql;
```

b. **add two tables to it:**
   _first make sure sql knows which database to use_
   

```
use ds_sql;
```
   _let's create 2 tables namely: students and schools_
   

```
create table students(
id int,
first_name varchar(25),
last_name varchar(25)
);

create table schools(
	id int,
    school_name varchar(15),
    address varchar(20)
);
```
c. **let's do a few manipulations to the above tables:**

  i. adding a column to the students table
     

```
alter table students add class varchar(10);
```

  ii. change data type in one of the columns in students table
      

```
alter table students modify id varchar(10);
```

  iii. drop a column from students table
      

```
 alter table students drop class;
```

  iv. create a foreign key between the two tables

```
    alter table students add constraint primary key (id);
    alter table students add constraint foreign key 
    (school_id) references schools (id) on delete cascade on update cascade;
```

   v. drop foreign key constraint between the tables
      _since we didn't specify a constraint name during creation of the foreign key, sql defines one for us and we need to retrieve it and use it for dropping the foreign key_

```
SELECT TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME, CONSTRAINT_NAME
       FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE
       WHERE REFERENCED_TABLE_SCHEMA IS NOT NULL;
```

 _then proceeding to drop the foreign key_

```
alter table students drop foreign key `students_ibfk_1`;
```

  vi. renaming our table schools
      

```
alter table schools rename to school;
```

  vii. finally, dropping a table
      

```
 drop table school;
```

This marks the end of our post, till next.
Process events once, (pub/sub) using Nitric in GO
Tags: go, tutorial, cloudcomputing
Published: 2023-10-11 15:16:47

The **Idempotent Consumer pattern** is essential for handling duplicate messages in microservices, ensuring that processing the same message repeatedly yields the same outcome as processing it once. 

This can be achieved by tracking message IDs, either in a separate `PROCESSED_MESSAGE` table or within the business entities affected by the messages. By recording processed message IDs, a message handler can identify and discard duplicates, ensuring idempotent processing and data consistency across the microservices.

In this short tutorial we will example a simple snippet which uses a `Subscribe` method to process messages from a topic named "updates". 

Our goal is to ensure that the event is processed only once by using an inbuilt function provided by the Nitric SDK to check for duplicates.

> If you haven't used the [Nitric SDK](https://nitric.io) before, then start with this [tutorial](https://dev.to/rsiv/your-first-api-with-go-nitric-39b7).

Pre-Requisites:
1. Go installed on your machine.
2. Nitric SDK for Go.

```go
import (
  "fmt"
  "github.com/nitrictech/go-sdk/nitric"
  "github.com/nitrictech/go-sdk/nitric/faas"
)

func main() {
  updates := nitric.NewTopic("updates")

  updates.Subscribe(func(ctx *faas.EventContext, next faas.EventHandler) (*faas.EventContext, error) {
    if isDuplicate(ctx.Request) {
      return ctx, nil
    }
    // TODO: Not a duplicate, process the event
  })

  if err := nitric.Run(); err != nil {
    fmt.Println(err)
  }
}
```

By invoking `isDuplicate` with the incoming request, it checks for duplicate messages, discarding them to maintain idempotency, while processing new or unique messages accordingly.

Learn more about idempotent subscribers and patterns [here](https://microservices.io/post/microservices/patterns/2020/10/16/idempotent-consumer.html).
Indoor Delights: Embracing Rainy Days with Heartwarming Activities
Published: 2023-10-11 15:15:28

The sound of rainfall hitting the window may stir up a variety of emotions. Some could enjoy the sound of rain and the smell of damp dirt, while others could be confined inside, hoping for a sunny day. When rain continues to fall, it's important to have a list of indoor activities on hand. Thankfully, there are several options for being active, having fun, and even getting some work done.


Rainy days are ideal for curling up with a nice book or reading something you've previously seen. The sound of rain and the comfort of a lovely blanket could improve the reading experience greatly. In addition, if you like suspense or romance, the rain could truly create the tone.


Cooking is one of the finest ways to enjoy the weather during the rainy season. The warmth of an oven, the smell of freshly baked products, or the steam of a significant soup can all serve to ease the cold of a wet day, whether it's an experiment or a favorite meal. Cooking can be a fun group activity, enabling family members or housemates to take on responsibilities and enjoy the benefits of their efforts together.


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

Monsoons are a great chance to get creative! Painting, drawing, crafts, and even [diamond painting](https://diamondpaintingkit.pro/) are all wonderful ways to encourage your artistic abilities. Rain can be a tremendous source of inspiration for artists, serving as a goddess that inspires them to compose poetry, short tales, or even diary entries. Rain might not just help you overcome the blues, but it can also help you produce excellent artwork!


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

Don't let the rain stop you from enjoying nature! Growing plants indoors is one of the most relaxing and enjoyable ways to connect with nature. Watching a plant grow and bloom inside can be quite relaxing, whether you want to plant some potted plants or herbs or you're just beginning off with a small veggie garden near your window. There are several online gardening tutorials that can help you get started if you're new to gardening.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9pzy12ogq2s04mwt0yuu.jpeg)

Playing board games is one of the most wonderful things to do on a rainy day. You're missing out on a great deal of fun if you've never played board games before. There's nothing more enjoyable to do on a rainy day than playing board games, which include everything from Monopoly to Scrabble, jigsaw puzzles, and even card games.


To conclude, monsoon season can be a drag, but it is additionally an excellent opportunity to conduct satisfying indoor activities. Rainy days may be turned into fantastic memories if you see them as a time to grow, discover, and reconnect with your hobbies. It's not only about waiting for the rain to stop; it's also about acquiring the skills to read, cook, or paint in the rain.
Upload repository preview image for github topics
Published: 2023-10-11 15:13:33


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pl8fxnegxozc4nz904gt.png)
1. Go to reposatory main page.
2. Go to setting section.
3. Here you can see social preview.


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

### Upload an image according to your project.
MBA with me : Mitul Shahriyar ( Part 2 )
Tags: mba
Published: 2023-10-11 15:06:15

Creating our presentation  keeping these in mind: 
- Less is more : Less points with jokes to interact
- Keep it simple
- The medium is often more important than the message: How you present is often more important than what you present. For example. Check out [Kennedy-Nixon First Presidential Debate](https://youtu.be/gbrcRKqLSRw?si=CG9ve9MFGE0J2mC4) where Kennedy had a better style and he won for that basically
- You need to inspire people
- You need to show passion. For example:
[Best Motivational Speech by Larry Ellison](https://youtu.be/_lK1w7KGuNs?si=wh-6PhcRkj0Trbo_)
[Bill Gates presenting](https://youtu.be/pyg-DYm7b0A?si=SCu8Wt88cJWzgR7V), Steve jobs

- Deliver an experience rather and example. Steve jobs was pro in it.
- Practice a lot.
- 3 words work a lot. For example, Obama used to say 'Yes, we can'. Amazon uses 'And you're done',
Nike "Just do it" etc.
- Marketing is theatre : You are the actor (CEO) and presenting (acting) before so many people.
- Create a passion/mission statement.
- Short video clip works
- Showing product works 
- Inform, educate & entertain : Make it entertaining and let them know about your product.
For example. Starbucks founder said, "It's not about coffee. It's about passion and experience"
- Present with passion : Right from the heart . Don't read script. Watch [Matthew McConaughey's OSCAR winning moment ](https://youtu.be/wD2cVhC-63I?si=GynktERxTEN9a4dd)

- Us vs them creates loyaly: 
Show bad guy and then introduce a hero.
Check [1984 Super Bowl APPLE MACINTOSH Ad by Ridley Scott](https://youtu.be/ErwS24cBZPc?si=YRasfSe0Ij72N2Wv)

Here the enemy is IBM and the women is Apple. Haha!
Also, windows vs MAC user 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gn8nrw6t6e3i79548zp7.png)
-  Clarity is important. 

Meryl here present very clearly . See [here](https://youtu.be/5-a8QXUAe2g?si=rdXiHncxAPlFUEYc)
- Humor and self 'deprecation' (making fun of own) works well.
Example: [Conan O'brien's speech](https://youtu.be/DvoXClMs-40?si=TqI6Otp2zgP3JPWu)

- Use your hands to interact
- Use dramatic pauses.
- Be honest and sincere
- Learn something for 10,000 hours to be an expert - Malcolm Gladwell
- Talk for 4 min at max
Check best example by [Barak Obama's 4 minute speech](https://youtu.be/OFPwDe22CoY?si=0uOUj5ARugfjQK9X)

Before that, no one knew him . He started relating his story with the audience.

**Hire slowly and fire quickly**

Focus on the active performance of your employee and fire if needed.
My Hacktoberfest 2023 Pledge
Tags: hacktoberfest23
Published: 2023-10-11 14:56:22

Hi I'm Rafael Romero, a Computer Engineer and a Frontend Developer from Venezuela. I always introduce myself the same way because I'm not very known in any tech community, I am a 5 year club member of dev.to and I really enjoy reading a lot of articles and seeing the wins of the week. There are a lot of amazing people in Dev and I've always wanted to be part of the community in a more significant way, write blogs and share experiences. That's why I joined Dev in the first place and I hope to write some posts before this year's end.

I really love Hacktoberfest. My first one was in 2019 and it was --in part-- the reason why I got a job in 2020 and since then I've always tried to complete the challenge and I always try to up the complexity of my contributions. In 2020 and 2021 I was full of work in October but I successfully returned to the challenge last year, I made my first project with Next.js and overall I felt really good with my contributions even if they are small.

This year, I've had some trouble starting my open source journey but I will start today, even if I start with something simple like some minor UI changes. My goal is to keep contributing after the Hacktoberfest so I want to find projects I think are cool or innovative and if able, help with frontend related issues so I can apply my knowledge in different projects, learn from different systems and code bases and help others. 

Finally, congrats to everyone that already completed the challenge as of today, cheers to those that are half way there and for all of you that haven't made up your mind or are having some difficulties on the way, keep going, you can do it. Happy coding!
Understanding Security Groups (SG) and Network Access Control List (NACL) in AWS Cloud Infrastructure
Published: 2023-10-11 14:54:50

Security Group: A Security Group acts as a virtual firewall for an Amazon EC2 instance or a set of instances.
It controls inbound and outbound traffic for instances in the same VPC. It operates at the instance level, meaning the rules apply to every instance associated with the Security Group.

The rules in a Security Group include allowing specific IP addresses or ranges, port ranges, and protocols. It can be associated with multiple instances, and instances can be associated with multiple security groups.

Security Groups are stateful, meaning if an inbound rule allows traffic, the response traffic is automatically allowed, even if no specific rule has been defined for it.

Network Access Control List (NACL): A NACL is an optional layer of security for a subnet in a VPC. It controls inbound and outbound traffic at the subnet level. It operates on a rule basis, where a rule can be defined to allow or deny traffic based on IP, port, and protocol.

Each subnet in a VPC must be associated with a NACL, and a NACL can be associated with multiple subnets. NACLs are stateless, meaning if an inbound rule allows traffic, the response traffic is not automatically allowed. NACLs are processed before Security Groups, meaning if a rule explicitly denies traffic in a NACL, it won't be allowed even if a Security Group allows it.

Application in AWS Cloud Infrastructure: Security Groups and NACLs can be applied in AWS cloud infrastructure to control the traffic flow and enhance security. Security Groups can be used to define access rules at the instance level, allowing only necessary traffic to and from instances based on their IP, port, and protocol. It is often used to protect instances and services running in the VPC.

NACLs, on the other hand, provide an additional layer of control at the subnet level. It allows more granular control over traffic entering or leaving specific subnets.

By carefully configuring Security Groups and NACLs, organizations can enforce fine-grained access control, prevent unauthorized access, and minimize potential attack surfaces in their AWS cloud infrastructure.
New #release!!
Tags: sre, upgrade, opensource, loadbalancing
Published: 2023-10-11 14:51:13

Our new RELIANOID #Community Edition v5.21.0 simplifies your work with a #seamless process to upgrade from Community Edition to Enterprise, without the need of #redeployment.

All the info here: 

https://www.relianoid.com/blog/new-release-relianoid-adc-load-balancer-community-edition-v5-21-0/



#RELIANOID #CommunityEdition #ReleaseAnnouncement #SystemUpgrade #GrubConfiguration #FarmsFix #DebianBuster #LoadBalancer #SiteReliability #SRE #EnterpriseUpgrade #Upgrade #LoadBalancing #OpenSource #Infrastructure #ReleaseNotes
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0crbf4kab125ubsel490.png)
A free SIEM and XDR with SOC AI going open source
Tags: cybersecurity, siem, xdr, opensource
Published: 2023-10-11 14:38:22

Hey there, amazing developers!

Allow me to introduce you to UTMStack, a groundbreaking open-source project that brings together the power of SIEM (Security Information and Event Management) and XDR (Extended Detection and Response) with SOC AI (Security Operations Center Artificial Intelligence). UTMStack is designed to revolutionize threat detection and response, providing a robust security solution for organizations of all sizes.

**Unleashing the Power of UTMStack:**

1. **Free and Open Source:** UTMStack is committed to promoting accessibility and transparency by providing a free and open-source platform. This means that developers like you can easily contribute, customize, and enhance the project to suit your specific needs. Join the community and be part of the journey!

2. **SIEM and XDR Integration:** UTMStack combines the best of both worlds, bringing together SIEM and XDR capabilities. With its powerful log management and real-time analysis, UTMStack enables you to track and monitor security events across your entire infrastructure. The XDR functionality enhances threat detection and response by correlating data from multiple sources, providing a holistic view of potential threats.

3. **SOC AI for Advanced Threat Detection:** UTMStack introduces cutting-edge SOC AI, leveraging machine learning and artificial intelligence to identify and prioritize security incidents. By analyzing vast amounts of data, UTMStack's intelligent algorithms can detect anomalies, recognize patterns, and quickly respond to potential threats. This allows organizations to stay one step ahead of cybercriminals.

4. **Streamlined Incident Management:** UTMStack simplifies the incident management process by automating routine tasks, such as incident triage and ticket generation. By reducing manual efforts, SOC teams can focus on critical tasks, resulting in faster response times and improved overall security posture.

5. **Community Driven and Collaborative:** UTMStack thrives on community participation and collaboration. By joining the UTMStack community, you gain access to a network of passionate security professionals, developers, and enthusiasts. Share your insights, contribute code, suggest improvements, or simply connect with like-minded individuals who share your passion for cybersecurity.

**Get Started with UTMStack Today:**
Seema Prabhu’s Expert Insights on the Future of Testing
Tags: testing, softwaredevelopment, digital, techtalks
Published: 2023-10-11 14:11:27

As organizations embrace digital transformation, the integration of artificial intelligence (AI) in software testing processes has gained prominence. AI offers the potential to automate testing tasks, analyze vast amounts of data, and provide valuable insights to improve the effectiveness and efficiency of testing efforts.

To learn more about this topic, the LambdaTest team recently interacted with Seema Prabhu, a seasoned QA leader with 20+ years experience, at EuroSTAR 2023 in Antwerp, Belgium. Talking to her, we learnt about the various aspects of digital transformation, the role of testing in the age of remote work, the importance of non-functional testing techniques, and the potential impact of AI in testing.

Seema highlighted the significance of accessibility and the role of testing in ensuring a seamless digital experience for end-users. She said, “*In the world of digital transformation, testing is not an afterthought. Testers need to demonstrate their presence and advocate for quality even in a remote work environment.*”

Further, she emphasizes the importance of addressing critical issues that directly impact end-users, stating, “*By focusing on high-priority issues promptly, organizations can avoid disruptions and maintain a structured approach to achieving their digital transformation goals.*”

She also shares her favorite KPI for upper management and CxOs to track religiously, highlighting the need for a proactive approach to testing.

Drawing inspiration from the ancient story of Babylon, Seema discusses how teams can transition from chaos to clarity. By understanding the attributes of chaos and fostering clarity, organizations can enhance their team dynamics and overall productivity.

“*Establishing effective communication within a team requires purpose, autonomy, feedback, and social interaction,*” she states.

While closing the conversation, Seema shares some valuable advice to aspiring public speakers. She advises that overcoming nervousness is a part of the process, and she encourages individuals to embrace the opportunity to share knowledge and insights.

This blog provides just a glimpse into the informative conversation with Seema Prabhu. Her extensive expertise, practical insights, and motivational stories will leave you inspired and eager to watch the full interview.

{% youtube wzwE13XZa94  %}
The difference between fresh() and refresh() in Laravel Eloquent
Tags: programming, php, laravel
Published: 2023-10-11 14:07:05

Here's a quick blog post explaining the differences between `fresh()` and `refresh()` on Eloquent models.

Let's assume we have a Team model in hand represented by the `$team` variable.

In Laravel, both `$team->fresh()` and `$team->refresh()` are used to reload the data associated with a model from the database. However, there is a subtle difference between them in terms of how they are used:

- `$team->fresh()`:

   - `$team->fresh()` is a more explicit way to reload the model's data from the database.
   - It returns a new instance of the model with the data from the database, leaving the original model unchanged.
   - It's useful when you want to obtain a fresh instance of the model without modifying the existing one.

   Example:

   ```php
   $freshTeam = $team->fresh();
   // $team remains unchanged, and $freshTeam
   // contains the refreshed data
   ```

- `$team->refresh()`:

   - `$team->refresh()` is a method that directly refreshes the data of the existing model in-place.
   - It modifies the current instance of the model, updating its attributes with the data from the database.
   - This can be useful when you want to refresh the data of the current model without creating a new instance.

   Example:

   ```php
   $team->refresh();
   // $team is updated with the refreshed data
   ```

In summary, the key difference is that `$team->fresh()` returns a new instance with fresh data, while `$team->refresh()` updates the existing instance in-place. The choice between them depends on whether you want to work with a new copy of the model or update the existing one.