teleren/devto huggingface dataset:
CMD commands every programmer should know
Tags: javascript, webdev, beginners, productivity
Published: 2023-03-02 07:37:00

The command prompt is a powerful command line interface that is available in the Windows operating system and enables users to execute commands by typing text. 

If you want to open the command prompt, you can easily access it by opening the start menu and searching for **“cmd”**, or by simply pressing the **Windows key + R**, typing “cmd” and pressing enter. Additionally, you can also access it through PowerShell or through the run dialog box that is available in all versions of Windows.

## Commands



## 1 Create a new folder

**mkdir** -  Make a Directory & create a new folder on the working directory  

```bash
mkdir [folderName]
```

---

## 2 Change directory 

**cd** - Change directory lets you change and access the directory

```bash
cd [folderName]
```

---

## 3 List Files

**dir** - lists the files & folders contained in the current working directory 

```bash
dir
```

---

## 4 Rename 

**ren** - To rename files and folders 

```bash
ren [folder] [newFolderName]
```

---

## 5 Copy Files 

**copy** - copies the file (file.txt) to the destination (copyfile.txt)

```bash
copy [file] [destination]
```
---

## 6 Delete Files 

**del** - Deletes files and files in a folder 

```bash
del [file]
```

to learn more about these visit
[https://www.w3schools.com/whatis/whatis_cli.asp](https://www.w3schools.com/whatis/whatis_cli.asp)



---
## For more information

1. Check my GitHub profile
[https://github.com/amitSharma7741](https://github.com/amitSharma7741)

2. Check out my youtube channel 
[https://www.youtube.com/channel/UCTBG1pUL9HtP4ntbj63Fngw](https://www.youtube.com/channel/UCTBG1pUL9HtP4ntbj63Fngw)

3. Check out my Fiver profile if you need any freelancing work
[https://www.fiverr.com/amit_sharma77](https://www.fiverr.com/amit_sharma77)

4. Check out my Instagram
[https://www.instagram.com/fromgoodthings/](https://www.instagram.com/fromgoodthings/)

5. Linktree
[https://linktr.ee/jonSnow77](https://linktr.ee/jonSnow77)

6. Check my project

- EVSTART: Electric Vehicle is the Future
[https://evstart.netlify.app/](https://evstart.netlify.app/)
-  News Website in react
 [https://newsmon.netlify.app/](https://newsmon.netlify.app/)
-  Hindi jokes API
 [https://hindi-jokes-api.onrender.com/](https://hindi-jokes-api.onrender.com/)
- Sudoku Game And API
[https://sudoku-game-and-api.netlify.app/](https://sudoku-game-and-api.netlify.app/)

---
---
 
--- 
## Support us 
Don't miss the amazing video we've embedded in this post! Click the play button to be inspired

{% youtube  p6t7Iprd-38 %}

---
Obtaining and Verifying an Installation Package
Tags: beginners, discuss, opengauss
Published: 2023-03-02 07:27:57

**Procedure**
1. Download the installation package of the corresponding platform from the openGauss community.
   1. Log in to the openGauss community and download the latest installation package of the corresponding platform. For individual developers or non-enterprise-level environments, download the simplified installation package (without installing components such as the OM).
   2. Click Download.
2. Check the installation package.
Decompress the installation package and check whether the installation directory and files are complete. Run the following commands in the directory where the installation package is stored:

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

Run the ls command to display information similar to the following:


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yeipwij6mcn0xyhh9g6w.png)
The Reason Why I Don’t Use Gmail as My Primary Email Anymore
Tags: google, email
Published: 2023-03-02 07:18:20

It’s been 2 years since I realized that my whole online presence is built around Google.

It’s very convenient to build your whole life around Google Services - Gmail, Drive, Contacts, Photos, YouTube, save Passwords to Chrome, Login with Google, … the list goes on and on. Google services are free, easy to use, and they all work well together.

## Your account has been suspended

The problem is that each service on Google has its own Terms & Conditions, and it’s not that uncommon to get your account suspended because you “breached something somewhere”.

Once you get suspended, you basically stop existing online, and you lose access to all your data. Everything. Gone. Immediately. And Google has no obligation to talk to you. After all, it’s free.

> Centralizing all our online being into the hands of a single giant is not the best idea.

I did not like the idea of that. Not having an access to my email and my passwords could be existential. 

![People posting on Twitter about being suspended](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4y47vz8ficxggxmiq9za.png)

There are [many](https://twitter.com/miguelytob/status/1315749803041619981) [stories](https://www.businessinsider.com/google-users-locked-out-after-years-2020-10) [out](https://twitter.com/com/status/1466928315562958850) [there](https://kylepiira.com/2020/01/09/why-i-quit-google/) where people got locked out.

## Portability is freedom

My email is now on my own domain, hosted at Fastmail. I’m using 1Passwords for logins and passkeys. I use Firefox for bookmark sync. And I never use social logins.

I pay for all of these services. It costs me around 12$ a month and it’s totally worth it. I feel good about supporting more independent internet, plus paying for service has so many other benefits (like a support that actually talks to you, better privacy, loads faster, and so on).

The point is not to avoid Google at all costs, but to minimize the impact of being suspended. If I would simply switch to Apple or Microsoft, it would be the same problem. **The internet is meant to be decentralized.**

I still use YouTube and Google Maps. But they are just yet another service I use. If I would get suspended, it would not be a big deal anymore.

If you’re in the same position as I was 2 years ago, now is the best time to reconsider your online being.
Using MQTT.JS library
Published: 2023-03-02 06:28:54

MQTT (Message Queuing Telemetry Transport) is a lightweight publish-subscribe messaging protocol designed for use in IoT (Internet of Things) and M2M (Machine to Machine) communication. MQTT protocol is a client-server protocol, where the clients are the IoT devices, and the server is the broker that facilitates communication between the devices.

Following is an example of how to create an MQTT client using the MQTT.js library in JavaScript:

```
const mqtt = require('mqtt')

// Connect to the MQTT broker
const client = mqtt.connect('mqtt://broker.agilytics.in')

// Subscribe to a topic
client.subscribe('my/topic')

// Publish a message to a topic
client.publish('my/topic', 'Hello Agilytics!')

// Handle incoming messages
client.on('message', (topic, message) => {
  console.log(`Received message on topic ${topic}: ${message}`)
})

// Handle errors
client.on('error', (error) => {
  console.error(`Error: ${error}`)
})

// Disconnect from the MQTT broker
client.end()
```

This code uses the mqtt library to connect to an MQTT broker, subscribe to a topic, publish a message to that topic, and handle incoming messages and errors. You'll need to replace mqtt://broker.agilytics.in with the address of your own MQTT broker.
Software Architecture
Tags: opengauss, discuss, beginners
Published: 2023-03-02 07:06:41

openGauss is a standalone system that supports one primary and up to eight standby servers.

Service data is stored on a single physical node, and data access tasks are pushed to service nodes and then executed. The high concurrency of servers enables quick response to data processing. In addition, data can be copied to the standby server through log replication, ensuring high reliability and scalability.

Software Architecture

Figure 1 shows the logical components of openGauss.


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


Figure 1 openGauss logical architecture

Table 1 Architecture description

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h85etva07m8u2xd07hv7.png)
How to compare mongoose model objects in jest while excluding _id
Tags: javascript, testing, mongodb, jest
Published: 2023-03-02 06:50:20

The schema model object in Mongoose provides an `_id` that is of type `ObjectId`. If you are not interested in comparing value of this attribute when you compare it compare objects in jest, you can exclude it by calling the `toObject` method of the mongoose model and set the `_id` object to nothing via the spread operator, something similar to the following:

```
expect({...resultBookmark.toObject(), _id: {}}).toEqual({...expectedBookmark.toObject(), _id: {}})
```

The complete testing method with the setup is shown in the snippet bellow,
where expected bookmark model should match the mapped bookmark from the given request:

```javascript
const showdown = require('showdown');
const Bookmark = require('../../model/bookmark');
const bookmarkRequestMapper = require('./bookmark-request.mapper');

jest.mock('showdown', () => {
  const makeHtml = jest.fn(() => '<p>This is a test bookmark</p>');
  return {
    Converter: jest.fn().mockImplementation(() => ({makeHtml})),
  };
});

describe('toBookmark', () => {
  const req = {
    body: {
      _id: '123',
      name: 'Test Bookmark',
      location: 'https://example.com',
      language: 'en',
      description: 'This is a test bookmark',
      tags: ['test'],
      public: true,
    },
    params: {
      userId: '456',
    },
  };

  beforeEach(() => {
    showdown.Converter.mockClear();
    showdown.Converter().makeHtml.mockClear();
    req.body.descriptionHtml = undefined;
    req.body.youtubeVideoId = undefined;
    req.body.stackoverflowQuestionId = undefined;
  });

  it('should use descriptionHtml if it is provided', () => {
    req.body.descriptionHtml = '<p>This is a test bookmark</p>';

    const expectedBookmark = new Bookmark({
      _id: '123',
      name: 'Test Bookmark',
      location: 'https://example.com',
      language: 'en',
      description: 'This is a test bookmark',
      descriptionHtml: '<p>This is a test bookmark</p>',
      tags: ['test'],
      public: true,
      userId: '456',
      likeCount: 0,
      youtubeVideoId: null,
      stackoverflowQuestionId: null,
    });

    const resultBookmark = bookmarkRequestMapper.toBookmark(req);

    expect({...resultBookmark.toObject(), _id: {}}).toEqual({...expectedBookmark.toObject(), _id: {}})
    expect(showdown.Converter().makeHtml).not.toHaveBeenCalled();
  });
});
```

**Project**: [`codever`](https://github.com/CodeverDotDev/codever) - **File**:  `bookmark-request.mapper.test.js`

<hr/>

> Shared with :heart: from [**Codever**](https://www.codever.dev/snippets/63ff7adb1b5b8945055f4e59/details). Use :point_right: [**copy to mine**](https://www.codever.dev/snippets/63ff7adb1b5b8945055f4e59/details) functionality to add it to your personal snippets collection. 
> 
> **Codever** is open source on [Github](https://github.com/CodeverDotDev)⭐🙏
Street Programmer: Create Stunning Banners with Github Action
Tags: javascript, programming, tooling, githubactions
Published: 2023-03-02 06:40:05

Are you tired of spending time creating banners for your articles? Look no further than the Create Banner Image Github Action and Rest API! With just one step, you can create stunning banners for your articles.

The Github Action is easy to use and integrates seamlessly with your workflow. Simply add the action to your workflow and provide the necessary inputs, such as your Github token, canonical name, gradient colors, article name, article category, and emoji.

But that's not all - the Rest API is also available for deployment on your server. With a simple curl command, you can generate a banner for your article with the same ease as the Github Action.

No more wasting time designing banners - let the [Create Banner Image Github Action](https://github.com/darkterminal/create-banner-image) and Rest API handle it for you. Try it out today and see the difference it can make in your article presentation!

Let's say we have a GitHub repository for a blog or website, and we want to automatically generate banner images for each new article that we publish. We can use the "Create Banner Image - Github Action & Rest API" tool to achieve this.

Here's an example flow of how this might work:

    

1. Create a new article for the website or blog and commit it to the GitHub repository.
2. Add the necessary metadata to the article file, including the article title, category, and any other relevant information. This metadata will be used to generate the banner image.
3. Create a new GitHub Actions workflow file that includes the "Create Banner Image" job. This job should be triggered whenever a new article is committed to the repository.
4. In the job definition, specify the input parameters for the "Create Banner Image" tool. These include the GitHub access token, the canonical name of the article (which is used to generate the image file name), the gradient colors to use for the image background, the article name, category, and an emoji to include in the image.
5. When the job runs, it will use the input parameters to call the "Create Banner Image" REST API, which will generate the banner image and save it to the repository.
6. Once the banner image is generated and saved, it can be included in the article itself, either by referencing the file path or by embedding it directly in the HTML.

With this flow, every time we publish a new article, a banner image will automatically be generated and saved to the repository, making it easy to add visual interest and attract readers to our content.

{% github https://github.com/darkterminal/create-banner-image %}
Vocabulary Based Game App UI
Tags: uiux, ux, uiweekly, programming
Published: 2023-03-02 06:28:43

This Vocabulary-Based Game App UI will help the user understand English Vocabulary. This application [UI & UX](https://www.cmarix.com/ui-ux-design.html) works on Different quiz game & leaderboard by giving notification that runs in the background of their smartphone, like Vocabulary and translation. 

[Check It Now](https://www.behance.net/gallery/165012899/Vocabulary-Based-Game-App-UI )
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/03h5114ruv1owc6o9ptr.png)
O que é e para o que serve arquitetura de microsserviços?
Published: 2023-03-02 06:23:46

Nos últimos anos, a arquitetura de microsserviços tem se tornado cada vez mais popular na construção de sistemas de software escaláveis e flexíveis. Essa abordagem é uma evolução da arquitetura monolítica, onde um único aplicativo é desenvolvido como uma unidade e todos os componentes estão intimamente acoplados.

A arquitetura de microsserviços, por outro lado, consiste em dividir um aplicativo em serviços independentes e autônomos que podem ser implementados, testados e escalados independentemente uns dos outros. Cada serviço é responsável por uma única funcionalidade de negócio e se comunica com outros serviços por APIs bem definidas.

A principal vantagem da arquitetura de microsserviços é que ela permite que as equipes de desenvolvimento sejam mais ágeis e iterativas na construção de um sistema. Cada serviço pode ser implementado e implantado separadamente, permitindo que as equipes trabalhem de forma independente e acelerem o ciclo de desenvolvimento. Além disso, a modularidade dos microsserviços torna mais fácil para as equipes entenderem e manterem o código.

Outra vantagem é a escalabilidade horizontal. Ao contrário da arquitetura monolítica, onde todo o aplicativo é implantado em um único servidor, a arquitetura de microsserviços permite que cada serviço seja implantado em seu próprio servidor. Isso significa que os serviços sobrecarregados possam ser facilmente escalados, enquanto os outros serviços continuam a operar normalmente.

A arquitetura de microsserviços também permite uma maior resiliência e tolerância a falhas. Se um serviço falhar, ele não afetará os outros serviços. Além disso, a separação de serviços torna mais fácil para as equipes isolar e corrigir problemas em um serviço sem afetar outros serviços.

No entanto, a arquitetura de microsserviços também apresenta desafios. A comunicação entre serviços deve ser gerenciada cuidadosamente para garantir que a arquitetura seja escalável e confiável. Além disso, a separação de serviços pode levar a um aumento na complexidade do sistema como um todo.

Em resumo, a arquitetura de microsserviços é uma abordagem para a construção de sistemas de software escaláveis e flexíveis, onde um aplicativo é dividido em serviços independentes e autônomos. Essa abordagem permite que as equipes de desenvolvimento sejam mais ágeis e iterativas na construção de um sistema, e permite uma maior resiliência e tolerância a falhas. No entanto, a arquitetura de microsserviços também apresenta desafios, que devem ser gerenciados cuidadosamente para garantir que a arquitetura seja escalável e confiável.
What is a context switching?
Published: 2023-03-02 06:03:22

# What is context switching?


###**Context Switching**
The process of replacing a running process/thread with another process/thread on a CPU/core.
Each process has a thread, which is the basic unit executed on a CPU/core.


### What is a context?
The status of a process/thread, CPU, memory, etc.


### Why is context switching necessary?
To execute multiple processes/threads simultaneously.

### When does context switching occur? 
When the given time slice(quantum) has been used up, when IO operations are required, when using other resources, etc.


##Context switching in a multitasking system
&rarr; Since the program is executed by dividing it into short periods, the user feels like programs are being executed simultaneously.


### Who executes context switching?
OK kurnel: manages/supervises various resources.


### How does context switching occur?
- Process context switching: switching between different processes.

- Thread context switching: switching between threads in the same process.


**Commonalities:**
- Executed in kernel mode
&rarr; control is transferred from the process to the kernel.

- Registers of the CPU are replaced
&rarr; the register state of the process being executed is saved somewhere, and another process is executed. Later, the saved register state of the first process is used to execute it again.

Registers: a location where data necessary to execute instructions is stored.


**Differences:**
- Process context switching
&rarr; additional processing related to virtual memory addresses is performed. MMU TLB

- Thread context switching
&rarr; memory-related processing is not needed because memory is shared within the same process.


### Summary
- Memory processing must be performed to prevent incorrect access to each other's memory areas.

- Thread context switching is faster than process context switching.(sharing a memory)

- Indirect effects of context switching: cache pollution.
Since the previous thread's information may be stored in the cache, when the thread is switched, it becomes useless.

- From the user's perspective: pure overhead.


**This posting is just a study note which was written after watching youtube videos in Korean.**
[Youtube Link](https://youtu.be/qnVKEwjG_gM)
Setting up M1/M2 Mac for using package node-gyp
Published: 2023-03-02 05:55:25

If you're using an M1 Mac and trying to use Node.js for native module development, you may run into errors with node-gyp. Node-gyp is a tool that compiles native modules for Node.js, and it needs to be configured correctly to work on an M1 Mac. In this article, we'll explore how to set up an M1 Mac to use node-gyp without errors.

## Step 1: Install Command Line Tools

After installing Xcode, you need to install the Command Line Tools. Open a terminal window and enter the following command:
```bash
xcode-select --install
```

This command installs the Command Line Tools, which include the necessary tools for compiling software on a Mac.

## Step 2: Install Homebrew

Homebrew is a package manager for macOS that makes it easy to install and manage software packages. You can install Homebrew by entering the following command in a terminal window:
```bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
```

This command installs Homebrew and sets it up on your system.

## Step 3: Install Node.js

After installing Homebrew, you can use it to install Node.js. Enter the following command in a terminal window:
```bash
brew install node
```

This command installs the latest version of Node.js and its dependencies.

## Step 4: Configure node-gyp

Now that Node.js is installed, you need to configure node-gyp to work on an M1 Mac. Open a terminal window and enter the following command:
```bash
export CXXFLAGS="-stdlib=libc++"
```

This command sets the C++ standard library to libc++, which is required for node-gyp to work on an M1 Mac.

## Step 5: Test node-gyp

To test that node-gyp is configured correctly, you can install a native module that depends on it. Open a terminal window and enter the following command:
```bash
npm install -g node-gyp
```

This command installs the node-gyp package globally.

To test that node-gyp is working correctly, you can create a new Node.js project and install a native module that depends on it. For example, you can create a new project with the following command:bash
```bash
mkdir test-project &amp;&amp; cd test-project
npm init -y
```

Then, you can install a native module that depends on node-gyp with the following command:
```bash
npm install sharp
```

The sharp module is an image processing library that uses node-gyp to compile native code.

If node-gyp is configured correctly, you should be able to install the sharp module without errors.

## Conclusion

Setting up node-gyp on an M1 Mac can be challenging, but it's necessary for native module development in Node.js. By following these steps, you can configure node-gyp to work correctly on your M1 Mac and avoid errors when compiling native modules.
Top 11 Freelancing Websites for Software Testers& QA. (Even as Manual Tester)
Tags: javascript, webdev, beginners, programming
Published: 2023-03-02 05:43:06

Do you want to earn some extra cash while working part time as Software Tester. You can get lots of manual and Automation projects on these top 11  freelancing websites for QA.

{% embed https://youtu.be/NS16TsvKNRI %}

Here is the link of List ► https://mm.tt/1350598845?t=DtWnnll8X6

▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
Mastering API Testing Course  ►: https://learnapitesting.com

Join at  ►:  https://learn.thetestingacademy.com

▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

Join Facebook Group :  http://bit.ly/learntesting2019

Website:   https://scrolltest.com

Website:   https://thetestingacademy.com

Twitter: https://twitter.com/itstechmode

🚀 Tools and services I recommend:
Some of the courses that I recommend to become better Automation Tester 🙌🙌

✅Selenium Training and Certification -
https://scrolltest.com/go/edureka


✅Learn Jenkins for QA -
https://bit.ly/learnjenkins-p1


✅Programming Java -
https://bit.ly/learnjava2020-p1


✅Test Automation - 
https://bit.ly/learnautomation2020


✅API Testing - 
https://www.learnapitesting.com


✅Cypress Tutorial with LIVE Projects -
http://cypresstutorial.com