teleren/devto huggingface dataset:
How to Send Customers Text Messages Using Django & Twilio
Tags: django, twilio, webdev, tutorial
Published: 2020-06-30 00:57:57

1) Create a Django project
```
C:\Users\Owner\Desktop\code>py -m venv text
C:\Users\Owner\Desktop\code>cd text
C:\Users\Owner\Desktop\code\text>Scripts\activate
(text) C:\Users\Owner\Desktop\code\text>pip install Django
(text) C:\Users\Owner\Desktop\code\text>django-admin startproject mysite
(text) C:\Users\Owner\Desktop\code\text>cd mysite
(text) C:\Users\Owner\Desktop\code\text\mysite>py manage.py startapp main
```

2) Configure Django settings.py
```python
INSTALLED_APPS = [
    'main.apps.MainConfig', #add this
    ...
]
```

3) Create a superuser
```
py manage.py createsuperuser
```

4) Install the django-phonenumber-field package
```
pip install django-phonenumber-field[phonenumbers]
```

5) Add django-phonenumber-field to the settings.py
```python
INSTALLED_APPS = [
    ...
    'phonenumber_field', #add this
    ...
]
```
6) Create the model in models.py
```python
from django.db import models
from phonenumber_field.modelfields import PhoneNumberField

class Customer(models.Model):
  name = models.CharField(max_length=200)
  phone_number = PhoneNumberField()
```

7) Make migrations and migrate
```
py manage.py makemigrations
```
```
py manage.py migrate
```

8) Add the model to the admin.py
```python
from django.contrib import admin
from .models import Customer

admin.site.register(Customer)
```

9) Add a customer via the Django admin panel

10) Install the official Twilio Python helper library
```
pip install twilio
```

11) Visit twilio.com, create a trial account, choose a trail phone number, and locate your ACCOUNT SID and AUTH TOKEN

12) Add your ACCOUNT SID and AUTH TOKEN to the Django settings.py.
These variables should be kept safe in production using a solution such as [python-decouple](https://www.ordinarycoders.com/blog/article/secure-django-variables-with-python-decouple).
```python
TWILIO_ACCOUNT_SID = 'YOUR_ID_HERE'
TWILIO_AUTH_TOKEN = 'YOUR_TOKEN_HERE'
```

13) Handle text message setup in the admin.py
```python
from django.contrib import admin
from .models import Customer
from twilio.rest import Client
from django.conf import settings

def send_text(modeladmin, request, queryset):
  client = Client(settings.TWILIO_ACCOUNT_SID, settings.TWILIO_AUTH_TOKEN)
  for customer in queryset:
    message = client.messages.create(
      to= str(customer.phone_number), 
      from_="+13156403238", # insert trial number 
      body="Hey I hope you received this message") # insert message
send_text.short_description = "Send text campaign"
class CustomerAdmin(admin.ModelAdmin):
  fields = ('name', 'phone_number')
  actions = [send_text]
admin.site.register(Customer, CustomerAdmin)
```

14) Log back into the Django admin panel, select the customers model, select the customers, change the action to "Send text campaign" and click "Go" to send the text.

[Django and Twilio Quickstart Guide](https://www.ordinarycoders.com/blog/article/django-twilio)
AZ-303 Study notes #4 VNet Peering and VPN Gateways
Tags: azure, cloud
Published: 2020-06-30 00:44:06

Here is the forth episode of my AZ-303 study notes series.

{% youtube I9TuQ14_YDw %}

# VNet Peering

Like I mentioned in the Intro to VNets section, each VNet is an isolated and secure space. Each one has connectivity inside of itself and to the internet but by design there is no connectivity between VNets in a subscription or across subscriptions. What if we wanted to enable that? We can use VNet peering for this, it allows us to establish low-latency, high-bandwidth connectivity between VNets and works over the Microsoft backbone, that means that this connectivity avoids the public internet and is more secure.

## Capabilities

- Provides connectivity over private IP.
- Supports cross-subscription connectivity.
- Supports cross-region connectivity.

## Limitations

- Address space cannot overlap.
- Does not support transitive routing by default. You could setup a Network Virtual appliance. A VM acts as a router and that could forward traffic.

## Advanced options

- **Allow forwarded Traffic:** Allows forwarded traffic to pass through the VNET peer. Commonly used with Azure Firewall.
- **Allow Gateway transit:** Allows a VNet to be used to access other resources through a VNet gateway
- **Use Remote Gateway:** Configures a VNet to make use of a peered VNet's gateway, to access other resources.

# VPN Gateway
## VNet Peering vs VPN Gateway

You can also use VPN gateways to establish connectivity between VNets. 

### Components

- VPN gateway within a special subnet called GatewaySubnet.
- Public IP addressing for each VPN gateway to establish the connection.
- IPSec IKE site-to-site VPN tunnel that ensures all traffic is encrypted.

### Which one to use?

- VNet peering: Designed for VNet-to-Vnet connectivity. Typically used for private low-latency interconnectivity.
- VPN gateway: Designed for hybrid connectivity. Generally used where encryption and/or transitive routing is needed.

# Thanks for tuning in.

I plan on creating more content around Azure; it's great to share what I've been learning.

If you have any feedback at all, please let me know in the comments below or reach out to me on socials.

Thanks for reading and possibly watching!
AZ-303 Study Notes #2 Intro to VNET and VMs
Tags: azure, cloud, womenintech
Published: 2020-06-30 00:43:00

Here is the second episode of my AZ-303 study notes series.

{% youtube kqswzAAC1Ek %}

# Video Notes

## Virtual Networks

A VNET is an isolated container within Azure that provides network connectivity to resources. 

### Important components

- Subnet: A VNET has one more more subnets. Resources that require network connectivity must reside in a subnet. 

- Address space: VNETs require one or more address spaces to provide private IP addresses to resources.

### Important Considerations

- Default connectivity: After creating a VNET, some connectivity is enabled by default. (Internet access, inter-subnet access).

- Address range restrictions: Private IP address ranges are allowed. The smallest allowed is /29 and the largest is /8.

- Reserved IP addresses: 5 IP addresses are reserved in each subnet. This includes the first 3 and last one. (x.x.x.0-3, x.x.x.255).

- DNS and DHCP: Custom DNS can be configured for your VNET. DHCP is built-in and cannot be custom deployed.

- Supported Protocols: VNETs support TCP, UDP, TCP/IP protocols.

- Integrated Connectivity: VNETs are also built for various forms of integration. Including ExpressRoute, Private Link, VPN, and more. 

- Routing and Connectivity: NSG are more like a firewall, VNET routing is more about the actual pathway. 

- System Routes: Default routes configured by Azure to allow specific connectivity to work automatically.

- Any subnet within a vnet will have outbound access to the internet.
        
- Subnet to Subnet connectivity.

- Custom Routes: User-defined routes which allow custom paths of communication to be enforced or blocked.  

- Route priority when you have multiple routes: Custom > BGP > System. The longest prefix match is always going to precedence first. a /32 will override a /24 when the other octets of the IP are matching.

## Virtual Machines

A VM allows you to deploy virtualized Windows or Linux machines. They are helpful when you want to migrate existing compute workloads to the cloud and deploy advance compute solutions. 

### Key Components

- Belongs to a resource group.
- Created in a specific region.
- Is configured with a given size that you can change also once it's created (requieres restart).
- Built from an image of an OS.

### Virtual Machine Sizes

The size of a VM influences several characteristics:

- CPU resource allocation
- Total available memory
- Network Interface Card (NIC performance
- Storage (Azure Disks) performance
- Graphics capabilities
- Influences limits (maximum NICs, disks)

Available sizes for your VM depend on Whether the virtual machine is running and the location of the virtual machine.

# Thanks for tuning in.

I plan on creating more content around Azure; it's great to share what I've been learning.

If you have any feedback at all, please let me know in the comments below or reach out to me on socials.

Thanks for reading and possibly watching!
Hay algúna forma de identificar contenido en español?
Tags: help, spanish
Published: 2020-06-30 00:33:46

Hola !, esto va más bien para la gente que habla en español, estoy buscando creadores de contenido y contenido en sí en español dentro de dev, ya que creo que muchos en el ambiente hablamos en español y si hay contenido en ese idioma es una barrera menos para mucha gente que quiere arrancar en este mundo y por el idioma no puede o no se anima. 

Si saben de algo se los agradezco!, por mi parte estoy empezando a escribir y por lo menos en mi blog quiero crear contenido tanto en ingles como en español 😃
Self-Hosted MongoDB
Tags: mongodb, aws, atlas
Published: 2020-09-07 12:16:24

---
title: Self-Hosted MongoDB
published: true
date: 2020-06-30 00:00:00 UTC
tags: MongoDB,Mongo,AWS,Atlas
canonical_url: https://www.loginradius.com/engineering/blog/self-hosted-mongo/
---

Looking to optimize your db cost? This post will guide you with the complete migration steps from a cloud to a self-hosted environment…

   
[Read On](https://www.loginradius.com/engineering/blog/self-hosted-mongo/)
Roadmap of idx-auto-tester
Tags: automation, idx, roadmap
Published: 2020-09-08 12:06:47

---
title: Roadmap of idx-auto-tester
published: true
date: 2020-06-30 00:00:00 UTC
tags: Automation,idx,roadmap
canonical_url: https://www.loginradius.com/engineering/blog/roadmap-idx-autotester/
---

Roadmap of IDX-auto-tester We're delightfully Announcing the upcoming releases of LoginRadius Identity-Experience-Framework Open-Source Automation These full-version releases will include more test coverage and major changes with several improvements & code optimizations, the…

   
[Read On](https://www.loginradius.com/engineering/blog/roadmap-idx-autotester/)
Fallacies of Distributed Computing: 8. The network is homogeneous
Tags: distributedcomputing
Published: 2020-06-30 00:00:00

---
title: "Fallacies of Distributed Computing: 8. The network is homogeneous"
date: "2020-06-30T00:00:00.000Z"
tags: ["distributedcomputing"]
---

[The fallacies of distributed computing](https://web.archive.org/web/20171107014323/http://blog.fogcreek.com/eight-fallacies-of-distributed-computing-tech-talk/) are a set of assertions describing false assumptions made about distributed systems. 

[L. Peter Deutsch](https://en.wikipedia.org/wiki/L._Peter_Deutsch) drafted the first 7 fallacies in 1994, with the 8<sup>th</sup> added by [James Gosling](https://en.wikipedia.org/wiki/James_Gosling) in 1997.

The 8 fallacies are:

1. [The network is reliable](https://dereklawless.ie/fallacies-of-distributed-computing-1-the-network-is-reliable)
1. [Latency is zero](https://dereklawless.ie/fallacies-of-distributed-computing-2-latency-is-zero)
1. [Bandwidth is infinite](https://dereklawless.ie/fallacies-of-distributed-computing-3-bandwidth-is-infinite)
1. [The network is secure](https://dereklawless.ie/fallacies-of-distributed-computing-4-the-network-is-secure)
1. [Topology doesn't change](https://dereklawless.ie/fallacies-of-distributed-computing-5-topology-doesnt-change)
1. [There is one administrator](https://dereklawless.ie/fallacies-of-distributed-computing-6-there-is-one-administrator)
1. [Transport cost is zero](https://dereklawless.ie/fallacies-of-distributed-computing-7-transport-cost-is-zero)
1. [The network is homogeneous](https://dereklawless.ie/fallacies-of-distributed-computing-8-the-network-is-homogeneous)


## 8. The network is homogeneous

### The problem
Networks typically must support a wide variety of connected clients -- from desktop-class machines to mobile and <abbr title="Internet of Things">IoT</abbr> devices. These devices and the applications running on them may not be interoperable and a variety of standards-based and proprietary protocols and data formats may be in use.

The network is not homogenous, it is heterogenous.

### Solutions
Interoperability is key.

Where possible, avoid applications that use proprietary protocols in favour of those leveraging standards-based ones. Favour data formats that enable interoperability e.g. JSON or XML over binary formats ([fallacy 7](https://dereklawless.ie/fallacies-of-distributed-computing-7-transport-cost-is-zero) aside) and architectures such as <abbr title="REpresentational State Transfer">REST</abbr> or web services, particularly when integrating with third-party services.
Terraform for Teams
Tags: aws, devops, serverless, terraform
Published: 2020-07-03 15:47:59

---
title: Terraform for Teams
published: true
date: 2020-06-30 00:00:00 UTC
tags: aws, devops, serverless, terraform
canonical_url: https://theconsultingcto.com/posts/terraform-for-teams/
---

A lot of my work over the past few years has involved introducing Terraform into teams that are unfamiliar with both Terraform and the AWS resources we’re building with. The challenge throughout has been to train each developer while ensuring high team productivity by delivering working software. I have not always been successful, but I’ve learned a thing or two along the way.

Terraform has changed a lot since I started using it back at the end of 2016. Getting into a technology early is like stepping on a treadmill—you’re going to have to work to stay in the same place. How can you introduce this technology into a working team while buffering them from the treadmill effect?

Also, when you’re [programming with infrastructure](https://theconsultingcto.com/posts/continuous-delivery-with-terraform/#programming-with-infrastructure) you can’t just spin up a local instance of a [service](https://theconsultingcto.com/posts/continuous-delivery-with-terraform/#services) for a developer. Everything has to be built in the cloud. How can you make it easy for developers to create working environments for themselves? And how can you prevent developers working on the same service from stepping on each other’s toes?

Finally, Terraform is not prescriptive in how to architect your infrastructure. This is probably the single hardest thing for developers to overcome when they start working with Terraform. Terraform provides a lot of primitives, but it’s up to you to assemble them. How can you create a coherent architecture shared across services that a developer will find familiar even as they move from service to service?

Well, [I wrote a script for that](https://github.com/jdhollis/fenna/blob/master/fenna).

## Introducing Fenna

[`fenna`](https://github.com/jdhollis/fenna) is a thin wrapper for Terraform built around [a set of conventions](https://github.com/jdhollis/fenna#conventions) extracted from my experience introducing Terraform into teams. It simplifies [backend management](https://www.terraform.io/docs/backends/index.html) and [developer onboarding](https://github.com/jdhollis/fenna#onboard) while not being overly prescriptive in how you structure your Terraform or your architecture.

I have more to share on how to apply `fenna` to your work, but in the meantime, [give it a try](https://github.com/jdhollis/fenna) and [open an issue](https://github.com/jdhollis/fenna/issues/new) if you have any questions.
Add Linting to Create-React-App
Tags: react, javascript, node, webdev
Published: 2020-06-30 16:36:53

---
title: Add Linting to Create-React-App
published: true
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/uzztab7fmpzp6quqebjn.jpg
date: 2020-06-30 00:00:00 UTC
tags: react,javascript,node,webdev
canonical_url: https://chrisotto.dev/add-linting-to-create-react-app/
---

Image from [Free Illustrations](https://freellustrations.com/).

Create-React-App gives a nice bootstrapped project. I like being able to lint outside of the build or run process of the application, like on pre-commit hooks with husky. To do that I needed to add linting to my create-react-app. Follow these steps to add linting to your create-react-app project and get linting outside of your build process.

## Install packages 📦

This is the most painful part of the process I kept installing one package after another to see if linting worked. All-in-all seven packages later I finally had everything there and ready to run based on the configurations from create-react-app.

```bash
npm i --save-dev babel-eslint eslint-config-react-app eslint-plugin-flowtype eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-react eslint-plugin-react-hooks
```

```bash
yarn add --dev babel-eslint eslint-config-react-app eslint-plugin-flowtype eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-react eslint-plugin-react-hooks
```

## Add ESLint Configuration to `package.json`

You can either supply this in a separate file (`.eslintrc.json`/`.eslintrc.js`) or right in your `package.json`. For larger configuration changes I would recommend a separate file but I’m just extending the react-app configuration and applying a couple of rule adjustments.

```JSON
  "eslintConfig": {
    "extends": "react-app",
    "rules": {
      "semi": 0,
      "no-console": 0
    }
  },
```

## Add Linting Script

Now, all we need to do is to add the linting script to our `package.json` and we’ll be able to lint whenever we want. Even hook up husky or add a specific step for linting in our CI/CD pipeline.

```JSON
  "scripts": {
    ...
    "lint": "node_modules/.bin/eslint --ext js src"
  },
```
Simple, Readable Fonts Available Via CDN
Tags: fonts
Published: 2020-06-29 22:38:49

Fonts to consider for super-readable latin alphabet copy.

### Raleway
New to me, and I like it. But I'll need to look at it for a month before I can decide to use it. Sans-serif, but the q and l both have fine serifs, and the M does not have that long center like Helvetica M. Speaking of comparison to Helvetica, the em height is better, leading to less oblong letters. I'm not a fan of the W.
https://fonts.google.com/specimen/Raleway

### Roboto
By now a classic. Heavier than Raleway. Cleaner and more traditional?? than Raleway.
https://fonts.google.com/specimen/Roboto

### Helvetica
Wonderfully easy to read letter-to-letter, word-to-word. Unfortunately, from a broader viewpoint, e.g. looking at the whole screen, Helvetica text just doesn't have the calm appeal I'm looking for. When I see it, I always want tampermonkey again so I can have it replaced on the fly.
https://www.fonts.com/font/linotype/helvetica

### Rooney
Probably the only serif font that will make this list. But I will probably only use it for sites with less copy.
https://www.janfromm.de/typefaces/rooney/overview/
https://www.janfromm.de/typefaces/rooney/std/

### Verdana Pro
[Verdana](https://docs.microsoft.com/en-us/typography/font-list/verdana) was king of "modern" for years. I find it a bit tiresome now, and it takes up space that I'd rather leave empty. However, I just noticed [Verdana Pro](https://docs.microsoft.com/en-us/typography/font-list/verdana-pro) today, and maybe that's the happy Verdana that uses the space I want to give it. Probably Windows only, or only for machines with Microsoft Office installed.
https://docs.microsoft.com/en-us/typography/font-list/verdana-pro


https://fonts.google.com/specimen/Quicksand
https://fonts.google.com/specimen/Ubuntu
https://fonts.google.com/specimen/Karla
https://fonts.google.com/specimen/Lato
https://www.fonts.com/font/linotype/futura

<hr>

## Other Font Resources

### Identifont
For searching and [comparing fonts](http://www.identifont.com/differences.html).
http://www.identifont.com/index.html

### Microsoft's Font List
Not a list of web fonts.
https://docs.microsoft.com/en-us/typography/font-list/
SwiftUI&#58; Previewing localized text in the canvas
Tags: ios, swiftui
Published: 2020-06-29 23:32:16

---
title:  SwiftUI&#58; Previewing localized text in the canvas
published: true
description: How to view localized text in XCode Canvas
tags: #iOS #swiftui
canonical_url: https://monicagranbois.com/blog/swift/swiftui-previewing-localized-text-in-the-canvas/
---

Last week I watched the [Swift packages: Resources and localization](https://developer.apple.com/videos/play/wwdc2020/10169/) video from [WWDC20](https://developer.apple.com/wwdc20/). One thing I learned was that the Canvas can preview localized values. This is done by adding a locale to a View via the [environment](https://developer.apple.com/documentation/swiftui/environment).

Example:

```swift
import SwiftUI

struct ContentView: View {
    var body: some View {
       Text("greeting")
    }
}

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView().environment(\.locale, Locale.init(identifier: "fr"))
    }
}

```

The above code assumes that a French `Localizable.strings` file exist with a `greeting` key.  For example:

```
"greeting" = "Bonjour le monde!";
```

The [EnvironmentValues](https://developer.apple.com/documentation/swiftui/environmentvalues) documentation lists all the values that can be set.  

![Gif showing the Canvas preview switching greeting text between english, french and german.](https://dev-to-uploads.s3.amazonaws.com/i/zjbaz0l42p6m64uc7hyy.gif)
Explore Enterprise Apache Flink with Cloudera Streaming Analytics - CSA 1.2
Tags: 2020, apacheflink, flank
Published: 2020-06-29 23:15:43

---
title: Explore Enterprise Apache Flink with Cloudera Streaming Analytics - CSA 1.2
published: true
date: 2020-06-29 23:13:00 UTC
tags: 2020,apacheflink,FLANK
canonical_url: 
---

<font size="6"><b><br></b></font>
<font size="6"><b>Explore Enterprise Apache Flink with Cloudera Streaming Analytics - CSA 1.2</b></font>

  

**What's New in Cloudera Streaming Analytics**

  

[https://docs.cloudera.com/csa/1.2.0/release-notes/topics/csa-what-new.html](https://docs.cloudera.com/csa/1.2.0/release-notes/topics/csa-what-new.html)

[https://docs.cloudera.com/csa/1.2.0/index.html](https://docs.cloudera.com/csa/1.2.0/index.html)

  

Try out the tutorials now:   [https://github.com/cloudera/flink-tutorials](https://github.com/cloudera/flink-tutorials)

  

So let's get our Apache Flink on, as part of my FLaNK Stack series I'll show you some fun things we can do with Apache Flink + Apache Kafka + Apache NiFi.

  

We will look at some of updates in Apache Flink 1.10 including the SQL Client and API.

  

We are working with Apache Flink 1.10, Apache NiFi 1.11.4 and Apache Kafka 2.4.1.

  

The SQL features are strong and we will take a look at what we can do.

  

[https://docs.cloudera.com/csa/1.2.0/release-notes/topics/csa-supported-sql.html](https://docs.cloudera.com/csa/1.2.0/release-notes/topics/csa-supported-sql.html)

  

**Table connectors**

- Kafka
- Kudu
- Hive (through catalog)

  

**Data formats (Kafka)**

- JSON
- Avro
- CSV

  

**Using Hive Catalog with Flink SQL:**    [https://docs.cloudera.com/csa/1.2.0/flink-sql-table-api/topics/csa-hive-catalog.html](https://docs.cloudera.com/csa/1.2.0/flink-sql-table-api/topics/csa-hive-catalog.html)

  

**Use Kudu Catalog with Flink SQL:**    [https://docs.cloudera.com/csa/1.2.0/flink-sql-table-api/topics/csa-kudu-catalog.html](https://docs.cloudera.com/csa/1.2.0/flink-sql-table-api/topics/csa-kudu-catalog.html)

  

**Building a DataStream Application in Flink**

[https://docs.cloudera.com/csa/1.2.0/flink-sql-table-api/topics/csa-sql-table-api.html](https://docs.cloudera.com/csa/1.2.0/flink-sql-table-api/topics/csa-sql-table-api.html)

  

**Build A Flink Project**

  

```
mvn archetype:generate \ -DarchetypeGroupId=org.apache.flink \ -DarchetypeArtifactId=flink-quickstart-java \ -DarchetypeVersion=1.10.0
```

  

**References** :

- [https://ci.apache.org/projects/flink/flink-docs-stable/dev/table/sqlClient.html](https://ci.apache.org/projects/flink/flink-docs-stable/dev/table/sqlClient.html)
- [https://github.com/apache/bahir-flink/tree/master/flink-connector-kudu#datastream-api](https://github.com/apache/bahir-flink/tree/master/flink-connector-kudu#datastream-api)