teleren/devto huggingface dataset:
Installing ECS-CLI in your Mac
Tags: aws
Published: 2020-09-26 15:58:42

# Prerequisites

MacOS Catalina
More information can be found here in the documentation: [Installing the Amazon ECS CLI](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_CLI_installation.html)

# Procedures

Download ecs-cli using `sudo curl`.

```
$ sudo curl -Lo /usr/local/bin/ecs-cli https://amazon-ecs-cli.s3.amazonaws.com/ecs-cli-darwin-amd64-latest
Password:
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 49.5M  100 49.5M    0     0  3419k      0  0:00:14  0:00:14 --:--:-- 4012k
```

Install `gnupg`, or GNU privacy guard. This may take a few minutes.

```
$ brew install gnupg
```

Run the following command. This will retrieve the key.

```
$ gpg --keyserver hkp://keys.gnupg.net --recv BCE9D9A42D51784F
gpg: directory '/Users/USERNAME/.gnupg' created
gpg: keybox '/Users/USERNAME/.gnupg/pubring.kbx' created
gpg: /Users/USERNAME/.gnupg/trustdb.gpg: trustdb created
gpg: key BCE9D9A42D51784F: public key "Amazon ECS <ecs-security@amazon.com>" imported
gpg: Total number processed: 1
gpg:               imported: 1
```

Download the ECS CLI signatures.

```
$ curl -Lo ecs-cli.asc https://amazon-ecs-cli.s3.amazonaws.com/ecs-cli-darwin-amd64-latest.asc
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   821  100   821    0     0   1080      0 --:--:-- --:--:-- --:--:--  1078

```

Verigy the key.

```
$ gpg --verify ecs-cli.asc /usr/local/bin/ecs-cli
gpg: Signature made 水  7/ 8 07:29:27 2020 JST
gpg:                using RSA key DE3CBD61ADAF8B8E
gpg: Good signature from "Amazon ECS <ecs-security@amazon.com>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: F34C 3DDA E729 26B0 79BE  AEC6 BCE9 D9A4 2D51 784F
     Subkey fingerprint: EB3D F841 E2C9 212A 2BD4  2232 DE3C BD61 ADAF 8B8E
```

Add the necessary restrictions.

```
$ sudo chmod +x /usr/local/bin/ecs-cli
```

If you are able to check the version, it is successful.

```
$ ecs-cli --version
ecs-cli version 1.20.0 (7547c45)
```
Deadly commands and why you should be extra careful with them
Tags: linux, bash
Published: 2020-09-26 15:52:56

I'm writing this from my personal experience, because I broke a few systems by misusing some commands...

# chown & chgrp

I wanted to save a server which wasn't booting because of a kernel update which went badly. Thus I put a FTP server on the rescue server, mounted the disk of the original server, and tried to retrieve the files. The FTP was launched as `user`, the partition mounted listed files from `root`, thus the FTP couldn't retrieve them.

My ~~best~~ (actually, the worst) idea? A `chown -R user` and a `chgrp -R user`... This affected the mounted partition but **also** the original files (which is logical but I didn't think about that).

We were able to downgrade the kernel version in the /boot partition and boot it again afterward but alas, it was unusable because everything was owned by `user`, even things like `sudo` or `shutdown`.

**TL;DR** When using chown and chgrp, be extra careful.

# The usual one, rm

I have a friend who was trying to create a temporary website for an association, named "abc". Well, it wasn't a success thus he tried to delete it. The first time he typed the wrong name, the second time he forgot `-r`, the third there was an error and he needed to add `-f` as well.

The plot twist? There was another folder for another website named "pbn", and 3 times he typed "pbn" and not "abc". The wrong website was deleted, unrecoverable.

How it could have been avoided? By having `alias rm='rm -i'` in the `.bash_aliases`, asking for a confirmation to delete a file (for every file if `-r` was added). If you are sure and have reviewed it carefully, you can pipe the rm command with `yes` which will send "y" to every prompt from `rm -i`.

# Conclusion

I'm hoping that I'll be able to add more commands to this article, without causing too much damage, and I also hope that this will help some of you!
Day 72
Tags: 100daysofcode
Published: 2020-09-26 15:34:32

I learnt how to integrate notifications API to my PWA. I am not excited about today's work so no explanations today. Here is the resource used: [Using notification API](https://codelabs.developers.google.com/codelabs/pwa-integrating-push/#2)

The level of boredom!
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/thb9um00krr0vjuzo35r.jpg)

 
_That's it for day 72_
_Let's do this again tomorrow_
How to get rid of Overwhelming
Tags: hacktoberfest, help
Published: 2020-09-26 15:24:35

I really need some support and motivation to move forward, it's so intimidating and daunting looking at the amount of participation and everything. Am hoping someone to shed some light to help me move forward.
Also I am all into AI and data science, and I cannot find much projects related to these areas where I can help. Everything's all about NodeJS, or databases and stuff. I kind of feel like am no use here.
chapter 0.1.5 released!
Tags: ai, scifi, machinelearning, books
Published: 2020-09-26 14:53:37

I'm Andrew, I'm writing an open source sci-fi novel. I'm posting my launch metrics in public :)


Changed the landing page from the ads to point towards https://wrannaman.com, I'll leave it there for 7 days and see if that works better.

## Metrics for yesterday:

- fb spend - $8.28
- fb clicks - 14
- reddit spend - $5.32
- reddit clicks - 22
- website views - 28
- email signups - 0
- sales - 0

you can now read the book for free on wattpad, medium, and github!
Error
Published: 2020-09-26 14:45:20

The following errors show up when I hit npm start in visual studio code.

E:\version1\react-repo>npm start

> react-repo@0.1.0 start E:\version1\react-repo
> react-scripts start

i ｢wds｣: Project is running at http://192.168.18.5/
i ｢wds｣: webpack output is served from
i ｢wds｣: Content not from webpack is served from E:\version1\react-repo\public
i ｢wds｣: 404s will fallback to /
Starting the development server...

events.js:292
      throw er; // Unhandled 'error' event
      ^

Error: spawn powershell ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
    at onErrorNT (internal/child_process.js:469:16)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:273:12)
    at onErrorNT (internal/child_process.js:469:16)
    at processTicksAndRejections (internal/process/task_queues.js:84:21) {
  errno: 'ENOENT',
  code: 'ENOENT',
  syscall: 'spawn powershell',
  path: 'powershell',
  spawnargs: [
    '-NoProfile',
    '-NonInteractive',
    '–ExecutionPolicy',
    'Bypass',
    '-EncodedCommand',
    'UwB0AGEAcgB0ACAAIgBgACIAaAB0AHQAcAA6AC8ALwBsAG8AYwBhAGwAaABvAHMAdAA6ADMAMAAwADAAYAAiACIA'
  ]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! react-repo@0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the react-repo@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Anyone who has switched from react to svelte ,what has been your experience in a large scale production app ?
Tags: react, svelte
Published: 2020-09-26 14:40:50

What I want to know is majorly about the developer experience .Recently I got to know about svelte ,I saw a video on fireship io channel ,I was really impressed but all in all like I understand what it does and how it optimises things and all the cool stuff of unused css and everything and that it runs on low memory devices ,Currently I am a senior react dev,I consider myself quite proficient with react and tbh there is also the sunk cost fallacy at play. I just want to know a honest experience from someone who has made that switch.
Making portable binary for MacOS
Tags: macos, portable, development
Published: 2020-09-26 13:57:17

---
title: Making portable binary for MacOS
published: true
description: 
tags: macos, portable, development
//cover_image: https://direct_url_to_image.jpg
---

Let’s say we want to take some binary and prepare it for distribution (unsigned), here is how we can make it portable with example of `psql`

#### Copy executable file
```
# cp /Applications/Postgres.app/Contents/Versions/latest/bin/psql .
```

#### Check linked libraries
```
# otool -L psql
psql:
/Applications/Postgres.app/Contents/Versions/13/lib/libpq.5.dylib (compatibility version 5.0.0, current version 5.13.0)
/usr/lib/libedit.3.dylib (compatibility version 2.0.0, current version 3.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.0.0)
```
We can see psql has dependency on `libpq.5.dylib`

#### Copy required dylib’s

```
# cp /Applications/Postgres.app/Contents/Versions/latest/lib/libpq.5.13.dylib .
```

#### Check dependencies of `libpq.5.13.dylib`
```
# otool -L libpq.5.13.dylib
libpq.5.13.dylib:
/Applications/Postgres.app/Contents/Versions/13/lib/libpq.5.dylib (compatibility version 5.0.0, current version 5.13.0)
/Applications/Postgres.app/Contents/Versions/13/lib/libssl.1.1.dylib (compatibility version 1.1.0, current version 1.1.0)
/Applications/Postgres.app/Contents/Versions/13/lib/libcrypto.1.1.dylib (compatibility version 1.1.0, current version 1.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.0.0)
```

#### Copy `libssl.1.1.dylib`, `libcrypto.1.1.dylib` and their dependencies (if any)
```
# ls
libcrypto.1.1.dylib
libssl.1.1.dylib
libpq.5.13.dylib
psql
```

#### Use install_name_tool to change dependencies paths to `@loader_path/...`.
More details about [@loader_path](https://wincent.com/wiki/@executable_path,_@load_path_and_@rpath)

```
install_name_tool -change /Applications/Postgres.app/Contents/Versions/13/lib/libssl.1.1.dylib @loader_path/libssl.1.1.dylib ./libpq.5.13.dylib

install_name_tool -change /Applications/Postgres.app/Contents/Versions/13/lib/libcrypto.1.1.dylib @loader_path/libcrypto.1.1.dylib ./libpq.5.13.dylib

install_name_tool -change /Applications/Postgres.app/Contents/Versions/13/lib/libcrypto.1.1.dylib @loader_path/libcrypto.1.1.dylib ./libssl.1.1.dylib

install_name_tool -change /Applications/Postgres.app/Contents/Versions/13/lib/libpq.5.dylib @loader_path/libpq.5.13.dylib ./psql
```

#### Try to run psql
If you run this on Macos Catalina, it will be killed by system

```
# ./psql
[1]    2490 killed     ./psql
```
It happens because those binaries was signed but modified them, and signature check started to fail

#### Let’s remove code signing
```
codesign --remove-signature *
```

If binary is not signed we may need to remove quarantine flag
```
xattr -d com.apple.quarantine *
```

#### Try again
```
# ./psql
psql (13.0, server 10.14)
Type "help" for help.
myname=#
```

It works 👏

---
*I use this technique in [Postbird.app](https://github.com/Paxa/postbird) - Free Cross-platform Desktop Client for PostgreSQL*
THE HACKTOBERFEST GAME - YEAR 2! 🎮⌨🚀
Tags: hacktoberfest, contributorswanted, javascript
Published: 2020-09-26 14:19:11

# Introduction
This time last year I came up with an idea to get more people involved in Hacktoberfest. The idea was simple, let's create a game, about Hacktoberfest. 

# Hacktoberfest Racer
Name still in the works &mdash; someone make a pull request 😁
The idea is that *racers* compete in an event where they are tasked to type out some code as fast as they can. The winner &mdash; the person who types out the code the fastest &mdash; will be the one who makes the merge to master and receives the sought after Hacktoberfest badge. The bigger the number of Hacktoberfest badges a racer has, the bigger the flex 💪.

# 2019
Last year was an awesome experience, we had a lot of interest in the game and I was overwhelmed by the brilliant ideas comes up with, you're all way more creative than me.

# Getting started
Firstly head over to the repo [hacktober-racer](https://github.com/LukeGarrigan/hacktober-race) and giving it a star ⭐ to hopefully spread the word even further. 

## Get it running 🏃‍♂️
1. npm install in the root directory
2. npm start to get it running!
3. Navigate to localhost:4000

The game so far is a cut from an old repo I made a blog about to quickly develop multiplayer games in the browser "[Code a BRILLIANT multiplayer game 🚀 in 2 MINUTES!](https://dev.to/lukegarrigan/code-a-brilliant-multiplayer-game-in-2-minutes-2gdd)" &mdash; reading this may help you in understanding what's going on under the covers!

## Make a pull request!
All features that are going to be added will be placed in the [issues](https://github.com/LukeGarrigan/hacktober-race/issues) section of the repo. Go ahead and find an issue you want to work on and get stuck in!

# Open to suggestions!
Feel free to raise issues for features you think would be awesome in the game. Also don't hesitate to ask me questions on the repo in the issues section, if you'd like any advice on a PR or a ticket I am happy to help (Or you could just DM me on [Twitter](https://twitter.com/luke_garrigan)).

People are already making pull requests prior to releasing this blog which is amazing! Get involved people, be apart of this will-be brilliant game!

We have exactly ONE month to get as much done as possible, then the repo will be put on hold for a year, unless it's in a releasable state 😀!!

Thank you, if you like my rambling check out my personal blogging site at https://codeheir.com/
What You Should Know About DNS Before Deploying Your Site
Tags: beginners, devops, tutorial, webdev
Published: 2020-09-26 13:55:36

If you don't know what DNS is your going to have a hard time getting traffic to your website. If you know what it is, but don't understand how it works your walking in the dark. At a minimum you should know how DNS works at a high level. That being said this article gives you resources to understand DNS in breadth and depth.

# DNS

DNS stands for domain name system. It's the thing that turns `www.google.com` into something that a computer can actually understand. An IP address.

# Free

[DNS made easy](https://dnsmadeeasy.com/support/what-is-dns/) - This is a great intro to DNS. It gives the big picture about what DNS does and how it works. The amount of information in here will probably leave you asking questions about certain things, but that being said I haven't found a more entertaining video about DNS than this one.

[How DNS works - Computerphile](https://www.youtube.com/watch?v=uOfonONtIuk) - This is quite similar to **DNS made easy**, but it provides a bit more detail on how things work. Hearing the same information in a different way often helps solidify your understanding.

[DNS the good parts](https://www.petekeen.net/dns-the-good-parts) - This puts the ideas in the previous two resources into practice. This article talks about DNS, but more practically gives you a way to poke at DNS with the`dig` (domain information grouper) utility.

# Paid

[DNS & BIND](https://www.oreilly.com/library/view/dns-and-bind/0596100574/) - This is by far the most in depth resource here. This book covers just about everything you could want to know about DNS. If your looking to understand DNS on a deeper level this is where you'll want to go.


# Final Thoughts

How much you'll need to know about DNS will vary. For most It'll probably be good enough just to know how it functions at a high level. Others might need to know the nitty gritty of how DNS operates.

If your looking to understand how DNS works at high level check out

- DNS made easy
- How DNS works - computerphile
- DNS the good parts

If your looking for a deep dive on DNS then go read

- DNS & BIND

That's all I got for ya. If you enjoyed this article there's more of em at the [Learning Computations Archive](https://buttondown.email/LearningComputations/archive).
Candle - A 2D lighting library for SFML
Tags: showdev, sfml, cpp, gamedev
Published: 2020-09-26 13:46:41

There is a big difference in the look and feel of a 2D game with dynamic lighting and one without it. The bad thing is that, while 2D game development is relatively accessible, lighting algorithms are not as much.

Fortunately, we have amazing people in this world, like javidx9, that has [this amazing tutorial](https://www.youtube.com/watch?v=fc3nnG2CG8U) on 2D shadow casting. It inspired me to write Candle. It is easy to integrate, it has no dependencies other than SFML itself and it's open for further development!

The code comes with a demo to test the main features, which are dynamic lights, fog and shadows.

![demo gif](https://raw.githubusercontent.com/MiguelMJ/Candle/master/doc/img/demo.gif)

Any feedback is appreciated! Thank you and have a nice day ;)

Code: https://github.com/MguelMJ/Candle
Documentation: https://github.com/MiguelMJ/Candle


{% github MiguelMJ/Candle %}
NordVpn Pricing - YearlyPlan Explain
Published: 2020-09-26 13:45:21

NordVPN’s monthly starting price of $11.95 remains unchanged. As expected, massive discounts are available when opting for long-term plans, but these plan prices have been increased a little bit since we first did the review a couple of years ago. They have also introduced a new six-month plan that will set you back $9 a month.

That said, NordVPN remains one of the more affordable premium VPN options when considering longer subscriptions. Nord has unfortunately done away with their enticing 3-year subscription. You can opt for a two-year plan though that brings the monthly rate down to just $3.71.

Standard payment options include debit and credit cards, and you can also use a variety of cryptocurrencies, unlike other VPNs like IPVanish and ExpressVPN that only offer bitcoin. Supported regional payment options and wallets include AliPay, WebMoney, Yandex, iDeal, UnionPay, SOFORT, and GiroPay.

The Android app lets you get started with a free seven-day trial. The option is hard to find on the website but can be accessed when you download any of the apps. NordVPN is one of the few premium services that provide a free trial and also offers a no questions asked 30-day money-back guarantee as well.

https://nordvpn-3-year-deal-plan.s3.amazonaws.com/index.html
Convert a set to an array
Tags: javascript, codenewbie, beginners, webdev
Published: 2020-09-26 13:41:16

```
const set = new Set([1, 2, 1, 4, 5, 6, 7, 1, 2, 4]);
console.log(set); // Set(6) {1, 2, 4, 5, 6, 7}

set.map((num) => num * num); // TypeError: set.map is not a function
```

It does not work because `sets` are `iterables`.
To convert to an array,
```
const arr = [...set];
```

---

**Thanks for reading 💙**  
Follow **@codedrops.tech** for daily posts.  
[Instagram](https://www.instagram.com/codedrops.tech/) ● [Twitter](https://twitter.com/codedrops_tech) ● [Facebook](https://www.facebook.com/codedrops.tech/)

Micro-Learning ● Web Development ● Javascript ● MERN stack ● Javascript  
**[codedrops.tech](https://www.codedrops.tech/)**
Benefits of writing test for your code
Tags: testing, javascript, tdd, integration
Published: 2020-09-26 13:36:35

Why bother writing tests for your code? Many beginners to code testing would wonder. 
Bugs can be lurking anywhere in your code and if you are like me, you hate repetitively testing your application manually to check if something has broken the link. Writing your test in a way users interact with your app can give you the confidence that everything is still fine.

You don't want to sit back and wait for your users to report bugs which is even a punishment on their part. There are four different kind of test I will be discussing in my next episode soon...
Writing a ReadMe: StarterPack
Tags: vscode, github, beginners
Published: 2020-09-26 13:20:57

First, create a `Readme.md` in your code editor!

**Headers:**
This is usually your title or subtitle in your markdown file.

```python
# for H1 
## for H2
### for H3
#### for H4
##### for H5
###### for H6 
```
That gives you:
# Read me
## Read me
### Read me
#### Read me
##### Read me
###### Read me

***

**Style:**
For a bold font, use double asterisks: `**Read me**`. 
This gives you: **Read me**

For an italic font, use single asterisks: `*Read me*`. 
This gives you: *Read me*

For a strike through text, use double curly lines: `~~Read me~~`. 
This gives you: ~~Read me~~

<hr></hr>

**Lists:**

```javascript
1. Mango
2. Pineapple
3. Berry
   1. Strawberry
   2. Blueberry

* Cherries
* Watermelon
* Citrus
   * Orange
   * Grapefruit
```


1. Mango
2. Pineapple
3. Berry
   1. Strawberry
   2. Blueberry

* Cherries
* Watermelon
* Citrus
   * Orange
   * Grapefruit

The asterisks can be replaced with + and - :
```
+ Papaya
- Guava
```
+ Papaya
- Guava

<hr></hr>

**Links:**
```
[Click me I'm google!](https://www.google.com/)
```
[Click me I'm google!](https://www.google.com/)

<hr></hr>

**Code:**
Use back-ticks to get incline code:
```
`How to write a simple ReadMe`
```
This gives you: `How to write a simple ReadMe`

For a block of code, use 3 back-ticks at the beginning and the end of your code.

```javascript
console.log('Read me')
```

```python
print('Read me')
```
<hr></hr>

**Tables:**
You use | to separate the table columns and - for the column header with : to align them!

```
TV Shows|Seasons|Genre
--------|:-----:|:-----
Money Heist|4|Crime
Schitts Creek|6|Comedy
```
TV Shows|Seasons|Genre
--------|:-----:|:-----
Money Heist|4|Crime
Schitts Creek|6|Comedy

<hr></hr>

**Images:**
You can add images: `![imagename](TargetUrl)`
```
![Pineapple](https://i.pinimg.com/originals/54/fb/a3/54fba3dbd6b4af80cfc4d2bd6cb5c81b.jpg)
```
![Pineapple](https://i.pinimg.com/originals/54/fb/a3/54fba3dbd6b4af80cfc4d2bd6cb5c81b.jpg)


To add an image from locally, there are many ways to do this. My favourite is using [imgur](https://imgur.com/upload). This creates a URL for your local image!

<hr></hr>

**Videos:**
Youtube links can be added: `[![video name](Video URL img)(Video URL embedded)]`

```
[![Anthony Ramos](https://i.ytimg.com/vi/gfIugjRFNXs/maxresdefault.jpg)(https://www.youtube.com/embed/Jc9pka7sE0w)]
```
[![Anthony Ramos](https://i.ytimg.com/vi/gfIugjRFNXs/maxresdefault.jpg)](https://www.youtube.com/embed/Jc9pka7sE0w)

<hr></hr>

**Gifs:**
One way to add Gifs to your markdown is to:
1. Convert your video into gif using [Imgflip](https://imgflip.com/)
2. Once your Gif is generated, you can save it in .gif file.
3. Bring .gif to your code editor
4. `<a href="yourgif.gif"><img src='yourgif.gif'></a>`

<hr></hr>