teleren/devto huggingface dataset:
Using AWS Network Access Analyzer to Explore your Network
Tags: cloud, networking, security
Published: 2023-10-01 11:33:55

Networking is the most important & complicated part of your architecture, especially when it comes to a large corporate or organization.

If you have a large network and large number of offices, you will need to have a full control of your network and you need to be able to secure it and know if there are any unintended findings for your network.

AWS has a feature called Network Access Analyzer; this feature allows you to identify unintended network access to your resources on AWS.

It used to let you know if there are network paths don't meet your requirements, which helps you to have a full view & control for your AWS network architecture, beside that it helps you to check network compliance requirements. 

AWS Network Access Analyezer can help you with the below:

- Let you know which resources on your network can be accessed through IGW.
- Check if you have required network controls (Firewalls, NAT).
- It makes sure your resources are accessible from a trusted IPs only.


## Using AWS Network Access Analyzer

1. Go to AWS console and search for Network Manager 

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

2. Select Network Access Analyzer from the left panel under security & governance, then press get started.

3. there will be default 4 scopes exist as below:

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

the 4 scopes are

1. **All-IGW-Ingress (Amazon created)** – Identifies network paths from internet gateways to all network interfaces in your account.

2. **All-IGW-Egress (Amazon created)** – Identifies network paths from all network interfaces to internet gateways in your account.

3. **All-VPC-Ingress (Amazon created)** – Identifies inbound paths from internet gateways, peering connections, VPC endpoints, VPNs, and transit gateways to all VPCs in your account.

4. **All-VPC-Egress (Amazon created)** – Identifies outbound paths to internet gateways, peering connections, VPC endpoints, VPNs, and transit gateways from all VPCs in your account.

5. We will use All-IGW-Ingress to know which resources in our side can be accessed through internet gateway & press analyze

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

6. It will take several minutes to show the findings, below are the paths for the resources which can be accessed through IGW 

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


## Conclusion 

AWS Network Access Analyzer is very useful to know the available paths to your resources and which resources also can be access the internet on which ports.
ข้อได้เปรียบในการใช้ Rust ทำ web backend
Tags: rust, webbackend, advantage
Published: 2023-10-01 11:25:43

---
title: ข้อได้เปรียบในการใช้ Rust ทำ web backend
published: true
description: 
tags: rust,webbackend,advantage
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2023-10-01 11:23 +0000
---

มีผู้ถามเข้ามาในกลุ่มตามหัวข้อ ผมก็เลยเอาคำตอบมาเรียบเรียงไว้อีกที

นอกจากประสิทธิภาพแล้ว Rust ได้เปรียบเรื่อง compile time type checking; Lemmy เทียบกับ GotoSocial ที่ใช้ Go  มี 2 จุดคือ 

1. GotoSocial ทำ cache เลี่ยงเรียก database บ่อย ซึ่ง cache แชร์กันระหว่าง goroutine ไม่ผ่าน channel ต้อง lock กันเอง; แต่ถ้าเป็น Rust มี compiler คอยช่วยตรวจว่า lock จุดที่ควร lock หรือไม่ 
2. Bun ORM ใน GotoSocial เวลา query ก็ส่ง string เข้าไป ไว้ parse เอาตอนรัน ซึ่งทำให้ compiler ช่วยตรวจไม่ได้; Diesel ใน Lemmy ใช้ macro ทำให้ check type ได้
Internet Marketing with FirstStore
Tags: webdev, news, ai, chatgpt
Published: 2023-10-01 11:23:00

[FirstStore free store](https://firststore.io/logocreator) internet marketing strategies that you can apply to promote your online store or business effectively:

[FirstStore sample sites](https://firststore.io/logocreator) Search Engine Optimization (SEO): Optimize your website's content to rank higher in search engine results. Use relevant keywords, create quality content, and improve website speed and mobile-friendliness.

[B2B FirstStore app](https://firststore.io/logocreator) Social Media Marketing: Utilize platforms like Facebook, Instagram, Twitter, and Pinterest to connect with your audience. Share engaging content, run ads, and interact with your followers.

Email Marketing: Build and maintain an email list to send out newsletters, promotions, and updates to your customers. Personalize your emails for better engagement.

[Small FirstStore stores](https://firststore.io/logocreator) Content Marketing: Create valuable and relevant content, such as blog posts, videos, or infographics, to attract and engage your target audience. Share this content on your website and social media channels.

Pay-Per-Click (PPC) Advertising: Use platforms like Google Ads or Bing Ads to run paid advertising campaigns. This can help drive targeted traffic to your online store.

Influencer Marketing: Collaborate with influencers in your niche to promote your products or services. Influencers can help you reach a wider and more targeted audience.

Affiliate Marketing: Set up an affiliate program where other websites or influencers can promote your products in exchange for a commission on sales.

[Business on FirstStore](https://firststore.io/logocreator) Analytics and Tracking: Use tools like Google Analytics to monitor your website's performance, track conversions, and understand your audience's behavior. Adjust your strategies based on data insights.

Customer Reviews and Testimonials: Encourage satisfied customers to leave reviews and testimonials on your website or review platforms. Positive feedback can build trust with potential customers.

Mobile Optimization: Ensure your website is mobile-friendly, as an increasing number of users access the internet via mobile devices.

Please note that the effectiveness of these strategies can vary depending on your target audience, industry, and competition. It's essential to continually assess and adapt your internet marketing efforts to achieve the best results for your FirstStore.
โปรแกรมและโปรแกรมเชิงวัตถุ
Tags: oop, gambas
Published: 2023-10-01 11:22:17

---
title: โปรแกรมและโปรแกรมเชิงวัตถุ
published: true
description: 
tags: oop,gambas
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2023-10-01 11:20 +0000
---

(เคยโพสต์ที่ qua.name เมื่อ 20 กันยา ค.ศ. 2023)-

## โปรแกรม

คำสั่งคำสั่งเดียวหรือหลายๆ คำสั่งที่เรียงกันเป็นลำดับ

### ตัวอย่างโปรแกรม

```Basic
Dim i As Integer  
For i = 1 To 3
  Print "สวัสดี"
Next
```

### ผลการรัน:

```
สวัสดี
สวัสดี
สวัสดี
```

## ตัวแปร

ตัวแปรคือที่ที่มีชื่อเอาไว้เก็บข้อมูล

### ตัวอย่างโปรแกรม

```Basic
Dim i As Integer
i = 20
Print i
```

### ผลการรัน 

```
20
```

## โปรแกรมย่อย

ส่วนของโปรแกรมที่ถูกเรียกใช้ได้ในโปรแกรมนั้น เรียกอีกอย่างว่า “Subroutine”

### ตัวอย่างโปรแกรม

```Basic
Sub GreetThreeTimes()
  Dim i As Integer
  For i = 1 To 3
    Print "สวัสดี"
  Next
End

GreetThreeTimes
GreetThreeTimes
```

### ผลการรัน

```
สวัสดี
สวัสดี
สวัสดี
สวัสดี
สวัสดี
สวัสดี
```

## ฟังก์ชัน

คือโปรแกรมย่อยที่ทำงานเสร็จแล้วให้ค่าบางอย่างเสมอ

### ตัวอย่างโปรแกรม Book.class

```Basic
Function Add10(n As Integer) As Integer
  Dim m As Integer
  m = n + 10  
  Return m
End

Print Add10(20)
```

### ผลการรัน

```
30
```

## อ็อบเจกต์และคลาส

* อ็อบเจกคือสิ่งประกอบไปด้วยโปรแกรมย่อยและตัวแปร 
* คลาสคือสิ่งที่กำหนดอ็อบเจกต์


### ตัวอย่างโปรแกรม

```Basic
Id As String
Title As String
Author As String

Sub PrintObject()  
  Print Id, Title, Author
End
```

## ข้อกำหนดในการเข้าถึง

* Public ใช้ได้จากทุกส่วนของโปรแกรม
* Private ใช้ได้เฉพาะในอ็อบเจกต์เดียวกัน

### ตัวอย่างโปรแกรม Book.class

```Basic
Public Id As String
Public Title As String
Public Author As String

Public Sub PrintObject()  
  Print Id, Title, Author
End
```

## การสร้างอ็อบเจกต์

สร้างอ็อบเจกต์ตามที่คลาสกำหนดโดยคำสั่ง "New"

### ตัวอย่างแบบยาว

```Basic
Dim Book1 As Book
Book1 = New Book
```

### ตัวอย่างแบบสั้น

```Basic
Dim Book1 As New Book
```

## การใช้งานตัวแปรของอ็อบเจกต์

```
ชื่อออปเจกต์.ชื่อตัวแปร
```

### ตัวอย่างโปรแกรม

```Basic
  Dim Book1 As New Book
  Book1.Title = "โฉมหน้าศักดินาไทย"
  Print Book1.Title
```


## การใช้งานโปรแกรมย่อยของอ็อบเจกต์

โปรแกรมย่อยของอ็อบเจกต์หรือที่เรียกอีกอย่างว่า “เมท็อด”

```
ชื่ออ็อบเจกต์.ชื่อโปรแกรมย่อย
```

### ตัวอย่างโปรแกรม

```Basic
  Dim Book1 As New Book
  Book1.Title = "โฉมหน้าศักดินาไทย"
  Book1.Author = "จิตร"
  Book1.Id = "TH001"
  Book1.PrintObject
```

### ผลการรัน

```
โฉมหน้าศักดินาไทย	จิตร		TH001

```

## สังกัดอ็อบเจกต์หรือคลาส

* ปกติแล้วสังกัดอ็อบเจกต์
* ให้สังกัดคลาสให้ใส่คำว่า “static”
* โปรแกรมย่อยสังกัดคลาสใช้ได้โดยไม่ต้องสร้างอ็อบเจกต์

### ตัวอย่างคลาส Book.class

```Basic
Public Id As String
Public Title As String
Public Author As String

Public Sub PrintObject()  
  Print Id, Title, Author
End

Static Public Sub Info() 
  Print "หนังสือเป็นสื่อ"
End
```

### ตัวอย่างการเรียกใช้งานโปรแกรมย่อยที่สังกัดคลาส

```Basic
Book.Info
```
Data Science for Beginners: 2023 - 2024
Published: 2023-10-01 11:12:52

## Learn the fundamentals of data science
Data science is the study of data using modern tools and techniques to find unseen patterns, derive meaningful information, and make business decisions. It is a rapidly growing field given the vast volumes of data with plenty of untapped potential.

Starting a journey as a beginner can be both exciting and challenging. Before diving deep in the field these are some of the key  concepts you should understand before learning what  data science is.
1.Programming: Learn a programming language like Python, which is widely used in data science. There are many resources available online and in libraries to learn Python

2.Statistics: Statistics is essential for understanding and analyzing data. You should learn about probability, descriptive statistics, and inferential statistics.

3.Database: Understand how databases work, how to manage them, and how to extract data from them.

4.Machine Learning: Machine learning is a subfield of computer science that gives computers the ability to learn without being explicitly programmed. Machine learning is used in many data science applications, such as image recognition, natural language processing, and fraud detection.

## Gain experience with data science tools
1.Python libraries: NumPy, Pandas, Matplotlib, Seaborn, and Scikit-learn are some of the most popular Python libraries for data science. These libraries provide a variety of functions for data manipulation, visualization, and machine learning.

2.SQL databases: SQL is a language used to query and manage relational databases. MySQL, PostgreSQL, and Oracle are some of the most popular SQL databases.

3.Cloud computing platforms: Cloud computing platforms like AWS, Azure, and Google Cloud Platform offer a variety of services for data science, such as data storage, data processing, and machine learning.
Data science for begginers:2023-2024 complete roadmap
Tags: beginners, datascience, python, programming
Published: 2023-10-01 11:00:57

If you are a beginner, embarking on a career in data science can seem daunting, but with the right guidance and resources, success is achievable. In fact, mastering the fundamental concepts, tools, and techniques required to excel in this field is entirely possible within a year or two. Data science is a field that involves programming, statistics, mathematics, and domain knowledge.
 One of the most crucial steps in becoming a data scientist is selecting a programming language. Python and R are the most commonly utilized languages in the field, and mastering either or both can provide a significant advantage. To derive insights from data, conduct experiments, test hypotheses, and evaluate results, a solid understanding of statistics is paramount. It is essential to learn the fundamental concepts, such as descriptive statistics, probability distributions, hypothesis testing, confidence intervals, correlation, and regression. 

Data visualization is another critical component of data science, as it plays a crucial role in exploring data, communicating findings, and identifying patterns. Proficiency in creating different types of charts and graphs using Python or R libraries, as well as knowledge of the principles of effective data visualization, is vital for creating a clear and concise representation of data. 

Machine learning is the backbone of data science, as it enables the building of models that learn from data to make predictions or recommendations. It is necessary to learn the basic concepts, such as supervised and unsupervised learning, classification, regression, clustering, and model evaluation and deployment. Putting theoretical knowledge into practice through project work is essential for developing practical experience in data science. Not only can it help to apply concepts and tools to real-world problems, but it is also an excellent way to develop a portfolio and showcase your skills to potential employers or clients. 

Additionally, working on projects provides an opportunity to learn from mistakes and challenges and further improve your data science skills. The data science community is active and supportive, providing numerous resources for learning and growth. Joining online platforms and networking with other data scientists and enthusiasts can offer valuable support and guidance. It is also an excellent way to stay informed about the latest developments and trends in the field.

 Lastly, it is crucial to remain curious and stay updated with the latest trends and developments in data science. Following this roadmap, putting in consistent effort, and maintaining dedication and hard work can help you achieve your data science goals and make a significant impact in your career.
Data Science for Beginners :2023 - 2024 Complete Roadmap
Tags: datascience, data
Published: 2023-10-01 10:52:54


Data science is the study of data in order to extract meaningful insights from it. It extracts insights by combining various subjects such as  math and statistics, specialized programming, advanced analytics, artificial intelligence (AI) and machine learning. These insights are then used by organizations in decision making and strategic planning.

A data science roadmap is visual representation of a strategic plan designed to help one learn about and succeed in the field of data science.

As a wide field in technology, data science has several career paths one can follow:

- Data Analyst - Collects, cleans and analyzes data.

- Data Scientist - Builds predictive models and creates data driven solutions. 

- Data Engineer - Builds infrastructure for generation, storage and retrieval.

- BI Analyst - Creates reports, dashboards and visualizations 

- Machine learning engineer- Implements ML algorithms and models.

- NLP Engineer- Focus on understanding and interpreting natural languages. 

**Key Data Science skills for beginners**

- Mathematical and Statistical Skills
- Programming Skills
- Communication Skills
- Curiosity

**<u>Mathematical and Statistical skills</u>**

**Statistics** - This is a branch of mathematics that teaches us how to collect and analyze  data so that we can find answers to questions. 

- Descriptive Statistics- Conducts experiments on the entire dataset
- Inferential statistics- conducts experiments from a small dataset then applies to the entire dataset.

**Probability**- Numerical representations of the likelihood of an event.

**Calculus**- Calculus is a branch of mathematics that deals with the study of rates of change and the accumulation of quantities. It has two main branches: 

- Differential Calculus - Differential calculus helps us understand how things change. It helps us understand how a function behaves at a single point

- Integral Calculus - Integral calculus helps us find areas and accumulate quantities. 

**Linear Algebra**
This is a branch of mathematics that deals with vectors and matrices. 

**<u>PROGRAMMING SKILLS</u>**

**SQL(Structured Query Language)**- This is a an organized collection of data that handles large datasets.
**Python programming** - Python offers built in data structures and libraries that store and manipulate data efficiently.
- lists
- Tuples
- Dictionaries
- Sets
- Strings

**<u>Data Analysis and Visualization</u>**

Being a data scientist would require you to work on data visualization to display the pictorial forms of charts and graphs that can be easy to understood. There are hefty of tools that are being used and some of the popular ones are:
- Tableau
- Power BI
- Looker Studio
- Python Libraries e.g. Matplotlib, plotly

**<u>Communication Skills</u>**

Ability to spread and influence ideas that are easy to understand and that can be used in decision making.
Cybersecurity For Business
Tags: techno
Published: 2023-10-01 10:39:09

Cybersecurity For Business and Solutions to Secure Business from Cyber Threat

Safeguard business from cyber threat with NSEIT-managed <a href="https://www.nseit.com/cybersecurity/">Cybersecurity For Business</a>. Strategize and automate cybersecurity to protect identities, cloud, data, applications, and endpoints

Take a 360° approach to cybersecurity
Facilitate digital business and improve responsiveness with automated cyber security programs

Actively protect and defend your business against increasingly sophisticated attacks. We help you protect your organization’s identities, cloud, data, applications, and endpoints from complex threats with cybersecurity services.
GPT Template plugin for VSCode
Published: 2023-10-01 02:14:35

Install Here: https://marketplace.visualstudio.com/items?itemName=PolymerMallard.gpt-template

**What is it?**
It's a plugin for VSCode that uses ChatGPT to create a variation of a file that already exists.

**How does it work?**
Select a file in the tree, or open it, and run the `Generate using this as template` command. _(via Cmd+Shift+P)_

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

Type a description of the new file you want to create that is loosely based off this one.

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

Press [Enter] and it'll generate a new file; or you can give it a name to save it.

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

And you end up with a similar file, similar commenting, etc but with a new purpose.

**Why would you do this?**

It's a more open-ended templating system that allows you to create things like migrations, seeders, services, and more using similar syntax, commenting, and file structure.

It's not practical to create a template or boilerplate for every filetype, so this steps in as a dynamic templating system.

Since it's using GPT, it can even predict what fields in a migration you might want, foreign keys, etc.
22. Creating a Node.js Server: A Step-by-Step Guide
Published: 2023-11-14 05:58:47

---
title: 22. Creating a Node.js Server: A Step-by-Step Guide
published: true
date: 2023-10-01 10:16:42 UTC
tags: 
canonical_url: 
---

Node.js has gained immense popularity as a runtime environment for server-side development, allowing developers to build scalable and high-performance web servers. In this step-by-step guide, we'll explore the process of creating a Node.js server from scratch. By the end of this article, you'll have a solid understanding of how to create a basic HTTP server using Node.js.

## Prerequisites

Before we dive into creating a Node.js server, make sure you have Node.js installed on your computer. You can download and install it from the official Node.js website ([https://nodejs.org/](https://nodejs.org/)).

## Step 1: Setting Up Your Project

1. **Create a Project Directory** : Start by creating a new directory for your Node.js server project. Open your terminal or command prompt and run:

2. **Navigate to the Directory** : Move into your project directory:

3. **Initialize a Node.js Project** : Use the following command to initialize a new Node.js project and create a `package.json` file:

## Step 2: Installing Dependencies

In this basic example, we will use the built-in `http` module, so there are no external dependencies to install.

## Step 3: Creating the Server

1. **Create a JavaScript File** : Create a JavaScript file for your server, e.g., `server.js`, using your preferred code editor. You can use Visual Studio Code, Sublime Text, or any other text editor you like.

2. **Import the** `http` Module: In your `server.js` file, start by importing the `http` module, which is a built-in module in Node.js, as follows:

3. **Create the Server** : Next, create an HTTP server using the `http.createServer()` method:

4. **Handling Requests** : Inside the server's callback function, you can implement your request handling logic. For this basic example, let's send a simple "Hello, World!" response:

5. **Listening for Requests** : To make your server listen for incoming HTTP requests on a specific port, use the `listen` method:

6. **Start the Server** : Save your `server.js` file and start the server by running the following command in your terminal:

## Step 4: Testing Your Server

Open your web browser or a tool like Postman and navigate to [`http://localhost:3000`](http://localhost:3000). You should see the "Hello, World!" message displayed in your browser. Congratulations! You've created a basic Node.js server.

## Conclusion

Creating a Node.js server is a fundamental skill for web developers. In this guide, we walked through the process of setting up a Node.js project, creating a basic HTTP server, handling requests, and testing your server. This is just the beginning of what you can do with Node.js. You can expand your server by adding routing, handling different HTTP methods, and connecting to databases or external APIs to create more complex and feature-rich applications. With Node.js, the possibilities for server-side development are endless, and you're well on your way to building powerful web applications.
Dividing IPs for Multiple Subnets in a VPC
Tags: vpc, cidr, aws, subnets
Published: 2023-10-01 10:12:11

When creating resources for your application in a cloud infrastructure like AWS you would categorize resources into public or private subnets, often spread across multiple Availability Zones (AZs) for high availability, all in a single virtual private cloud (VPC).

VPC defines the total IP range using CDIR (Classless Inter-Domain Routing) notation.
Eg. 10.0.0.0/22 - 1024 IPs

The number after the slash "/" - 22 (prefix length) is used to calculate the total IPs following a formula - 2^(32 - PREFIX_LEN). It could go from /0 to /32.

In the above VPC the CIDR is 10.0.0.0/22 - 1024 IPs
This means the total number of subnets will share 1024 IPs 

But how do you now further divide these IPs for each subnet?

Octets referencing: 
[10].[0].[0].[0] => [1st].[2nd].[3rd].[4th]

Subnet-1 => 10.0.0.0/24 - 256 IPs
Range 10.0.0.0, 10.0.0.1, 10.0.0.2, ... 10.0.0.255
Meaning the 4th or last octet is full it has exactly 256 IPs.  

But anything below /24 would have eaten into the 3rd octet, say /23 - 512 IPs, because the last octet certainly don't have up to 1024 IPs

Subnet-2
Knowing that the last octet is full, 2nd subnet has the 3rd octet to play with.
Common practice when creating additional subnets is to increase the octet by 1 - 10.0.1.0/24 - 256 IPs
Range 10.0.1.0, 10.0.1.1 ... 10.0.1.255

I could choose any PREFIX_LEN (0-32) but I also have to bear in mind that the VPC's total range is 1024
If I did 10.0.1.0/22, this won't work because 1024 + Subnet-1's 256 is more than the VPC's total.

Subnet-3 => 10.0.2.0/24 - 256 IPs
Range 10.0.2.0, 10.0.2.1, 10.0.2.2 ... 10.0.2.255

I hope this brief explanation helps you understand how to allocate IP ranges to a VPC's subnets better.

Thanks for reading ❤️