A Quick Way to Add Username and Passwords to Your Python Scripts
The other day I was asked: How do I get usernames and passwords into my Python scripts? For example to use with Netmiko, Scrapli or Nornir. The simple answer to this is the library python-dotenv. Whats python-dotenv? python-dotenv is a library that loads your environment variables from a .env file.
Python is a powerful programming language that can be used for a wide range of tasks. One of those tasks is organizing files. With just a few lines of code,
This all started with a simple question about the R programming language: _is R lexically or dynamically scoped?_ To answer that question, we need to understand what _scope_ is, along with _lexical scope_ and _dynamic scope_....
This recording is part of the Packet Coders member Tech Sessions. Within this tech session we cover: Why Go? Reasons why people choose Go Go for network engineers Go vs (Python | Ruby | C | Rust) Intro to Go Go proverbs Go tool Types system Interfaces Concurrency Network automation overview SSH HTTP
Database Modeling With Ecto Part 2 - has many and belongs to Relationships
Previously, we created the initial Phoenix app and created a Teacher struct and table. We went over how to perform the basic CRUD operations as well as how to do some basic tests to verify the functionality. In part 2, we’re going to be adding more structs and defining relationships between them. We’ll also go over how to fetch records with their associations.
If you haven’t been following along, you can checkout the code from GitHub and fetch the branch:
Add Tags with Ecto has_many, through in Phoenix - Tagging part 1
I want to add tags to products. And as usual there are a situation where a product can have many tags and a tag can belong to many products.
However, in my opnion, the best option is to use a 'has_many :through' relationship. So for this, I need a table called tags and a join table called taggings.
In this tutorial, I will go through how would do this.
Something I do in EVERY project is to setup some sort of relation between resources. And even though Phoenix comes with generators for migrations and CRUD opeartions, you still need to modify the code to suite for the relations you want.
In this short tutorial, I will go through my usual steps regarding setting up a basic has_many / belongs_to - relation.
Components are a mechanism to compartmentalize state, markup, and events in LiveView. We can move a part of the LiveView's logic (and related template) into separate components. We start by moving the product card, the part inside the for comprehension, into a LiveComponent.
Step-by-Step Tutorial to Build a Phoenix App that Supports User Upload
A step-by-step tutorial we see in depth how to build a Phoenix app from scratch, letting users upload their files using a multipart form. We learn how to easily run PostgreSQL with Docker, to receive uploads using Plug, and how to use Ecto to store upload details into the database.
Building an Elixir Encryption Engine with Erlang's Crypto Module
Demystify encryption by taking a medium dive and building your very own encryption engine in Elixir. In this post, we'll build a light-weight Elixir library that leverages Erlang's :crypto to encrypt/decrypt sensitive data, and learn a little more about encryption along the way. Overview Our library will be able
Believe it or not, I spent 3 years of my career without knowing what testability really means, in fact, I never really heard that term until lately. I have been working on small-scale applications, writing tests for every feature I had implemented, b...