teleren/devto huggingface dataset:
3. Configuring GitHub pages to deploy your website
Tags: webdev, tutorial, github, ghpages
Published: 2022-05-24 03:54:18

It's been a lengthy process since you took the initial step in this series by obtaining a custom domain. You may read the article [here](https://dev.to/awalakaushik/1-purchasing-a-custom-domain-from-a-provider-google-domains-godaddy-etc-325i), if you missed it.

In this article, you'll look at how to configure your GitHub repository to host your project on your custom domain using GitHub Pages.

To configure GitHub pages, follow the instructions below. More on GitHub Pages can be found [here](https://docs.github.com/en/pages). You may learn how to set up a custom domain [here](https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site/about-custom-domains-and-github-pages).

## Configuration Steps
1. Go to your repository settings page and click `Pages` under `Code and automation.`
![config steps](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/80sgu5y5kph76nqozqvx.png)
2. To begin building your website with GitHub Pages, choose your source branch. I'm using a new branch called `deployment` for this. Many tutorials you'll find on the internet use the branch name `gh-pages.`
3. You can enter the subdomain `www.<your-domain-name>.<domain-name-ending>` in the `custom domain` area.
`www.testsite.net,` for example.
4. Make sure HTTPS is enabled on your domain to offer a layer of encryption that prevents tampering with traffic to your site. Your website will only be served via HTTPS if this is enforced. More details can be found [here](https://docs.github.com/articles/securing-your-github-pages-site-with-https).

Okay, we're finished with the GitHub configuration. Then, follow the steps below to configure your DNS settings in Google Domains.

**Note**: If you used a different domain provider, make sure to configure your DNS records for your website according to the instructions provided by your DNS provider.

## Configuring DNS records on Google Domains
1. To manage your custom domain, log in to your Google Domains account.
2. Select DNS from the left menu to access the DNS settings page, where you can configure custom records for GitHub pages.
![dns records](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4hy7qg8f703o5wlew3zg.png)
3. Create a CNAME record for your subdomain that points to your GitHub pages.
For example,
```
Host name: www.testsite.com
Type: CNAME
Data: <your-username>.github.io.
```
4. Create an A Name record for your apex-domain that points to your github pages.
For example,
```
Host name: testsite.com
Type: A
Data: 185.199.111.153
```
5. Return to GitHub to validate your custom domain. If everything goes well, you should see the following.
![google domains](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hcquxs4y6d262rwr5ru5.png)
![github page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tza8vwplnay69l8go7gz.png)

Alright then, let us move on to the final step to automate your deployment, [here](https://dev.to/awalakaushik/4-automating-your-projects-deployment-procedure-46b1).
Copilot Code Pipeline Build Stage Trouble Shooting
Published: 2022-05-24 03:50:05

Pipeline Build Stage Failed (Using Copilot Platform linux/arm64)

해당 에러는 Copilot Platform이 linux/arm64이며, manifest.yml + buildspec.yml 파일을 수정하지 않았을 경우 발생합니다.

Copilot pipelien init를 하여 생성된 manifest.yml + buildspeec.yml 파일의 빌드 이미지는 arm64기반의 이미지가 아니라 일반 linux 기반의 이미지이기 때문에 설정을 통해 arm64 이미지로 맞춰주어야 합니다.

맞춰주지 않게 되면 아래와 같이 resources upload 에러가 발생합니다.
```
✘ upload resources required for deployment for copilot: build and push image: build Dockerfile at /codebuild/output/path/Dockerfile: building image: exit status 1
Cloudformation stack and config files were not generated. Please check build logs to see if there was a manifest validation error.
```

해결 방법은 위에서 말했던거처럼 manifest.yml과 buildspec.yml의 빌드 이미지를 arm64로 맞춰주면 됩니다.

먼저 manifest.yml 파일에 (source와 stages 사이에)
```
build:
  image: aws/codebuild/amazonlinux2-aarch64-standard:2.0
```
코드를 추가해 빌드 이미지를 설정해줍니다.

buildspec.yml 파일에 기존 아래와 같이 작성되어있는 부분을 변경해줍니다. 이렇게 작성 후 새로 빌드를 실행하게되면 빌드가 정상 작동하는것을 확인할 수 있습니다.
```
- wget -q https://ecs-cli-v2-release.s3.amazonaws.com/copilot-linux-v1.18.0
- mv ./copilot-linux-v1.18.0 ./copilot-linux
```
```
- wget -q https://ecs-cli-v2-release.s3.amazonaws.com/copilot-linux-arm64-v1.18.0
- mv ./copilot-linux-arm64-v1.18.0 ./copilot-linux
```

![Copilot Code Pipeline Build Success Image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ytz0ku6oy0276xtino9m.png)

참고. [github issue](https://github.com/aws/copilot-cli/issues/3158), [github pr](https://github.com/aws/copilot-cli/pull/3190/files)

번외
```
[Container] 2022/05/16 02:38:00 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: for env in $pl_envs; do
  tag=$(sed 's/:/-/g' <<<"${CODEBUILD_BUILD_ID##*:}-${env}" | rev | cut -c 1-128 | rev)
  for svc in $svcs; do
  ./copilot-linux svc package -n $svc -e $env --output-dir './infrastructure' --tag $tag --upload-assets;
  if [ $? -ne 0 ]; then
    echo "Cloudformation stack and config files were not generated. Please check build logs to see if there was a manifest validation error." 1>&2;
    exit 1;
```

로그를 보다보면 이런 에러가 붉은 글씨로 떠있어서 해당 에러 메세지를 보면서 어떤 에러인지 유추 하였는데 이부분을 볼 필요가 없었습니다... 살짝만 위로 올려보면 위에 작성한것 처럼 명확한 에러를 보여주는....T^T
Learn about open source and how to contribute
Tags: opensource, javascript, react, discuss
Published: 2022-05-24 03:47:31



A Open source software is a way of develop free software, from libraries or modules to an entire product. Is available to everyone and all can contribute this is and incredible tool because if you got the idea but you don’t have all the knowledge other people who got the skills can help you.

A lot of developers and companies collaborates on open source projects because it helps them to debug issues more easier or to make the software more secure and to add more features.

### A Big example of open source project: React

React is an open source UI library built by Facebook (nowadays Meta)  currently is the most popular javascript tool used on industry. Is well known that React has been mantained and updated by his  community which is one of the biggest at open source projects, but there’s still bugs and fixes to work on.  

Is very important to know that all the open source projects got their own community guidelines and there’s a way to contribute. In case of React it follows semantic versioning releasing patch versions when critical bug fixes exists.

### But how can I contribute?

One of the first things that you need to have in order to contribute on open source projects is to have a Github account. Then, you can start looking for an open source project and based on your skills you can choose the one to contribute. 

Setting up the environment to be able to work with the technology you choose is very important, after that you can start looking for issues and when you think you got the solution you can ask one of the contributors to assign you that issue. 

Finally you have to submit a pull request and it will be reviewed by the owners and tested until they know it works fine.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wyj6qu6bznxnuvzzzajo.jpeg)### What’s open source?
Ethernaut系列-Level 11(Elevator)
Published: 2022-05-24 03:32:15

## LEVEL 11 （Elevator）:
```solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;

interface Building {
  function isLastFloor(uint) external returns (bool);
}


contract Elevator {
  bool public top;
  uint public floor;

  function goTo(uint _floor) public {
    Building building = Building(msg.sender);

    if (! building.isLastFloor(_floor)) {
      floor = _floor;
      top = building.isLastFloor(floor);
    }
  }
}
```
## 通关要求
  top=true

##要点
  逻辑错误，设置top不能再调用外部

##解题思路
isLastFloor第一次返回false,第二次返回true
contracts/11Elevator.sol
```solidity
    bool firstCallLastFloor = true;

    function run(address _levelAddress) external {     
        ILevel(_levelAddress).goTo(1);
    }
    
    function isLastFloor(uint _floor) external returns (bool) {
        if (firstCallLastFloor){
            firstCallLastFloor = false;
            return false;
        }else{
            return true;
        }
    }
```
check telegram invitation link
Tags: telegram, api
Published: 2022-05-24 03:23:53

I'm looking for an api, just for a simple action to check if a provided invitation link(group, Chanel, private chat) is valid or not. I'm using perl and there is no sdk for perl, any suggestion?
for example this link should be invalid: [https://t.me/+tUvbvmkO1pGe82ODM8](https://t.me/+tUvbvmkO1pGe82ODM8)
Enable Access to http://localhost For Development
Tags: webdev
Published: 2022-05-24 03:17:32

---
title: Enable Access to http://localhost For Development
published: true
date: 2022-05-24 03:14:15 UTC
tags: WebDev
canonical_url: https://jamienordmeyer.net/2022/05/23/enable-access-to-http-localhost-for-development/
---

I will forget this if I don’t get it written down, and I’m hoping that someone else will find this useful as well. If you’re having trouble accessing http://localhost from your development machine (for instance, http://locahost:4200 when starting an Angular application), you can do the following, at least for the Edge and Chrome browsers.

Open your Edge or Chrome browser, and go to edge://net-internals/#hsts or chrome://net-internals/#hsts, as applicable. At the very bottom (at least at the time of this writing), you’ll find a section called `Delete domain security policies`. Here, enter `localhost` into the Domain box, then click on the Delete button. You should now be able to access localhost from http on your development machine.
Deploy your website using GitHub pages and Google domains
Tags: webdev, deploy, programming, portfolio
Published: 2022-05-24 03:05:01

Most challenges in a developer's life become easier with repetition because automation is available to assist.

Many, if not all, of you may have considered creating and publishing your portfolio but did not proceed due to the numerous challenges involved in successfully deploying your website.

You've come to the right place if you want to introduce yourself to the world through your portfolio.

In this series, we will look at the following topics in detail:

1. [Getting a custom domain from a service provider (Google Domains, GoDaddy, etc.)](https://dev.to/awalakaushik/1-purchasing-a-custom-domain-from-a-provider-google-domains-godaddy-etc-325i)
2. [Setting up your git repository](https://dev.to/awalakaushik/2-setting-up-your-git-repository-5509)
3. [Configuring GitHub Pages to deploy your website](https://dev.to/awalakaushik/3-configuring-github-pages-to-deploy-your-website-29ic)
4. [Automating your project's deployment procedure](https://dev.to/awalakaushik/4-automating-your-projects-deployment-procedure-46b1)
1. Purchasing a custom domain from a provider (Google Domains, GoDaddy, etc.)
Tags: domain, purchase, webdev, tutorial
Published: 2022-05-24 02:57:31

Domain names serve as aliases for IP addresses, making it easier to remember the website name rather than the string of digits in an IP address.

Today, we'll look at how to purchase a custom domain. Despite the fact that there are numerous providers on the market, today we will look at how to buy a custom domain on Google Domains.

You can select from over 300 domain endings and benefit from a real-person 24/7 support team. It's great to have Google's power behind your domain! Isn't that interesting? Let's get started.

You can find out more about Google Domains [here](https://domains.google/).

When you arrive at the website, you can sign in with your credentials by clicking the "Sign In" button or go straight to the domain search, as shown below.

In either case, you must sign in to be able to associate and manage the purchased domain.

## Searching for your domain

![Google Domains Search](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zizzah549a60apmnc16z.png)

## Viewing and sorting your search results
Following your domain search, you will be presented with a list of options to choose from; refine your search list using the provided filters. When you've found the perfect domain, add it to your cart and proceed to the checkout process.

![Google Domains Search List](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/coiv5xqrylzbjcg0le5j.png)
By clicking on the domain row, you can also view more information about the domain.

![Google domain insights](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6kpruzc7lzn60qyb3t3m.png)


## Checkout to purchase your desired domain
The next step is to add one or more domains to your cart and complete the checkout process. Use the add to cart button to add your preferred domains to your cart.

![Google Domains Add to Cart](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hwu5efoqxrddkykat8it.png)

Following the addition of your custom domain to your cart, you will be given further options to configure or add to your domain, such as Google Workspace, as shown below.

![Google domains checkout](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jcfpl0cz4khm4ys3oyyt.png)

Once you've opted to buy your domain, you'll be directed to the payment stage to complete your purchase, or you'll be requested to sign in first before being moved to the payment stage to complete your purchase.

## Viewing your purchased domain(s) associated with your google account

After you've finished purchasing your custom domain, go to "My domains" to see it.

![Google domains view my domains](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0tvsc0uooqusrzbmq39t.png)

You have now completed the process of purchasing a custom domain name.

Let us move to the [Step 2](https://dev.to/awalakaushik/2-setting-up-your-git-repository-5509) where we will see how to setup your GitHub repository.
Print left view of binary tree
Tags: javascript, programming, algorithms
Published: 2022-05-24 02:40:50

```
class Node{
  constructor(data,left,right){
    this.data=data;
    this.left=left;
    this.right=right;
  }
}

const tree=new Node(10);
tree.left=new Node(1)
tree.right=new Node(3)
tree.left.left=new Node(4)
tree.left.right=new Node(5)
tree.right.right=new Node(6)
tree.right.left=new Node(2);
tree.right.right.left=new Node(7)
tree.left.right.left=new Node(8)
tree.left.right.right=new Node(9)
tree.left.right.left.left=new Node(10);

let max_level=0;
function leftsideView(node,level){
  if(node==null){
    return null;
  }
  if(max_level<level){
    console.log(node.data)
    max_level=level;
  }
  leftsideView(node.left,level+1);
  leftsideView(node.right,level+1);
}
leftsideView(tree,1)
```
Nested subcommands in Rest with clap
Tags: rust, cli, clap
Published: 2022-05-24 02:13:52

---
title: Nested subcommands in Rest with clap
published: true
description: An example of how to create nasted sub commands in a Rust CLI app using clap
tags: rust, cli, clap
//cover_image: https://direct_url_to_image.jpg
---

I apologize for the brief post, but it's late and I spent too much time figuring this out to not share. Hope it helps someone!

Edit: I have no ideas why repl.it won't find the traits and compile. I swear it works in real life. Suggestions for fixing the example are welcome!

{% replit @drazisil/Nested-subcommand-in-Relp-with-clap %}
Kubernetes Throttling
Tags: sysadmin
Published: 2022-05-24 02:03:27

If you are using CPU cap on your Kubernetes, you may be experiencing performance loss, it seems like CPU limit may cause k8s to do CPU throttling, you can use this open source APM called Netdata to analyze usage CPU of all your k8s containers, you can see more details in this link

https://www.netdata.cloud/blog/kubernetes-throttling-doesnt-have-to-suck-let-us-help/
BubbleSort en Typescript
Tags: typescript, sort, bubblesort, typescriptadvanced
Published: 2022-05-24 01:20:20

![BubbleSort in Javascript](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/02vav0lo1x6bwkwuo5af.png)
 

**NAMESPACES**

Se crea el `namespace MathUtils` con los distintos types auxiliares para el método BubbleSort:

![Num, Length, Push NTuple and Add types](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b7b1s9g11cxk6pix3scx.png)

En el caso de la resta importa el orden en que se reciben los paramentos, por este motivo el primer parámetro debe ser mayor o igual que el segundo: 
![Substract type](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g4kwss7dvldqb75cncd3.png)
 

Si queremos comparar 2 números en Typescript, los símbolos "<" y
">" no son validos
`type isMinor = 1 > 2 ? true : false;`
por este motivo vamos a crear el `type GreaterComparison`
![Type GreatComparison](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zbarmaw9gjtmdmjb3r93.png)
 

**_BUBBLE SORT_**
Ayudándonos del `namespace MathUtils` definido anteriormente procedemos a definir el `type BubbleSort` el cual recibe un array como primer parámetro y una variable auxiliar "actual".
Si el array tiene un solo elemento se retorna el mismo array.

Caso contrario extendemos un array en el que se infieren 3 elementos, los números a comparar y lo que queda del resto.

Se llama recursivamente al `type BubbleSort`.

![Bubble Sort Method](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q64pnd87cpgq1dwh9fno.png)

```
type example1 = BubbleSort<[234, 43, 55, 63, 5, 6, 235, 547]>;
// [ 5, 6, 43, 55, 63, 234, 235, 547]
type example2 = BubbleSort<[5, 2, 4, 6, 1, 3]>;
// [1, 2, 3, 4, 5, 6]
type example3 = BubbleSort<[1]>;
// [1]
type example4 = BubbleSort<[]>;
// []
```
¿Qué es JavaScript?
Tags: javascript
Published: 2022-05-24 01:18:46

JavaScript es un robusto lenguaje de programación que se puede aplicar a un documento HTML y usarse para crear interactividad dinámica en los sitios web.
JavaScript por sí solo es bastante compacto aunque muy flexible, y los desarrolladores han escrito gran cantidad de herramientas encima del núcleo del lenguaje JavaScript, desbloqueando una gran cantidad de funcionalidad adicional con un mínimo esfuerzo. Esto incluye:

- Interfaces de Programación de Aplicaciones del Navegador (APIs). APIs construidas dentro de los navegadores que ofrecen funcionalidades como crear dinámicamente contenido HTML y establecer estilos CSS, hasta capturar y manipular un vídeo desde la cámara web del usuario, o generar gráficos 3D y muestras de sonido.

- APIs de terceros, que permiten a los desarrolladores incorporar funcionalidades en sus sitios de otros proveedores de contenidos como Twitter o Facebook.

- Marcos de trabajo y librerías de terceros que puedes aplicar a tu HTML para que puedas construir y publicar rápidamente sitios y aplicaciones.
Como configurar mais de um profile no AWS CLI
Tags: aws, womenintech, braziliandevs
Published: 2022-05-24 01:18:46

Após a instalação do AWS CLI na sua máquina Linux, você precisa configurar o seu perfil para poder interagir com a AWS.
Caso haja a necessidade de você ter mais de uma conta numa mesma máquina, você pode sim configurar alguns profiles!

O que precisamos fazer, é basicamente criar nomes para cada um profile que você precisar.
Por padrão temos o profile default e você pode optar por usa-ló ou não. Nesse caso você pode nomear todos os profiles que tiver.

Porém, caso você queira configurar o profile default, execute o comando e aperte enter: 


```
$ aws configure
```


Após, apareceram algumas perguntas que precisam ser respondidas.
Segue:

```
> AWS Access Key ID [None]: ~~IAM-USUARIOS-CREDENCIAISDESEGURANCA~~
> AWS Secret Access Key [None]: ~~VISIVEL-NO-CSV~~
> Default region name [None]: us-east-1
> Default output format [None]: json
```

Pronto, configurado o default, podemos criar outros profiles. Dessa vez vamos passar o parâmetro `--profile` seguido do nome que escolhemos para ele, exemplo:


```
$ aws configure --profile nome_profile
```


Onde _nome_profile_ é o identificador desse profile na sua máquina. Após apertar enter as mesmas perguntas serão feitas:


```
> AWS Access Key ID [None]: ~~IAM-USUARIOS-CREDENCIAISDESEGURANCA~~
> AWS Secret Access Key [None]: ~~VISIVEL-NO-CSV~~
> Default region name [None]: us-east-1
> Default output format [None]: json
```

Se caso precisar incluir outros perfis, repita o comando com o _nome_profile_ e as informações pertencentes a conta.

Caso você precise verificar/alterar essas entradas, você pode acessar os arquivos de configuração em:
> code ~/.aws/credentials

> code ~/.aws/config

Pode usar o editor que preferir, eu sempre abro com o vscode :)

Lá você encontra 2 arquivos: **config** e **credentials**

Você pode também fazer alguma alteração através desses arquivos.

Para testar, você pode executar o comando a seguir que te trás a listagem de arquivos no s3.


```
$ aws s3 ls --profile nome_profile
```
Lógica que calculasse a média de três notas - C++
Tags: programming, tutorial, help
Published: 2022-05-24 01:18:34


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

Em um programa desenvolvido na Linguagem C, foi solicitado que o desenvolvedor criasse uma lógica que calculasse a média de três notas e, logo após, indicasse ao usuário se o aluno foi reprovado (média abaixo de 5), se ficou em recuperação (média entre 5 e 6.9) ou aprovado (acima de 7). Entretanto, o usuário acusa que o programa está com problema, pois ao digitar as três notas, o valor da média se for abaixo de 7 mostra na tela o status errado.

Observe o código desenvolvido pelo programador e aponte em que linhas podem conter os erros que estejam mostrando o status errado, justificando o erro. Logo após a identificação das linhas e justificativa do erro indique qual a correção que deverá ser feita no código para que o cálculo fique correto.
 
Estarei mostrando o código original e posteriormente o código em que eu reformulei para testar e aparentemente funcionou. Gostaria de uma validação se é possível fazer desta forma.

Código Modificado: 


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6huum8zxoiprbwyl6alb.png)
Programando em C++
Tags: programming, tutorial, help
Published: 2022-05-24 01:17:09

Faça o algortimo ler uma séria de N marcações em litros, mostrando na tela o maior valor em metro cúbico;

Imagine que você mora em um prédio onde contém diversos apartamentos, e na reunião de condomínio houve uma reclamação por parte dos moradores do gasto excessivo de água, fazendo assim que o custo do condomínio aumentasse. Para isso é preciso identificar o apartamento que mais consumiu para que possa verificar se foi algum vazamento ou outra situação parecida.

Para resolver o problema você se prontificou a criar um algoritmo onde irá ler N marcações de quantidade de litros de água de cada apartamento, no final da leitura deverá mostrar na tela o valor mais alto em metros cúbicos de água que foi consumido.

Onde:

Cada 1000 litros de água representa 1 metro cúbico; O que entregar? Faça o algortimo ler uma séria de N marcações em litros, mostrando na tela o maior valor em metro cúbico;

Neste caso: N - representa a quantidade de vezes que será inserido uma marcação de litros gasto, ou seja a quantidade de apartamentos, essa informação deverá ser lida pelo algoritmo.

**Preciso fazer isto em Portugol, alguém poderia me auxiliar?**
My first attempt at using HashiCorp Vault (inc. C# Client Library)
Published: 2022-05-24 00:43:23

So it's here:
- [https://github.com/kibblewhite/HashiVaultCs](https://github.com/kibblewhite/HashiVaultCs)

It's for my own education, although I may end up using the very limited features in production as it is all that I need.

I wrote my own documentation for it, for getting started with Vault.
- [https://www.vaultproject.io/](https://www.vaultproject.io/)

That is all, thank you very much.