teleren/devto huggingface dataset:
How to deploy Node.js app with PM2 in production
Tags: devops, architecture, node, webdev
Published: 2019-10-14 09:04:50

---
title: How to deploy Node.js app with PM2 in production
published: true
date: 2019-10-13 14:46:44 UTC
tags: devops, architecture, node, webdev
canonical_url: https://boobo94.xyz/devops/deploy-nodejs-app-with-pm2/?utm_source=rss&utm_medium=rss&utm_campaign=deploy-nodejs-app-with-pm2
---

To deploy Node.js app with PM2 it’s very simple and nowadays is very important to use the right tool which facilitates your time. [Time is the most valuable resource](/developer-story/time-to-work-later/) that a human being can own, so try to avoid those tools which are time-consuming.

I would like to present below a simple solution found by me to deploy Node.js app with PM2. I needed a fast solution and with less configuration as possible. I tried as well Forever JS, you can find the [NPM page here](https://www.npmjs.com/package/forever) or [Github repository](https://github.com/foreversd/forever#readme). But I prefer the documentation and explanation of [PM2](https://pm2.keymetrics.io/).

Firstly you need to create a pm2.json file and put it preferably in the root of your project:

```json
{
    "apps": [
        {
            "name": "web",
            "exec_mode": "cluster",
            "instances": "max",
            "script": "./lib/server.ts",
            "interpreter": "ts-node",
            "env": {
                "ENV": "prod",
                "PORT": 3000,
                "DB_USERNAME": "boobo94_username",
                "DB_PASSWORD": "123",
                "DB_NAME": "some_db_name",
                "DB_HOST": "127.0.0.1",
                "DB_DIALECT": "postgres",
                "DB_PORT": 5432,
                "SECRET_KEY": "boobo94_is_my_secret_key",
            }
        }
    ]
}
```

## Prerequested

- npm & node
- PM2 `npm i -g pm2`
- Typescript `npm install -g typescript`
- PostgreSQL installed

## How to run it

1. `pm2 install typescript`
2. `pm2 install @types/node`
3. `pm2 start pm2.json`

The name of the web service is `web` under pm2 manager.

That’s all. To check the availability:

```
pm2 show web
```

My example use typescript, if you don’t want typescript, in the pm2.json file the value of `interpreter` would be `node` and from **How to run it** section you can skip the first two steps.

The post [How to deploy Node.js app with PM2 in production](https://boobo94.xyz/devops/deploy-nodejs-app-with-pm2/) appeared first on [boobo94](https://boobo94.xyz).
Beware Counterfeit No Starch Books from Amazon!
Tags: news, books
Published: 2019-10-13 14:22:00

It turns out, Amazon itself (*not* a third-party seller on Marketplace) is selling **counterfeit copies** of No Starch Press books!

{% twitter 1183095004258099202 %}

{% twitter 1183094406573748225 %}

{% twitter 1183187632940974080 %}

This is *not* the first time Amazon has done this, either...

{% twitter 844030960333152256 %}

What should you do?

1. Order directly from No Starch Press, or from a reputable bookseller where you can handle the product and verify it's the real deal.

2. Look for tell-tale signs of counterfeit books: thin paper, inconsistent margins, low-resolution text or images, mismatched spine, books that don't lay flat, et cetera. No Starch Press has a reputation for extremely high-quality books, so if you get anything that doesn't measure up to that standard, it's probably counterfeit!

3. If you encounter a counterfeit book, please report it to No Starch Press immediately!

If Amazon is going to do this to a major publisher like No Starch Press, who else are they doing this to? Buy directly from publishers, or from reputable booksellers like Barnes & Noble!

---

More reading...

[Vox: Amazon's counterfeit book problem is still making it money](https://www.vox.com/the-goods/2019/6/24/18715584/amazon-counterfeit-book-problem-nyt-project-zero)
The violence within
Tags: career, startup
Published: 2019-10-13 14:16:07

For the past 15 years, I've had multiple encounters with the systemic violence baked in our mainstream work culture: bullying, constant competition, harassment, mocking, productivism, racism, sexism, sticks and carrots, etc. You name it.

I've spent hours talking about these heart-breaking situations with friends, lawyers, psychologists, and work inspectors. All have been witnessing a shitstorm that is destroying people from all horizons.

All companies indulge in it: big corporations, public services, NGOs, etc. It's everywhere, even (especially!) in those over-hyped companies called startups.

Look around you for a moment. One out of three women is sexually harassed in the workplace [^1]. One out of two men is bullied by a supervisor [^2]. The person you're looking at right now is likely molested as we speak.

I don't know if you've been there (yet), but I have. And I refuse to feel guilty about it. I refuse to wear those traumas as a shame mark.

I fell prey to [the lies our work culture tells us](https://dev.to/ronsoak/the-lies-and-lack-of-self-respect-that-lead-to-burnout-5007). And our work culture has seared its own culture of silence into our collective conscience. For a long time, I felt isolated. But no more.

<blockquote>Only sitting in a circle of women, listening to similar stories, allowed her to realize that she wasn't alone, it wasn't her fault, she could speak up. <cite>Gloria Steinem, My Life On The Road</cite></blockquote>

No matter the gender you're relating to, sitting and sharing similar stories with others can be the first step to saying "No!" to this violence. This is why I want people to speak up and talk to each other. This is why I talk about it so that people will take courage from it.

Silence is playing our violent working culture's game. Silence is accepting your disappearance, literally and symbolically. Silence is dying.

<mark>Talking is bonding with others. Talking is organizing and exploring new paths. Talking is living.</mark>

You're not alone. Help and kindness are sometimes found when most needed. Find your circle, listen, and maybe, talk.

Rémi

Want to talk? My DMs are open. Noticed something? [Create an issue on GitHub](https://github.com/merciremi/remicodes/issues/new).

--- 

Originally published on my blog 👉 [remimercier.com.](https://remimercier.com/the-violence-within/)

[^1]: Official studies assume that most harassments are not reported for fear of retributions. For official data (in French): [https://www.egalite-femmes-hommes.gouv.fr/dossiers/egalite-professionnelle/lutte-contre-le-harcelement-sexuel-au-travail/les-chiffres-cles-du-harcelement-sexuel-au-travail/](https://www.egalite-femmes-hommes.gouv.fr/dossiers/egalite-professionnelle/lutte-contre-le-harcelement-sexuel-au-travail/les-chiffres-cles-du-harcelement-sexuel-au-travail/)
[^2]: See Canada's official data: [https://www150.statcan.gc.ca/n1/pub/75-006-x/2018001/article/54982-eng.htm](https://www150.statcan.gc.ca/n1/pub/75-006-x/2018001/article/54982-eng.htm)
Learning JavaScript and Vue
Tags: javascript, vue, learning, webdev
Published: 2019-10-13 14:01:26

---
title: Learning JavaScript and Vue
published: true
description: 
tags: javascript,vuejs,learning,webdev 
---

This is my first post here at dev.to I've never done anything like this before so bare with me. I'm keen to try and get more involved in the community as I lurk a lot so here goes.

I'm a web developer as my day-to-day job primarily involves building HTML emails (everyone's favourite) and landing pages in different platforms. I'm looking to level up and move away from this work and do more 'dev' work. I'm currently learning VueJS (which I really like through a combination of pluralsight and tutorials) and am keen to learn more about its ecosystem currently in the process of moving my blog and portfolio (if you can even call it that...) from jekyll and github pages to Gridsome (as its Vue based I thought why not) and Netlify. I have moved my blog posts over and have a version up and running it was fairly straightforward as I found a couple of tutorials on getting started but GraphQL I know nothing about so not sure if it's worth me looking more into it?  

It has made me realise how much vanilla JS I have forgotten as I don't get to use it in my day job so am trying to refresh all the basics as I know a bit of ES6 syntax and some array methods. I consider myself a beginner with Vue but I've built/am building a couple of different things with the Vue-CLI. 

Does anyone use Vue a lot? Would you recommend perhaps learning something like React as well? I have read about it briefly bu8t it seems so alien to me but everyone seems to rave about it. 

If anyone has any tips they would be appreciated.
Governance in angular
Tags: angular
Published: 2019-10-13 13:47:40


I don't know whether this really belongs here but I thought I'd ask anyhow. I'm writing my thesis on governance in open source software projects. It would help me immensely if one of you could answer this short questionaire concerning the development of Angular itself. Lots of thanks in advance!

Answer with:

0) Closed from outsiders (i.e. not part of the company), 1) Open only to an exclusive group, 2) Open to accredited individuals, 3) Open to any external observer

A) Who can contribute source code?

B) Who can test code contributions?

C) Who can accept code contributions?

D) Who can access the complete, live development version?

E) Who can impact work issue priorities?

F) Who knows integration status of code contributions?

G) Who can view the project roadmap?

H) Who knows release timing and content?

I) Who knows priorities of project issues?
Nested, Muxed, Screens on the CommandLine
Tags: linux, showdev, productivity
Published: 2019-10-13 13:47:12

I'm a huge fan of the command line and always have been.  If you're like me, you're most comfortable at the keys in a dark terminal session.  Most of my day to day work can get accomplished through a terminal, with the rare case of needing a graphical web browser.

As both a network engineer and systems admin, I have a lot going on at any given time.  There are two tools I believe we all use, stuff happening in the background, and an organized classification of our work areas, often times separated.  

This is a good way to classify projects, environments, testing, coding, you name it.  Each workspace has it's own separation.  I'm often logged into dozens of servers, iot devices, lab machines, vms, cloud instances.  It helps to stay organized.

And I'm not going to log into these resources everytime I swap client machines I'm working behind.  I could be using a linux machine, a chromebook, a windows laptop, bastion host, or temporary container. I need stuff to continue to run in the background.

This is where GNU Screen comes in.  I've used it for years.  How to use screen is a bit out of the scope of this post, but the quick description is that it's a terminal muxer.  It takes one ssh session and creates a back-end of many sessions.  You can disconnect and leave them running, move to a different client, and re-connect later.  This is great for long-running processes like compiling or creating stacks or container environments.  Commands are based on a hot-key "ctrl-a".  For example, to switch to the next screen session, "ctrl-a n".

Now somewhere on the internet, there's a holy war raging.  There are people who prefer tmux, an alternative to GNU screen.  Each has their own pros and cons, and for a while I switched from exclusively screen to exclusively tmux.  But wait, these are open source tools, can't I use both?  The hot-key for tmux is "ctrl-b" and some of the commands overlap.  Ie, next-session in tmux is "ctrl-b n".

The diagram shows my new setup.  Tmux handles my groups. Screen handles my sessions inside those groups.

Typically I use up to nine sessions in each screen session, so this allows me to have eighteen sessions muxed into one, grouped into two groups.  I've found a more comfortable working number is somewhere between 12-15.  

![my screen nested tmux layout](https://thepracticaldev.s3.amazonaws.com/i/wgfhaji8qiul66qkzcpi.png)

This is just the tip of the iceberg when it comes to tools.  Don't even get me started on mosh, the mobile shell which uses protocol buffers (from Google) to resume roaming sessions.  

[Update]: I've been using the same tmux-start script for a while, and roughly 23 sessions (20 screens + 1 more tmux group with 3 panes). I was comfortable, so automated it a bit.

I have also added it [as a gist here](https://gist.github.com/flrichar/bfe95d130d980b9f279dd9d8ed388ed6), please ignore my joke about it exploding everything, but seriously you should completely understand things you find randomly on the internet, before running.
Governance in React
Tags: react
Published: 2019-10-13 13:14:59



I don't know whether this really belongs here but I thought I'd ask anyhow. I'm writing my thesis on governance in open source software projects. It would help me immensely if one of you could answer this short questionaire concerning the development of React itself. Lots of thanks in advance!

Answer with:

0) Closed from outsiders (i.e. not part of the company), 1) Open only to an exclusive group, 2) Open to accredited individuals, 3) Open to any external observer

A) Who can contribute source code?

B) Who can test code contributions?

C) Who can accept code contributions?

D) Who can access the complete, live development version?

E) Who can impact work issue priorities?

F) Who knows integration status of code contributions?

G) Who can view the project roadmap?

H) Who knows release timing and content?

I) Who knows priorities of project issues?
My First Hackathon ( an amazing experience )
Tags: hackathon, development, react, net
Published: 2019-10-13 13:08:04

---
title: My First Hackathon ( an amazing experience )
published: true
description: 
cover_image : https://thepracticaldev.s3.amazonaws.com/i/zp36f8br46sf1hybdk4l.png
tags: #hackathon #development #react #.NET
---



#from the start
I applied for this event as a way to challenge myself and network. the hackathon took place at [AccessOne](http://www.accessone.com.br/), a company dedicated to identity and access management.The tecnologies used was **React** and **C#**,being that I was responsible for FrontEnd ( it was really a challenge because it had been a long time since I worked with React ).

#the challenge proposed
We had the challenge build a API and an client application that could register computers and receive user commands and execute these commands on a machine (Windows or Linux).

#organization phase
After the presentation of the challenge and the formation of the teams (in this case, a pair), we started the Kanban Board, where we were deciding what functionality we needed and what tools / libraries we would use. We also defined which commands we would execute.

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/wa885whlmmjvxy0rnc7i.jpg)

#hands on code
So is here that magic happens.I started thinking about the division of the screen components, which were basically a component for the navigation menu, registration table (computers and computer groups), making it possible to insert new computers and update the data of already registered. My partner was then responsible for building the .NET API.

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/b9rwt3zn2c68osut3kph.jpg)

#the bug phase :x:
After assembling the screen components and my partner building the API, the time has come to unite the applications and behold BOOM! The errors start to appear. We face many problems with SSL Certificate. We spent a lot of time getting applications to communicate (we found out later that all participants experienced this problem). After solving the problems, there was little time to start the presentation phase, so we were able to pull data from the bank and make the entries, leaving the other features unfinished

#apresentation phase
After all, it was time for the presentations, to my surprise, all teams had a problem with SSL or another communication problem and couldn't implement everything on time. I just have to thank  [AccessOne](http://www.accessone.com.br/) for the opportunity and my competition partner [Alan Soder](https://www.linkedin.com/in/alan-soder/) for the good teamwork.

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/1xfwaqfa88zlk2bj7hdn.JPG)

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/a7kw0hwcz06q6e9k5uu6.jpg)

#**``tell us a little bit about your experiences, it would be really cool to share it with others``** :heavy_check_mark: :link:
A SimpleExplorer Built With ElectronJs, ReactJs,and Typescript
Tags: electronjs, javascript, react, typescript
Published: 2019-10-13 12:39:19

![Electron Image from Quantized.com ](https://quantizd.com/wp-content/uploads/2018/05/Electron-React.png)
*Image: <small>Quantized.com</small>*

I promise to say the truth and nothing but the truth.

Here it comes.... the truth...Drum rolls.

![I have been busy](https://media3.giphy.com/media/OsLReVsmTgicw/source.gif)
<center>I have been busy </center>

Yeah, that is the truth , I said it. I am free. 


It doesn't look like something I should be scared to say but then, I believe I should not be too busy to finish a project I started. 

Anyways, it happened. I started a project and left it unfinished. 

This is not an article about the love and hate relationship most developers have with electron apps. It is more about a Simple File Explorer App I created with Electronjs. I have been on it for a while  and I hope someone might just tell me what he or she thinks about it.

## Here are some details about it:
Github REPO: [Simple Explorer](https://github.com/Akintunde102/simpleExplorer)
- It is an ElectronJs App
- It is meant to be a File Explorer for PCs/Macs
- It has a bundle of features like file preview for some media content types
- It can read Code files and preview it with good indenting, all thanks to some wonderful react libraries.
- The architecture of the app was cannibalized from the [Museeks](https://github.com/martpie/museeks) App, meaning I downloaded Museeks Source Code, removed the core codebase while leaving the file structure and configuration behind, then I added my own codes to make SimpleExplorer. 

## Why did I Cannibalize [Museeks](https://github.com/martpie/museeks)? 
 - Museeks as a project was too attractive. It was architectured for Typescript & React usage. What else can be more wonderful? 


## What do I need from you?
- Tell me what you think
- Adopt this project as yours
- Contribute to it
- Be a friend.

Thanks for taking your time to read. Expecting your response.
Learning about eBPF on macOS
Tags: linux, ebpf
Published: 2019-10-13 12:22:00

---
title: Learning about eBPF on macOS
published: true
date: 2019-10-13 12:21:00 UTC
tags: linux,ebpf
canonical_url: https://booyaa.wtf/2019/learning-about-ebpf-on-macos
cover_image: https://thepracticaldev.s3.amazonaws.com/i/jxqs31y2z5g7xu6g2hx4.png
---

Photo by Sarah Lee on [Unsplash](https://unsplash.com/photos/QURU8IY-RaI)

I've created this is a short post to talk about a new GitHub repo that might be useful to some: [vagrant-bcctools][gh_repo].

It's a simple Vagrant box using the latest (at the time of writing) version of Ubuntu (bionic) with the bcc tools [package][ubuntu_packages] installed.

I needed a way to play around with [eBPF][iovisor_ebpf] on macOS locally. So before embarking on a fool's errand, I did some research. For details about my findings, see the repo's [`README.md`][gh_repo].

I saw there was a Docker image, which doesn't work because I think it expects the underlying Docker host to be Linux base (volume mounts to `/lib/modules`, `/usr/src` and `/etc/localtime`). 

The `Vagrantfile` provided by [IO Visor][iovisor_homepage] is using such an old version of Ubuntu that a modern version of Vagrant seems to choke on it.

No doubt someone will point me to something that only requires [xhyve][gh_xhyve] (at me on Twitter or dev.to if you do know).

<!-- links -->

[gh_repo]: https://github.com/booyaa/vagrant-bcctools
[ubuntu_packages]: https://packages.ubuntu.com/bionic/all/bpfcc-tools/filelist
[iovisor_ebpf]: https://www.iovisor.org/technology/ebpf
[gh_xhyve]: https://github.com/machyve/xhyve
[iovisor_homepage]: https://www.iovisor.org/
Designing Data Intensive Applications - Book Review
Tags: data, database, book, review
Published: 2019-10-13 11:29:57

---
published: true
title:  Designing Data Intensive Applications - Book Review
tags: Data, Database, Book, Review
cover_image: https://iammowgoud.com/blog/assets/imgs/ddia-review/cover.jpg
canonical_url: https://iammowgoud.com/blog/Designing-Data-Intensive-Applications-Review/
---


*Originally posted on my [personal blog](https://iammowgoud.com/blog/Designing-Data-Intensive-Applications-Review/)*

This book is definitely a classic. The book basically touches upon the surface of a wide array of topics related to handling data in a distributed environment; ranging from basic database theory, ACID, replication and partitioning to more complex (and "modern") topics like stream and batch processing on the cloud.

>
> ## "Data outlives code.”

> \- Martin Kleppman
>

Martin Kleppman lays down all the needed information on what every engineer needs to know about designing systems that deal with any kind of data.

The first part is about basic database concepts:

- Relational vs. NoSQL
- Different query languages
- How data is actually persisted on storage devices. (B-Trees / LSM Trees)
- Encoding and serialization/deserialization

The second part goes deeper and discusses the following concepts *(and their issues)*:

- CAP Theorem
- Replication
- Partitioning
- Transactions
- Consistency

The final chapter discusses ***derived data*** and  aims to tackle the issues discussed in the previous part, as well as introducing more "modern" concepts like:

- Batch and Stream processing (MapReduce/Spark)
- Eventual consistency and "Change Data Capture"

Although the book doesn't dive into any  deep technical or implementation details, it has a very good bibliography and footnotes that leads you to all of the academic papers you need. Overall, the book is an essential read for any software/data engineer in 2019.

*Instagram Art:*
![Some Instagram art](https://iammowgoud.com/blog/assets/imgs/ddia-review/cover.gif)

- [Review on Goodreads](https://www.goodreads.com/review/show/2833852928)

- [Book website](https://dataintensive.net/)

- [Book on Amazon](https://www.amazon.com/Designing-Data-Intensive-Applications-Reliable-Maintainable/dp/1449373321)
successfully completed 🎉🎉
Tags: mongodb
Published: 2019-10-13 11:24:59

Confirmation: http://university.mongodb.com/course_completion/9d58d436-974e-47ef-bf01-d3ce51df6634

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/2pd4fevz1le4h23532t4.jpg)
Console Games - Snake - Part 2
Tags: gamedev, csharp
Published: 2019-10-13 11:00:10

Following on from <a href="http://pmichaels.net/2014/11/12/console-games-snake-part-1/">this post</a>, we were creating a snake game for the purpose of teaching a 9 year old to program.  This post will not make sense without its predecessors.

<strong>Clean up the tail</strong>

The next part of this game is to get the snake game to tidy up after itself (to remove the last part of its own tail).  This was done (for us) in two parts.

```csharp

private static int _length = 3;        

private static void CleanUp()
{
    while (points.Count() > _length)
    {
        points.Remove(points.First());
    }
}
```

This is called from AcceptInput:

```csharp
private static bool AcceptInput()
{
    . . . 
    points.Add(currentPos);
    CleanUp();

    return true;
}
```


If you run that now, it simply does what it did before; the final part is to re-introduce the clear:

```csharp

private static void DrawScreen()
{
    Console.Clear();
    foreach (var point in points)
    . . . 
```
	
So now we have a 3 star snake game; try extending the length manually to play with it.  It is strangely addictive, even in this immature state.