Linux

Fixing display resolution stuck at 1024x768 in Ubuntu 18.04 due to missing NVIDIA driver

$ sudo apt update && sudo apt upgrade

$ cd Downloads/

$ chmod 777 <your .run file>

$ sudo dpkg --add-architecture i386

$ sudo apt update

$ sudo apt install build-essential libc6:i386

$ sudo bash -c "echo blacklist nouveau > /etc/modprobe.d/blacklist-nvidia-nouveau.conf"

$ sudo bash -c "echo options nouveau modeset=0 >> /etc/modprobe.d/blacklist-nvidia-nouveau.conf"

$ sudo update-initramfs -u

$ sudo reboot

According to Dibakar, we just disabled the current Nouveau kernel display server to install the NVIDIA driver. There are two possibilities that can happen at this step:

$ sudo telinit 3

$ sudo telinit 3

This will log out of the purple screen and bring us to a black screen. Then using Ctrl + Alt + F1 to log in with username and password.

$ sudo su

$ bash .run

The installation will start and it will ask several questions:

Then reboot the computer and the display resolution should be automatically adjusted to 4k. In System Settings > Details, The graphic should change to 'GeForce GTX 1660 Ti/PCIe/SSE2', and in System Settings > Display, there should be various resolutions for to choose instead of just 1024 x 768 as before.


Reference: Fix Display Resolution on Ubuntu by Installing NVIDIA drivers  

Autocomplete in Ubuntu terminal automatically adds "\" in front of "$": How to disable?

Link to askubuntu thread: https://askubuntu.com/questions/1494433/auto-completion-puts-back-slash-before-mark-how-can-i-disable-it-ubuntu-22

$> shopt direxpand

$> shopt -s direxpand

Doing this will expand the environmental variable after $ to the actual path and do not add an "\" in front of "$"

Extend Ubuntu disk size in Hyper-V

First, change the disk size in Hyper-V by following this: https://www.nakivo.com/blog/increase-disk-size-hyper-v-complete-guide/

Second, extend the partition size of the Ubuntu virtual machine by following this: https://www.nakivo.com/blog/increase-disk-size-hyper-v-complete-guide/