The problem was that ~/.config/mimeapps.list doesn't have the correct setting for type text/html=. It should be set to text/html=microsoft-edge.desktop or your chosen browser.
4/28/2026
4/13/2026
Ubuntu 24.04 installation on Surface Pro 9 & Surface Pro 11
Issues:
bluetooth: The bluetooth doesn't work after hibernation. The following steps nneed to be added:
1. sudo emacs /lib/systemd/system-sleep/bt-lunar-fix
2. Paste the following script:
#!/bin/sh
case $1 in
post)
echo "Resetting Bluetooth for Lunar Lake..."
systemctl stop bluetooth
modprobe -r btintel_pcie btintel bluetooth 2>/dev/null || true
sleep 1
modprobe btintel_pcie
systemctl start bluetooth
;;
esac
3. sudo chmod +x /lib/systemd/system-sleep/bt-lunar-fix
hibernation: surface pro 9 hibernate won't shutdown completely on ubuntu 24.04. Need to add Adding specific kernel flags can force the hardware to respect power-off commands.
Open the configuration: sudo nano /etc/default/grub.
Find the line GRUB_CMDLINE_LINUX_DEFAULT.
Append pci=hpiosize=0 to the existing parameters (e.g., GRUB_CMDLINE_LINUX_DEFAULT="quiet splash pci=hpiosize=0").
Update GRUB: sudo update-grub and reboot.
sogou pinyin: Should not install fcitx5. sudo apt purge fcitx5. Need to install fcitx.
Grub: Adding GRUB_DISABLE_MEMTEST=true to /etc/default/grub and re-running sudo update-grub to remove the memtest from the grub selection menu.
12/21/2025
How do I install the NVIDIA drivers for RTX A6000 GPUs on Ubuntu 22.04?
8/19/2021
Grub loader set default to Windows boot manager
If you have dual boot setup, one of the frustrating things that you'll immediately notice is that Ubuntu is now set as the default OS in the Grub loader. There is an easy way to switch back to using Windows as the default.
sudo emacs /etc/default/grub
Change: GRUB_DEFAULT=? (? is the 0-based index of the Grub menu)
sudo update-grub
This is for grub-mkconfig (GRUB) 2.02-2ubuntu8.23
Ubuntu 18.04
3/02/2021
How to adjust Linux Ubuntu 18.04 screen brightness
sudo apt install brightnessctl
sudo brightnessctl set 20%
5/11/2020
Enable Ubuntu 18.04/22.04/24.04 hibernate
To make things easy: create a swap drive instead of using a swap file.
In the BIOS settings: disable secure boot FIRST.
For 24.04:
Follow: https://ubuntuhandbook.org/index.php/2021/08/enable-hibernate-ubuntu-21-10/
- First, run command to create a config file:
sudo nano /etc/polkit-1/rules.d/10-enable-hibernate.rules
- When file opens, paste the lines below and press Ctrl+S to save, finally press Ctrl+X to exit.
polkit.addRule(function(action, subject) { if (action.id == "org.freedesktop.login1.hibernate" || action.id == "org.freedesktop.login1.hibernate-multiple-sessions" || action.id == "org.freedesktop.upower.hibernate" || action.id == "org.freedesktop.login1.handle-hibernate-key" || action.id == "org.freedesktop.login1.hibernate-ignore-inhibit") { return polkit.Result.YES; } });
For 22.04
Then follow: https://www.geeksforgeeks.org/how-to-enable-hibernate-in-ubuntu-22-04-lts/
Edit the file /etc/systemd/sleep.conf with the following configuration:
[Sleep]
HibernateMode=shutdown
Enable the hibernation menu:
sudo gedit /etc/polkit-1/localauthority/50-local.d/com.ubuntu.desktop.pkla[Enable hibernate in upower]
Identity=unix-user:*
Action=org.freedesktop.upower.hibernate
ResultActive=yes
[Enable hibernate in logind]
Identity=unix-user:*
Action=org.freedesktop.login1.hibernate;org.freedesktop.login1.handle-hibernate-key;org.freedesktop.login1;org.freedesktop.login1.hibernate-multiple-sessions;org.freedesktop.login1.hibernate-ignore-inhibit
ResultActive=yes
1/22/2018
Font of Microsoft OneDrive Text or text editor
I like to use the Consolas font for the display, but it always uses Courier New as the font for my Ubuntu/Linux Firefox browser.
The solution is to install User Agent Switcher in Firefox and use Windows/Firefox to enable the Consolas font.
1/19/2018
How to install the latest cinnamon on Ubuntu 16.04
sudo add-apt-repository ppa:embrosyn/cinnamon
sudo apt update sudo apt install cinnamon
1/11/2018
VIM frequently commonly used commands
Right: l
Up: k
Down: j
Undo: u
Start Editing: i
Append at line end: A
Edit after cursor: a
Goto line: number then G
Delete line: dd
1/06/2018
Linux下的飞鸽传书 iptux
Tools | Preferences | System
Use gb2312 for Preference network encoding
11/29/2017
X11 Forwarding over Screen (gnome terminal screen command)
echo $DISPLAY
Once you have re-attached to screen, explicitly set the environment variable:
export DISPLAY=:N.0
How to set up Canon MF247 dw printer on Ubuntu 16.04
2. Manually install "sudo apt install libgcrypt20-dev"
3. Run sudo ./install.sh. (I had to edit the file and make sure it runs DEB instead of RPM by changing "if which rpm > /dev/null 2>&1;" to if [ 1 -eq 0];
NOTE: I got this error:
#----------------------------------------------------#
# cups restart
#----------------------------------------------------#
/etc/init.d/cups restart
[ ok ] Restarting cups (via systemctl): cups.service.
Could not install.
But it seems this error doesn't matter.
4. Then I can add the printer by using its ip: 10.1.30.154
11/22/2017
11/02/2017
emacs paste text wrong indent
The solution to it:
Install Emacs 25.3 by using the following command:
sudo add-apt-repository ppa:kelleyk/emacs
sudo apt update
sudo apt remove --purge emacs24
sudo apt install emacs25
8/30/2017
CloudCompare hangs on Linux/Ubuntu 16.04
Display | Display Options | Change Auto-compute octree for picking to NEVER
7/20/2017
.inputrc file content
"\e[1;5C": forward-word # ctrl + right
"\e[1;5D": backward-word # ctrl + left
1/06/2017
How to change terminal cursor shape and color
Profile Preference | Cursor Shape (Prefer no blinking block)
Then:
Add "echo -ne '\e]12;#ff0000\a'" to change the color to red
To disable cursor blinking:
gsettings set org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:$(gsettings get org.gnome.Terminal.ProfilesList default|tr -d \')/ cursor-blink-mode off
To disable Ubuntu Cinnemon cursor blinking:
System settings | Keyboard Turn off text cursor blinks
For Putty:
Window | Appearance | Cursor Appearance: to change shape
Window | Colors | Cursor Color: to change the color
12/26/2016
9/07/2016
How to fix Docker
So far I haven't figured out a way to fix it without rebooting the machine.
Even worse: docker daemon won't start after reboot. I need to reinstall docker to get it to work. And I had to use the following commands to uninstall and reinstall to make it work.
$ sudo apt-get autoremove --purge docker-engine
$ rm -rf /var/lib/docker
$ sudo apt-get install docker-engine
8/03/2016
How to use SSHFS
sudo apt install sshfs
# To mount
sshfs -o idmap=user dev@192.168.1.45:/ /mnt/sshfs/
# to umount
fusermount -u /mnt/sshfs/