teleren/devto huggingface dataset:
Python Packaging: Optional Dependencies
Tags: python
Published: 2023-01-06 01:25:40

---
title: Python Packaging: Optional Dependencies
published: true
date: 2020-05-01 04:43:07 UTC
tags: Python
canonical_url: https://brandonrozek.com/blog/pyextradeps/
---

It is possible to make different package group of optional dependencies for a Python package. This is useful if you want to include an extra set of dependencies for developers/maintainers of the package. We can also define a plugin-based package similarly to how [OpenAI Gym uses it](https://github.com/openai/gym/blob/67212547ac29296839434324a0d5996e48fae840/setup.py) to denote different categories of environments you can setup.

```
from setuptools import setup, find_packages

extras = {
  'typing': ['mypy~=0.740', 'mypy-extensions~=0.4.0', 'pylint~=2.4.4'],
  'testingdocs': ['tox~=3.14.6', 'Sphinx~=3.0.1'],
}

# Meta dependency groups.
extras['all'] = [item for group in extras.values() for item in group]

setup(name='example',
      version='0.0.1',
      packages=find_packages(),
      install_requires=['Flask~=1.1.1'],
      extras_require=extras,
)

```
Conference Call Accessibility
Tags: twiliohackathon
Published: 2020-05-01 04:42:47

## Origin

I was catching up with a friend, who is also a colleague, for the
first time in quite awhile in early March.
We were texting over whatsapp and we were discussing the difficulties
that she has using our video conferencing service now that all her
meetings are remote as she is getting increasingly hard of hearing.

We went on to discuss how some of the apps do real-time
transcription/close-captioning. However, the one the company uses,
primarily, doesn't.  I then had the thought how easy it should be too:

## What I built

* create a web page where the user could enter the audio dial in for their call
* have Twilio dial that number
* pass the audio stream to Google Speech to Text
* feed closed captions back to the user

#### Category Submission: 

COVID-19 Communications: an app to help folks communicate during this challenging time, either to stay connected or to help resolve COVID-19 related challenges.

## Demo Link
[vca dialer](https://dialer.vca.fishjump.com:11080/)

## Link to Code

[vca/dialer-server](https://github.com/vc-accessibility/dialer-server)

## How I built it (what's the stack? did I run into issues or discover something new along the way?)

The application is built on nodejs and express. The entire application runs in a container for easy deployment and scalability. 

I think the biggest problems I ran in to were those typical "gaps in documentation." The items are probably documented somewhere but it took a long time to find because I was trying to stand something up that was new. 

## Additional Resources/Info
While doing this, I need the Twilio CLI and I hate installing things...

If you need the Twilio CLI but don't want to actually install it, I also wrote a "[twilio-helper](https://github.com/vc-accessibility/twilio-helper)" container that should be handy.

## Acknowledgements

The application is largely based on work from [nokenwa's demo](https://github.com/nokenwa/twilio-media-stream-live-transcription-node).

As always, many, many references on the internet.
I think I have about 70 odd tabs open.
Diceware
Tags: security
Published: 2023-01-06 01:25:52

---
title: Diceware
published: true
date: 2020-05-01 04:22:31 UTC
tags: Security
canonical_url: https://brandonrozek.com/blog/diceware/
---

Diceware is a passphrase generator proposed by [Arnold G. Reinhold](http://diceware.com/). Passphrases contain multiple words which are chosen according to a sequence of dice rolls. Let’s look at a simplified example where we have binary dice (0 or 1) and we have a wordlist of two dice rolls.

```
00	abacus
01	abdomen
10	abdominal
11	abide

```

If you roll a zero twice, then you choose the word `abacus`. If you roll a zero and then a one, you choose the word `abdomen`.

In reality, [Joseph Bonneau](https://www.eff.org/about/staff/joseph-bonneau) over at the EFF, compiled a wordlist that consists of six dice rolls with a regular 5 sided dice. Resulting in a total of $6^5$ or 7776 different [english words](https://www.eff.org/files/2016/07/18/eff_large_wordlist.txt).

Instead of rolling physical dice forever, we can use a nicely put together python package called [`diceware`](https://github.com/ulif/diceware/). It is easily installable via pip: `pip install diceware`. The README explains the security implications far better than I can. At the time of writing, it uses by default `urandom` on Linux to choose 6 words from the EFF word list from before.

```
diceware

```

Gave me the random passphrase “DrearilyUncorruptOutboardKneeSubzeroGumdrop”.
Node AWS S3 Photo Gallery Starter Project
Tags: node, bootstrap, angular, aws
Published: 2020-05-01 04:19:44

:beginner: I created a quick little project to demonstrate how to pull data from amazon #AWS #S3 #cloudstorage with nodejs.  My primary language of choice is typically #C, but I know a large majority of developers in the community prefer #node.

I will continue to add on to the project when I have more time.  This was a great experience making this for you guys to use, and I am looking forward to doing alot more NodeJS projects.



Where to Get it: 
:link: [https://github.com/arthicksdev/NodeAWSS3PhotoGallery]

Let me know your thought's or if there is anything specific you would like to see.

:v: @arthicksdev
Traduzindo as docs do Gatsby em 4 passos
Tags: opensource, gatsby, tutorial, github
Published: 2020-05-01 04:00:29

Muitos de nós brasileiros temos dificuldade em aprender outro idioma, seja por falta de recursos, oportunidades, interesse pessoal e por aí vai. Mas o assunto não é esse...

![Friends](https://dev-to-uploads.s3.amazonaws.com/i/y8y7ay8ex2lqzjhlcp7q.gif)

Pensando nisso, uma galerinha resolveu contribuir com a comunidade **Gatsby** brasileira ajudando na tradução das documentações para pt-BR e sabe o melhor disso tudo? Você também pode ajudar =)

É bem simples, vamos aprender:

1. Vá até o [repositório oficial](https://github.com/gatsbyjs/gatsby-pt-BR) de tradução do Gatsby para pt-BR

2. Clique em [issues](https://github.com/gatsbyjs/gatsby-pt-BR/issues), escolha qual você deseja contribuir e coloque nos comentários para que os moderadores possam ver no que você irá contribuir

3. De o **Fork** no repositório e comece a contribuição

4. Após ter realizado todas as alterações, abra um **pull request** para que os moderadores possam aceitar ou abrir correções daquilo que você traduziu

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/dveali2r08si9wzswnfo.gif)

> Caso você ainda tenha dúvidas em como contribuir, [neste link](https://github.com/gatsbyjs/gatsby-pt-BR/blob/master/CONTRIBUTING.md) tem todas as informações que você precisa saber

Você também pode aprender com este video aqui: [Tutorial - Traduzindo as docs do Gatsby](https://drive.google.com/file/d/1cmwL_yJHYtHoCrlBGM7zZaBvSlrTVsg0/view?usp=sharing)

Viu como é fácil? Tá aí uma boa maneira de você contribuir com a comunidade brasileira do Gatsby e ainda aprender um novo idioma, conhecer novos desenvolvedores e o mais legal de tudo: ter seu nome no repositório oficial do **Gatsby** !
May 1st, 2020: What did you learn this week?
Tags: weeklylearn, discuss, weeklyretro
Published: 2020-05-01 04:00:04

It's that time of the week again, just a day early. I'm off tomorrow and Monday so posting this now.

So wonderful devs, what did you learn this week? It could be programming tips, career advice etc.

<center>

![Justin Timberlake saying it's just May](https://media.giphy.com/media/l3V0zeekyJuwYOE0M/giphy.gif)

</center>

Feel free to comment with what you learnt and/or reference your TIL post to give it some more exposure.

{%tag todayilearned %}

And remember, if something you learnt was a big win for you, then you know where to drop it as well.👇👇🏻👇🏼👇🏽👇🏾👇🏿

{% link https://dev.to/jess/what-was-your-win-this-week-4j3b %}

<center>

![Johnny Rose from Shitt's Creek giving a power high five](https://media.giphy.com/media/4QFAH0qZ0LQnIwVYKT/giphy.gif)

</center>

Photo by [Wes Hicks](https://unsplash.com/@sickhews?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) on [Unsplash](Photo by Wes Hicks on Unsplash)
Crystal Fridays - May 2, 2020
Published: 2020-05-01 03:58:04

I'll be expanding [cprox](https://github.com/arschles/cprox) and writing some more specs for the new functionality.

Join me at 10am Pacific Time at [twitch.tv/arschles](https://twitch.tv/arschles).

I'll have the chat up and ready for questions/comments.

See you there!
Customer support Chatroom
Tags: twiliohackathon
Published: 2020-05-01 03:53:36

[Comment]: # (All of this is placeholder text. Use this format or any other format of your choosing to best describe your project.)

[Reminder]: # (Make sure you've submitted the Twilio CodeExchange agreement: https://ahoy.twilio.com/code-exchange-community)

[Important]: # (By making a submission, you agree to the competition's terms: https://www.twilio.com/legal/twilio-dev-hackathon-terms)


## What I built
In this pandemic, we are very much dependent on our nearby stores to deliver the goods and services. These stores have websites but if any issues come up the only way to connect to them is manually or via phone.  

In such situations, the phone is either busy or not reachable. So in order to enhance the communication, I have built a chatroom service with features like schedule a phone call and get SMS updates.

Through this chatroom, the client can connect with customer care discuss the issues over chat and if required can also schedule a call and register himself to get SMS updates. My major motive was to increase the means of communication so that both the parties do not face issues and are not blocked. Customers can easily avail the services and get the work done on time and also the stores don't lose their customers. :smile:
 

## Link to Code
[Github Repository Link](https://github.com/Jasmin2895/twilio-support-chat)

## Features
 This project supports different means of communication like chat, voice call, and SMS 


* Basic chatroom

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/4fjr1m6qife5clgewyku.png)

**To chat between two people open the application in two tabs. The first user will be the customer and the second will be the customer agent.**

* Schedule a call for assistance.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/b6hguq6guokeda6b3fmn.png)

* Register your Phone Number to get updates about the progress of the issue.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/md8kk7rkpmqas88anbh4.png)

When the user submits his Phone Number he will get a phone call at the moment and the same for SMS.
SMS will be received in bulk as for the testing purpose some data is fed into DB. So as soon as the user register for SMS service he will be getting multiple automated messages as a CRON is running to send the automated message to the user based on the time.

## Tech Used

* Backend - Node.js and Express.js
* Frontend - React
* Twilio Chat service
* Twilio Voice Call service
* Twilio SMS service




## Additional Resources/Info
[Previous Article](https://dev.to/jasmin/support-chatbot-for-food-stores-4poo)

In the end, I would like to thank the **Dev team** and **Twilio Team** for giving this amazing opportunity to try some new challenging problems. 
Keep inviting us to more hackathons. :heart:
Code in LaTex
Tags: latex
Published: 2023-01-06 01:26:10

---
title: Code in LaTex
published: true
date: 2020-05-01 03:46:05 UTC
tags: LaTex
canonical_url: https://brandonrozek.com/blog/latexcode/
---

I am currently working on a paper in LaTex and wanted to include some source code in it. I didn’t want to use the default `verbatim` environment since I wanted to include syntax highlighting as well. Luckily, the `listings` package is an easy and extensible way to include source code inside LaTex documents. To speak first of its extensibility, here is a subset of the arguments that it can possibly take:

| Argument | Description |
| --- | --- |
| aboveskip | Amount of space to include above code. |
| backgroundcolor | Background color |
| basicstyle | Font-style of code (Color & Size) |
| belowskip | Amount of space to include below code. |
| breakatwhitespace | Only break at whitespace (boolean) |
| breaklines | Automatic Line Breaking (boolean) |
| commentstyle | Font-style of comments (Color & Size) |
| frame | Type of frame: `l` for left, `r` for right, `t` for top, `b` for bottom; can use combination of letters or `single`. |
| keywordstyle | Font-style of keywords (Color & Size) |
| language | Language of code (for highlighting purposes) |
| numbers | Where to put the numbers: `none`, `left`, or `right`. |
| numbersep | How far the line-numbers are from the code. |
| numberstyle | Font-style of numbers (Color & Size) |
| stringstyle | Font-style of strings in code (Color & Size) |
| tabsize | Default tab size in terms of spaces. |
| title | Show filename included in `\lstinputlistings` or caption. |

Here is an example of code that I used in a paper

```
\usepackage{color}
\usepackage{listings}
\definecolor{keyblue}{rgb}{0.1, 0.1, 0.6}
\definecolor{dkgreen}{rgb}{0,0.6,0}
\definecolor{gray}{rgb}{0.5,0.5,0.5}
\definecolor{stringcol}{rgb}{0.58,0.4,0.1}

\lstset{frame=l,
  language=Python,
  aboveskip=3mm,
  belowskip=3mm,
  columns=flexible,
  basicstyle={\small\ttfamily},
  numbers=left,
  numberstyle=\tiny\color{gray},
  numbersep=2mm,
  keywordstyle=\color{keyblue},
  commentstyle=\color{dkgreen},
  stringstyle=\color{stringcol},
  breaklines=true,
  tabsize=4
}

\begin{lstlisting}
def greeting():
	return "Hello!"

# Printing the greeting to the screen
print(greeting())
\end{lstlisting}

```

![image-20200501001231572](https://brandonrozek.com/files/images/blog/20200501001231572.png)
Twilio App to get COVID-19 Updates
Tags: twiliohackathon, javascript, beginners
Published: 2020-05-01 03:44:56

## What I built
#### Category Submission: COVID-19 Communications

I built a Twilio app that sends users the latest COVID-19 statistics for either a state or country.

## Demo Link
You can try it out by texting <a href="tel:415-562-0796">415-562-0796</a>. Here is a short video demo:

{% youtube 0n3D7uxa0Co %}

## Link to Code
The code is here https://github.com/programming-liftoff/twilio-covid-data/blob/master/twilio-function.js.

I also made a tutorial how this function was used in Twilio to create the complete program https://dev.to/programmingliftoff/build-a-twilio-app-to-get-covid-19-case-counts-gii.

## The Stack
I built this using Twilio Functions, Twilio Studio, and this COVID-19 API https://corona.lmao.ninja/docs/.
A speech therapy game, powered by Twilio Video
Tags: twiliohackathon
Published: 2020-05-01 00:24:12

[Comment]: # (All of this is placeholder text. Use this format or any other format of your choosing to best describe your project.)

[Reminder]: # (Make sure you've submitted the Twilio CodeExchange agreement: https://ahoy.twilio.com/code-exchange-community)

[Important]: # (By making a submission, you agree to the competition's terms: https://www.twilio.com/legal/twilio-dev-hackathon-terms)


## What I built
#### Category Submission: COVID-19 Communications

Memory is a game that Speech-Language Pathologists (SLPs) can use to facilitate therapy over video and voice chat.  COVID-19 has eliminated most in-person speech therapy, which tends to take place in schools and clinics.  Many SLPs choose to use games as a pretense for therapy for younger patients, but these games need to meet four requirements:

1. Video and voice chat to facilitate the therapy
2. A visual game interface
3. SLP controls the flow of the game to encourage practice
4. Strong security and privacy

Currently, there are not many options available for SLPs that satisfy all of these requirements... until now!

## Demo Link
https://memory.slpgames.com

This project is a simple memory matching game.  Before the therapy session, the SLP chooses an appropriate number of cards, and then selects one or more articulation decks:

![image](https://user-images.githubusercontent.com/1910118/80770500-b5411b00-8b0d-11ea-8349-7135fe56d4d1.png)

Then, the SLP chooses particular words to use in the game, using their experience to select which words would be best for the person to practice:

![image](https://user-images.githubusercontent.com/1910118/80770714-3698ad80-8b0e-11ea-876f-eb4b5f9d601f.png)

Finally, two links are generated: one for the SLP, and one for the client.  These can be added to a calendar invite or sent in an email ahead of the therapy session.

When the therapy session starts, both the SLP and client join the session via their respective links.  The Twilio Video SDK is used to open video, audio, and data channels between the browsers, and the game/therapy can commence:

![image](https://user-images.githubusercontent.com/1910118/80771094-8f1c7a80-8b0f-11ea-8b5c-10f183c9d7b6.png)

The SLP controls the flow of the game.  A young student might select two cards, and then be asked to use both words in a sentence.  The SLP controls when the student can take their next turn, ensuring that there is a good balance between gameplay and therapy.  The above screenshot is what the SLP sees; the student has no controls available in the bottom right quadrant.

## Link to Code
https://github.com/scott113341/slp-memory

## How I built it

The project is built using:

- Video/voice/data: [Twilio Video](https://www.twilio.com/video)
- Frontend: [Vue.js](https://vuejs.org/)
- Backend and hosting: [Vercel](https://vercel.com/)
- Database: [Airtable](https://airtable.com/)

## Additional Resources/Info

- [SLP Games](https://slpgames.com/)
Installing the Heroku CLI on WSL
Tags: quicktip, tip, heroku, wsl
Published: 2020-05-01 03:23:29

Wait, wait, let me guess...
#### You're running WSL.
#### You're trying to install Heroku on the command line.
#### It's not working.

First, you tried downloading the installer, and that didn't work.

Then, you tried tossing `sudo apt-get heroku` into your bash terminal, and that didn't work.

And then you ended up here. (Or, more likely, searching way too long on StackOverflow.)

## Never fear: the answer is right here. 
Pop open that bash terminal, and toss in this line:

```bash
curl https://cli-assets.heroku.com/install.sh | sh
```

Then lean back and let the Heroku CLI install.

![BOOM! Done... sort of.](https://media.giphy.com/media/NSlZlsaGjhMd0Xjzu9/giphy.gif)

You're not done quite yet, though. Once it's installed, give `heroku apps` or `heroku open` a whirl and you should be prompted with an opportunity to log in.

Enter those credientials, and all of the magic of the Heroku CLI is yours.

![It's like navigating Legends of the Hidden Temple, forreal](https://media.giphy.com/media/xT1Ra7ebJPSbOhbnH2/giphy.gif)

One thing to note, you probably have to add an `--app` flag for whatever apps you're running a command against. While most of the Heroku documentation doesn't indicate that, you'll want to include `-a your-app-name` at the end of **every command** you run that's app-specific.

For example, the documentation for running migrations says to use `heroku rake db:migrate`. But you'll have to use `heroku rake db:migrate -a your-app-name`. Trying to see your error logs? Try `heroku logs -a your-app-name` instead of `heroku logs`. You can check out which commands require the `-a` or `--app` flag, and which don't on the [giant list of Heroku CLI commands](https://devcenter.heroku.com/articles/heroku-cli-commands).

![Way to go, Heroku bro!](https://media.giphy.com/media/111ebonMs90YLu/giphy.gif)
**Looks like you're off to the races, my WSL compadre.**

*Want to know more about why `curl` works? Check out the ultimate guide to [everything curl](https://ec.haxx.se/cmdline)!*
OpenVPN Container
Tags: containers
Published: 2023-01-06 01:26:25

---
title: OpenVPN Container
published: true
date: 2020-05-01 03:20:49 UTC
tags: Containers
canonical_url: https://brandonrozek.com/blog/openvpncontainer/
---

Instead of configuring multiple containers to use a VPN, we can setup a VPN container and route the other containers traffic through this container. This post will outline how to do that with [dperson’s OpenVPN Container](https://github.com/dperson/openvpn-client).

I’m a huge fan of docker-compose, so here we go:

```
version: "3.3"
services:
  openvpn-client:
    image: dperson/openvpn-client
    cap_add:
      - net_admin
    security_opt:
      - label:disable
    container_name: openvpn-client
    hostname: openvpn-client
    environment:
      - PUID=1000
      - PGID=1000
    volumes:
      - /dev/net:/dev/net:z
      - /volumes/openvpn-client/vpn/:/vpn
    restart: always

```

The `net_admin` capability according to the documentation “perform various network-related operations”. This would make sense since an additional network interface is configured for a VPN connection. The `label:disable` definition is to disable label confinement.

In this setup, you will need to put the `.ovpn` profile that you wish to connect to under the `/volumes/openvpn-client/vpn/` directory.

## (Optional) Username/Password Setup

In the event you need a username and password to connect, create a file called `pass.txt` in the same directory as your ovpn profile. The file `pass.txt` will contain the username in the first line and the password in the second line. Then in your ovpn profile make sure you have a line that says `auth-user-pass pass.txt`.

## Routing Traffic through VPN

Let’s say your ISP throttles torrent connections and you want to route your `qBittorrent` container so that you can download Linux distributions faster. Here’s how you can define it in the docker-compose file.

```
qbittorrent:
  image: linuxserver/qbittorrent
  container_name: qbittorrent
  environment:
    - PUID=1000
    - PGID=1000
    - UMASK_SET=022
    - WEBUI_PORT=8000
  volumes:
    - /volumes/qbittorrent/config:/config
    - /volumes/qbittorrent/downloads:/downloads
  network_mode: service:openvpn-client
  restart: always

```

## Network Workarounds

Sadly as of the time of writing, routing a container’s traffic makes it lose its ability to belong to a network. I knocked into this when I tried accessing the qBittorrent API. So for the sake of example, if you want to connect to qbittorrent, you need to route the traffic to the openvpn-client container at port 8000 which we specified earlier to be the webui port of qbittorrent.
Placeholder titlehmb
Tags: twiliohackathon
Published: 2020-05-01 03:20:22

[Comment]: # (All of this is placeholder text. Use this format or any other format of your choosing to best descnnvkmnribe your project.)lnl

[Reminder]: # (Make sure you've submitted the Twilio CodeExchange agreement: https://ahoy.twilio.com/code-exchange-community)

[Important]: # (By making a submission, you agree to the competition's terms: https://www.twilio.com/legal/twilio-dev-hackathon-terms)


## What I built
#### Category Submission: v


## Demo Link
 

## Link to Code


## How I built it (what's the stack? did I run into issues or discover something new along the way?)


## Additional Resources/Info