teleren/devto huggingface dataset:
mysql docker config 
Published: 2021-10-30 13:22:58

https://phoenixnap.com/kb/mysql-docker-container
https://towardsdatascience.com/connect-to-mysql-running-in-docker-container-from-a-local-machine-6d996c574e55


```
sudo apt-get install mysql-client

docker run --name=mysqlDocker --env="MYSQL_ROOT_PASSWORD=yourRootPassword" -d mysql/mysql-server 
```

now you have to change mysql root user host to accept all ips:

```
docker exec -it <containerName> bash
mysql -u root -p 
# enter the password you entered in the container config

# in mysql bash enter:
update mysql.user set host='%' where user='root';
```
#### Configure Mysql Container

you have to use a .cnf file or you will have this error :

```
Host 'xxx.xx.xxx.xxx' is not allowed to connect to this MySQL server
```
create an alternative config file on the host machine and mount them inside the container.

1.First, create a new directory on the host machine:
```
sudo mkdir -p /root/docker/[container_name]/conf.d
```
2.Create a custom MySQL config file inside that directory:
```
sudo nano /root/docker/[container_name]/conf.d/myCustom.cnf
```
3.Once in the file, you can add lines with the desired configuration.

For example, if you want to increase the maximum number of connections to 250 (instead of the default 151), add the following lines to the configuration file:

```
[mysqld]
bind-address  = 0.0.0.0
```
4.change the location of the data directory :
    4.1. Find an appropriate volume on the host and create a 
        data directory on it:
```
sudo mkdir -p /storage/docker/mysqlData
```

4.2. Save and exit the file.

5. For the changes to take place, you need to remove and rerun the MySQL container. 

```
docker run \
--detach \
--name=[container_name] \
--restart unless-stopped
--env="MYSQL_ROOT_PASSWORD=my_password" \
--publish 66030:3306 \
--volume=/root/docker/[container_name]/conf.d:/etc/mysql/conf.d \
--volume=/storage/docker/mysqlData:/var/lib/mysql \
mysql
```
 
now you can use either dockerized phpmyadmin or workbench on your host machines.if you want to use phpmyadmin do the following steps otherwise you can jump to step 7.

#### dockerized phpmyadmin

```
docker volume create phpmyadminVolume
phpmyadmin-volume

docker run --name mk-phpmyadmin -v phpmyadminVolume:/etc/phpmyadmin/config.user.inc.php --link mk-mysql:db -p 82:80 -d phpmyadmin/phpmyadmin

```
#### Access MySQL via phpMyAdmin
Open your browser and visit http://localhost:82 to access phpMyAdmin UI.

#### Mysql workbench 

7. leave the host option to localhost, in the port section enter the port you exposed for mysql container(in our case 6603) .user and password are the ones you specified in the above section (in our case root ).

bonne chance !
How to disable WordPress feed with redirect to 404
Tags: wordpress, feed, php
Published: 2021-10-30 13:21:43

```php
remove_action( 'wp_head', 'feed_links_extra', 3 );
remove_action( 'wp_head', 'feed_links', 2 );

add_action( 'do_feed', 'zl_remove_feed_and_redirect', 1 );
add_action( 'do_feed_rdf', 'zl_remove_feed_and_redirect', 1 );
add_action( 'do_feed_rss', 'zl_remove_feed_and_redirect', 1 );
add_action( 'do_feed_rss2', 'zl_remove_feed_and_redirect', 1 );
add_action( 'do_feed_atom', 'zl_remove_feed_and_redirect', 1 );
add_action( 'do_feed_rss2_comments', 'zl_remove_feed_and_redirect', 1 );
add_action( 'do_feed_atom_comments', 'zl_remove_feed_and_redirect', 1 );

function zl_remove_feed_and_redirect() {
	wp_redirect( esc_url( home_url( '404' ) ), 301 );
	die();
}
```

But I think the redirect should be on through Nginx, before a client-server. Actually, it is a correct solution
code every day with me
Tags: javascript, programming, 100daysofcode, algorithms
Published: 2021-10-30 13:10:34

##--DAY 12--
Hi, I am going to make #100DaysOfCode Challenge. Everyday I will try solve 1 problem from leetcode or hackerrank. Hope you can go with me until end.
**Now let's solve problem today:**
-Problem: Plus One
-Detail: [here](https://leetcode.com/problems/plus-one/)
-My solution (javascript):
```
var plusOne = function(digits) {
    let i=digits.length-1;
    while(i>=0){
        if(i==0&&digits[0]==9){
            digits[i]=0; digits.unshift(1);
            return digits;
        }
        digits[i]+=1;
        if(digits[i]!=10) return digits;
        else{
            digits[i]=0;
            i--;
        }
    }
    return digits;
};
```
-->*If you have better solution or any question, please comment below. I will appreciate.*
TaskForce week 1 experience
Tags: awesomitylab, codeofafrica, taskforce
Published: 2021-10-30 13:04:38

![it really isn't :))](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wh352a9i5ov381esarma.jpg)
 
first of all I will start by mentioning how my entire time in school I was always (read ALWAYS) the youngest of my class and all of a sudden I am the oldest guy of the cohort....how times change,ok now onto the experience.

Week one was an amazing experience, we started off by playing a strategy game, lets just say it didn't go so well, then came a session with Lionel about writing good user stories. my main takeaway was how crucial it is to write good user stories for software development teams. Then came codewars challenges, which only proves as a software engineer you can run as fast as you can but you won't outrun leetcode challenges. We also had a session about intercultural communication which highlights how while working in international setups cultural differences and values could make things tricky if not paid enough attention. 

I was also introduced to few collaboration tools I had never used before (miro,trello) and I can see why they are so popular, they make collaboration, project management much easier and inspire to get visually creative. 

To cap off an amazing week, we had our first presentation and formally introduced ourselves to Awesomity Lab's team and vice versa, they proceeded to beat us at a game they had just introduced us to (which is not exactly a welcoming gesture but whatever😄)

Overall I had fun in week one and I can't wait for week 2 :)
Types of Operating Systems
Tags: os, operating, systems, software
Published: 2021-10-30 12:37:07

![operating system](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/urookcipi0z0bpwgdjpz.png) 

An operating system is a significant piece of a computer system. It doesn't make any difference whether it is a PC or a robot working in an assembling processing plant, each computer needs an operating system so the particular program gets a climate to run.

Here are the list of [Types of Operating Systems](https://www.techgeekbuzz.com/types-of-operating-systems/):

### 1. Batch Operating System

The primary OS on our rundown of the main sorts of operating systems is the Batch OS. In a Batch operating system, the client doesn't have direct admittance to the computer and can't straightforwardly cooperate with it all things considered.

### 2. Interactive Operating System

In an Interactive operating system, there is an immediate communication between the client and the computer. Generally, all PCs utilize Interactive operating systems. In this sort of operating system, the client enters some order in the system and the system works as indicated by it.

### 3. Real-Time Operating System

A RTOS is an information handling system whose reaction time to the information is exceptionally short. RTOS is otherwise called the mind of the real-time system in light of its nearby reaction to the info. 

The reaction to the contribution to RTOS is shown in a particular time period. However the time frame is extremely short it doesn't show any sort of difference.

### 4. Multiprogramming Operating System

Multiprogramming operating systems can execute various projects on the double. However the computer can't execute every one of the projects without a moment's delay in view of exchanging between the positions, it appears to be that it does.

### 5. Time-sharing Operating System

It is like the multiprogramming system for certain extra expansions and furthermore known as Multitasking OS. In a Time-sharing OS, the system is equipped for taking care of various positions at the same time and here the handling time is divided between every one of the clients.

### 6. Multiprocessing Operating System

A Multiprocessing operating system comprises of different processors to execute the projects and every one of the processors are associated with the principle fringe. With the assistance of various processors or CPUs, the program can execute all the while on the principle memory of the system.

### 7. Distributed Operating System

In this operating system, various computers interface with each other and impart to trade information. Web chips away at this system where everybody is connected with one another to convey. It can likewise be named as the Networking operating system, which upholds a significant degree of correspondence.

## Conclusion

In spite of the fact that there are many sorts of operating systems, these are the main ones. Every one has its own particular manner of getting things done and consequently, every one is appropriate for meeting an alternate arrangement of necessities.
Can this makeshift vertical case keep the Pi cool?
Tags: linux, showdev, raspberrypi, productivity
Published: 2021-10-30 11:04:34

> *Originally published at [thekrishna.in](https://thekrishna.in/blogs/blog/rpi-temp-case/)*

The Raspberry Pi 4 offers an excellent upgrade to the preceding Pi 3B+, but keeping the new model from overheating can be a challenge. Users have tried many techniques to tackle this issue, from running the Pi in the open air to utilizing cooling rigs with fans attached. But as vertical cases are gaining popularity, can my DIY vertical case keep the Broadcom BCM2711B0 quad-core A72 SOC (system on chip)—cool? Spoiler alert: Surprisingly, yes.

First of all, why subject your Raspberry Pi to this level of stress? In the case of Raspberry Pi 4, the A72 CPU is so powerful that it can overheat if it doesn't have enough cooling. This results in the CPU being thermal throttled (governed) to reduce the power consumption and in turn reducing heat generation. The Raspberry Pi 3B+ and predecessors could also overheat, but this was less of an issue for the majority of use cases. A quick stress test will reveal if the Raspberry Pi 4 can run at maximum CPU-loads in its case/environment without overheating or throttling.

The goal of this post is to create a graph, which depicts:

1. A stabilization period at the beginning
2. A period of time for full-load CPU
3. View the CPU temperature
4. View the CPU clocks (to witness if the CPU is being thermal throttled, or not)

I searched the Internet for existing methods for stress testing the Pi and stumbled upon Stressberry. The package is straightforward, as their documentation quotes "stressberry is a package for testing the core temperature under different loads, and it produces nice plots which can easily be compared". The room temperature at the time was about 26ºC. The Raspberry Pi is operating at a stock clock speed of 1.5 GHz, since this is more relevant to the wider population

#### Chart notes:

- **Blue** = Temperature in degrees Celsius
- **Orange** = CPU clock speed (maximum 1500 MHz)

## Test 1: Heat Sink, No Fan, Open air, Stock Case with open lids.

![Test Case 1](https://thekrishna.in/assets/img/blogs/rpi-temp-case/rpi_test_1.jpg)

> Creative visualization (but not inaccurate 😛) of the setup and the performance chart for the stock case setup

Towards the end of 10 minutes under full-load, the CPU was clearly in for trouble.

## Test 2: Heat Sink, Fan, Open air, DIY Vertical Case.

![Test Case 2](https://thekrishna.in/assets/img/blogs/rpi-temp-case/rpi_test_2.jpg)

> Actual setup and the performance chart for the vertical setup
Mount a Linux image on Windows and access to it from File Explorer with WSL2 
Tags: wsl, powershell, linux
Published: 2021-10-30 10:28:46

---
title: Mount a Linux image on Windows and access to it from File Explorer with WSL2 
published: true
description: Description
tags: wsl, powershell, linux
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ylf27gquw0vaqykru7z8.jpg
---

### Requisites
A Windows system with WSL2 and an installed distro.

### 1. Downlaod linux distro image

```
wget __linux_image_url
```

### 2. Run wsl console

```
$ wsl
```

### 3. Check disk image sectors

```
$ partx --show __linux_image_filepath__
NR  START     END SECTORS SIZE NAME UUID
 1   8192  532479  524288 256M      9730496b-01
 2 532480 3661823 3129344 1.5G      9730496b-02
```

### 3. Calculate offset

```
$ bc
bc 1.07.1
Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006, 2008, 2012-2017 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.
> 532480 * 512
> 272629760
> quit
```

### 4. Mount Image

Create mounting point
```
$ sudo mkdir /mnt/other
```

Mount image
```
$ sudo mount -v -o offset=272629760 -t ext4 /_path_to_file_image/__filename__.img /mnt/other
mount: /dev/loop0 mounted on /mnt/other.
```

Check mounted image
```
$ ls /mnt/other
```

### 5. Access to Filesystem through File Explorer

1. Open File Explorer
2. Type `\\wsl$` in the address bar
3. Installed distros will be shown up. Click on it and navigate in the file system into the mounted path.

#### References

- [Access Linux filesystems in Windows and WSL 2](https://devblogs.microsoft.com/commandline/access-linux-filesystems-in-windows-and-wsl-2/)
- [Access WSL2/Ubuntu Drive from File Explorer] (https://docs.microsoft.com/en-us/answers/questions/116126/access-wsl2ubuntu-drive-from-file-explorer.html)
- [How to mount Linux file system using WSL on Windows 11](https://pureinfotech.com/mount-drive-linux-file-system-wsl-windows-11/)
- [Mounting a Raspberry Pi disk image under WSL 2](https://imgur.com/xO3UXVh)

_[Photo Credit Dorolein](https://isorepublic.com/photo/factory-button/)_
Hawk pentest tool
Tags: showdev, programming, cybersecurity, python
Published: 2021-10-30 09:55:31

Hawk is a network and pentest utility that I developed so that I could perform different kinds of task using the same suite, instead of jumping from one tool to another.
Currently, this script can perform a good variety of tasks such as: 
- ifconfig, 
- ping, 
- traceroute, 
- port scans (including SYN, TCP, UDP, ACK, comprehensive scan), 
host discovery (scan for up devices on a local network), 
- MAC address detection (get MAC address of a host IP on a local network), 
- banner grabbing, 
- DNS checks (with geolocation information), 
- WHOIS, 
- subdomain enumeration, 
- vulnerability reconnaissance, - 
- packet sniffing, 
- MAC spoofing, 
- IP spoofing, 
- SYN flooding, 
- deauth attack, 
- brute-force attack (beta).

Other features are still being implemented. Future implementations may include WAF detection, DNS enumeration, traffic analysis, XSS vulnerability scanner, ARP cache poisoning, DNS cache poisoning, MAC flooding, ping of death, network disassociation attack (not deauth attack), OSINT, exploits, some automated tasks and others.
If you want to become a contributor, make a pull request or issue.
Waiting for your feedback. Kudos
Link to the repository: 
https://github.com/medpaf/hawk
What is Object-Oriented Programming?
Tags: discuss, programming, computerscience
Published: 2021-10-30 09:40:58

---
title: What is Object-Oriented Programming?
published: true
description: 
tags: discuss, programming, computerscience
//cover_image: https://direct_url_to_image.jpg
---

Is it a *combination of data and functions*?

Maybe a way to *model the real world*?

Or just a mix of *encapsulation, polymorphism, and inheritance*?

Please tell me. I really need to know.
Landing Page to collect stripe no-code payment links
Tags: opensource, beginners, html, hacktoberfest
Published: 2021-10-30 09:29:11

I've created a simple landing page to collect payment using https://stripe.com/docs/payments/no-code no-code payment links. Also this is a simple website with big title, description, button to click to the payment & footer information about the website. Currently is mobile responsive.

I also custom the landing page with confetti when refresh. I put this because i love little tiny celebration when i get paid.  

Why i use this is because is easy to make payments + collect emails. I can export in .csv. You'll need a stripe account and create a product and create payment links.
The move to Hashnode 👋
Tags: discuss, watercooler
Published: 2021-10-30 09:19:50

Hey there! Just wanted to announce that I'm moving to move to Hashnode! 

Don't worry, I'll still be active (probably more active than on Hashnode) on DEV (There's a chance that I'll come back here, because I've deleted my hashnode account like 3 times :laughing:). I'm even building a DEV centered startup :fire:! More on that in another post.

If you want to keep up with my Hashnode account, [sign up](https://hashnode.com/@SiddharthShyniben/joinme) [^1] and check out my blog at <blog.siddu.tech> (Yes, it's a custom domain, one of the reasons I switched!)

I'll still be cross posting over here though!

Also, tell me: What do you think of hashnode? Do you have an account over there? (if yes, leave a comment)

[^1]: It's a referral, if you don't mind :)
Apple Dev
Published: 2021-10-30 08:15:39

The App Store makes it easy for users in 175 regions to discover and download your apps, games, and extensions across Apple platforms. Apple handles worldwide payment processing, offers unlimited hosting and bandwidth — even for free apps, verifies user accounts, and much more to empower you to scale your app distribution. With Apple Business Manager and Apple School Manager, you can offer your app in volume or custom apps only to organizations you specify. You can even choose to distribute your Mac apps outside the Mac App Store using your Developer ID certificate and Apple’s notarization process, which reassures users that you’re a trusted developer.
First Django App For Beginners Part 3(templates & static files)
Published: 2021-10-30 07:59:02

###### For this part of tutorial we are going to be building A simple Django Booking(appointment) App!

**Welcome Back!**

###### Let's get started.

* Start by creating a project called appointment
* Also create a app called app
* Register your app in your project folder
* And do your url config.

######Pls Get the template folder we are going to be using from[Link to my Github Profile](https://github.com/thisisazeez/template)

Let's Get Started!

**Template and Static files Settings.**

Step 1: after setting up your django application we will register our template files

![Template Settings](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/osgq3r94xdbju0b1h28u.png)

Step 2: Static Files

![Static Settings](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hg8u33xgu8rsricrm89d.png)

**Urls and Views**
> I hope you have already set up your urls if you haven't set it up to see if you can do it if you encounter any error pls comment in the comment section!

Let's get started!

1 models.py: 
            ![models.py](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yigtaez0muvjdarunqvu.png)

What is models.py:
Models.py is a file that allows us to completely define our database!

2 views.py:
           ![views.py](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ss53a4nrfx2lpgqfk0ej.png)

What is context in our views.py:
So we imported our models in line 2 of our code and we want to show something from our database so we use context manager to help us render models to view!

3 urls.py:
          ![urls.py](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/00uise11je0ojbcd9ke3.png)

What did we do in urls.py?:
We imported our views file  and used it to create our url


4 admin.py:
           ![admin.py](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gjgt1dqy7be527eojvvs.png)

What just happened in the file:
we imported our model and register it so it can be viewed in the admin site


**Introduction to Django Admin Site **
What is Django admin?
Django Has a built-in admin site that handles the site management and to log in to the admin site we need to create a superuser to do that we use this command `python manage.py createsuperuser` it will throw an error because you haven't make your migrations 
to do that we use this command `python manage.py makemigrations` the command will initialize your database and then this command `python manage.py migrate `to create the necessary tables and columns then you can crate your super user

now crate your superuser and runserver then go to /admin

you will discover a page saying login so you enter your superuser credentials and boom a dashboard

![django admin site](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4h5rqbh8tgjx5d3wegxn.png)

**Add some models and play around with it**
Pls Comment if you encounter any errors

![Catch Ya Later!](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t8d7hr74if6hthe2zeoj.jpg)

>Play Around With this **Part 4 will contain user authentication and sending mails** i hope we all have a great understanding of django
Display an animated loading icon with Vue.js
Tags: vue, javascript, webdev, beginners
Published: 2021-10-30 07:36:52


A **throbber**, also known as a **loading icon**, is an animated icon used to show that a software is performing an action in the background (such as downloading content or conducting intensive calculations).

To indicate to the user that the software is working in the background, you can easily put a throbber on a webpage. 

With **Font Awesome** icons you can use [the fa-spin class](https://fontawesome.com/v5.15/how-to-use/on-the-web/styling/animating-icons) to make an icon rotates as a throbber.

Example of usage from my website [Rollideo](https://rollideo.com/): On the home page the user can click on a button to generate a video from a text, then a throbber is displayed to indicate that a process is running in the back-end.

In the code bellow the throbber will be displayed if wait_video_generation equals true. On a side note, if you can evaluate the total duration of the the process it’s a good practice to display it to the user. 

    <div class="box" v-if="wait_video_generation">      
    <font-awesome-icon icon="spinner" class="fa-spin" size="3x"  />
    </div> 

wait_video_generation is set to false when the front-end gets the response from the back-end. Then the throbber is not displayed anymore.

    axios.post(load_url,data, {
    headers: {
    'Content-Type': 'multipart/form-data'
    }}
    ).then(response => {
    ...
    this.wait_video_generation = false
    }).catch(error => {
    console.log(error)
    })

Sometimes you need to disable an element when a process is running in the background, for example to avoid that the user clicks 10 times on the video generation button.


    <button :disabled="wait_video_generation" class="button is-info" @click="createvideo">
    Launch the video generation
    </button>