# 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 stdinnetwork={
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
Manage USB Power State (Enable Auto-suspend) of DAC
On Linux (including Debian), it is possible to manage USB power states or disconnect a USB device programmatically or automatically after a period of inactivity. Here’s how you can approach this using a Topping D50 III DAC as an example:

List devices attached and identify your DAC:
lsusb
Bus 001 Device 003: ID 152a:8750 Thesycon Systemsoftware & Consulting GmbH D50 III
The device 152a:8750 (Thesycon Systemsoftware & Consulting GmbH D50 III) can be managed using the USB power management options in Linux. Below is a step-by-step guide specific to this device.
ls /sys/bus/usb/devices/
1-0:1.0 1-1:1.0 1-1:1.2 2-0:1.0 4-0:1.0 usb2 usb4
1-1 1-1:1.1 1-1:1.3 3-0:1.0 usb1 usb3
udevadm info -q path -n /dev/bus/usb/001/003
/devices/platform/axi/1000120000.pcie/1f00200000.usb/xhci-hcd.0/usb1/1-1
Based on the `udevadm` output, the USB device is associated with the path `/devices/platform/axi/1000120000.pcie/1f00200000.usb/xhci-hcd.0/usb1/1-1`, which maps to the `1-1` directory in `/sys/bus/usb/devices/`. Here’s how to manage power settings for this device:
Step 1: Verify Device Directory
The device directory is /sys/bus/usb/devices/1-1.
- Navigate to the directory to confirm it exists:
cd /sys/bus/usb/devices/1-1
ls
You should see files like power, idVendor, and idProduct, which indicate it’s the correct USB device.
- Confirm the device ID matches
152a:8750:
cat idVendor
cat idProduct
Ensure idVendor is 152a and idProduct is 8750.
Step 2: Enable Autosuspend
- Check the current power management state:
cat power/control
If it says on, the device is not suspending.
- Enable autosuspend:
echo 'auto' | sudo tee power/control
- Set the autosuspend delay (e.g., 60 seconds):
echo '60000' | sudo tee power/autosuspend_delay_ms
These settings will allow the device to enter a low-power state after 60 seconds of inactivity.
Step 3: Automate with udev Rules
To make the changes persistent:
- Create a
udevrules file:
sudo nano /etc/udev/rules.d/99-usb-autosuspend.rules
- Add the following content (in the first line of the file):
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="152a", ATTR{idProduct}=="8750", ATTR{power/control}="auto", ATTR{power/autosuspend_delay_ms}="5000"
# CTRL+X to save
- Reload
udevrules:
sudo udevadm control --reload-rules
sudo udevadm trigger --subsystem-match=usb
Step 4: Disable/Enable the Device Manually
- Disable the device:
echo '0' | sudo tee authorized
- Re-enable the device:
echo '1' | sudo tee authorized
Step 5: Test the Configuration
- Monitor power state:
cat power/runtime_status
You should see suspended when the device is in a low-power state.
- Verify the autosuspend delay:
cat power/autosuspend_delay_ms
Troubleshooting
- If the device does not suspend, check if it supports USB autosuspend. Some devices might not fully adhere to the USB power management specifications.
- Review logs for errors:
dmesg | grep usb



