teleren/devto huggingface dataset:
Passman - a password manager for the command line
Tags: python, linux, gpg, security
Published: 2021-07-19 18:03:42

## Introduction

Passman is a python script that encrypts your passwords with `gpg`.  The inspiration for this project came from ![pass](https://passwordstore.org), a shell script that does the same thing.

## Dependencies

`gpg` and `xclip` should be installed.  No external python libraries were used.

## Structure

Passman stores credentials in the following file structure:

```
-- Website name
       |
       -- username_1.enc
       |
       -- username_2.enc
```


Passwords are copied to the clipboard with `xclip`, and are cleared from the clipboard after one paste.  Configuration is done via a json file, which must be named `config.json`, and be in the same directory as `passman.py`.  Since there are no external dependencies, `passman.py` can be moved around and placed wherever, as long as the `store_path` variable in `config.json` is set correctly.
CSS Display inline, block, and inline-block
Tags: html, css, webdev, codenewbie
Published: 2021-07-19 17:44:49

In this post, we will discuss the difference between three common CSS display properties:

1. `inline`
2. `block`
3. `inline-block`

## 1. `inline`

Inline elements do not start from a new line. You can not set `width` or `height` values for them. Even if you set a value, it won't have any effect.

Examples:

- `<span>`
- `<a>`
- `<img>`
- `<u>`
- `<e>`
- `<strong>`

## 2. `block`

Block elements always start from a new line. They take up the whole space available to them. You can set their `width` and `height`.

Examples:

- `<div>`
- `<header>`
- `<footer>`
- `<section>`
- `<main>`
- `<aside>`
- `<h1>`
- `<p>`

## 3. `inline-block`

These elements are formatted just like `inline`, but you can set their `width` and `height`, similar to `block`.

Examples:

- `<button>`
- `<select>`

Hope this helped 😊

{% codepen https://codepen.io/dasshounak/pen/eYWdEGr %}
Npm libraries you need to know for your Node JS App
Tags: node, npm, discuss, javascript
Published: 2021-07-19 17:41:21

NPM Libraries you need to know for Node Js

📌 Bull

The fastest & most reliable redis based queue for node

https://t.co/Qe6yXdp2FR

📌 Bull Board

This is built in top of bull which helps to visualise the queue & their jobs

https://t.co/rJe8LJ5Mvp

📌 Lodash

One of the best utility library for javascript

https://t.co/UtRuwgOLgs

📌 Jest

Complete and ready to set-up JavaScript testing solution. A great one if you are following Test driven development

https://t.co/kkFZuMxif8

📌 Express winston

express-winston provides middlewares for request and error logging of your express app and also provides variety of options as well

https://t.co/PNDSMNOD7N

📌 User Agent

Helps to determine the device information

https://t.co/AWDBpjTy0u

📌 Ip address

Helps to deal with Ipv4 & Ipv6 addresses in Javascript

https://t.co/sS52oErRih

📌 Uuid

Helps in generation of unique identifier to be added in your application

https://t.co/WSNf7zxs0G

📌 Joi

Most famous & powerful data validation & schema description language in Javascript

https://t.co/JD0JIQ2iW2

📌 Winston daily rotate file

It is a transport of winston that logs information to a rotating file. Logs can be removed after some days and also rotation of log files can be based on date, size & limit

https://t.co/aZvJww5eqE

If you know anymore famous npm libraries feel free to add below 👇

To know more tech related information let's stay connected via [Twitter](https://twitter.com/Dhanush_Nehru)
Create a Spotify HomePage with NextJs.
Tags: css, react, javascript, beginners
Published: 2021-07-19 17:34:13

HomePage=>[👁 View Now:](https://spotify-home-page.vercel.app)
## Github Repo
[Repo Link:](https://github.com/Ammyy9908/spotifyHomePage)

### Project Structure

--Components(Ui React Components)
--data:(Hardcoded Spotify Plans Data)
--styles(All css Styles)
--pages(All pages that can be navigate)



#### Note 📙 All components in the project is Functional React components and there is no fully interaction as in Real Spotify Website it's just a standalone not fully dynamic nor a fully static.


## Components

<strong>1.Footer.jsx</strong>

This component represent the Footer UI of the Home Page.

<strong>2.HomeHero.jsx</strong>

HomeHero build the Top Hero Section of the Home Page.

#### 3.InputGroup.jsx

A Custom React Component used for Login & SignUp form.

#### 4.Layout.jsx

A Layout component which render some UI components based on page route.

#### 5.Logo.jsx

A Custom component to render the Spotify Logo in Navbar Component.

#### 6.Logo2.jsx

Another React Component which is used to render spotify black logo in svg format used in Login & Signup Page.

#### 7.Navbar.jsx

A React functional component which use to render the Navbar UI of the Page.

#### 8.PlanCard.jsx

A React Card Component use to Display a Single Plan Card for the Spotify subscription plan.

#### 9.Plans.jsx

A React component which contains a wrapper in which we iterate through the list of plans imported from the data directory by using Array.map() method.

#### 10.Sidenav.jsx

Last React Component use to build the Sidenav for the Pages which we can toggle by clicking on hamburger menu button from top right.

## Pages

#### 1.index.js

This will render the index or home page of the spotify home page.

#### 2.login.js

This represent the Login Screen of the Spotify Login Page.

#### 3.register.js

This will render the registration page containing some other custom components which i declared above.

#### 4.premium.js

This will display the Plans for the Premium Users.

#### 5.support.js

This page renders the support page ui of the spotify home page.

#### 6.download

This is the last page in whole project just renders the download page of the spotify website.


### Author

😜~ [Sumit](https://github.com/Ammyy9908) 

1.[Website:](https://ammyy9908.github.io/PortfolioSumit/)
2.[Github:](https://github.com/Ammyy9908)
3.[LinkedIn:](https://www.linkedin.com/in/sumit-kumar-097a3a204/)

## Show Your Support 

~by giving ⭐️ to this Project
Installing Scrapy in Fedora34 with pypy( pypy3 )
Tags: scrapy, pypy, fedora34, personal
Published: 2021-07-19 17:23:56

# Pre-context:
The thing is I love fast things. And I am sure the reader also pursue same nature like me. Hence, pypy3 is the choice.
Fedora is nice but for me it is new and new thing is not always hassle free so to make your life better this instructions will be life saving.

First install pypy3 and respective pip pkgmanager:
```
sudo dnf install pypy3
wget https://bootstrap.pypa.io/get-pip.py -o get-pip.py
pypy3 get-pip.py
``` 
Then install the below dependencies which are the root cause of scrapy installation failures. So do it carefully.

```
sudo dnf install pypy3-devel
sudo dnf install libxml2-devel
sudo dnf install libxslt-devel
sudo dnf install @development-tools
sudo dnf install libffi-devel
install them if you find them: [zlib1g-dev, libssl-dev] (optional)
```
Now create virtual environment:
```py
pypy3 -m venv venv
```
Activate the virtual environment:
```py
source venv/bin/activate
```
Now install scrapy:
```py
pypy3 -m pip install setuptools
pypy3 -m pip install scrapy
```
Hopefully scrapy will be installed successfully.
Now create scrapy project.
```py
scrapy startproject demo
```
Create a spider:
```py
cd demo
scrapy genspider demo demo
```
In fine, this is the way to have our beloved scrapy working in fedora.
If you have any problem you can comment below. I will try my best to resolve it.
So, you want to launch several threads in Python and something does not work?
Tags: python, threading, programming
Published: 2021-07-19 17:22:40

<a href="https://www.flickr.com/photos/fernand0/415859306/" title="Hilos de colores "><img src="http://live.staticflickr.com/52/415859306_e77c449fd3.jpg" alt="Hilos de colores " width="240" height="180" border="10"></a>

I was refactoring some program and I discovered that my concurrence was not working well: I programmed some `concurrent.futures.ThreadPoolExecutor` tasks but some of them were waiting until the others finished.
This was a problem because the program was launched once each hour and it was not finishing in time for the next run. I had the program running several times (not a problem of concurrency since it is mostly well behaved, but definitely a non desirable way of working).

The problem? Well, these methods (`ThreadPoolExecutor`, `ProcessPoolExecutor`, ...)   have a `max_workers` limit which is defined as follows:

> Changed in version 3.8: Default value of max_workers is changed to min(32, os.cpu_count() + 4). This default value preserves at least 5 workers for I/O bound tasks. It utilizes at most 32 CPU cores for CPU bound tasks which release the GIL. And it avoids using very large resources implicitly on many-core machines.

The machine where this program is running is a cheap 1 vCPU machine, and this is a problem. However, my processes are very light, they just do some input, wait some time, do some output and that's all.

The solution? You can count (or at least, have some idea about it) the number of threads and set an adequate value for this `max_workers` parameter.

In my case:
     
    with concurrent.futures.ThreadPoolExecutor(max_workers=75) as pool:
    ...

That is, 75 workers. As stated previously I have no problems with these processes and this allows the program to run all of them in a concurrent way.
iOS App Review on iPhone: Resume Builder - Professionals on App Store Connect
Tags: ios, ipad, swift, appstore
Published: 2021-07-19 17:05:33

App Store Connect: 
https://apps.apple.com/gr/app/resume-builder-professionals/id1569380836


YouTube Video: 
https://youtu.be/089SGaIYFOw

iOS App Review on #iPhone: Resume Builder - Professionals on App Store Connect

The Resume Builder for #LinkedIn users is an iOS mobile application that offers a great user experience for building your ideal template to earn your job of your preference.

LinkedIn has a lot of jobs worldwide, but it is needed to upload a great material including in your #CV with no time.

Your job-hunting is already started on LinkedIn. Good luck!

Resume Builder - Professionals is the next social network for professionals that like LinkedIn networks and groups. Build your professional network based on Resume Builder, connect with anyone, and use your professional profile as an online resume with Apple Sign-In, Google Sign-In, Microsoft Sign-In and GitHub for developer professionals.

JOB SEARCH

• Search and apply to millions of job openings including your responsive resume
• Upload and easily submit your resume to jobs that fit on LinkedIn jobs
• Save searches and create alerts to be the first to know about new job openings and worldwide events

The Resume Builder - Professionals app has a low cost to use and download.

---------------------------

There are no additional subscriptions or premium plans. Find a job, create your business, find and hire the new talented persons worldwide with a really low cost on 4.99 $ all over the world.

Privacy Policy: https://opendevops.dev/
Terms of Service: https://opendevops.dev/
Installing OpenCV on Windows for C++
Tags: opencv, windows, visualstudio, cpp
Published: 2021-07-19 17:05:16

OpenCV is a library of programming functions mainly aimed at real-time computer vision. OpenCV was built to provide a common infrastructure for computer vision applications and to accelerate the use of machine perception in the commercial products. Being a BSD-licensed product, OpenCV makes it easy for businesses to utilize and modify the code.

Here are the simple installation guide to install OpenCV on Windows:
 
* Go to https://github.com/opencv/opencv and download the latest release. Extract files to local drive (eg : C)

![Screenshot (59)](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xe24ujmosn26tqlglytj.png)

* Add **bin** folder to the Environment Variables path.
 For eg: `C:\opencv\build\x64\vc15\bin` 

![Screenshot (60)](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6w2d71ppgzw90h6rk5nx.png)

* Create a New Visual Studio project C++ console.
  
    Set the platform target to `x64`

![Screenshot (50)](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l4jdcx6urg2lp3a94vff.png)
 
* Add Directories by going to: `Project->Properties->Configuration Properties`-

![Screenshot (51)](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d3aquify7c0ukznmx5p1.png)
 
  **VC++ Directories**
    1. Add Build Directories: `C:\opencv\build\include`
    2. Add Library Directories: `C:\opencv\build\x64\vc15\lib`

![Screenshot (53)](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n5hnjekybov4z9o7u1s1.png) 

  **Linker Input** 
    1. Add to Linker->Input: `opencv_world452d.lib` (`452` depends 
       on your OpenCV version)
       `d` for debug, without `d` for release 

![Screenshot (55)](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9fvhsx2gksuz13i4fh0n.png)

* Click on your Project name on right side in *Solutions Explorer*, and right-click on it to *Add* a *New Item*. 

Select **C++ File** and rename it as `test.cpp`.

![Screenshot (56)](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vhtypnv2olw68o8lg57a.png) 

* Finally, you can run this demo code in your visual studio IDE to 
  see if it’s all working fine.
```C++
	#include <opencv2/imgcodecs.hpp>
	#include <opencv2/highgui.hpp>
	#include <opencv2/imgproc.hpp>
	#include <iostream>
	
	using namespace std;
	using namespace cv;
	
	void main() {
	
		VideoCapture cap(0);
		Mat img;
	
		while (true) {
	
			cap.read(img);
			imshow("Image", img);
			waitKey(1);
		} 
	} 
```
 * Your Output Screen should display your live Web-Cam feed.  

![Screenshot (61)](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ky5tyyzsj95ljjhnx07z.png)
   
And that’s all, you can now use OpenCV with ease. 😉 

For more install information, visit the [OpenCV official guide](https://docs.opencv.org/2.4/doc/tutorials/introduction/windows_visual_studio_Opencv/windows_visual_studio_Opencv.html).
A Cloud Migration Questionnaire
Tags: aws, cloud, microservices, architecture
Published: 2021-07-19 16:53:13

The questions you must ask your customers before migrating their on-premise workload to AWS Cloud.

[![Cloud Migration Questionnaire. Image by author](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5cxy6ft4fd59xlkg9e01.png)](https://betterprogramming.pub/a-cloud-migration-questionnaire-for-solution-architects-dec7ffcf063e?source=friends_link&sk=accffce9d79a29769a908036b90f9845)

- [Why do you want to migrate to the cloud?](https://betterprogramming.pub/a-cloud-migration-questionnaire-for-solution-architects-dec7ffcf063e#28dc)
- [How many code changes can you afford as part of migration?](https://betterprogramming.pub/a-cloud-migration-questionnaire-for-solution-architects-dec7ffcf063e#06f8)
- [What type of database are you using?](https://betterprogramming.pub/a-cloud-migration-questionnaire-for-solution-architects-dec7ffcf063e#edbe)
- [What type of load balancers are you using?](https://betterprogramming.pub/a-cloud-migration-questionnaire-for-solution-architects-dec7ffcf063e#fe49)
- [What application servers and versions are you using?](https://betterprogramming.pub/a-cloud-migration-questionnaire-for-solution-architects-dec7ffcf063e#69e0)
- [What operating system are you using?](https://betterprogramming.pub/a-cloud-migration-questionnaire-for-solution-architects-dec7ffcf063e#f325)
- [Is your application public facing?](https://betterprogramming.pub/a-cloud-migration-questionnaire-for-solution-architects-dec7ffcf063e#f6b2)
- [Is your application stateful or stateless?](https://betterprogramming.pub/a-cloud-migration-questionnaire-for-solution-architects-dec7ffcf063e#6e29)
- [Is your application containerized?](https://betterprogramming.pub/a-cloud-migration-questionnaire-for-solution-architects-dec7ffcf063e#afeb)
- [What are the current resource requirements of the servers?](https://betterprogramming.pub/a-cloud-migration-questionnaire-for-solution-architects-dec7ffcf063e#63e2)
- [How is your workload variation?](https://betterprogramming.pub/a-cloud-migration-questionnaire-for-solution-architects-dec7ffcf063e#86c2)
- [What are your logging and monitoring requirements?](https://betterprogramming.pub/a-cloud-migration-questionnaire-for-solution-architects-dec7ffcf063e#0b9e)
- [What is your current backup strategy?](https://betterprogramming.pub/a-cloud-migration-questionnaire-for-solution-architects-dec7ffcf063e#ecab)

Take a look at a detailed [post](https://betterprogramming.pub/a-cloud-migration-questionnaire-for-solution-architects-dec7ffcf063e?source=friends_link&sk=accffce9d79a29769a908036b90f9845) to know why these questions are important and how it helps to lay the foundation for future design solutions and plan migrations better.
K-mean clustering and its real use-case in the security domain
Published: 2021-07-19 16:14:06

*What is K- Means Clustering ?*
We are given a data set of items, with certain features, and values for these features (like a vector). The task is to categorize those items into groups. To achieve this, we will use the k-Means algorithm; an unsupervised learning algorithm.
1. *Document classification*
cluster documents in multiple categories based on tags, topics, and the content of the document. this is a very standard classification problem and k-means is a highly suitable algorithm for this purpose. the initial processing of the documents is needed to represent each document as a vector and uses term frequency to identify commonly used terms that help classify the document. the document vectors are then clustered to help identify similarity in document groups.
2. *Identifying crime localities*
With data related to crimes available in specific localities in a city, the category of crime, the area of the crime, and the association between the two can give quality insight into crime-prone areas within a city or a locality.
3. *Insurance fraud detection*
Machine Learning has a critical role to play in fraud detection and has numerous applications in automobile, healthcare, and insurance fraud detection. utilizing past historical data on fraudulent claims, it is possible to isolate new claims based on its proximity to clusters that indicate fraudulent patterns. Since insurance fraud can potentially have a multi-million dollar impact on a company, the ability to detect frauds is crucial.
4. *Cyber-profiling criminals*
Cyber-profiling is the process of collecting data from individuals and groups to identify significant co-relations. The idea of cyber profiling is derived from criminal profiles, which provide information on the investigation division to classify the types of criminals who were at the crime scene.
Thank You...
how much do you test
Published: 2021-07-19 16:28:41

while doing testing content for my church i found a bug that ony affected chrome and android devices. which brings me to my topic we all have favorite browser but do we consider what other browsers do to our project this is why QA is a good skill as a developer reporting and collecting bugs reports helps give you the tools to be aware of issues and fix thme before your clients are aware.
SEO in 2021 and beyond - list of software
Tags: ai
Published: 2021-07-19 16:26:47

On [SEO.London](https://seo.london) we are using folliwing:

- [Plagiashield.co.uk](https://plagiashield.co.uk) - to quickly send DMCA claims regarding stolen content

- [jarivs.ai](http://jarivs.ai/) - an AI GTP-3 based content writer
How to resolve split-brain in DRBD9
Tags: linux, storage, drbd, troubleshooting
Published: 2021-07-19 16:06:12

![split-brain](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kzyx2gkmcim5hgjk5dft.png)

First, let's define what split-brain is. Each replica can be either connected or disconnected towards to the other. If the replica spontaneously goes to StandAlone. It means that it refuses to accept the state and don't want to synchronize with the other. This is a classic split-brain situation.

Solving the split-brain for two replicas is done in the same way as for multiple replicas.

First, let's decide which replica we want to synchronize with. To do this, look into

```
drbdadm status <res>
```

If the replica we need is in the `StandAlone` or `Outdated`/`Inconsistent` state, it must first be switched to `UpToDate`. To acheve this go to the node with this replica and execute:

```
drbdadm primary --force <res>
drbdadm secondary <res>
```

And in order to make the rest of the replicas forget about their state and synchronize the data from the `UpToDate` replicas. Go to the nodes with them and execute:

```
drbdadm disconnect <res>
drbdadm connect <res> --discard-my-data
```

It is worth mentioning that in the latest versions of LINSTOR, the auto-tiebreaker function is enabled by default. This means, when you creating a resource in two replicas, automatically adds a third diskless replica, which is a kind of arbiter for ensuring the quorum. Thus, it is less and less usual to solve split-brain these days.
A Docker container to serve directory with upload capability
Tags: docker, node
Published: 2021-07-19 15:49:45

Sometime we just need a simple solution to serve some directory but also allow upload capability. I just created one and the source code is [here](https://github.com/khle/serve-dir-upload).

The heavy lifting is done by [vercel/serve-handler](https://github.com/vercel/serve-handler).

The use case for me is I use it to share books, PDFs, and other documents among all of the computers in my local network. I can retrieve and upload from any of my computers.
Find the Script Execution Time in Python
Tags: python, flask, heroku
Published: 2021-07-19 15:22:35

<p>Being a Programmer our main aim will be to optimize the program and make sure it take less time to execute it.</p>
<p> Using the Time module in Python we can find the execution time of the program. </p>
<p><em>Lets start it by writing a simple python script </em></p>
```python
def BinarySearch(arr, val):
    first = 0
    last = len(arr)-1
    index = -1
    while (first <= last) and (index == -1):
        mid = (first+last)//2
        if arr[mid] == val:
            index = mid
        else:
            if val<arr[mid]:
                last = mid -1
            else:
                first = mid +1
    return index

array = [10, 7, 8, 1, 2, 4, 3]
result = BinarySearch(array, 4)
```
<p><em>So now lets import the time module and <em></p>
<ul><em>
<li> Initiate a variable to store the time at the beginning of the execution ,</li>
<li> Initiate another variable at the end to store the time  after the execution ,</li>
<li> Then find the difference between the start and the end time to get the time required for the execution.</li>
</em></ul>

```python
import time  #import the module
   
def BinarySearch(arr, val):
  first = 0
  last = len(arr)-1
  index = -1
  while (first <= last) and (index == -1):
      mid = (first+last)//2
      if arr[mid] == val:
          index = mid
      else:
          if val<arr[mid]:
              last = mid -1
          else:
              first = mid +1
  reurn index
 

start = time.time() #store the starting time 
 
a=[1,2,3,4,5,6,7,8,9,10]
result = BinarySearch(a, 5)
print(f'Number found at {result}')
time.sleep(1)  # sleeping for 1 sec to get 10 sec runtime
 
end= time.time() #store the ending time
time= "{:.3f}".format(end - start) #time required for the execution 
print(f"time required : {time} sec")

```
<p><em>so the output will be like ... </em></p> 

```
@nilavya~/Desktop
> python script.py 
Number found at 4
time required : 1.001 sec
@nilavya~/Desktop
> 
```
<p> <em>So in this way we can get the time required for the execution. </em></p>
<p>Calculating the time of execution of any program is very useful for optimizing your python script to perform better.
<br>The technique come in handy when you have to optimize some complex algorithm in Python.  
</p>

<p><em>Do drop your views in the comment section</em> 😊.</p>