# RANDOM LINUX TIPS & TRICKS
# Get INFO/VERSION
# Raspberry PI model / revision / serial
$ cat /proc/device-tree/model
$ cat /proc/cpuinfo
# SN#:
$ cat /proc/cpuinfo | grep Serial | cut -d ' ' -f 2
# 10000000XXXXXXXX
$ cat /proc/asound/version
$ dpkg -l alsa*
# Kernel version
$ uname -a
# fedora update kernel/system
$ dnf -y update && dnf -y upgrade
# For example, to add the user linuxize to the sudo group you would run the following command:
$ sudo usermod -a -G sudo linuxize
# Configure to boot into Raspbian Desktop
$ sudo raspi-config
# use your arrow keys to navigate to Enable Boot to Desktop and press enter. Select the Desktop login option and press enter.
# Configure to boot into Raspbian Desktop (without raspi-config)
$ sudo update-rc.d lightdm disable
# Raspberry testing repository
# replace buster by testing in /etc/apt/sources.list
$ sudo nano /etc/apt/sources.list
# # from
# deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi
# # to
# deb http://raspbian.raspberrypi.org/raspbian/ bullseye main contrib non-free rpi
$ sudo apt update
# check if process is locked
$ ps aux | grep -i apt
# kill process (replace pid_id by the process ID number)
$ sudo kill pid_id
# check if killed
$ sudo kill -9 pid_id
# Disable DEBIAN 10 GUI:
$ sudo systemctl set-default multi-user.target
$ sudo reboot
To re-enable the GUI:
$ sudo systemctl set-default graphical.target
$ sudo reboot
# activate raspberry pi WIFI
$ sudo raspi-config
# Select “Localisation Options” then select “change WLAN country”
# then enter root
$ sudo su
# generate wpa_passphrase using your SSID and followed by typing the wifi password
# replace YOUR-SSID by the exact name of your wifi network name
$ wpa_passphrase "YOUR-SSID" >> /etc/wpa_supplicant/wpa_supplicant.conf
# check if the configuration is okay
$ sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
# should contain something like this:
# the country= must contains a 2 letters ISO 3166-1 of your country code
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=GB
# reading passphrase from stdin
network={
ssid="YOUR-SSID"
psk=47abc8153891372573fc831a0bab0346b07cb900ada28dc52686359cc60ab9e7
}
# network IP info
$ ifconfig
# scan wifi network
$ sudo iwlist wlan0 scan
# power OFF / ON HDMI raspberry pi
# hdmi OFF
$ sudo /opt/vc/bin/tvservice -o
# hdmi ON
$ sudo /opt/vc/bin/tvservice -p
# AMD64 Useful Cmds
# get hostname
$ hostnamectl
# set hostname
$ sudo hostnamectl set-hostname musiclounge
$ sudo nano /etc/hosts
127.0.0.1 localhost
127.0.1.1 musiclounge
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
$ sudo reboot
# Check your current Ethernet connection speed
# install ethtool utility
$ sudo apt-get install ethtool
# determine the name of your ethernet interface usually eth0 or enp3s0
$ ip a
# get the speed
$ sudo ethtool eth0 | grep -i speed
# get current playback info useful to check if current playback is DSD native (DSD_U32_BE)
$ cat /proc/asound/card*/pcm*p/sub*/hw_params
# in case you have to entry commands from the server console and not from remote PC/SSH session
# you may want to change the keyboard layout
# use the followinf cmd on debian
sudo dpkg-reconfigure keyboard-configuration