teleren/devto huggingface dataset:
Creative with data: Gender equality at the olympics
Published: 2022-03-15 03:00:32

---
title: Creative with data: Gender equality at the olympics
published: true
date: 2022-03-08 00:00:00 UTC
tags: 
canonical_url: https://dataroots.io/research/artyfarty
---

How much chance do you have as female athlete to go to the Olympics compared to your male counterpart? An analysis per country shows clear regional trends related to these gender ratio.
stdout: Localhost HTTP Proxy with Node.js
Tags: javascript, node, http, proxy
Published: 2022-05-28 08:30:44

---
title: stdout: Localhost HTTP Proxy with Node.js
published: true
date: 2022-03-08 00:00:00 UTC
tags: javascript,nodejs,http,proxy
canonical_url: https://nabeelvalley.co.za/stdout/2022/08-03/http-proxy-node-js/
---

#Contents

A localhost HTTP proxy is useful for debugging and can be easily defined using Node.js by installing `http-proxy`

```
yarn add http-proxy

```

And then adding the following to an `index.js` file:

`index.js`

```
const httpProxy = require('http-proxy')

const target = 'http://my-target-website.com:1234'

httpProxy.createProxyServer({ target }).listen(8080)

```

Which will create a server that listens on `8080` and will proxy requests to the target
Azure Policy - Add custom error messages
Tags: azure, policy
Published: 2023-09-13 15:41:33

---
title: Azure Policy - Add custom error messages
published: true
date: 2022-03-08 00:00:00 UTC
tags: Azure,Policy
canonical_url: 
---

Azure Policy is very useful to do governance on Azure, however the error messages are not always clear, but it is possible to customize them as we will see in this article

Let’s imagine a policy for your storage accounts to validate that they will all be accessible only in https, so we will have a policy like this:

```
"if": {
    "allOf": [
        {
            "field": "type",
            "equals": "Microsoft.Storage/storageAccounts"
        },
        {
            "field": "Microsoft.Storage/storageAccounts/supportsHttpsTrafficOnly",
            "equals": false
        }
    ]
},
"then": {
    "effect": "deny"
}

```

When assigning it, you will want to give it a name, at this point you have several choices:

- Put a name that speaks to all those who will have the error message such as _AllowOnlyStorageAccountWithOnlyHttpsSupport_
- Put a unique identifier such as _4cd4c48a-9a10-4386-ae0e-45ee0205231b_, since we agree that there is nothing better than a Guid, or not …
- Have a nomenclature on your different Azure Policies in order to find them easily and avoid typos or approximate English, except that there is a risk of ending up with a code that is not always clear such as STG-SPEC-NWK-RSK0 (Storage-Specific-Network-Risk\_0)
- The answer D

Well, to be honest, I prefer the third choice, because a nomenclature can be declined and there is no need to invent a name for everything. The real drawback however is that sometimes your policies get triggered and your users legitimately ask you “If not Wilfried, what does this error code mean?” Well you should know that now all these support concerns are over, because Microsoft has provided the ability to put custom error messages like this:

![](https://woivre.com/images/2022/03/08/azure-policy-add-custom-error-messages-img0.png)

So when you create your Storage Account, for example in powershell, you will get this message:

```
PS C:\Users\wilfr> New-AzStorageAccount -Name policytestwwo -ResourceGroupName policy-test-2 -Kind StorageV2 -SkuName Standard_LRS -Location westeurope -AccessTier Hot -EnableHttpsTrafficOnly $false
New-AzStorageAccount : Resource 'policytestwwo' was disallowed by policy. Reasons: 'Allow only storage account with
only https support enabled'. See error details for policy resource IDs.
At line:1 char:1
+ New-AzStorageAccount -Name policytestwwo -ResourceGroupName policy-te ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : CloseError: (:) [New-AzStorageAccount], CloudException
    + FullyQualifiedErrorId : Microsoft.Azure.Commands.Management.Storage.NewAzureStorageAccountCommand

```

And voilà there you have your custom message! Of course, you can put whatever you want like a link to your internal documentation for this Policy.
FREE Alternative Tools For Your Online Privacy
Tags: free, privacy, tooling, opensource
Published: 2022-03-07 23:33:14



## Search Engine
-> Duck Duck Go - [link](https://duckduckgo.com)

## Web Browser
-> Brave - [link](https://brave.com)
-> Firefox - [link](https://www.mozilla.org/en-US/firefox/new/)
-> Opera - [link](https://www.opera.com)

## Messenger
-> Signal - [link](https://signal.org/en/)
-> Threema - [link](https://threema.ch/en)

## Operating System
-> Linux based system ([Ubuntu](https://ubuntu.com), [Fedora](https://getfedora.org), [Arch](https://archlinux.org), [etc...](https://en.wikipedia.org/wiki/Linux_distribution))

## Web Site Analytics
-> Plausible self-hosted - [link](https://plausible.io)
-> Matomo - [link](https://matomo.org)

## Email
-> ProtonMail - [link](https://protonmail.com)

## Password Manager
-> Bitwarden - [link](https://bitwarden.com)
-> Keepass - [link](https://keepass.info)

------------

Hopefully, these resources will help you. If you have any tips, feel free to contribute them.

Writing has always been my passion and it gives me pleasure to help and inspire people. If you have any questions, feel free to reach out!

Connect me on <a href='https://www.twitter.com/paulknulst' target="_blank">Twitter</a>, <a href='https://www.linkedin.com/in/paulknulst/' target="_blank">LinkedIn</a> and <a href='https://github.com/paulknulst' target="_blank">GitHub</a>!

Visit my <a href='https://medium.knulst.de' target="_blank">Medium Blog</a> for more articles like this.


-----------


Photo <a href='https://www.freepik.com/photos/shocked-woman'>Shocked woman photo created by cookie_studio - www.freepik.com</a>
Happy International Women's Day from Core dna!
Tags: discuss, opensource, coredna, womenintech
Published: 2022-03-07 23:17:41

As it is International Women's Day, we want to thank the women in our international offices and to everyone else who celebrate this today's event. Keep being badass!

Happy International Women's Day from Core dna!

#Beboldforchange #InternationalWomensDay #IWD2022 #coredna #breakthebias #IWD #WomensDay #internationalbusiness

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y443uzi0alq2vqznnqyw.png)
How My Approach to IWD Has Changed
Tags: wecoded
Published: 2022-03-07 23:04:48

---
title: How My Approach to IWD Has Changed
published: true
tags: shecoded
---

A couple years ago I shifted my approach to celebrating International Women's Day (IWD) and talking about diversity and inclusion by doing exactly that - **celebrating**. 

This included stronger boundaries firmly enforcing this change in my personal brand - I want to celebrate the accomplishments of women, underrepresented minorities, and other marginalized people, not continue to ask them how they are going to acknowledge and "cure" all tech of diversity and inclusion issues while somehow also still doing their day jobs, while also shouldering significant unpaid, unnoticed, unappreciated labor at work and home.

Around the same time I made a conscious effort to shift my approach, I pulled together an all day livestream event - a celebration - where women spoke about the work they were doing at my current employer, what they were passionate about professionally, and it was like sprinting a marathon but I felt so fulfilled by the end of the day. Exhausted, but fulfilled.

At nearly 10 years into my tech career I understand I'm privileged. I'm still here. I'm thriving. I'm feeling more supported than ever. I acknowledge that not everyone is in the same position I am for a variety of reasons including privilege.

But even when I say I'm thriving, I've recognized that I can't be all things to all people and I need to protect myself and my emotional and cognitive bandwidth or slip from thriving to surviving... again.

More plainly put - I don't have lived experience I want to share or a corporate brand-friendly answer to most questions on this topic. Nor do I think this would add value to anyone, including myself.

I don't want to be the token women on a panel. I don't want to be THE technical woman (because there is only one). I don't want to be the moderator for a manel (man-panel) because we need more women. I don't want to spend more hours thinking about all the terrible things that have happened to me and other women when we just want to do our jobs. 

However, I do want opportunities to showcase my expertise.

So ask me about my career path, my accomplishments, how people management is going, how strategic leadership is going, how I'm finally feeling like I'm an expert in my field. Invite me into your spaces to talk about my expertise. Acknowledge my expertise. 

Ask the allies their thoughts and how their actions are going to improve things for women. Allyship requires work - are they committed to putting in the work? Are other allies holding them accountable?

And, finally, respect the boundaries women put in place to protect themselves. She's not being difficult, she's being purposeful.
🍃 Groovi - Create Soothing Focus Mixes
Tags: azuretrialhack, typescript, nextjs, showdev
Published: 2022-03-07 23:02:06

{% github https://github.com/harshhhdev/groovi %}

👀 Try it out! [groovi.hxrsh.in](https://groovi.hxrsh.in)
🎨 Check out the [branding board](https://www.figma.com/file/8UW0ZE6WURyqnYZIDNwFqJ/Groovi?node-id=0%3A1)

### Overview of My Submission

Many of us jam to lofi hiphop beats and ASMR to improve our focus and concentration while we're working -- so, why not create your own concentration mixes?

The goal of this project is to provide you with a basic set of calming, ASMR white noise to build your favourite concentration mixes.

[Groovi](https://groovi.hxrsh.in) works like a social website, which has profiles. You can create and like different mixes made by other people, and the website also has support for private mixes that can be seen by just you! You can create mixes without logging in, however to publish them you must login. You can login with either [Google](https://developers.google.com), [Twitter](https://developer.twitter.com), or [Facebook](https://developer.facebook.com).

This project is has a lot of features, and it took a lot of my time and effort into designing a clean and responsive interface and bringing it to life. If you enjoyed, consider giving it a ⭐ on [GitHub](https://github.com/harshhhdev/groovi) - every star counts!

### Submission Category: 

This app uses the [Azure PostgreSQL service](https://azure.microsoft.com/en-us/services/postgresql), along with being a creative and cool, best fitting the "wacky wildcards" category.

![image](https://user-images.githubusercontent.com/69592270/157129653-a6561b6e-5069-495d-8dab-48e079adc053.png)

### Link to Code

{% github https://github.com/harshhhdev/groovi %}

I've made this project by myself! Here are some videos:

![main](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/khnlfv5zrpcnrn9t5awh.gif) 
![profiles](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lwp8ys2ot1njhqq0xd93.gif)

Libraries & technologies I've used:

- [Kraftuur](https://harshhhdev.github.io/kraftuur/)
- [TypeScript](https://www.typescriptlang.org/)
- [Azure PostgreSQL](https://postgresql.org)
- [Prisma](https://prisma.io)
- [NextAuth.js](https://next-auth.js.org/)
- [Next.js](https://nextjs.org/)
- [Stitches](https://stitches.dev/)
- [Framer Motion](https://framer.com/motion)
- [react-icons](https://react-icons.github.io/react-icons/)
- [nanoid](https://zelark.github.io/nano-id-cc/)
- [Prettier](https://prettier.io/)
- [ESLint](https://eslint.org/)
- [Figma](https://www.figma.com/)

...and if you made it down here, be sure to check out [Groovi](https://groovi.hxrsh.in)! Feel free to share your mixes in the comments below :)
Introducing new MS Learn module on how to detect anomalies in time-series data from IoT devices.
Tags: ai, azure, tutorial, beginners
Published: 2022-03-07 22:59:27

We are excited to announce a new AI module on MS Learn: [Identify abnormal time-series data with Anomaly Detector](https://aka.ms/learnAnomalyDetector).

# Introduction

Training a Machine Learning model for Anomaly Detection is challenging. There are multiple types of data patterns: Spikes/Dips, periodic wavy pattern, inclining pattern, declining pattern etc.  In real life, data patterns from time series data are inconsistent and unpredictable.  There is no one algorithm that fits all the patterns.  As a result, developers or data scientists have to continuously train a new model to accurately detect issues.  In this learn module, you will explore how Azure Anomaly Detector is able to automatically select an algorithm or model based on the data pattern it observes in real-time.

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

# Hands-on Exercises
The module provides hands-on exercises to read time-series data from a smart meter device; send data to the cloud using IoT Hub; and use Azure Anomaly Detector service to spot issues in the real-time data.  The module provides a FREE sandbox environment for all the hands-on exercise. 


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

# Benefits of Azure Anomaly Detector
The following are some of the Anomaly Detector features that will be explored in the module:
- Auto selection of the best algorithm in real-time based on the data pattern.  
- Root cause detection when you have multiple contributors of the anomaly.
- Custom Training & deploying AI model
- REST API & SDK support

# Let’s get started

{% embed https://www.youtube.com/watch?v=tf5K4AGsjx4 %}

After completing this lesson, you will be able to use the Azure Anomaly Detector to build AI solutions that are reliable and ensure that your processes run smoothly.  You will understand how the Azure Anomaly Detector APIs work and how to apply the AI service to you time-series data analytics.  [Get started here]
(https://aka.ms/learnAnomalyDetector).  Happy Learning!
CSRF Protection in Next.js
Tags: javascript, nextjs, webdev, security
Published: 2022-03-07 22:53:29

Cross-Site Request Forgery (CSRF) is an attack that forces authenticated users to submit a request to a Web application against which they are currently authenticated.

It ensures the authenticity of your requests.

We will use a popular npm package to handle CSRF called [csurf](https://github.com/expressjs/csurf).


Because csurf is express middleware, and there is no easy way to include express middlewares in next.js applications we have two options.

1- Create custom express server and use the middleware, check [this link](https://github.com/vercel/next.js/tree/canary/examples/custom-server-express)
2- Connect express middleware, we will follow this method, more details in [next.js docs](https://nextjs.org/docs/api-routes/api-middlewares#connectexpress-middleware-support)

we will create new file `/src/csrf.js`

```javascript
import csurf from 'csurf'

// Helper method to wait for a middleware to execute before continuing
// And to throw an error when an error happens in a middleware
export function csrf(req, res) {
	return new Promise((resolve, reject) => {
		csurf({ cookie: true })(req, res, (result) => {
			if (result instanceof Error) {
				return reject(result)
			}
			return resolve(result)
		})
	})
}

export default csrf
```

Now we have two steps to implement this,

1- Make sure the API is protected by CSRF token.

Lets take the default API route that comes with initial next.js project "hello.js", to include the middleware we need to do the following
```javascript
import csrf from "../../src/csrf";
export default async function handler(req, res) {
  await csrf(req, res);
  res.status(200).json({ name: 'John Doe' })
}
```

This way we are protecting this route with CSRF token

2- Expose this token to the react page so it can be sent with the requests.

To get the token

```javascript
export async function getServerSideProps(context) {
	const { req, res } = context
	await csrf(req, res)
	return {
		props: { csrfToken: req.csrfToken() },
	}
}
```

Now on the next API call to hello.js we need to include the token in the header, here I used axios but you can use fetch as well

```javascript
axios.post('http://localhost:3000/api/hello', {}, {headers:{'CSRF-Token': csrfToken}})
    .then(res=>console.log({data: res.data}))
```

And that's it, Now you are protected against CSRF attacks

Note that you can add more options to your cookie like make it HttpOnly and change the key name, check the library docs for more details.
Jaf - Deploy Jupyter Notebook as an Azure Function
Tags: azuretrialhack, jupyter, serverless, datascience
Published: 2022-03-07 22:50:56

[Instructions]: # (To submit to the Microsoft Azure Trial Hackathon on DEV, please fill out all sections.)


### Overview of My Submission
[Note]: # (Please make sure the project links to the appropriate GitHub repository, and includes the [Apache-2 permissive license](https://www.apache.org/licenses/LICENSE-2.0)  and README.)

jaf stands for Jupyter notebook as functions.
jaf skaffolds an Azure Duration Function project to enable a jupyter notebook be deployed as a web endpoint.

Jupyter notebooks are widely used as interactive programming environment to experiment data science and machine learning ideas. However, going from development to deployment once a notebook is drafted is extremely hard. The process usually involves an engineer to rewrite significant portion of the jupyter notebook as a web/rpc service in order to make the model/procedure written in the notebook to be callable to other services.

With jaf, you can quickly spin up a web service that makes the jupyter notebook as a callable function, thus expediting greatly the speed to come from dev to deployment for data science solutions.


### Submission Category: 

[Note]: # (AI Aces, Computing Captains, Low-Code Legends, Java Jackpot, or Wacky Wildcards:)
Wacky Wildcards


### Link to Code on GitHub

[Note]: # (Our markdown editor supports pretty embeds. Try this syntax: `{% github link_to_your_repo %}` to share a GitHub repository)
[Note]: # (Your repository must include a README)
[Note]: # (You must use and list a permissive license for your code: MIT, Apache-2)
{% github yuhuishi-convect/jaf %}


### Additional Resources / Info

[Note:] # Screenshots/demo videos are encouraged!

[Note]: # (Be sure to include the DEV usernames of your collaborators, if any. Prizes for winning projects with multiple collaborators will be sent to the person who posts this submission and they will distribute the prize evenly. DEV will not split prizes as per our rules)

[Reminder]: # (Submissions are due on March 8, 2022 @ 11:59 PM UTC)


<a href="https://www.loom.com/share/e26b21e1b5b94e589a274faf77863d4a"> Demo video:  </a>

    <img style="max-width:300px;" src="https://cdn.loom.com/sessions/thumbnails/e26b21e1b5b94e589a274faf77863d4a-with-play.gif">
5 motivos para participar da Imersão Dev da Alura (gratuita)
Tags: imersãodev, dev, webdev, html
Published: 2022-03-07 22:49:39

---
title: 5 motivos para participar da Imersão Dev da Alura (gratuita)
published: true
description: 
tags: #imersãodev #dev #webdev #html
//cover_image: https://direct_url_to_image.jpg
---
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1iccmt1ygekw8z0par1g.png)

**[imersao.dev] (https://imersao.dev)**

### 1. É pra todo mundo
De iniciante à dev experiente, todos aproveitam

### 2. Criar projetos
Durante a imersão você vai ter a oportunidade de criar projetos que vão agregar experiências e histórias para você contar em uma entrevista, ou na mesa do bar rsrs

### 3. Variedade
Já teve imersões de diversos temas como html, css, react e games.

### 4. Comunidade
Tem um Discord exclusivo pra ajudar e pedir ajuda.

### 5. É de graça!

Esta acontecendo nesse momento uma edição da Imersão Dev
acesse **[imersao.dev] (https://imersao.dev)** e se inscreva. Essa é uma ótima maneira de iniciar na área ou conhecer melhor a área. Só vamos.
NGINX Ingress on Kubernetes
Tags: kubernetes, ingress, nginx
Published: 2022-03-07 22:41:21

---
title: NGINX Ingress on Kubernetes 
published: true
description: 
tags: kubernetes,ingress,nginx
//cover_image: https://direct_url_to_image.jpg
---

# NGINX Ingress on Kubernetes

https://www.nginx.com/products/nginx/kubernetes-ingress-controller/

>By default, pods of Kubernetes services are not accessible from the external network, but only by other pods within the Kubernetes cluster. Kubernetes has a built‑in configuration for HTTP load balancing, called Ingress, that defines rules for external connectivity to Kubernetes services. 

The Ingress **controller** can then automatically program a frontend load balancer to enable Ingress configuration. The NGINX Ingress Controller for Kubernetes is what enables Kubernetes to configure NGINX and NGINX Plus for load balancing Kubernetes services.

### Deploy Ingress NGINX

https://kubernetes.github.io/ingress-nginx/deploy/

First, we'll need to initialize our user as a cluster-admin with the following command:

```
kubectl create clusterrolebinding cluster-admin-binding \
  --clusterrole cluster-admin \
  --user $(gcloud config get-value account)
```

Now we can deploy to our cluster via:

`kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/mandatory.yaml`

Running a check on the service might show a Pending status:

```
alexvallejo:showcase-mde$ kubectl get pods -n ingress-nginx
NAME                                        READY   STATUS    RESTARTS   AGE
nginx-ingress-controller-7b887b65b7-d99kh   0/1     Pending   0          22m
```

Quick Google search shows a potential fix that should address that:

https://github.com/kubernetes/ingress-nginx/issues/4775#issuecomment-558381452

`kubectl label node --all kubernetes.io/os=linux`

https://blog.rcmmd.com/www-to-non-www-with-kubernetes/

To the Ingress service yml:

```yaml
annotations:
      nginx.ingress.kubernetes.io/ssl-redirect: 'true'

      // this is the required part
      nginx.ingress.kubernetes.io/from-to-www-redirect: 'true'
```

More Resources:

https://devopscube.com/setup-ingress-kubernetes-nginx-controller/

https://cloud.google.com/community/tutorials/nginx-ingress-gke

https://medium.com/google-cloud/setting-up-google-cloud-with-kubernetes-nginx-ingress-and-lets-encrypt-certmanager-bf134b7e406e

https://stackoverflow.com/questions/48763805/does-gke-support-nginx-ingress-with-static-ip
Web3. Explained in very simple terms. (and how to get into it)
Published: 2022-03-07 22:34:13

ower these independent bodies have and should have. Last year, the then president of the United States was banned from twitter. This shows that at any point, the companies and institutions that safeguard our data could simply decide to delete it or sell it.

If you’re like me and that bothers you a bit, I have some good news for you. Web3 fixes this. How you might ask? 

Well, web3 is the name given to the new technology that will change the way we use the internet. Unlike web2, web 3 is decentralized meaning like Buhari, it simultaneously belongs to everyone and no one. There is no single point of failure because there is no single point of storage. For example, when you make a transaction instead of being recorded on a single database on a single server, a distributed ledger is used and everyone on that network has a copy of that database where that transaction is recorded.
 
Web3 is still in its infancy stage and due to a partnership between [Zuriteam](https://zuri.team/) and [Nestcoin](https://nestcoin.com/), [Blockgames](https://blockgames.gg/) is training beginners and experts in the way of the web3.