teleren/devto huggingface dataset:
Setting up PgAdmin4 with Homebrew
Tags: homebrew, postgressql, macos, tutorial
Published: 2023-12-17 19:40:39

There are a few ways of setting up PgAdmin4 you can download it from the official website [pgadmin](https://www.pgadmin.org) or you can set it up with homebrew. I like homebrew so we're going to do it that way!

Here's how you can do it too!

First, It's always a good practice to update Homebrew to ensure you get the latest versions of software.

```
brew update
```

Next we can install pgAdmin 4 using Homebrew by executing the following command:

```
brew install --cask pgadmin4
```

After the installation is complete, you can launch pgAdmin 4. 

You might find it in your Applications folder, or you can start it using the Finder search (Cmd + Spacebar, then type "pgAdmin 4").


## **Connecting to your PostgreSQL Database**

When you first open pgAdmin 4, you'll need to set a master password for the pgAdmin application itself. This is different from your PostgreSQL credentials.

To connect to your local PostgreSQL database, right-click on `Servers` in the left-hand browser pane, and a dropdown will appear

`Register  > Server`

and

`Create  > Server Group`

for all intents and purposes we're going to create a new server group.

Select `Create  > Server Group`

In the `Create - Server Group` dialog, enter a name for the connection in the `Name` field. Your new server group will come up in the left pane. Right click the server name you just created and click `Register > Server`.


Make sure you give the server a name and then switch to the `Connection` tab, and enter the following details, We're going to create a locally running postgreSQL database.

```
Hostname/address: localhost
Port: 5432 (default PostgreSQL port)
Maintenance database: postgres
Username: Your PostgreSQL SuperUsername
Password: Your PostgreSQL user's password
```
Note: You can save the password for ease of use later.

Remember to ensure that your PostgreSQL server is running when you try to connect via pgAdmin 4. If you face any issues with the connection, verify that PostgreSQL is active (using brew services list) and that the connection details in pgAdmin 4 are correct and that's it. 

You can now use pgAdmin 4 to manage your PostgreSQL databases, create tables, run queries, and much more, all through a user-friendly interface.
Understanding Object-Oriented Programming: Unveiling the Power of Classes
Tags: oop, class, programming, csharp
Published: 2023-12-17 19:40:08

Embarking on the journey into the world of Object-Oriented Programming (OOP) is similar to exploring a landscape filled with architectural blueprints. At the very heart of this programming paradigm resides a fundamental building block: 'Classes.' Much more than typical templates, classes serve as the backbone of OOP, enabling the creation of structured, modular, and reusable code. Understanding classes opens the doors to developing powerful software applications, organizing data, and defining behaviors. So, let's go into the heart of OOP and discover the significant impact of classes on creating elegant and effective solutions to real-world programming challenges.

## Classes
In the context of **Object-Oriented Programming (OOP)**, a class serves as a blueprint or template that defines the properties (attributes) and behaviors (methods) that objects belonging to that class will contain. It serves as a fundamental principle for organizing code and generating objects.

- **Blueprint or Template:** A class defines the structure, attributes (properties), and behaviors (methods) that objects instantiated from that class will contain.

- **Properties (Attributes):** These are the features or data associated with objects in the class. They represent the state of the object and are defined as fields within the class.

- **Behaviors (Methods):** These are the actions or operations that objects in the class can perform. Methods explain what an object can do and how it can interact with other objects or the environment.

- **Fundamental Principle for Organizing Code:** Classes provide an approach to organize code by grouping related data and functionalities into a single component. They promote modularity, re-usability, and maintainability in software development.

- **Generating Objects:** Instances or objects are generated based on the blueprint provided by a class. Each object created from a class has its own set of properties and behaviors defined by that class.
```C#
//Class Example

public class Car
{
    // Field
    private string model;

    // Property
    public string Model
    {
        get { return model; }
        set { model = value; }
    }

    // Constructor
    public Car()
    {
        // Constructor logic
    }

    // Method
    public void StartEngine()
    {
        // Method body
    }
}

```
Bandit Level 19 Level 20
Tags: ctf, writeup, overthewire, bandit
Published: 2023-12-17 19:39:57

## Introduction

Greetings, Welcome back to the OverTheWire Bandit challenges. In this level, we are presented with a custom binary that has to be exploited to get secret information.

## Previous Flag

In the previous challenge, we successfully acquired the following flag:

Flag:

```
awhqfNnAbc1naukrpqDYcF95h7HoMTrC
```

### Exploring bandit20-do

Our next task involves the execution of the `./bandit20-do` command. Let's initiate it and see what it does:

```bash
./bandit20-do
```

It seems like this binary executes whatever bash command we provide as the user we want to escalate to, bandit20.

### Retrieving Bandit20 Password

Now that we have access to `bandit20-do`, let's utilize it to read the contents of the `/etc/bandit_pass/bandit20` file:

```bash
./bandit20-do cat /etc/bandit_pass/bandit20
```

Executing this command should reveal the password for the Bandit level 20. 

Flag:

```
VxCazJaVykI6W36BkBU0mJTCM8rR95XT
```
MERN Project: Movie Portal with AI- using Node & Next.js
Tags: javascript, nextjs, node, mern
Published: 2023-12-17 19:39:53

Welcome to this tutorial. In this tutorial, we are making MERN Project. 

**Overview of Project:**
Frontend, we used NextJs and Backend used Node. This Project's main feature is, that we are using AI to make a movie portal. 
Like In Frontend, We have a form to connect Ai. We Type our idea or story in this form, and then AI will generate 3 things. 

1. Movie Title
2. Movie Description
3. Title and Description wise image

Then we saved this information in our database, like MongoDB.

For doing easy our project, we separated Five parts in this project. These are

1. Making API Using Node and Express. [Link](https://dev.to/kamruzzaman/making-api-using-node-and-express-4a9l)
2. Scaffolding redux-toolkit in NextJs. [Link](https://dev.to/kamruzzaman/scaffolding-redux-toolkit-in-nextjs-1n2p)
3. API Setup in NextJs. [Link](https://dev.to/kamruzzaman/api-setup-in-nextjs-3gen)
4. AI Prompt setup on Nextjs. [Link](https://dev.to/kamruzzaman/ai-prompt-setup-on-nextjs-2109)
5. Deploy A NextJs App and Node API on a Linux Server. [Link](https://dev.to/kamruzzaman/deploy-a-nextjs-app-and-node-api-on-a-linux-server-3ge8)

Here this project short video and pictures.

[Vidoe Link](https://youtu.be/CQBIkzvocc8) 


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


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1mr55aflg9g42lycmw20.jpg)
**AI Result Page**


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/07hot7wo5mbp16turwvy.jpg)
**Home page**
Project Seventeen: Notifications
Tags: webdev, beginners, challenge, codingquokka
Published: 2023-12-17 19:36:41

Would you like a *toast*? How about a *snackbar*? I bet whoever coined these terms for small notification popping up on a website or in an app was very hungry.

Regardless of etymology toast-messages are used in pretty much any service to notify users that operation is complete, failed or something else has happened.

Build one today and you'll certainly use it more than once.

## Toast Notification: requirements and recipe

> As a user a want a clear message to popup like a toast from a toaster, so that I can be quickly made aware of an important event

There are plenty of ready to use components, here's an example from [Material UI](https://m1.material.io/components/snackbars-toasts.html):

!["Your message has been sent" toast in the bottom of the screen](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0nrt9lzev7lhim3l5mo0.png)

As usual I'll leave the design to your imagination as long as the requirements are met:

### Requirements

1. All notifications should have the same width and preferably the same height
2. They should automatically close after several seconds
3. User should be able to close it manually
4. The amount of toasts present on the screen should be reasonably limited ( to 2-3 or event better - just one)
5. Toast notifications should have proper aria labels
6. Toast notifications should have sufficient contrast

### Recipe

1. Design a static message
2. Pick a position on the screen and ensure that the areas around message are still interactive
3. Ensure accessibility
4. Add ability for the toast to be closed after a certain amount of time
5. Add ability for user to close the toast manually
6. Write a function that would create a toast notification with a provided message
7. Add a limit to the amount of toasts on the screen
8. Ping!

### Hints

When using `setTimeout` don't forget to clean the timer when toast is closed or hidden.

To limit amount of toasts on the screen one could use a queue, but show the latest added messages first.

## Hard mode: Push Notifications

You've built a way to notify user of what is going on when user is on the page, but what if something important happens when user is away? 

And the answer is - send them a push notification. Of course, you should first ask them for a consent and a special token, but you'll be able to figure it out ;-)

Share your creations and feedback and see you tomorrow!

Liked the idea a lot and would love to have it all year long?

[![Buy Me A Coffee](https://cdn.buymeacoffee.com/buttons/v2/default-red.png)](https://www.buymeacoffee.com/valeriavg)
📘 Wanted to be a Top Engineer but clueless where to start?
Tags: softwareengineering, productivity, codenewbie, career
Published: 2023-12-17 19:33:19

Okay, like title says, you wanted to be a Top Engineer but clueless where to start?

Well, here's your chance! ScyllaDB, a leading database provider, **has sponsored** a publication featuring chapters from Martin Kleppmann's legendary book, **"Designing Data-Intensive Applications"**. If you haven't had a chance to read it, now is your opportunity to get a taste of this valuable resource.


![Designing Data-Intensive Applications](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/see3rkltjf89zsp23drn.png)

In his book, Kleppmann delves into topics like distributed database tradeoffs, replication strategies, caching strategies, scaling strategies and many more. By understanding these software architecture concepts, you can enable your organisation to achieve greater agility, efficiency, and growth potential, while also advancing your knowledge and skills as an engineer.

How are you currently handling data-intensive applications in your organization? Share your experiences and don't forget to grab your copy of the sponsored chapters to dive deeper into the world of data-intensive applications with the link below 👇 👇 👇

https://lp.scylladb.com/designing-data-intensive-apps-book-offer
Understanding Object-Oriented Programming Concepts: A Comprehensive Guide for Interviews
Tags: csharp, dotnet, oopconcepts, programmingtips
Published: 2023-12-17 19:23:46

**Object-Oriented Programming (OOP)** is a fundamental aspect of software development that has significantly transformed the way we create and develop applications within this vast field. Having a solid understanding of Object-Oriented Programming (OOP) concepts is not only beneficial but also often the determining factor in succeeding in programming interviews and thriving in the constantly evolving field of technology. This applies to both prospective developers and experienced experts.

Imagine OOP as the architectural blueprint, providing an organized approach for designing, organizing, and managing code. This guide covers the fundamental Object-Oriented Programming (OOP) concepts that are essential to the field of software engineering. If you are getting prepared for a technical interview or trying to strengthen your programming competencies, this exploration will provide you with the required knowledge and insights to confidently navigate the complexities of Object-Oriented Programming (OOP).

Get ready and be prepared to explore the world of Object-Oriented Programming (OOP) with clear understanding and intention. Upon the conclusion of this expedition, you will not only understand these essential concepts, but also utilize their potential to write code that is more brief and effective, so thriving in your upcoming interviews with confidence.

**Topics Covered in the series:**

- Classes
- Objects
- Encapsulation
- Abstraction 
- Inheritance
- Polymorphism
Miss the old operating systems? Join us for Windows 2000 Software/Driver development
Published: 2023-12-17 19:13:30

Hello everyone, Please, if someone is interested and volunteer to develop drivers and software for Windows 2000, they should join our community. There are individuals who have a serious commitment to this mission. I want to start with the NVMe driver.Discord Server : https://discord.gg/FtfQ7q8h
📘 The Bible of Generative AI – A Must-Read
Tags: ai, programming, productivity, career
Published: 2023-12-17 19:03:03

 
Today, I want to share another great resource in AI. CB Insights has recently unveiled a 120-page masterpiece, **"The Generative AI Bible"**, a crucial read for anyone in our field.

![The Generative AI Bible](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/td11tbgq1r5l14tp9q5e.jpeg)

The growth of generative AI (GenAI) was gradual, but suddenly it surged, shaking the world:

- understand how this happened;
- and why it happened?

_For non-specialists_, the most interesting and comprehensible part is Part 1.

For those _who want to understand_ the undercurrents and trends, Part 2 is ideal.

Part 3 is particularly relevant _for investors and government officials_.

This report covers the big competition to lead in GenAI technology, how it's changing many industries, and the great chances for growth in areas like healthcare, finance, insurance, and retail. It talks about how companies are now using GenAI to make smarter online shopping and automate difficult tasks. 

This report is a must-read to see how GenAI is becoming a key part of our future in various fields.

The Generative AI Bible –https://www.cbinsights.com/research/report/generative-ai-bible/
It's time to talk about DRY
Tags: webdev, javascript, programming, tutorial
Published: 2023-12-17 19:01:32



This is a pattern that is one of the main practices in programming and system design. Its essence lies in minimizing the repetition of information and code, which helps to increase readability, maintainability, and scalability of software.

The main aspects of this principle:

Don't repeat code: When you write programs, avoid having the same lines of code repeated in different parts of the program. This means you should not copy or write the same code over and over again. Instead, create this code once and use it wherever needed.

Group code: To make your code more organized and easier to manage, consider grouping similar operations and functions in one part of the code. For example, if you have several places where you need to do the same things, create a function that performs these actions and use it as many times as needed.

Use functions and libraries: If other programmers have created useful pieces of code or libraries, you can use them in your programs. Instead of reinventing the wheel, you can use ready-made solutions that already exist. This will save you time and make your work more efficient.

Reducing complexity: By adhering to the DRY principle, you create less code that needs maintenance and bug fixing. This makes your program less complex and less prone to errors.
Setting up Postgres via Homebrew
Tags: macos, homebrew, postgressql
Published: 2023-12-17 18:38:53

Setting up PostgreSQL using Homebrew is quick easy and painless, Here's a detailed guide to help you through the process:

Install Homebrew if you haven't already installed Homebrew, you can do so by running the following command in your terminal:

```
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
```

Installing PostgreSQL once Homebrew is installed, you can install PostgreSQL by running:

```
brew install postgresql@version_number
```

Initializing a Database Directory after installation, you can initialize the directory with this command:

```
brew services start postgresql@version_number
```

Check that PostgreSQL Services are running with:

```
brew services list
```

**Creating a Superuser**

To create a Superuser, you can access the PostgreSQL interactive terminal by running the command:

```
psql postgres
```

Then, you can create a new superuser ideally you would want to replace username with your desired username:

```
CREATE ROLE username WITH LOGIN SUPERUSER CREATEDB CREATEROLE PASSWORD 'password';
```
Make sure you replace 'password' with a your super secret secure password.

To exit the PostgreSQL Interactive Terminal: Type `\q` and then press Return/Enter to quit the PostgreSQL interactive terminal.


But, WAIT.. There's more...

Additionally, If you have multiple versions of PostgreSQL installed, or if you want to use the `PostgreSQL@version_number` that you installed as your default version, you can link it with:

```
brew link postgresql@version_number --force
```

Finally you want to verify the installation, you can verify that PostgreSQL is properly installed and the superuser is created by logging into PostgreSQL with the new user credentials:

```
psql -U username -d postgres
```

Again remember to replace username and password with your chosen username and password. Make sure to keep your password secure and avoid using simple or predictable passwords.

I like to use sha256 myself for passwords, but that's an article for another time.
Are You Lazy or Burnt Out?
Tags: productivity, discuss, startup, developer
Published: 2023-12-17 18:29:35

View a tl;dr on [Substack](https://cmdfang.substack.com/p/are-you-lazy-or-burnt-out).

Lack of motivation is so commonplace that there’s a multi-billion dollar industry designed to profit off of it.

However, one thing I’ve learned throughout the years is that we all stand to benefit from understanding our physiological and psychological signals. We inherently understand that the correct response to muscle soreness is rest, so why do we not apply the same principles to our psychological indicators?

Traditional grind culture sidelines psychological signals. Emotions and feelings are considered unimportant and productivity is the only concern. This is a great recipe for burnout.

On the opposite end of the spectrum, current day wellness culture is heavily in tune with the need to rest and recover. While this is a positive change, wellness is often used as an excuse to not get work done.

**Are you burnt out, or are you just lazy?**

My rule of thumb is:

- I’m being lazy if I haven’t yet started the task
- I’m burnt out if I’ve been spending 80%+ of my available time on the task

For the latter item, “available time” is loosely defined and entirely dependent on the task itself:

- For a work-related task, then “available time” would be the amount of time I’ve allocated towards that piece of work
- For something like writing a blog, “available time” would be the amount of time I dedicate towards hobbies

There exists a spectrum of states in between these extremes, and it’s up to you to develop an intuition for identifying the root cause of your lack of motivation. As an example, I may have been extra busy at work - potentially putting in 80+ hours a week into my startup. If I end up unmotivated to write a blog post, I’ve come to understand that:

- I’m burnt out because my mind has been mentally drained from work
- I should take my free time to rest and recuperate - not further tax my brain by trying to write a blog

Having an understanding of your psychological state allows you to take the best course of action in response. The best remedy for burnout is to distance yourself from stress and engage in activities that rejuvenate your mental well-being. But if you’re just being lazy, you need to swallow your emotions and just do the damn thing.
Automatically register and load vue routes 🔥 (vue 2-3)
Published: 2023-12-17 18:29:22

in the routes folder you can create a route loader file to automatically load routes then add them to the route registration of the app

```typescript
// routeLoader.[js,ts]
import { RouteConfig } from 'vue-router';

export default function loadRoutes(): RouteConfig[] {
  const routes: RouteConfig[] = [];
  const requireRoutes = require.context(
    './routes',
    true,
    /^(?!.*test).*\.(js|ts)$/is,
  );

  requireRoutes.keys().forEach((fileName) => {
    const module = requireRoutes(fileName);
    const route = module.default || module;

    routes.push({
      ...(route as RouteConfig),
    });
  });

  return routes;
}
```

In the route registration, assign `loadRoutes` to routes,
this will also work for nested routes

```typescript
// routes/index.[ts|js]

import Vue from 'vue';
import VueRouter from 'vue-router';
import loadRoutes from './routeLoader';

Vue.use(VueRouter);

const router = new VueRouter({
  routes: loadRoutes(),
});

export default router;
```

Single route definition

```typescript
import Home from '@/views/Home.vue';
import About from '@/views/About.vue';

// Nested route definition
import NestedRoutes from './nestedRoutes';

const routes: RouteConfig[] = [
  {
    path: '/',
    component: Home,
  },
  {
    path: '/about',
    component: About,
    children: NestedRoutes,
  },
];

export default routes;

```
How-to install Windows SPICE Guest Tools on QEMU/KVM Virtual Machine Manager
Published: 2023-12-17 18:25:00

As everyone knows, getting started with a new technology is not always simple but this how-to will hopefully help in the process when using a Windows VM.

As of 2023 and if you are using a Windows guest you can use ***Windows SPICE Guest Tools***.

## How to install Windows SPICE Guest Tools on QEMU/KVM Virtual Machine Manager

To start, make sure inside the VM manager "*Show virtual hardware details*" -> "*Video < Model-Name >*" you have QXL selected.

If it looks like this: 

[![enter image description here][1]][1]

then you continue with the following steps.

### The Process

1. Start the Windows VM.

2. Open your favorite browser, inside the Windows VM.

3. Go to [SPICE Website Download Page][2].
    [![enter image description here][3]][3]

4. Scroll down to "***Windows binaries***".

5. In the first sentence you should see:
    - "*Windows SPICE Guest Tools (spice-guest-tools)*" 
    - Click -> (*[spice-guest-tools][4]*) to download it on the Guest VM.
    [![enter image description here][5]][5]

6. Run through the installer. The defaults should be fine.
    [![enter image description here][6]][6]

7. Restart

You should now be able to change the "Display resolution" in the Windows VM.

![Shows an image of Windows Settings Display Resolution being changed](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tam5xfimh21mi31xwlsl.png)

Hopefully this helps. If you have further questions, let me know in the comments.

  [1]: https://i.stack.imgur.com/ga0mx.png
  [2]: https://www.spice-space.org/download.html
  [3]: https://i.stack.imgur.com/Wmc2j.jpg
  [4]: https://www.spice-space.org/download/windows/spice-guest-tools/spice-guest-tools-latest.exe
  [5]: https://i.stack.imgur.com/3C8gZ.png
  [6]: https://i.stack.imgur.com/KkGS9.png
  [7]: https://i.stack.imgur.com/mpE7T.png