teleren/devto huggingface dataset:
How to Unsubscribe from All Users on DEV.to
Published: 2023-11-24 23:31:38

Funny title for my first post here.

I created my user profile on DEV.to 4 years ago and didn't really use it back then. Now that I've returned, I find myself following 50 people in whom I'm no longer interested.

There is no option to unsubscribe all, nor is there a comfortable way to do it manually (I would have to open profile page of everyone). Naturally this led me to explore the DevTools' network tab to see if there is an easy way to do this in the console. And there is, here is how:

1. Go to https://dev.to/dashboard/following_users
1. Run following script in the DevTools console:
```javascript
async function fetchFollowedList(page) {
    const signature = parseInt(Date.now() / 4e5, 10);
    const response = await fetch(`https://dev.to/followings/users?page=${page}&controller_action=following_users&signature=${signature}`);
    if (!response.ok) {
        throw new Error(`Failed to fetch followed list: ${response.statusText}`);
    }
    return response.json();
}

async function unfollowUser(userId, csrfToken) {
    const response = await fetch('https://dev.to/follows', {
        method: 'POST',
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded',
            'X-CSRF-Token': csrfToken,
        },
        body: `followable_type=User&followable_id=${userId}&verb=unfollow&authenticity_token=${encodeURIComponent(csrfToken)}`,
        credentials: 'include',
    });

    if (!response.ok) {
        console.error(`Failed to unfollow user ID ${userId}: ${response.statusText}`);
    }
}

async function unfollowAllUsers() {
    const csrfToken = window.csrfToken; // Retrieve the CSRF token from the window object
    let page = 0;
    let hasMore = true;

    while (hasMore) {
        try {
            const followedList = await fetchFollowedList(page);
            if (followedList.length === 0) {
                hasMore = false;
                break;
            }

            for (const user of followedList) {
                await unfollowUser(user.user_id, csrfToken);
                console.log(`Unfollowed user ID ${user.user_id}`);
            }

            page++;
        } catch (error) {
            console.error(error);
            break;
        }
    }
}

unfollowAllUsers();
```
Writing my first PR for release 0.2
Published: 2023-11-24 23:19:19

For the first pull request (PR) of this release, I decided to work on the Meilisearch Python branch, specifically on issue [884](https://github.com/meilisearch/meilisearch-python/issues/884). 

This issue was one of many, but for different languages. I chose Python because I am somewhat familiar with it, and I am curious about what other people would write for this issue in different languages so I will wait look for new PR'S.

What I had to do was create a `snapshot` method that would return information about a task to track the progress of an asynchronous process. I added a config path, created a new entry with the key create_snapshot_1:, and modeled a test based on a similar test.

My pull request was reviewed and is considered approved; it is awaiting merge since the snapshot feature has to be merged first.

I think this PR was, so far, the best experience I've had since [Paul Sanders](https://github.com/sanders41) was very detailed and helpful in reviewing my work and assisting me. I felt really welcome in this repository.

It was a first for me to contribute to a project where I had to use tests to verify my work and where I had to implement not only some functionality but also try to test it. Even though I modeled the test, I really enjoyed the experience. Also, it was the first time I used Codespaces; this project had them set up, and I found it extremely useful because I didn't have to set anything up. I will probably try to use them for BukuRain. [PR](https://github.com/meilisearch/meilisearch-python/pull/885)

To be honest, I find that it still takes me a long time to find places to contribute. I am still looking for two repositories to contribute to in this release since I don't want it to be like I did in Hacktoberfest, where sometimes I just did things to get them done ☹️. I'm trying to avoid those scenarios and grow as a person.
Next Js 13 Rendering ?
Published: 2023-11-24 23:18:14

due to Search engine friendly ENV. i am fetching data using firestore db functionality. now on initial render i got data but i want to update that same data onSnapshot or onChange, when i tried to implement it on client side it throws error because 'use client' will not going to handle Server async function which i include earlier to load initial data. if you dont understand please comment i will share it again. Need Solution.
JavaScript
Published: 2023-11-24 22:42:35


 Hey fellow developers! 👋 Just wanted to share the magic of JavaScript - the language that brings websites to life! 💻✨. JavaScript is like the wizard behind the curtain, making your web pages dynamic and interactive. From cool animations to handling user input, it's the driving force that enhances the user experience.. Whether you're a beginner or a seasoned coder, JavaScript is a must-know in the world of web development. It opens doors to building responsive, feature-rich applications. 🌐💡. What's your favorite JavaScript feature or project? Let's celebrate the awesomeness of coding together! 🎉 Drop your thoughts below! 👇 #JavaScriptMagic #WebDevelopment #CodingJourney
How to get notified of newly connected devices on your OpenWRT router
Tags: openwrt, pushover, router, bash
Published: 2023-11-24 22:02:30

So you’ve just set up OpenWRT with all the bells and whistles only to realize there is no out-of-the-box way to receive notifications for newly connected devices. No worries! With this tutorial, we will set up our OpenWRT server to send notifications to [Pushover](https://pushover.net/) whenever a new device is connected to the server.

---

Let’s start with Pushover. Sign up is really easy, and pricing is very reasonable. It’s typically a one-time purchase per device used. For myself, I’ve purchased it for my iPhone and really enjoy its simplicity. Once signed up, create a new application with your preferred options. Lastly, find your app’s api key along with your user key. They should look something like this:

![API Key](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z9nsckx8g03daxombrk3.png)
![User Key](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b13gh995h45uy1gohscp.png)

With pushover ready to go, let’s head back to our OpenWRT server. Create a new script file called `new_device_notification.sh` with the following lines:

```
#!/bin/sh

cat << "EOF" > /etc/hotplug.d/dhcp/90-newdev
[ "$ACTION" == "add" ] || exit 0
# [ "$ACTION" == "add" -o "$ACTION" == "update" ] || exit 0
known_macs="/etc/known_macs"
user_key="your-user-key"
api_key="your-api-key"
if ! /bin/grep -iq "$MACADDR" "$known_macs"; then
  msg="New device detected:
MAC: $MACADDR
IP: $IPADDR
Hostname: $HOSTNAME"
  echo "$MACADDR $IPADDR $HOSTNAME" >> /etc/known_macs
  curl -s \
       --form-string "token=$api_key" \
       --form-string "user=$user_key" \
       --form-string "title=New Device" \
       --form-string "message=$msg" \
       https://api.pushover.net/1/messages.json
fi
exit 0
EOF
```

Replace `your-api-key` and `your-user-key` with the values provided from Pushover. This script will check for new devices on your DHCP server as these devices make connections. If the server has not seen it before, it will add the device to a list of known devices and send you a notification.

Finally, let’s make this script runnable and execute it:

```
chmod +x new_device_notification.sh
./new_device_notification.sh
```

And that’s it! Simply restart your server and you should begin receiving messages from Pushover. You may receive many messages at the beginning as existing devices are added, but from then on, only new devices will trigger a message.

Enjoy!
Ruby on Rails Pagination
Tags: pagygem, ruby, rails
Published: 2023-11-24 21:48:45

Hey Rubyist!

I'm excited to share with you a streamlined approach to implementing pagination in your Ruby on Rails blog application. Pagination can be a bit tricky, but fear not! The Ruby community has gifted us with a gem that simplifies the process.

Let's get started:

Create a new Ruby on Rails application:
   ```bash
   rails new <name_of_your_project>
   cd <name_of_your_project>
  ```

Generate a scaffold for your blog posts:

```
rails generate scaffold Post title:string content:text
```

Using a scaffold is convenient as it creates everything from controllers to views to models, saving you time.


Perform migrations:

```
rails db:migrate
```
This ensures your database is set up with the new Post model.



Open **_application_controller.rb_** and include the following code:

```
include Pagy::Backend
```

In **_application_helper.rb_**, add:

```
include Pagy::Frontend
```


Create a file named **pagy.rb** in the **config/initializers** folder, and insert:

```
Pagy::DEFAULT[:items] = 5
```
Here, we specify that we want 5 items/posts per page.

Update the index method in **_posts_controller.rb_**:

```
def index
  @pagy, @posts = pagy(Post.order(created_at: :desc))
end
```
This code fetches a paginated list of posts ordered by creation date in descending order, storing pagination information (**@pagy**) and the posts (**@posts**) in instance variables.


In views/posts/index.html.erb, add:

```
<div>
    <% @posts.each do |post| %>
        <h2>
            <%= link_to post.title, post %>
        </h2>
    <% end %>

    <div>
        <%== pagy_nav(@pagy) if @pagy.pages > 1 %>
    </div>
</div>
```
This template iterates through the collection of posts, displaying each post's title as a link. If pagination is necessary (more than one page), it displays the pagination navigation at the bottom.

Now you have a robust pagination setup for your Ruby on Rails blog application! Remember to test thoroughly, consider alternative gems like kaminari if needed, and keep an eye on gem updates for any improvements or changes.
Does Instagram have an API that provides public profiles when sending the username in the API request?
Tags: anonymous, stories, insta, instanavigation
Published: 2023-11-24 21:43:57

Instagram provides an API known as the Instagram Graph API, which developers can use for various functionalities, including what I'll term "Insta Navigation." This API allows developers to interact with Instagram programmatically, accessing features such as user information, media content, and business account insights.

When it comes to "Insta Navigation," developers utilizing the Instagram Graph API must be mindful of the platform's guidelines. Direct access to a public profile by sending a username in an API request might not be a straightforward process due to privacy and security considerations. The API primarily focuses on business accounts, and specific permissions or approval from Instagram may be required for certain user-related endpoints.

To embark on "Insta Navigation" using the Instagram Graph API, developers typically need to create a Facebook App, obtain an access token, and adhere to the API's rate limits and usage policies. The API documentation is a valuable guide, providing insights into how to structure requests, handle authentication, and interpret responses.

It's crucial for developers engaged in "Insta Navigation" to stay informed about any changes or updates. Instagram regularly revises its policies and API features. Checking the official Instagram for Developers website and related documentation is essential for the most accurate and up-to-date information regarding available endpoints and their capabilities.

In the realm of "[Insta Navigation](https://insta-navigation.com/)," responsible API usage is paramount. Developers should approach this tool with respect for user privacy. Even if the data accessed is public, Instagram's stringent policies are in place to ensure ethical and responsible use of the platform's resources. Unauthorized access or misuse of the API can result in severe consequences, such as account suspension.

In summary, as of my last knowledge update, "Insta Navigation" using the Instagram Graph API involves navigating through the intricacies of user data access. While the API offers valuable tools for developers, it's imperative to stay informed about any updates or changes to ensure compliance with Instagram's policies and guidelines. Developing an understanding of the API's structure and adhering to responsible usage practices is key for a successful and ethical "Insta Navigation" experience.
I'm just wondering how to create a WebSocket that listens for matches in the API query parameters
Tags: javascript, node, api, express
Published: 2023-11-24 20:57:50

So I'm creating an application that let's users input data to create a filter used in an api request. 
That api request is then turned into a websocket and that websocket listens for matches in the query parameters of the api query. 

I'm just not sure how to embed the logic in the websocket so that it returns the data that the original api query would if I ran it again. 

I'm just looking for a nudge in the right direction. 
Any help would be really appreciated!
Very basic introduction (revision tool) to SQL
Tags: beginners, codenewbie, learning, database
Published: 2023-11-24 20:55:19

SQL, or Structured Query Language, is like the language we use to talk to databases. Imagine a database as a well-organised storage space. SQL provides a set of commands that act as a sort of translator, allowing us to ask the database questions, add new stuff, updating existing info, or even remove things. It's a way for us to interact with and manage data in databases, making it a crucial tool in the world of information handling. The cool thing about SQL is that its language is designed to be logical and straightforward, aligning neatly with how we organise and think about data in databases. 

In this brief blog, I aim to provide a concise introduction to a few essential elements of SQL: commands, data types, and constraints, along with their significance. This serves as a quick and effective revision, offering a streamlined overview of key concepts of SQL.

**SELECT**:
This command is used to retrieve data from one or more tables. 

**INSERT**:
Used to insert new records into a table.

**UPDATE**:
Used to modify existing records in a table.

**DELETE**:
Used to delete records from a table.

**CREATE TABLE**:
Used to create a new table.

**ALTER TABLE**:
Used to modify an existing table(add, modify, or delete columns).

**WHERE**:
Filters records based on specific conditions and allows you to narrow down your queries to specific criteria. 

**DROP TABLE**:
Used to delete an existing table.

_Those are some SQL commands and they provide a powerful set of tools to interact with and manage the data in a relational database._

**Data Types**

**INT**:
Integer data type.

**VARCHAR(n)**:
Variable-length character string with a maximum length of 'n'.

**CHAR(n)**:
Fixed-length character string with a length of 'n'.

**DATE**:
Stores date values.

**BOOLEAN**:
Represents true or false values.

**TEXT**:
Used for large blocks of text data.

**DECIMAL or NUMERIC**:
Holds numbers with fixed precision and scale.

**TIME**:
Represents a specific time of day.

**DATETIME or TIMESTAMP**:
Combines date and time values.

_Data types define the kind of data that a column or variable can hold. They play a crucial role in ensuring data integrity and precision._

**Constraints**

**PRIMARY KEY**:
Uniquely identifies each record in a table.

**FOREIGN KEY**:
Creates a link between two tables.

**UNIQUE**:
Ensures that all values in a column are unique.

**NOT NULL**:
Ensures that a column cannot have a NULL value.

_Constraints in SQL are rules or conditions applied to a column or a set of columns in a table. They enforce data integrity and maintain the accuracy and reliability of the data in a relational database._

Mastering these fundamentals lays a solid foundation, paving the way for a deeper exploration into the intricacies of SQL.

Thank you for reading into this brief yet impactful blog—it serves as an effective and concise revision.

In the meantime....

**KEEP CODING!!**
BukuRain on npm
Published: 2023-11-24 20:47:54

Now you can use [BukuRain](https://github.com/pbelokon/BukuRain) as an [npm package](https://www.npmjs.com/package/bukurain). 

Publishing your own tools to npm is pretty simple; you just have to follow these 3 steps:

First, go to your `package.json` and add an entry for `bin` that points to your `index.js` file or any file that plays the role of an entry in your application.

```js
"bin": "./index.js",
``` 

Then you have to login into your npm account by running: `npm login`

Lastly you just have to publish your package with `npm publish`

Voila! You have published your package to the public 🥳

To install my package, you can read the instructions in my npm package or refer to the README of the project.
Lean Startup y MVPs: Soluciones Ágiles para el Desarrollo de Software
Tags: architecture, programming, computerscience, webdev
Published: 2023-11-24 20:33:42

📌 Cuando los equipos de desarrollo construyen productos muy completos después de largos ciclos, sin validar qué necesitan realmente los usuarios, esto trae desventajas.

📌 Esos productos sobre diseñados rara vez encajan con lo que los usuarios realmente necesitan. No resuelven sus problemas reales.

📌 Además, los proyectos que se extienden por años acumulan una importante deuda técnica: las librerías y arquitecturas se vuelven obsoletas.

➡️ Esto puede deberse a una serie de factores, como:

⭐️ La falta de comunicación con el cliente o el negocio.
⭐️ La falta de experiencia en el desarrollo de productos.
⭐️ La presión por cumplir con plazos o presupuestos.

➡️ También puede ser que los desarrolladores se extiendan en poner cosas de más simplemente porque les gusta hacerlo así. Esto puede deberse a una serie de factores, como:

⭐️ La pasión por el desarrollo de software.
⭐️ El deseo de crear un producto que sea perfecto.
⭐️ La falta de experiencia en el desarrollo de productos

📌 Y es aquí cuando entra en escena La metodología ágil Lean Startup y su propuesta de MVPs (Producto Mínimo Viable), orienta a que el desarrollo de un software de una forma rápida y con poco riesgo.

Ref 🔗 https://es.wikipedia.org/wiki/Lean_startup

📌 Los MVPs permiten probar ideas de forma simple y rápida. Se crean versiones básicas y funcionales del producto o servicio para obtener retroalimentación temprana de los clientes. Si algo no funciona, se puede ajustar fácilmente sin mucha inversión, mejorando continuamente el producto basándose en las opiniones de los clientes.

📌 También se puede combinar esta técnica con Backlog por semanas y funcionalidades que permite una gestión eficiente, y que luego les hablaré en otro post.

📌 Al adoptar esta metodología ágil e iterativa, los equipos pueden: Obtener feedback continuo de los usuarios para guiar el desarrollo, detectar y cambiar rápido funcionalidades no deseadas, evitar la acumulación de deuda técnica.

📣 Así, Lean Startup y los MVPs se consolidan como una forma inteligente de crear valor enfocándose en las necesidades reales de los usuarios desde el primer día;  De esta forma evitamos extensos proyectos desconectados de la realidad, que terminan fracasando.
CPU Instruction Cycle Simulator
Tags: python, programming, cpu, beginners
Published: 2023-11-24 19:53:29

I am definitely more of a software than a hardware person, but it's always good to step out of your comfort zone.

[This project](https://github.com/LCerulean/CPU_Simulator) was a portfolio assignment from the Computer Architecture course on Codecademy. The assignment required that I "research, design, and build a Python program that simulates the functionalities of a CPU."  Which sounded quite simple, it's such a little piece of hardware, but as soon as I started really researching I discovered more of a mountain range than a mountain of information.  I applaud you hardware people, I had no idea how complex the physical components of a computer were.

The assignment was very open-ended as to how and in what way the program simulated a CPU, but did come with two text files to use for testing, one containing data, and the other instructions.  Using those files and my research as a guide, I decided to simulate the stages in the CPU instruction cycle:
-Fetch
-Decode
-Execute
-Memory Access
-Registry Write-Back

Was this my favorite project? No.  Did it challenge me and give me a deeper understanding of the inner workings of this wonderful machine I type away at all day? Yes.

Good assignment Codecademy.
Setting the Table: Why Quality Everyday Dinnerware is Essential
Published: 2023-11-24 19:52:57

Maybe little things are changing the world [best everyday dinnerware](https://malacasa.com/blogs/news/what-is-the-best-material-for-everyday-dishes?utm_source=dev_to&utm_medium=rankking). 

It’s easy to forget how important everyday dinnerware is until you’re ready to serve a meal and find yourself without the right plates and dishes. Eating is an essential part of life, and having **quality everyday dinnerware** is essential to make meals enjoyable. From plates and bowls to cups, mugs and serving dishes, everyday dinnerware sets the stage for a comfortable and inviting meal.

Choosing the right dinnerware depends on personal preference. Some people prefer a casual, rustic look, while others prefer a more formal feel. **Best everyday dinnerware** should be made of materials that are durable and can withstand frequent use. Ceramics and porcelain provide classic elegance, while melamine is a great option for casual meals. Stoneware is also a popular choice as it's less likely to break, chip, or crack.

In addition to materials, color and pattern are important when selecting dinnerware. A light neutral palette is ideal for everyday use, while a bolder pattern or color can be used on occasion. Selecting pieces with classic shapes can help create a timeless look. However, it’s also important to choose pieces that are practical and functional. Plates that are too heavy or cups that are too small can be difficult to use and can detract from the overall dining experience.

As well as selecting the right dinnerware, creating a welcoming table setting is essential for any meal. Placemats and tablecloths can be used to add color and texture to the table, while coordinating napkins and centerpieces can bring the look together. Candles, flowers, and other decorative elements can also help create a feeling of warmth and hospitality.

When it comes to setting the table, **quality everyday dinnerware** is essential. From materials and colors to shapes and designs, selecting the right pieces can help create a beautiful and inviting table setting. With the right dinnerware, it’s easy to create a comfortable and enjoyable experience for every meal.

## References

  * [best everyday dinnerware](https://www.boulderdigitalarts.com/search/click.php?url=//malacasa.com/blogs/news/what-is-the-best-material-for-everyday-dishes "best everyday dinnerware")
[GCP] Google Cloud Certified - Professional Cloud Network Engineer
Tags: gcpcertificated, cloud, gcpnetwork, gcp
Published: 2023-12-29 07:36:17

---
title: [GCP] Google Cloud Certified - Professional Cloud Network Engineer
published: true
date: 2023-11-24 19:42:44 UTC
tags: 
- GCPCertificated
- Cloud
- GCPNetwork
- GCP

canonical_url: https://www.kmp.tw/post/googlecertificatedprofessionalnetworkengineer/
---


## 這次準備的內容為 `GCP Certified - Professional Cloud  Network Engineer` 的認證

<!--more-->

## 學習路徑為依然為 [Jayendra's Blog](https://jayendrapatil.com/google-cloud-professional-cloud-network-engineer-certification-learning-path//) 與官方文件


## 考試相關內容如下：
- 120 分鐘內考 50 題選擇題, 包含多選
- 考試內容大多為網路方面的調整與選擇
- Interconnect, Cloud Route, Shared VPC, Loan Balancer
- 有關於 GKE Cluster 與 Pod 的網段要稍稍計算一下
- 依照題型給予的狀況去選擇適合的 LoadBalancer 也有出現好幾題

## 最後, 就不免俗的放上證照 :D

![GCP_Cert](http://img.kmp.tw/gcpnetwork.png)