/debian-12

Primary LanguageShellMIT LicenseMIT

Debian 12

1. Add user to sudores

save current user in a temp file and log as root user

echo "$USER" > /tmp/current_user.txt
su - 

then execute this

ORIGINAL_USER=$(cat /tmp/current_user.txt)
sed -i "/^root.*ALL=(ALL:ALL) ALL$/a $ORIGINAL_USER ALL=(ALL) ALL" /etc/sudoers
rm /tmp/current_user.txt
exit

2. Update repositories

update system repositories and run update and upgrade

echo "deb https://deb.debian.org/debian bookworm main contrib non-free non-free-firmware
deb-src https://deb.debian.org/debian bookworm main contrib non-free non-free-firmware

deb https://deb.debian.org/debian-security/ bookworm-security main contrib non-free non-free-firmware
deb-src https://deb.debian.org/debian-security/ bookworm-security main contrib non-free non-free-firmware

deb https://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware
deb-src https://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware

deb https://deb.debian.org/debian bookworm-backports main contrib non-free non-free-firmware
deb-src https://deb.debian.org/debian bookworm-backports main contrib non-free non-free-firmware
"| sudo tee /etc/apt/sources.list > /dev/null && sudo apt update && apt list --upgradable && sudo apt upgrade

3. Install Firmware Wifi (if necessary)

Run this commands to see Wifi network infos

lspci
lsusb

Assuming the wireless card is "Atheros", run this command:

sudo apt install firmware-atheros

and reboot your system.

4. Install NVIDIA drivers

  1. Install the nvidia-driver package, plus the necessary firmware:
sudo apt install nvidia-driver firmware-misc-nonfree

DKMS will build the nvidia module for your system, via the nvidia-kernel-dkms package.

  • Note about Secureboot: if you have SecureBoot enabled, you need to sign the resulting modules. Detailed instructions are available here.
  1. Restart your system to load the new driver.

Links:

5. Install programs

sudo apt install -y terminator htop apache2 xclip snapd chromium flameshot pngquant curl wget

6. Install VPN Plugin

sudo apt install openvpn
sudo apt install network-manager-openvpn

7. Git install and configs

Install Git, Git Flow and Gitk

sudo apt install -y git git-flow gitk

Configure your Git username/email globally

git config --global user.name "FIRST_NAME LAST_NAME"
git config --global user.email "MY_NAME@example.com"

Enable multiples hotfix globally

git config --global gitflow.multi-hotfix true

Disable TAG on finish hotfix globally

git config --global gitflow.hotfix.finish.notag true

Disable automatic conversion of line endings

cd /var/www
git config --global core.autocrlf false

8. Enable syntax highlighting in nano

find /usr/share/nano/ -iname "*.nanorc" -exec echo include {} \; >> ~/.nanorc

9. Complementary softwares

10. Configure snap apps to show in xorg (If Necessary)

sudo ln -s /etc/profile.d/apps-bin-path.sh /etc/X11/Xsession.d/99snap
sudo nano /etc/login.defs

# Paste the following at the end of the file and save:
ENV_PATH PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin

# Log out and log in again to your system

11. Install nvm

See repository instructions to install: https://github.com/nvm-sh/nvm

12. Chrome Flags

Access chrome flags with this url chrome://flags/ and enable this:

  • GPU rasterization
  • Overscroll history navigation
  • Preferred Ozone platform (set Wayland) image

Run this commant to force enable Overscroll history navigation:

sudo sed -ie 's/Exec=\/usr\/bin\/google-chrome-stable %U/Exec=\/usr\/bin\/google-chrome-stable %U --enable-features=TouchpadOverscrollHistoryNavigation/g' /usr/share/applications/google-chrome.desktop

then restart Chrome browser to enable this config

13. ZSH and Oh My Zsh

Install ZSH

sudo apt install zsh -y

ZSH Autocomplete

zsh
autoload -Uz compinit
compinit
_comp_options+=(globdots)

Set as default system interpreter commands

chsh -s $(which zsh)

To rollback chsh -s /bin/bash

Then close and reopen terminal to apply changes.

Install Oh My Zsh

sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

Oh My Zsh - Plugins

Oh My Zsh plugins make it possible to add extra functionality to your shell. There are numerous existing plugins, to check all the possibilities, take a look at the repository Wiki. Check out some of these special plugins below.

Plugin zsh-syntax-highlighting

git clone https://github.com/zsh-users/zsh-syntax-highlighting ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

Plugin zsh-autosuggestions

git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

Plugin fzf

git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf && ~/.fzf/install

Enable plugins

nano ~/.zshrc

and edit plugins to this:

plugins=(
  git
  zsh-syntax-highlighting
  zsh-autosuggestions
  fzf
)

Install fonts by script:

cd /tmp
curl -LO https://raw.githubusercontent.com/jrfernandodasilva/debian-12/main/oh-my-zsh.sh
chmod +x oh-my-zsh.sh 
 ./oh-my-zsh.sh  

Install Powerlevel10k Theme

git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/themes/powerlevel10k 

Chante Theme

nano ~/.zshrc

Find ZSH_THEME="robbyrussell" and change to:

ZSH_THEME="powerlevel10k/powerlevel10k"

#powerlevel19k configuration
POWERLEVEL9K_MODE='awesome-fontconfig'

Then run:

source ~/.zshrc

to load new config.

See

14. Emby

See instructions here

15. Zram

See instructions here or here

Links uteis