Showing posts with label Ubuntu. Show all posts
Showing posts with label Ubuntu. Show all posts

7/13/2026

Ubuntu password set a short one, disable length check

sudo apt-get purge libpam-pwquality

 Then: sudo passwd <user name>

Don't use the Settings UI to change it because the UI will check the length too. 

3/17/2025

Ubuntu 22.04 won't upgrade to 6.8 kernal even after sudo apt install linux-generic-hwe-22.04 ran

If the Ubuntu 22.04 is stuck at 5.15 kernal, make sure the following setting is correct.

 It turned out that the Software & Updates need to subscribe to All Updates.



1/13/2025

Ubuntu shotcuts hijacked

 Ctrl+Alt+B 被占用

Ctrl+Alt+S 被占用

Ctrl+Alt+D 被占用

Ctrl+Alt+T 被占用


Ctrl+Alt+左键 被占用

gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-left “[‘disabled’]”

Ctrl+Alt+Right 被占用

gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-right “[‘disabled’]”


输入法相关快捷键

如Ctrl+Alt+B和Ctrl+Alt+S,这个隐藏的比较深,基本是通过搜索引擎找到的答案.

Ctrl+Alt+S 快捷键从命令行输入fcitx-configtool命令,进入控制面板.

选择第二个tab Global Config,勾选右下角Show Advanced Options,然后从上到下看一下,哪些快捷键被占用,把哪个禁用掉.

Ctrl+Alt+B是选中Tab的Addon,然后勾选左下角的Advanced,滚到最底下,将Virtual Key Board 取消选 中即可.

————————————————


                            版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。

                        

原文链接:https://blog.csdn.net/liusf1993/article/details/109609689

7/25/2024

Use keyboard to mimic mouse left click

Ubuntu/Linux: Create a shortcut to use xdotool click 1 command

Windows: Use AHK software,

#j::

  MouseClick, left

7/24/2024

Ubuntu hibernation fails

 Try: sudo swapoff -a && sudo swapon -a

4/17/2024

Ubuntu 22.04, Cinnamon Desktop missing slack icons in the system tray

To solve this problem:

 sudo apt purge indicator-application

7/09/2021

Ubuntu: how to fix broken packages

Use synaptic:

sudo synaptic

Then Custom Filters (At the lower left corner) | Broken, remove them

5/26/2020

网易云音乐 Netease Cloud Music登录不能保持

find ~/.config/netease-cloud-music -exec sudo chown $USER:$USER {} +
find ~/.config/netease-cloud-music -exec sudo chmod 755 {} +
find ~/.cache/netease-cloud-music -exec sudo chown $USER:$USER {} +
find ~/.cache/netease-cloud-music -exec sudo chmod 755 {} +

5/24/2020

Ubuntu 18.04 fix mouse and fix wifi

If the bluetooth mouse doesn't work properly:
sudo add-apt-repository ppa:bluetooth/bluez
sudo apt install bluez

To fix it temporarily:
#!/bin/bash
sudo service bluetooth restart

If the WIFI adapter is lost after resume or hibernation:
#! /bin/bash

# Little sleep for safety (??)
sleep 5;

# Remove all of the wifi modules from the kernel
sudo modprobe -r mwifiex_pcie;
sudo modprobe -r mwifiex;
sudo modprobe -r cfg80211;

# Re-add all of the wifi modules
sudo modprobe -i cfg80211;
sudo modprobe -i mwifiex;
sudo modprobe -i mwifiex_pcie;

# Restart netmanager
sudo service NetworkManager restart;

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
  

4/15/2020

How to create a shortcut icon on Ubuntu desktop

Eclipse Shortcut for Ubuntu Unity: https://gist.github.com/kui/2922285 

4/14/2020

Use Super + Shift + S to copy a screen section on Ubuntu

Use the following script to bind to the Super + Shift + S to call the command:
----------------

#!/bin/sh

sleep 0.125

gnome-screenshot --area -c

11/20/2019

Ubuntu 18.04 gnome terminal tab bar height too high


cat ~/.config/gtk-3.0/gtk.css 
terminal-window notebook > header.top button {
  padding: 0 0 0 0;
  background-image: none;
  border: 0;
  margin-right: 10px;
}
terminal-window notebook > header.top > tabs > tab {
  margin: 0 0 0 0;
  padding: 0 0 0 0;
}
terminal-window notebook > header.top > tabs > tab label {
  padding: 0 0 0 0;
  margin: 0 0 0 0;
  font-size: 10px;

}

6/25/2019

Ubuntu Eclipse/Console font to use: Consolas High (font size: 10.5)

The default Consolas font is too low so that lines look crowded. The solution is to use the Consolas High font.
In One Drive | ubuntu_home | Consolas-High-Line-master..zip

https://github.com/Salauyou/Consolas-High-Line

6/12/2019

How to remap keyboard keys in Ubuntu

sudo cp /usr/share/X11/xkb/symbols/pc /usr/share/X11/xkb/symbols/pc.backup
sudo emacs /usr/share/X11/xkb/symbols/pc
And modify the settings.

5/31/2019

How to sign a file in Ubuntu

Example commands:
# To generate a new key
gpg --gen-key

# This will generate a separate sig file, test.sh.sig
gpg -sb test.sh

# To verify the file signature
gpg --verify test.sh.sig

# To delete a key
gpg --delete-key DC77BA9E


2/12/2019

google-chrome cannot start on Ubuntu 16.04

Symptom:
Gkr-Message: secret service operation failed: The name org.freedesktop.secrets was not provided by any .service files

The chrome window doesn't show up.

Solution:
gnome-keyring was not installed. After installing it, the problem was solved.

4/30/2018

Fix Ubuntu doesn't sleep after closing the computer lid

Add
sudo su <
echo LID0 > /proc/acpi/wakeup && echo XHC1 > /proc/acpi/wakeup && echo ARPT > /proc/acpi/wakeup                                      
EOF

To /etc/rc.local file.




3/29/2018

Meta + E opens disk analyzer in Ubuntu instead of file explorer

Run this command to fix:
xdg-mime default nemo.desktop inode/directory

1/24/2018

Change FN key behavior on Ubuntu 16.04 installed on Macbook pro

Change Function Key behavior

This section of the document describe how to change the behavior of 'fn' key to better match what user expect. (See #201711, #162083)
Here a description of each behavior :
  • 0 = disabled : Disable the 'fn' key. Pressing 'fn'+'F8' will behave like you only press 'F8'
  • 1 = fkeyslast : Function keys are used as last key. Pressing 'F8' key will act as a special key. Pressing 'fn'+'F8' will behave like a F8.
  • 2 = fkeysfirst : Function keys are used as first key. Pressing 'F8' key will behave like a F8. Pressing 'fn'+'F8' will act as special key (play/pause).

Ubuntu 9.04 to 12.04 LTS (Precise Pangolin)

Temporarily

The following command will change the behaviour of 'fn' key with immediate effect, but restarting will reset the configuration:
$ echo 2 | sudo tee /sys/module/hid_apple/parameters/fnmode
(The meaning of fnmode values is as described in the preceding section.)

Permanently

Methods described in this section will change the behavior permanently. There are several ways to proceed with this modification. Each sub-section describes one way to permanently change the configuration.
With .conf file (Recommended)
1. Run the following command to append the configuration line to the file /etc/modprobe.d/hid_apple.conf creating it if necessary:
$ echo options hid_apple fnmode=2 | sudo tee -a /etc/modprobe.d/hid_apple.conf
2. Trigger copying the configuration into the initramfs bootfile.
$ sudo update-initramfs -u -k all
3. Optionally, reboot

$ sudo reboot