teleren/devto huggingface dataset:
About Kali - Linux
Tags: linux, beginners, webdev, github
Published: 2022-03-27 08:06:36

#  **what is Kali - Linux ?**

The kali-Linux is the OS(operating system) that has many kinds of Hacking tools  .

## **why kali-Linux is used by many hackers ?**
 
For all the Hackers ,
kali Linux is the best option to create any Cyber attack ,it provide many kinds of tools to hack Wi-Fi ,to track IP(internet protocol),hack any kind of software .


![download.jpg](https://cdn.hashnode.com/res/hashnode/image/upload/v1648354259368/l4jqWXDPq.jpg)



## About Kali - Linux !!!


- Kali - Linux is very attractive Operating System .

- It is all about Hacking in that Operating System , it's all about Terminal .

- All hacking tools are using Terminal as the core of the Linux .

## There are to types of Linux Terminal :

1. **Simple Terminal**

2. **Root Terminal**

### **Simple Terminal**


- It is mainly used to run simple commands just like 


1.  mkdir  -> to make directory .

2. ls -> to see the directories or inside files. 

3. cd -> to change the directories .

4. echo -> to put some data in the file . 

5. cat -> to get the content of the file .

6. man -> to get online help .

etc....

there are many types of commands  that can you use in Simples Terminal.

### **Root Terminal**


- It is use to download or use the rooted mood off any files or apk. and basically use for hacking attacks .


- it make's very easy to hack any server throw the help of Kali - Linux .

##**Why only Root mode ?**

- Root mode is use to boot the operating system to perform the task witch can use only by bootable devices .

# So that is the basics of Kali - Linux .

if you have some more information from this Article ... give me your replay in the comments !!! I am waiting for your replay .

# keep learning.......😊👨‍💻 keep growing........😊📈

# So..... This is my hasnode id : 
## https://crazycomputer6892.hashnode.dev/


# AND this is my first #DevCard : 

<a href="https://app.daily.dev/yashbhatti"><img src="https://api.daily.dev/devcards/a3fdae7295f2449284504220eb36c7b7.png?r=b22" width="400" alt="Yash bhatti's Dev Card"/></a>
Today's Daily Humor For Devs - Daily Developer Jokes
Tags: jokes, dailydeveloperjokes
Published: 2022-03-27 08:00:25

---
title: "Today's Daily Humor For Devs - Daily Developer Jokes"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
published: true
tags: #jokes, #dailydeveloperjokes
---

Hi there! Here's today's Daily Developer Joke. We hope you enjoy it; it's a good one.

![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e1258e0be565.png)

---

For more jokes, and to submit your own joke to get featured, check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/). We're also open sourced, so feel free to view [our GitHub Profile](https://github.com/dailydeveloperjokes).

### Leave this post a ❤️ if you liked today's joke, and stay tuned for tomorrow's joke too!

_This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit._

<!--
Joke text:
___Q:___ How did pirates collaborate before computers ?

___A:___ Pier to pier networking.
 -->
How To Comeback ! for coding After A Long Break?
Published: 2022-03-27 07:31:33

Hi !
It Do Happens to the most of us. **If we take a break from programming then things gets pretty difficult for us**.

1 took a One Month Gap from programming due to College Exams and Health Issues. Yesterday **I wasn’t be able to solve a direct Binary Search Problem on Leetcode** :frowning:

Even the experts :stuck_out_tongue: recommend us , that coding is like a sporting practice which we must do everyday. **If we miss out someday then our overall performance would get affected.**

## > Now… How To Comeback! for coding After A Long Break?

1. Rule #1- Give yourself 1 complete day for **revising your completed topics.** Making the Notes is a good practice. Even I make notes :stuck_out_tongue_closed_eyes: they are the bunch of good DSA problems which kickstarts my brain functionality. ( give yourself 3-4 hours)

2. Rule #2- **Start from the easy problems**, so that you can get adapted to the pace. Also it will boost your morale. ( give yourself 1 complete Day)

3. Rules #3 Don’t Go Too Slow in solving the questions- It will cause trouble :face_with_spiral_eyes:
**instead watch video solutions , it will click your remembrance**

> After day-2 You will feel confident in coding , and BOOM! :boom: **you have made a comeback.**
> You Can again Start from the topic , where you left before the break.

Comment me your opinions ! I daily check my comment box :smiling_face_with_tear:
Best way to LeetCode
Tags: leetcode, career, computerscience
Published: 2022-03-27 07:25:02

Getting ready for algorithmic questions for interview requires a lot of time and dedication. The questions are tough and often makes you give up.

Two months ago a reddit user [u/newgradsmackindab](https://www.reddit.com/user/newgradsmackindab/) made a [post](https://www.reddit.com/r/cscareerquestions/comments/sgktuv/the_definitive_way_on_how_to_leetcode_properly/) describing a solution to this problem.

I recommend going through his post and to starting making notes of every new thing that you learn **it helps**.
Chapter 2: Dokerize Laravel App with Nginx and Postgres.
Tags: docker, nginx, beginners, webdev
Published: 2022-03-27 07:17:00

## Nginx

So previously we have set our `app Dockerfile` and `docker-compose`.

Now we will set up our Nginx docker-compose.

For this part, we don't want to set up Dockerfile for Nginx image, because we don't want to customize Nginx image.

At this point, we don't need to create a custom Nginx Dockerfile. We can use the Nginx image from Docker, `nginx:1.19.8-alpine`.

Before we head to the docker-compose file, first we need to create Nginx `conf` to configure our web server.

Go to `./infra/nginx/conf` and create `app.conf`, we can name it anything as long as it's ended with `.conf`.

```
server {
    listen 80;
    index index.php index.html;
    error_log /var/log/nginx/error.log;
    access_log /var/log/nginx/access.log;
    root /var/www/public;
    location ~ \.php$ {
        try_files $uri =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass app:9000;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;
    }
    location / {
        try_files $uri $uri/ /index.php?$query_string;
        gzip_static on;
    }
}
```
You can modify it later, for example if you want to add SSL or something else.

Now we head to our `docker-compose.yml` file.

```

version: "3.7"

networks:
  app-network:
    driver: bridge

services: 
  app:
    container_name: app
    build:
      context: ./infra/app
      dockerfile: Dockerfile
    image: php-laravel-7.0
    restart: unless-stopped
    tty: true
    working_dir: /var/www
    volumes: 
      - ./:/var/www
    networks: 
      - app-network

  nginx:
    image: nginx:1.19.8-alpine
    container_name: nginx
    restart: unless-stopped
    tty: true
    ports: 
        - 8100:80
    volumes: 
        - ./infra/nginx/conf:/etc/nginx/conf.d
    networks: 
        - app-network
```

In port we can see `8100:80`, We expose our Nginx in port 80 and expose it to the public using port 8100. So we can access our Laravel app via Nginx using localhost:8100.

And also we copy again our Nginx `conf` to the container Nginx folder.

...continue...
How javaScript Asynchronous works under the hood?
Tags: javascript, webdev
Published: 2022-03-27 06:56:52

in this brief Article I'm going to show you how Event loop , Call stack , Callback queue and web APIs (Events table) work together and handle the asynchronous and synchronous functions. ok let’s dive into it.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/phpylfvtht6fcr1j648p.gif)
in the above gif, it shows how functions orderly go to to call stack and after execution they pop out of it and one intresting thing that catches your attention is that asyncronous setTimeout function which is not gonna end up right here (we’ll talk about it more), but first let break the gif down into a few parts to see what exactly going on:
greet function is called
this function goes to call stack to run
now call stack executes this function and return “hello”
greet function pops out of call stack
now respond function goes the same way above
that’s it for the gif, let’s continue…

## Web APIs ( Events table ) , Callback Queue , Event Loop

#### Introducing of Web APIs(Event tables) :
every functions that is asynchronous like Ajax , setTimeouts , event handlers , etc.., join to Events table and wait for the time for execution to come, for example: setTimeout waits 3000 ms to run or event handler waits untill Click event happens and then run. as we know functions are executedin call stack but these guys can’t join the others in call stack yet, so… they should go somewhere else but wher?!

### Introducing of Callback Queue :
as it’s called , this is a queue of callbacks (the gusy in the events table, remember?), thus callbacks which are waiting for get executed will join to this queue. this queue is not going to execute callbacks or even push them to call stack so what it does?!

### Introducing of Event loop :
This dude is an intermediary between web APIs and callback queue , what does it mean?
event loop waits and keeps an eye on call stack and callback queue and when call stack is emty and there is no synchronous function to execute , event loop takes first callback from callback queue and sends it to call stack and as usual, call stack will execute it just like other functions.
now we know how any of these works, let’s see it in the gif below to understand this cooperate better.
attention: watch this gif twice ,first time just look at bar function and its setTimeout and second time look at the rest of the functions which are synchronous.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lqgtfqxgofwsr9flu65x.gif)
let’s see above gif as a code now:

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

now we can see although bar function gets called first but because it’s asynchronous it has to wait for synchronous guys to get executed first, it is good to know that if setTimeout time was even 0 ms it wouldn’t be change anything , it’s ashnchronous function afterall.
well , that’s pretty much it
now , you are a better programmer than 10 minutes ago.

goodbye and good luck.🤞
My First Repo: Scraping API + Node.js SDK with Captcha Bypass
Tags: showdev, typescript, github, node
Published: 2022-03-27 06:37:56

Hi devs,

I've just created my absolutely first Github repo, and I wanted to get your opinion on it. 

The concerned project is a Nodejs SDK for web scraping that, connected to an API I maintain, aims to be ultra easy to use. (I've planned to adapt this SDK to Python in the future) 

The easy-to-use aspect is really one of the key points of the project, with the pricing. 

I've used many web scraping apis in the past, and I found them costly and the dev experience was terrible. 

ScrapingAPI is supposed to simplify the whole process of extracting data from the web: captcha bypass, requests and clean data extraction.

The API isn't live for now, but I could be glad if you could give me some feedback about what could be added, improved or removed from the readme.

Here is the github: [https://github.com/scrapingapi/scraper](https://bit.ly/386wp4P)

Many thanks in advance
Using Trait for Unit testing in Rust
Tags: rust, beginners, tutorial
Published: 2022-03-27 06:34:03

Trait is one of powerful feature in rust. If you are coming from object oriented world, the `Trait` is like `interface`.

On of example of how we can use trait is to define abstraction for writing file. Let's create some trait code.
```rust
pub trait Buffer {
    fn write(&mut self, data: &str);
}
```

So these buffer we will use to be an abstraction to write file.

Next, let's create `BufferWritter` struct for the actual implementation to the `Buffer` trait.
```rust
pub struct BufferWriter {
    writer: BufWriter<File>,
}

impl BufferWriter {
    pub fn new(file: File) -> Self {
        let writer = BufWriter::new(file);
        Self { writer }
    }
}
```

And now let's implement our trait to `BufferWritter`.
```rust
impl Buffer for BufferWriter {
    fn write(&mut self, data: &str) {
        let bytes = format!("{}\n", data).as_bytes();
        if let Err(e) = self.writer.write_all(bytes) {
            println!("Failed to write data to file: {}", e);
        }
    }
}
```

And now let's use it to write file, first let's suppose we have some logic that made some text processing and turn it to some generated code.
```rust
pub fn write_output(buffer: Box<dyn Buffer>, config: &Config, source: &HashSet<String>) {
    let mut generator = Parser::new(buffer, config.clone());
    for line in source.iter() {
        if generator.plugin(line).is_some() {
            continue;
        }
    }
}
```

And here's our parser.
```rust
pub struct Parser {
    config: Config,
    writer: Box<dyn Buffer>,
}

impl Parser {
    pub fn new(writer: Box<dyn Buffer>, config: Config) -> Self {
        Self { config, writer }
    }
    pub fn plugin(&self, line: &str) {
        // Some processing and then
        self.writter.write(some_str);
    }
}
```

## Testing

One of the advantage of trait is for testing. In this case, we don't want to work with file directly whenever we are doing testing.

So let's take a look how we can use trait for testing.
```rust
#[test]
fn test_columns() {
    let config_set = Parser::parse(include_str!("source.json")).unwrap();
    let test_case = vec![
        ("name", "my-name"),
        ("wrong", "not-wrong"),
    ];

    struct Buf(String);
    impl Buffer for Buf {
        fn write(&mut self, data: &str) {
            assert_eq!(data, self.0)
        }
    }

    for (class, expected) in test_case {
        write_output(Box::new(Buf(expected.into())), &config_set, &set![class]);
    }
}
```

So that it for now, if you want to read more about rust tutorial follow me at twitter [@_ahmadrosid](https://twitter.com/_ahmadrosid) and don't forget to visit my blog [ahmadrosid.com](https://www.ahmadrosid.com?source=dev.to)

Thank you let me know if you have any question.
How to Get Previous and Next Record in Laravel
Tags: laravel, php, beginners, tutorial
Published: 2022-03-27 06:14:08

A really common task is to display links for the previous and next record typically you find these on blogs, when viewing the post a previous title and link are displayed and the same for the next post, as long as they are previous and next posts. In this post, I'll explain how to create these.

There are several ways to implement this functionality and the simplest way is to use the Model Id. Since by right an Id auto increment, we can assume that the newest post will always have a higher number than the oldest post.

Laravel gets previous & next record, data, or URL examples. This tutorial will help us learn how to get the next/previous data or record in laravel application throughout this comprehensive tutorial.

## How to Get Previous and Next Record in Laravel
Here are the quintessential steps you needed to follow to get the next or previous data and records from the database table in the laravel.

## Get Next Record in Laravel
Get the next record or data from the database in the laravel app. We have one table name posts, we want to fetch the next record or data from the database table in laravel. So you can use the below eloquent query for that:
```
$next_record = Post::where('id', '>', $post->id)->orderBy('id')->first();
```
As you can see, we have defined the where(), first(), orderBy() likewise first() eloquent queries to get the next posts or records from the database.

## Get Previous Record in Laravel
Define the $previous variable, along with the Blog model. Set the where() clause, pass the id and blog id properties and define the orderBy and first queries to fetch the previous records and post URL or slug from the database.
```
$previous_record = Blog::where('id', '<', $blog->id)->orderBy('id','desc')->first();
```

## Access Prev / Next Records from Laravel Blade View
Open the blade view template; you can get the idea from the below code example to show the previous and next blog posts with their respective slug and URLs.
```
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>How to Get Previous and Next Record in Laravel</title>
</head>
<body>
    <div class="container">
        <div class="row">
            <div class="col-6">
                @if (isset($previous_record))
                    <a href="{{ url($previous_record->url) }}">
                        <div> Previous</div>
                        <p>{{ $previous_record->title }}</p>
                    </a>
                @endif
            </div>
            <div class="col-6">
                @if (isset($next_record))
                    <a href="{{ url($next_record->url) }}">
                        <div>Next</div>
                        <p>{{ $next_record->title }}</p>
                    </a>
                @endif
            </div>
        </div>
    </div>
</body>
</html>
```
**Thank you** for reading this blog.
Why GitHub? 🤖
Tags: git, github, webdev, beginners
Published: 2022-03-27 04:14:11

_I hope you know much about git._
### Why do we need tools like GitHub? 
GitHub it is a place where you can store your code online, it doesn't mean its the only one, but most popular. Due to its generous free services, high security and, again popularity.

You can store, write, update your code with others, but what's more with GitHub is working with branches, opening issues, wiki for a repository.

#### Branches
- its like, Everyone can work on same ship without interfering work of others.
- Branches concept is similar to time travel your code.
- You can commit on a branch, for a change in file. afterwards you can see those logs and also go back there.
- Merge a branch in your codebase, maintain different versions of your code.

#### Is it ok for a Developer alone?
- It depends on project, but most of the time yes. As it shows your work to public.
- You can maintain your repository with a nice format, from anywhere in world.

#### Is it ok to contribute in other projects?
- Yes, this can help you to understand best practices to maintain a codebase, how things work at different levels.
- You got to know a lot of people, groups.
- Develops your community skills, connections.
 
#### Fork
- Fork is use to get a copy of another repository for your, so that  you can make changes over it, collaborate.
- After making changes you can send pull requests, so that admin of that repository can merge your code.

#### Issues
- _whenever there is code, there is a bug_ so, consider a situation where you find a error in code, but you don't know how to fix it, that's where you can open issues on that.
- You can use issues section as Task list, most used one.

_Tip_ - Start using it as a shopping list, personal diary or films to watch list, that's how I practice Git & GitHub.

That's it on GitHub, if you want a cheat sheet on GitHub.

Checkout [devhints.io]("https://devhints.io")
Some useful MySQL/MariaDB commands to create and provide access to a database.
Published: 2022-03-27 04:25:26

---
title: Some useful MySQL/MariaDB commands to create and provide access to a database.
published: true
description: Some useful MySQL/MariaDB commands to create and provide access to a database.
tags: 
//cover_image: https://direct_url_to_image.jpg
---

Login to MariaDB with:
```sql
mysql.exe -u root -p <your-root-password>
```
If your root account doesn't have a password omit the `-p` option.

Create database with: 
```sql
create database database_name;
```

Grant all access to the user with: 
```sql
grant all on database_name.* to 'root'@'localhost';
```
If you are logged in with a different user change `root` to your username accordingly.
My dream is about solving global warming with fusion and AI
Tags: ai, deeplearning, physics, plasma
Published: 2022-03-27 04:08:53

My dream is about solving global warming with fusion and AI.

We all know that matter consists of atoms, and an atom consists of atomic nuclei and electrons orbiting it. Atomic nuclei are not very friendly: electrostatic forces push them apart. However, if they are close enough for long enough, if the nuclear force is greater than electrostatic, they fuse into heavier nuclei. For many elements, the reaction is accompanied by energy release, for example, hydrogen. Our sun consists primarily of hydrogen and its fusion product - helium. As you might guess, it has two protons in contrast to one proton in hydrogen. Hydrogen fusion in the sun releases all the energy required to enable evolution on our planet. But why can't we reproduce the same on Earth? Why can't we light up mini-stars in fusion reactors and consume infinite energy? Hydrogen, after all, is the most abundant element in the universe. We try, we try hard.

Suppose one wants to surpass electrostatic force and make hydrogen nuclei fuse. In that case, one has two choices: bring huge volume to one place (read: Sun) or "pump up" a lot of energy into a limited amount (read: fusion reactor). Small reactor - higher the temperature should be. "Plasma" is what physicists call pumped up with energy hydrogen. More power: hotter and denser plasma becomes. The temperature is so high that no such material can withhold it. Hence the only way to hold is a strong magnetic field. But steering a fusion plasma toward stability is a complicated problem. If we can do it in real-time with high precision, we can crack super-high temperature fusion in a limited volume. Simple methods don't work. A human operator is also not capable of this because of the human's reaction time. But what about an AI? DeepMind tried, and their result looks very promising: https://www.nature.com/articles/s41586-021-04301-9.

The idea of DeepMind's research and proof-of-concept is that there is no need to simulate and support a specific configuration of the plasma carefully. The AI can steer it precisely enough and react to ever-changing states. The hope is that they will be able to hold plasma in the desired configuration for as long as needed and slowly extract the energy we want.

I dream of AI controlling hundreds if not thousands of small fusion reactors. They produce so much energy that we don't burn coal, gas, or oil to get the power we so desperately need. Do you want to see such a world too?