Crontab – Linux

Here are some commands to be used to work with crontab in Linux sudo crontab -e Open to edit crontab crontab -l List all your crontab jobs * * * * * command to be executed – – – – – | | | | | | | | | —– Day of week (0 …


Deploy angular app into server

1- You need to build your project using: ng build –prod If you see some problem while launching your website, maybe it is because your build is optimized and it misses some needed component. In this case, you would need to set: … “optimization”: false, … You can find this line inside: angular.json or .angular-cli.json …


Handy commands for working with server using terminal

1- This is to see ports and which application is running on which port sudo netstat -plunt 2- To restart apache server sudo service apache2 restart or /etc/init.d/apache2 restart 3- To check firewall status sudo ufw status verbose 4- To change port listen on Apache server vi /etc/apache2/ports.conf 5- To make new site for Apache …


Keep ssh session alive for amount of time

TienTham:~ tientham$ vi .ssh/config TienTham:~ tientham$ cat .ssh/config # — For timeout settings dev — Host * ServerAliveInterval 30 TienTham:~ tientham$ 30 is the second where you ssh client will send the request alive to your server (you can change as you want) * is for all host, you can replace it with your specific …


how to run php file on MacOS terminal without installing virtual server

How to run .php server on Mac using Terminal without installing anything

Run php file on Mac OS using Terminal without installing virtual server When you go around many search result for running php file on Mac, you will find out so many results for this topic. However, most of them are so complex and even irrelevant to what you you want. In this post, I would …


c# – Linq – JToken, JObject, JProperty, JArray

The JToken hierarchy looks like this: JToken – is an abstract base class JContainer – is an abstract base class of JTokens that can contain another JTokens JArray — represents a Json array (contains an ordered list of JTokens) JObject — represents a Json object ( contains a collection of JProperties) JProperty — represents a …


Font awesome naming convention

Here is some collections for working with font-awesome Source: https://fontawesome.com   1- Rotating icons <div class=”fa-2x”> <i class=”fa fa-font-awesome”></i> <i class=”fa fa-font-awesome fa-rotate-90″></i> <i class=”fa fa-font-awesome fa-rotate-180″></i> <i class=”fa fa-font-awesome fa-rotate-270″></i> <i class=”fa fa-font-awesome fa-flip-horizontal”></i> <i class=”fa fa-font-awesome fa-flip-vertical”></i> </div> Source: https://fontawesome.com/how-to-use/on-the-web/styling/rotating-icons 2- Sizing icons <i class=”fas fa-stroopwafel fa-xs”></i> <i class=”fas fa-stroopwafel fa-sm”></i> <i class=”fas fa-stroopwafel fa-lg”></i> …


How to create a new component in Angular Framework

1. Open the folder of the website on Visual Studio Code 2. In folder app create the new folder with its name (ex. policy) 3. In the folder policy, create three files for html, css and ts with (ex. policy.component.html, policy.component.css, policy.component.ts) 4. Copy a file .ts of other quite similar folder then paste to file policy.component.ts …


nodejs – apache2 – digital ocean – setup server with port forwarding

Let’s assume that you have 2 nodejs applications which will run on 2 different ports 9900 and 8800. You would like to have your server forward request to those ports properly. Following steps will be useful: 1.Install apache on digital ocean server 2.Set ports.conf as follow vi /etc/apache2/ports.conf Listen 80 Listen 443 3. Create 2 …


Install a new module in Angular

Following are steps to install a new module in Angular: Find the name of the module on Internet. Ex:  ng2-page-scroll. Then, go to its website to find its latest version. Go to package.json, modify it as follows: {   “name”: “<name>”,    …    “private”: true,    “dependencies”: {       …     …


JS: map – filter – reduce methods

This blog is going to show you some example about how to use map, filter and reduce methods. This can help you quickly remember how to use it so that you can apply to your project development (at least as I am doing now 🙂 ) A- MAP 1. Convert an array into another array …