Skip to content

System

System

Install

  1. download ios file Download Ubuntu Desktop | Download | Ubuntu
  2. download Flash OS images appbalenaEtcher - Flash OS images to SD cards & USB drives
  3. let device start by the flashed drivers

Ignore Lid Switch

sudo nano /etc/systemd/logind.conf
# make sure
HandleLidSwitch=ignore
HandleLidSwitchExternalPower=ignore
HandleLidSwitchDocked=ignore
# then run
sudo systemctl restart systemd-logind

Lock Screen on Lid Switch

sudo nano /etc/systemd/logind.conf
# make sure
HandleLidSwitch=lock
# then run
sudo systemctl restart systemd-logind

settings-> power, disable automatic suspend

aim to prevent to fail to wake up ,black screen on Ubuntu + Nivida

usermod

add into sudo group

sudo usermod -aG sudo yourusername
# check it
groups yourusername

Sudoers

avoid be asked input passwd call sudo every time

sudo visudo
# fine the line begin with %sudo and replace it
%sudo ALL=NOPASSWD: ALL

SSH Server

Install and Enable

sudo apt update
sudo apt install openssh-server
sudo systemctl start ssh
sudo systemctl enable ssh
sudo systemctl status ssh

Add Ssh Key

copy your key

cat ~/.ssh/id_ed25519.pub

write into ssh server

echo "your key content" >> ~/.ssh/authorized_keys

Add Ssh Config(optional)

code ~/.ssh/config

write the following into ssh config

Host ubuntu-laptop
    Hostname 192.168.0.107
    Port 22
    User root

we assume 192.168.0.107 is your ssh server IP which could be found after running ifconfig

Connect

# == ssh [email protected]
ssh ubuntu-laptop

Current User

 whoami

change folder owner to current user

sudo chown -R $USER:$USER ~/DevSpace/repo/.venv

Display Server

enable wayland

code /etc/gdm3/custom.conf
# WaylandEnable=true

Service

Service

service.type

It is recommended to use Type=exec for long-running services, as it ensures that process setup errors (e.g. errors such as a missing service executable, or missing user) are properly tracked.[1]

journalctl --since "2025-01-14 08:09:00" --until "2025-01-14 08:09:30"

CPU Mode

cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor | sort | uniq

the output is powersave/performance

enable performance via cpupower

sudo apt-get install linux-tools-common
cpupower frequency-info # Check available governors
sudo cpupower frequency-set -g performance # Set governor with root permissions

1

Basic Tools for Desktop

Browser

FireFox

sudo snap remove firefox
sudo add-apt-repository ppa:mozillateam/ppa -y
# ignore snap firefox
echo 'Package: firefox*
Pin: release o=LP-PPA-mozillateam
Pin-Priority: 1001' | sudo tee /etc/apt/preferences.d/mozilla-firefox
sudo apt update
sudo apt install firefox

Settings

  1. enable Ctrl+Tab cycles through tabs in recently used order
  2. Fonts settings

PWA plugin failed to work on my ubuntu 24.04 now

Chrome

Setup key with:

mkdir /etc/apt/keyrings
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo tee /etc/apt/keyrings/google.asc >/dev/null

Setup repository with:

sudo sh -c 'echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/google.asc] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'

Setup package with:

sudo apt-get update
sudo apt-get install google-chrome-stable

Use Eye Protection Mode

setting-> display-> night light

Keyboard

sudo apt install fcitx5 fcitx5-chinese-addons fcitx5-frontend-gtk4 fcitx5-frontend-gtk3 fcitx5-frontend-qt5
  • add fcitx5 into Startup Applications in gnome-tweaks
  • run im-config and add pinyin input method

switch input method by pressing ctrl+space

Theme

git clone https://github.com/thep0y/fcitx5-themes-candlelight.git
mkdir -p ~/.local/share/fcitx5/themes
cp -r fcitx5-themes-candlelight/macOS-light ~/.local/share/fcitx5/themes/
cp -r fcitx5-themes-candlelight/macOS-dark ~/.local/share/fcitx5/themes/

select the theme in addons->Classic User Interface 23

System Backup

sudo apt-get update
sudo apt-get install timeshift

Clipboard

GitHub - Tudmotu/gnome-shell-extension-clipboard-indicator: The most popular clipboard manager for GNOME, with over 1M downloads

Clipboard Indicator - GNOME Shell Extensions

Custom Shortcuts setting->Keyboard->Keyboard Shortcuts->Custom Shortcuts set as win+alt+v

OCR to Clipboard

GitHub - tesseract-ocr/tesseract: Tesseract Open Source OCR Engine (main repository)

sudo apt-get update
sudo apt-get install tesseract-ocr xclip gnome-screenshot

cd DevSpace
git clone [email protected]:Atticuszz/scripts.git
sudo chmod +x ./scripts/ocr_clipboard.sh

scripts/ocr_clipboard.sh at main · Atticuszz/scripts · GitHub setting->keyboard->shortcuts

  • command :~/DevSpace/ocr_clipboard.sh
  • shortcuts : ctrl+win+Q

Gpu Monitor

uv tool install nvitop

CPU ,RAM, SWAP Monitor

sudo apt install htop

Clean Hard Driver

sudo apt install ncdu

Fan Mode

use Legion in windows to set mode

AppImage

I get some errors related to something called “FUSE” — AppImage documentation

sudo apt install libfuse2

Install .tar.gz

tar -xzf filepath

Apt Source Change

sudo nano /etc/apt/sources.list
sudo apt update
sudo apt upgrade

Dual System Extend Disk for Ubuntu

tutorial

Increase Swap Space via Swap File

extend to 16gb for example

sudo swapoff -a
sudo fallocate -l 16G /swapfile
# if failed fallocate try
sudo dd if=/dev/zero of=/swapfile bs=1G count=16

# then
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile

# Make it permanent
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
# test it
swapon --show
->
 swapon --show

NAME      TYPE SIZE USED PRIO
/swapfile file  16G   0B   -2

Zip File

Note:

  • The -r option stands for "recursive" and tells zip to include all files and subfolders in the specified folder.
  • If you want to exclude certain files or folders, you can use the -x option followed by the file or folder name. For example:
zip -r myfolder.zip myfolder -x myfolder/excluded_file.txt

OneDrive

onedrive/docs/ubuntu-package-install.md at master · abraunegg/onedrive · GitHub

install

sudo apt remove onedrive
sudo rm /etc/systemd/user/default.target.wants/onedrive.service
wget -qO - https://download.opensuse.org/repositories/home:/npreining:/debian-ubuntu-onedrive/xUbuntu_24.04/Release.key | gpg --dearmor | sudo tee /usr/share/keyrings/obs-onedrive.gpg > /dev/null
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/obs-onedrive.gpg] https://download.opensuse.org/repositories/home:/npreining:/debian-ubuntu-onedrive/xUbuntu_24.10/ ./" | sudo tee /etc/apt/sources.list.d/onedrive.list
sudo apt-get update
sudo apt install --no-install-recommends --no-install-suggests onedrive

Login

onedrive

Config

code ~/.config/onedrive

and fill it with following:

# sync home

sync_dir = "~"

# Skip dot files

skip_dotfiles = "true"

# Skip github sync dir

skip_dir = "DevSpace"
skip_dir = "miniconda3"
skip_dir = "NVIDIA Nsight Compute"
skip_dir = "snap"
skip_dir = "cache"
skip_dir = "temp"

# upload_only = "true"

# https://github.com/abraunegg/onedrive/blob/master/docs/application-config-options.md#monitor_interval
monitor_interval = "600"

threads = "16"

Usage

once

onedrive --sync --verbose

monitor

onedrive --monitor

monitor as startup

...

Compatibility with curl

brew install curl
echo 'export PATH="/home/linuxbrew/.linuxbrew/opt/curl/bin:$PATH"' >> ~/.zshrc
echo 'export LD_LIBRARY_PATH="/home/linuxbrew/.linuxbrew/opt/curl/lib:$LD_LIBRARY_PATH"' >> ~/.zshrc

Zotero

GitHub - retorquere/zotero-deb: Packaged versions of Zotero and Juris-M for Debian-based systems

wget -qO- https://raw.githubusercontent.com/retorquere/zotero-deb/master/install.sh | sudo bash
sudo apt update
sudo apt install zotero

spotify

curl -sS https://download.spotify.com/debian/pubkey_C85668DF69375001.gpg | sudo gpg --dearmor --yes -o /etc/apt/trusted.gpg.d/spotify.gpg
echo "deb https://repository.spotify.com stable non-free" | sudo tee /etc/apt/sources.list.d/spotify.list
sudo apt-get update && sudo apt-get install spotify-client