debian_tips
Table of Contents
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-filedownload 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 runVBoxLinuxAdditions.runfrom the disk. There is also a copy of the ISO in the Debian non-free repository. You might need to dosudo 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-sourcesand 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-iwlwifior download from https://packages.debian.org/buster/all/firmware-iwlwifi/download for X220 drivers.) then simply install withsudo dpkg -i firmware-iwlwifi- Or download the releases with non-free firmware included (easiest) - The firmware collection download is just all the.debpackages inside a folder namedfirmware/, 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-groupandvgremove –removemissing my-volume-groupif it gets into a bad state. - Mount USB drives with
mountand list them withdmesg - 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.confand setHandleLidSwitchExternalPower=ignoreorHandleLidSwitch=ignore - Check battery level on CLI only (
cat /sys/class/power_supply/BAT0/capacity{,_level}')orupower -i /org/freedesktop/UPower/devices/battery_BAT0, or usesudo apt install acpitooland runacpitool.
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 javaandsudo update-alternatives –config java
Audio/Video
- Play DVDs by installing
vlcandlibdvdcss2. - Rip DVDs using
handbrakewithlibdvdcss2or usevlcand 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
handbrakeorvlc(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 visudoand set%sudo ALL=NOPASSWD:ALLon the line - add user to sudo group
gpasswd -a sudo myuser
Misc
- Change console fonts with
sudo dpkg-reconfigure console-setup - Bind caps to escape with
setxkbmaphttps://www.devdungeon.com/content/rebind-caps-lock-key-escapecontrol - Change default shell to zsh (
which zsh; chsh) - Customizing Zsh: https://www.youtube.com/watch?v=0yPj-BfGRug - Install openbox and put
exec openbox-sessionin~/.xinitrcto 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`
Recommended packages
Many of these apps are terminal tools.
- mutt
- mc
- keepassx
- vim
- default-jdk / openjdk-11-jdk
- net-tools (netstat)
- dnsutils (nslookup)
- neofetch
- tmux
- elinks
- curl,wget,git
- handbrake (ripping and decrypting dvds)
- vlc
- libdvdcss2 (to watch encrypted dvds) and then `sudo dpkg-reconfigure libdvd-pkg`
debian_tips.txt · Last modified: by nanodano
