teleren/devto huggingface dataset:
Want to crack AWS Interview?
Tags: aws, amazon, career
Published: 2021-10-08 14:00:05

AWS gained significant growth in a couple of years, leaving its competitors far behind it. It dominates the cloud industry by occupying 33% of it, while Microsoft rests at 18% and Google at 9%. 

AWS developers in the industry are significantly well paid as it is broadening its boundaries towards all the sectors. It fulfills the need of users for any number of servers at any time in minutes, thus making it convenient as users earlier had to book the servers in advance weeks and months before.

List of AWS Interview questions asked in 2021:

* What do you understand by AWS?
* What services are provided by AWS?
* What is auto-scaling?
* Explain geo-targeting in CloudFront?
* Differentiate between EC2 and S3?
* Explain AWS Lambda?
* Explain the Amazon EBS Volumes.
* What is the need for subnetting?
* What do you understand by EIP?
* Why should one use Amazon EBS volumes over its other competitors?
* What is Cloudwatch?
* What do you understand by Amazon EC2?
* What do you know about Amazon VPC?
* What is Amazon S3?
* Can you cast S3 with EC2 Instances? If yes, explain how?

Want to know more questions to crack the interview, then go through this blog on [AWS Interview questions](https://www.techgeekbuzz.com/top-aws-interview-questions-and-answers/).



**All the best**
Code Smell 91 - Test Asserts without Description
Tags: testing, poo, tutorial, webdev
Published: 2021-10-08 16:00:25

*We are big fans of xUnit. But we don't care much for the programmers.*

> TL;DR: Use asserts with declarative descriptions.

# Problems

- Readability

- Hard debugging

- Time waste

# Solutions

1. Put a nice descriptive assertion

2. Share guides for problem-solving

# Sample Code

## Wrong

[Gist Url]: # (https://gist.github.com/mcsee/4edc85bb65bc9a70d11706086e0fab99)
```php
<?

public function testNoNewStarsAppeared(): void
  {
     $expectedStars = $this->historicStarsOnFrame();
     $observedStars = $this->starsFromObservation();
     //These sentences get a very large collection
  
     $this->assertEquals($expectedStars, $observedStars);
     //If something fails we will have a very hard debugging time
    }
```

## Right

[Gist Url]: # (https://gist.github.com/mcsee/72a551eb26d02f1480142e9cd41a5ca7)
```php
<?

public function testNoNewStarsAppeared(): void
  {
     $expectedStars = $this->historicStarsOnFrame();
     $observedStars = $this->starsFromObservation();
     //These sentences get a very large collection
  
     $newStars = array_diff($expectedStars, $observedStars);
  
     $this->assertEquals($expectedStars, $observedStars ,
         'There are new stars ' . print_r($newStars,true));
     //Now we can see EXACTLY why the assertion failed with a clear and
     //Declarative Message 
    }
```

# Detection

Since *assert* and *assertDescription* are different functions, we can adjust our policies to favour the latter.

# Tags

- Test Smells

# Conclusion

Be respectful to the reader of your assertions.

It might even be yourself!

# More Info

- [XUnit: Assert Description Deprecation](https://github.com/xunit/xunit/issues/350)

# Credits

Photo by <a href="https://unsplash.com/@startaeteam">Startaê Team</a> on <a href="https://unsplash.com/s/photos/dialogue">Unsplash</a>  

* * *

> Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

_John Woods_

{% post https://dev.to/mcsee/software-engineering-great-quotes-26ci %}

* * *

This article is part of the CodeSmell Series.

{% post https://dev.to/mcsee/how-to-find-the-stinky-parts-of-your-code-1dbc %}
Introduction to Databases
Published: 2021-10-08 15:48:25

Databases are *logical structures* that can store and organized any kind of data for future use. They are an **indispensable component of a web application**, thus they allow us to process, retrieve, or evaluate our data. They are managed by an application called **DBMS** (Database Management System), which organizes data according to specific patterns (database models). The *relational model* is perhaps considered to be the default paradigm, organizing data into cross-referenced tables, rows, and columns. 

Databases have two ways to store data:
1. **Data persistence**: since the data is store *on disk*, even if the application or computer shuts down and restart, everything will continue there.

2. **Ephemeral storage**: the data is saved *in-memory*, but it is volatile, meaning that it does not survive a system shut down. Although the data might not be saved, in-memory databases are usually faster. 

Now that we now how data is store, how can we interact with it? Databases provide an interface for users or applications, that allow us to access and interact with what's stored there. There are four types:

* **Data definition**: allow us to create, modify, and remove definition's of the data structure.

* **Update**: allow us to insert, modify, and delete data within the database. 

* **Retrieval**: allow us to access the stored data. It can be access as-is, or it can be filtered for a specific result.

* **Administration**: these tasks are not directly related to our data, but it is important for user management, security, and performance monitoring.

Creating, modifying, or deleting data are **potentially dangerous** operations, often known as "write operations". On the other hand, *retrieving* data allow users to access that information for certain use, without modifying or interfering with the database itself.

In the case that we don't want to use a database, there are a few options that, in some way, are also consider a database:

1. Local memory or temporary filesystems
2. Serialize application data directly to the local filesystem
3. Storing file-like objects directly to disk

Database are used for many reasons, some of them are:

* **Storing and processing site data**, which affects how information is organized on the site. If we have an e-Commerce, our database can store user information, product availability, and orders history.

* **Analyzing information to make better decisions**, which relates to the basic functionality of the website. This operations, called analytics, provide answers to specific questions such as product trends, states where we ship the most, and factors that influence sales.
Get My Assignment Done
Tags: beginners
Published: 2021-10-08 15:47:24

Paying a person to jot down your paper, whether or not it's a fellow pupil or an essay mill, is a form of plagiarism and is typically taken into consideration one of the most serious with the aid of <a href="http://www.masterpaperwriters.com/get-assignment-done">Get My Assignment Done</a> teachers and directors alike. As referred to above, the task writing offerings available online commonly charge between $10 to $25 according to page. Tutors may additionally fee extra if the undertaking writing desires hours of intense research work.
Do My Homework Cheap
Tags: beginners
Published: 2021-10-08 15:39:56

You may outsource some of your essays by hiring a professional educational creator who will <a href="https://assignmentcorner.co.uk/">Do My Homework Cheap</a> your studies and assist you secure a success instructional overall performance. You don't even need to do a whole lot, just get all of your essay commands together, pay for an essay, and overlook about all of these studying struggles.
Writing Services Uk
Tags: beginners
Published: 2021-10-08 15:37:25

Expert and reliable essay writing services are sincerely really worth it. And there's greater to it than you <a href="https://www.dissertationtime.co.uk/">Writing Services Uk </a> realize. Their writers help them apprehend the course, perfect their writing talents, and put together for his or her tests in a higher way.
Added option to share the blog on any social media | @dsabyte.com
Tags: node, react, javascript, webdev
Published: 2021-10-08 15:22:19

Today i have added an option to share the blog on the social media directly. To make this happen i have generated the actual url of the blog and added this url to each social media shareing url.

## Teach stack
- reactjs
- nextjs
- nodejs
- expressjs
- chakra-ui
- react-icons

## Share
To use this feature, go to this [blog](https://www.dsabyte.com/blogs/blog/How-to-write-blogs-on-dsabyte-com/615ae5800092e1acfb513590) and scroll to the bottom.

Then click on the share icon
![post](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9eqw7kxzwyc6oxqvg93r.png)

## How i built this?
#### Workflow
- show share icon
- if user clicked on the share icon then show modal
- then user can click on the social media icons to share the blog

```js
import {
  IconButton,
  Icon,
  Modal,
  ModalOverlay,
  ModalContent,
  ModalHeader,
  ModalBody,
  ModalCloseButton,
  useDisclosure,
  HStack,
} from "@chakra-ui/react";

import { FiShare2 } from "react-icons/fi";
import { FaLinkedin, FaTwitter, FaFacebook } from "react-icons/fa";
import { RiWhatsappFill } from "react-icons/ri";

const SocialIconLink = ({ url, as, color }) => (
  <a target="_blank" href={url}>
    <Icon color={color} w="30px" h="30px" as={as} />
  </a>
);

export default function SocialShare({ url }) {
  const { isOpen, onOpen, onClose } = useDisclosure();
  return (
    <>
      <IconButton
        onClick={onOpen}
        aria-label="Search database"
        icon={<Icon as={FiShare2} />}
        variant="ghost"
      />

      <Modal isOpen={isOpen} onClose={onClose} pb="50px">
        <ModalOverlay />
        <ModalContent>
          <ModalHeader>Share on social media</ModalHeader>
          <ModalCloseButton />
          <ModalBody>
            <HStack justifyContent="center">
              <SocialIconLink
                as={FaFacebook}
                url={`https://www.facebook.com/sharer/sharer.php?u=${url}`}
                color="#1244a1"
              />
              <SocialIconLink
                as={FaLinkedin}
                url={`https://www.linkedin.com/sharing/share-offsite/?url=${url}`}
                color="#002569"
              />
              <SocialIconLink
                as={FaTwitter}
                url={`https://twitter.com/intent/tweet?url=${url}`}
                color="#328dc2"
              />
              <SocialIconLink
                as={RiWhatsappFill}
                url={`https://api.whatsapp.com/send?text=${url}`}
                color="#42ba2d"
              />
            </HStack>
          </ModalBody>
        </ModalContent>
      </Modal>
    </>
  );
}
```
How to Hack Any Social Media Account with ProPhishr-New Tool
Tags: hacking, phishing, php, html
Published: 2021-10-08 15:13:22

Hello Everyone
Today I am going to show you how you can hack any social media account in android with termux.

{% vimeo 626577014 %}

Firstly install termux from Play Store and run these commands.

Then upgrade packages

```shell
apt update && apt upgrade -y
```

Then install Git Package

```shell
pkg install git -y
```

Then clone this repo

```shell
git clone https://github.com/ProHarshit/ProPhishr
```

Then navigate to it

```shell
cd ProPhishr
```

Then run it

```shell
bash prophishr.sh
```

Rest commands in video

Thank you
(Followers Goal 50)
Pls tell how did you like it
Beginner's Guide to Docker (Part 3) - Communication & Network
Tags: docker, devops, beginners, webdev
Published: 2021-10-08 15:06:09

{% link https://dev.to/paru429/beginner-s-guide-to-docker-and-docker-cli-commands-1p75 %}

{% link https://dev.to/paru429/beginner-s-guide-to-docker-part-2-manage-data-in-docker-1co9 %}

We have learned about docker basics and also we saw what is volumes and why we need volume in docker. Now let us see what are all the types of communication our application needs and how we can achieve it using docker.

###Container to WWW
   
In case, our application in docker container wants to communicate with world wide web for read or write, for example, our application uses youtube api to fetch video for our iframe, or building any search widget using wikipedia api we need to communicate with api that youtube and wikipedia has exposed, this we can do it without any additional efforts, docker supports this out of box.

###Container to host

Let's say we have our application is in need to connect with mongodb which is hosted on localhost, now what can we do? how our application inside container reaches the mongodb hosted locally?

```
mongoose.connect('mongodb://localhost/todo_app', {useNewUrlParser: true, useUnifiedTopology: true});
```

we can simply change the above code to 
```
mongoose.connect('mongodb://host.docker.internal/todo_app', {useNewUrlParser: true, useUnifiedTopology: true});
```

###Container to another container

Let's take the same above example, our application wants to communicate with the mongodb, but this time it is hosted in another container instead of host machine, now how can we do that?

```
docker run --name mongoDb --rm -d -v data:/data/db mongo
```
```
docker container inspect mongoDb
```
from the result of the above command, we can find the ipAddress of the mongo container
```
"IPAddress": "172.17.0.2",
```
We can replace the connection string as
```
mongoose.connect('mongodb://172.17.0.2/todo_app', {useNewUrlParser: true, useUnifiedTopology: true});
```
Wait is this the only way to do it??? No!

**Network**

`docker network COMMAND` 
>Manage networks. You can use subcommands to create, inspect, list, remove, prune, connect, and disconnect networks.

Let us take todo application built using MERN stack, in which our node application talks with mongo db.

We can bring node container and mongo container to a same network and then we can just use the container name as host ipAddress and docker will resolve the ipAddress internally.
![Docker network](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9kqvuq5ni4yv9qss9omc.png)
```
docker network create todo-network
```
```
docker run \
    --name mongodb_container \
    --rm \
    -d \
    --network todo-network \
    -v data:/data/db \
    mongo
```
```
docker run \
    --name todo-node \
    -p 3030:3030 \
    --rm \
    --network todo-network \
    todo-node
```
```
mongoose.connect('mongodb://mongodb_container/todo_app', {useNewUrlParser: true, useUnifiedTopology: true});
```

Thanks for Reading!!!

Learn more about [Docker Compose](https://dev.to/paru429/beginners-guide-to-docker-part-4-docker-compose-5537) in next article
Easy Spring-Boot with Drools
Tags: spring, springboot, drools
Published: 2021-10-08 14:55:04

There's a million of these articles and they're all overly complex. You can expose your Drools `KieContainer` as a bean with 2 lines if you let Drools manage the rules on your classpath:

```java
@Bean
public KieContainer kieContainer() {
    KieServices kieServices = KieServices.Factory.get();
    return kieServices.getKieClasspathContainer();
}
```

Boom. Done. No need to futz with file I/O, the `KieFileSystem`, or any of that other nonsense. Drools will do it all for you if you let it -- why make your life more complicated?

-----

For completeness, you'd use it in your components/services like this:

```java
@Service
public class FooService {
    // Inject the bean using constructor injection
    private final KieContainer kieContainer;

    public FooService(KieContainer kieContainer) {
        this.kieContainer = kieContainer;
    }

    public void fireRules() {
        KieBase rules = this.kieContainer.getKieBase("validaton");
        KieSession session = rules.newKieSession();
        try {
            session.insert( ... ); // add facts into working memory
            session.fireAllRules();
        } finally {
            session.dispose();
        }
    }
}
```

This all works if you have your rules on your classpath, with a kmodule.xml describing your kieBases in META-INF. 

If you want to see a working example, my [library demo application](https://github.com/roddy/library-demo) is a Spring-Boot app I developed for my series of articles about how not to interact with databases.

_Cover image attribution: [coyot @ PixaBay](https://pixabay.com/photos/white-paper-texture-background-1714170/)_
You should use Buildpacks instead Dockerfile and I'll tell you why
Tags: todayilearned, docker, buildpack
Published: 2021-10-08 14:40:28

Everyone knows the benefits of docker, building containers from a **dockerfile is lit asf**🥵  in terms of  productivity, we can build and distribute applications as a piece of cake.

Despite this developers must have a knowledge in detail of how the commands in a `Dockerfile` relate to *Docker layers* and the circumstances under which layers can, and can not, be reused. 

Buildpacks abstract away much of the deeply understanding required to build a Docker image with battle-tested scripts leveraging advanced features like volumes to build images swiftly and wisely.

## Okay, I get it! But show us why we should believe you 🤨

 - **[Buildpacks](https://buildpacks.io/) is a [cncf](https://www.cncf.io/projects/) projet**;
 - **Productivity**: Removing a lot of onboarding friction for teams looking to move their applications in terms of a previous knowledge in docker;
 - **Security**: Many modern applications include dozens, if not thousands, of dependencies that perform many standard plumbing and infrastructural concerns;
 - **Performance**: Buildpacks are smarter in the way they handle application dependencies, Writing a Dockerfile that ensures that rebuilt images do so quickly and efficiently might as well be an "occultism art" 🧙‍♂️, Buildpacks [encode this knowledge](https://github.com/paketo-buildpacks/bundle-install/blob/0c4e1c769d72a1a7ca27659cb4ab33f1e1348b2b/bundle_install_process.go#L30-L104) into their implementation.
 - **It's not only for Docker**: Buildpacks embrace the OCI format, so feel free to use some [**Podman**](https://podman.io/), [**Containerd**](https://containerd.io/) or **[RunC](https://github.com/opencontainers/runc#introduction)**;

If you have that doubt and want to know how to implement, take a look at [this amazing article](https://blog.logrocket.com/dockerize-node-js-apps-buildpacks/) by **Matthew Casperson** where he builds a node application and goes from docker to buildpacks.
git remote add <friend> <collaborate.git>
Tags: opensource
Published: 2021-10-08 14:22:21

This week we practiced making contributions to a branch that we didn't create using git remote. In this week I worked on Gustavo Tavares' code [Repo Link](https://github.com/GMOTGIT/GMOT-SSG), and Mizuho Okimoto was working on my repository [My Repo](https://github.com/AndreWillomitzer/textToHTML_V2). 

The feature we were meant to implement is using a configuration file to get the arguments for our tool. This is in addition to having the option to pass the arguments manually. However, the config file should override the values from the command line.

In order to do this, the logic included:
* Checking if there's a JSON file.
* Reading the file
* Checking if it parsed correctly (no incorrect JSON formatting)
* Print an error if you could not read the file.
* Swapping the values contained in each line of the file with the corresponding JSON key-value pair for the SSG program variables.

When it came to tackling the work I did a git pull on Gustavo's repository to update my version of his repo. In order to implement this I used Yargs as this is what the original program was doing. I added an alias for "c" and "config" to allow for the user to enter a file. Using this, I stored it in argv.c and read it as a JSON file. I checked for errors including not being able to open it, or incorrect parsing:
![alt text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/extc4mkdtjydaqnzzsb6.png)

Then, as mentioned, I stored the values in each of the Yargs CLI values.

![alt text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e613oqv7mj9k92kmwvbz.png)
 
Overall the code itself was not too crazy to implement. The next step was asking him to make a change, and I realized that when I first committed I didn't update the README to let the users know they can use a config file now. So he added my branch as a remote origin, and after I pushed my README changes Gustav did a "git fetch <my name>, git checkout main so that he would be in his production branch, then git merge to get my changes, and then git push to move them to his main branch.

I learned a lot in this lab about git remote and merging a branch that I didn't create. This will be useful knowledge when multiple people are working on my project. It allows me to add them as a remote origin and merge changes and close the pull request that way after pushing.
XPanel #1: Start point
Tags: python, django, fullstack, xpanel
Published: 2021-10-08 13:51:37

[Wrong English Disclaimer](https://dev.to/alabex_/wrong-english-disclaimer-2daa)

Hello!

In this post I will list the actions what I did about XPanel project before I create the dev.to account, if you don't know what's this project visit the #0 post of the project [A Fullstack project: XPanel #0](https://dev.to/alabex_/a-fullstack-project-xpanel-gfh).

* Talk with like 20 different kind of players of the videogame about the original idea and how can I modify to the real usage (Im only one kind of player and honestly I didnt play so much the game)

* Create a concept picture of the home page in Photoshop to use when explain idea.

![XPanel concept home example](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/py5brolw68u2vcown3vg.png)

* Connect with a few principal streamers of the game to know their oppinion about the idea and if they will promote this kind of play mode, and all of them was in! :)

* Create a discord server to inform about the progress of the project, roadmap, detailed features and let interested people opine and participate in the project. It also let me know the volume of players interested :)

![XPanel discord](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/51swsvcmicn1eeoj42a4.png)

* Create a twitter account and connect with relevant content creators.
[XPanel_SC Twitter](https://twitter.com/XPanel_SC)

* Create a landing page to inform about the concept of the project and let visitors connect with our discord and twitter account.

![XPanel landing page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bhrs75gpar3lddixneo8.png)

* Start learn about Django basics.

* Continue learn about Django basics.

* Continue Continue learn about Django basics.

* Continue Continue Continue learn about Django basics.

* Define a realistic v1 objetives.

* Form a group of different kind of players to contrast relevant points.

* Design the v1 database model in sqldbm.com website.

![XPanel v1 model](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wsd379tpohwzml6yp586.png)

* Publish the idea in one relevant Spanish Podcast

* Draw the step-by-step route of user actions of v1 in diagrams.net

![XPanel v1 diagram](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2g7ftyx4lbu0wls3wvsw.png)

* Learn about bootstrap + metronic implementation in Django >> Bad idea :(

* Start project in Django and create system to read official profile characters webpage and take important data like name, enlisted date, organizations related, the rank of every organization and look for claim_code (a four digits random generated number previously showed to user) in their short bio area (this will be used to link one user in XPanel with his character in game)

///

More or less this is what I did before I start posting in dev.to, now... I will try every relevant day post about the progress..

I hope this is not my last post :D