Home
Sanh Doan
Cancel

Leetcode 121 - Best Time to Buy and Sell Stock - Easy

Leetcode link https://leetcode.com/problems/best-time-to-buy-and-sell-stock/ Cho 1 mảng các số nguyên prices, với số prices[i] tương ứng giá stock của ngày thứ i. Hãy tính ra giá lợi nhuận cao nh...

Install Certbot for Nginx in Centos 7

1. (Optional) Run with sudo user sudo su - 2. Install needed packages and certbot yum install epel-release yum update yum -y install certbot-nginx 3. Generate certificate certbot --nginx -d r...

Install nginx in Centos 7

1. (Optional) Run with sudo user sudo su - 2. Install needed packages and nginx yum install epel-release yum update yum -y install nginx 3. Start nginx systemctl enable nginx systemctl start...

Install docker in Centos 7

1. Run with sudo user sudo su - 2. Install needed packages and docker yum -y update yum -y install yum-utils device-mapper-persistent-data lvm2 yum-config-manager --add-repo https://download.do...

Add ssh key to remote server

1. Copy ssh key to server ssh-copy-id -i ~/.ssh/id_rsa.pub root@1.2.3.4 It will ask your password. Please input it 2. (Optional) Disable password authentication for SSH Find PasswordAuthenticatio...

Create a Google account using another domain email

1. Visit here 2. Click the Create an Account button 3. Click Use my current email address instead 4. Fill the information and follow Google next steps

Make an alias command in MacOS

Make an alias command in MacOS 1. Edit file nano ~/.bash_profile or nano ~/.zshrc 2. Add this line to make an alias alias <alias>='<actual command>' For example alias k='kubectl' ...

Watch command in MacOS terminal

You want to follow command result continuously. Use watch 1. Install brew install watch 2. Usage watch -n <number_of_seconds> <command> For example watch -n 5 kubectl get all -o wid...

Setup multiple SSH keys for different Github account

For example: you have a repo in private organization myteamprivate with url git@github.com:myteamprivate/repo-api.git 1. Create ssh key on your machine $ ssh-keygen -t rsa -C "your_email@youremai...

Create telegram bot to send service notification/alert

1. Search for BotFather in search box 2. Create a new bot Note 1: You can type /start for get all commands Type /newbot in a message box Type your bot name (whatever you want) Type your bo...