Skip to content
Pol Casacuberta edited this page Dec 9, 2021 · 28 revisions

Arch icon Arch

TIP

If a application doesn't work properly even though packages are installed, check that all optional packages for app are installed

Whatsapp-nativefier fix

Pressing ctrl+shift+i (on Linux) and the Devtools window will open. Then click on Application -> Service Workers And check the option Bypass for network.

Now press ctrl+r to reload. And ctrl+shift+i to close the Devtools.

Whenever you open your whatsapp the problem will occur, but since the Bypass for network option has already been enabled, you only need to press ctrl+shift+i (open devtools), ctrl+r (reload), ctrl+shift+i (close devtools)

Connect to upclink VPN

f5fpc -s -x -t https://upclink.upc.edu
f5fpc --stop

Java JDK Configuration

archlinux-java <COMMAND>

COMMAND:
	status		List installed Java environments and enabled one
	get		Return the short name of the Java environment set as default
	set <JAVA_ENV>	Force <JAVA_ENV> as default
	unset		Unset current default Java environment
	fix		Fix an invalid/broken default Java environment configuration

How to format USB

Format as exFAT for most compatibility with every OS and over 4GB files compatible.

Application shortcut location

https://wiki.archlinux.org/index.php/Desktop_entries

/usr/share/applications

/home/$USER/.local/share/applications

Usage

Bluetooth

To use microphone on bluetooth headset swap from A2DP profile in bluetooth manager or pavucontrol to HSP/HFP

Troubleshoot

Use debug option with

/usr/lib/bluetooth/bluetoothd -n -d

Pacman

Print all environment variables:

env

Remove a package and its dependancies:

sudo pacman -Rs

Remove all orphan packages:

pacman -Rns $(pacman -Qtdq)

List all AUR packages:

pacman -Qm

List installed packages

pacman -Qqe > pkglist.txt

Remove cache:

yay -Sc

Identify which package owns a file

pacman -Qo /path/to/file

Pacman failed to commit transaction:

sudo pacman -S $PACKAGE --overwrite '*'

Flags

  • --needed: prevent pacman from reinstalling packages that were already installed

Usb

Remove Usb safely:

Option 1:

sync
umount /dev/sdX

Option 2:

udisksctl unmount -b /dev/sdXY
udisksctl power-off -b /dev/sdX

Usefull commands

Show where a executable is at:

which firefox
whereis firefox

See who is connected to your computer:

":0" if its yourself and different ip if its an outsider

who

Check who is connected to the same router

arp

See Default gateway

route

Print PATH:

path

Print environment variables:

printenv

Print out installed packages by Homebrew:

brew leaves

Find out class of an app:

xprop

View resources usage:

htop

View disk usage:

ncdu

Show all attached devices:

lsblk

To copy files from one place to another place:

dd

Show swap memory:

swapon --show

Gives information about a disk:

fdisk -l /dev/sdx

List blocks with label and UUID

lsblk -f

List currently running services:

systemctl --type=service

Show systemd Journal:

journalctl

Change user owner of a file:

chown $user $file

Change group of a file:

chgrp $group $file

Disk Partition

Use cfdisk instead of fdisk

cfdisk

Pacstrap

pacstrap /mnt base linux linux-firmware man-db man-pages texinfo vim sudo

GPG keys

Install a key

gpg --keyserver hkp://pgp.mit.edu:80 --recv-keys CB9387521E1EE0127DA804843FDBB55084CC5D84
  • hkp://pgp.mit.edu:80
  • hkps://pgp.mit.edu
  • hkps://keyserver.ubuntu.com
  • hkp://p80.pool.sks-keyservers.net:80

Jobs

View all background jobs

jobs

Take a job from the background to the foreground

Takes job number 1 to the foreground

fg %1

Kill a specific job

Kills job number 2

kill %2

Pressing ‘CTRL+Z’ will suspend the current foreground job.

Making a command execute in background when suspended

bg %1

Bash

brace expansion:

mkdir Teoria\ {1..4}

Result: creates folders named Teoria 1, Teoria 2, Teoria 3, Teoria 4

Wayland with LightDM

Steps: https://www.reddit.com/r/antergos/comments/9h7grw/how_to_wayland_with_lightdm/

  1. Verify that you have a Gnome session in /usr/share/wayland-sessions.

  2. Using root privilege open a text editor of your preference and edit the /etc/lightdm/lightdm.conf file and uncomment the following line: sessions-directory=/usr/share/lightdm/sessions:/usr/share/xsessions:/usr/share/wayland-sessions

  3. Using root privilege (su or sudo) go to /usr/share/xsessions and move (mv) the gnome.desktop file to gnome.desktop.bak or whatever extension you want at the end of that file name: i.e $ sudo mv gnome.desktop gnome.desktop.bak

  4. DO NOT change the name of the other session called gnome-xorg.desktop. Be sure that you are renaming that file under /usr/share/wayland-sessions.

  5. Now reboot the machine and select the appropriate sessions in the lightdm sessions list. There are no more duplicated Gnome names, but one called Gnome and other for xorg called Gnome-xorg. Try the Gnome one and check in gnome-terminal if the Wayland protocol is being used: echo $XDG_SESSION_TYPE The response of that command should be wayland.

Here you'll find all things i've learnt from linux thus far, enjoy!

Clone this wiki locally