teleren/devto huggingface dataset:
Terminal message: "bash: syntax error near unexpected token '&' in Visual Studio Code"
Tags: python, vscode, bash
Published: 2021-06-07 09:14:24

The reason you arrived at this page, is caused very likely, you are hampered by the fact, Visual Studio Code surprised you with a message, such as mentioned in the title; _...unexpected token '&' in Visual Studio Code..._ .

## Why? 
Most likely, you are not aware of the fact (as I was due to upgrading to python 3.9.5 64-bit) that the setting _terminal.integrated.shell.windows_ has been deprecated. It seems it has been replaced by **terminal.integrated.automationShell.windows**.

## How to fix!
Pick up your path to your favorite terminal and map it to **terminal.integrated.automationShell.windows** like
![setting in settings.json](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s8ed1damxz6pdfwtuc7y.png)

## Result
![three ways of script execution](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/em15k27zb5xevq3lzpk1.png)


PS: It it always a wise idea to recheck your environment variables if they are set to your desired python version. For what ever reason they still might point to a previous one.
All About AWS Cloud Computing
Tags: aws, cloudskills
Published: 2021-06-07 09:06:51

AWS Cloud Computing

AWS stands for Amazon Web Services ,an on demand cloud computing platform by Amazon. It offers various services and deployment tools over internet. 
For detailed information about [Amazon Web Services tutorial](https://intellipaat.com/blog/tutorial/amazon-web-services-aws-tutorial/) keep reading further.. 

AWS provides Services like database storage, computation power, networking, security, developer and productivity tools, and business applications. It is most secure cloud services that provides scalability and help businesses grow.

AWS provides 3 types of services:
1. IaaS(Infrastructure as a service)
2. PaaS(Platform as a service)
3. SaaS (Software as a service)

AWS works on pay-as-you-go basis, where enterprises can pay only when they use a particular service of cloud. It gives them the freedom of using business appropriate cloud computing model.

Top AWS cloud computing services includes following:

1.Computing services : 
Elastic compute cloud, Amazon lightsail, AWS elastic beanstalk , elastic container service for kubernetes and AWS lamda are computing services provided by AWS. They helps in faster application deployment, monitoring performances, etc.

2.Migration services :
Database migration, Amazon server migration, and Amazon snowball are the migration services given by AWS. They helps in fast and easy medium to transfer massive data.

3.Storage services:
Amazon glacier, AWS storage gataway, and Amazon elastic blockstore are some of the storage services by AWS. It helps in secure, long lasting and continuous data storage .

4.Security services:
AWS inspector, AWS certificate manager, Web application firewall, cloud directory, AWS shield etc. some of the security services given by AWS. These services helps in authentication and authorization, managing security layers SSL/TSL, and protect data using machine learning techniques.

5.Developer Tools:
Codestar, Codebuilt, Codecommit, Codedeploy, Codepipeline, Cloud9 are the development tools by AWS that helps in development, deployment, collaboration of software applications over internet.

AWS Cloud is changing the way these processes were performed by the organizations to get better services and ROI. AWS is undoubtedly better than its competitors in terms of services.
Sự ra đời của tinh dầu thiên nhiên Hương Sắc Việt
Published: 2021-06-07 09:05:09

Câu chuyện ra đời của Hương Sắc Việt xuất phát từ nhu cầu của bản thân anh Hùng. Ngày đó, trong phòng rất nhiều muỗi, nên anh đã lên mạng tìm hiểu về cách sử dụng tinh dầu chống muỗi. Sau khi mua về dùng thử thì anh thấy rất hiệu quả, muỗi không còn mà mùi hương tinh dầu còn mang lại cho anh cảm giác rất thoải mái, thư giãn và tinh thần sảng khoái hơn rất nhiều. Từ đó, anh bắt đầu sưu tập thêm một vài loại tinh dầu khác và cảm thấy đam mê nên bắt đầu kinh doanh.

Hương Sắc Việt chính thức được thành lập từ năm 2015 với mong muốn phân phối những sản phẩm tinh dầu thiên nhiên tốt nhất đến người tiêu dùng. Thời gian đầu, Hương Sắc Việt chủ yếu bán trên các forum như Web Trẻ Thơ, Làm Cha Mẹ, sau đó mới xây dựng website và kênh facebook riêng.

Cái tên Hương Sắc Việt được chọn vì anh mong muốn phân phối những sản phẩm tinh dầu thiên nhiên tốt nhất cho phụ nữ Việt. Những sản phẩm tinh dầu này không chỉ mang đến mùi thơm (HƯƠNG) mà còn có thể dùng để làm mỹ phẩm handmade, dầu massage, dầu dưỡng da (SẮC) nên từ đó cái tên tinh dầu Hương Sắc Việt ra đời.
Taking over when exception occurs
Tags: python
Published: 2021-06-07 08:50:38

```python3
class ExceptionHook :
	instance = None
	
	def __call__(self, *args, **kwargs) :
		if self.instance is None:
			from IPython.core import ultratb
			self.instance = ultratb.FormattedTB(mode = "Plain", color_scheme = "Linux", call_pdb = 1)
		return self.instance(*args, **kwargs)
    
import sys
sys.exceptionhook = ExceptionHook()
```
PST 파일을 EML로 변환하는 쉬운 솔루션
Published: 2021-06-07 08:32:30

IT의 한 부분에서 이메일은 클라이언트 또는 클라이언트와 대화하는 중요한 역할을합니다. PST와 EML은 두 가지 고유 한 이메일 메시지 배열입니다. 예를 들어 PST는 MS 관점에서 사용하고 EML은 Outlook Express, Live Mail, Thunderbird 등에서 사용합니다. MS Outlook은 일반적으로 의미 있고 효과적인 합리적인 이메일 클라이언트입니다. 작업, 메시지, 일정, 메모 등과 같은 다양한 정보로 구성됩니다. MS Outlook은 사용하기 어렵지만 Outlook 정보 클라이언트의 버그 나 문제로 인해 어떤 경우에는 EML, MSG, MBOX 등과 같은 여러 클라이언트로 전환합니다.이 블로그에서는 PST 문서의 레이아웃을 Outlook에서 EML로 변경하는 간단한 수동 전략에 대해 설명합니다. <b><a href="https://www.gaintools.com/pst/eml/">PST에서 EML로 변환 도구</a></b>

<b>PST에서 EML로 프로세스 변경</b>

전략 1 : Outlook Express를 사용하여 PST를 EML로 변환 :

1 단계 : MS Outlook을 엽니 다. 스냅 온 파일을 선택하고 대체 드롭 다운에서 열기 버튼을 선택합니다.

2 단계 : 정보 문서 Open POV를 클릭합니다.

3 단계 : 이제 PST 문서의 영역을 찾고 레코드를 선택합니다. 확인을 클릭하여 PST 레코드를 MS Outlook에 추가합니다.

4 단계 : PST 문서에서 Outlook Express로 정보를 가져올 수있는 기회입니다. 나중에 Outlook Express와 추가 기능 파일을 엽니 다.

5 단계 : 드롭 다운 옵션에서 가져 오기를 선택한 다음 하위 메뉴에서 메시지를 선택합니다.

6 단계 : Outlook Express 가져 오기라는 이름의 다른 창이 열리고 가져올 이메일 프로그램 선택 요약에서 Microsoft Outlook을 선택합니다. 다음 스크린 샷.

7 단계 : 전제 조건에 따라 모든 폴더 또는 모든 폴더 선택과 같은 대안을 선택합니다.

8 단계 : 다음 캡처를 클릭하여 가져 오기 절차를 실행합니다. 온 보딩 프로세스가 완료되면 칭찬 메시지를 받고 마침을 클릭합니다.

9 단계 : 모든 Outlook 정보를 Outlook Express로 가져 오면 이제 간단한 전략을 사용하여 EML로 쉽게 프로 셀리 테이션 할 수 있습니다.

<b>기술 2 : Mozilla Thunderbird를 사용하여 PST를 EML로 변환 :<b/>

1 단계 : Thunderbird 이메일 클라이언트를 열고 도구 → 가져 오기를 클릭합니다.

2 단계 : Import라는 이름의 또 다른 팝업 창이 열립니다. 여기에 두 가지 옵션이 표시됩니다. 즉, 모두 가져 오기 및 가져올 재료 선택입니다.

3 단계 : 모두 가져 오기를 선택하고 다음을 선택합니다.

4 단계 : 이제 가져 오기 마법사가 나타납니다. 여기에서 Outlook을 선택하고 다음을 선택합니다.

5 단계 : 가져 오기 절차가 시작되면 완료 될 때까지 기다립니다. 이 시점에서 모든 발송물을 선택하고 해당 발송물을 마우스 오른쪽 버튼으로 클릭하여 다른 이름으로 저장 옵션을 선택합니다. 현재 주최자를 검색하여 EML 기록을 저장합니다.

반면에 PST 레코드를 EML, 즉 GainTools PST v EML Converter로 변경하는 또 다른 대안이 있습니다. 이 기계는 사용하기 어렵지만 문서를 이동해야합니다. EML 문서를 PST로 물리적으로 변경할 수도 있습니다. 또한 아래 단계에 따라 PST 문서를 EML로 변경하십시오.

1 단계 : 먼저 PST에서 EML 로의 변환기를 다운로드 한 다음 프레임에서 실행합니다.

2 단계 : 요약 PST 파일을 선택한 다음 캡처 열기를 클릭합니다.

3 단계 : 정보 실행을 선택할 수있는 옵션이 있습니다. 정보를 선택해야하는 경우 확인란을 인쇄하고 선택하지 않은 상태로 둡니다. Snap Converter 파일.

4 단계 : 변환 절차가 완료된 후 효과적인 변경에 대한 확인 메시지를 받게됩니다.
DATA HK TERCEPAT
Tags: result
Published: 2021-06-07 07:53:07

<a href="http://165.232.175.43/data-hk-tercepat/" target="'_blank'">data hk tercepat</a> sendiri ialah pusat data dari pengeluaran no hk pools official yang dimana telah direkap dalam wujud bagan data hongkong alhasil para bettor  hk yang mau melaksanakan formulasi pada data itu dapat dengan gampang menganalisa keluaran ataupun bocoran yang dipercayai hendak pergi pada malam ini. Laman bagan data hk kerap kali diucap selaku akhir cengkal dalam memperoleh hasil perkiraan hk ataupun bocoran  hongkong. Ini diakibatkan banyak para pakar lotere bumi merumuskan dasar dengan memakai hasil result data hk sebelumya dapat membagikan peluang besar untuk para bettor buat menduga angka mana saja yang belum pergi pada rentang waktu berikutnya. Dengan pembenaran ini pasti membuat para penggemar  hongkong pools di tanah air bersaingan buat mencari Keluaran Data HK sah di internet. Serta kita merupakan salah satu pelayanan yang sediakan pengeluaran bagan hk dalam wujud data komplit.
Pusat Data Keluaran Data HK 4D Yang Telah Direkap Dengan Sempurna
Data cermat serta serta kilat dari Keluaran Data HK 4D dapat kamu miliki dengan gampang di laman dini web kita, laman data hk 4d yang kita sajikan sendiri telah kita rekap dengan amat sempurna yang dimana telah dilengkapi dengan bertepatan pada serta hari result hk 4d alhasil para bettor dapat memakai data hk kita dengan lebih efesien serta kilat dalam membekuk peluang keluaran no data hk.
hongkong pools
Data hk tercepat haruslah asi serta pula mempunyai akta dari sertifikat pengeluaran lotere bumi alhasil seluruh result data  hongkong dapat dipastikan hendak ke asliannya dari bola hk yang di input, serta web laman data hongkong kita merupakan pusat no data keluaran hk dengan sertifikat WLA, jadi untuk kamu mau memakai data hk prize hingga laman kita dapat kamu coba.
Undian data hk umumnya dapat kita temui disitus official hongkongpools. com tetapi web itu tidak bisa di akses sebab kamu hendak memperoleh keluaran pop up page not found ataupun internet segar dari kominfo, ini diakibatkan web perjudi  hk telah tidak bisa diakses dari tanah bunda bumi. Buat mendatangi web official hk pools diperlukan suatu VPN.
Data HK 2020 Lebih Menarik Dari Pada ( HK) Hongkong Pools
Data HK 2020 lebih menarik dari pada  Hongkong Pools disebabkan para bettor  kegandrungan bisa memandang seluruh hasil keluaran  hk cuma memakai satu laman serta itu seluruh telah di merangkup dalam wujud bagan. Sebaliknya  hongkong pools cuma membagikan pengeluaran sepanjang 10 hari terakhir saja, pasti ini membuat para bettor  online lebih kesusahan melaksanakan pengecekkan penuh dari keluaran data hk 2020.

Source : http://165.232.175.43/data-hk-tercepat/
Using bridged networks with Docker
Tags: docker, networking, sysadmin, linux
Published: 2021-06-07 07:51:45

---
title: Using bridged networks with Docker
published: true
description: Using a bridged network configuration with Docket
tags: docker, networking, sysadmin, linux
//cover_image: https://direct_url_to_image.jpg
---

Docker containers are assigned addresses from a network on each host (or from a mesh in the case of a Swarm cluster) when run in a standalone fashion, and in order to access them from outside the host, the following patterns are common:
```bash
docker run -d --name nginx -p 8080:80 nginx 
```
to expose the nginx app on http://HOST_IP:8080 , or less commonly, attaching directly to the host’s network:
```bash
docker run -d --net host --name nginx nginx
```
where no port forwarding rule is required, because it will bind ports as required to the host network.

In a production scenario, or even one where a host and its containers should have separate addresses, or not accessed through the host network, docker network can be used to attached to a bridge device, to allow Docker containers to get addresses from your external networks.

In a situation where you might have a virtual bridge, or a [bridge to an upstream network](https://help.ubuntu.com/community/KVM/Networking), and want a Docker service to be exposed to that network, without needing to map a port to the container service, Docker can automate this process.

Assume you have an external network that your host has a bridge configured for, 192.168.123.0/30 , and you want your container to be assigned an address from that pool, you can start by creating the network entry for Docker’s side:
```
docker network create -d bridge --subnet=192.168.123.0/30 --gateway=192.168.123.1 -o parent=br0 hostNetwork0
```
so when you create containers attached to that network, using --net hostNetwork0 , it will be assigned an address from this pool:
```
docker run -d --name nginx --net hostNetwork0 nginx
```
and you can see this assignment using docker inspect :
```bash
$ docker inspect nginx | grep IPAddress
                    "IPAddress": "192.168.123.2",
```
and connect to the specificed port inside the container without needing port forwarding:

```
$ curl -Ik http://192.168.123.2
HTTP/1.1 200 OK
Server: nginx/1.17.6
Date: Thu, 16 Jan 2020 08:15:07 GMT
Content-Type: text/html
Content-Length: 612
Last-Modified: Tue, 19 Nov 2019 12:50:08 GMT
Connection: keep-alive
ETag: "5dd3e500-264"
Accept-Ranges: bytes
```

This will allow you to, additionally, scope your container workloads into security groups that might already exist at your network level, without needing to configure the host for each workload being created — this is particularly useful if your entire platform might not be containerized, or if these are groups of services that might require an Ingress address, where some might not (similar to when you might not wish to expose a port).

More about Docker networks can be found [here](https://docs.docker.com/engine/reference/commandline/network_create/).
Understanding The CSS FlexBox - With visual examples.
Tags: css, ux, frontend, codenewbie
Published: 2021-06-07 07:12:19

Flexbox gives you complete control over the boxes' alignment, direction, order, and size. It makes it very easy to build modern web page layouts.

In this post we will explore the most used Flexbox properties.

## Container and Items
"Flex" is one of the value of CSS display property.

```css
.container {
  display: flex;
}
```

- Flex Container: The element with display property set to flex becomes the Flex Container.
- Flex Items: All direct child of container becomes flex items.

![felx container and flex items](https://pbs.twimg.com/media/E3LyFz7UcAEemXF?format=png&name=small)

## Flex container properties
**1. Justify Content: Horizontal alignment of items.**

Values for Justify-Content.

- flex-start: Align items at row-start
- flex-end: Align items at the row-end
- center: Align items at row center
- space-between: Space between flex items
- space-around: Space around flex items

![flex-box justify-content values](https://pbs.twimg.com/media/E3L5GB0VEAYlmCx?format=png&name=small)

**2. Align Items: Vertical alignment of items.**

- Values for Align-Items are exactly the same as that for justify-content.
- The difference being Align-Items aligns the items vertically and Justify-Content aligns the items horizontally.

**3. Flex Wrap: Create a grid layout**
When flex-items row width exceeds the width of flex-container, flex-items flow off the edge of the container.

Flex Wrap has two values:

- no-wrap: Default value. Flex items flow off the page.
- wrap: Wraps the flex items on the next line.

![flexbox flex-wrap](https://pbs.twimg.com/media/E3L-uNvVoAA442z?format=png&name=small)

**4. Flex Direction: Row or Column**
By default, flex containers align their flex items in a row. You can change the flex container direction with the flex-direction property.

It four values: 

- row
- row-reverse: Reverses the row
- column
- column-reverse: Reverses the column

![flex-direction](https://pbs.twimg.com/media/E3L_1DJVUAoRWVC?format=png&name=small)

> Justify-Content and Align-Items change their role when flex-direction is set to the column.

![flex-direction row v/s column](https://pbs.twimg.com/media/E3MA0gwVoAM0FLR?format=png&name=small)

## Flex Items property: Align Self
Align-Self is similar to align-items, the only difference is that align-items is applied on flex-container and align-self is applied on individual flex-item.

- flex-start
- flex-end
- center
- stretch

![flex-items align-self](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kdb3mh760pn8nypmz0md.png)

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

If you enjoyed this post consider joining my [Newsletter](https://swastikyadav.com/), where I share epic weekly content on building your skillset.

Thanks a lot for reading.
6 Signs Your Web Crawler Code Is Going To Break At Scale
Published: 2021-06-07 07:09:59

Here are 6 ways to sense the upcoming disaster:

 1. You have not used a framework

We have not seen a single project survive the wild that is not built on a robust web crawling and web scraping framework like Scrapy. Ignoring years of community tested code (handling rouge HTML, server vagaries) and abstractions (concurrency, sessions, cookies handling, rate limit handling, multiple spiders) and sophisticated algorithms (Beautiful soup, CSS and XPath selectors), etc., is foolhardy and is setting yourself up for massive headaches and mostly a failure.

2. You have no checks and balances

a. Does a website change code?

b. Does a spider crash?

c. Does a web site rate limit you?

d. Does a web site issue a CAPTCHA challenge?

e. Does a website IP block you?

3. You have no measures to overcome IP blocks

You have to use a rotating proxy service like Proxies API if you are serious about scaling your web scraper and doing it consistently.

4. Your scraping logic is built on RegEx or some such rudimentary way of extracting data

No! RegEx is no. It is because even small changes can and will break your code. It’s better to use CSS selectors or XPath to define the data you want. It will also break but nowhere as often as any other method.

5. You are ignoring cookies, rotating User-Agent-String, and giving away many others’ tells’ that you are not human.

6. Your bot runs at the same time every day, runs in precisely the same intervals, runs in a particular order. You know, like a bot!

Add some random intervals between requests, run at a random time, change the order of fetching the URLs a bit, spread the requests over the day, and use a goddamn rotating proxy service for GOD’s sakes!
The Stack Behind A Production Level Rotating Proxy Service
Published: 2021-06-07 07:09:28

Background

Proxies API is a rotating proxies API that developers use to fetch hard to scrape data at scale and consistently. We auto-rotate millions of proxy servers, and also handle auto retries, rotate user agent strings, handle cookies, CAPTCHAs behind the scenes.

The Constraints

The service has to scale to millions of URL fetches a day without lagging on speed and should work out of a single API like this.

curl “http://api.proxiesapi.com/?key=API_KEY&url=https://example.com"

The Architecture

The architecture looks somewhat like this.

A more in-depth look at this architecture is provided in this article.

Load balancing & Serving

The whole infrastructure is on Amazon EC2. The load balancer plays a significant role in calling the right service based on just the variables passed and the API KEY that holds some secret information like what pool of servers are assigned for them etc.

Our plans have higher concurrency as customers pay more, so we need to pass them to more reliable, dedicated servers as they have higher concurrency needs.

Luckily amazon elastic load balancer can make this using rules you can set, which look at the URL patterns and direct them to different pools of servers intelligently.

Without this exact combination of facilities, we would not have been able to create it all using a single API call without compromising speed and performance somewhere.

We use Apache if there is a need for HTTP servers. Many of these are super optimized to be able to crawl data concurrently using multiple cores. We will soon write an article on how we can get the most amount of crawling ability out of Apache instances.

Proxy Components

For CGI, we use a combination of Python and even PHP where required.

Memcache is used to monitor and throttle concurrencies gracefully, so some rouge code by one of our clients doesn’t bring down the entire setup.

As I described earlier, most of this throttling happens in the way we route out requests from the load balancer.

We use the Node Js/Puppeteer library extensively as an interface to connect to Browserless docker instances located on multiple servers. Browserless is optimized to run as many ready-to-go instances of Chromium as possible, so there is no lag in loading any of them for our clients.

Database

We use good old MySQL in a Master/Slave configuration to hold user info, cache info, millions of proxy info, quality metrics for each, etc.

Maintenance tools

We have a pool pruner that’s written in Python running as a Cronjob. Uses Scrapy and Scrapyd extensively in making calls, monitoring, benchmarking, and pruning proxies from our database.

We use the Beanstalk library for Queues. We use Datadog for monitoring and PagerDuty for alerts.

The author is the founder of Proxies API, a proxy rotation API service.
Understanding var, dynamic const, final in Dart
Tags: dart
Published: 2021-06-07 06:58:45

## Introduction
When you are a beginner with Dart you could get lost in the understanding of the different keywords to create a variable. These variable types in Dart follow a set of rules (some common to other programming languages). This writing aims to provide these rules and to explain to beginners what are the differences between these.

## What is var ?
`var`is a keyword allowing to create a variable without specifying a type. The type of the variable will therefore be determined according to the initial value of this variable.
Note that the type of the variable will be inferred only if you assign it a value at its declaration: 
```dart
void main() {
  var a = 1;
  a = "salut"; // Will not compile

  var b;
  b = 2; // runtimeType is int
  b = "salut"; // runtimeType is String
}
```

This happens because we are not assigning an initial value to our variable at it's declaration.

## What is dynamic ?
When creating a variable using the `dynamic` keyword, the data type will depend on the variable this variable will contain :

```dart
void main() {
    dynamic myVar = 2;
    print("$myVar is of type ${myVar.runtimeType}");
    myVar = "Hello World";
    print("$myVar is of type ${myVar.runtimeType}");
}
```
This will output:

```shell
2 is of type int
Hello World is of type String
```
## What is final ?
The `final` keyword allows you to create variables that can only be assigned once at runtime. This means they are immutable. This keyword is mostly used to create instance variables for a class. 

## What is const ?

You may use the const keyword to create constant values; these variables are implicitly final. The thing you have to take care of is that the value of this variable must be known at compile time :

```dart
void main() {
  var myValue = 2;
  const myConst = myValue; // Cannot compile
  const activityCount = 4; // Will compile
}
```

myValue's variable is not known at compile time because it's type is infered, therefore Dart will need to determine the type of the variable before executing the code; note that changing myValue to a constant will actually my everything work.

For a more complete reference, consider reading the [dart language tour](https://dart.dev/guides/language/language-tour).

Thank you for reading, don't hesitate to let me know if you have any suggestion.