teleren/devto huggingface dataset:
Passwords vs Keys
Tags: password, keys, security
Published: 2023-10-30 05:40:21



🔒 **Passwords: The Basics**

Passwords are the most common way to prove your identity online. However, they need to be strong to protect your accounts. Here's what you need to know:

**Best Practices:**

- Use longer passwords (at least 8 characters).
- Mix it up with numbers, upper and lower case letters, and symbols.
- Avoid common words or simple substitutions.
- Never reuse the same password for different accounts.
- Change your passwords regularly.

🧐 **Why Passwords Matter**

Using weak or easily guessable passwords can put your accounts at risk. Attackers have many tricks up their sleeves to crack them.

💡 **Password Managers to the Rescue**

Password managers like KeePass, LastPass, and 1Password can make life easier:

🔑 **KeePass**: Keeps your passwords in a secure, encrypted database. Only remember one strong password.

🔗 [KeePass](https://keepass.info/)

👉 **To Install**: `brew cask install keepassxc`

🔑 **LastPass**: Manage passwords online, across devices. Also, offers convenient browser plugins and mobile apps.

🔗 [LastPass](https://www.lastpass.com)

🔑 **1Password**: A competitor to LastPass. Some prefer it due to its security features.

🔗 [1Password](https://1password.com/)

🔐 **Public Key Authentication: The Advanced Way**

For a higher level of security, you can use public key authentication. Here's how it works:

🔑 **SSH (Secure Shell)**: Uses public key authentication to allow passwordless access to remote hosts.

📜 **Steps to Set Up SSH**:

1. Generate SSH keys with `ssh-keygen -b 4096`.
2. Copy your public key to the SSH server with `scp`.
3. Append the public key to `authorized_keys`.
4. Adjust file permissions with `chmod`.

Simple SSH Key Generate

```
# Generate SSH keys. Use the default file and empty passphrase for the keys.
ssh-keygen -b 4096

# Copy public key to SSH server
scp ~/.ssh/id_rsa.pub <HOST_NAME>:

# SSH to host
ssh <HOST_NAME>

# Append public key to authorized_keys
mkdir ~/.ssh
cat id_rsa.pub >> ~/.ssh/authorized_keys
rm id_rsa.pub
```
⚠️ **Note**: The private key should remain secret and have restricted file permissions.

🛡️ **Advantages of Public Key Authentication**:

- Enhanced security through cryptographic keys.
- Passwordless and non-interactive access.
- Avoids the risk of password cracking.

🚫 **Disadvantages of Public Key Authentication**:

- More complex setup.
- If the private key is compromised, it's a security risk.

🚀 **Tips and Tricks**

- Simplify login to different hosts using SSH config files.
- Set defaults for hosts so you don't need to enter the same details repeatedly.

📄 **Sample SSH Config File**:

```
Host my_host
    Hostname ec2-42-42-42-42.us-west-2.compute.amazonaws.com
    User ec2-user
    IdentityFile ~/.ssh/host_public_key.pub
```

👉 Now, you can connect with `ssh my_host` effortlessly.

🔑 **Deliverable**: Create SSH keys, add the public key to an SSH server, and test logging in without a password.

So, choose your authentication method wisely—passwords for simplicity or public keys for enhanced security. Stay safe online! 🌐🔐
What's your honest opinion of the Next.js App Router?
Published: 2023-10-30 05:36:00

So I tried using the App Router in a new project, but to be honest it felt weird.

For example: server forms, where the backend logic ends up in the same file as the frontend, but it's not clear which code is executed where? not being able to use `useState` and `useEffect` in server components, but it works when splitting in another file?

I feel like I just don't get it. Pages router seemed much simpler and clearer.

Maybe I just need to rethink how everything is done, but I don't know, the performance improvements seemed minimal for my use case.

With Next.js 14 coming out, curious to hear from people that fully made the switch on big projects, or those that tried it but didn't get it like me, what do you think? Is it really the future of web dev or meh?
I finally completed participation in Hacktoberfest23 as a Contributor
Tags: hack23contributor, hacktoberfest23, hacktoberfest
Published: 2023-10-30 05:29:44

Hi, I am Yash Dinesh Singh, open source enthusiast and web developer. This was my first time contributing in Hacktoberfest and it was a lovely experience. Finding good projects to contribute to and improving the codebase is something I really enjoyed.

I learned a lot of things in this event which I thought i would never touch in life and it acts like a good push to me. I thoroughly enjoyed participating in Hacktoberfest and I will continue to do so.
Multi Step Form With Progress Bar Using HTML CSS & JavaScript
Tags: html, css, javascript, tutorial
Published: 2023-10-30 05:25:15

Multi-Step Form With Progress Bar Using HTML CSS & JavaScript

hey everyone hope you are all fine, today we are going to learn how to create a Multi-Step Form With a Progress Bar Using HTML CSS & JavaScript. It's a great project, there are many large websites using multiple forms to collect multiple data.

So, Inside the Project, I'm going to use pure HTML CSS and JavaScript languages to create it from scratch. Inside that have three forms each form has a different data. 

When the user clicks the next button we need to display the second form and so on. These features that we need to add to the project.

You can watch the complete video, and I've explained everything as you want, After watching the complete tutorial I hope you've learned something from this tutorial. I hope this is helpful and beneficial for you.

{% embed https://www.youtube.com/watch?v=8tuxpCOAWQo %}
Measuring sequences
Tags: kotlin
Published: 2023-10-30 05:20:48

I wrote article about kotlin sequences performance.
In my article I explained how sequences work and how we get performance benefits.

I measured and explained all the functions of a sequence and compared them to collections.
Is the detect rule **CouldBeSequence** correct? Answer in my article [Measuring sequences](https://medium.com/@maxssoft/measuring-sequences-6536db14d576)
MonDEV Newsletter: Filter better with Laravel Purity
Tags: php, laravel, api, webdev
Published: 2023-10-30 05:15:26

Good morning, and happy MonDEV!☕️

I hope you had a great weekend and are ready to get back to work. 😄 
Is anyone out there working on some Laravel APIs this week? If so, I might have a useful tool to make your work a bit easier.

What am I talking about? It's this handy little library called [Laravel Purity](https://abbasudo.github.io/laravel-purity)!

It's a lightweight package that resolves a rather nagging issue, not in terms of difficulty, but in terms of code verbosity. Indeed, Laravel Purity streamlines the process of filtering your models to the extreme, saving you from having to write out all the various types of filters and search methods for a given model.

By adding the "Filterable" trait to your Model and a "filter()" method in the endpoint where you return your model's list, you'll have access to a range of default parameters that can be used by the frontend to receive a filtered list.

The filter syntax might look somewhat familiar if you've ever worked with MongoDB in a project, even briefly. Here's a quick example:

```
restaurant?filters[name][$contains]=num
```

Suppose you have an endpoint with a list of restaurants. This filter would allow you to filter them by name if they contain the text specified as a parameter. Besides `$contains`, there are various other filters like $eq for checking equality, `$gt` and `$lt` for comparing greater or less than relationships, `$in` for checking if a parameter is inside an array provided by us, and many more. You can also use `$and` and `$or` to combine other filters and create more complex search scenarios.

Just to reiterate, all you need to do is add a `->filter()` method in your controller. It might not be the ultimate solution for complex cases, but it certainly saves a lot of time on simpler but lengthy tasks, especially for pages with many different filters.

Moreover, if you don't want to make all types of filters available, you can enable or disable them at your discretion in the Purity config file. If you prefer to manage them case by case, you can configure them directly in the specific controller.

I strongly recommend this tool for its versatility and ease of implementation. It requires very little to be added to the project and used. 
Have you ever tried it? Do you prefer to write everything from scratch, or do you willingly embrace tools like this that help you sidestep repetitive tasks? What do you look for in a tool before adopting it? 
Let's discuss it in the comment if you want!

Have a great week, and happy coding 1_0! 😄
Hacktoberfest23 Pledge
Tags: hacktoberfest23
Published: 2023-10-30 05:10:41

### Intro
<!-- If you are new to the DEV community, introduce yourself and share a bit about why you joined DEV and your motivation to participate in Hacktoberfest this year. -->
Hi, this is Yash Singh. This is my first time at dev.to and hacktoberfest both. I joined hacktoberfest this year since I needed an opening to join open source community and it helped greatly.

### Background
I have been mild coding since few years but never got around to getting to know a language from inside out or a domain. But I enjoy doing it.

### Pledge
MY goal is to contribute 4 good PR's during October and hoping for a smooth journey contributing in open source.
Why CSE Graduates Should Look for Product Management Jobs?
Tags: productivity, beginners, leadership, career
Published: 2023-10-30 05:04:42

As a computer science engineer graduating in 2023, you likely have several career paths to choose from. While software engineering may seem like an obvious option, I encourage you to also consider opportunities in product management. 

Computer Science Engineering (CSE) graduates have a strong foundation in the technical aspects of software development, making them well-suited for product management roles. In product management, you will be responsible for the entire lifecycle of a product, from ideation to launch to post-launch support. This requires a deep understanding of the technical aspects of the product, as well as the ability to think strategically and creatively. 

Here are a few reasons why product management can be a great fit for CSE graduates:

## You understand *Technology*

As a CSE grad, you have strong technical skills and understand how software and products work under the hood. This gives you an advantage when collaborating with engineers and assessing technical feasibility of product ideas.

## You're *Analytical*

Product management requires strong analytical skills - from crunching numbers on business models to analyzing user data. Your training in methods like algorithms and data structures equips you to approach product decisions methodically.

## You're *Innovative* 

Product managers are responsible for coming up with creative solutions to problems. The out-of-the-box thinking you gained in school by solving coding challenges applies here.

## You see the *big picture*

In computer science programs, you work on complex systems and learn how individual components fit together. This systematic perspective allows you to view products holistically.

## You can pick up *New Domains*

While PMs need to understand their product domain, strong general learning abilities enable you to rapidly gain knowledge in new areas.

## Conclusion

Product managers are in high demand. The tech industry is booming, and there is a growing demand for skilled product managers. CSE graduates have the skills and experience that are in high demand, making them well-positioned to land these jobs. Product management is a well-paid career. Product managers are some of the highest-paid professionals in the tech industry. According to Glassdoor, the median salary for a product manager in the United States is $122,000. If you're intrigued by blending business, technology and design to create products users love, consider a career in PM. With your technical foundation and adaptive mindset, you have much to contribute in this role.
first
Published: 2023-10-30 05:02:12

```
{
                            blogs == null ? <Loader /> : <div className="grid grid-cols-2 gap-2 md:grid-cols-3">
                                {
                                    blogs.results.length ?
                                        blogs.results.map((blog, i) => {
                                            return <AnimationWrapper key={i} transition={{ delay: i * 0.2 }} ><BlogPostCard content={blog} author={blog.author.personal_info} /></AnimationWrapper>
                                        })
                                        : <NoDataMessage _message="No blogs pushlished_" />

- v 
vd

v

- 
                                }
                                <LoadMoreDataBtn dataArr={blogs} fetchDataFunc={pageState == 'home' ? fetchLatestBlogs : fetchBlogsByCategory} />
                            </div>
                            
                        }
```
Laravel Increment or Decrement a column value easily.
Tags: laravel, php, webdev, beginners
Published: 2023-10-30 04:39:18

🚀 Level Up Your Laravel Skills with Eloquent's Increment and Decrement Functions 🚀

In Laravel's Eloquent, the power to increment or decrement column values is at your fingertips, thanks to the increment and decrement functions. These nifty methods provide a clean and efficient way to update numeric columns in your database.

Incrementing a Column:

Let's say you have a likes column in your posts table, and you want to increase the number of likes for a specific post:

```
$affectedRows = Post::where('id', $postId)->increment('likes');
```

This single line of code increments the likes column by 1 for the post with the specified ID. You can also specify a custom increment value as the second argument.

Decrementing a Column:

On the flip side, if you need to reduce a column's value, decrement comes to the rescue. For instance, you might want to decrease the available quantity of a product:

```
$affectedRows = Product::where('id', $productId)->decrement('quantity', 5);
```

In this example, the quantity column for the specified product ID is reduced by 5.

Why It's Awesome:

🌟 Efficiency: Eloquent handles the SQL update query for you, making your code concise and efficient.

🌟 Clarity: The code is self-explanatory, making it easy for you and your team to understand the purpose of the operation.

🌟 Safety: Eloquent takes care of locking the row during the update, ensuring data consistency in a multi-user environment.

So, the next time you need to increment or decrement values in your Laravel application, remember the handy increment and decrement functions at your disposal. They'll save you time and make your code more readable.

Have you used these functions in your projects? Share your experiences and tips! 🚀

#Laravel #Eloquent #PHP #Increment #Decrement #ProgrammingTips
JavaScript : The 'this' Keyword (English/Hindi)
Tags: webdev, javascript, beginners, programming
Published: 2023-10-30 04:16:13

## English

The 'this' keyword in JavaScript is a special identifier that refers to the current context or object in which it is used. Its value can change depending on how and where it is employed. Understanding 'this' is crucial for working effectively with JavaScript.

Let's look at an example to illustrate this concept:

```javascript
// Example 1: 'this' in a Global Context
console.log(this); // 'this' refers to the global object (usually 'window' in browsers)

// Example 2: 'this' in a Function
function greet() {
  console.log(this); // 'this' inside a function can refer to the global object or be undefined in strict mode
}

greet();

// Example 3: 'this' in an Object Method
const person = {
  name: 'John',
  greet: function() {
    console.log(`Hello, my name is ${this.name}`);
  },
};

person.greet(); // 'this' refers to the 'person' object

// Example 4: 'this' in an Event Handler
const button = document.querySelector('button');
button.addEventListener('click', function() {
  console.log(this); // 'this' refers to the element that triggered the event (the button)
});
```

## Hindi

JavaScript mein 'this' keyword ek vishesh pehchanakar hai jo us vyakti ya vastu ko refer karta hai jiske samay mein yah istemal hota hai. Iska moolya istemal kiye jaane ke tarike aur sthal ke anurup badal sakta hai. 'this' ko samajhna JavaScript ke saath prabhavit rup se kam karne ke liye mahatvapurn hai.

Chaliye ek udaharan dekhe is siddhant ko spasht karne ke liye:

```javascript
// Udaharan 1: 'this' Global Samay Mein
console.log(this); // 'this' sadharan roop se global vastu ko refer karta hai (aam taur par browser mein 'window' hota hai)

// Udaharan 2: 'this' Ek Function Mein
function greet() {
  console.log(this); // Ek function ke andar 'this' global vastu ko refer kar sakta hai ya strict mode mein undefined ho sakta hai
}

greet();

// Udaharan 3: 'this' Ek Object Method Mein
const vyakti = {
  naam: 'John',
  greet: function() {
    console.log(`Namaste, mera naam hai ${this.naam}`);
  },
};

vyakti.greet(); // 'this' 'vyakti' object ko refer karta hai

// Udaharan 4: 'this' Ek Ghatna Handler Mein
const button = document.querySelector('button');
button.addEventListener('click', function() {
  console.log(this); // 'this' us tatva ko refer karta hai jo ghatna ko trigger kiya (button)
});
```

Isse 'this' keyword ke mahatva ko samajhna aapko JavaScript mein prabhavit rup se kaam karne mein madad karega.
Hardening Tomcat 9
Tags: tomcat, hardening, pentest, http
Published: 2023-10-30 04:12:00

Hi,

Recently we have deploy our application on customer side. And after the pentest, we are required to disable certain port and features.

Below is the requirement:
1. HTTP TRACE Method Enabled
2. HTTP OPTIONS Method Enabled
3. TLS/SSL Server Is Using Commonly Used Prime Numbers

We are using Tomcat 9. As on the solution I did use based on google recommendation but nothing works.

Tool: Nikto
Tomcat: 9
Building My First Wagtail Site
Tags: softwaredevelopment, webdev, python, django
Published: 2023-10-30 04:09:01

Software development is an ever-changing field. Often, one has to pick up new technologies rather quickly. This was the case for me with Wagtail. And thanks to its simplicity, I was able to do so in no time.

## Why Wagtail?

An opportunity to improve the accessibility of websites built with Wagtail opened up recently. And I immediately jumped on it. I was so excited at the prospect of putting my accessibility skills to use that I didn’t give much thought to the fact that I had no experience with Wagtail. I figured I could pick up Wagtail quickly enough if I put my mind to it. And since I learn best by doing, I decided to build a blog site to gain hands-on experience with Wagtail.

## What’s Wagtail?

Wagtail is an open-source Content Management System built on Django. So, much of the process for building websites with Django translates directly to Wagtail. But Wagtail abstracts the need to define `urls`, `views` and `admin` functionality. In Wagtail, emphasis is placed on page and page content. Every page is built from a Django model that inherits from Wagtail’s `Page` model. Wagtail also provides a number of custom template tags and filters that extend the capabilities of the Django templating engine.

## Building the Blog Site

I decided that my blog site would have a home page, a blog index page, blog post pages, and an about page. Since a home app comes out of the box with Wagtail, I only had to create a base and blog app for my Wagtail project.

In the home app, I updated the `HomePage` model to include fields for a hero image, heading, introduction and link to the blog index page. I defined the image and link fields as a `Foreignkey` to Wagtail’s `Image` and `Page` models, respectively.

As the name suggests, the base app defined functionalities shared across apps within the project. It contained `snippets` for the site logo, main menu and breadcrumb navigation. Within this app, I constructed a `ContentBlock` that allowed me to dynamically add subheading, image, list and rich text content to a page. This `ContentBlock` inherited from `StreamBlock`. It was used to define a `StreamField` to populate the body field of the about and blog post pages. Because the about page didn’t belong in the home or blog app, I defined a `StandardPage` model to create it.

The blog app held models and templates for the blog index page and blog post pages. I defined the `BlogPage` model as child page of the `BlogIndexPage`. And I populated the blog index page with meta data for each blog post. Thus, a new blog site was built.

I’m glad that I can now add Wagtail to my toolkit as a web developer. If you’d like to see my code, check out the [praiztech_blog repository on GitHub](https://github.com/praiztech/praiztech_blog). I'm still working on the front-end, though.
How can I download videos to my iPhone?
Tags: download, tiktok, video, iphone
Published: 2023-10-30 03:57:40


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hg9d3s2y4ax0w5xhhojh.jpg)
It is now possible to save videos from social networking websites to your computer for later watching or to share with others who aren't on the same platform. Users of the social media platform can transfer movies straight to their iOS or Android-powered mobile devices by utilizing a piece of software called Video Download. Users will have access to these videos when they're ready.


- Use desktop or mobile apps to search for the video you wish to save on social networking websites.

- You may find the share button by pointing at the icons on the right side of the screen.

- Next, choose "Copy Link."

- Open the address bar of that browser and type **ssdownloader.online**  [ssdownloader.online](ssdownloader.online)

- Copy the link and then paste it into the box on Downloader Online MP4 page when you're ready.

- A page containing a Download Video button will appear after the video has finished loading.

- Clicking on the appropriate icon will change the video's resolution.

You must click the Download Video option after choosing the quality setting. Video downloads will be available as soon as feasible.

<u>

Downloader Online MP4 Advantages

</u>
quicker download.

Using this plugin, you may efficiently and quickly download online MP4, movies.

No cost to use.

Free Downloader Online MP4. Downloads are unlimited.

It's naturally.

The Downloader Online MP4 lets you copy-and-paste files. video downloads require these two actions.

compatibilities.

Smartphones, desktops, laptops, and tablets can all be used with this downloader. All of the latest browsers are also supported.