teleren/devto huggingface dataset:
curl: la navaja suiza de los protocolos de Internet
Tags: tip, software, cli
Published: 2021-02-03 17:32:51

---
title: "curl: la navaja suiza de los protocolos de Internet"
published: true
tags: ['tip', 'software', 'cli']
canonical_url: https://marceloandrader.github.io/blog/2021/02/03/curl-la-navaja-suiza-de-los-protocolos-de-internet/
---

Una de las herramientas que más uso en el día a día es [curl](https://curl.se/), es muy versátil y soporta una gran cantidad de protocolos, los que más uso son solo http y https, pero tiene soporte para los siguientes protocolos de acuerdo a su página web DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET and TFTP.

Básicamente con esta herramienta puedes ejecutar peticiones HTTP/s, subir o bajar archivos vía ftp, scp, sftp, enviar emails vía smtp, leer bandejas de correo vía pop3 o imap, administrar directorios LDAP entre otros.

Pero la acción que uso con mayor frecuencia es mientras creo alguna app en el browser, es abrir las herramientas de desarrollador, pestaña de Red, seleccionar un request y click derecha **copiar como cURL** esto ayuda bastante si estás depurando una petición web específica o una petición ajax. Esto me permite aislar esa petición llamándola desde la línea de comandos, es decir pegando el comando copiado desde el browser en un terminal.

Si la petición es json se puede usar en conjunto con [jq]({{< ref "posts/2021-01-27-formatear-y-convertir-json-al-vuelo-con-jq.md" >}}) o si es xml con [xq](https://github.com/jeffbr13/xq) o [hq](https://github.com/rbwinslow/hq) si es html.

Para obtener más información, se puede encontrar los parámetros de cada protocolo digitando

```
curl --help http
curl --help smtp
curl --help sftp
curl --help imap
```
[Tips] Rails6起動時のError対応
Published: 2021-02-03 17:13:02

### Errorの対処
localへrailsを入れただけでは、以下のエラーが出てしまった為、起動までのステップを備忘として載せる。

```
cannot load such file -- nokogiri/nokogiri (LoadError)
```
上記の対応としては、arm64版のモジュールが不必要に入っていることによって、エラーが起きていた為。一旦それを解消する。

①一旦nokogiriをアンインストール。

②Gemfileにgem 'nokogiri', '~> 最新版'を記載
> https://github.com/sparklemotion/nokogiri/releases

③nokogiri (1.11.1-arm64-darwin)をGemfile.lockから削除

④gem install nokogiri

上記の問題はこれで解消したが、それだけではwebpackerのエラーが発生するため。
```
 Webpacker configuration file not found
```
⑤rails webpacker:install

上記を行うことによって解消され、ひとまず起動。
Android developer roadmap
Tags: android, mobile
Published: 2021-02-03 17:12:56

[Interactive roadmap for android developer](https://infinite.education/expertise/Android_Developer_2021)

Sorry, dev.to has image limitation to 4096 pixels, so image quality is so-so
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/b7ypib1yfo0ziamb6961.png)
What Matters in a Conditional Cloud
Tags: azure, aws, cloud
Published: 2021-02-03 17:11:27

The cloud is becoming even more conditional.  We know the cloud is programmable.  This is exactly why it is very flexible.  The conditional cloud is a hot topic because it is showing up in more than one way.  Here are exactly two examples of the conditional cloud:

###Conditional Access - Machine Learning###

A single mobile user accesses three private applications over the Internet.  The three applications are hosted in a private data center with an excellent source of carbon-free energy.  Azure AD conditionally grants access each time the user accesses any of the mobile applications.  For example, Azure's machine learning considers the user, location, device, and real-time risks.  Conditionally, the user may just get the web page.  Or, conditionally, the user may be asked to authenticate a second time, like a re-certification.  The decision is up to the cloud. [learn more here](https://docs.microsoft.com/en-us/azure/active-directory/conditional-access/overview)

###Conditional Access - Rules Based###

A single developer has a closed serverless application limited to an exact number of accounts.  Each exact account number is listed in the S3 Bucket resource policy. It is a stated condition. The AWS Serverless Repository grants a user access to the application only when the user's deployment passes the condition where the SourceAccount number is in the list. [learn more here](https://docs.aws.amazon.com/serverlessrepo/latest/devguide/serverlessrepo-how-to-publish.html#publishing-application-through-aws-console)

###What matters is up to you###

Don't forget time-based conditional access.  Sometimes temporary access is a stated condition.  Like for a hotfix that comes up in an emergency. One person may just need a few hours of access to a single exact machine in the cloud.  To keep it safe, a person can write one Common Expression Language statement in a Google Policy restricting access by the request time. The condition is the time. [learn more here](https://cloud.google.com/iam/docs/reference/rest/v1/Policy)

###Identity Matters###

Conditions look fine-grained.  The conditions consider identity.  Nobody wants to look over a user's shoulders.  Please let me emphasize the conditional cloud is intended to make the cloud safer.  How the cloud exactly does this for us, either machine learning or rules-based, is a hot topic.  Any comments?
Cypress Tip: Get the Cypress Dashboard App

Tags: javascript, testing
Published: 2021-02-03 17:04:36

If you're familiar with the [Cypress Dashboard](https://www.cypress.io/dashboard), you might immediately suspect that I'm clickbaiting you, but stay with me!

In Chrome, [there's a way](https://support.google.com/chrome_webstore/answer/3060053?hl=en) to add shortcuts to ordinary sites (like dashboard.cypress.io) as "apps". Firefox calls these "site-specific browsers" but sadly they're [dropping](https://9to5google.com/2021/01/27/firefox-discontinues-work-pwa-desktop/) SSB and PWA support, while other Chromium-based browsers are making it more of a mainstay. Edge on Windows supports this feature and will [soon](https://9to5google.com/2020/12/23/chrome-windows-web-app-uninstall-integration/) allow you to manage/uninstall those apps just like native ones. 

Why would we do this? If you're like me, you check on runs frequently throughout the day. You also have a lot of apps and Chrome tabs - like the dashboard - open (because you're uber-productive). Hunting around for the dashboard either takes longer than it should or you have to navigate there every time.

Do this now (trust me): 
1.  Open the Cypress Dashboard in Chrome
2.  At the top right, click More (⋮) 
3.  Click **More Tools**
4.  Click  **Create shortcut**
5.  Input **Cypress Dashboard** as the name for the shortcut
6. Check the **Open as window** checkbox
7. Click  **Create**

Now getting to the Cypress Dashboard is as easy as opening and switching apps!

If you're not familiar with the Dashboard or if you haven't used it in a while, I suggest giving it a try - at least on the free tier. Check out the  [FAQ](https://docs.cypress.io/faq/questions/dashboard-faq.html) if you have a question. Cypress has been making a ton of improvements on it as of late (and  [more](https://portal.productboard.com/cypress-io/1-cypress-dashboard/tabs/1-under-consideration) on the way), so it's a worthy investment. I love it!
Cypress Tip: In-Spec Functions
Tags: javascript, testing
Published: 2021-02-03 17:00:04

Let's imagine you have a bunch of repeatable code in your tests:

```javascript
it('should do this thing', () => {
  // ...
  cy.get('#thisElement')
    .then($el => {
      // some unusual hackery here
    })
  // ...
})
it('should do that thing', () => {
  // ...
  cy.get('#thatElement')
    .then($el => {
      // some unusual hackery here
    })
  // ...
})
it('should do another thing', () => {
  // ...
  cy.get('#anotherElement')
    .then($el => {
      // some unusual hackery here
    })
  // ...
})
```
What a mess, right? You might be tempted to immediately break this out into a custom command...

```javascript
it('should do this thing', () => {
  // ...
  cy.get('#thisElement')
	.doSomething()
  // ...
})
```
...but it's not necessarily the best solution for a number of reasons. The alternative? I'm calling it an **in-spec function**. It's an abstraction in the form of a hoisted function contained in the spec file:

```javascript
describe('some feature', () => {
  it('should do this thing', () => {
    // ...
	cy.get('#thisElement')
	  .then(doSomething)
	// ...
  })
	// ...
})
function doSomething($el) {
  // some unusual hackery here
}
```

Here's why you might want to use an in-spec function: 

 1. Like an abstraction into a custom command, this will make your tests much easier to reason about, but if it's only required in a single spec, why bother with a command when you can use plain JavaScript?
 
 2. It's hoisted from the bottom so that it's out of the way, but because it's in the spec, it's easier to access in the event you need to debug, update or refactor it. 
 
 3. If you need this function outside the spec, it's likely easier to prototype it as an in-spec function first. Then when it's working the way you want, you can convert it to a command.
Write a Unit Test for your JavaScript (video)
Tags: javascript, testing, tutorial, testdev
Published: 2021-02-03 16:50:01

In this video I show you how to write your first unit test using Mocha and Chai. Mocha is a popular testing framework that we will be using for this video, along with Chai which is an assertion library.

{% youtube Rumf96j0cR0 %}

---Other links----
- If you liked this short video, and would like to buy me a coffee: https://www.buymeacoffee.com/aniakubow​
- Sign up for weekly coding tips from my newsletter partnership: http://bit.ly/JS-tips​
- If you are looking to deploy this project, you can use 10% off on Hostinger with code ANIAKUBOW. https://www.hostinger.com/aniakubow​​

The source code for this project can be found here: https://github.com/kubowania/mocha-test​

You can also find me on:
Twitter: https://twitter.com/ania_kubow​​​
Instagram: https://instagram.com/aniakubow​​​

#codingbootcamp​​​ #coding
Darknet - do you dare?
Tags: darknet, tor, onion, hacker
Published: 2021-02-03 16:49:19

Guys - Ever since the BigTechs started the censorship, I decided to be in more lined with secret browsing and just hidin'. Nothing I am doing is illegal, but I don't like how things are with the world.

Plus learning a little about the darkweb isn't so bad.

First, get a VPN [This is my personal referral and I've been using them since 2013](http://www.privateinternetaccess.com/pages/buy-a-vpn/1218buyavpn?invite=U2FsdGVkX1-U93d7iTeFBlrLiKaLvNDkUu2zvaSmbps%2Ctxg0cmZyANddsV7iJgUQ0MYa59E)

Second download [Tor-Browser here](https://www.torproject.org/download/)

Always remember to start VPN first, then open the Tor-Browser. This is so your ISP doesn't know you are using Tor. 
If you use Tor first then VPN, your ISP will know you are using Tor, but won't see your activities.

Since onion websites aren't indexed, you will need to know the exact urls to get in.
My recommendation is to duckduckgo hidden wikis.

Here is starter-page
[Hidden Wiki](http://zqktlwi4fecvo6ri.onion/wiki/index.php/Main_Page)

The Tor browser is based on Mozilla, so I would not recommend to just install any extensions. I am not a fan of Firefox so I only use it here and there. It does take a lot of CPU resources. 

Cheers!


Feel free to buy me a cup of coffee if you think this is helpful.

[![https://www.buymeacoffee.com/tekniq](https://dev-to-uploads.s3.amazonaws.com/i/7gc0talenp68hr542p0w.png)](https://www.buymeacoffee.com/tekniq)
Vue 3 real-life performance
Tags: vue, javascript
Published: 2021-02-03 13:20:40

Recently, I moved [SiteInspector](https://github.com/siteinspector/siteinspector) to Vue 3 so I was curious to see if the app had any improvements in terms of efficiency and performance.

### Build speed

#### Vue 2
```
Hash: 30af4c4033482074a37d
Version: webpack 4.44.2
Time: 6730ms
```

#### Vue 3
```
Hash: 36b518e42dad63f1a2cd
Version: webpack 4.44.2
Time: 7871ms
```

The measured build speed is represented by the fastest build time of Vue modules (css/scss/less modules were removed from the bundle).

Vue 3 app build didn't reach the same speed as Vue 2.

### Bundle size

#### Vue 2

```
                                    Asset       Size  Chunks                                Chunk Names
            js/ui-c0266b6bd5a26196d002.js    413 KiB       0  [emitted] [immutable]  [big]  ui
         js/ui-c0266b6bd5a26196d002.js.br   91.5 KiB          [emitted]
         js/ui-c0266b6bd5a26196d002.js.gz    109 KiB          [emitted]
        js/ui-c0266b6bd5a26196d002.js.map   1.58 MiB       0  [emitted] [dev]               ui
     js/ui-c0266b6bd5a26196d002.js.map.br    335 KiB          [emitted]              [big]
     js/ui-c0266b6bd5a26196d002.js.map.gz    407 KiB          [emitted]              [big]        
```

#### Vue 3
```
                                    Asset       Size  Chunks                                Chunk Names
            js/ui-34caf8d12584e4e16014.js    432 KiB       0  [emitted] [immutable]  [big]  ui
         js/ui-34caf8d12584e4e16014.js.br   96.4 KiB          [emitted]
         js/ui-34caf8d12584e4e16014.js.gz    116 KiB          [emitted]
        js/ui-34caf8d12584e4e16014.js.map    1.8 MiB       0  [emitted] [dev]               ui
     js/ui-34caf8d12584e4e16014.js.map.br    372 KiB          [emitted]              [big]
     js/ui-34caf8d12584e4e16014.js.map.gz    460 KiB          [emitted]              [big]

```

Vue 3 app weight is 19kb more. A smaller bundle size could be achieved with Rollup tree-shaking, but the default Vue webpack package weighed slightly more, as well as Vue 3 Vuex and Router packages.


### Web performance

To test web performance I used a large SiteInspector [report](https://siteinspector-test.herokuapp.com/shared?token=eyJhbGciOiJIUzI1NiJ9.eyJ3aWQiOjEsInJvbGUiOiJ2aWV3ZXIifQ.e6pBL0rTwooiSUq5kFg8dOe1zNQes2ESQ8UhXCu07Bw) page which renders thousands of custom Vue components.

#### Vue 2

![vue2-ch-2](https://dev-to-uploads.s3.amazonaws.com/i/mktyefd0oyblq7esaouq.png)

```
3507ms - Scripting
1356ms - Rendering
24ms   - Painting
```
 
#### Vue 3

![vue-3](https://dev-to-uploads.s3.amazonaws.com/i/bmthet3qldwwkywrsurg.png)
 
```
3707ms - Scripting
1252ms - Rendering
26ms   - Painting
```

Vue 3 didn't show a noticeably faster rendering speed - it took ~5 seconds to render the report both in Vue 2 and 3.

#### Summary

Vue 3 didn't improve app efficiency and performance for SiteInspector. In general, web performance remained on the same level. Vue 3 showed bigger progress towards making better toolings and maintainable code.
Running GitHub Actions CI/CD triggers on specific branches
Tags: github, githubactions, devops
Published: 2021-02-03 16:41:54

GitHub Actions allows you to automate, customize and execute your software development workflows inside your repository.
  
You can configure your workflows to run when specific activity on GitHub happens, at a scheduled time, or when an event outside of GitHub occurs.

The most common events are push and pull_request events to trigger workflow runs on any change to the main branch. The workflow will run for any pull request opened and show your workflows directly in the pull request.

```yml
on: [push, pull_request]
```

You want certain events to run on specific branches. You adjust the YAML to include branch names to only run CI checks on branches you needed them. Below I have changed my events to run on the main branch, even though it is named the push. It will run when you run git push or merge a pull request into the main branch.

```yml
on:
  push:
    branches:
    - main
  pull_request:
    branches:
    - main
```

Finally, you can leverage YAML syntax to run an array of branches. You can also set up wildcards to run on similarly named branches as well. So now you can set up a workflow to run in multiple branches and maintain separate release tracks. For example:

```yml
on:
  push:
    branches:
    - master
    - 'releases/**'
  pull_request:
    branches:
    - master
    - 'releases/**'
```

_This is part of my 28 days of Actions series. To get notified of more GitHub Action tips, follow the GitHub organization right here on Dev._

{% link https://dev.to/github/running-github-actions-on-forks-4e75 %}
Upload File | Selenium Webdriver Python Tutorial
Tags: python, testing, webdev, tutorial
Published: 2021-02-03 16:29:56

In this post, we will learn how to upload a file using Selenium Webdriver in Python as well as using the SeleniumBase framework. File uploads are common use cases for the majority of websites these days, so it is important to know how to work with them.

Typically, you’ll run into two scenarios when working with file uploads. 1 – where the file input field is visible. 2 – where the file input field is hidden (most common in modern websites). Let’s take a look at an example for both of them –

### **Upload file on a visible input field**
For this example, I will be using this website – https://the-internet.herokuapp.com/upload 

![visible input](https://automationbro.com/wp-content/uploads/2021/01/image-3.png)

As you can see in the screenshot above, the “Choose File” input field is visible. So, in this case, we can easily find the input field and send the file to that.

![visible code](https://dev-to-uploads.s3.amazonaws.com/i/yjjmli14mtjzspgazylb.png)

---

### **Upload file on a hidden input field**
However, most likely, you will see in the modern websites that the file input field is hidden for styling purposes. Every website will have its own kind of implementation to hide the input field, for example – reducing the opacity to 0, setting display to none, etc…

For this example, we will be using this website – https://practice.automationbro.com/cart/ 

![hidden input](https://automationbro.com/wp-content/uploads/2021/01/image-4.png)

As you can see in the screenshot above, we do not see any “Choose File” input field as that is hidden behind the “Select File” button.

**Solution**: So to overcome this problem, we need to make the element visible again by manipulating the DOM using JavaScript.

![hidden code](https://dev-to-uploads.s3.amazonaws.com/i/evhhvol4g8gkkpdg3kvs.png)

The key thing to notice here is the `add js code` part where I am removing the hidden class to enable our input field and then uploading the file.

---

### **Check out the video below to learn how to effectively upload file in Selenium Python –**

{% youtube hMVNtRyhttM%}

---

📧 Subscribe to my [mailing list](https://automationbro.com/mailing-list) to get access to more content like this 

👍 Follow [automationbro](https://twitter.com/automationbro) on Twitter for the latest updates

...

I love coffees! And, if this post helped you out and you would like to support my work, you can do that by clicking on the button below and buying me a cup of coffee -

<a href="https://www.buymeacoffee.com/automationbro">![Buy me a coffee](https://dev-to-uploads.s3.amazonaws.com/i/4aw2ub3f4qkyjk0ivwt4.png)</a>

You can also support me by liking and sharing this content.

Thanks for reading!
First steps from monolithic applications to microservices. Part 2
Tags: monolithic, rest, api, microservices
Published: 2021-02-03 16:27:59

Hi! In my [previous article](https://dev.to/alexdodonov/first-steps-from-monolithic-applications-to-microservices-48be) I have described how you can start splitting your monolithic applications into services. And one way to do it was to split the backend by cutting one table (or set of tables) from another ones.

But it is not the only way.

I am sure that you have huge pieces of functionality wich are not using database, but they are also suitable candidates to become a microservice.

Here are few examples.

## Email sending routine

Usualy if you want to send email in your code you just call `sendEmail` method, and pass recipient's address, name of the required email template, some variables, wich will be substituted in the email body or headers. And thats all.

But email sending process can be quite tricky. Some kind of template engine can be used, messages can be queued in RabbitMQ (or in it's equivalent). Messages in this queue may be prioritized and so on.

Writing all this I mean that all these email sending details are usually well incapsulated even in a very bad and messy code.

Thus it can be relatively easy be taken out into standalone service.

## Interactions with the third-party APIs

This can be a difficult tusk but you surely suld keep in mind that it is also a good candidate to become a proxy service between your monolith and third party API.

The main argument is that these APIs evolute and old versions are deprecated and then become unsupported by their developers.

What you will do if this will happen? You will open your IDE and grep your source code to change it and make work with the new version of the deprecated API. In all places were it is used. May be they are quite numerous )

Don't you think that it is a great idea to have only one place wich must be updated. And standalone proxy-service is a good solution.

## Report generation

I know that report generation routines are usually use database, but I nevertheless want to mention it in this article because you usually have some reports wich are independent from each other. Thus you can move them to standalone service one by one.

And reports usually require a lot of CPU and RAM resources, so you can speed up yor application by moving report generation in a separate service on a separet host.

That's all for today! Hope this article was usefull.

**PS Subscribe, like, share )**

# Want more articles?
Subscribe me in [Twitter](https://twitter.com/mezonphp)

Or you can get access to my code on [github](https://github.com/alexdodonov/mezon)
AzureFunBytes Reminder - 02/04/2021 2PM EST - Intro to @daprdev with @mfussell
Tags: azure, microservices, beginners, cloudnative
Published: 2021-02-03 16:24:56

Each week on [AzureFunBytes](https://twitter.com/azurefunbytes), we drive into the tools and products that make up the foundations of using [Azure](https://azure.microsoft.com/free/?WT.mc_id=devops-14110-jagord).  This week we dive into microservices and how our distributed applications can thrive on [Azure](https://azure.microsoft.com/free/?WT.mc_id=devops-14110-jagord).  One tool that really helps drive productivity and helps developers build reliable and resilient applications is [Dapr](https://docs.dapr.io/concepts/overview/?WT.mc_id=devops-14110-jagord).

[Dapr](https://docs.dapr.io/concepts/overview/?WT.mc_id=devops-14110-jagord) is an open-source, portable, event-driven runtime that reduces the overhead in creating distributed microservices in the cloud. Dapr helps provide you with options to create microservices using any language, with any framework, on any platform. Dapr will help codify best practices for your distributed services infrastructure without requiring you to be an expert on cloud-native architecture.

To help me through this, I will be working with [Mark Fussell](https://twitter.com/mfussell), one of the product leaders on the Dapr project. We'll take questions, listen to your comments and most of all learn together.

AzureFunBytes! - Byte-sized content with a live Twitch show!

{% youtube 9o9iDAgYBA8 %}

Learn about Azure fundamentals with me!

Live stream is available on Twitch at 2 pm EST Thursday. You can also find the recordings here as well:

https://twitch.tv/azurefunbytes
https://twitter.com/azurefunbytes
https://aka.ms/jaygordononyoutube

Join me, ask questions, and learn about Azure!

Useful Docs:

[Microsoft Learn: Azure Fundamentals](https://cda.ms/1jV) 
[Microsoft Azure: $200 Free Credit](https://cda.ms/1tj) 
[Dapr Overview](https://twitter.com/mfussell)
[Getting started with Dapr](https://docs.dapr.io/getting-started/?WT.mc_id=devops-14110-jagord)
[Try out Dapr quickstarts to learn core concepts](https://docs.dapr.io/getting-started/quickstarts/?WT.mc_id=devops-14110-jagord) 
[Dapr Reference Docs](https://docs.dapr.io/reference/?WT.mc_id=devops-14110-jagord) 
[Microservices in Azure](https://azure.microsoft.com/solutions/microservice-applications/?WT.mc_id=devops-14110-jagord) 
[Building microservices on Azure](https://docs.microsoft.com/azure/architecture/microservices/?WT.mc_id=devops-14110-jagord)