Skip to content

Instantly share code, notes, and snippets.

@nilreml
Last active May 1, 2024 10:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nilreml/28b73ad3c920640b003cf216c27a1c59 to your computer and use it in GitHub Desktop.
Save nilreml/28b73ad3c920640b003cf216c27a1c59 to your computer and use it in GitHub Desktop.
APT mirror:
sed -i -- 's/deb.debian.org/mirror.netcologne.de/g' /etc/apt/sources.list.d/*
APT components:
main contrib non-free non-free-firmware -> see end
APT external repos:
apt install extrepo
sed -i -E "s/# (- (contrib|non-free))/\1/g" /etc/extrepo/config.yaml
apt update
extrepo search [something] (https://salsa.debian.org/extrepo-team/extrepo-data/-/tree/master/repos/debian)
extrepo enable:
vscode
docker-ce
edge
fasttrack: https://salsa.debian.org/extrepo-team/extrepo-data/-/blob/master/repos/debian/fasttrack.yaml
mozilla
node: https://salsa.debian.org/extrepo-team/extrepo-data/-/blob/master/repos/debian/nodesource.yaml
nvidia-container:
https://salsa.debian.org/extrepo-team/extrepo-data/-/commit/e90d33775190dbd70a4783dad02ef4b3c80153b2
https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html#installing-with-apt
onlyoffice-desktopeditors
signal
teamviewer_default:
apt install teamvewer
sudo rm /etc/apt/sources.list.d/teamviewer.list
virtualbox: https://salsa.debian.org/extrepo-team/extrepo-data/-/blob/master/repos/debian/virtualbox.yaml
Pipx:
apt install python3 pipx
pipx ensurepath
pipx completions
register-python-argcomplete pipx | sudo tee /usr/share/bash-completion/completions/pipx
Python virtualenvwrapper:
pipx install virtualenv
pipx install virtualenvwrapper
export WORKON_HOME=$HOME/.virtualenvs
export VIRTUALENVWRAPPER_PYTHON=$HOME/.local/pipx/venvs/virtualenvwrapper/bin/python3.11
source $HOME/.local/pipx/venvs/virtualenvwrapper/bin/virtualenvwrapper.sh
alias workoff=deactivate
Diagnostics:
lspci -k | grep -EA3 'VGA|3D|Display'
lsmod | grep "kms\|drm"
find /dev -group video
cat /proc/cmdline
find /etc/modprobe.d/
cat /etc/modprobe.d/*kms*
ls /etc/X11/xorg.conf
glxinfo | grep -i "vendor\|rendering"
grep LoadModule /var/log/Xorg.0.log
lstopo
Packages:
backports:
linux-image-amd64
linux-headers-amd64
iotop
latencytop
mpv
git-lfs
man-db
qalculate-gtk
Laptops:
powertop
tlp
Logitech:
solaar (backports) https://github.com/pwr-Solaar/Solaar
build-essential dkms firmware-linux
sysfsutils nvme-cli
gvfs-backends gvfs-fuse nfs-common cifs-utils
curl jq ca-certificates
docker-ce docker-compose-plugin
wireguard 7zip
python3 python3-dev
fonts-noto
Nvidia:
nvidia-driver
nvidia-xconfig
cuda-drivers
Pipx packages:
pre-commit
yt-dlp
Change default editor:
sudo update-alternatives --config editor
LightDM auto login:
/etc/lightdm/lightdm.conf.d/10-autologin.conf
[Seat:*]
autologin-user=username
autologin-user-timeout=0
Default systemd timeouts:
/etc/systemd/system.conf
/etc/systemd/user.conf
Allow long-running user services:
loginctl enable-linger [user]
Change username safely:
[[logout]]
exec sudo -i
killall -u [oldname]
id [oldname]
usermod -l [newname] [oldname]
groupmod -n [newname] [oldname]
usermod -d /home/[newname] -m [newname]
usermod -c "[full name (new)]" [newname]
id [newname]
NTP:
ntpq -p
Show mouse params:
xinput list | cut -f2 | cut -f2 -d'=' | \
xargs -d $'\n' -I'{}' sh -c "xinput list-props '{}' | grep -iq scroll && \
(echo Listing dev id '{}'; xinput list-props '{}')"
Show kernel module params:
modinfo -p [module] # explanation
systool -m [module] -av # currently set
Analyze boot time:
systemd-analyze [blame|critical-chain]
Scan ports:
nc -w 1 -vz [ip] [start-port]-[end-port]
Delete duplicate files
fdupes -rdN .
Rust:
https://rustup.rs
Update all cargo tools:
sudo apt install pkg-config libgit2-dev libssh-dev libssl-dev
cargo install cargo-update
cargo install-update -a
Packages:
bottom lsd eza fd-find hyperfine binocle du-dust
GNU find best practices:
https://unix.stackexchange.com/questions/321697/why-is-looping-over-finds-output-bad-practice
APT sources:
debian-stable.sources:
Types: deb deb-src
URIs: https://debian.netcologne.de/debian
Suites: bookworm bookworm-updates
Components: main contrib non-free non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
Types: deb deb-src
URIs: https://security.debian.org/debian-security
Suites: bookworm-security
Components: main contrib non-free non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
debian-backports.sources:
Types: deb deb-src
URIs: https://debian.netcologne.de/debian
Suites: bookworm-backports
Components: main contrib non-free non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
nvidia.sources:
Types: deb
URIs: https://developer.download.nvidia.com/compute/cuda/repos/debian12/x86_64
Suites: /
Signed-By: /usr/share/keyrings/cuda-archive-keyring.gpg
Nvidia offset (under)clock:
nvidia-settings -a [gpu:0]/GPUGraphicsClockOffsetAllPerformanceLevels=-500
rclone systemd mount as user:
https://github.com/nilreml/rclone-mount-systemd
(Re)configure time zone:
dpkg-reconfigure tzdata
Change first day of the week to Monday:
Add en_GB locale:
sudo dpkg-reconfigure locales -> add en_GB.UTF-8 -> select/keep default system locale (e.g. en_US)
Use en_GB locale for time only:
/etc/default/locale -> LC_TIME="en_GB.UTF-8"
logout & login
Only for headless systems like containers:
Keyboard layout:
apt install/dpkg-reconfigure keyboard-configuration -> 27 43 1
Locales:
apt install -y locales
update-locale "LANG=C.UTF-8"
export LANG=C.UTF-8
https://unix.stackexchange.com/questions/87745/what-does-lc-all-c-do/87763#87763
https://stackoverflow.com/questions/59295250/python-default-locale-unsupported-locale-setting/59676852#59676852
Git OAuth (when SSH isn't an option):
apt install -t bookworkm-backports git-credential-oauth
git credential-oauth configure
Patch local .deb archive:
dpkg -x your_package_vesion.deb your_package_folder/
dpkg -e your_package_vesion.deb your_package_folder/DEBIAN
dpkg -b your_package_folder/ new_package_vesion.deb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment