Ubuntu 22.04 ============ Disable IPv6 ------------ https://www.linuxbabe.com/ubuntu/disable-ipv6-on-ubuntu Settings Network [gear icon] IPv6 (o) Disable (o) Link-Local Only (if needed) sudo systemctl restart NetworkManager OS Version ---------- uname -a cat /etc/os-release lsb_release -a Software & Updates ------------------ Software & Updates (blue icon) Updates Automatically check for updates: Never Notify me of a new ubuntu version: Never Unistall -------- type which # snap snap list sudo snap remove --purge firefox # apt apt list --installed | grep {app} sudo apt remove --purge firefox sudo apt remove --purge thunderbird sudo apt remove --purge libreoffice-* sudo apt autoremove --purge # removes dependencies no longer used sudo apt clean # erase downloaded archive files sudo apt autoclean # erase old downloaded archive files Updates ------- sudo apt update sudo apt upgrade # snap sudo snap refresh # flatpak # https://flatpak.org/setup/Ubuntu sudo apt install flatpak flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo flatpak update Configs ------- # ~/.bashrc # /etc/bash.bashrc # # https://manpages.ubuntu.com/manpages/jammy/man1/tput.1.html # alias ll='ls -l' alias cls='tput reset' alias uu='sudo apt update && sudo apt upgrade -y' alias ip='ip -color' # ~/.inputrc # /etc/inputrc # # https://askubuntu.com/questions/87061/can-i-make-tab-auto-completion-case-insensitive-in-bash # set completion-ignore-case on # ~/.nanorc # /etc/nanorc # # https://stackoverflow.com/questions/11173769/how-to-make-the-tab-character-4-spaces-instead-of-8-spaces-in-nano # set tabsize 4 set tabstospaces set linenumbers VirtualBox ---------- sudo apt install perl build-essential sudo apt install libxt6 libxmu6 # only server # installation Devices Insert Guest Additions CD image... # run script sudo bash VBoxLinuxAdditions.run sudo adduser $USER vboxsf # screen flickering Log Out click on the name right bottom corner Ubuntu on Xorg Install ------- # usefull tools sudo apt install htop sudo apt install neofetch sudo apt install tmux # wallpapers sudo apt install ubuntu-wallpapers* sudo apt install ubuntu-wallpapers-xenial # ssh sudo apt install openssh-server sudo systemctl enable ssh sudo systemctl start ssh # generate authentication keys ssh-keygen -t rsa -b 4096 ssh-keygen -t ed25519 # copy public key (windows) mkdir ~/.ssh type | ssh @ "cat >> ~/.ssh/authorized_keys" chmod 0600 ~/.ssh/authorized_keys # copy public key (linux) ssh-copy-id -i @ # backup sshd configuration sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak0 # configuration sudo nano /etc/ssh/sshd_config ``` PermitRootLogin no PasswordAuthentication no KbdInteractiveAuthentication no UsePAM no ``` # restart deamon sudo systemctl restart sshd # connect ssh @ -i # git sudo apt install git git-lfs gitk git --version git lfs version gitk # configuration git config --global user.name "{name}" git config --global user.email "{email}" git config --global alias.co checkout git config --global alias.br branch git config --global alias.ci commit git config --global alias.st status git config --global alias.ff "pull --ff-only" git config --global alias.sui "submodule update --init --recursive" git config --global alias.lg "log --oneline" git config --global alias.lg "log --graph --pretty=format:'%Cred%h%Creset %ad %s %C(yellow)%d%Creset %C(bold blue)<%an>%Creset' --date=short" git config --global alias.df difftool git config --global alias.mod "diff --name-only --relative" git config --global alias.fomm "fetch origin master:master" git config --global alias.root "rev-parse --show-toplevel" git config --global alias.ka '!gitk --all&' git config --global pull.ff only git config --global core.editor "nano -w" git config --global init.defaultBranch master git config --global credential.helper store git lfs install # git credential manager # https://github.com/git-ecosystem/git-credential-manager/blob/release/docs/install.md # # Linux # Debian package # Download the latest .deb package # sudo apt install ./gcm-linux_amd64.2.6.0.deb git-credential-manager configure # credential stores # https://github.com/git-ecosystem/git-credential-manager/blob/release/docs/credstores.md # git config --global credential.credentialStore gpg # requires gpg, pass, and a GPG key pair # OR git config --global credential.credentialStore plaintext # python sudo apt install python-is-python3 python3-pip sudo apt install python3.10-venv python --version python3 --version python -m pip --version python -m venv --help # gcc, make sudo apt install build-essential gdb gcc --version gdb --version make --version # network sudo apt install wireshark Should non-superusers be able to capture packets? sudo dpkg-reconfigure wireshark-common sudo adduser $USER wireshark sudo apt install net-tools sudo apt install bridge-utils sudo apt install traceroute # remote desktop (RDP) sudo apt install xrdp # other tools sudo apt install curl sudo apt install shellcheck sudo apt install mc sudo apt install gparted sudo apt install wine64 sudo apt install meld sudo apt install vlc sudo apt install fortune cowsay lolcat sudo apt install cmatrix cmatrix-xfont # google chrome # # Install Google Chrome on Ubuntu # https://itsfoss.com/install-chrome-ubuntu # # Chrome asks for password to unlock keyring on startup # https://askubuntu.com/questions/31786/chrome-asks-for-password-to-unlock-keyring-on-startup # open Chrome # close # rm ~/.local/share/keyrings/* # open Chrome again # leave blank, continue, continue # wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb sudo apt install ./google-chrome-stable_current_amd64.deb # vscode # # Download Visual Studio Code # https://code.visualstudio.com/download # wget --trust-server-names https://update.code.visualstudio.com/latest/linux-deb-x64/stable sudo apt install ./ # vscode themes # - Dark (Visual Studio) # - Dark (Visual Studio - C/C++) # - GitHub Dark # vscode extensions # - Remote - SSH (Command Pallete: remote install) # - Python # - Markdown All in One # - C/C++ Extension Pack # * C++ # * C++ Themes # * CMake # * CMake Tools # # - Makefile Tools # - Doxygen Documentation Generator # - PRACTICE # - Hex Editor # - XML (Red Hat) # # - Git Extension Pack (Don Jayamanne) # * Git History (git log) # * Project Manager # * GitLens # * gitignore # * Open in GitHub / Bitbucket / VisualStudio.com # - Jinja Extension Pack (Sugato Ray) # * Python # * Jinja # * BetterJinja # * Visual Studio IntelliCode # * Python Docstring Generator # x Python Preview # # - PlatformIO IDE # sublime # # Download # https://www.sublimetext.com/download # direct downloads # 64 bit .deb # zoom # # Download Center # https://zoom.us/download # docker # # Install Docker Engine on Ubuntu # https://docs.docker.com/engine/install/ubuntu/#install-using-the-convenience-script curl -fsSL https://get.docker.com -o get-docker.sh sudo sh get-docker.sh --dry-run sudo sh get-docker.sh sudo docker run hello-world Applications ------------ Additional Drivers Language Support Settings -------- Background Appearance Size [Normal] Position of New Icons [Top Left] Show Personal folder [OFF] Region & Language Language English (United States) / Čeština (Česko) Formats Česko --- [Manage Installed Languages] Language English (United States) English čeština (přesunout na první místo) [Apply System-Wide] Regional Formats čestina [Apply System-Wide] Keyboard Input Sources English (US) [+] Czech Keyboard Shortcuts Settings (Super + I) Switch Keyboard Input (Alt+Shift) gsettings set org.gnome.desktop.wm.keybindings switch-input-source "['Shift_L']" gsettings set org.gnome.desktop.wm.keybindings switch-input-source-backward "@as []" Finish line ----------- clean "Download" folder links in favorites sudo apt autoremove --purge -------------------------------------------------------------------------------- Bridge ``` sudo ip link add br0 type bridge sudo ip link set br0 up ``` Dummy interface ``` sudo ip link add dummy0 type dummy sudo ip link set dummy0 up ``` Virtual CAN ``` sudo modprobe vcan sudo ip link add vcan0 type vcan sudo ip link set vcan0 up ``` -------------------------------------------------------------------------------- Desktop on an Ubuntu Server --------------------------- F1 help F2 shell ---- F2 ip -c a ---- sudo apt update sudo apt upgrade sudo snap refresh reboot ---- sudo apt install ubuntu-desktop-minimal /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg ``` network: config: disabled ``` /etc/netplan/01-network-manager-all.yaml ``` # Let NetworkManager manage all devices on this system network: version: 2 renderer: NetworkManager ``` sudo chmod 0600 /etc/netplan/01-network-manager-all.yaml sudo netplan generate sudo systemctl disable systemd-networkd reboot Netplan config generated by cloud-init -------------------------------------- /etc/netplan/50-cloud-init.yaml ``` # This file is generated from information provided by the datasource. Changes # to it will not persist across an instance reboot. To disable cloud-init's # network configuration capabilities, write a file # /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following: # network: {config: disabled} network: ethernets: enp0s3: dhcp4: true version: 2 ``` -------------------------------------------------------------------------------- Auto-mount ---------- run 'Disks' choose disk choose partition Additional partition options (gear icon) Edit Mount Options... [ ] User Session Defaults [ ] Mount at system startup # make symlink to mount point ln -s {mount_point} {link_name} ---- sudo mkdir /media/win-ntfs sudo fdisk -l sudo blkid cat /etc/fstab # fat32 (during installation) UUID=xxxxxx /media/win-fat32 vfat utf8,umask=007,gid=46 0 1 # ntfs (during installation) UUID=xxxxxx /media/win-ntfs ntfs defaults,umask=007,gid=46 0 0 # test if everything is ok # do NOT restart the computer if an error pops up, boot might not run properly sudo mount -a Time Windows-Linux Dual Boot ---------------------------- https://itsfoss.com/wrong-time-dual-boot/ timedatectl set-local-rtc 1 Microsoft TrueType Fonts ------------------------ https://itsfoss.com/install-microsoft-fonts-ubuntu/ # installation sudo add-apt-repository multiverse sudo apt update sudo apt install ttf-mscorefonts-installer # update font cache sudo fc-cache -f -v # reinstallation (in case you accidentally reject the license agreement) sudo apt reinstall ttf-mscorefonts-installer