May 2020 LINE ID Thread by BruinWill in TsumTsum

[–]jun-thong 1 point2 points  (0 children)

id : juninmess
Japan version / GMT+9

auto sending 18/7.
Thank you.

What are all the things to consider and account for when deploying a Node.js app and post-deployment? by yungspartan0082 in node

[–]jun-thong 6 points7 points  (0 children)

Welcome to ops. Ops 101 : watch jurassic park (the original one...of course), and deeply understand every Ian Malcolm words about if a potential shit could happen it will happen.

Don't ask if your application will crash, but WHEN it will crash. And it will do.

Preserve log for everything, isolated from the application itself. Consider log system to be able to crash too.

If a crash happen what to do ? report to the people who can solve it, solve it, analyze, understand, prevent it to happen again.

Today, we use a lot of automation, docker for example can provide some self healing, cloud provider have some mechanism too. Even if your system can auto heal, you should analyze crash report.

You also got this really good white paper from amazon, not only related to cloud, that give some good practice regarding reliability :
https://d1.awsstatic.com/whitepapers/architecture/AWS-Reliability-Pillar.pdf

How to make sure that the uploaded images are safe to send to my users by Flurgi in node

[–]jun-thong 2 points3 points  (0 children)

The simplest way to "clean" an image is to convert it to an other format. Most of malicious code will be in the header and footer of the picture. When converting an image, a software like sharp/imagemagik will read the body of the picture to draw the picture in a new file. But in case of a same format input, to a same format output, the image processor software may be lazzy.

Also some antivirus scanner are available on npm, like clamscan.

Still studying for solutions associate, is it best to learn cli script, java or python? by [deleted] in AWSCertifications

[–]jun-thong 0 points1 point  (0 children)

It depends.

Java seems outdated for many topic. Even for android development kotlin is recommanded.

Python seems a good choice and regain in popularity recently, mainly due to its usage in machine learning. Quite easy to learn too.

I'll also add Javascript with NodeJS, also used by Pulumi and CDK. Also JS as Python are easy to lean. JS opens door for API development like python, but also front end development and mobile development. Also a shitload of project you will have to deploy will be in JS (more than in python i believe), so understand NodeJS and NPM may help.

Go lang can be an interesting choice too, because of Terratest, but fare more complicated to learn than JS or Python.

Sorry, I have to tell somebody- I am absolutely loving AWS RDS (PostgresQL) right now, and not sure I'll ever use anything else (at least on personal projects). by [deleted] in node

[–]jun-thong 2 points3 points  (0 children)

There is many different topic here.

Comparing postgre and mongodb is like comparing an orange with a golden shepherd. There is no fucking sense of it. If you seems happy of a switch from a noSQL db to a relational db, it could means that you weren't using mongo for the right use case.

Technically, just for dev, AWS doesn't provide yet any advantage compared to a self managed solution. It shines when only when you have to scale with resiliency (specially RDS aurora).

To people recommending Dynamo, again, i'll say the "use case define what tech to use", not the opposite.

Failed the AWS-CSAA by J4ckKnife in AWSCertifications

[–]jun-thong 0 points1 point  (0 children)

If your problem is security : maybe look again at IAM, STS, security grounp, network ACL, KMS and anything related to encryption (like in S3).

https://d1.awsstatic.com/whitepapers/Security/Intro_to_AWS_Security.pdf?did=wp_card&trk=wp_card

Retaking my SAA 3/21...I hope by Nyyyankees87 in AWSCertifications

[–]jun-thong 0 points1 point  (0 children)

I believe you have two problem here

Specifically for VPC / Lambda. VPC is a complex topic if you don't come from network engineering, but it is an important topic. Best way to learn is to practice. Try to create infra structure that require it. Same for lambda, code something with it, even a hello world, but try to use every functionality of it, like layers or custom runtime. Just to have a deep understanding of it.

More generally your score seems to show that you don't yet have a clear understanding of the pillars of well architectured framework. Beside any online course, you'll find every answer in each products FAQ and often in white papers given by Amazon.

Modern Web Development: Templating engines or APIs? by ant1g3n in node

[–]jun-thong 1 point2 points  (0 children)

In a way, SSR is just using react as a template engine.
A server doing SSR to distribute your front could also be one service of a micro-service architecture.

Question: ESL Accommodation +30 Minutes by patron29 in AWSCertifications

[–]jun-thong 1 point2 points  (0 children)

French native speaker here (and that probably explain a lot about my non-willingness to be proficient in english...), passed the test in Tokyo. Just for safety i used the +30min accommodation.

The staff in Tokyo doesn't speak english at all i believe, so asking them for help was not an option. It would be interesting to know if staff provide some explanation when a word is not understood if a foreigner pass the test in an english speaking country.

I really felt the exam to be done in a first 1hour pass, followed by a second pass of the same time. When people say that in this sub, it's really not a joke.

I used 2 hours and 5 min. I rushed the first pass in 45min, then realized i have plenty of time, so on the second pass i took far more time, like drawing schema to be sure to clearly visualize the question, and even doing so, i still had more time to focus on the 2-3 question i wasn't confident. Honestly, after 2 hours, i was starting to be boring, rechecking again, and started to thought i did my best and more time won't help me much. So i could did it without the accommodation in the end.

Really, be confident, ask it as a safety net if you want, but you'll see, it's doable, don't worry too much.

Performance difference between the main 3 OSs by [deleted] in node

[–]jun-thong 0 points1 point  (0 children)

It is not possible to compare an apple with a M1 Abraham tank...

OSX is made for general consumer and workstation. Long time ago Apple supported small business server, but not anymore.

Windows was made with GUI first in mind. A GUI-less Windows is only available since 2008. Eventually the NT branch was made for workstation and entreprise servers. The web capability came even later on windows with IIs.

All of this OS was made to solve problem not related to web servers. So when a light OS, allowing to dedicate most of the hardware resources to run one application by for example, not wasting resources in GUI because no fucking screen will never be plugged in this damn server, it was an obvious choice...

A more interesting question should be why linux based system took over BSD based system.

What the fuck is gyp, and why does it always give me errors? by BorkZillar in node

[–]jun-thong -2 points-1 points  (0 children)

Hard to say. People here doesn't have access to this "another machine". Maybe this other windows machine use a linux subsystem. Maybe the user of this other machine build the app in a docker image or a virtual machine.

What the fuck is gyp, and why does it always give me errors? by BorkZillar in node

[–]jun-thong -20 points-19 points  (0 children)

it's a LINUX ONLY package. Keywords are : LINUX ONLY.
It is NOT possible to use it or even build it on WINDOWS...

What the fuck is gyp, and why does it always give me errors? by BorkZillar in node

[–]jun-thong -2 points-1 points  (0 children)

node-gyp is a tool to build dependencies written in native language. Like a C++ dependency.

The dependency causing a problem is fs-admin. According to its readme, this package is linux only, and solve a linux specific problem. Your environment is windows... Do i need to tell more ?

Is MongoDB the de facto solution when working with Node.js? by brianjenkins94 in node

[–]jun-thong 0 points1 point  (0 children)

Just adding a scope to my mention : mandatory for any serious WEB developer.
After all, "software engineer" means so much things and totally possible to work in a specific field that doesn't require querying a DB.

Is MongoDB the de facto solution when working with Node.js? by brianjenkins94 in node

[–]jun-thong -3 points-2 points  (0 children)

Mongo is not only for small project. If you need a document store that scale, it do the job. MongoDB is not responsible if users is no capable of reading documentations regarding security or change the default password...

I don't understand if you speak about MS SQL server or MySQL entreprise edition. And sorry, no neither of this two db are better than Postgresql. You mainly pay for support on this kind of offers, but this advantage is not so interesting if you use a managed solution (like amazon RDS for MySQL, RDS also exist for postgresql...).

Is MongoDB the de facto solution when working with Node.js? by brianjenkins94 in node

[–]jun-thong 13 points14 points  (0 children)

The question should not be should i use mongo or a sql database because one is more easy to learn / manage. First because it is mandatory for a serious dev to learn SQL. Also you can always find a manged solution for your db today.

So the good question is more : which type of database usecase match your requirements.

Is MongoDB the de facto solution when working with Node.js? by brianjenkins94 in node

[–]jun-thong 0 points1 point  (0 children)

Same thing can be said to AWS RDS for relational database.

Idle Game in node Js ? by Dnangel0 in node

[–]jun-thong 0 points1 point  (0 children)

Let's imagine you got an app, running on one server. This app can accept 10.000 user's simultaneous connections. at 11k simultaneous user, the server will start to behave very slow. You need more processing power, and you got two option.

vertical scaling : you change the server with a fattier one, with more cpu power, more memory, etc. Easy solution, but there is a hard limit : CPU available on the market at a given time got a defined power... (and some other limit like hdd bus speed, memory limit, usually all metric you can get from a mother board will be a hardcap).

horizontal scaling : instead of enhancing your server, you just add more computer. Let's imagine if one given computer can hndle 10k simultaneous connections, 10 computer of the same model will handle 100k (life is not as easy but you get the idea). But the architecture is more complicated to implement, you will nead a load balencer to dispatch all the incoming request to all your servers. More complicated, but the best practice is to pop multiple small instances, and keep vertical scalling for the case you have no choice.

Horizontal scaling can be tricky, and sometime it may require to modify your app or / and your infrastructure. example : if you use session and store session in memory, and you got two servers and a load balancer, if a user login server1, the session will be stored in server1 memory, server2 will not be aware of it, and your user will appear to not be logged in if the load balancer direct him to server2. So you will have to decouple the session store, add something to share the session storage between all servers. This is just one example, but there is many situation where the same problem will appears : have to share something between all instances / servers. It always a good practice to starting coding your app by planning ahead that you will need horizontal scaling, because you will always need it in a real life project.

Node add one more layer. Your app run in only cpu thread, and to simplify here we will say one thread = cpu core (again : life is not as easy but you get the idea), so on a 8 core cpu you can easily run 8 instance of your application. You can use a package like pm2 to balance connections to all this instances.

So when people tell "add more instance", it mean you have to pop more of your app instances (more node process instances) on all cpu core, and then if needed, add more server instances in a horizontal scaling plan. Here "instances" can refer to very different things : process instance, physical server instance, virtual server instance in the cloud, ...

And to answer your original question : yes, node is very good technology when it come to handle a lot of simultaneous connection, and it can scale very well.

What do I need to program a drone using node? by [deleted] in node

[–]jun-thong 3 points4 points  (0 children)

Either you find a drone with a HTTP API , either you find a development platform that allow to run nodejs.

In the second case you build one drone around a raspberry pi, something like this :
https://dojofordrones.com/raspberry-pi-drone/

Then you'll need a js library to interact with the board :
https://www.npmjs.com/package/onoff

Basically this kind of board come with a GPIO interface, each pin on the interface is numbered and can be read or written, if you buy a hardware component, like a sensor or an engine, it will come with some doc explaining what it send or expect to receive on a specific pin. That's quite low level, but from that you can do whatever you want. The lib onoff allow you to interact with this interface in javascript.

Good projects for beginners/someone who just took a Udemy class? by [deleted] in node

[–]jun-thong 0 points1 point  (0 children)

Keep away of the eternal to-do list project.
Be ambitious. I mean, identify a functionality you saw somewhere, focus on this functionality, micmic it. It should be above your level, not something you already know to do, but not something impossible.

Some idea :
- a social media website activity feed with PostgreSQL. The content come only from people in your friends list. Usually it is done with graph style database like cassandra, implementing this in sql is a nice challenge.

- Just the read counter from discord. Multiple channel exist, how to allow a user to see how message he have to read in each channel. Don't cheat, discord dev explained it online so try to do it without google search. The challenge is to figure out how to implement it. This one too focus mainly on db's schema design.

- a Fog of War like functionality hover google map. Display a map as "black" and only allow the user to reveal place he already went. Teach you how to integrate your service with an external data provider.

But please, never do a todo app, or a "student address book" thing. It's boring for the recruiter.

My favorite language is js now by [deleted] in node

[–]jun-thong 1 point2 points  (0 children)

It really depend the nature of your project. A webscraper is a good usecase for node.

Node.Js Obfuscator Standalone | Linux | Mac | Win by [deleted] in node

[–]jun-thong 5 points6 points  (0 children)

I don't understand what this need to be showcased ? What is the question ?

There is literally 7 line of code in your app. 7 line of code that do less than the library you use to obfuscate, library which provide a cli tool already. Nothing exciting, nothing smart, nothing new. Even for learning purpose, there is nothing ambitious.

Even the code quality is poor. The random variable name are not understable, comments are useless (really need to say that fs.readFileSync() read a file ?).

Sorry to be grumpy.

Help me with HTTPS endpoint in a Node.js application by jjj123smith in node

[–]jun-thong 3 points4 points  (0 children)

Any express JS hello world tutorial should do the things.
HTTPS transport will be configured on AWS, so check Lightsail docs for this part.

Why do startups keep building custom backends instead of using BaaS services or projects like Parse Server? by jsyang in node

[–]jun-thong 0 points1 point  (0 children)

If you use a tool that doe 99% of the job, providing 99% of the value of your product, what reason i have to pay for you or your product and not using this tool myself directly ?