teleren/devto huggingface dataset:
Day-5: A day off but...
Tags: cybersecurity, security, blogaday, infosec
Published: 2020-06-21 16:11:39

**Day-5:** Sunday...Hmmm! Today I did nothing In research but I read Two Medium blogs/Write-Ups one on ATO (Account Takeover) and one on Bypassing 2FA (2 Factor Authentication). And gave the rest of my time to family. Also realized Family talks actually makes your stress/Confusion low!😛

*Lessons learned:*

**ATO by Avanish Pathak:**
- Changing value in Email Parameter in response request can lead to ATO! 
- The company was asking for OTP for login, what he did was: Put in the write email and code and then,
     - `Capture the request in Burp ==> Response request ==> Change the Email in Email Parameter to victim's email with correct OTP code ==> BOOM!`
- For more In detail Information check out his blog! Link in Resource down there!

**2FA bypass by Seqrity:**
- Subdomain enumeration helps alot! It opens a whole lot of opportunities to attack the target! 
- If the main domain is asking for 2FA Don't forget to check out that other domains are?, You can change the Host Header and can bypass 2FA!
- For more In detail Information check out his blog! Link in Resource down there!



---

PS: Happy Father's Day to all Fathers out there!❤️

---
# **Resources:**

**ATO WriteUp by Avanish Pathak:** https://medium.com/@avanishpathak46/an-interesting-account-takeover-vulnerability-f5bf6a89152c
**2FA bypass by Seqrity:**
https://medium.com/@seqrity/bypass-2fa-like-a-boss-378787707ba



# **Contact:**

Got doubts? Contact me on [Twitter](https://twitter.com/FenilShah1616). 
Feedbacks are welcomed, do comment it down below! :)
How to add an element to ending of an array with ES6
Tags: javascript, tutorial, array, es6
Published: 2020-06-21 16:00:59

The **spread operator `...`**, introduced first in **ES6** became one of the most popular and favourite feature among the developers.

This tutorial describes how to add an element to the ending of an array using spread operator in ES6

## Example with animals emoji

```javascript
let animals = ["🦁", "🐵", "🐕", "🦊", "🐯"];
console.log(animals);
// Output → ["🦁", "🐵", "🐕", "🦊", "🐯"]

console.log(animals.length);
// Output → 5

animals = [...animals, "🦄"];

console.log(animals.length);
// Output → 6

console.log(animals);
// Output → ["🦁", "🐵", "🐕", "🦊", "🐯", "🦄"]
```

Read the complete post on our site [MeshWorld](https://meshworld.in) - [How to add an element to ending of an array with ES6](https://meshworld.in/es6-add-element-to-array-end/)

Happy coding
How to almost run your Console Apps in the new terminal from Visual Studio2019
Tags: todayilearned, tutorial
Published: 2020-06-21 15:44:27

If you like me love what microsoft has done with the new terminal you might be wondering when and how can i run this as the default terminal in windows, and how i can start my console apps through this beauty.

Well the answer to question number one is easy, just relearn to write `wt` instead of the classic `cmd`
Note that this will just launch the terminal, meaning it will most likely start in your `%USERPROFILE%` folder

Thankfully you can start from any location with the -d flag
`wt -d <Path>`
which means that we can start from the current directory with 
`wt -d .`

#### What about the "Open command prompt here" right-click menu?
While this can be achieved through editing the registry yourself the feature is merged and should be release in the next public release, and is already available in the preview build. 
Heres the roadmap for the terminal:
https://github.com/microsoft/terminal/blob/master/doc/terminal-v2-roadmap.md
And here is the PR for that specific feature:
https://github.com/microsoft/terminal/pull/6100

#### So what does that mean for visual studio?
Well what you can do is change your executable from your project settings to instead start the terminal and pass your application as arguments.
To pass commands directly to the terminal is done with the flags
`wt cmd /c <your command>`

So what can be done is changing your Project settings under the Debug tab to `Launch: Executable` as opposed to Project.
And then pass `wt` as your executable
and for arguments `-d . cmd /c <YourExecutable.exe>`

Sadly this breaks debugging and launches two terminal windows, one to run your custom command and one with the new terminal.
Intro Post
Tags: beginners, motivation, productivity, webdev
Published: 2020-06-21 15:36:40

Well, this is a little embarrassing to do because I have been on DEV.to for the past 6 months or so. But, I feel it is necessary to let others in the community know about me and my experience. 

# The Intro
*I am Medam Mahesh. 
My coding journey started 4 years ago.
I am good at Frontend and Backend Development, Machine Learning, Artificial Intelligence and owing to my past experience
I love to chat about literally anything and everything new as long as it is related to coding.*

# My Experience with DEV
*It has been very awesome. The community is active, great and sensible to newcomers. You do not see a lot of hate speech going on which is great.*

Thanks for being such a great community, DEV.
Secrets in AWS and reading from Kotlin
Tags: aws, kotlin
Published: 2020-06-21 15:32:05

This article is part of the **Twitter bot with Kotlin in AWS series** showing how [I created a Twitter bot for Vue 3 updates](https://dev.to/gautemeekolsen/twitter-bot-vue-3-updates-j5b). But this article works as an independent article on how to manage your secret values and tokens in AWS and read them from Kotlin code.

We are using the AWS Secrets Manager to keep our keys and tokens safe. Make sure your role running the code has access to the Secrets Manager.

## Adding secrets with AWS CLI
Run the create-secret command to create secret containing a JSON object with key/value's for all the secrets.
```
aws secretsmanager create-secret --name twitter-bot-vue-3/auth --description "Twitter app keys and tokens" --secret-string "{\"consumer-key\":\"API key\",\"consumer-secret\":\"API secret key\",\"access-token\":\"Access token\",\"access-token-secret\":\"Access token secret\"}"
```

## Reading from Kotlin
First, we need to add a JSON serializer and AWS Secrets Manager to `build.gradle.kts`.
_plugins_:
```
kotlin("plugin.serialization") version "1.3.70"
```

_dependencies_:
```
implementation("software.amazon.awssdk:secretsmanager")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.20.0")
```

Now create a Secrets.kt file where we create a class that will hold the secrets.
```kotlin
import kotlinx.serialization.json.Json
import kotlinx.serialization.json.JsonConfiguration
import kotlinx.serialization.json.content
import software.amazon.awssdk.regions.Region
import software.amazon.awssdk.services.secretsmanager.SecretsManagerClient
import software.amazon.awssdk.services.secretsmanager.model.GetSecretValueRequest

const val secretName = "twitter-bot-vue-3/auth"

class Secrets {
    val consumerKey: String
    val consumerSecret: String
    val accessToken: String
    val accessTokenSecret: String

    init {
        val client = SecretsManagerClient.builder().region(Region.EU_WEST_1).build()
        val secrets = client.getSecretValue(GetSecretValueRequest.builder().secretId(secretName).build())
        val json = Json(JsonConfiguration.Default)
        val jsonObject = json.parseJson(secrets.secretString()).jsonObject
        consumerKey = jsonObject["consumer-key"]!!.content
        consumerSecret = jsonObject["consumer-secret"]!!.content
        accessToken = jsonObject["access-token"]!!.content
        accessTokenSecret = jsonObject["access-token-secret"]!!.content
    }
}
```

We can now use the Secrets class in our `Tweet.kt` file.
```kotlin
fun sendTweet(message: String){
    val secrets = Secrets()

    val cb = ConfigurationBuilder()
    cb.setOAuthConsumerKey(secrets.consumerKey)
    cb.setOAuthConsumerSecret(secrets.consumerSecret)
    cb.setOAuthAccessToken(secrets.accessToken)
    cb.setOAuthAccessTokenSecret(secrets.accessTokenSecret)
    val twitter = TwitterFactory(cb.build()).instance
    twitter.updateStatus(message)
}
```
What does if __name__ == '__main__': do in Python?
Published: 2020-06-21 15:15:06

What does `if __name__ = '__main__'` mean?  

You can sometimes see this in <a href="https://python.org">Python</a> script, in general this is where your Python program starts. 

In many other languages, the computer program starts with a main() function. That can be the case in Python too.

## main value

Let us do a quick exercise in order to grasp the specifics of the main function and the [if statement](https://python-commandments.org/python-if-else-elif-statement/). 

```python
print("module_name :{}".format(__name__))
```
[Run the Python](https://pythonprogramminglanguage.com/how-to-run/) file and execute the file as python3 script 

The outcome of the app in this example states that the [variable](https://pythonspot.com/python-variables/) name has a **main** value.

```python
>>> print("module_name :{}".format(__name__))
module_name :__main__
```

So what is this main?

## What does if __name__ == "__main__": do?

When the above condition is tested, it must be verified whether the file is run directly by or [imported](https://pythonbasics.org/modules/) by python.

The explanation demonstrates this.

```python
    def main():
        print("module_name :{}".format(__name__))
        
    if __name__ == "__main__":
        main()
    else:
        print("run from import")
```

That's because you can import any Python script but most of the times you only want access to the functions

![python main function](https://dev-to-uploads.s3.amazonaws.com/i/897pkqxeyogv2dj5f3z8.png)

Like `import math` shouldn't execute sin, cos, pow etc automatically, you import it because you want it available.

If you are new to Python, I suggest <a href="https://gumroad.com/l/dcsp">this book</a>
Amazon (AWS) NLP Service - Comprehend and Twitter API
Tags: laravel, amazon, twitter, nlp
Published: 2020-06-21 15:11:34

In today's world data is everywhere. And, so analysing data and coming up with insights from that data is a very important thing. 

Recently, I was involved in a project where an automotive company wanted to get some insights about the sentiment of the users who were posting on their twitter handle and also on their other social mediums. 

Now a days, using API we can fetch information from Facebook pages, Tweeter handles etc. And hence, it is possible to fetch that data, run them through Natural Language Processing (NLP) and get some idea about the content which is posted. 

For example, as a social media manager I would like to know what is the sentiment of a user who has written anything about my company on Facebook or Twitter. If there is something positive written about my company, I would like to highlight that. If someone has written something negative, then we have an unhappy customer and I would like to know what was a problem and try to solve that problem.

Now, it is difficult to read through all these mediums and come up with analytics. And hence, services like AWS Comprehend can really help. Yes, there are a lot of services available who can do these stuff. But, I found AWS to be very easy, vast and cheap as well. 

So, in this video I am going to show you how we can use the Amazon Comprehend service to fetch data from Twitter API using the Twitter streaming API and then send them to AWS Comprehend and get some sentiment analysis done on that tweet, extract some keywords and do other stuff. 

So, if this requirement interests you, then dive into the journey where I show you how we can do this.

{% youtube LHlHPrFe-6M %}
Use iconfront to create icon component
Tags: javascript, vue, tricks
Published: 2020-06-21 14:39:31

---
title: Use iconfront to create icon component
published: true
description: 
tags: Javascript, Vue, Tricks

---

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/5lyj2r9j3y6lb68ul0x8.jpg)

How to create `icon` component with [iconfront](https://www.iconfont.cn/) let show you code simple and clearn

### icon.vue

```vue
<template>
  <svg
    class="icon iconfont"
    aria-hidden="true"
    :class="name"
    @click="
      () => {
        this.$emit('click')
      }
    "
  >
    <use :xlink:href="`#icon-${name}`"></use>
  </svg>
</template>

<script>
export default {
  props: {
    name: {
      type: String,
      required: true
    }
  }
}
</script>

<style>
.icon {
  -webkit-font-smoothing: antialiased;
  -webkit-text-stroke-width: 0.2px;
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  fill: currentColor;
  overflow: hidden;
}
</style>

```

### demo.vue

```vue
<template>
  <div class="container">
    <icon name="add" />
    <icon name="circle" />
  </div>
</template>
<script>
import Icon from './index'
export default {
  components: {
    Icon
  },
  methods: {
    toast() {
      alert('click')
    }
  }
}
</script>
<style lang="scss" scoped>
.icon {
  width: 24px;
  height: 24px;
  margin: 8px;
}
.hide-right {
  color: $primary;
}
</style>

```

Download iconfront static files and import to you project, that all.


Hope it can help you :)
Hackathon is coming 🏆
Tags: discuss, competition, news, showdev
Published: 2020-06-21 14:34:30

I was **Busy** this June, working with my team **INDIAN SOCIETY FOR TECHNICAL EDUCATION, SRM**... 

So, Now we have a Surprise for everyone... And title says it all.. It's a Hackathon...👩‍💻👨‍💻

In the current situation where the **Pandemic COVID-19** has distracted programmers with all fun... Our team has tried hard enough for you all to bring all the fun back in such less time. and came up with a solution to conduct a **Hackathon**.

**To Them Who don't know what Hackathon Is ?**

A hackathon is basically an event where programmers get ‘x’ amount of time (usually one or two days) to try to make something from the ground up. This “something” can be an application, a piece of hardware, a service… basically anything, unless the guidelines specify otherwise.

**What we are Up to...⁉**

We are making this Hackathon a **virtual Hackathon**. And we are Conducting it **@github**. 

**But How 🤔 ⁉** 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/7kj8ychtsgywimlyqclw.gif)

* we will make it an **Open Source**.

* **Registration** will be considered by **PULL Request**.

* We came up with this approach as **GitHub would be the Best place to create a virtual hackathon Environment.**

* People can update the **PULL REQUEST** with their Projects and GitHub Repositories.

* It would be More Fun...


**We Would be Providing the Link to the Repositories to which you have to send the `Pull Request` very soon... So stay Tuned...**

#### Follow My Team **ISTE**

- ISTE's Instagram : https://www.instagram.com/iste_srm_offc

**Drop Your Email @ Comment to let you know when we are Rollin ! 📧**

Thanks,
Happy Coding ! 👩‍💻👨‍💻
Please Give Suggestion 🙏.
Are curved PC monitors good for programming ?  
Tags: monitor, discuss
Published: 2020-06-21 14:22:12

UM.UE2SS.002
After a long time I joined PC master race,I hadn't had any experience/ feel with it curved monitors.I have been doing whole life with a flat screen monitors.I typically develop websites so can this curveness have any effect on UI comparing to flat ones.If any of you using this how is your switch to the curved monitors ?
How to Pass Parameter in JavaScript
Tags: javascript
Published: 2020-06-21 14:06:25

<!DOCTYPE html>
<html>
<head>
	<title>function parameters </title>
</head>
<body>
<button onclick="functionName('karan')">Click</button>

<script type="text/javascript">
	
	function functionName(a){

		alert(a);
		
	}

</script>
</body>
</html>

Therefore, we have to show an example to pass the argument in function of javascript. Now, an Html design in this Html structure. Also, I included scripting tags for using JavaScript functions.

Firstly, Saw at this code have the button and in this button. Added a JavaScript function event element of onClick event.
 
 The main part as you want to know about its arguments.

So, there are I pass one parameter in the JavaScript function imperilment the Html button onClick function.

pass an parameters with the onClick event JavaScript function. Then I implement to this function script code in the section of the body.this is the main source avilable here more example of code <a href="https://wlearnsmart.com/how-to-pass-parameter-in-javascript-function-from-html/">How to Pass Parameter in JavaScript Function From Html</a> 

Secondly, insert in the script tags the function coll and then get parameter. Thus, show the function parameters result with the alert box of the argument value.

Therefore, we can be getting the parameters in different ways using javascript elements. Also, include other functionality to store parameters as a variable.
I created an app that generates fake data for you
Tags: react, redux
Published: 2020-06-21 13:51:09

---
title: I created an app that generates fake data for you
published: true
description: An app that generates fake data for you
tags: Reactjs, redux
---
I usually need fake data to test with & I end up writing code to generate it.

so I created a tool to do that for me, with react and redux I had to use redux because the state was getting complex.

you only need to define the prototype for your model and then choose the random function generator for each property.

**everything here runs on the client-side, there is no backend**

There is a lot of enhancements that can be done which I'll try to implement, for example

1 - Add a way to save model definitions & load them

2 - Add ways to join models and nest them

3 - maybe read the models from a data source ( DB - typeorm entity - sequelize model )

* PR's are welcomed


link -> https://mohammedal-rowad.github.io/pollux/

issues and if you have any ideas -> https://github.com/MohammedAl-Rowad/pollux/issues

readme -> https://github.com/MohammedAl-Rowad/pollux


* simple video as a demo:
{% youtube Vh0M0oNo7Gc %}
Install Node.js on Ubuntu server
Published: 2020-06-21 13:47:31

Here we install node.js using nodesource on a vps server

To begin ssh to your vps and type

`curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash`

The above command helps add the desired node repository to allow you to install any given version. For this article, we are using node version 12 

Next we install node.js with the following command

`sudo apt install nodejs`

After command is run, check the version of node.js installed


`node --version`

Node.js is typically install with npm(node package manager) you can check the version of npm installed using the following command

`npm --version`
Post Makers - Week 14
Tags: jobhunt, forhire, pernstack, quarantine
Published: 2020-06-21 13:42:56

This week was a quiet one. After my ramblings last week, I spent time searching for jobs, and applying to companies who I genuinely wanted to work for. 

It seems that someone out there heard me moaning, there does seem to be a few more roles around, and some of the ones I came across even mentioned that they were suitable for bootcamp grads! Fingers crossed this is the shape of things to come. It seems that there is a direct correlation with government strictness, the less severe, the more companies are likely to hire/onboard juniors.

Makers also had a job posted for the first time in 3 months which is great, i've applied so fingers crossed something positive comes back soon. 

On the coding site I spent a couple of days trying to get an authentication system in place in a PERN stack app I am making. It's a bit fiddly, but it has been fun to use the react router and tokens to validate a user. 

Next week i'm planning on hooking back up with my old partners in crime Nic and Asia to start a new project, the successor of the covid application. 

Fingers crossed it will be as much fun, and as resourceful as that!

Stay safe everyone,

David
Sticky Header and Footer with Tailwind
Tags: tutorial, tailwindcss, css, flexbox
Published: 2020-06-21 13:35:30

Recently I started exploring Tailwind CSS framework. It is utility CSS framework fro building components. It gives us utility classes for creating customizable components. 

If you don't know about utility CSS, check out this article from tailwind creator Adam: [Utility CSS](https://adamwathan.me/css-utility-classes-and-separation-of-concerns/ ).

I had to build similar UI like Spotify where header and footer are fixed. The only middle part is scrollable.

It will be our final result:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/k6h7k9qzm65gicedg1l9.gif)

### First Step:

This is our HTML code which contains a header, main and footer.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/73gufxp6247m9xmhg01h.png)

### Last Step:

We want our max screen width of 100%. Our main block should be scrollable. Header and Footer should be stick to the same position always. We won't use `position: fixed` class.  We will use flexbox superpowers here. 

Add `h-screen` to parent div. It will give max 100vh height.

Add `flex-1 overflow-y-auto` to the main block.

Here `flex-1` class is giving remaining space to the main block. Header and Footer will take space based on their content size.
`overflow-y-auto` class give the scrollable property for the main block. Try to add lot of content in main block. 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/6zwbipo8y6gd69yx101u.png)

That's it :slightly_smiling_face:

### Final Result 
{% codesandbox y7g7g %}
Angular - ERROR in 'router-outlet' is not a known element:
Published: 2020-06-21 06:53:36

I have been supporting this massive Angular app and from the time I took over support, I was told "ng build --prod" never works. Of course, we did a couple of things that I am not proud of to go round this issue.

So the detailed error when building for prod has been: -
ERROR in 'router-outlet' is not a known element: 1. If 'router-outlet' is an Angular component, then verify that it is part of this module. 2. If 'router-outlet' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("     [ERROR ->]<router-outlet></router-outlet>   ")

A quick  Google (I actually did a lot of searching) took me to these places, which have great material about this issue: -
1. Stackoverflow - https://stackoverflow.com/questions/44517737/router-outlet-is-not-a-known-element

None of that worked for me :(.

I then started working my way through all the app modules and discovered that there were a couple of modules which did not have routing defined. Voila. I added routing to all of these modules and this app is now successfully compiling with the --prod flag.