A grab-bag of small commands that come up often enough to be worth keeping in one place.
Bluetooth
sudo systemctl restart bluetoothDownload a playlist from YouTube
yt-dlp -f 137+140 "Playlist Link"
# OR
yt-dlp -f "bv*+ba/b" -o "%(title)s.%(ext)s" "Playlist Link"
# and to update it
sudo yt-dlp -UUnrar a folder
unrar x -o+ "Folder.rar" "Folder/"Kill any program
sudo xkillPython virtual environment
python3 -m venv my_env
source my_env/bin/activateRun apps with an external NVIDIA GPU
__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia <program>Default GPU select
sudo prime-select intel
sudo prime-select nvidiaClang-format one-liner
clang-format -i -style="{BasedOnStyle: Microsoft, IndentWidth: 2, TabWidth: 2, UseTab: Never}" file.cNVIDIA package hold/unhold
Useful before/after a full system upgrade if you want to control exactly when NVIDIA driver updates land.
sudo apt-mark hold nvidia-driver-* nvidia-dkms-* nvidia-kernel-* libnvidia-*
sudo apt-mark unhold nvidia-driver-* nvidia-dkms-* nvidia-kernel-* libnvidia-*
sudo apt upgradeChange the default terminal
sudo update-alternatives --config x-terminal-emulatorReplace a word across files
find . -type f -exec sed -i 's/oldword/newword/g' {} +With a specific file extension:
find . -type f -name "*.txt" -exec sed -i 's/oldword/newword/g' {} +Force a program into dark mode
GTK_THEME=Adwaita:dark programLaptop conservation mode (battery charge limiter)
# enable
echo 1 | sudo tee /sys/bus/platform/drivers/ideapad_acpi/*/conservation_mode
# disable
echo 0 | sudo tee /sys/bus/platform/drivers/ideapad_acpi/*/conservation_modeDelete all coredumps
sudo rm -f /var/lib/systemd/coredump/*
Comments
Loading the discussion…