teleren/devto huggingface dataset:
AWS Elastic Container Registry Cheat Sheet
Tags: 30daysofaws, day12, certifieddeveloperassociate, ecr
Published: 2022-09-20 03:38:52

Amazon Elastic Container Registry (Amazon ECR) - Fully managed container registry offering high-performance hosting, so you can reliably deploy application images and artifacts anywhere

## Alternatives

- Docker Hub
- JFrog Artifactory
- Azure Container Registry
- Harbor
- Google Container Registry
- Red Hat Quay
- JFrog Container Registry

## Quick start

- Login
  - **get-login-password:**`aws ecr get-login-password --region region | docker login --username AWS --password-stdin aws_account_id.dkr.ecr.region.amazonaws.com`
- Create a repository:
    ```bash
    aws ecr create-repository \
        --repository-name hello-repository \
        --image-scanning-configuration scanOnPush=true \
        --region region
    ```
- Tag image
  - `docker tag hello-world:latest aws_account_id.dkr.ecr.region.amazonaws.com/hello-repository`
- Push
  - `docker push aws_account_id.dkr.ecr.region.amazonaws.com/hello-repository`
- Pull
  - `docker pull aws_account_id.dkr.ecr.region.amazonaws.com/hello-repository:latest`
- Delete an image
    ```
    aws ecr batch-delete-image \
        --repository-name hello-repository \
        --image-ids imageTag=latest \
        --region region
    ```
- Delete a repository
    ```
    aws ecr delete-repository \
      --repository-name hello-repository \
      --force \
      --region region
    ```


> - [Practice notes](https://romankurnovskii.com/en/docs/aws-certified-developer-associate/ecr/)
> - [Questions](https://dev.to/romankurnovskii/aws-ec2-top-
questions-certified-developer-exam-27oo)
Fast Clustering
Published: 2022-09-20 03:22:22

For large scale data, there is no current existing approach is optimal. DBSCAN requires O(n2) time, Fast-DBSCAN only works well in 2 dimensions, and ρ-Approximate DBSCAN runs in O(n) expected time which needs dimension D to be a relative small constant for the linear running time to hold. If someone averagely runs in O(n*log(n)) with the help of indexing technique, it is also well.

from reference:[]
Cloudflare Load Balancing with Laravel Forge SFTP File Only Servers
Tags: cloudflare, loadbalancing, laravelforge, rsync
Published: 2022-09-20 03:17:46

## Table Of Contents
 - [Assumptions](#assumptions)
 - [Setting up servers with Laravel Forge](#setting-up-servers-with-laravel-forge)
 - [Setting up Load balancing with Cloudflare](#setting-up-load-balancing-with-cloudflare)

## Assumptions
1. Using Laravel Forge to setup servers
2. Syncing folder(s) between Server 1 and Server 2
3. Using Load balancing with Cloudflare

## Setting up servers with Laravel Forge
`rsync` is required to sync between servers, using Laravel Forge to setup the servers will automatically install `rsync`

1. Setup 2 servers
  - **Do not delete the `default` site**, deleting it did not work with load balancing for some reason
2. SSH into server #2
3. Create SSH key in server #2 and choose to save the key into `/home/forge/.ssh/`
4. Copy the contents of the newly generated key with `cat/home/forge/.ssh/<key_name_from_step_2>.pub`
5. Add the key to server #1 in Laravel Forge **SSH Keys**
6. Create the main folder in server #1 and #2 that you want to be synced between them
7. Add a test file to server #1 folder for test syncing
8. In server #2 run: `sudo rsync -avzhe "ssh -i /home/forge/.ssh/<key_name_from_step_2>" forge@<server_1_ip_address>:<directory_from_server_1_to_sync>  <server_2_directory_to_sync_into>`
  - If successful, terminal will show the files that got synced
9. Add cronjob to server #2 to have it sync, use [crontab.guru](https://crontab.guru) to figure out time
  - **DO NOT add job in Scheduler in Laravel Forge, you will be required to input a password for `sudo`**
  - Run `sudo crontab -e`
  - Add to the end of crontab `* * * * * sudo rsync -avzhe "ssh -i /home/forge/.ssh/<key_name_from_step_2>" forge@<server_1_ip_address>:<directory_from_server_1_to_sync>  <server_2_directory_to_sync_into>`

## Setting up Load balancing with Cloudflare
1. Select the domain in **Websites** section in Cloudflare
2. On the left go to **Traffic** -> **Load Balancing**
3. Select **Manage Pools** to create a new pool
4. Creating new Pool
    - Create origins (get ips from both servers created from forge)
5. Create Load Balancer
    - Choose subdomain (it will create a loadbalancer subdomain in DNS)
    - Select pool
    - Attach pool monitor
    - Traffic steering OFF
    - No custom rules
6. On the left go to **SSL/TSL** -> **Origin Server**
7. Create certificate
    - RSA (2048)
    - hostname, put the subdomain used for the loadbalancer
    - 15 years is fine
8. Copy the private key and certificate (Both servers will use them)
9. Go back to Laravel Forge and install (Existing) SSL for both servers using private key and certificate created in step 7-8
OSD600- Siteit is not a citation tool
Tags: opensource, beginners, javascript, cli
Published: 2022-09-20 03:09:54

Siteit might sound like a tool that generates citations for you, but it is not. 

##What is Siteit? 

Siteit is an open-source command-line tool that converts  text files into HTML files.

#Steps to Install

- Access Siteit on GitHub by clicking [here](https://github.com/SerpentBytes/siteit).

- Use `git` to `clone` the repo to local machine.

- Navigate to the cloned directory using command-line and execute the following commands:

```
npm install

npm link

```

- Now test out the tool:

```
siteit -h

```

Using `siteit` with `-h` or `--help` option displays the usage manual. If an error message, is displayed instead try running siteit as follows:

```
node ./index.js -h
```

Running either `siteit -h` or `node ./index.js` should yield the following result:

```
SiteIt - USAGE MANUAL

    usage:   
             siteit [flag]
             siteit [flag] [source_file]
             siteit [flag] [source_directory]

    example: 
             siteit -v
             siteit -i source_file.txt
             siteit -i ./source_directory

Common SiteIt Flag Options
----------------------------------------------------------------------

    --version | -v     Outputs tool name and version information

    --help    | -h     Outputs Siteit command usage manual 

    --input   | -i    Accepts a source file or a directory containing 
                       files as input, and outputs an HTML file for 
                       each file supplied

----------------------------------------------------------------------
                        *** END OF MANUAL ***                   
    
```

- The `--input` option is the one that accepts a file or a directory containing `.txt` files as a parameter and converts them into static webpages. The generated files can be viewed in the application's `dist` directory. If the source is a directory, an `index.html` file will be available with links to all the newly generated HTML pages.

Click [here](http://siteit.vercel.app) to see the resulting static website. 

More information on tool usage is available on [GitHub](https://github.com/SerpentBytes/siteit#usage).

###PS
This is the first release of Siteit. 
Stay tuned, as more features will be added in subsequent releases.
Giới Thiệu Công Ty WORKMAN JSC
Tags: javascript, webdev, beginners
Published: 2022-09-20 02:52:04

Mang đến cho khách hàng những trải nghiệm tuyệt vời nhất trong thời đại công nghệ 4.0, Công ty Cổ phần Thiết Bị Công Nghiệp [WORKMAN](https://www.workmanjsc.vn/gioi-thieu-cong-ty-workman/) đang mở rộng kinh doanh, ứng dụng công nghệ, đẩy mạnh thương mại điện tử , kênh bán hàng trực tuyến với giao diện thân thiện và tiện lợi. Giới Thiệu Công Ty WORKMAN hướng tới mục tiêu trở thành một công ty lớn mạnh; tập thể gắn kết, là nơi các thành viên có thể nâng cao khả năng sáng tạo và kỹ năng của mình; tạo ra những sản phẩm, dịch vụ chất lượng, giá cả hợp lý, mang lại nhiều giá trị hữu ích cho cộng đồng.

Sứ mệnh: Không ngừng phấn đấu, phát triển để cung cấp cho khách hàng những sản phẩm và dịch vụ tốt nhất.


Lĩnh vực hoạt động chính:
Dịch vụ tư vấn, thiết kế, lắp đặt, chuyển giao công nghệ, sửa chữa, bảo hành, bảo dưỡng Thương mại.
Nhập khẩu và phân phối các sản phẩm dụng cụ cầm tay, kiểu dáng công nghiệp
Văn hóa doanh nghiệp:
Phục vụ khách hàng bằng việc cung cấp các sản phẩm và dịch vụ có chất lượng tốt nhất.
nhân tố, khuyến khích sự chủ động của cá nhân. Trung thực, tận tâm trong mọi mặt kinh doanh, đặt chữ Tín lên hàng đầu.
Làm việc bằng tâm huyết, đam mê và trách nhiệm, không ngừng sáng tạo.
Là một tập thể đoàn kết, coi trọng lợi ích của khách hàng và đối tác.
Kính chúc Quý khách hàng, Quý đối tác làm việc hiệu quả, mang lại nhiều giá trị thiết thực cho công ty. WORKMAN JSC xin chân thành cảm ơn và rất mong được phục vụ, hợp tác!

Các đơn vị đủ điều kiện để làm đại lý muốn làm đại lý phân phối các dòng sản phẩm chính hãng của Workman JSC vui lòng tham khảo tại đây: WORKMAN JSC Homepage
Big PostgreSQL Problems: Introduction
Tags: postgres
Published: 2023-06-13 12:07:46

---
title: Big PostgreSQL Problems: Introduction
published: true
date: 2022-09-20 00:00:00 UTC
tags: postgresql
canonical_url: https://andrzejgor.ski/posts/big_postgresql_problems/introduction/
---

This is the first post in a series about problems that I encountered while working with rather big PostgreSQL databases. I will describe in it what are my assumptions about the database size and also some facts from PostgreSQL documentation.

## How big table or database have to be to be considered really “big”?

There’s no hard definition of that topic, so there are only my assumptions.

About a single table, I’d say that it can be considered big when it approaches 100 million rows. **But** of course, it depends on the row size itself. Things will be completely different for a table with two or three simple integers contrary to, let’s say twenty text columns loaded with heavy data.

On the database topic – in my opinion, 100 GB is a quite large database. **But** , again, it depends, on how many tables are there and how heavy single rows are.

## What are the PostgreSQL limits?

Now we are in a much better situation, as they’re documented in the [official PostgreSQL FAQ](https://wiki.postgresql.org/wiki/FAQ#What_is_the_maximum_size_for_a_row.2C_a_table.2C_and_a_database.3F). So, after the FAQ:

1. **Maximum size for a database?** Unlimited (32 TB databases exist)
2. **Maximum size for a table?** 32 TB
3. **Maximum size for a row?** 400 GB
4. **Maximum size for a field?** 1 GB
5. **Maximum number of rows in a table?** unlimited
6. **Maximum number of columns in a table?** 250-1600, depending on column types
7. **Maximum number of indexes on a table?** unlimited

## That’s all for today

It wasn’t a very long post, was it? But no worries, the next articles in the series will be more substantial (at least I hope so 🙂 ). This article is more like a common point to have something to refer to in subsequent posts.
Virtual modifier for C#
Published: 2022-09-20 02:33:44

什麼是 `virtual` ? 

它的定義很簡單，`virtual` 關鍵字可以使用於屬性、方法、索引子或事件定義，繼承內部具有 `virtual` 關鍵字成員的類別之子類別可以被覆寫，例如使用 `virtual` 關鍵字的方法，可以再子類別中使用 `override` 來覆寫此方法

```csharp
class Shape
{
	protected int size;

	// 定義為虛擬方法
	public virtual int GetArea()
	{
		return size * size;
	}
}

class Rectangle : Shape
{
	public Rectangle(int x, int y)
	{
		X = x;
		Y = y;
	}

	public int X { get; }
	public int Y { get; }

	// 覆寫方法內容
	public override int GetArea() => X * Y;
}
```

反之，如果覆寫的方法不是虛擬方法，編譯器會回報錯誤，例如下列 B 類別覆寫 Foo 方法會失敗

```csharp
class F
{
	public void Foo() { }
}

class B : F
{
	public override void Foo() { }
}
```

編譯器回報被覆寫的方法至少必須是虛擬、抽象或覆寫的其中一種

![pic-015](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ne2m3rcjkv4b3o66zd63.png)

**`virtual` 修飾詞不可與 `static`、`abstract`、`override` 或 `private` 一起使用**

嘗試將屬性定義為 `virtual`，並在子類別覆寫該屬性

```csharp
public class Person
{
	// virtual property
	public virtual string Name { get; set; }
}

public class Employee : Person
{
	private string name;

	// override property
	public override string Name
	{
		get { return name; }
		set
		{
			if (!string.IsNullOrEmpty(value))
				name = value;
			else
				name = "Unknown";
		}
	}
}
```

練習使用 `virtual` 關鍵字

```csharp
public class Shape
{
	public const double PI = Math.PI;
	protected double r, h;

	public Shape() { }

	public Shape(double r)
	{
		this.r = r;
	}

	public Shape(double r, double h)
	{
		this.r = r;
		this.h = h;
	}

	// virtual method
	public virtual double GetArea() => r;
}

public class Circle : Shape
{
	public Circle(double r) : base(r) { }

	// override method
	public override double GetArea() => r * r * PI;
}

public class Cylinder : Shape
{
	public Cylinder(double r, double h) : base(r, h) { }

	public double GetVolume() => base.GetArea() * 2 * h;
}
```

### Reference
[virtual](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/virtual)

---

Thanks for reading the article :tulip: :sunflower: :blossom:

If you like it, please don't hesitate to click heart button :heart:
or follow my [GitHub](https://github.com/FakeStandard) :star:
or buy me a coffee :arrow_down: I'd appreciate it.

[![Buy-me-a-coffee][1]][2]

[1]: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h077sxd0vx1hix4t7lw8.png
[2]: https://www.buymeacoffee.com/FakeStandard
AWS Provider for StackQL Released
Tags: aws, sql, stackql
Published: 2022-09-20 02:09:02

StackQL AWS provider is available now!  

> StackQL allows users to query, report, analyze, provision, and operate cloud and SaaS resources using a simple SQL-based framework  

With StackQL and the AWS provider, you can run queries like...  

```sql
SELECT instanceType, COUNT(*) as num_instances
FROM aws.ec2.instances
WHERE region = 'ap-southeast-2'
GROUP BY instanceType;
```
and much more, including mutation operations using `INSERT` and `JOIN` operations (within a provider or across different providers).  

Provider docs available [__here__](https://registry.stackql.io/providers/aws/), also check out this [__blog article__](https://stackql.io/blog/stackql-aws-provider-released).  

Other providers are available for [Azure](https://registry.stackql.io/providers/azure/), [GCP](https://registry.stackql.io/providers/google/), [GitHub](https://registry.stackql.io/providers/github/), [Kubernetes](https://registry.stackql.io/providers/k8s/), [Okta](https://registry.stackql.io/providers/okta/), [Netlify](https://registry.stackql.io/providers/netlify/) and [Firebase](https://registry.stackql.io/providers/firebase/)
Software Architecture Patterns for common problems
Published: 2022-09-20 01:37:36

## Data management

- Database per Service
- Shared database
- CQRS
- Domain event
- Event sourcing

## Transactional messaging

- Transactional outbox

## Security

- Access Token (JWT)
- Oauth
- Session

## Observability

- Log aggregation
- Application metrics
- Audit logging
- Health check API
Create News Website using Reactjs with the help of third party Api
Tags: react, javascript, beginners, programming
Published: 2022-09-20 01:28:59

Here; I created one News Website using Reactjs Library with the help of Api. Which help us to deliever news to you. 

**Website Link**: [Aksh News Website]( https://akshnews.netlify.app/)

* For Detailed Information please watch this Video.
Youtube video(Detailed Information): {% embed https://youtu.be/tnIXLl17tgM %}

In this video i explained about overall Introduction of my Website which i created with the help of React Js Library and i also explained that what is single page application and the features of single page application and code. And i mentioned api which i use and github source code link also. I hope you like this 😊 .

For that; I use Class Based Component for that. But; You can also use function Based Component for that. 

**Features of this Website**:-

1. Single Page Web Application
2. Top Loading Bar
3. Infinite Scrolling
4. React Router Dom

**Api Link**: [Api Link](https://saurav.tech/NewsAPI/)

**Github Link(Source Code)** :  [Github Link](https://github.com/AKSHDESAI1/NewsMonkey)

Thank You. 
You can follow us on:
[Instagram for full stack web Development](https://www.instagram.com/full_stack_web_developer1/)
ML-Zoomcamp Series (wk 2)
Tags: machinelearning, datascience, python, mlzoomcamp
Published: 2022-09-20 00:31:30

Hello there, this is week 2 on my Machine Learning journey with ML-Zoomcamp, well this week was pretty choked up, but I still made time to go through the content, here are some things we did this week..

- We were introduced to a real world problem, that involved predicting the price of a car.

- First, we had to gather, access and clean the data to make it good for the ML model.
- Explored the dataset visually through graphs and chart to spot outliers and understand the distribution of target variable.
- We then split the dataset into Train, Validate and Tests sets.
- Linear regression model is a very popular model for predicting the price of a numerical quantity or variable, we used this, and we implemented the linear regression model with numpy.
mob.sh
Tags: pairprogramming, mobprogramming, ensebleprogramming
Published: 2022-09-22 07:25:57

---
title: mob.sh
published: true
date: 2022-09-20 00:00:00 UTC
tags: pairprogramming,mobprogramming,ensebleprogramming
canonical_url: https://jhall.io/archive/2022/09/20/mob.sh/
---

One of the teams I’m working with has recently started experimenting with virtual mob programming. To facilitate, I went on the search for a tool to make it easier to change drivers, particularly when we don’t all use the same editor/IDE.

After asking around a bit, I was turned on to [mob.sh](https://mob.sh/). It’s not a shell script… it’s a web site. And at the web site, you’ll find a simple to use CLI tool that works as a wrapper around `git`, to keep your working copy in sync across multiple computers.

It includes built in timer support, to remind you when to switch drivers, and it’s pretty configurable via environment variables, and several other features I haven’t explored yet.

Give it a try.

Do you have a favorite remote pair programming tool?

* * *
_If you enjoyed this message, [subscribe](https://jhall.io/daily) to <u>The Daily Commit</u> to get future messages to your inbox._
All in a Single Night
Tags: adventofcode, algorithms, programming, javascript
Published: 2022-09-19 23:57:09

## [Advent of Code 2015 Day 9](https://adventofcode.com/2015/day/9)

## Part 1
1. A walk in the park
2. Writing a working algorithm

### A walk in the park
Today's puzzle feels like Day 13 in Easy mode!
- Generate the list of permutations
- Sum up each A to B score
- Identify the lowest score

### Writing a working algorithm
#### Extracting the places and score
Each line of the input follows this pattern:
```
A to B = C
```

I'll forego using `regex` and instead extract the three parts using `split()` and array destructuring:
```js
let [A, ,B, ,C] = flight.split(' ')
```

#### Creating the dictionary of places and scores
For the example input:
```
London to Dublin = 464
London to Belfast = 518
Dublin to Belfast = 141
```

I want a dictionary like this:
```js
{
  London: { Dublin: 464, Belfast: 518 },
  Dublin: { London: 464, Belfast: 141 },
  Belfast: { London: 518, Dublin: 141 }
}
```

Thus, for each line, I need to set two keys and the same value to each:
```js
dict[A][B] = +C
dict[B][A] = +C
```

Altogether, my `reduce()` looks like this:
```js
const scores = input.reduce((dict, flight) => {
  let [A, ,B, ,C] = flight.split(' ')
  if (!(A in dict)) dict[A] = {}
  if (!(B in dict)) dict[B] = {}
  dict[A][B] = +score
  dict[B][A] = +score
  return dict
}, {})
```

#### Generating the list of possible routes
- I'll again use the very handy JavaScript library, [`js-combinatorics`](https://github.com/dankogai/js-combinatorics)
- I need to pass the list of all possible destinations
- I'll use `Object.keys()` to generate that list

```js
const C = require('js-combinatorics')
const routes = [...new C.Permutation(Object.keys(scores))]
```

#### Finding the shortest route
My algorithm in pseudocode:
```
For each possible route
  Accumulate a number - starting at Infinity - that should get smaller and smaller
  Set score to 0
  For each destination in the route, except the last
    Increment score by the value associated with the key corresponding to the next item that is a key inside the dictionary corresponding to the current item
  Return the smaller number between the accumulated number and score
Return the accumulated number
```

My algorithm, animated:
![Algorithm animation](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e60ydy9rnj1pjkdce6d4.gif)

My algorithm in JavaScript:
```js
routes.reduce((shortest, route) => {
  let score = 0
  for (let i = 0; i < route.length - 1; i++) {
    score += scores[route[i]][route[i + 1]]
  }
  return Math.min(shortest, score)
}, Infinity)
```

It generated the correct answer!

## Part 2
### Swapping `Math.min()` for `Math.max()` and `Infinity` for `0`
- Two simple changes
- And another correct answer!

## I did it!!
- I solved both parts!
- In record time, given my familiarity with the combination-generating library and `reduce()`!

The only problem with solving these puzzles backwards is that combination-themed ones become decreasingly fun to solve.

Since I'm only at Day 9, I feel like there's at least one more waiting for me before the end of the year.
How to Remove Office 365 License From a User Account After Being Suspended for a Certain Time
Tags: nocode, workflows, okta, ipaas
Published: 2022-09-22 17:47:59

---
title: How to Remove Office 365 License From a User Account After Being Suspended for a Certain Time
published: true
date: 2022-09-19 23:34:05 UTC
tags: NoCode, Workflows, okta, ipaas
canonical_url: https://maxkatz.net/2022/09/19/how-to-remove-office-365-license-from-a-user-account-after-being-suspended-for-a-certain-time/
---

[Okta Workflows](https://www.okta.com/platform/workflows/) how-to guides are questions and answers from weekly community [office hours](https://calendly.com/oktaworkflows/group-office-hours-okta-workflows), MacAdmins [Workflows Slack channel](https://www.macadmins.org/), and other places. 

Read all the other how-to guides ⤵️
{% embed https://dev.to/oktaworkflows/all-okta-workflows-how-to-guides-4nl9 %}

On to the question. 

**_How to remove Office 365 license a user account after being suspended for a certain time?_**

**Note** : _I don’t yet have access to O360 Admin account (Workflows connection) so I’m proving a high-level overview of the solution. I will update this post once I have access to a O360 Admin connection._

The solution consists of two flows:

1. Save the time when user was suspended
  - Trigger a flow with **[Okta – User Suspended](https://help.okta.com/wf/en-us/Content/Topics/Workflows/connector-reference/okta/events/usersuspended.htm)** card and save the time a user was suspended, their Okta ID, and any other information needed such as O365 login
2. Use **[Okta – Scheduled Flow](https://help.okta.com/wf/en-us/Content/Topics/Workflows/build/set-schedule-options.htm)** card to check the table and compare the date now against the date a user was suspended
  - If the difference between dates is greater than [X days], remove the license from the user and delete the row in a table

This is the first flow (save the time when user was suspended):

[![Save suspended user information to a table](https://katzmax.files.wordpress.com/2022/09/workflows_howto_suspend_o360_table.png?w=1024)](https://katzmax.files.wordpress.com/2022/09/workflows_howto_suspend_o360_table.png)
<figcaption>Save suspended user information to a table</figcaption>

Table with suspended user information:

[![Table with suspended user information](https://katzmax.files.wordpress.com/2022/09/workflows_howto_suspend_o360_table2.png?w=1024)](https://katzmax.files.wordpress.com/2022/09/workflows_howto_suspend_o360_table2.png)
<figcaption>Table with suspended user information</figcaption>

* * *

**More resources to help you learn** :

📺 Short how-to [Workflows videos](https://youtube.com/playlist?list=PLIid085fSVdvyK8F4xuk49EchBPmAVNHG) to help you become a better automation builder.

🍿 A collection of helpful [Workflows tips](https://maxkatz.net/okta-workflows-tips/).