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 / Tăng tốc độ Ubuntu.md
Last active January 5, 2025 00:12
Tăng tốc độ Ubuntu

Giảm thời gian tải Grub mặc định

sudo nano /etc/default/grub

Tìm dòng GRUB_TIMEOUT=X.X.X và chuyển giá trị thành 2. Việc này sẽ thay đổi thời gian khởi động thành 2 giây. Không nên đặt 0 ở đây vì bạn sẽ mất đặc quyền thay đổi giữa các tùy chọn hệ điều hành khi khởi động dual boot và khôi phục dữ liệu. Ở đây tui xài Ubuntu không khởi động dual boot nên tui để giá trị của GRUB_TIMEOUT=0

Tìm dòng GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" và đổi thành GRUB_CMDLINE_LINUX_DEFAULT=""

@codedeep79
codedeep79 / Install Oracle Java 8 64-bit Ubuntu 22.04 | 20.04 LTS.md
Last active August 3, 2022 08:07
Install Oracle Java 8 64-bit Ubuntu 22.04 | 20.04 LTS

The steps are given here to download and set up Java 8 on Linux will be the same for other distros such as Linux Mint, CentOS, RedHat, AlamLinux, Rocky Linux, Manjaro, etc.

Run system update, and have wget

sudo apt update
sudo apt install wget

Download Oracle Java 8 for Linux

Visit the official website and download the Jave 8 for Linux. You can also copy the link and download it using the command given below:

@codedeep79
codedeep79 / Uninstalling Android Studio.md
Last active July 27, 2022 04:25
Uninstalling Android Studio Ubuntu 21.10
rm ~/.local/share/applications/androidstudio.desktop
sudo rm -rf /opt/android*
rm -rf ~/.android/
rm -rf ~/.AndroidStudio2.1/
rm -rf ~/.AndroidStudio2.3/
rm -rf ~/Android
rm -rf ~/.gradle
@codedeep79
codedeep79 / Install Ruby On Rails on Ubuntu.md
Last active July 27, 2022 11:18
Install Ruby On Rails on Ubuntu 21.10

Installing Ruby

To make sure we have everything necessary for Webpacker support in Rails, we're first going to start by adding the Node.js and Yarn repositories to our system before installing them.

sudo apt install curl
curl -sL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list

sudo apt-get update
@codedeep79
codedeep79 / How to diagnose and fix very slow boot on Ubuntu.md
Created July 27, 2022 11:48
How to diagnose and fix very slow boot on Ubuntu

Method 1 : Fix very slow boot on Ubuntu to update GRUB so that it passes this option to the kernel automatically on boot:

Edit the file /etc/default/grub file so that the string noresume is included in the GRUB_CMDLINE_LINUX_DEFAULT line, for example: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash noresume"

Run this command to update GRUB: sudo update-grub

Method 2: You can configure the timeout for Start Job and Stop Jobs.

Edit /etc/systemd/system.conf with elevated privileges and change/add two lines that are commented by default from 90 seconds to 5 (or whatever you prefer) and uncomment it:

from:

@codedeep79
codedeep79 / Xem thời gian khởi động Ubuntu.md
Created July 28, 2022 00:33
Xem thời gian khởi động Ubuntu

Bạn có thể xem thời gian khởi động Ubuntu như sau: systemd-analyze

Mất 51.976 giây để khởi động.

@codedeep79
codedeep79 / MySQL Commands in Ubuntu.md
Last active August 3, 2022 08:07
MySQL Commands in Ubuntu

Connect to MySQL

sudo mysql -u root -p

In the above command:

  • -u is the user
  • root is the MySQL username
  • -p is the password

Set or Change Password

@codedeep79
codedeep79 / Cài đặt Rust trên Ubuntu.md
Last active August 3, 2022 08:06
Cài đặt Rust trên Ubuntu

Starting with the Installation

To do this, you need to open the terminal on your Ubuntu system and type the following: sudo apt update

Install Rust on Ubuntu using the RustUp Script

To use the rustup installer, we need to enter the following command in our terminal: curl https://sh.rustup.rs -sSf | sh

curl https://sh.rustup.rs -sSf | sh
info: downloading installer

Welcome to Rust!
@codedeep79
codedeep79 / Cài đặt Erlang phiên bản mới nhất trên Ubuntu.md
Last active August 3, 2022 08:06
Cài đặt Erlang phiên bản mới nhất trên Ubuntu

Installing the latest version of Erlang on Ubuntu

Select your best server:

Open terminal and enter the following command:

sudo apt install wget
wget -O- https://packages.erlang-solutions.com/ubuntu/erlang_solutions.asc | sudo apt-key add -
# For Ubuntu 20.04 (and Ubuntu 20.10)
echo "deb https://packages.erlang-solutions.com/ubuntu focal contrib" | sudo tee /etc/apt/sources.list.d/erlang-solution.list
@codedeep79
codedeep79 / Cài đặt ngôn ngữ kịch bản Lua trong Linux.md
Last active August 3, 2022 08:06
Cài đặt ngôn ngữ kịch bản Lua trong Linux

Lua runs on all if not most Unix-like operating systems including Linux and Windows; on mobile operating systems (Android, iOS, BREW, Symbian, Windows Phone); on embedded microprocessors (ARM and Rabbit); on IBM mainframes and many more.

Install Lua in Linux

sudo apt install lua5.3                       #Debian/Ubuntu systems 
# yum install epel-release && yum install lua	#RHEL/CentOS systems 
# dnf install lua		                          #Fedora 22+