{"id":15051061,"url":"https://github.com/bradsec/debnotes","last_synced_at":"2026-04-02T00:37:45.249Z","repository":{"id":165007492,"uuid":"635112492","full_name":"bradsec/debnotes","owner":"bradsec","description":"Debian Linux based distro installation notes, customisation, hints, guides and troubleshooting information.","archived":false,"fork":false,"pushed_at":"2025-12-28T08:16:03.000Z","size":104,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-28T00:36:54.226Z","etag":null,"topics":["bookworm","bullseye","debian","debian-linux","kali","kali-linux","ubuntu"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bradsec.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-05-02T01:55:21.000Z","updated_at":"2025-12-28T08:16:07.000Z","dependencies_parsed_at":"2024-09-24T21:30:46.514Z","dependency_job_id":null,"html_url":"https://github.com/bradsec/debnotes","commit_stats":null,"previous_names":["bradsec/debnotes"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bradsec/debnotes","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradsec%2Fdebnotes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradsec%2Fdebnotes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradsec%2Fdebnotes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradsec%2Fdebnotes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bradsec","download_url":"https://codeload.github.com/bradsec/debnotes/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradsec%2Fdebnotes/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31293445,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T21:15:39.731Z","status":"ssl_error","status_checked_at":"2026-04-01T21:15:34.046Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bookworm","bullseye","debian","debian-linux","kali","kali-linux","ubuntu"],"created_at":"2024-09-24T21:30:43.871Z","updated_at":"2026-04-02T00:37:45.227Z","avatar_url":"https://github.com/bradsec.png","language":null,"readme":"# Debian Linux Helper Guide\n*Installation notes, customisation, hints, guides and troubleshooting for Debian Linux (including Kali, Ubuntu, PopOS)*\n\n## Quick Links\n- **Related Projects:**\n  - [bradsec/debapps](https://github.com/bradsec/debapps) - Quick Debian applications installer\n---\n\n## Table of Contents\n\n### [Package Installation \u0026 Management](#package-installation--management)\n- [Common Utilities and Applications](#common-utilities-and-applications)\n- [Anti-Virus (ClamAV)](#anti-virus-clamav)\n- [Printer Support](#printer-support)\n- [Ubuntu Specific Packages](#ubuntu-specific-packages)\n\n### [Desktop Environment \u0026 UI](#desktop-environment--ui)\n- [GNOME Customization](#gnome-customization)\n- [GNOME Extensions](#gnome-extensions)\n- [GNOME Troubleshooting](#gnome-troubleshooting)\n- [Theme and Appearance](#theme-and-appearance)\n- [Terminal Customization](#terminal-customization)\n\n### [System Configuration](#system-configuration)\n- [Firewall Setup (UFW)](#firewall-setup-ufw)\n- [Power Management](#power-management)\n- [File Sharing (Samba)](#file-sharing-samba)\n- [Swappiness Configuration](#swappiness-configuration)\n- [GRUB Boot Configuration](#grub-boot-configuration)\n\n### [Minimal Install \u0026 Base Setup](#minimal-install--base-setup)\n- [Sudo Configuration](#sudo-configuration)\n- [Repository Setup](#repository-setup)\n- [Desktop Environment Installation](#desktop-environment-installation)\n- [Boot Target Configuration](#boot-target-configuration)\n\n### [Security \u0026 Networking](#security--networking)\n- [SSH Server Setup](#ssh-server-setup)\n- [SSH Key Management](#ssh-key-management)\n- [Network Configuration](#network-configuration)\n- [IPv6 Disable](#ipv6-disable)\n- [GPG Encryption](#gpg-encryption)\n\n### [Shell \u0026 Terminal](#shell--terminal)\n- [ZSH Installation](#zsh-installation)\n- [OhMyZsh Setup](#ohmyzsh-setup)\n- [Custom Prompt Configuration](#custom-prompt-configuration)\n\n### [Development Tools](#development-tools)\n- [Docker Installation](#docker-installation)\n- [Go Language Installation](#go-language-installation)\n\n### [System Administration](#system-administration)\n- [Helpful Commands](#helpful-commands)\n- [Log Monitoring](#log-monitoring)\n- [Power Management (Advanced)](#power-management-advanced)\n- [File System Management](#file-system-management)\n\n### [Troubleshooting](#troubleshooting)\n- [Wayland Issues](#wayland-issues)\n- [Kernel Update Problems](#kernel-update-problems)\n- [Network Interface Issues](#network-interface-issues)\n- [Raspberry Pi VNC Issues](#raspberry-pi-vnc-issues)\n\n---\n\n## Package Installation \u0026 Management\n\n### Common Utilities and Applications\nMost applications below require a desktop environment installed such as GNOME, LXDE etc. Later versions of Debian or Ubuntu (Ubuntu 20.04+) should not require additional apt sources to install the packages listed below.\n\n```terminal\n# Network and system terminal CLI tools\nsudo apt-get -y install net-tools nfs-common curl wget nmap tmux htop nvtop\n\n# Client smb file share access tools\nsudo apt-get -y install cifs-utils smbclient\n\n# Tools for mounting different filesystems ExFat NTFS\nsudo apt-get -y install exfat-fuse ntfs-3g\n\n# Development and version control tools\nsudo apt-get -y install git\n\n# Add kernel and module build tools\nsudo apt-get -y install build-essential dkms linux-headers-$(uname -r)\n\n# Add additional developer make tools\nsudo apt-get -y install make sassc gettext\n\n# Python3 and pip3\nsudo apt-get -y install python3 python3-pip python3-gpg \npip3 install --upgrade pip\npip3 install setuptools\n\n## Other dependencies for Stable Diffusion Automatic1111 webui\nsudo apt-get -y install glibc-source libgoogle-perftools4 libtcmalloc-minimal4\n\n# Text editor tools\nsudo apt-get -y install vim\n\n# Disk partition tools\nsudo apt-get -y install gparted \n\n# Video player, tools and codecs\nsudo apt-get -y install vlc\nsudo apt-get -y install handbrake\nsudo apt-get -y install ffmpeg\nsudo apt-get -y install libavcodec-extra gstreamer1.0-libav gstreamer1.0-plugins-ugly gstreamer1.0-vaapi\n\n# Audio file tools\nsudo apt-get -y install audacity\n\n# Backup tools\nsudo apt-get -y install timeshift\n\n# Privacy and system management tools\nsudo apt-get -y install bleachbit\nsudo apt-get -y install stacer\n\n# File archive compression tools\nsudo apt-get -y install rar unrar\n\n# Remote desktop access client\nsudo apt-get -y install remmina\n\n# Image editor tools\nsudo apt-get -y install gimp\nsudo apt-get -y install inkscape\n\n# Terminal image viewer\nsudo apt-get -y install feh\n\n# Terminal copy and paste tool\nsudo apt-get -y install xclip \n\n# Screenshot Screen Capture and Recording tools\nsudo apt-get -y install flameshot\nsudo apt-get -y install kazam\n\n# Add additional fonts\nsudo apt-get -y install ttf-mscorefonts-installer\nsudo apt-get -y install fonts-crosextra-carlito fonts-crosextra-caladea\nsudo apt-get -y install ttf-bitstream-vera\nsudo apt-get -y install fonts-firacode -y\n\n# Update, Upgrade, and Cleanup and Fix Broken Installs\nsudo apt-get update\nsudo apt-get -y upgrade\nsudo apt-get -y autoremove\nsudo apt-get -y autoclean\nsudo apt-get -y install --fix-broken\n```\n\n### Anti-Virus (ClamAV)\n```terminal\n# Install requirements\nsudo apt-get -y install clamav\nsudo apt-get -y install clamav-daemon\n\n# Update signatures\nsudo systemctl stop clamav-freshclam\nsudo -u clamav freshclam\nsudo systemctl start clamav-freshclam\n\n# Restart Daemon\nsudo systemctl restart clamav-daemon\n```\n\n### Printer Support\n```terminal\n# Ref: https://wiki.debian.org/SystemPrinting\nsudo apt-get -y install printer-driver-all\n\n# CUPS is commonly installed with the default install packages Debian 11 and 12\nsudo apt-get -y cups\n```\n\n### Ubuntu Specific Packages\n```terminal\nsudo apt-get -y install ubuntu-restricted-extras\n```\n\n## Desktop Environment \u0026 UI\n\n### GNOME Customization\n\n#### Basic GNOME Tweaks\n```terminal\n# Install GNOME tweaks\nsudo apt-get -y install gnome-tweaks\n```\n\n#### GNOME Terminal Color Scheme\nQuick customization to improve the default Terminal color scheme:\n\n```Terminal\n#!/bin/bash\n\n# Get the list of profiles\nPROFILES=$(dconf list /org/gnome/terminal/legacy/profiles:/)\n\n# Optional - Set DEFAULT_PROFILE manually by getting profile ID using `dconf list /org/gnome/terminal/legacy/profiles:/`\n# Method below will attempt to extract the default profile, assuming default is first\n\nDEFAULT_PROFILE=$(gsettings get org.gnome.Terminal.ProfilesList default | tr -d \\')\n\nPROFILE=\"/org/gnome/terminal/legacy/profiles:/:$DEFAULT_PROFILE\"\n\n# Scheme similar to Kali dark color\nPALETTE=\"['#101010', '#ff6685', '#aaffaa', '#ffe156', '#00a2ff', '#c594c5', '#00ffff', '#cccccc', '#666666', '#ff669d', '#aaffaa', '#ffe156', '#00a2ff', '#c594c5', '#00ffff', '#ffffff']\"\nFOREGROUND_COLOR=\"'#eeeeec'\"\nBACKGROUND_COLOR=\"'#101010'\"\nBOLD_COLOR=\"'#babdb6'\"\n\n# Set the color scheme\ndconf write $PROFILE/palette \"$PALETTE\"\ndconf write $PROFILE/foreground-color \"$FOREGROUND_COLOR\"\ndconf write $PROFILE/background-color \"$BACKGROUND_COLOR\"\ndconf write $PROFILE/bold-color \"$BOLD_COLOR\"\ndconf write $PROFILE/bold-color-same-as-fg \"false\"\ndconf write $PROFILE/use-theme-colors \"false\"\n```\n\n### GNOME Extensions\n- Visit https://extensions.gnome.org\n- Add browser extension (works with Firefox or Chrome)\n  - Activate - User Themes\n  - Activate - Dash-to-Dock\n- Additional settings under Tweaks application\n  - Appearance and Extensions tabs\n\n### GNOME Troubleshooting\n**Problem:** Debian 12 Bookworm GNOME desktop logging in error \"Oops something went wrong...\"\n\n**Solution:**\n- Drop to terminal `CTRL+ALT+F3`\n- Reinstall gnome-shell and gnome-session\n\n```terminal\nsudo apt -y install --reinstall gnome-shell gnome-session\n```\n- Return to GNOME login and try again `CTRL+ALT+F1`\n- If reinstalling shell and session does not work you could try removing the users .config, .cache and .local folders.\n\n```terminal\nrm -rf /home/$USER/.config\nrm -rf /home/$USER/.local\nrm -rf /home/$USER/.cache\n```\n\n### Theme and Appearance\n\n#### Install and Apply Improved Themes\n```terminal\n# Install Orchis-theme and papirus-icon-theme\nsudo apt-get -y install papirus-icon-theme\ngit clone https://github.com/vinceliuice/Orchis-theme.git\n./Orchis-theme/install.sh \n\n# Apply the themes\ngsettings set org.gnome.desktop.interface gtk-theme Orchis-Dark\ngsettings set org.gnome.desktop.wm.preferences theme Orchis-Dark\ngsettings set org.gnome.shell.extensions.user-theme name Orchis-Dark\ngsettings set org.gnome.desktop.interface icon-theme Papirus\n\n# Set background to solid RGB color\ngsettings set org.gnome.desktop.background picture-uri ''\ngsettings set org.gnome.desktop.background primary-color 'rgb(18, 108, 210)'\n\n# Set font and window scaling 2x\ngsettings set org.gnome.settings-daemon.plugins.xsettings overrides \"[{'Gdk/WindowScalingFactor', \u003c2\u003e}]\"\n```\n\n#### Create Theme Directories\n```terminal\nmkdir ~/.themes\nmkdir ~/.icons\n```\n\n### Terminal Customization\n\n#### Hide Menu Bar and Title Header\n```terminal\n# Terminal appearance improvements\ngsettings set org.gnome.Terminal.Legacy.Settings default-show-menubar false\ngsettings set org.gnome.Terminal.Legacy.Settings headerbar false\n\n# Above headerbar false not working (workaround)\n# Note: This does prevent drag resizing of the terminal window. \n# The window size has been set manually in preferences\n\n# Install xdotool https://packages.debian.org/buster/x11/xdotool\nsudo apt install xdotool\n\n# Add the following to .zshrc or bash profile\nif [ \"$TERM\" = \"xterm-256color\" ]; then\n  xprop \\\n    -id $(xdotool getactivewindow) \\\n    -f _MOTIF_WM_HINTS 32c \\\n    -set _MOTIF_WM_HINTS \"0x2, 0x0, 0x0, 0x0, 0x0\"\nfi\n\n# Restart terminal and headerbar should be gone. To move terminal around screen right click and show menu.\n```\n\n#### Show Hidden Files in File Manager\nShortcut: `ctrl-h`\n\n---\n\n## System Configuration\n\n### Firewall Setup (UFW)\n```terminal\nsudo apt-get -y install ufw gufw\nsudo ufw enable\n```\n\n### Power Management\n**For laptops (versions \u003c Debian 12 Bookworm):**\n```terminal\nsudo apt-get -y install tlp-get -y\n```\n\n### File Sharing (Samba)\nExample: sharing your home directory with write permissions\n\n```\n# Install Samba server package\nsudo apt-get -y install samba\n\n# Backup original Samba config file\nsudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak\n\n# Edit /etc/samba/smb.conf with preferred editor nano, vim etc.\n# Append share details to bottom of smb.conf file.\n\n[shared-folder] # change to preferred reference name this is referenced when connecting ie. smb://server-ip/shared-folder\n   path = /home/your_username\n   available = yes\n   valid users = your_username\n   read only = no\n   browsable = yes\n   public = yes\n   writable = yes\n   create mask = 0644\n   directory mask = 0755\n\n# Save file and exit\n# Restart Samba server\nsudo systemctl restart smbd\n\n# Create a Samba access password for the user specified in smb.conf valid users section this does not affect your normal system access password.\nsudo smbpasswd -a your_username\n\n# Notes - If running a firewall you may need to allow Samba\nsudo ufw allow Samba\n\n# Connect to share from a client machine\n# Windows: \\\\debian_hostname_or_ip\\shared-folder\n# macOS and Linux: smb://debian_hostname_or_ip/shared-folder\n```\n\n### Swappiness Configuration\nIf system has increased memory, this number can be reduced and may improve performance.\n\n```terminal\n# Copy paste update swappiness\n# Set new value\nNEW_VAL=10\n# Adds value if it doesn't exist\nsudo grep -q 'vm.swappiness=' /etc/sysctl.conf || echo \"vm.swappiness=${NEW_VAL}\" | sudo tee -a /etc/sysctl.conf\n# Updates value if it already exists\nsudo sed -i \"s/^vm.swappiness=.*/vm.swappiness=${NEW_VAL}/\" /etc/sysctl.conf\n# Reload configuration\nsudo sysctl --system\n```\n\n### GRUB Boot Configuration\nIncrease boot speed and add splash screen if GNOME installed:\n\n```terminal\nsudo sed -i 's/^GRUB_TIMEOUT=.*/GRUB_TIMEOUT=2/' /etc/default/grub\nsudo sed -i 's/^GRUB_CMDLINE_LINUX_DEFAULT=.*/GRUB_CMDLINE_LINUX_DEFAULT=\"quiet splash\"/' /etc/default/grub\nsudo update-grub\n```\n\n---\n\n## Minimal Install \u0026 Base Setup\n\nWhen prompted unselect all desktop and package options *(use mouse with graphical install or spacebar to unselect normal install)*. The base install should boot to a terminal as no X Window desktop environment should have been selected.\n\n### Sudo Configuration\n**Note:** When installing if you leave root password blank this should disable the root account and install sudo for the user you create. Otherwise follow the steps below to enable sudo on a selected user account.\n\nThe minimal install may mean the `sudo` command may not be installed. The following commands install the sudo package and adds the default (logged in user) to the sudo group.\n\n```terminal\nsu -c 'apt-get update \u0026\u0026 apt-get -y install sudo \u0026\u0026 \\\n/sbin/adduser $USER sudo \u0026\u0026 \\\nexec su -l $USER'\n```\n\nTo undo the above (remove user from group sudo and remove package sudo):\n```terminal\nsu -c 'gpasswd -d $USER sudo \u0026\u0026 \\\napt-get -y remove sudo \u0026\u0026 exec su -l $USER'\n```\n\n### Repository Setup\n\n#### Debian 12 Bookworm - Add contrib non-free\n```terminal\n# Append contrib and non-free to /etc/apt/sources.list\nsudo sed -i '/^deb .* non-free-firmware$/ s/$/ contrib non-free/; /^deb-src .* non-free-firmware$/ s/$/ contrib non-free/' /etc/apt/sources.list\nsudo apt update\n```\n\n#### Update Debian\n```terminal\nsudo apt-get update \u0026\u0026 sudo apt-get -y dist-upgrade\n```\n\n#### Fix PATH Issues\nIf `/sbin` is missing from the user $PATH variable, edit `/etc/profile` and append `/sbin` to the second PATH variable.\n\nAlternative direct path usage:\n```terminal\nsudo /sbin/reboot\nsudo /sbin/halt\nsudo /sbin/shutdown\n```\n\nAlternative systemctl commands:\n```terminal\nsudo systemctl reboot\nsudo systemctl halt\nsudo systemctl poweroff\n```\n\n### Desktop Environment Installation\n\n#### Install GNOME (Core Only)\n```terminal\nsudo apt-get -y install gnome-core\n```\n\n#### Install XFCE\n```terminal\nsudo apt-get -y install xserver-xorg xfce4 xfce4-goodies\n```\n\n### Boot Target Configuration\n\n#### Check Current Boot Environment\n```terminal\nsudo systemctl get-default\n```\n\n#### Set Graphical Boot\n```terminal\nsudo systemctl set-default graphical.target\n```\n\n#### Set Console Boot\n```terminal\nsudo systemctl set-default multi-user.target\n```\n\n---\n\n## Security \u0026 Networking\n\n### SSH Server Setup\n```terminal\nsudo apt-get -y install openssh-server\n```\n\n### SSH Key Management\nBackup and regenerate SSH server keys:\n\n```terminal\nsudo mkdir /etc/ssh/backup_keys \u0026\u0026 \\\nsudo mv /etc/ssh/ssh_host_* /etc/ssh/backup_keys \u0026\u0026 \\\nsudo dpkg-reconfigure openssh-server\n```\n\n### Network Configuration\n\n#### Show Active Ports and Processes\n```terminal\n# Command switches [a] all, [t] TCP, [u] UDP, [l] listening, [p] process, [n] numeric \n# Using netstat command\nnetstat -laptun\n\n# Using ss command\nss -laptun\n\n# Resolve IP addresses\nss -laptur\n```\n\n#### IPv6 Disable\n```terminal\nsudo nano /etc/sysctl.conf\n```\nAdd the following line to `sysctl.conf`:\n`net.ipv6.conf.all.disable_ipv6 = 1`\n*Change all to interface adapter name for individual interfaces*\nRun `sudo sysctl -p` to execute changes\n\n### GPG Encryption\n\n#### Generate New Key\n```terminal\ngpg --full-generate-key\n\n# Select default key RSA and RSA\n# Increase key security/length to 4096\n# Set key expiry 0 = Does not expire\n# Enter user details\n# Enter complex pass phrase\n```\n\n#### List Keys\n- List public keys: `gpg --list-public-keys`\n- List private keys: `gpg --list-secret-keys`\n\n#### Encrypt/Decrypt Files\n```terminal\n# Encrypt a file\ngpg --encrypt --output encryptedfilename.gpg --recipient someemail@email.net filenametoencrypt\n\n# Decrypt a file\ngpg --decrypt --output decryptedfilename.txt encryptedfilename.gpg\n# Enter private key pass phrase\n```\n\n---\n\n## Shell \u0026 Terminal\n\n### ZSH Installation\n```terminal\nsudo apt-get -y install zsh\n```\n\n### OhMyZsh Setup\n```terminal\nsh -c \"$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)\"\ngit clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting\ngit clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions\n```\n\n#### Edit `~/.zshrc`\nUpdate plugin section:\n```terminal\nplugins=(\n    git\n    zsh-autosuggestions\n    zsh-syntax-highlighting\n)\n```\n\n### Custom Prompt Configuration\nExample `.zshrc` with custom prompt that supports Python virtual environments (venv and conda):\n\n**Example prompt (colored):**\n```terminal\n┌──(conda_base)─(user@hostname)-[/dirpath]\n└─$ \n```\n\n#### Complete .zshrc Configuration\n```terminal\nexport PATH=$HOME/bin:/usr/local/bin:$PATH\nexport ZSH=\"$HOME/.oh-my-zsh\"\nexport CONDA_PATH=\"$HOME/miniconda3\"\nZSH_THEME=\"robbyrussell\"\n\nplugins=(\n    git\n    zsh-autosuggestions\n    zsh-syntax-highlighting\n)\n\nsource $ZSH/oh-my-zsh.sh\nexport CONDA_CHANGEPS1=false\n\n# \u003e\u003e\u003e conda initialize \u003e\u003e\u003e\n__conda_setup=\"$('$CONDA_PATH/bin/conda' 'shell.zsh' 'hook' 2\u003e /dev/null)\"\nif [ $? -eq 0 ]; then\n    eval \"$__conda_setup\"\nelse\n    if [ -f \"$CONDA_PATH/etc/profile.d/conda.sh\" ]; then\n        . \"$CONDA_PATH/etc/profile.d/conda.sh\"\n    else\n        export PATH=\"$CONDA_PATH/miniconda3/bin:$PATH\"\n    fi\nfi\nunset __conda_setup\n# \u003c\u003c\u003c conda initialize \u003c\u003c\u003c\n\nNEWLINE_BEFORE_PROMPT=yes\n\nprecmd() {\n    # Print a new line before the prompt, but only if it is not the first line\n    if [ \"$NEWLINE_BEFORE_PROMPT\" = yes ]; then\n        if [ -z \"$_NEW_LINE_BEFORE_PROMPT\" ]; then\n            _NEW_LINE_BEFORE_PROMPT=1\n        else\n            print \"\"\n        fi\n    fi\n}\n\nprompt_symbol=@\n\n# Modify the PROMPT variable to include conda env\nprompt_symbol='%F{white}'$prompt_symbol'%F{blue}'\n\n# Function to update the prompt\nupdate_prompt() {\n    local prompt_symbol='%F{white}'$prompt_symbol'%F{blue}'\n    local conda_env_name=''\n    local env_name=''\n\n    if [[ -n $VIRTUAL_ENV ]]; then\n        env_name=$(basename \"$VIRTUAL_ENV\")\n    fi\n\n    if [[ -n $CONDA_DEFAULT_ENV ]]; then\n        conda_env_name=$(basename \"$CONDA_DEFAULT_ENV\")\n    fi\n\n    # Add conditional for different shells\n    if [[ $SHELL == *\"zsh\"* ]]; then\n        PROMPT=\"%F{blue}┌──${debian_chroot:+($debian_chroot)─}${env_name:+(venv_$env_name)─}${conda_env_name:+(conda_$conda_env_name)─}(%B%F{%(#.red.green)}%n$prompt_symbol%m%b%F{blue})-[%B%F{reset}%~%b%F{blue}]\n%F{blue}└─%B%(#.%F{red}#.%F{cyan}$)%b%F{reset} \"\n    elif [[ $SHELL == *\"bash\"* ]]; then\n        PS1=\"\\[\\e[34m\\]┌──${debian_chroot:+($debian_chroot)─}${env_name:+(venv_$env_name)─}${conda_env_name:+(conda_$conda_env_name)─}\\[\\e[m\\]\\[\\e[1m\\]\\[\\e[38;5;$(( $(id -u) == 0 ? 1 : 2 ))m\\]\\u$prompt_symbol\\h\\[\\e[m\\]\\[\\e[34m\\]\\]-[\\[\\e[m\\]\\[\\e[1m\\]\\[\\e[0m\\]\\w\\[\\e[m\\]\\[\\e[34m\\]\\]\n\\[\\e[34m\\]└─\\[\\e[m\\]\\[\\e[1m\\]\\[\\e[38;5;$(( $(id -u) == 0 ? 1 : 6 ))m\\]#\\[\\e[m\\]\\[\\e[1m\\]\\[\\e[0m\\] \"\n    fi\n}\n\n# Call the update_prompt function initially\nupdate_prompt\n\n# Function to update the prompt when the command is executed\nif [[ $SHELL == *\"zsh\"* ]]; then\n    precmd_functions+=(update_prompt)\nelif [[ $SHELL == *\"bash\"* ]]; then\n    PROMPT_COMMAND=update_prompt\nfi\n\n# Adjust path if required. Example below is for when Go was installed.\nexport PATH=/usr/local/go/bin:$PATH\n```\n\n#### Change Default Shell to ZSH\n```terminal\nchsh -s $(which zsh)\n```\n\n#### Load Existing .profile with ZSH\nEdit `~/.zshrc` and append:\n```terminal\n[[ -e ~/.profile ]] \u0026\u0026 emulate sh -c 'source ~/.profile'\n```\n\n#### Check Current Shell\n```terminal\nps -p $$\n```\n\n---\n\n## Virtualization Tools\n\n### Install QEMU/KVM\n\n```terminal\n# Initial packages includes filesystem sharing and bridge interface utilities\nsudo apt install qemu-system-x86 libvirt-daemon-system virtinst virt-manager virt-viewer ovmf swtpm qemu-utils guestfs-tools libosinfo-bin tuned virtiofsd bridge-utils\n# Enable services and autostart on reboot\nsudo systemctl enable libvirtd.service\nsudo systemctl start libvirtd.service\nsudo systemctl enable tuned\nsudo systemctl start tuned\nsudo tuned-adm profile virtual-host\nsudo virsh net-start default\nsudo virsh net-autostart default\n```\n\n### QEMU/KVM Download Virtio drivers (ISO)\n[Fedora VirtIO Drivers and ISO](https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-virtio/?C=M;O=D)\n\n### Enabled Bridge Interface for QEMU/KVM (allows VMs to use IP from local network, not NAT)\nEdit `/etc/network/interfaces`\n```terminal\n# Example only of what /etc/network/interfaces should look like\ncat /etc/network/interfaces\n# This file describes the network interfaces available on your system\n# and how to activate them. For more information, see interfaces(5).\n\nsource /etc/network/interfaces.d/*\n\n# The loopback network interface\nauto lo\niface lo inet loopback\n\n# Primay network interface with bridge\nauto br0\niface br0 inet static\n  # This is the VM server host ip details, check using ip addr command\n\taddress 192.168.1.36\n\tbroadcast 192.168.1.255\n\tnetmask 255.255.255.0\n\tgateway 192.168.1.1\n\n  # This is the bridged network interface ID on the VM host, use ip addr command to check.\n\tbridge_ports enp0s31f0\n\tbridge_stp off\n\tbridge_waitport 0\n\tbridge fd 0\n```\nAfter making changes restart the networking service\n`sudo systemctl restart networking.service`\n\nIn Virtual Machine Manager, in the VM config select virtual network interface and change source to `Bridge device...` type in the Device name set in interfaces config example `br0`\n\n\n## Development Tools\n\n### Docker Installation\n```terminal\n# Remove any older versions\nfor pkg in docker.io docker-doc docker-compose podman-docker containerd runc; do sudo apt-get remove $pkg; done\n\n# Setup repo and add official Docker GPG key\nsudo apt-get update\nsudo apt-get install ca-certificates curl gnupg\nsudo install -m 0755 -d /etc/apt/keyrings\ncurl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg\nsudo chmod a+r /etc/apt/keyrings/docker.gpg\necho \\\n  \"deb [arch=\"$(dpkg --print-architecture)\" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \\\n  \"$(. /etc/os-release \u0026\u0026 echo \"$VERSION_CODENAME\")\" stable\" | \\\n  sudo tee /etc/apt/sources.list.d/docker.list \u003e /dev/null\nsudo apt-get update\n\n# Install latest version\nsudo apt-get install docker-ce docker-compose docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin\n\n# If required add docker group and current user to docker group\nif ! getent group docker \u003e /dev/null; then sudo groupadd docker; fi\nsudo usermod -aG docker $USER\nnewgrp docker\n\n# Verify installation and that the user has permissions to run docker by running hello-world image\ndocker run hello-world\n```\n\n### Go Language Installation\nScript to install latest Linux Go version:\n\n```terminal\n#!/bin/bash\n\n# Function to check if the script is running as root\ncheck_root() {\n    if [[ $EUID -ne 0 ]]; then\n        echo \"This script must be run as root.\" \u003e\u00262\n        exit 1\n    fi\n}\n\n# Function to download a file\nfunction download_file() {\n    local dst_file=${1}\n    local src_url=${2}\n\n    # Check if the source URL is blank\n    if [[ -z ${src_url} ]]; then\n        echo \"Unable to get the latest application source URL. The application source URL may have changed or moved.\"\n        exit 1\n    fi\n\n    echo \"Downloading file...\"\n    echo \"SRC: ${src_url}\"\n    echo \"DEST: ${dst_file}\"\n\n    # Check if the source URL is valid\n    if [[ ! ${src_url} =~ ^(http|https|ftp):// ]]; then\n        echo \"Invalid source URL. Only URLs starting with 'http://', 'https://', or 'ftp://' are supported.\"\n        exit 1\n    fi\n\n    if wget --user-agent=Mozilla --content-disposition -c -E -O \\\n    \"${dst_file}\" \"${src_url}\" -q --show-progress --progress=bar:force 2\u003e\u00261; then\n        echo\n        echo \"File successfully downloaded.\"\n    else\n        echo \"There was a problem downloading the file. Trying another method...\"\n        echo \"Trying wget without resume option...\"\n        if wget --user-agent=Mozilla --content-disposition -E -O \\\n            \"${dst_file}\" \"${src_url}\" -q --show-progress --progress=bar:force 2\u003e\u00261; then\n            echo\n            echo \"File successfully downloaded.\"\n        elif curl -L -J \"${src_url}\" -o \"${dst_file}\" --progress-bar; then\n            echo\n            echo \"File successfully downloaded.\"\n        else\n            echo \"There was a problem downloading the file. Check URL and source file.\"\n            exit 1\n        fi\n    fi\n}\n\n# Check if the script is run as root\ncheck_root\n\n# Variables for download\nfrom_url=\"https://go.dev$(curl -s https://go.dev/dl/ | \\\n        grep linux | grep $(dpkg --print-architecture) -A 0 | sed -r 's/.*href=\"([^\"]+).*/\\1/g' | awk 'NR==1')\"\nsave_file=\"/tmp/golang.tar.gz\"\n\n# Download the file\ndownload_file ${save_file} ${from_url}\n\n# Extract the downloaded file\nrm -rf /usr/local/go \u0026\u0026 tar -C /usr/local -xzf ${save_file}\n\n# Remove temp save file\nrm ${save_file}\n\n# Run go version and display the output\n/usr/local/go/bin/go version\n```\n\n---\n\n## System Administration\n\n### Helpful Commands\n\n#### User and Group Management\n```terminal\n# Show user accounts and groups\ncat /etc/passwd\n\n# Show user shadow password file and hashes\nsudo cat /etc/shadow\n\n# Show user sudoers privileges\nsudo cat /etc/sudoers\n\n# List users in sudo group\ncat /etc/group | grep 'sudo'\n\n# Edit sudo (must be root to run visudo) su to root\nvisudo\n```\n\n#### Network Information\n```terminal\n# List network interface details\nip a\nifconfig\n\n# List network address including MAC\nip n\narp -a\n\n# List wireless details\niwconfig\n\n# Show route (routing table)\nip r\nroute\n```\n\n#### Network Monitoring\n```terminal\n# Show open network ports related programs/services\nsudo netstat -tulpan\n\n# Continuously watch for `ESTABLISHED` connections (update every 3 seconds) \nsudo watch -n 3 \"netstat -tulpan | grep ESTABLISHED\"\n```\n\n#### Curl with SSL Bypass\n```terminal\n# curl ignore SSL certificate errors and follow redirects including 301\ncurl -kL https://address\n```\n\n#### Scheduled Tasks\n```terminal\n# List cron jobs\ncrontab -l\n\n# List root user cron jobs\ncrontab -u root -l\n\n# List timers that a loaded to run\nsystemctl list-timers\n```\n\n### Log Monitoring\n```terminal\n# Monitor log events -f --follow show only the most recent\nsudo journalctl -f\n\n# View all logs for sudo\nsudo journalctl -e /usr/bin/sudo\n```\n\n### Power Management (Advanced)\n\n#### Disable Suspend/Hibernate\n```terminal\n# Disable sleep suspect on laptop lid close, will take affect upon next reboot.\nsudo sed -i '/\\[Login\\]/a HandleLidSwitch=ignore\\nHandleLidSwitchDocked=ignore' /etc/systemd/logind.conf\n\n# Disable sleep, suspect, hibernate\nsudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target\n\n# Check status sleep, suspect, hibernate\nsudo systemctl status sleep.target suspend.target hibernate.target hybrid-sleep.target\n\n# Enable sleep, suspect, hibernate\nsudo systemctl unmask sleep.target suspend.target hibernate.target hybrid-sleep.target\n```\n\n### File System Management\n\n#### NFS Mount Management\n```terminal\n# Show offered fileshare mounts\nshowmount -e 192.168.0.10\n# result return ie. /srv/thisdir\n# To mount make local directory to mount fileshare\nmkdir /mnt/thisdir\n# Mount filesystem\nmount -t nfs 192.168.0.10:/srv/nfs /mnt/thisdir\n```\n\n#### Network Interface Management\n```terminal\n# Show full network interface details\nip address show\n\n# Show network interface names only\nip address show | awk '/^[0-9]+:/ {sub(/:$/, \"\", $2); print $2}'\n\n# Show interface names with MAC addresses only\nip address show | awk '/^[0-9]+:/ {interface=$2} /link\\/ether/ {print interface, $2}'\n\n# Show only network interfaces with assigned IP addresses\nip address show | awk '/^[0-9]+:/ {interface=$2} /inet / {print interface, $2}'\n```\n\n#### DHCP Interface Configuration\nChange `enp0s31f6` to the interface name to configure with DHCP.\nExample config `/etc/network/interfaces`:\n\n```terminal\n# This file describes the network interfaces available on your system\n# and how to activate them. For more information, see interfaces(5).\n\nsource /etc/network/interfaces.d/*\n\n# The loopback network interface\nauto lo\niface lo inet loopback\n\n# The ethernet interface to be configured with DHCP\nallow-hotplug enp0s31f6\niface enp0s31f6 inet dhcp\n```\n\nTo bring network interfaces down and up use `ifdown` and `ifup`:\n```terminal\n# Set to down\nsudo ifdown enp0s31f6\n\n# Set to up\nsudo ifup enp0s31f6\n```\n\n### Package Management\n\n#### Enable Snap and Flatpak Support\n- Open \"Software\" application\n- Search in Software application for \"software\"\n- Click \"Software\"\n- Scroll down to Add-ons and select Flatpak and Snap Support\n\n#### Microcode Installation (Debian 11)\n- Open Synaptic Package Manager\n- Search \"microcode\"\n- Install appropriate AMD or Intel microcode\n\n#### Missing Firmware (Debian 11 Bullseye)\nCheck `/etc/apt/sources.list` contains `contrib non-free`, otherwise edit the file:\n\n```terminal\n# If sources.list is missing contrib non-free:\nsudo sed -r -i 's/^deb(.*)$/deb\\1 contrib non-free/g' /etc/apt/sources.list\n\nsudo apt-get update \u0026\u0026 sudo apt-get -y install firmware-misc-nonfree\n\n# If wifi drivers such those in some Intel NUCs are missing try...\nsudo apt-get -y install firmware-iwlwifi\n```\n\n#### Advanced GRUB Configuration\nRemove GRUB timeout, enable splash and disable USB auto suspend power management:\n\n```terminal\n# Edit /etc/default/grub and ensure the the following lines exist\n\nGRUB_DEFAULT=0\nGRUB_TIMEOUT=0\nGRUB_DISTRIBUTOR=`lsb_release -i -s 2\u003e /dev/null || echo Debian`\nGRUB_CMDLINE_LINUX_DEFAULT=\"quiet splash usbcore.autosuspend=-1\"\n\n# Run GRUB update\nsudo update-grub\n\n# Reboot\nsudo reboot\n\n# Check USB power management has been changed to -1\ncat /sys/module/usbcore/parameters/autosuspend\n```\n\n---\n\n## Troubleshooting\n\n### Wayland Issues\n\n#### Fix Debian 13 Trixie GNOME Wayland OpenGL Issue\n**Problem:** \"Could not initialise OpenGL support\"\n\n```terminal\n# edit with vi or nano /etc/environment.d/90atk-adaptor.conf\n# Add line\nGDK_GL=gles\n\n# Save and exit.\n# Reboot system\n```\n\n#### Fix Debian 13 VLC GNOME Wayland Black Screen\n**Problem:** Black screen playing webm and other videos in VLC\n\n**Solution:**\n- Open VLC → Go to Tools \u003e Preferences\n- Select Input / Codecs\n- Change hardware-accelerated decoding to disabled\n\n#### Fix Slow VNC on Raspberry Pi 4\n**Problem:** Slow lagging VNC and VNC resolution issues on headless Raspberry Pi 4\n\n**Solution:** Edit `/boot/config.txt`:\n```terminal\n#### Comment out the following lines\n# Enable DRM VC4 V3D driver\n#dtoverlay=vc4-kms-v3d\n#max_framebuffers=2\n\n#### Uncomment this line\nhdmi_force_hotplug=1\n\n#### Uncomment and modify the following two lines to force higher resolution\n# uncomment to force a specific HDMI mode (this will force VGA)\nhdmi_group=2\nhdmi_mode=82\n```\n\n### Raspberry Pi VNC Issues\n\n#### Fix Slow VNC on Raspberry Pi 4\n**Problem:** Slow lagging VNC and VNC resolution issues on headless Raspberry Pi 4\n\n**Solution:** Edit `/boot/config.txt`:\n```terminal\n#### Comment out the following lines\n# Enable DRM VC4 V3D driver\n#dtoverlay=vc4-kms-v3d\n#max_framebuffers=2\n\n#### Uncomment this line\nhdmi_force_hotplug=1\n\n#### Uncomment and modify the following two lines to force higher resolution\n# uncomment to force a specific HDMI mode (this will force VGA)\nhdmi_group=2\nhdmi_mode=82\n```\n\n### Kernel Update Problems\n\n#### Bad Kernel Update (6.1.0-18) - February 16, 2024\n**Problem:** Issues updating or upgrading packages caused by problems in NVIDIA driver files with 6.1.0.18 kernel.\n\n**Symptoms:**\n```terminal\nBuilding module:\nCleaning build area...\nunset ARCH; env NV_VERBOSE=1 make -j12 modules KERNEL_UNAME=6.1.0-18-amd64..............(bad exit status: 2)\nError! Bad return status for module build on kernel: 6.1.0-18-amd64 (x86_64)\nConsult /var/lib/dkms/nvidia-current/545.23.08/build/make.log for more information.\nError! One or more modules failed to install during autoinstall.\nRefer to previous errors for more information.\ndkms: autoinstall for kernel: 6.1.0-18-amd64 failed!\nrun-parts: /etc/kernel/postinst.d/dkms exited with return code 11\ndpkg: error processing package linux-image-6.1.0-18-amd64 (--configure):\n installed linux-image-6.1.0-18-amd64 package post-installation script subprocess returned error exit status 1\n```\n\n**Additional Problem:** The following commands fail:\n- `sudo apt install --fix-broken`\n- `sudo dpkg --configure -a`\n\n**Solution:** Remove bad update package files:\n```terminal\nsudo apt -y purge linux-image-amd64 linux-headers-amd64 linux-image-6.1.0-18-amd64 linux-headers-6.1.0-18-amd64\nsudo apt -y autoclean\nsudo apt -y autoremove\nsudo rm /var/lib/dpkg/info/linux-image-6.1.0-18*\nsudo rm /var/lib/dpkg/info/linux-headers-6.1.0-18*\nsudo apt -y install --fix-broken\n```\n\n### Network Interface Issues\n\n#### Base Install - Network Commands Not Working\n**Problem:** `ifconfig`, `shutdown`, `reboot`, `halt` and other commands not working.\n\n**Cause:** `/sbin` is missing from the user `$PATH` variable.\n\n**Check current path:**\n- `echo $PATH` or `env | grep PATH`\n\n**Solution 1:** Edit `/etc/profile` file and append `/sbin` to the second PATH variable.\n- Using nano: `sudo nano /etc/profile`\n- Using vi: `sudo vi /etc/profile`\n\n*You may need to logout and back in to initialize the new PATH variables.*\n\n**Solution 2:** Use direct path:\n```terminal\nsudo /sbin/reboot\nsudo /sbin/halt\nsudo /sbin/shutdown\n```\n\n**Solution 3:** Use systemctl commands:\n```terminal\nsudo systemctl reboot\nsudo systemctl halt\nsudo systemctl poweroff\n```\n\n---\n\n## Quick Reference\n\n### Essential First Steps (New Installation)\n1. [Update repositories and install sudo](#sudo-configuration)\n2. [Add contrib non-free repositories](#repository-setup)\n3. [Install common utilities](#common-utilities-and-applications)\n4. [Set up firewall](#firewall-setup-ufw)\n5. [Configure GNOME desktop](#gnome-customization)\n\n### Most Useful Commands\n- **Update system:** `sudo apt-get update \u0026\u0026 sudo apt-get -y dist-upgrade`\n- **Fix broken packages:** `sudo apt-get -y install --fix-broken`\n- **Clean system:** `sudo apt-get -y autoremove \u0026\u0026 sudo apt-get -y autoclean`\n- **Show network info:** `ip a`\n- **Monitor network:** `sudo netstat -tulpan`\n- **Check boot target:** `sudo systemctl get-default`\n\n### Emergency Recovery\n- **Drop to terminal:** `CTRL+ALT+F3`\n- **Return to desktop:** `CTRL+ALT+F1`\n- **Reinstall GNOME:** `sudo apt -y install --reinstall gnome-shell gnome-session`\n- **Reset user config:** Remove `~/.config`, `~/.cache`, `~/.local` directories\n\n---\n\n*This guide covers Debian Linux distributions including Kali, Ubuntu, and PopOS. Always backup important data before making system changes.*\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbradsec%2Fdebnotes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbradsec%2Fdebnotes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbradsec%2Fdebnotes/lists"}