teleren/devto huggingface dataset:
AzureFunBytes Episode 12 - IaC, @HashiCorp Terraform, and @Azure ARM Templates with @zdeptawa
Tags: azure, terraform, cloud, beginners
Published: 2020-08-27 19:07:36

This week [Zachary Deptawa](https://twitter.com/zdeptawa) joins me to discuss Infrastructure as Code (IaC), Terraform, Azure, and how they all fit together.  As a fellow member of the Azure Advocacy DevOps team, we both love opportunities to collaborate and learn in public together.  We'll take questions, discuss how Zach got his start and tons more.

{% youtube thNc2-eK91M %}

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

Learn about Azure fundamentals with me!

Live stream is available on Twitch at 2 pm EDT Thursday. You can also find the recordings there as well.

https://twitch.tv/azurefunbytes
https://twitter.com/azurefunbytes

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) 
[Terraform with Azure](https://cda.ms/1z2)
[Quickstart: Configure Terraform using Azure Cloud Shell](https://cda.ms/1z3)
[HashiCorp Terraform on Azure](https://cda.ms/1z5)
[Infrastructure as Code](https://cda.ms/1z6)
[ARM template documentation](https://cda.ms/1zk)
[What are ARM templates?](https://cda.ms/1zn)
[Frequently asked questions about ARM templates](https://cda.ms/1zm)
[Azure Quickstart Templates](https://cda.ms/1zj)
[Terraform Demo](https://aka.ms/azfunbytes-tf-demo)

{% youtube Y42hgiSvXfE %}
Tracing in express.js
Tags: node, tracing, javascript, logging
Published: 2020-08-27 18:40:46

Tracing is tracking the details of each request. With tracing it is possible to track down the execution of the code for each user request in the context of a web application. This is important when debugging an application as it might be necessary to track a user and the corresponding path of the code. With threaded languages, this is quite straightforward with the thread id.

In Node.js, it is not simple as it is single threaded and depends on the event loop to execute asynchronously. However [rtracer](https://github.com/puzpuzpuz/cls-rtracer) provides a straight forward solution to accomplish this.

rtracer provides APIs to use it in multiple frameworks such as express.js, and fastify.

To use it in express.js, rtracer has to be registered as a middleware. That's it. After that the id generated by rtracer can be used with any type of logger. An id is generated as follows,

```js
app.use(rTracer.expressMiddleware());
app.get('/', (req, res) => {
  const requestId = rTracer.id();
  console.log(`Request Id: ${requestId}`);
  
  res.json({ status: true });
});
```

This [repository](https://github.com/rajikaimal/express-tracing) contains a minimal example that demonstrates rtracer with winston logger.
ColdFusion timeFormat Conversion Testing
Tags: coldfusion, cfml
Published: 2020-08-27 18:15:01

I was prepping some tests for the awesome [Lucee Spreadsheet library](https://github.com/cfsimplicity/lucee-spreadsheet) and came across an issue when one of my ID strings `9A` was autocast as a time `09:00:00`. I wasn't expecting this to happen as it didn't seem like a valid date/time string to me. I thought this could be easily fixed by adding a space `9 A` and it was still converted to a time.  How about multiple spaces `9    A`... nope, it's still a valid time string?

Has anyone reviewed what valid and invalid strings the [TimeFormat()](https://cfdocs.org/timeformat) tag can accept?  I get different results when using Adobe ColdFusion versus Lucee... and that's a problem IMHO, but is it a bug or feature?

## Adobe ColdFusion [2016](https://www.trycf.com/gist/923f645b3944b7315c22ac693c17e94b/acf2016) / [2018](https://www.trycf.com/gist/923f645b3944b7315c22ac693c17e94b/acf2018) Results:
```
"9" = NO "00:00:00.000"
"9A" = YES "09:00:00.000"
"9p" = YES "21:00:00.000"
"9#Chr(32)##Chr(32)##Chr(32)#A " = YES "09:00:00.000"
" 9 A " = YES "09:00:00.000"
"23" = NO "00:00:00.000"
"15.4" = YES "09:36:00.000"
```
## [Lucee 5](https://www.trycf.com/gist/923f645b3944b7315c22ac693c17e94b/lucee5) Results:
```
"9" = false "00:00:00.000"
"9A" = false "ERROR"
"9p" = false "ERROR"
"9#Chr(32)##Chr(32)##Chr(32)#A " = false "ERROR"
" 9 A " = false "ERROR"
"23" = false "00:00:00.000"
"15.4" = true "00:00:00.000"
```

## Source Code

{% gist https://gist.github.com/JamoCA/923f645b3944b7315c22ac693c17e94b %}
Remodeling Data Relationships - Building SaaS #55
Tags: python, django, saas
Published: 2020-08-27 18:10:28

{% youtube qQdBcj02J60 %}

In this episode, we're remodeling!  I changed the model relationship between GradeLevel and Course from a ForeignKey (1 to many) to a ManyToManyField.  We talked through the change and started fixing all the tests that broke.

After explaining the change that I wanted to make and why I want to make it, I explained how a foreign key and many to many relationship at the database level.

Once we had the conceptual foundation in place, I started with the documentation.  We looked at the `ManyToManyField` and what changes were needed to convert a `ForeignKey` to a `ManyToManyField`.

After the change, we immediately saw the value of having a test suite that runs all the code.  We ran the tests and see the test suite light up like a Christmas tree with errors.

For the remainder of the stream, I worked to fix errors in the suite by fixing the broken code and the broken tests.

This article first appeared on [mattlayman.com](https://www.mattlayman.com/building-saas/remodeling-data-relationships/).
Build X from source is so hard 😭
Tags: build, compile, sourcecode
Published: 2020-08-27 18:02:31

Default Version: latest

## On Ubuntu 18.04:

- servo ❌ 
{% github servo/servo no-readme %}
- lumen ❌ 
{% github lumen/lumen no-readme %}
- tensorbase ❌ 
{% github tensorbase/tensorbase no-readme %}

## On macOS Catalina (Version 10.15.5)

- Emacs27 ✅
{% github d12frosted/homebrew-emacs-plus no-readme %}
Stateful Action: keep the state between runs
Tags: actionshackathon, github
Published: 2020-08-27 17:58:02

This is my entry for the [GitHub Actions Hackathon on DEV](https://dev.to/devteam/announcing-the-github-actions-hackathon-on-dev-3ljn):

**[💾 Stateful Action](https://github.com/marketplace/actions/stateful-action)** persists the data into a **branch** after every run, letting the actions **keep a state between runs**.

I use this utility to periodically run **reports**, **crawlers**, and **bots** that live entirely as a GitHub repository. They keep the state of the progress in a branch. Some of them store the information in a SQLite database file. I also the action for publishing the results in the GitHub pages branch.

The action squashes the oldest commits, so the repository size doesn't grow wildly.


## How does it work?

The action stores the information in a folder that is also a branch, using a git [worktree](https://git-scm.com/docs/git-worktree). 

It wraps the run like this:

1. `state` branch is checked out as a [worktree](https://git-scm.com/docs/git-worktree) under a folder named `.state` (which must be ignored by `.gitignore`). Please check [`scripts/main.sh`](scripts/main.sh).
2. The application writes its state into the `.state` folder.
3. Changes in `state` branch are commited and pushed to origin. Please check [`scripts/post.sh`](scripts/post.sh):
    * Changes are commited and pushed.
    * Old commits on `state` branch are squashed and force-pushed.
    * `.state` worktree is removed.

For more details, please check the [repository](https://github.com/jorgebg/stateful-action).
MongoDB |> How to Select a Single Field for All Documents in a MongoDB Collection
Tags: quickanswer, mongodb
Published: 2020-08-27 17:56:29

``` javascript
db.inventory.find( { type: 'food' }, { item: 1, qty: 1 } )
```

In above example from the folks at Mongo, the returned documents will contain only the fields of item, qty, and _id.

``` javascript
db.inventory.find( { type: 'food' }, { item: 1, qty: 0 } )
```

In above example from the folks at Mongo, the returned documents will contain only the fields of item, and _id.

<hr>

*References*:

- https://stackoverflow.com/questions/25589113/how-to-select-a-single-field-for-all-documents-in-a-mongodb-collection
- https://stackoverflow.com/questions/25589113/how-to-select-a-single-field-for-all-documents-in-a-mongodb-collection
Arduino PCB Design
Published: 2020-08-27 17:54:09

Power Supply Part
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/cbli5nsl29v4tkq0axl5.png)
MIcrocontroller Part
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/zqvmpcqg38omlw2gg04a.png)
Pinout Part
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/myo5v7aj5zx5rptey959.png)
Trying the schema into board
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/lp704bjimarp8wbhvg8v.png)
After some modification such as fuse and other 
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/c7irwzpkazzfw3yynqtg.png)
after design rule checking final gerber file is produced.

Now it can be programmed using CP2102 or USB to serial converter board. PCB designed...... hurray!!!
Would you like to get a Neuralink Implant? 🧠🤖
Tags: watercooler
Published: 2020-08-27 17:34:32

---
title: Would you like to get a Neuralink Implant? 🧠🤖
published: true
description: discuss, watercooler
tags: 
//cover_image: https://direct_url_to_image.jpg
---

Okay, I'm excited about Neuralink, maybe you are not. Seem like an episode of Black Mirror coming to reality.

![ Neuralink Implant](https://media.giphy.com/media/igJVh7Eu8aPvxhgkm6/giphy.gif)

But let's assume if in Future this actually works and this technology is assessable to masses than that means we might get a chance to develop something using it. I'm pretty sure that they probably provide an emulator for that but what if to even test something you build(without errors obviously) on you or probably wanna get an implant trying that someone else builds?
Damn, there are so many possibilities ahead. What are your thoughts on this? 

#### FYI
{% youtube _noh59-WA5Q %}
Which would you prefer and why? (I know its different) PYTHON vs JAVA/KOTLIN 
Tags: python, javascript, java, kotlin
Published: 2020-08-27 17:33:40

Which would you prefer and why?
Vue, React, Python,Django, Flask (concentrating on Python)
....
OR
Java, Kotlin?? Using Spring?

I’m trying to narrow down what is “needed”. 
Styling can be anything, it’s always changing. 
I’m not really liking styling that much. 
I like creating objects and interactions, but I don’t like the styles of it that much. 
.
So is Java, Kotlin good? Is it popular and needed?
7 steps after installing PostgresQL on Ubuntu Server 20.04
Tags: postgres, ubuntu, hints
Published: 2020-08-27 17:07:39

**Problem:**

After installation (`sudo apt install postgresql-12`) you try to connect to your fresh PostgresQL 12 using `psql`, but it's responding

```
psql: error: could not connect to server: FATAL:  Peer authentication failed for user "postgres"
```

**Solution:**

1) Make sure you've run `pg_ctlcluster`

```
sudo pg_ctlcluster 12 main start
```

2) Check postgres port and change it to 5432 if needed

```
sudo nano /etc/postgresql/12/main/postgresql.conf
```

> in newer versions it might be 5433 by default, so it causes problems

find a string with `port = 5433` and change it to `port = 5432`

3) Restart postgres service (just in case)

```
sudo service postgresql restart
```

4) Sign-in into psql using `sudo`

```
sudo -u postgres psql postgres
```

5) Set up `postgres` user's password. Don't forget the semicolon!

[2 last steps on my DevOps blog](https://ntscx.com/posts/7-steps-after-installing-postgresql-on-ubuntu-server-20.04)
Docker Config PreProcessor
Tags: help, docker
Published: 2020-08-27 17:01:31

So, I keep on running into this issue time and time again.  I need to dockerize an app, but the application doesn't follow the https://12factor.net/ design or at the very least it's not allowing ENV overrides.  

There are tools now that are agnostic to what format the config file is in. (yaml, json, .ini ) and is able to read the configuration in. 

https://github.com/spf13/viper is a great example and https://gitlab.com/dashwav/gila is another python example. 

How does everyone else deal with updating configs that doesn't support env? I was thinking of writing a tool where my docker image just invokes a pre-processor that is ENV aware.  

like

```
#!/usr/bin/env bash 
preprocess --config foobar.template foobar.properties

$@
```

Wouldn't it be worthwhile to create something that adapts the config rather than updating the config by exposing it via volumes or doing weird sed/regex pre-processing?

Any thoughts?
How to get Geo location in PHP
Tags: php, location, geo, geolocation
Published: 2020-08-27 16:56:35

I was created a composer package for get GEO Location from the users. This package help to find location info and service provider information.

[https://packagist.org/packages/katheesh/visitorinfo](https://packagist.org/packages/katheesh/visitorinfo)

## 💥 Installation

```bash
# install it via composer
composer require katheesh/visitorinfo
```

## 💥 To use in your program

```php
require_once __DIR__ . '/vendor/autoload.php';

use VisitorInfo\GetInfo;

$info = new GetInfo;


    // get IP and geographical information about your client
echo $info->getGeoInfo();

    // get service provider information about your client
echo $info->getProviderInfo();

     // get hosting provider information about your client
echo $info->getHostingInfo();

```

Thank you for your time
### 😍 Have a good day.
My #100DOC - Day 1
Tags: 100daysofcode, challenge, log
Published: 2020-08-27 16:49:35

Hey 👋

Yes, I was tempted and finally today I started the challenge. Give me luck!
___

### Day 1: August 27, 2020
##### Starting the challenge 🚀

#### **Today's Progress**: 
1. **[Help on Stack Overflow](https://es.stackoverflow.com/questions/385221/agrupar-array-multidimensional-en-java)** (1h 20min):<br>I helped a Stack Overflow colleague sorting an ArrayList of Objects by Dates. It was difficult at first, but with a little research I managed to do it.

2. **[Start The Complete JavaScript Course by Jonas Schmedtmann on Udemy](https://github.com/pablohs1986/javaScriptCompleteCourse2020_Schmedtmann)** (1h 02min):<br>I started this amazing course to improve my JavaScript (I know the really basics). In today's lesson, we have gone over the basics.
    
#### **What I learned**: 
* Use of Java Comparator.
* Convert Java String to Date.
* Review of JavaScript basics.

#### **Total time**:
2h 22min.
Control and monitor virtually any Modbus RTU device from the cloud
Tags: modbus, ubidots, rs485, iot
Published: 2020-08-27 16:48:45

It's almost inevitable not to worry about your high-powered devices running most of the day if they have no way of being monitored. [ModbusBox](https://mbox.iotbits.net), a very cheap yet powerful device, its the a great candidate to be in charge of reading critical variables and publishing those to any MQTT enabled dashboard such as [Ubidots](https://ubidots.com/). 

This device, manufactured by IOTBITS in the US, promises to take full control of Modbus RTU devices such as variable frequency drives, industrial power generators, energy meters and the majority of hobbyist power supplies and other workbench instruments. 

One of its key features its the ability to modify its manifest file written in JSON format, making it possible to add virtually any Modbus RTU device to read and write any of its register without having to modify the firmware.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/r64p7mscz8nusrre0l3q.png)
The manufacturer announced their plan to make its firmware available to download on the website, allowing it to be used on any ESP32 powered device or development board. That is a great news for makers who wants to be able to have full control of their Modbus RTU device without having to pay much. For more information about ModbusBox please visit its website: https://mbox.iotbits.net.

The cover image is not an actual image of the device.
<span>Cover image by <a href="https://unsplash.com/@_louisreed?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Louis Reed</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></span>
Giving Away Interview Cake Subscriptions!
Tags: giveaway, beginners, career, learning
Published: 2020-08-27 16:48:14

Image via [_FreeStocks_](https://unsplash.com/@freestocks)

All you have to do to enter is reply to this tweet. Please read all of my replies for contest information.

Others have started to match my donations so who knows how many subscriptions we'll end up giving away.

{% twitter 1299007018091642880 %}
[META LIST] What twitter lists and people do you follow for developers?
Tags: discuss, webdev, productivity
Published: 2020-08-27 16:34:51

---
title: [META LIST] What twitter lists and people do you follow for developers?
published: true
description: 
tags: [discuss,webdev,productivity]
//cover_image: https://direct_url_to_image.jpg
---

I’ve been pruning and curating my following on [twitter/nyxtom](https://twitter.com/nyxtom) and I’m curious what recommended lists/people follow for things like development, indie hacking, hardware hacking, generative art, mathematics...etc

Here are a few that I've found neat:

* [DevJobs](https://twitter.com/i/lists/1288078283859464192)
* [Indie Hackers](https://twitter.com/i/lists/1292810213666381825)
* [Science](https://twitter.com/i/lists/834921994810503171)

Updated from Community:
* [Design and Development via @vtrpldn](https://twitter.com/i/lists/1288901453915074560)

Let me know in the comments below and I'll add you to this meta list! Also, feel free to share your own twitter handle and a bit about what you post if you are interested.

Thanks 🍻
Hugo |> Dev Server Open Browser
Tags: quickanswer, macos, hugo, chrome
Published: 2020-08-27 16:26:59

<hr>

> IF YOU JUST SOLVED SOME PROBLEM, WELCOME TO DM **qaRabbit** ON [TWITTER](https://twitter.com/qaRabbitx), OR CREATE A PULL REQUEST IN [GITHUB REPO](https://github.com/supeterlau/quickanswer).

Why hugo dev server can't open browser tab automatically?

Modify hugo source code will definitely solve this issue.

Or we can use two simpler ways:

- use some program to run command `hugo server` and `open_browser` [in parallel](https://www.cyberciti.biz/faq/how-to-run-command-or-code-in-parallel-in-bash-shell-under-linux-or-unix/)

- use simple command sleep

Here is the second way on **macOS**: (open command only works on macOS)

```zsh
#!/bin/bash

LOCAL_URL=http://localhost:1313

open_browser () {
  duration=${1:-3}
  sleep $duration
  echo 'After '$duration
  # change open command to proper one
  open --new -a "Google Chrome" --args $LOCAL_URL
}

open_browser 1 &
hugo server
```


<hr>

*Reference*:

https://github.com/gohugoio/hugo/issues/6293
https://www.cyberciti.biz/faq/how-to-run-command-or-code-in-parallel-in-bash-shell-under-linux-or-unix/
https://zwbetz.com/open-a-new-google-chrome-tab-or-window-via-command-line-on-mac"
alpinelinux for armel and mips anyone?
Tags: help, alpinelinux, armel, mips
Published: 2020-08-27 16:24:21

We love alpine a lot: it's lean, it's nice, apk does its job very well and is lightweight and lightning fast to use even on low spec systems....

Unfortunately, we have devices that would benefit from these alpinelinux properties in the router and CPE segment that currently cannot benefit from it's awesomeness :(.

Hence, I am looking for interested folks that would be keen to help bootstrapping and maintaining an unofficial ports repo for armel and mips (and maybe more?) architectures.

If you like the idea and want to help ping me and we can see how we can work together.
Start Goland from terminal
Tags: go
Published: 2020-08-27 16:10:10

Its Very Easy!!!

### Step1:
Open `Goland` and click on `Tools -> Create Command-line launcher` and give the path as `/usr/local/bin/goland`
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/efodvsxc7ofmewtgyrdd.png)


### Step2:
Create an alias 
`alias goland='/usr/local/bin/goland'`

Tip: Its better to have this line a startup script, so that restart doesn't revert your changes

### Step 3:
Open terminal and go to your workspace and type 
`goland .`

That's it!!! you will see your IDE opening your favourite project
Angular 10 CRUD Application Tutorial [PDF eBook]
Tags: angular
Published: 2020-08-27 16:00:38

---
title: Angular 10 CRUD Application Tutorial [PDF eBook]
published: true
description: "Throughout this tutorial, We'll be learning how to build an Angular 10 CRUD application to consume a REST API, create, read, modify and search data"
tags: angular
//cover_image: https://direct_url_to_image.jpg
---


Throughout this tutorial, We'll be learning how to build an Angular 10 CRUD application to consume a REST API, create, read, modify, and search data.

> [Download this tutorial as a PDF ebook](https://www.techiediaries.com/angular-10-crud-bootstrap-tutorial.pdf) for offline reading.

You can also read this tutorial online from:

`https://www.techiediaries.com/angular-10-crud-example-web-api/`


## Introducing our Angular 10 CRUD Application

We will learn how to build an Angular 10 front-end application that fetches data from a REST API of products:

-   Each product has id, name, description, availability status.
-   Users would be able to create, retrieve, update, and delete products.
-   Users can search for products by name.



## The REST API Endpoints

We'll be building an Angular 10 frontend app for a presumed REST API exporting the following REST API endpoints:



- POST /api/products create new product
- GET /api/products retrieve all products
- GET /api/products/:id retrieve a product by  `:id` 
- PUT /api/products/:id update a product by  `:id`
- DELETE /api/products/:id delete a product by  `:id`
- DELETE /api/products delete all products
- GET /api/products?name=[keyword] find all products which name contains  the passed `keyword`.

All of them can work well with this Angular App.

## Angular 10 CRUD App Structure

These are the components of our CRUD app:

- The  `App`  component is the parent of all other components and contains a  `router-outlet` directive where the router will be inserting any matched component. It also contains a navigation bar that contains links to the app routes using  `routerLink` directive.

–  `ProductListComponent`  which displays the list of products.  
–  `ProductUpdateComponent`  which displays a form for editing product’s details by  `:id`.  
–  `ProductCreateComponent`  which displays a form for creating a new product.

The components use the `ProductService`  methods for actually making CRUD operations against the REST API. The service makes use of Angular  10 `HTTPClient`  to send HTTP requests to the REST and process responses.