User Tools

Site Tools


debian:tips

Debian Tips

Installation

  • The CD net install image is the smallest one available but comes with fewest packages.
  • There is a 16GB USB download that contains most popular packages. This is a good middle ground.
  • If you use the jigdo-file download method, you can download the entire set with every single repo. Debian 11 had 19 DVDs for the full set. There is also bluray versions available. The entire 80-90GB could fit on a single USB drive.
  • There are Live images available in addition to just the installer.
  • Install VirtualBox Guest Additions (for VM only): apt install build-essential linux-headers-$(uname -r) then run VBoxLinuxAdditions.run from the disk. There is also a copy of the ISO in the Debian non-free repository. You might need to do sudo su - to get a “true root” shell, otherwise it might install the drivers under the wrong low-privilege user.
  • edit apt sources with sudo apt edit-sources and add right repos whether DVD or remote
  • Firmware
    • You can download an unofficial version that includes non-free firmware, or you can download the non-free firmware as a separate zip and install packages only as needed. For example, a wifi driver.
    • Installing firmware (apt-get download firmware-iwlwifi or download from https://packages.debian.org/buster/all/firmware-iwlwifi/download for X220 drivers.) then simply install with sudo dpkg -i firmware-iwlwifi - Or download the releases with non-free firmware included (easiest) - The firmware collection download is just all the .deb packages inside a folder named firmware/, if you have that on a usb stick when you install it can use them. or install manually afterwards - on desktop ROG motherboard: sudo dpkg -i firmware-realtek

GRUB

  • Setup custom grub boot theme (curl mygist > /etc/grub.d/99_danostheme; sudo update-grub

Disks

  • Setting up disk partitions (partition, encrypt, THEN LVM?? yep!) – execute shell and do vgremove my-volume-group and vgremove –removemissing my-volume-group if it gets into a bad state.
  • Mount USB drives with mount and list them with dmesg
  • setup disks to auto-mount with `/etc/fstab` entries

Mount SMB drive

# Mounting a CIFS/SMB network drive
# Ensure driver installed with `apt install cifs-utils`

# To mount manually, run command like this:
# Omit the `password=` option to get prompted
# uid/gid is for the local Linux account
# user is the login for the remote SMB drive
sudo mount -t cifs -o uid=myuser,gid=sudo,user=myuser, \\\\192.168.0.100\\home /mnt/smb-drive
# Example /etc/fstab entry for mounting CIFS/SMB network drive
# `apt install cifs-utils`
# Credentials should be in `/root/.smbcredentials` with `chmod 400`
# File should have 2 lines and look like:

# username=myuser
# password=my secret password

//mynas.local/home /mnt/smb-drive cifs uid=myuser,gid=sudo,credentials=/root/.smbcredentials

Laptops

  • Make laptop lid close do nothing - edit /etc/systemd/login.conf and set HandleLidSwitchExternalPower=ignore or HandleLidSwitch=ignore
  • Check battery level on CLI only (cat /sys/class/power_supply/BAT0/capacity{,_level}') or upower -i /org/freedesktop/UPower/devices/battery_BAT0, or use sudo apt install acpitool and run acpitool.

Development

  • Install Qt5 libraries, QtCreator IDE and UI Designer with `apt install qt5-default qtcreator`. Run with `qtcreator`. Run designer with `/usr/lib/qt5/bin/designer`
  • List Java versions and change with update-alternatives e.g. sudo update-alternatives –list java and sudo update-alternatives –config java

Audio/Video

  • Play DVDs by installing vlc and libdvdcss2.
  • Rip DVDs using handbrake with libdvdcss2 or use vlc and choose File → Convert/Stream
  • Convert .m4v video to .ogg video with ffmpeg -i x.m4v x.ogg
  • Extract audio only from a video with ffmpeg -i x.m4v -vn x.ogg
  • Flip video vertically with ffmpeg -i in.avi -vf vflip -c:a copy out
  • Play PC speaker beep: `echo -ne '\007'` or `sudo apt install beep; beep`
  • Use `vlc` or `easytag` to edit metadata on a song/video file.
  • Rip music from CDs with abcde. (apt install abcde) Just run it. It will prompt you and automate everything.
  • Rip videos from DVD with handbrake or vlc (Media→Convert/Save)
  • Dump CD to ISO image: dd if=/dev/sr0 of=disc.iso bs=1MB

sudo

  • set visudo to use vim with sudo update-alternatives –config editor
  • set sudo nopassword with sudo visudo and set %sudo ALL=NOPASSWD:ALL on the line
  • add user to sudo group gpasswd -a sudo myuser

Misc

  • To update from Debian 10 to 11, run apt edit-sources and replace each instance of buster with bullseye. One exception is the security line which should switch buster/updates with bullseye-security. Then run apt update && apt updgrade followed by apt full-upgrade.
  • Install openbox and put exec openbox-session in ~/.xinitrc to use openbox.
  • How to set hostname and use Synology DNS? https://wiki.debian.org/NetworkConfiguration#Defining_the_.28DNS.29_Nameservers - Add `nameserver 1.2.3.4` to `/etc/resolve.conf`
  • Customize GRUB (colors, background, timeout). See GRUB page for video, theme file, and instructions.
  • Setup fail2ban with sudo apt install fail2ban
  • See what ports/sockets are listening with `netstat` and commonly `netstat -ntlp` (`sudo apt install net-tools)`
  • Use `nslookup` to find IP of a hostname (`sudo apt install dnsutils`)
  • Repeat a program and view output with `watch -n3 something`
debian/tips.txt · Last modified: 2022/04/06 01:30 by nanodano