teleren/devto huggingface dataset:
Common Issues with AWS, EKS Cluster-Fargate-VPC
Tags: aws
Published: 2022-07-07 15:13:07

Following the AWS documentation on Amazon EKS was super helpful and very detailed, covering topics such as AWS Networking and Security for example and the prerequisites. 

**Issue**

However, I had an issue with coredns deployment failing, looking for nodes. 

```
kubectl get pods -n kube-system
NAME                      READY   STATUS    RESTARTS   AGE
coredns-                    0/1     Pending   0          46m
coredns-                    0/1     Pending   0          46m
coredns-                    0/1     Pending   0          77m
```

**Solution**

I was using an existing VPC with public and private subnets, internet gateway and nat gateway. The solution was in your VPC, make sure you have enableDNSHostnames and enableDNSSupport set to True.
AWS Service Principals for IAM
Tags: aws, security, serverless
Published: 2022-07-07 14:21:47

I just stumbled upon this list of AWS Service Principals on GitHub. [Principals](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html) identify an entity within AWS Identity and Access Management (IAM) such as a certain user or role, another AWS account for cross-account access, or another AWS service. Service principals are domain-like identifiers for AWS services, such as **s3.amazonaws.com** for AWS S3 or **events.amazonaws.com** for AWS EventBridge. 

We need these service principals when defining IAM roles because they grant the specified service access to that specific role. In AWS terms, this means _the service identified by the service principal can assume this IAM role_. In addition, AWS Lambda uses [resource-based policies](https://docs.aws.amazon.com/lambda/latest/dg/access-control-resource-based.html) to grant usage permission to specific entities on a per-resource basis. These entities are also identified as principals.

I embedded this [Gist](https://gist.github.com/shortjared/4c1e3fe52bdfa47522cfe5b41e5d6f22) directly in this post, but I would recommend to head over to GitHub to star it directly. 

{% embed https://gist.github.com/shortjared/4c1e3fe52bdfa47522cfe5b41e5d6f22 %}
4 cases of reading and writing files in Go
Tags: go, programming, beginners, file
Published: 2022-07-07 14:10:20

## 1. How to create empty file in Go

```go
package main
import "os"

func main() {
  file, _ := os.Create("/tmp/go.txt")
  defer file.Close()
}
```

- **/tmp/go.txt** - path to file [to create](https://onelinerhub.com/golang/create_file)


## 2. How to create new or overwrite existing file with new content in Go

```go
package main
import "os"

func main() {
  f, _ := os.OpenFile("/tmp/go.txt", os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0644)
  defer f.Close()
  f.WriteString("new content\n")
}
```

- **/tmp/go.txt** path to file to [create/overwrite](https://onelinerhub.com/golang/how-to-overwrite-content-in-file-if-it-exists)
- **os.O_RDWR|os.O_CREATE|os.O_TRUNC** means we will either create new or truncate existing file before writing content
- **new content\n** new content to write to file

## 3. How to append line to existing file in Go

```go
package main
import "os"

func main() {
  f, _ := os.OpenFile("/tmp/go.txt", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
  defer f.Close()
  f.WriteString("new line\n")
}
```

Here, [we're appending](https://onelinerhub.com/golang/how-to-append-lines-to-file) **"new line\n"** text (with new line symbol at the end) to **/tmp/go.txt** file. In order to make that right, we need to set **os.O_APPEND|os.O_CREATE|os.O_WRONLY** permissions.

## 4. How to read file contents to a string variable:

```go
package main
import "os"

func main() {
  t, _ := os.ReadFile("/tmp/go.txt")
  str := string(t)
}
```
Here we [read everything](https://onelinerhub.com/golang/how-to-read-file-to-string) from **/tmp/go.txt** file to `str` variable. Note we're converting read bytes to string using `string()` function.

## More useful Go solutions to work with files
- [How to rename a file](https://onelinerhub.com/golang/how-to-rename-a-file)
- [How to remove a file](https://onelinerhub.com/golang/how-to-rename-file)
- [How to check if file exists](https://onelinerhub.com/golang/how-to-check-if-file-exist)
- [How to read big file line by line](https://onelinerhub.com/golang/how-to-read-file-line-by-line)
GCP is going to dominate AWS
Tags: cloudplatform, service, speed, agility
Published: 2022-07-07 14:09:14

GCP will eventually dominate AWS..  for one reason. Service, They(Google) actually are obsessive about customer satisfaction in their Google Cloud Platform service structure. AWS, does not seem to care at all about anything except, well, you help yourself. It's a self service platform and that's how it started out.  Their support structure is terrible and staffed by folks that do not seem to care at all whether a customer is happy, or anything else. 

GCP will whip AWS in the end. Google has designed and built a superior system. The "system" to which I am referring...  is SERVICE.

Go GCP Support!!
Data Types in Python
Tags: programming, beginners, python, datatypes
Published: 2022-07-07 13:24:38

**1.Introduction**
Variable in python stores different kind of data and these are :
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bgy6nqpuyiu769xlhf0z.png)
**2.INTEGER TYPE OF DATA**
As the name suggest it contain positive or negative type of data. It is used by the keyword "int.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2luww3weomtyl4zbkiuv.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jh9hlo11cz4rw7pzllia.png)
**3.Float**
It contains decimal type of data.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k5vr63pxz4ylf6bz5d0e.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/60bv9zzv3ey6vtgayndf.png)
**4.String**
It contains a message to be executed to the user and it is enclosed in quotes.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/osfp8rygl8p17s1hjbeh.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u6m1664jub2f1hlupsq7.png)
**5.Tuple**  
 It can contain more than one type of data in one variable. They are enclosed in (). 
**NOTE**- Tuple value is unchangeable.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6odmi9pb8gv9mv3hop8q.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uf7ff0wiso4ziooabyr3.png)  
**6.Lists**
They contain multiple data in them. They are enclosed in square brackets[].
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jwctq6viwqhx82xbv570.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qjx2o5td55ppug3j9iwa.png)
**7.Sets** 
With the help of Sets we can make many sets of different data and they are enclosed in {}.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/40sth78bi8g915077rlm.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8j0da8ysg943m5xxtqge.png)
Release Notes 22.07.07 - Public API and the documentation
Published: 2022-07-07 13:18:48

We’re thrilled to present to you the latest release of Syntropy Stack. We are introducing the public API to enable you to work more efficiently and give you the programmatic access to manage your agents and connections between endpoints. You can learn about using it by reading our `API reference` [documentation](https://docs.syntropystack.com/reference/quick-start). 

### Features
- ability to use the public API to:
	- get a list of Agents
	- create, update and delete Agent
	- get the list of Connections
	- create P2P and mesh Connection
	- update and delete the Connection
	- authorise Agents
	- grant access via tokens with specific permissions

### Improvements
- minor internal improvements

### Fixes
- Fixed ability to generate the VPN network config by the user
	- Fixed ability to activate the checkbox in the new account survey window
- Modal title fitting long words
	

## Getting Started
Get started with Syntropy Stack with our three-minute [quick start video](https://vimeo.com/499558754), or follow the [documentation](https://docs.syntropystack.com) for more details. Use Syntropy Stack to streamline your container and multi-cloud deployments and automate network orchestration.

## Getting Involved
Our community helps us identify the right problems to solve for our users. Whether you’re an active user of one of our products or just getting started, [join our community on Discord](https://discord.com/invite/HxW6DbUeMn)! We love to foster communication among developers. Also, don’t hesitate to send us a message if you have feedback or need assistance. We're happy to help!
Leetcode Solutions: Queries on a Permutation With Key
Tags: leetcode, python, programming
Published: 2022-07-07 13:06:02

Given the array queries of positive integers between 1 and m, you have to process all queries[i] (from i=0 to i=queries.length-1) according to the following rules:

In the beginning, you have the permutation P=[1,2,3,...,m].
For the current i, find the position of queries[i] in the permutation P (indexing from 0) and then move this at the beginning of the permutation P. Notice that the position of queries[i] in P is the result for queries[i].
Return an array containing the result for the given queries.


```py
class Solution:
    def processQueries(self, queries: List[int], m: int) -> List[int]:
        
        P, result = list(range(1, m + 1)), []
        
        for q in queries:
            
            index = P.index(q)
            
            result.append(index)
            
            P = [P.pop(index)] + P
        
        return result
    

```
Select all table rows from the table not only current page in vuetify 2.x
Tags: vuetify, vuetifytable, selectallrows
Published: 2022-07-07 13:05:49

---
title: Select all table rows from the table not only current page in vuetify 2.x
published: true
description: Select all table rows from the table not only current page in vuetify 2.x
tags: vuetify, vuetifytable, selectallrows 
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
---

## Select all table rows in all pages 

- Add @toggle-select-all="selectAll" in table

```html
  <v-data-table v-model="selectedTasks" :headers="headers" 
:items="tasks" item-key="id" show-select 
:toggle-select-all="selectAll">

</v-data-table>
```

```javascript
selectAll(event) {
    if (event.value === true) {
        this.selectedTasks = [...this.tasks];
    } else {
        this.selectedTasks = [];
    }
}
```

Working example - https://jsfiddle.net/ktrajasekar/8nqu64f9
NPM OR YARN.
Published: 2022-07-07 12:36:44

<u>**WHAT IS NPM?**</u>

 NPM stands for Node Package Manager which is a package manager for nodejs.It have the CLI tool that helps us to install, manage, and remove Node.js packages.Moreover npm is the world's largest Software Registry. The registry contains over 800,000 code packages. Open-source developers use npm to share software. Many organizations also use npm to manage private development.

<u>**WHAT IS YARN?**</u>

Yarn is introduced by the facebook in 2016 as a replacement of npm.It was developed with an objective to offer more advanced features that npm doesnot have  and create a more secure, stable, and efficient product.

**<u>DIFFERENCE BETEWEEN NPM AND YARN</u>**

1.<u>**INSTALLATION**</u>
  _NPM_ - npm is installed automatically when node is 
               installed.
  _YARN_ - yarn is installed using npm.
                  
                 npm install yarn --global
2.**<u>LOCK FILE</u>**
  _NPM_ - npm createes a package-lock.json file
 _YARN_ - yarn creates a yarn lock file.

3.<u>**SPEED**</u>
_NPM_ - npm install packages sequentially
 _YARN_ - yarn install packages parallel

4.SECURITY

 _NPM_ - Security threats were a significant issue in early versions of NPM. As of version 6, NPM performs a security audit every time you install a package. This helps prevent vulnerabilities and ensures there aren't any conflicting dependencies.

 **<u>YARN</u>** - Yarn performs a security check as a background process while downloading packages. It uses the package license information to ensure it doesn't download any malicious scripts or cause any dependency conflicts.

 **<u> ADVANTAGES </u>**

  **<u>NPM</u>**
      

-  usage is easy for developers who follows old workflows.
       

- save space due to the optimization in package 
        installations.
**<u> YARN</u>**


- newer versions of Yarn offer a more secure form of version 
locking.

- increased performance due to parallel installation of packages
Creating an instance on Amazon Lightsail
Tags: aws, cloud, lightsail, linux
Published: 2022-07-07 12:19:18

Amazon Lightsail is a service that provides virtual private offerings/services, which offer a variety of templates to choose from. It is also known as a virtual machine or a virtual private server, which basically offers all characteristics of a server/computing machine (SSD-based storage, data transfer, DNS management, and a static IP etc.) but can’t be physically seen. For a detailed introduction please read my previous article at {% embed https://dev.to/d1n3th/what-is-aws-lightsail-19l8 %}

You can access Amazon Lightsail home page with below link.
{% embed https://lightsail.aws.amazon.com/ls/webapp/home/ %}
In the startup page, already created instances will be shown. To create a new instance, click on Create instance button.

![Lighsail Homepage](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f6x7qdr08k1kmek8kfjf.png)
 
Here you can select OS for the instance, either Linux/Unix or Windows at the present. You have the Apps + OS option to select a Blueprint with an application you require (such as WordPress, Joomla, Node.js etc.) already included. 

![Apps + OS](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kuq3i8idf6aje71xfl81.png)

Else you can just go with OS only option to install only the OS. In this scenario, we’ll be using Amazon Linux 2 image for our instance.

![OS only](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xh7psysh6r2zxx6aj0a9.png)
 
Next step is to name the instance. Each instance must have a unique name in Lightsail. 
For ssh logins you can either use the default ssh key generated here or use a ssh key pair you already own.
After naming the instance, click on create Instance button. 
![Naming instance](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8jcy64bietaqpba4jrf7.png)
 
The page will be redirected to Lightsail home page and you can see the new instance is being created.
 
![Instance creating](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7hwnqibnanfuh1fvx4r3.png)

Within few minutes the instance is ready to use. Click on upper right corner on the instance and select manage to access the instance via ssh using a browser-based terminal.

![Instance created](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zmt4f9j49o2o0saqu0l7.png)

You can now work in this server like a normal VM. Thank you for reading.

![Terminal](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d2tgvm4swatvqbhdi9gz.png)
Self Assess Your information security system
Tags: informationsecurity, cybersecurity
Published: 2022-07-07 12:16:39

![Seucured](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g74vg2jdslrf09ngopyt.jpeg)
Is Your system secured ? 🔐
__10 questions__ to know how save You are!

Check Your Information Security System Maturity Level and get instant report with the __diagnose__ and __actions__ to be taken to enhance Your system maturity level.
Click on the link below.
[FREE Security Assessment](https://crm.qvisoft.com/checks/check_ext/5 )
How to Setup and run Cypress Test cases In Azure DevOps
Tags: javascript, tutorial, testing, azure
Published: 2022-07-07 12:05:36

How to Setup and run Cypress Test cases In Azure DevOps Pipeline

https://lnkd.in/d8nx4bDX


And

How to integrate Cypress with Database in Azure Pipeline for Test cases Execution

https://lnkd.in/dQa3RphG
My interactive web based terminal made ^ JS
Tags: javascript, webdev, programming, tutorial
Published: 2022-07-07 11:52:31

![Melvin Jones Repol](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2opl38go25oegxml6cwc.png)
 
It's a simple portfolio that works like a terminal.

Feel free to check it out its open source:
https://github.com/mrepol742/terminal/

Live: https://mrepol742.me
5 things to keep in mind as a programmer 😍 🔥
Tags: webdev, beginners, programming, codenewbie
Published: 2022-07-07 11:35:10

## 1- Languages are just tools
The most common mistake for a beginner - even for some experienced developers - is focusing too much on languages/frameworks rather than solving problems. It's a good thing to be a "Jack of all trades" but keep in mind that it will get you nowhere if you know all languages/frameworks in the world.
Pick a random one, learn to solve problems with it. Believe me, at the beginning it doesn't matter which programming language you are using. They all make sense.
I am not saying it's bad to learn a new language but make sure to focus on how you can use the language to solve some real-life problems.
Remember, programming is not about what language you use. It's about how you think.

## 2- Understand the underlying concepts
Don't just focus on solving a problem and then jumping directly to the next one. Programming is not just a typing statement. you have to understand the programming core skills - the fundamentals. Programming can be a highly competitive industry, so it's advisable to highlight your skills.

## 3 - Complex Is Better Than Complicated
Don't be afraid of having a complex solution to a problem. It's true that Simple Is Better Than Complex but usually, complex problems require complex solutions. Just don't make it complicated - make it understandable.

## 4- Never Panic
Some people panic when they cannot solve a problem the first time. Don't be like that, even if the deadline is close. Most of the time the solution is around. Otherwise, you can find an alternative that might work. Make sure you understand what you are doing. Most importantly, never ever copy/paste code from StackOverflow without a complete understanding of it.

## 5- Build a routine of continuous learning
Things evolve rapidly in programming. So you better focus on continuous learning.
Reading can be a great way to improve yourself and get up to date. It's regular investment in your knowledge portfolio. But you should critically analyze what you read. Do not believe everything.
Multiple component Conditional Reactjs
Tags: react, javascript, form, component
Published: 2022-07-07 11:34:48



Hello can someone help me please I am new to react, I have a problem with multiple display conditions. I would like to display the "HabilitationFormSuccess" component if the "FormContent" component is well filled. And remember the data if we have already filled in the "FormContent" in order to have the possibility of displaying "SummaryForm" and modifying the "FormContent" component.
[My codesandbox](https://codesandbox.io/s/formulaire-v2-forked-kuwnvc?file=/src/components/Form.jsx)
How to use recoil effects_unstable for loading data from API.
Tags: recoil, nextjs, statemanagement
Published: 2022-07-07 11:31:37

Welcome friends 👋, to this new blog post where you will learn how to use effects_unstable for fetching the data from an API.

For people who know Hindi:

{% embed https://youtu.be/jJnOjPDYyyI %}

In this blog, I will use this API — [https://jsonplaceholder.typicode.com/todos](https://jsonplaceholder.typicode.com/todos)

### 🤔Situation

Suppose I have a website for making todos where I want to load the todos from an API. So, how will I do it with recoil?

Moreover, your project manager gave you this project which uses Nextjs as its framework and has made these files before 👇

atoms/atoms.ts
{% gist https://gist.github.com/studywithdesign/20677beeb6a61bf5c7e7876d9077792a.js %}
Index.ts file
{% gist https://gist.github.com/studywithdesign/63f7c4784ee2efdedeaefff4061defce.js %}


### 🥳Solution to load the data

we have two methods

### Method 1️⃣— Effects_unstable
{% gist https://gist.github.com/studywithdesign/923b5fc375d1350253a5c89d9adb6161.js %}
### Method 2️⃣— Effects_unstable
{% gist https://gist.github.com/studywithdesign/e739956c8523b2a4b76e4fbfd8e46bc0.js %}
### ⚠️Concerns

If you are using frameworks like nextjs then you need to know something unique and that is that **recoil loads the data by serverside rendering which makes the website load slow.**

For any questions, feel free to ask here 👇
[**Join the Next Dev Discord Server!**](https://discord.gg/hN4Wc5VR4M)
Bun - The fastest Javascript Runtime
Tags: javascript, programming, node, deno
Published: 2022-07-07 11:01:54

[Bun](https://bun.sh/) - the new Javascript runtime has just announced its first beta release and makes the claimed that it's significantly faster than Node and Deno, not just a little bit faster, but orders of magnitude faster. What makes Bun special?

## Performance ⚡
It doesn't use the V8 engine but instead uses the JavaScriptCore from WebKit which is generally considered to be faster. In addition it's written in a low level programming language called [ZIG](https://ziglang.org/) that similar to C or Rust and the creator of Bun say ZIG the lack of hidden control flow makes it much simpler to write fast software.

## All-IN-ONE Runtime 🎁
- Native module bundler to replace tools like Webpack.
- Native transpiler to support Typescript code out of the box.
- Top level await (just like Deno🦖)
- Auto transpile JSX files
- Supports WebAPI like `fetch`, `WebSocket` and `ReadableStream`
- Supports many Node core modules as well as Node API which will allow many NPM packages also work in Bun.
- Implements Node.js' module resolution algorithm, means you can install packages from npm into bun and those packages install 20x faster.⚡😲
- Environment variables load automatically, no more `dotenv`.
- Native test runner like Jest.

Try it out, if you are using Windows, you are required to use WSL to install Bun.

Thank you for reading.
Found an awesome code learning platform
Tags: scrimba, javascript, webdev, programming
Published: 2022-07-07 10:49:14

If you're a beginner, just look into this site of **scrimba** [Link](https://scrimba.com/allcourses)
Just now I've completed a JavaScript course there...
I damn sure that you'll also gain something special from there than other online courses.

Thank you Per Harald Borgen for this amazing JavaScript course.