In this quick tip, we’ll learn about using crontab to automatically start our Node.js app, together with the use of pm2 , a production process manager for Node.js apps.

Normally as a prerequisite, you would run your Node.js server by calling such command syntax:

With pm2 you can do so using the following syntax:

You don’t have pm2 yet? you can simply install it with npm :

Now that you have the command that starts your server handy, let’s…


Short answer: we will be using yes command which basically outputs a string to stdout forever until the process is killed or command was cancelled.

We can redirect the output of this command to our target file to produce large files.

This command can generate repeated bits of strings, thus large amounts of data, and for how much it can do quickly that all depends to your system resources.

The outcome of running it for 5 seconds followed by a cancel:

That’s quite something, it did generate a 1.8G file in no time.


In this quick tip we will learn about blocking Twitter on your whole network using Packet Filter.

So I was searching for an alternative to iptables for Mac, and found out PF allows you to block TCP connections to hosts on specified ports, so let’s make use of that.

There’s a file to host your custom rules at /etc/pf.conf , you can edit it as root and append new rules as follows:

Great! I can just add Twitter domains there alongside with the 443 port which works…


In this quick tip, we will learn how to generate our Android app’s launcher icon (ic_launcher.png) on the fly.

Prerequisites:

  • A final image icon which will be used for the launcher icons, e.g https://placekitten.com/200/200 (that’ll be /tmp/kitten.png in this example).
  • A command line interface with the essential *nix commands, and imagemagick ( convert command will be used to resize our desired icon to the launcher icons sizes and to also fetch images dimensions). If you’re on MacOS or Ubuntu, this library ships with the OS. Be sure to check, running command -v convert to check if it’s installed.

First of…


React Native WebView comes in handy when you’re seeking to embed a webpage in your app or port some HTML file and render it into a scene.

While browsing through the web view, you may find external links that are set to open in new tabs (in a web browser), or had a nofollow attribute, or whatever the cause for which you don’t want your web view to render these links in your main app.

DOM Side

We may call it the front-end, which is the HTML of the web view, where you have no control (yet) over the DOM.

We will…

Samuel Elh

I am devloper

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store