teleren/devto huggingface dataset:
Not Another Hello World
Tags: javascript, programming, codequality
Published: 2022-04-02 17:00:05

One of the biggest blockers for me moving from a beginner JavaScript developer to a more intermediate developer has been the lack of more advanced examples.  There are an abundance of "hello wold" examples out there, but not much in the way of more advanced examples.  (Really, who makes an API call only to print it to the console.)

So I am introducing a new series to for more advanced examples.  For me, part of the learning experience is turning around and teaching/sharing my new knowledge with someone else.  My hope is that someone else can use what I learned to improve their JavaScript as well.

**Note:** The name of this series is a nod to the movie ["Sideways"](https://www.imdb.com/title/tt0375063/), where the Miles character rants about having to drink merlot.  [Here is the clip.](https://youtu.be/KXXDC5FarhE)
Want free opinions my portfolio site.
Tags: webdev, javascript, react, typescript
Published: 2022-04-02 16:56:58

Hello, everyone!

I had deployed my portfolio site and I think it has some lack of design and contents. So, I want hear any opinion or good idea from you - smart developers and designers. The source is not fully my own.

This is the link.
https://youthful-bose-f418f4.netlify.app/

Kind regards.
Exfiltering VM disks using PowerZure
Tags: azure, cloudsecurity, pentest
Published: 2022-04-02 16:07:46

---
title: Exfiltering VM disks using PowerZure
published: true
description: 
tags: Azure, cloudsecurity, Pentest
//cover_image: https://direct_url_to_image.jpg
---
* Test at your own risk

1.In the PowerShell console, iport the PowerZure module with the following commands.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n9ico4hp2sn4ht0vgyn0.PNG)

2.Obtain a list of all unattached VM disks using the following command.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1egz1pip2wnzppijczdt.PNG)
The output of command should return all managed disks that are not currently attached to a running VM and their encryption status. In your output, you should see a disk that has a name starting with winvm02, make a note of the disk name as it will be needed in the next step.

3.In the PowerShell console, use the following command to generate a publicly accessible URL to export the disk identified in the previous step. Replace <DISK_NAME_FROM_STEP_2> placeholder with the name of the disk that was identified in the previous step.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xyrsns1vfmcfkkgymr4t.PNG)
Get-AzureVMDisk is a PowerZure Module that exploits the Disk Export feature to generate a link to download a VM's disk. You should get a URL from the command output. Make a note of this URL as it will be needed in the next step.

4.This final step is completely optional. If you want to save time, bandwidth, and disk space here, you can pause the exercise and keep the technique in mind for when you run into disks in future tests. Outside of doing some forensics on the disk to find files and hashes, there is not much for us to do with the disk at this point. If you want to download the disk, open a web browser and browse to the URL that you obtained in the previous step to download the disk from the internet.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i4z2w54tacod3r92qpy6.PNG)
At this point, we will have access to the VHD hard drive file for the VM. This can be mounted directly in another VM, and you can parse out sensitive files and the Windows password hashes at this point.

**Reference**
https://github.com/cheahengsoon/Penetration-Testing-Azure-for-Ethical-Hackers
Notion Style Avatar Generator Tools
Tags: productivity, tooling, design
Published: 2022-04-02 15:45:54

[cvbox.org](https://cvbox.org)

😉 16 face shapes
👃🏼 14 noses
👄 20 mouths
👀 14 eyes
👁️ 16 eyebrows
🕶️ 14 glasses
💇‍♀️ 58 hairstyles
🎅🏼 16 beards
💋 13 facial details
💍 14 accessories


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cmg8ojq6xmbtzj36k5hn.png)
Paracetamol.js💊| #90: Explica este código JavaScript
Tags: javascript, beginners, webdev, spanish
Published: 2022-04-02 15:37:53

## **Explica este código JavaScript**

```js
const profesores = ["Oscar", "Nico", "Freddy", "Christian", "Angela"];
console.log(profesores.at(1)); //?
console.log(profesores.at(-1)); //?
console.log(profesores.at(10)); //?
console.log(profesores.at(3.8)); //?
console.log(profesores.at(-3.3)); //?
```

A. `Nico Angela undefined Christian Freddy`
B. `Oscar undefined undefined Freddy undefined`
C. `Nico SyntaxError null Christian SyntaxError`
D. `Nico null undefined undefiend null`

Respuesta en el primer comentario.

---
Precisamos ter revisão de código ?
Tags: programming, codereview, braziliandevs, beginners
Published: 2022-04-02 15:20:46

## Por que precisamos ter revisão de código ?

* **Pegar bugs**, quanto mais cedo um bug é encontrado, mais barato é o custo de remoção.

![Custo de correção de um bug](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/19m23b0fmjpno874ldb8.png)

* **Pegar problemas com a qualidade do código**, a medida que o código aumenta, é natural que a qualidade de código vá diminuir, para isso, a revisão pode dificultar que isso aconteça. O custo de desenvolvimento fica mais barato fazendo do jeito certo na primeira, em vez de prometer refatorar o código futuramente.

* **Oportunidade de aprendizado para o criador e os revisores do Pull Request.** Quando fomentamos a discussão sobre as mudanças no código, estamos pegando o feedback de cada um dos envolvidos para refinar o pull request, assim tanto quem é o autor, como os revisores podem aprender um com o outro.

* **Uma chance para o time se alinhar**, os desenvolvedores são forçados a se comunicarem e entender mais sobre o contexto do novo código, assim dá oportunidade para eles se alinharem e tomarem mais contextos sobre os novos comportamentos do software.

* **Escrever software com uma melhor qualidade.**


## Revisões de código são potencializadores, para o bem e para o mal.

Se a empresa tiver uma cultura organizacional saudável, ele poderá trazer alguns ou todos os benefícios citados anterior, ampliando o bem. 

No entanto se a cultura da empresa é ruim, ou integrantes com personalidades difíceis, ou comportamentos não profissionais, isso será potencializado durante as revisões. Nesse caso a revisão não compensa ser feita, pois entrarão em discussões desnecessárias que retardam o desenvolvimento, confrontos, comentários arrogantes ou condescendentes, que levará a diminuição da moral, o medo gerado por tais comentários negativos poderá levar os desenvolvedores a esconder defeitos, e no pior cenário, irá contribuir para a rotatividade da equipe, pois os integrantes deixarão a empresa por frustrações.


## O que precisamos ter para participar de uma revisão de código

![Como é formada uma revisão de código](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tugmxo3pinof5shvg9to.png)
The 5W's of Threat Modeling
Published: 2022-04-02 15:20:14


**What**?
_Well, it’s a process which identifies security requirements, threats & vulnerabilities. It helps in understanding the impact of threats and also quantifies their severity._

**Why?**
_Because, it helps you spot design flaws early in SDLC which can be missed during code reviews or testing and keeps the attackers at bay._

**When?**
_Typically during the design phase. But it’s never too late to know your flaws and rectify them for the future._

**Where?**
_Hmm, I will tell you where you can create a Threat model diagram.
There are different tools which can be used like Cairis, IriusRisk, Kenna, Microsoft Threat Modeling Tool etc._

**Who?**
_Usually one or more members of security team along with the engineering team participates in this process._

**Ok, now that we know what it is, how to do this?**
 

1. _You need to know what you are trying to accomplish through your software. Basically_, **Set objectives**.

2. _You know what you want_, **Visualise** _how to do it_. _Design the architecture of your application_ .

3. _Now, think about what could go wrong_. **Identify threats**. _This is where the threat modeling tools come in handy_. _If you represent your architecture through a threat model diagram_, _it identifies the threats and gives possible mitigations_.

4. _You have a list of threats, what are you going to do about it? The obvious choice is to_ **Mitigate** _them_.

5. _Did you do a good job in fixing them_? **Validate**.

**Easy with an example**?

_Consider a sample Order application whose objective is to create an order request_.

_Lets visualise the design_

- _We need a Web API to receive the request from the client_.
- _Web API communicates with Order service_.
- _Order service communicates with a database to store the request_.
- _To identify threats_, _I have used Microsoft Threat Modeling Tool to create a threat model diagram_. _The tool analyses the design_, _spots the security threats and vulnerabilities and also gives possible mitigations_.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/93mtef3dxb2mze4eai75.PNG)

_Once we mitigate a particulat threat_, _we can provide our justification in the justification column_.
_Once the justification is validated, we can change the state to mitigated_.

**In conclusion**, **with this process we can identify the security flaws during the design phase**, **rectify them before the software release and prevent costly re-coding after deployment**.
100 Days of Swift - Day 3
Tags: swift
Published: 2022-04-02 15:11:40

Continuation of [Hacking With Swift](https://www.hackingwithswift.com/) [100 Days of Swift](https://www.hackingwithswift.com/100)

Day 3 - Operators and conditions

This day was about operators, most of them (arithmetic, comparison, etc) works about the same the only difference being that parenthesis are not required inside if statements.

For switch statements, `break;` is not required / used, so if you want to execute the next condition in another case you need to use the reserved keyword `fallthrough`.

Now "range" operators are a bliss for numerical comparisons and array checking, the half-open range ..< or ..> implies that the range is not inclusive ex: 1..<5 is 1,2,3,4. Where the full range operation is inclusive so 1...5 is 1,2,3,4,5. 
On the same fashioned way one can print specifics inside an array with this operator, ex:

`
let rangedArray: [Int] = [1,2,3,4];
print(rangedArray[1...]);
`

prints:
`[2, 3, 4]`
What are carbon pools? Eli5
Tags: beginners, eli5, mojaglobal, flint
Published: 2022-04-02 15:02:26

In a conversation with Andrew O'Reilly-Nugent, Namya, and Shola Ogunkelu, Andrew asked us to describe complex topics with the help of analogies and lead by an example.

He said,
> "I find a practical way to describe complex topics is by using analogies. One I really like about carbon pools is to think of a bucket being filled by a tap, with a hole in the bottom.
> The water level of the bucket is determined by the rate of water flowing in from the tap, minus the amount of water flowing out from the bottom. If we increase the inflow, without also increasing the outflow, the water contained within this bucket will rise. Alternatively, if we increase the outflow, without increasing the inflow, water levels will drop.
> FLINT models carbon pools in terms of stocks and flows - does this analogy help you visualise what a pool represents?"

This was one of the best analogies I came across for carbon pools and I think it would have been selfish to not put it out there.
Adding Lottie Animations to Your Website
Tags: javascript, webdev, animation, programming
Published: 2022-04-02 14:57:25

## What are Lottie animations?
Lottie is a JSON-file format for adding animations to your web and mobile applications. Lottie animations are eye-catching and can communicate messages more effectively than images and text. They make the overall user experience a lot more enjoyable. Lottie animations work on the web, iOS, Android, Windows, and React Native, so no matter what device or browser your audience uses, they'll be able to view them.  
Examples:
![Store Animation](https://cdn.hashnode.com/res/hashnode/image/upload/v1648105406055/xouzcIusl.gif)
![Coding Animation](https://cdn.hashnode.com/res/hashnode/image/upload/v1648105488673/kkQ8_J860.gif)

## LottieFiles
[LottieFiles](https://lottiefiles.com/) is an amazing website where you will find tons of free animations created by designers. And we'll be using their animations for our project. Head over to [this page](https://lottiefiles.com/featured) where you will find all the amazing animations. Pick any animation. For our purpose, we'll be using this one: 

![Coding Animation](https://cdn.hashnode.com/res/hashnode/image/upload/v1648106566167/1xafImAIo.png)

Below you will find the ''Lottie Animation URL". This is the URL of the JSON file of this animation. Copy it. But how can we use it?
 
## Using Lottie Animations
LottiFiles has an [npm](https://www.npmjs.com/) package named as [@lottiefiles/lottie-player](https://www.npmjs.com/package/@lottiefiles/lottie-player). You can either import it from CDN or can install it.
### CDN

```html
<script src="https://unpkg.com/@lottiefiles/lottie-player@0.4.0/dist/tgs-player.js"></script>
``` 
### NPM

```
npm i @lottiefiles/lottie-player
``` 

```javascript
import "@lottiefiles/lottie-player";
``` 
### Usage
Add the element ***lottie-player*** and set the ***src*** property to a URL pointing to the JSON file which you copied earlier.

```html
<lottie-player src="https://assets4.lottiefiles.com/packages/lf20_l3sfdi9x.json" ></lottie-player>
``` 
It accepts some other properties as well which you can use to control the behaviour of the animation:

```html
<lottie-player src="https://assets4.lottiefiles.com/packages/lf20_l3sfdi9x.json" autoplay loop controls background="transparent" speed="1" ></lottie-player>
``` 
You can play around with these properties [here](https://lottiefiles.com/web-player).  
That's it!  

[This article was originally published on my hashnode blog.](https://shahmir.me/adding-lottie-animations-to-your-website)
Stop Wars, Defund Military, Save America
Tags: america, europe, ww3
Published: 2022-04-02 14:16:58


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

According to War Statistics, America is the enemy of peace and prosperity everywhere. Those who live outside of United States knows more about America than actual Americans. When actor Will Smith slapped comedian Chris Rock on the stage, Americans debated while non Americans laughed and confirmed the truth about American culture. While Americans wave the flag and believe America as the symbol of peace, rest of the world disgusted at the reminder of all crime against humanity committed by American military. 

A common elementary schooler argument is that everyone wants to come to America because America is a free and peaceful country. In reality, foreigners are escaping from war and sanctions that are directly or indirectly linked to American weapon manufactures. The profit of war is like a Christmas to American politicians, military complex and banking investors but nightmare for everyone. People realize that only place to escape war consequence is coming into America and they do at means necessary. 

United States is the only place where everything can be commodified and made profit from basic necessities to human rights everywhere. American people forgot what is like to live in peace since America started declaring wars to reboot the failing capitalist economy. Today, the friendship of United States and Europe built on the principle of world peace is the primary reason for war everywhere. The friendship is at stake so do humanity. #America #Europe #WW3
What's your favorite old-school website based on design?
Tags: webdev, brutalist, design, discuss
Published: 2022-04-02 14:05:53

Got a favorite old-school website based on design? 

Whether you're a fan of that [flash](https://en.wikipedia.org/wiki/Adobe_Flash)-y 90's aesthetic, drawn to the rugged ridiculousness of [brutalism](https://dev.to/lewismenelaws/brutalist-web-design-a-breath-of-fresh-air-in-the-modern-web-2jk5), or ya prefer take a stroll down the [GeoCities](https://en.wikipedia.org/wiki/Yahoo!_GeoCities) of yesteryear, I wanna know what you're into.

Let me know what kind of old-school design you are particularly fond of below and if you can drop a link or a screenshot for specifics, even better! 

_p.s. you might find [The Wayback Machine](https://archive.org/web/) helpful for excavating images of those old sites._
An Opiniated React Stack
Tags: nextjs, react, recoil
Published: 2022-04-02 10:40:20

Simplicity & Aesthetics over Complexity
Life is too sweet to be loosing sleep over trying to understand how a library or framework works, as long as a solution or library is working and has long term support I'm okay with it

## Recoil JS
### Example with async queries
#### **using `useRecoilValueLoadable` hook.**
This hook is intended to be used for reading the value of asynchronous selectors. This hook will implicitly subscribe the component to the given state.

This hooks returns a `Loadable` object for the current state with the following interface:
* **state:** Indicates the status of the selector. Possible values are `'hasValue'`, `'hasError'`, `'loading'`.
* **contents:** The value represented by this `Loadable`. If the state is `'hasValue'`, it is the actual value, if the state is `'hasError'` it is the Error object that was thrown, and if the state is `'loading'`, then it is a Promise of the value.

The example code below implements `useRecoilValueLoadable` hook from recoilJS using [Next JS](https://nextjs.org/), in a use-case when implementing private routes using HOC

```js
import { useRouter } from "next/router";
import React from "react";
import { useRecoilValueLoadable } from "recoil";
import getAuthUser from "../store/selectors/getAuthUser";

const withAuthConsumer = (WrappedComponent: any) => {
  return (props: any) => {
    const authUser = useRecoilValueLoadable(getAuthUser);
    const router = useRouter();

    // checks whether we are on client / browser or server.
    if (typeof window !== "undefined") {
      if (authUser.state == "loading") {
        return null;
      }

      if (
        authUser.state == "hasValue" &&
        authUser.contents?.user_type == "consumer"
      ) {
        return <WrappedComponent {...props} />;
      } else if (
        authUser.state == "hasValue" &&
        authUser.contents?.user_type == null
      ) {
        router.push("/auth/login");
        return null;
      } else {
        router.push("/auth/login");
        return null;
      }
    }
    // If we are on server, return null
    return null;
  };
};

export default withAuthConsumer;
```
Check this [useRecoilValueLoadable](https://recoiljs.org/docs/api-reference/core/useRecoilValueLoadable/) for more explanation.

## Html to jsx
https://htmltojsx.in/
Learning Calculus
Tags: devjournal, calculus, beginners
Published: 2022-04-02 13:24:50

## Table of Contents
1. [Learning Calculus](#learning-calculus)
2. [Helpful Resources](#helpful-resources)
3. [Study Schedules](#making-a-study-schedule)
4. [Conclusion](#conclusion)

Calculus is one of the core mathematical concepts in machine learning. It plays an integral role in understanding the workings of machine learning algorithms while providing the necessary tools to optimize complex functions.

There are so many uses of calculus in machine learning - gradient computations, numerical optimization, bayesian methods, variational inference, generative adversarial networks, and more!

### Learning Calculus
Learning calculus on your own doesn't have to be a strenuous road. There are many courses and resources online starting with calc 1 all the way to linear algebra, such as [IXL](https://www.ixl.com/math/calculus?partner=google&campaign=340747265&adGroup=116593322857). 

Calculus as a subject in itself has an unfair reputation as being "too hard" or "not useful enough" to bother learning. In reality, calculus is a tool that allows you to solve various problems that would be much harder to solve, sometimes impossible to, without any knowledge of calculus.

In order to learn calculus, similar to many other subjects, you will want to avoid burnout as much as you possibly can. To do this, setting a schedule to remain consistent and focused in your learning all while including a minimum or maximum amount of hours will do the trick. For example:

- Monday: 6 am to 5 pm with 20 minute breaks every 2 hours - Watch lectures at 2x speed
- Tuesday: 6 am to 3 pm - Do practice problems
- Wednesday: 6 am to 5 pm with 10 minute breaks every hour - Review any questions written down for practice problems
- Thursday 6 am to 5 pm with 30 minute breaks every 2 hours - Watch more lectures at 2x speed
- Friday 6 am to 12 pm - Redo practice problems

By allowing yourself the nights, you are able to relax, go to the gym, and spend time with friends and family. If you are doing this on top of school and/or work, maybe you can shift the studying periods to night time so it is outside of work hours or on the weekends. Either way, always remember to leave room in your schedule for downtime. Your mind cannot work properly if it is always on "go" mode.

### Helpful Resources
1. [ML Glossary - Calculus](https://ml-cheatsheet.readthedocs.io/en/latest/calculus.html)
2. [Mathematics for Machine Learning - course](https://www.coursera.org/learn/multivariate-calculus-machine-learning)
3. [Calculus for Machine Learnig](https://www.dataquest.io/course/calculus-for-machine-learning/)
4. [Mathematics for Machine learning - youtube](https://www.youtube.com/watch?v=lsmUiWvmruU)
5. [Multivariable Calculus - Khan Academy](https://www.khanacademy.org/math/multivariable-calculus)
6. [Calculus: Early Transcendental](https://www.amazon.com/Calculus-Early-Transcendentals-James-Stewart/dp/1285741552)