Skip to content

Instantly share code, notes, and snippets.

View codedeep79's full-sized avatar

Nguyễn Trung Hậu codedeep79

View GitHub Profile
@codedeep79
codedeep79 / Cập nhật dữ liệu trong MongoDB (phần 2).md
Last active August 4, 2022 05:04
Cập nhật dữ liệu trong MongoDB (phần 2)

The updateMany() method allows you to update all documents that satisfy a condition.

The following shows the syntax of the updateMany() method:

db.collection.updateMany(filter, update, options)

In this syntax:

  • The filter is a document that specifies the condition to select the document for update. If you pass an empty document ({}) into the method, it’ll update all the documents the collection.
  • The update is a document that specifies the updates to apply.
@codedeep79
codedeep79 / Cài đặt OpenCart trên Ubuntu với LAMP Stack.md
Created August 5, 2022 09:11
Cài đặt OpenCart trên Ubuntu với LAMP Stack

Prerequisites

Step 1 — Creating a MySQL Database and User for OpenCart

To get started, log into the MySQL root (administrative) account by issuing the following command: sudo mysql -u root -p To create a database, database user, and grant all privileges to the database user run the following commands:

mysql> CREATE DATABASE opencart DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
mysql> CREATE USER 'opencartuser'@'%' IDENTIFIED WITH mysql_native_password BY 'your_password';
@codedeep79
codedeep79 / Cài đặt GCC trên Ubuntu.md
Last active August 5, 2022 09:58
Cài đặt GCC trên Ubuntu

The default Ubuntu repositories contain a meta-package named “build-essential” that includes the GNU compiler collection, GNU debugger, and other development libraries and tools required for compiling software.

To install the Development Tools packages, run the following command as root or user with sudo privileges :

sudo apt update
sudo apt install build-essential

The command installs a lot of packages, including gcc, g++ and make.

Verify that the GCC compiler is successfully installed by running the following command that prints the GCC version: gcc --version

@codedeep79
codedeep79 / Cài đặt PHP 7.4 trên Ubuntu 20.04 | 18.04 | 16.04.md
Last active August 6, 2022 02:19
Cài đặt PHP 7.4 trên Ubuntu 20.04 | 18.04 | 16.04

Step 1: Add PHP PPA Repository

We’ll add ppa:ondrej/php PPA repository which has the latest build packages of PHP

sudo apt-get update
sudo apt -y install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update

Step 2: Install PHP 7.4

Install PHP 7.4 on Ubuntu 20.04/18.04/16.04 using the command:

@codedeep79
codedeep79 / Cài đặt PHP (8.1, 7.4 or 5.6) trên Ubuntu 22.04.md
Created August 6, 2022 02:31
Cài đặt PHP (8.1, 7.4 or 5.6) trên Ubuntu 22.04

Install few dependencies required by this tutorial with the below-mentioned command:

sudo apt install software-properties-common ca-certificates lsb-release apt-transport-https 

Add the Ondrej PPA to your system, which contains all versions of PHP packages for the Ubuntu systems

LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php

Now, update the Apt package manager cache

@codedeep79
codedeep79 / Install Debian 11 on VMware Workstation.md
Last active August 6, 2022 05:05
Install Debian 11 on VMware Workstation

Create the Debian 11 virtual machine

Debian is one of the stable Linux distributions out there. Unlike other distros, you won’t be getting frequent upgrades on the Debian operating system. However, when it does, it will be a very stable one.

Open the Vmware workstation, and click on Create a new virtual machine. You can alternatively press CTRL+N to create the new virtual machine.

The new virtual machine creation wizard will open. To get more control over the Debian virtual machine installation, we will choose the Custom option and click on Next.

Click on Next

@codedeep79
codedeep79 / Cài đặt VirtualBox trên Ubuntu.md
Last active August 7, 2022 08:41
Cài đặt VirtualBox trên Ubuntu

At the time of writing this article, the latest version of VirtualBox is version 6.1.x. To install VirtualBox from the Oracle repositories, follow these steps:

  • Import the Oracle public keys using the following commands:
wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add -

  • Add the VirtualBox APT repository to your system:
echo "deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian $(lsb_release -cs) contrib" | \
@codedeep79
codedeep79 / Cài đặt Skype trên Ubuntu 20.04.md
Created August 6, 2022 10:25
Cài đặt Skype trên Ubuntu 20.04

Open your terminal and download the latest Skype .deb package using the following wget command:

wget https://go.skype.com/skypeforlinux-64.deb

Once the download is complete, install Skype by running the following command as a user with sudo privileges :

sudo apt install ./skypeforlinux-64.deb
@codedeep79
codedeep79 / Cài đặt Spotify trên Ubuntu 20.04.md
Created August 6, 2022 10:28
Cài đặt Spotify trên Ubuntu 20.04

Import the repository’s GPG key:

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 4773BD5E130D1D45

Add the Spotify APT repository to your system’s software repository list:

echo "deb http://repository.spotify.com stable non-free" | sudo tee /etc/apt/sources.list.d/spotify.list

Once the repository is enabled, update apt sources and install Spotify:

@codedeep79
codedeep79 / Cài đặt Mono trên Ubuntu 20.04.md
Created August 6, 2022 10:31
Cài đặt Mono trên Ubuntu 20.04

Install the dependencies necessary to add a new repository over HTTPS:

sudo apt update
sudo apt install dirmngr gnupg apt-transport-https ca-certificates software-properties-common

Import the repository’s GPG key:

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF

Add the Mono repository to your system sources’ list: