Skip to content

Linux

installation for newbie

Kubuntu (Ubuntu with KDE) for example

procedure

from win10/11

  1. install kubuntu iso
  2. flash iso to usb -> bootable USB drive
  3. partition your disk
    • use 3rd party tool
    • do it yourself
      • disk management -> shrink volume
      • if only very little is available
        1. advanced system settings -> performance -> advanced -> virtual memory -> unchech auto xxx -> set no paging file
        2. advanced system settings -> performance -> advanced -> system protection -> configure -> disable system protection
        3. restart
        4. shrink volume
        5. redo those things after you've shrinked the volume
  4. disable fast restart
  5. reboot and enter bios menu (press f10 for HP, hold f2 for ASUS)
  6. select kubuntu
    • (for HP) boot option -> move "boot with USB" to the top -> save and exit
    • (for ASUS) boot menu
  7. install kubuntu
  8. remove USB stick and enter bios menu again
  9. boot option -> move "boot with USB" back -> save and exit
  10. if still boot to Windows (no grub menu) -> cmd as admin -> bcdedit /set {bootmgr} path \EFI\kubuntu\grubx64.efi -> reboot
  11. you should see grub menu, now select kubuntu

Troubleshooting

  • stuck on install "Updates and other software" step
    • reflash the kubuntu iso to your usb
    • use the LTS version

references

flash iso to usb

dd

ventoy

tutorial

download ventoy
https://github.com/ventoy/Ventoy/releases

tar -xf <ventoy.tar.gz>

check what is your USB called with lsblk

go inside and run

. Ventoy2Disk -i /dev/<USB disk e.g. sdb>

And then your Ventoy is ready. When booting with this USB, ventoy will search all ISOs in the USB, so you can out your ISO whenever you want (inside the USB). You can also store normal files.

Ubuntu

System upgrade

for normal release

sudo do-release-upgrade

for development release

sudo do-release-upgrade -d

to change between LTS & normal
go to /etc/update-manager/release-upgrades - prompt=lts for lts - prompt=normal for normal

https://ubuntu.com/blog/how-to-upgrade-from-ubuntu-18-04-lts-to-20-04-lts-today

End of life release

You can't properly update & upgrade your packages if your release is already end of life. You'll see XXX doesn't have release file.

To solve it, replace your /etc/apt/sources.list with

## EOL upgrade sources.list
# Required
deb http://old-releases.ubuntu.com/ubuntu/ CODENAME main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu/ CODENAME-updates main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu/ CODENAME-security main restricted universe multiverse
# Optional
#deb http://old-releases.ubuntu.com/ubuntu/ CODENAME-backports main restricted universe multiverse

See https://help.ubuntu.com/community/EOLUpgrades & https://askubuntu.com/q/1420077

Package Management

See Linux Package Management

group & user

Use as root

  • sudo su or su root to enter

list all groups

they're in /etc/group

cut -d: -f1 /etc/group | sort

list groups a user belongs to

groups <user>

add user to a group

sudo usermod -aG <group> <user>

e.g. to add yourself to docker group

sudo usermod -aG docker $USER

file/dir size

current dir size

du . -sh

all dir/file with depth = 1 under current directory sorted

du . -had1 | sort -h

partition size

all (mounted) partitions

df -h

the partition the directory is at

df . -h

view all partitions

df -h
lsblk

networking

show network interfaces

show all network interfaces

# install net-tools if haven't
ifconfig

show all wireless interfaces

iwconfig

# install aircrack-ng if haven't 
sudo airmon-ng

see wireless driver

lspci -nnk | grep -A4 0280
ethtool -i wlan0 | grep driver

https://askubuntu.com/questions/333424

Turn wireless interface into monitor mode

You'll be disconnected from the network when you're in monitor mode.

with airmon-ng

sudo airmon-ng start <interface>

now the name of your interface will be changed to <interface>mon

now you can use tcpdump or wireshark on it and spoof all broadcasted packets

to change back, do

sudo airmon-ng stop <interface>mon

with iwconfig

For some reason it doesn't seem to actually work. The mode is changed but it doesn't sniff any packet, unlike with airmon-ng, which works perfectly.

sudo ifconfig <interface> down
sudo iwconfig <interface> mode monitor
sudo ifconfig <interface> up

see if it's changed to monitor mode

iwconfig

Note that if your DE help you auto reconnects to a network, the mode will be reversed into the original managed mode. So you better disable the auto connection.

to reverse

sudo ifconfig <interface> down
sudo iwconfig <interface> mode managed
sudo ifconfig <interface> up

enable and disable interface

enable

sudo ifconfig <interface> up

disable

sudo ifconfig <interface> down

Sniffing packets

You can use the CLI tool tcpdump to sniff on your interfaces, or use WireShark for GUI. It's a bit more complicated if you want to sniff packets from wireless networks, however.

find things

find text under a directory

grep -rnw  . -e <pattern>

https://stackoverflow.com/a/16957078/15493213

find files under a directory

find .

systemd

  • systemctl start <service>
    • start right now
  • systemctl stop <service>
  • systemctl enable <service>
    • start on boot
  • systemctl disable <service>
  • edit /etc/hosts to change/add the domain name mapping to 127.0.0.1
  • edit /etc/hostname to edit your hostname

https://userbase.kde.org/KDE_Connect/Tutorials/Useful_commands https://www.computernetworkingnotes.com/linux-tutorials/shutdown-reboot-suspend-and-hibernate-a-linux-system.html

shutdown

1

shutdown now

sleep

suspend to RAM

systemctl suspend

to swap

systemctl hybrid-sleep

turn off screen

xset dpms force off

session

session settings

  • /etc/environment
    • .env style
    • set up the variables on session start
  • /etc/profile
    • run on session start
  • ~/.config/plasma-localerc
    • .env of KDE plasma's GUI session, run after above so will overide them (bruh)

TTY sessions

ctrl+alt+f2-6
would create session with TTY = tty2-6 respectively

ctrl+alt+f1 is the GUI session, so press this combination to go back to GUI

logout or exit to log out

list sessions

loginctl list-sessions

see current session

loginctl session-status

lock session

loginctl lock-session

unlock session

loginctl unlock session <id>

terminate session

loginctl terminate session <id>

network connection

nmcli for cli

nmtui for gui in terminal

Bluetooth

bluetoothctl for interactive CLI

Show MAC of paired bluetooth devices

bluetoothctl devices

Connect or disconnect a device via MAC

bluetoothctl connect <MAC>
bluetoothctl disconnect <MAC>

Full reconnecting process

bluetoothctl remove <MAC>
bluetoothctl scan on
bluetoothctl trust <MAC>
bluetoothctl pair <MAC>
bluetoothctl connect <MAC>

Failed to connect: org.bluez.Error.Failed br-connection-profile-unavailable

Failed to connect: org.bluez.Error.Failed br-connection-profile-unavailable when you want to connect to your bluetooth headset.

systemctl status bluetooth may tell you a2dp-sink profile connect failed (relevant: this & this)

It's a problem I still haven't fully figu red out yet, but here's some solutions that sometimes work

Try

sudo apt-get install pulseaudio-module-bluetooth
sudo pactl load-module module-bluetooth-discover

https://askubuntu.com/a/1062044

If this doesn't work, try edit /etc/pulse/default.pa and make sure these lines are not commented

load-module module-bluetooth-policy
load-module module-bluetooth-discover

Now, remove the configs of pulseaudio, and reboot.

rm  ~/.config/pulse/*
pulseaudio -k

After rebooting, restart pulseaudio

systemctl --user restart pulseaudio

Now try connect your bluetooth headset again.

See https://askubuntu.com/a/1020601

Port

See port in use

sudo lsof -i -P -n | grep <port>

Open ports

sudo ufw allow <port num>

e.g.

  • sudo ufw allow 22 -> allo ssh
  • sudo ufw allow 80 -> allow http

ip

http

  • install
    • sudo apt httpie to be able to use
  • usage
    • http GET <url>

Netrc

~/.netc is a plain text file storing server credentials s.t. you don't have to log in manually.

machine <host> username <username> password <password>

remove an unremoveable file

If this don't work

sudo rm -rf <file>

Kill the processes using it, and then execute again.

lsof <file>
kill -9 <pid>
sudo rm -rf <file>

default apps

config file in ~/.config/mimeapps.list

open with default app

xdg-open <path/to/file>

to open in background

xdg-open <path/to/file> &

https://unix.stackexchange.com/questions/74605

see default opening app

xdg-mime query default <file type>
e.g.
xdg-mime query default text/html

set default opening app

xdg-mime default <app> <file type>
e.g.
xdg-mime default firefox.desktop text/html

https://unix.stackexchange.com/questions/36380

see app name

ls /usr/share/applications | less

https://stackoverflow.com/questions/2060284

check filetype

xdg-mime query filetype <path/to/file>

https://stackoverflow.com/a/5485123/15493213

config files locations

  • ~/.config
  • ~/.local/share

some nice dotfiles - https://github.com/Anomic-cr/i3_dotfiles

change user@host path, color and stuff

bash

settings located in ~/.bashrc
note that enclosing ANSI with \[ \] es necesario for it to behave normally

examples

# base
PS1='\u@\h:\w\$ '  
# 8-bit color
PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
# 24-bit color
PS1='\[\033[38;2;255;189;243\]m\u@\h\[\033[0m\]:\[\033[01;34m\]\w\[\eiddcckvribulvvebkvchfcgiidccfdnunkvgnvtingk033[0m\]$ '
# with archbtw
PS1='\[\033[48;2;108;196;255m\033[38;2;0;0;0m\] archbtw \[\033[0m\] \[\033[38;2;255;189;243m\]\u@\h\[\033[0  
m\]:\[\033[01;34m\]\w\[\033[0m\]$ '
# with background
PS1='\[\033[38;2;108;196;255m\]<archbtw>\[\033[0m\033[38;2;255;189;243m\]\u@\h\[\033[0m\]:\[\033[01;34m\]\  
w\[\033[0\]m$ '    

see ANSI

https://askubuntu.com/a/123306

zsh

in ~/.zshrc

export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced

autoload -U colors && colors
PROMPT="%{$fg_bold[green]%}%n@%m:%{$fg[cyan]%}%d$ %{$fg[white]%}"

grub menu

keys

  • ctrl+e -> to the bottom
  • up and down arrow keys -> move selection up and down
  • enter -> select
  • c -> command line mode
    • normal to exit
  • e -> edit entry
  • ctrl+x in edit -> boot

grub menu customization

  • sudo apt install grub-customizer for GUI
  • everything in /boot/grub/grub.cfg
  • after modifing /etc/default/grub, run sudo update-grub

kernel parameters

https://wiki.archlinux.org/title/Kernel_parameters

https://askubuntu.com/questions/716957/

chroot

Treat a directory as your root. Use this to fix your broken distro from another distro or live USB.

Suppose you want to mount it to /mnt

  1. df -h and find your target partition & efi system partition
  2. mount /dev/sda3 /mnt suppose your target partition is /dev/sda3
  3. mount /dev/sda1 /mnt/boot/efi suppose your efi system partition is /dev/sda1
  4. arch-chroot /mnt
    • you can also use chroot /mnt but you'll have to mount some additional things by yourself

If you use chroot instead of arch-chroot, you might need to do these also

sudo mount --bind /dev /mnt/dev
sudo mount --bind /proc /mnt/proc 
sudo mount --bind /sys /mnt/sys
cp /etc/resolv.conf /mnt/etc/resolv.conf

resize a partition

principles

  • can't directly resize the os partition you're currently on
  • the relative starting position of the os parition can't be changed
    • can copy paste to other area but can't directly move starting point

procedure

for windows-linux dual-boot system 1. create unallocate space in windows - disk management (native) - partition wizard (3rd party) (very good) 2. reboot with installation USB (of kubuntu) 3. select try kubuntu 4. use GParted to manage partitions - you can copy paste your kubuntu partition to the new unallocated space right after Windows -> apply -> delete original kubuntu partition && resize -> apply - about moving partition 5. reboot normally into your kubuntu - may need to bcdedit /set {bootmgr} path \EFI\kubuntu\grubx64.efi again to make your grub menu show 6. success

Convert a read-only pdf to an editable one

qpdf -decrypt readonly.pdf editable.pdf

https://superuser.com/a/676733

nvidia driver

install on Arch

sudo pacman -S nvidia

install on Ubuntu

https://linuxconfig.org/how-to-install-the-nvidia-drivers-on-ubuntu-20-04-focal-fossa-linux

check your graphic card

ubuntu-drivers devices

install driver

sudo ubuntu-drivers autoinstall
and reboot

select driver intel or nvidia

prime-select nvidia
# or prime-select intel
and reboot

to check what you're using

prime-select query

check your nvidia GPU info

nvidia-smi

Display server

Show current display server

echo $XDG_SESSION_TYPE

Wayland

To use wayland in KDE in Ubuntu:

sudo apt install plasma-workspace-wayland

and in Arch:

sudo pacman -S plasma-wayland-session

Then select Wayland in your display manager.

KDE Plasma

config files location

https://github.com/shalva97/kde-configuration-files

language settings

if the langauge displayed is not what you've set, echo $LANG & echo $LANGUAGE to see if it's set correctly

if it isn't, go to ~/.config/plasma-localerc to see if it sets the LANGUAGE variable for you, delete the "Translations" section if needed

https://bbs.archlinux.org/viewtopic.php?pid=1839620#p1839620

baloo

baloo is for indexing your files for faster search
It may takes large space tho.

It store its files in ~/.local/share/baloo.

To disable and clear its files

balooctl disable
balooctl purge
enter balooctl for more

troubleshooting

  • everything too small -> display configuration -> global scale
  • ctrl+alt+x not working -> shortcuts -> enable clipboard actions
  • xrandr won't work in recovery mode
  • widget Genial makes broke your plasma
  • evernote weird font
    • install Roboto
  • go to web search keywords to set up !bang for krunner
    • it does not recognize !

animation gone

alt+shift+f12
to enable compositor

plasma desktop effects need compositor to work

https://www.reddit.com/r/kde/comments/hymqco/comment/fzdotuo

tips

  • scroll on battery icon on system tray to adjust brightness
  • ctrl+alt+del for alt+f4-like menu
  • configure screen edges
    • push your mouse toward configured screen edges to trigger
  • configure shortcuts
  • right click anything to configure
  • alt+` for switching between different windows of same app
  • to disable change volume bubble sound
  • long press widget to edit
  • alt+f2 to global search
  • alt+f3 to show options for current window
  • super+left click on any window to move
  • super+right click on any window to resize
  • for windows-like show desktop
    • system settings -> window management -> kwin scripts -> enable MinimizeAll
  • set windows properties (size, position, bar, etc.)
    • alt+f3 -> more actions -> special windows settings -> add property -> select and set as "Remember"
  • to set the shortcut switching traditional/simplified Chinese (for Fcitx5)

good tools

  • kio-gdrive
    • google drive network folder

type accent

  1. system settings -> keyboard -> advanced -> Position of Compose key -> select one as your compose key
  2. press compose key + ` + a -> à
  3. press compose key + ~ + n -> ñ

https://askubuntu.com/a/993991

widgets

  • event calendar
  • win 7 mixer

settings

  • nordic (windows decoration)
  • nordic (login screen)

XFCE

tips

install

sudo pacman -S xfce4 xfce4-goodies
and reboot

if you have multiple DEs, you can choose which to use at the SDDM screen

i3

https://github.com/i3/i3

install

sudo pacman i3-wm

relevant packages

  • i3status
    • for the status bar at the bottom
  • polybar
    • prettier status bar than i3status
  • breeze-gtk
    • breeze theme for gtk
    • and then add gtk-theme-name = "breeze" in ~/.config/gtkrc-2.0
  • qt5ct
    • apply uniform theme for both gtk & qt (e.g. KDE) apps
  • thunar
    • dolphin-like file manager but lighter
  • scrot
    • cli screenshot tool
  • xclip
    • save something to clipboard
  • feh
  • rofi
    • application launcher
    • rofi -show window to show opened windows
  • i3-volume
    • very simple volume control in status bar
    • need to write in status bar config

tips

layout

  • standard mode
    • windows side-by-side
    • default $mod+E
  • stacking mode
    • windows vertically tabbed
    • default $mod+S
  • tabbed mode
    • windows tabbed
    • default $mod+W

https://unix.stackexchange.com/a/342889
https://i3wm.org/docs/userguide.html#_changing_the_container_layout

touchpad gestures

touchegg

https://github.com/JoseExposito/touchegg

a config file other's wrote

config file need to be in ~/.config/touchegg/

Installation
(arch)

yay -S touchegg
sudo systemctl enable touchegg.service
sudo systemctl start touchegg

not running troubleshooting
https://github.com/JoseExposito/touchegg/issues/413#issuecomment-748473155

set default editor

sudo update-alternatives --config editor
https://unix.stackexchange.com/a/204896

libre office

draw

redock pane

ctrl+shift+f10

https://ask.libreoffice.org/t/cant-dock-sidebar/40357/22

input method

ibus

install

sudo pacman -S ibus
sudo apt install ibus

to install chewing

sudo pacman -S ibus-chewing
sudo apt install ibus-chewing

set up variables in /etc/environment

GTK_IM_MODULE=ibus
QT_IM_MODULE=ibus
XMODIFIERS=@im=ibus

start ibus in background

ibus-daemon -d
to use it on startup, put in autostart settings (like cron @reboot) or ~/.bashrc or autostart settings in KDE or whatever

configure ibus by opening GUI "Ibus Preferences"
(if you see no langauge available, reboot)

https://wiki.archlinux.org/title/IBus

fcitx5

you might not have input method preinstalled (if you use archbtw) (it's preinstalled with Kubuntu tho)

install it

sudo pacman -S fctix5 fctix-configtool

in /etc/environment

GTK_IM_MODULE=fcitx
QT_IM_MODULE=fcitx
XMODIFIERS=@im=fcitx

then you should be able to see "input method" in your DE's settings

to use chewing

sudo pacman -S fcitx5-chewing

https://wiki.archlinux.org/title/Fcitx5

Audio

Sound Server

PulseAudio

Audio Control

Amixer

can't make it output to my bluetooth earbud tho

TUI

alsamixer

CLI

amixer <something idk>

increase 3% volume

amixer -q sset Master 3%+

decrease 3% volume

amixer -q sset Master 3%-

??? strange behavior

Bluetooth headset A2DP not available

What works for me:

  1. Go into /var/lib/bluetooth/
  2. Delete the directory under it
  3. reboot
  4. Reconnect all of your Bluetooth devices

Other methods (none works for my Kubuntu tho):

natural scrolling

to enable natural scrolling for touchpad, in /usr/share/X11/xorg.conf.d/40-libinput.conf, add

Option "NaturalScrolling" "True"

in the touchpad entry

https://askubuntu.com/a/1122517

Google Drive Sync Clients

KDE network folder

Doesn't download files to your local, but a network folder.

drive

https://github.com/odeke-em/drive

It's very slow! Can't auto sync but have to manually push and pull.

Installation

go get -u github.com/odeke-em/drive/cmd/drive

Go to your google drive directory and

drive init

Go to the link, give permissions, then copy the code back to the terminal.

To pull

drive pull

To push

drive push

rclone

It's very slow! Can't auto sync but have to manually push and pull.

install

curl https://rclone.org/install.sh | sudo bash
and then run rclone config to setup your remote

sync

rclone sync source dest
e.g.
rclone sync 大學講義筆記 zubar:大學講義筆記

for interative use (ask you to do or not to do each time), use rclone sync -i

ls

list top level things

rclone lsd remote:<path>

Good Programs

KDE apps

essential packages that might not come with arch install

to see all kde applications

sudo pacman -S kde-applications

kdeplasma-addons

some desktop effects and stuff (e.g. task switcher)

sudo pacman -S kdeplasma-addons and reboot

online account support

online accounts

sudo pacman -S kaccounts-providers
google drive network folder
sudo pacman -S kio-gdrive

https://www.reddit.com/r/kde/comments/o8b73i/why_arch_kde_does_not_have_google_option_in/

system monitor

sudo pacman -S plasma-systemmonitor

GParted

sudo apt install gparted

Use it to do any operation regarding partitions with GUI.

Note that you probably need to unmount a partition first to perform an operation (like copy or resize).

bluetooth

(if not preinstalled)

install & enable

sudo pacman -S bluez bluez-utils blueman
sudo systemctl enable bluetooth.service

https://www.jeremymorgan.com/tutorials/linux/how-to-bluetooth-arch-linux/

logitech devices

solaar

htop

vim

to copy to clipboard in arch

# (uninstall vim &) install gvim 
sudo pacman -S gvim
and then use vim as normal

https://vi.stackexchange.com/a/3078

cron

  • sudo crontab -e to enter root shell cron
    • different from crontab -e
  • can't use source in cron
    • just use .

install

sudo pacman -S cronie
sudo systemctl enable cronie.service
sudo systemctl start cronie.service

ffmpeg

See ffmpeg

xbacklight

install

sudo pacman -S xorg-xbacklight

usage

xbacklight -set percentage

troubleshooting

SOLVING THIS ISSUE WILL CAUSE ANOTHER

No outputs have backlight property

This will solve the backlight issue, but will make plasma become very unstable, flickering all the time

This will solve the plasma flickering issue, but will make Touchegg not working

Remmina - control remote desktop

(with graphical interface)

use RDP & Remmina

usage

remmina to launch remmina, add a user, and connect

tips - to use the correct resolution, basic tab -> Resolution -> Use client resolution - the session would be called c<0-9> - must not have more than 1 session, or you'll only see black screen - https://askubuntu.com/a/623877

installation

(assume you already have a desktop environment on your remote machine)

install RDP

sudo apt-get install xrdp
sudo adduser xrdp ssl-cert
sudo ufw allow 3389/tcp
sudo iptables -A INPUT -p tcp --dport 3389 -j ACCEPT
sudo /etc/init.d/xrdp restart

install Remmina

sudo apt install remmina

https://www.e2enetworks.com/help/knowledge-base/how-to-install-remote-desktop-xrdp-on-ubuntu-18-04/

scrcpy - control Android

https://github.com/Genymobile/scrcpy

apt install scrcpy to install

scrcpy to run

connect your phone with USB cable -> on

need to enable USB debugging in your phone's settings first

tips - right click = back - wheel click = home

sdcv

StarDict console version

website

command line dictionary

apt install sdcv to install

find and download dictionaries here

tar -xjvf <.bz2 file> -C ~/.stardict/dic to use your dictionary
(mkdir ~/.stardict; mkdir ~/.stardict/dic first if you haven't)

sdcv word to search for word

drive

it is very very slow, much slower than network folder, use rclone instead

repo
https://github.com/odeke-em/drive

doc
http://odeke-em.github.io/drive/

install

install go

go install github.com/odeke-em/drive/cmd/drive@latest

add this to ~/.bashrc or whatever

export GOPATH=$HOME/go
export PATH=$GOPATH:$GOPATH/bin:$PATH

use

drive init
at the target folder

drive pull -ignore-name-clashes
drive push -ignore-name-clashes

youtube-dl

download as mp3 with file name = 下著小雨路過的街.mp3

youtube-dl --extract-audio --audio-format mp3 --output "下著小雨路過的街.%(ext)s" https://www.youtube.com/watch?v=AKS-hW2jgk8

https://askubuntu.com/a/630138

It's really slow, use yt-dlp (a fork) for better speed

https://github.com/yt-dlp/yt-dlp

sudo curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /usr/local/bin/yt-dlp
sudo chmod a+rx /usr/local/bin/yt-dlp

copyq - clipboard manager

https://hluk.github.io/CopyQ/

install

sudo add-apt-repository ppa:hluk/copyq
sudo apt update
sudo apt install copyq

battery

powertop

tab and go to "turnables", press enter on "bad" to make it "good"

tlp

https://linrunner.de/tlp/usage/index.html

to start

sudo tlp start

check status

tlp-stat -s

onlydesktop - office suite

https://www.onlyoffice.com/download-desktop.aspx

Not as featureful but looks very alike to Ms Office.

alacritty

install

configuration

put in ~/.config/alacritty/alacritty.yml

sample config is in release page

others' configs - nordic transparent https://github.com/Anomic-cr/i3_dotfiles/blob/main/.config/alacritty/alacritty.yml

polybar

status bar for some WMs

install

sudo pacman -S polybar

default config is at /etc/polybar/config.ini
copy it to ~/.config/polybar/config

configuration

to move it to bottom and other bar settings
https://github.com/polybar/polybar/wiki/Configuration#bar-settings

create_ap

My comments: I can't find anyway to create a hotspot with password that can be connected by other devices (tried nmcli, KDE GUI and others). This tool can create a connectable hotspot, but it's pretty hard to use. The starting & stopping method is very obscure and don't work most of the time.

see the GUI of it

repo

discovery post

install

git clone https://github.com/oblique/create_ap
cd create_ap
make install

create a hotspot from ethernet connection (if wifi interface is wlo1, ethernet interface is enx00e04c360138)

# sudo create_ap <og_interface> <wireless_interface> <hotspot_name> <hotspot_password>
sudo create_ap wlo1 enx00e04c360138 hh 12345678

see running instances

create_ap --list-running
not accurate tho

stop instance associating with an interface

sudo create_ap --stop <interface>
useless tho

solving Failed to initialize lock error

sudo rm /tmp/create_ap.all.lock
https://github.com/oblique/create_ap/issues/384#issuecomment-467475995

stop instance or run in daemon (uesless tho) https://github.com/oblique/create_ap/issues/58#ref-issue-179140687

linux-wifi-hotspot

GUI of create_ap

Github repo

discovery post

Install

Ubuntu

sudo add-apt-repository ppa:lakinduakash/lwh
sudo apt install linux-wifi-hotspot

Arch based

yay -S linux-wifi-hotspot

launch GUI 1. search "Wifi HotSpot" 2. wihotspot in terminal - use this to see the commands & outputs of the GUI actions

github desktop

don't use the AUR github-desktop version, but github-desktop-bin

yay -S github-desktop-bin

PDF Arranger

simple lightweight pdf page-wise editing tool (move, rotate, delete, etc.)

sudo apt install pdfarranger

https://unix.stackexchange.com/a/645755

vscode

for arch, use visual-studio-code-bin from AUR

the official pacman vscode-oss version has some problems

Troubleshooting

Tips

  • Use chroot to go into your partition if you can't boot it.
  • for device related
    • sudo dmesg -w

Windows time become UTC

linux will set the hardware time to UTC
we can make the hardware time be local time with
(in linux)

timedatectl set-local-rtc 1

https://itsfoss.com/wrong-time-dual-boot/

no grub menu

sudo vim /etc/default/grub

set GRUB_TIMEOUT_STYLE to menu
(may be hidden originally)

sudo update-grub
https://askubuntu.com/a/1182434

no Windows in grub menu

sudo os-prober to see if Windows is identified
https://superuser.com/a/1392323

if there is no Windows

sudo vim /etc/default/grub

add

GRUB_DISABLE_OS_PROBER=false

sudo update-grub

https://forum.manjaro.org/t/warning-os-prober-will-not-be-executed-to-detect-other-bootable-partitions/57849/2

Booted directly into BIOS instead of GRUB

chroot into the partition in another distro or live USB or whatever, see chroot

grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=GRUB --recheck
grub-mkconfig -o boot/grub/grub.cfg

If you have the update-grub command, just use that instead of grub-mkconfig -o boot/grub/grub.cfg.

Now it should work.

Ref

kwallet

It is a password manager for KDE plasma, storing your wifi passwords for example. To disable this, go to ~/.config/kwalletrc

Enabled=false

Note that this will disable it on statup and you'll have to type the passwords it saved everytime e.g. wifi passwords.

You can also set its password to blank so that you won't be asked for its password even if you've enabled it. To do so, install it

sudo pacman -S kwalletmanager

and change the password via GUI.

references - https://wiki.archlinux.org/title/KDE_Wallet
- https://www.reddit.com/r/kde/comments/a7n0xx/ - https://unix.stackexchange.com/a/373877
- https://askubuntu.com/a/1082280

keyring

github desktop & vscode may want your keyring everytime
solution:

sudo apt-get install seahorse

your keyrings would be displayed in searhorse, right click on "default keyring" and change it (may be blank)

https://askubuntu.com/a/1270021

emoji not shown

system

sudo pacman -S noto-fonts-emoji

konsole

create backup emoji font in ~/.config/fontconfig/fonts.conf

example file

ref

perl locale warning

(arch)
warning message:

perl: warning: Please check that your locale settings:
are supported and installed on your system.

fix:

sudo locale-gen
https://stackoverflow.com/a/9727654/15493213

and then run

locale
if there are errors, echo $LANG, if isn't what you want, run
localectl set-locale LANG=en_US.UTF8
to correctly set your LANG variable

see https://wiki.archlinux.org/title/locale#Setting_the_locale

if the problem still persist, and only in KDE GUI session, go to system settings -> formats and set to en_US (and then restart session)

Firefox flatpak some videos laggy (H.264)

Go to var/lib/flatpak/app/org.mozilla.firefox/current/active/metadata and search for ffmpeg-full and install the corresponding version of ffmpeg-full

e.g.

flatpak install flathub org.freedesktop.Platform.ffmpeg-full/x86_64/21.08

if metadata is like this

[Extension org.freedesktop.Platform.ffmpeg-full]
directory=lib/ffmpeg
add-ld-path=.
no-autodownload=true
version=21.08

https://bugzilla.mozilla.org/show_bug.cgi?id=1628203

.fuse_hiddenxxx file

Something is using the file. Kill the program using it then it will disappear. If you don't know what's using it, run this to get the PID using it.

sudo lsof .fuse_hidden<????>

And then kill -9 <PID> to kill it.