teleren/devto huggingface dataset:
You can't create aws virtual mfa with terrafrom
Tags: aws, terraform
Published: 2023-06-18 12:42:40

It's just an FYI. Though theoretically you can create an aws virtual mfa device through terraform but you can't enable it or assign it to a user.

The process to create virtual mfa has two steps from aws-cli perspective.

1. [Creating the mfa device](https://docs.aws.amazon.com/cli/latest/reference/iam/create-virtual-mfa-device.html)

```
aws iam create-virtual-mfa-device --virtual-mfa-device-name BobsMFADevice --outfile C:/QRCode.png --bootstrap-method QRCodePNG
```

2. [Enabling the mfa device with auth Code](https://docs.aws.amazon.com/cli/latest/reference/iam/enable-mfa-device.html)

```
aws iam enable-mfa-device \
    --user-name Bob \
    --serial-number arn:aws:iam::210987654321:mfa/BobsMFADevice \
    --authentication-code1 123456 \
    --authentication-code2 789012
```

You can complete both steps using aws-cli. But using terraform you only can create the mfa device, you can't enable it or assign it to a user.

Yes, I understand it's legit from terraform's perspective. As you need to put auth code every time to enable a virtual mfa device. That's not what we want to do with every `terraform apply`.

But the scope to create the virtual mfa doesn't mean anything without having the opportunity to assign it.

Looking forward how terraform solves this in future.
What is Docker ? 🧐
Tags: docker, kubernetes, containers, programming
Published: 2023-06-18 12:36:48

##What is Docker 🐋 

Docker is an open-source platform that enables you to automate the deployment, scaling, and management of applications using containerization. It allows you to package an application and its dependencies into a standardized unit called a container. Containers provide a lightweight, isolated environment that ensures consistency and portability across different computing environments.

With Docker, you can create containers that encapsulate everything needed to run an application, including the code, runtime, system tools, and libraries. This approach allows you to build, ship, and run applications on any system with Docker installed, regardless of the underlying infrastructure.

Docker uses a client-server architecture. The Docker client interacts with the Docker daemon, which handles container management and resource isolation. The client communicates with the daemon through a REST API or a command-line interface, allowing you to control and manage containers, images, networks, and other Docker components.

Docker images serve as the building blocks for containers. An image is a read-only template that contains all the necessary instructions to create a container. Images are stored in a registry, such as Docker Hub, where you can find a vast collection of pre-built images maintained by the community. You can also create your own custom images using Dockerfiles, which are text files that specify the steps to build an image.

Docker provides a range of benefits, including:

1. **Portability:** Containers are self-contained units that run consistently across different environments, making it easy to deploy applications on various platforms, from local development machines to production servers.

2. **Isolation:** Containers provide a lightweight and isolated runtime environment, ensuring that applications and their dependencies do not interfere with each other or with the underlying system.

3. **Scalability:** Docker enables you to scale applications by spinning up multiple containers running the same image, distributing the workload across a cluster of machines.

4. **Efficiency:** Docker optimizes resource utilization by allowing multiple containers to share the same host operating system, reducing overhead and improving efficiency.

5. **Version control:** Docker images are versioned, allowing you to track changes and roll back to previous versions if necessary. This makes it easier to manage and reproduce deployments.

Overall, Docker simplifies the process of packaging, distributing, and running applications, providing a consistent and reliable environment regardless of the underlying infrastructure.
Play Videos in Your Browser Using Laravel Video Player
Tags: laravel
Published: 2023-06-18 12:34:36

---
title: Play Videos in Your Browser Using Laravel Video Player
published: true
description: A browser's video player build with laravel, vuejs & videojs to organize your media (video/pdf). 
tags: Laravel
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2023-06-18 12:20 +0000
---

As I was living in a village, my internet connection wasn't good enough to play online videos directly. So I need to download videos from udemy, youtube sites. To watch those videos I need to go to each folder and watch them. 

Instead of using vlc and manual watching videos, I tried to build a laravel project where I can watch all videos under a folder. I can categorize them as well by topic. 

to download this project visit 

https://github.com/polodev/laravel-video-player

It's a Laravel project. just clone it, create a database, and connect database in your `.env` file 

First clone project from github and `cd` into this project inside terminal

```bash
git clone https://github.com/polodev/laravel-video-player
cd laravel-video-player
cp .env.example .env
```

copy `.env.example` file to `.env` and add your database credential 

```bash
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel_video_player
DB_USERNAME=root
DB_PASSWORD=
```

In my case database name in `laravel_video_player`.

## website container class and default video width
 
you can change website container class and default video width from `.env` file.   

```bash
CONTAINER_CLASS=container
VIDEO_WIDTH=1200
```

`CONTAINER_CLASS` class can be bootstrap `container` or `container-fluid` class


### Downloading composer package and dumping for autoload

```php
composer install
```

## make a series

copy a folder location from your file manager. go to the create series page by clicking `Create series` from the menu.

once you created a series, go to `series` and go to specific series and click on `Generate / Regenerate Videos ` button. It will generate all videos  

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/91y2b0th61zc8wyyd70s.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g2swduovvdu7syig1gg9.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y6j21or2t5lw7a2bhuav.png)





Thanks
📢 Elevate Your Data Science Projects with ReactPy: A Python Framework for Interactive Applications! 🚀
Tags: python, datascience, framework, reactpy
Published: 2023-06-18 12:25:07

ReactPy is a Python framework that empowers data scientists and analysts to create interactive user interfaces for their machine learning and data science projects. Leveraging the renowned ReactJS framework, ReactPy is exclusively written in Python, eliminating the need to learn JavaScript.

Here are some fantastic features ReactPy offers for building data science applications:
📊 State management: ReactPy comes with a built-in state management system that enables you to effortlessly track the state of your applications. This is crucial for developing interactive applications that can respond to user input effectively.
🚦 Routing: ReactPy provides an intuitive routing system, allowing you to create multiple views within your applications. Seamlessly build applications with diverse pages or sections to enhance user experience.
🌍 Internationalisation: ReactPy supports internationalisation, making it ideal for constructing applications that cater to users from various countries. Expand your audience and reach by building multilingual applications effortlessly.
✔️ Testing: ReactPy offers a comprehensive suite of testing tools, empowering you to thoroughly test your applications. This ensures the correctness and reliability of your data science projects.

💡 Here are just a few examples of how ReactPy can elevate your projects:
📈 Building dashboards: Visualize and explore your data by creating interactive dashboards using ReactPy. Gain valuable insights and effectively communicate your findings.
🌐 Building web applications: Share your discoveries and insights with others by developing web applications using ReactPy. Engage and collaborate with stakeholders effortlessly.
⚙️ Building machine learning models: Utilize ReactPy to construct powerful machine learning models that enable accurate predictions and recommendations. Unleash the potential of your data science projects.
🔄 Building data pipelines: Streamline your data workflows by building robust data pipelines with ReactPy. Collect, clean, and transform data efficiently, saving time and effort.

If you are a data scientist or analyst seeking a seamless way to build interactive user interfaces for your projects, ReactPy offers a promising solution. It offers ease of use, a wide range of data science-centric features, and is constantly evolving to meet your needs.
Host Your Site Without Static IP via Server
Tags: webdev, devops, aws, programming
Published: 2023-06-18 12:19:19

## Why you want to do that?
This would be the first question if I need a server for this why would I need to expose any service from local in first place?
1. One of the reason would be to reduce server cost, like say you want to do some graphic intensive task which you can do in your local.
2. You can share your local work with other without publishing your work and without using services like ngrok

## Prerequisite
Basic understanding of SSH is required, also I have done it with a linux machine will be same for mac I don't know how this works with windows machine.

## How to Do it?
Suppose you have a server running on port 8080 and want to expose it to the outside world but you don't have a public IP.
So to make it public you need to have a server with public IP running in cloud (or any where) and SSH running in both the mechine.
Let say the IP address of the public server is pp.pp.pp.pp
then in the private server run the command ```ssh -NT -o ServerAliveInterval=5 -o ExitOnForwardFailure=yes  -R 80:127.0.0.1:8080 ubuntu@pp.pp.pp.pp```

or to run it through systemd use this systemd file inside /etc/systemd/system/api-tunnel.service

### /etc/systemd/system/api-tunnel.service
```config
[Unit]
Description=api server tunnel
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=always
RestartSec=1
User=ubuntu
ExecStart=/usr/bin/env ssh -NT -o ServerAliveInterval=5 -o ExitOnForwardFailure=yes  -R 80:127.0.0.1:8080 ubuntu@pp.pp.pp.pp

[Install]
WantedBy=multi-user.target
```

after succesfully running the command if you go the url pp.pp.pp.pp from any browser you will see the website running in port 8080 in your private machine

also need to update the sshd config file for the server machine to reduce the latency if the tunnel disconnect
### /etc/ssh/sshd_config
```
ClientAliveInterval 5
ClientAliveCountMax 3
```
Fishing for the most creative human fish
Tags: ai, machinelearning, community
Published: 2023-06-18 12:18:51

Truly a terrific occurrence, serendipitously encountering, opportunities that fashion from chaos chance for harmony by happenstance.

To hope for the  acquaintance that brings together kindred stranger's naturally recognized by the same immediate instinct for love.

The Sense of belonging to a feeling that experiences affinity for what calls to us, deeper than our identity.

When the harmony that unifies us separately, also configures circumstance to coalescence of creativity. 
How do we not unofficially bind ourselves to the fetters of this quintessence?

The diversity of our perspectives have arranged us the opportunity to meet each other and create for the first time, ever, whatever our chemistry can concoct.

My goal is just to put myself out there and begin to make a presentation of myself in conformity with my style.

So the potential for connection has the chance to manifest its possibility. I am unique and must fashion a novel approach to my interaction with humans. It's critical that I approach all only with the gift giving virtue and not a presumption to take or receive from them.

Unless it be what is shared and  discovered from creative collaboration.
Create Snake Game in C++: A Step-by-Step Guide
Tags: cpp, snakegame, tutorial
Published: 2023-06-18 12:04:27

In this blog, we will learn how to create a Snake game using C++. The Snake game is a classic and popular game in which the player controls a snake that moves around the screen, trying to eat food and avoid colliding with walls or its own tail. We will go through the process step by step and explain the necessary functions and parameters used in the code.

## Prerequisites
Before we start coding, make sure you have a basic understanding of C++ programming language and the concepts of variables, loops, and functions.

Also, make sure you have a C++ compiler installed on your system. You can choose any popular compiler such as GCC or Microsoft Visual C++. Set up your development environment by installing the compiler and a suitable integrated development environment (IDE) such as Code::Blocks or Visual Studio.

## Setting Up the Snake Game
Let’s start by setting up the basic structure of our Snake game. We will define the necessary variables and initialize the game’s initial state.
```
#include <iostream>
#include <conio.h>
#include <stdio.h>
#include <Windows.h>

bool gameOver;

const int width = 20;
const int height = 20;

int x, y, fruitX, fruitY, score;

int tailX[100], tailY[100];
int nTail;

std::string fruit = "*";

enum eDirections
{
    STOP = 0,
    LEFT,
    RIGHT,
    UP,
    DOWN
};

eDirections dir;

void Setup()
{
    gameOver = false;
    dir = STOP;
    x = width / 2;
    y = height / 2;
    fruitX = rand() % width + 1;
    fruitY = rand() % height + 1;
    score = 0;
}
```

In the code above, we have declared the necessary variables for the game. Here’s a brief explanation of each variable:

- gameOver: Keeps track of whether the game is over or not.
width and height: Define the dimensions of the game screen.
x and y: Represent the current position of the snake.
- fruitX and fruitY: Represent the position of the fruit that the snake needs to eat.
score: Stores the player’s score.
- tailX and tailY: Arrays to store the positions of the snake’s tail.
- nTail: Keeps track of the length of the snake’s tail.
fruit: Represents the character used to display the fruit on the screen.
- eDirections: An enumeration to represent the possible directions the snake can move.
- The Setup() function initializes these variables with their initial values, positioning the snake at the center of the screen and randomly placing the fruit.

Read more from the original post [Snake Game](https://hackthedeveloper.com/snake-game-cpp/). Find the blog on Google [Snake Game](https://www.google.com/search?q=snake+game+site%3Dhackthedeveloper.com).
Setting up IntelliJ Community Edition
Published: 2023-06-17 22:27:32

## Install JDK
```sh
$ brew install openjdk
$ sudo ln -sfn /opt/homebrew/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk
echo 'export PATH="/opt/homebrew/opt/openjdk/bin:$PATH"' >> ~/.zshrc
$ echo 'export CPPFLAGS="-I/opt/homebrew/opt/openjdk/include"' >> ~/.zshrc
$ source ~/.zshrc
$ java --version
openjdk 20.0.1 2023-04-18
OpenJDK Runtime Environment Homebrew (build 20.0.1)
OpenJDK 64-Bit Server VM Homebrew (build 20.0.1, mixed mode, sharing)

```

## Install IntelliJ Community Edition
https://www.jetbrains.com/idea/download/?var=1&section=mac

## Spring Boot Project
Use initializer to create a new project

https://start.spring.io
- Select Maven
- Add Spring Web dependency
- Select the correct Java version

![Select the correct Java version](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2rw5996u4rxx1aw1kzy1.png)

Open the project in IntelliJ CE
- Trust the project
- Specify JDK in Project Structure
![Specify JDK in Project Structure](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kdtgwv3xnwnb5xua4v0k.png)
- Add a controller
```Java
package com.example.demo;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloWorldController {
    @RequestMapping("/")
    public String hello()
    {
        return "Hello Spring Boot!";
    }
}
```
- Build project
- Run the project

![Run the project](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pv01m8nadbddudf713pv.png)


- Open a browser and point to `localhost:8080` to verify the web application is running

![Hello Spring App Running](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7q7chnksd0549j8805ov.png)
Chrome Reading List export
Tags: javascript
Published: 2023-06-18 11:25:20

The easiest way to export the chrome reading list is to use [takeout.google.com](https://takeout.google.com/) and to export the Chrome details. On my Google workspace account, this wasn't possible.

Instead, I navigated to [chrome://sync-internals/](chrome://sync-internals/) on the sync node browser tab and ran this javascript code in the console:

```js
[
  ...$("#sync-node-tree")
    .shadowRoot.querySelector("#tree-item-autogen-id-17")
    .shadowRoot.querySelectorAll(".leaf"),
].map((row) => row.detail.payload);
```

(The shadowRoot has its own query selector function separate from the window of the console.)

Then, I right clicked the result to paste it into a text editor and save as a json file

Here's a sample of what you can expect to get:

![Chrome reading list as json](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4hi4f6zbz878l5ylu426.png)

The following is one particular chrome reading list item
```json
{
    "CLIENT_TAG_HASH": "xxxxbEkAs=",
    "CTIME": "2022-07-25 14:41:44 +03",
    "ID": "sZ:ADqtAZw/jKp+WHaGmzqqSHy/YRNDZvdUo0doOqiQFaIMf0Yo59vheTu0WKfrimEtw+TaNyZJxSpEzC1wpOhS6r5qtfZP1kywYw==",
    "MTIME": "2022-07-25 14:41:44 +03",
    "NAME": "https://developer.mozilla.org/en-US/docs/Web/API/Reporting_API",
    "NON_UNIQUE_NAME": "https://developer.mozilla.org/en-US/docs/Web/API/Reporting_API",
    "ORIGINATOR_CACHE_GUID": "",
    "ORIGINATOR_CLIENT_ITEM_ID": "",
    "PARENT_ID": "",
    "SERVER_DEFINED_UNIQUE_TAG": "",
    "SPECIFICS": {
        "reading_list": {
            "creation_time_us": "1658749304297842",
            "entry_id": "https://developer.mozilla.org/en-US/docs/Web/API/Reporting_API",
            "estimated_read_time_seconds": "0",
            "first_read_time_us": "0",
            "status": "UNREAD",
            "title": "Reporting API - Web APIs | MDN",
            "update_time_us": "1658749304297842",
            "update_title_time_us": "1658749304297842",
            "url": "https://developer.mozilla.org/en-US/docs/Web/API/Reporting_API"
        }
    },
    "metadata": {
        "acked_sequence_number": "2",
        "client_tag_hash": "3ewNy9zDJ7HvgpPTJfkN1DbEkAs=",
        "creation_time": "1658749304297",
        "is_deleted": false,
        "modification_time": "1658749304299",
        "sequence_number": "2",
        "server_id": "Z:ADqtAZw/jKp+WHaGmzqqSHy/YRNDZvdUo0doOqiQFaIMf0Yo59vheTu0WKfrimEtw+TaNyZJxSpEzC1wpOhS6r5qtfZP1kywYw==",
        "server_version": "1658749304544398",
        "specifics_hash": "eb+IzTHvIE0GMJ0az8W4a1nUlis="
    },
    "modelType": "Reading List"
}
```
JavaScript Interview Questions, You Need to know.
Tags: javascript, programming, interview, beginners
Published: 2023-06-18 11:15:55

## **What is Null vs Undefined?**

**Null:** The intentional absence of any value in a variable is called null.
Example:
var myVar = null;
alert(myVar);

**Undefined:** If a parameter is not passed in a variable, it is called undefined.
Example:
let x;
console.log(x);

## **What is Double (==) and Triple (===)?**

**Double (==):** Double Equals (==) checks for value equality only.
Example:
var x = "test"
var y = "test"
console.log (x == y)

**Triple (===):** Triple === is used for comparing two variables, but this operator also checks datatype and compares two values.
Example:
const number = 1234
const stringNumber = '1234'
console.log(number === stringNumber);

## **What are Hoisting, Block Scope, and Global Scope?**

**Hoisting:** Hoisting is a JavaScript mechanism where variables and function declarations are moved to the top of their scope before code execution.

**Block Scope:** A block scope is the area within if, switch conditions or for and while loops. Generally speaking, whenever you see {curly brackets}, it is a block.

**Global Scope:** the global scope is the complete JavaScript environment. In HTML, the global scope is the window object. All global variables belong to the window object.

## **What is Closure, Encapsulation, and Private Variable?**

**Closure:** A closure is a combination of a function bundled together with references to its surrounding state.

**Encapsulation:** JavaScript Encapsulation is a process of binding the data with the functions acting on that data. It allows us to control the data and validate it.

**Private Variable:** A private variable is only visible to the current class. It is not accessible in the global scope or to any of its subclasses.

## **What is Bind, Call, Apply?**

**Bind:** The bind () method creates a new function that, when called, has its this keyword set to the provided value, with a given sequence of arguments preceding any provided when the new function is called.

**Call:** The call () allows for a function/method belonging to one object to be assigned and called for a different object. call() provides a new value of this to the function/method.

**Apply:** Apply method is similar to the call method. In last this starts with an array.
Syntax: oldObject.object. apply (newObjectName, [value]);

## **How to find the largest element from an array?**

> There are the three approaches:

1. with a FOR loop
2. using the reduce () method
3. using Math.max ()
xosoluck88
Published: 2023-06-18 10:50:21


Mỗi ngày, xosoluck88 sẽ cập nhật kết quả quay số mới nhất của các đài thuộc ngày hôm đó. Người dùng có thể dễ dàng xem được kết quả xổ số này ngay trên trang chủ của xosoluck88
#xosoluck88 #linkxosoluck88 #appxosoluck88
ĐC: 1323/28 Lê Văn Việt tp.Thủ Đức thành phố Hồ Chí Minh
Điện thoại: 09772584327
Mail liên hệ: xosoluck88com @gmail.com
https://xosoluck88.com/
https://www.facebook.com/xosoluck88/
https://www.youtube.com/@xosoluck88/about
https://twitter.com/xosoluck88
https://www.pinterest.com/xosoluck88/
https://www.quora.com/profile/Xosoluck88
https://www.reddit.com/user/xosoluck88
https://www.tumblr.com/xosoluck88
https://soundcloud.com/cakumachikezie 
https://social.msdn.microsoft.com/Profile/xosoluck88 
https://www.linkedin.com/in/x%E1%BB%95-s%E1%BB%91-luck-60888b27b/ 
https://vimeo.com/xosoluck88
Welcome to IndiTechCoder, My YouTube Channel
Published: 2023-06-18 10:33:30

Welcome to my channel IndiTechCoder (A developer from India and for Indians)

Hi, I'm Tarun - a full-stack software developer from India with 12 years of experience. I build open-source projects and write about modern JavaScript, Node.js, design, and web development. If you like my stuff Please subscribe to My channel and Fell free to hit One-click unsubscribe anytime. I have 2000 youtube videos on the latest technologies.

Learn Geek stuff from my channel Angular, React,svelte js, next js, nestjs, Redux, Nodejs, Web development, Docker, AWS, Vue JS, All about Javascript

If you have any comments, ideas, or critiques, or you want to say hi, don't hesitate to send me an email at tarun.softengg@gmail.com

Subscribe My channel 

See My All Youtube Videos 
https://tkssharma.com

https://www.youtube.com/channel/UCS1NeZF0Or2E1RAV9hQJz3g?view_as=subscriber
https://tkssharma.com/

#nestjs  #nextjs13  #nextjs  #react  #nodejs #typescript #javascript
from interview question to enlightenment: metaclasses in python
Published: 2023-06-18 18:54:42

---
title: from interview question to enlightenment: metaclasses in python
published: true
date: 2023-06-18 10:20:00 UTC
tags: 
canonical_url: https://mrturkmen.com/posts/metaclasses-python/
---

metaclasses in python


https://mrturkmen.com/posts/metaclasses-python/