{"id":22744123,"url":"https://github.com/mehradi-github/ref-ubuntu","last_synced_at":"2026-04-28T22:31:26.831Z","repository":{"id":165390196,"uuid":"640735923","full_name":"mehradi-github/ref-ubuntu","owner":"mehradi-github","description":"Tips to do on fresh install of ubuntu desktop","archived":false,"fork":false,"pushed_at":"2024-10-22T14:29:23.000Z","size":145,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-05T07:12:04.661Z","etag":null,"topics":["linux","ubuntu"],"latest_commit_sha":null,"homepage":"","language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mehradi-github.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2023-05-15T02:38:09.000Z","updated_at":"2024-10-22T14:30:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"ba86006f-3945-4d36-a38e-752bfb2c50d4","html_url":"https://github.com/mehradi-github/ref-ubuntu","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehradi-github%2Fref-ubuntu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehradi-github%2Fref-ubuntu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehradi-github%2Fref-ubuntu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehradi-github%2Fref-ubuntu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mehradi-github","download_url":"https://codeload.github.com/mehradi-github/ref-ubuntu/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246277351,"owners_count":20751548,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["linux","ubuntu"],"created_at":"2024-12-11T01:39:54.547Z","updated_at":"2026-04-28T22:31:26.823Z","avatar_url":"https://github.com/mehradi-github.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tips to do on fresh install of ubuntu desktop\n\n- [Tips to do on fresh install of ubuntu desktop](#tips-to-do-on-fresh-install-of-ubuntu-desktop)\n  - [Install and upgrade packages](#install-and-upgrade-packages)\n  - [Adding PPA using APT](#adding-ppa-using-apt)\n  - [Installing Git](#installing-git)\n    - [Clone a subdirectory only](#clone-a-subdirectory-only)\n  - [Installing necessary packages](#installing-necessary-packages)\n  - [Installing flatpak](#installing-flatpak)\n  - [Changing TimeOut in GRUB](#changing-timeout-in-grub)\n  - [Installing cobang,uget](#installing-cobanguget)\n  - [Installing WineHQ](#installing-winehq)\n  - [Customize Dock Panel on Ubuntu](#customize-dock-panel-on-ubuntu)\n  - [Repairing boot after install windows](#repairing-boot-after-install-windows)\n  - [Adding swap after system installation](#adding-swap-after-system-installation)\n  - [Enabling AppImage Support in Ubuntu](#enabling-appimage-support-in-ubuntu)\n  - [Installing rar/unrar](#installing-rarunrar)\n  - [Installing zip/unzip](#installing-zipunzip)\n  - [Installing tar](#installing-tar)\n  - [Installing Qv2ray](#installing-qv2ray)\n  - [Setting proxy on sudo](#setting-proxy-on-sudo)\n  - [Setting proxy on NPM](#setting-proxy-on-npm)\n  - [Installing pnpm](#installing-pnpm)\n  - [Installing V2raya](#installing-v2raya)\n  - [Enabling wayland](#enabling-wayland)\n  - [Installing Waydroid](#installing-waydroid)\n  - [Installing Microsoft fonts](#installing-microsoft-fonts)\n  - [Installing Docker](#installing-docker)\n  - [Setting proxy on Docker](#setting-proxy-on-docker)\n  - [Backup / Export Docker Image](#backup--export-docker-image)\n  - [Installing Vscode](#installing-vscode)\n  - [Installing Bing wallpaper](#installing-bing-wallpaper)\n  - [Installing Pomodoro](#installing-pomodoro)\n  - [Fixing error: download is performed unsandboxed as root...](#fixing-error-download-is-performed-unsandboxed-as-root)\n  - [Instaling TLP](#instaling-tlp)\n  - [Forwarding all traffic from ssh (sshuttle)](#forwarding-all-traffic-from-ssh-sshuttle)\n  - [Installing Minikube](#installing-minikube)\n  - [Installing MicroK8s](#installing-microk8s)\n  - [Install inside virtual environment:](#install-inside-virtual-environment)\n  - [Installing Brave browser](#installing-brave-browser)\n  - [Installing Node.js LTS via binary archive](#installing-nodejs-lts-via-binary-archive)\n    - [nvm Commands](#nvm-commands)\n  - [Tips](#tips)\n  - [Modifing style properties of GNOME Shell themes](#modifing-style-properties-of-gnome-shell-themes)\n    - [Generating custom theme and changing panel background color](#generating-custom-theme-and-changing-panel-background-color)\n    - [Extracting original CSS file as a reference](#extracting-original-css-file-as-a-reference)\n  - [Zsh](#zsh)\n    - [Oh my zsh](#oh-my-zsh)\n    - [Adding JAVA\\_HOME to PATH](#adding-java_home-to-path)\n  - [Changing Defualt Shell](#changing-defualt-shell)\n  - [Remount filesystem in the read-write mode](#remount-filesystem-in-the-read-write-mode)\n  - [InstallIng All Essential Media Codecs](#installing-all-essential-media-codecs)\n  - [Installing Jenkins](#installing-jenkins)\n  - [Managing startup applications](#managing-startup-applications)\n  - [Encryption/decryption via GPG](#encryptiondecryption-via-gpg)\n  - [How to Back Up and Restore Your GPG Keys](#how-to-back-up-and-restore-your-gpg-keys)\n  - [Using VeraCrypt encrypted volumes](#using-veracrypt-encrypted-volumes)\n  - [KeePassXC](#keepassxc)\n  - [Encrypting google drive with rclone](#encrypting-google-drive-with-rclone)\n    - [Docker installation](#docker-installation)\n      - [Uninstall Docker Engine](#uninstall-docker-engine)\n    - [Docker backup and restore images](#docker-backup-and-restore-images)\n    - [Source installation](#source-installation)\n  - [Add an SSH fingerprint to your known\\_hosts file](#add-an-ssh-fingerprint-to-your-known_hosts-file)\n    - [Generate an SSH key pair](#generate-an-ssh-key-pair)\n    - [Update your SSH key passphrase](#update-your-ssh-key-passphrase)\n    - [check your SSH key fingerprint](#check-your-ssh-key-fingerprint)\n  - [Create a new and push in Git repository](#create-a-new-and-push-in-git-repository)\n    - [Git global setup](#git-global-setup)\n    - [Create a new repository](#create-a-new-repository)\n    - [Push an existing folder](#push-an-existing-folder)\n    - [Push an existing Git repository](#push-an-existing-git-repository)\n  - [Installing Microsoft Edge](#installing-microsoft-edge)\n  - [Install Xfce VNC remote desktop on Ubuntu](#install-xfce-vnc-remote-desktop-on-ubuntu)\n\n## Install and upgrade packages\n\n```sh\n# Installing package\nsudo apt install ppp\n# Checking upgradable list of packages\nsudo apt list --upgradable\n# Updating only on package\nsudo apt --only-upgrade install ppp\n\n# Find and display the installed packages on your system\napt list --installed | grep -i \"package-name\"\n\napt list -a \u003cpackage_name\u003e\n\n\nman apt\n```\n\n## Adding PPA using APT\n\n```sh\n# Add\nsudo add-apt-repository ppa:PPA_Name/ppa\n\n# Remove\nsudo add-apt-repository --remove ppa:PPA_Name/ppa\n# OR\nsudo rm -i /etc/apt/sources.list.d/PPA_Name.list\n```\n\n## Installing Git\n\n```sh\nsudo apt update \u0026\u0026 sudo apt upgrade\nsudo apt install git\ngit config --global user.email \"you@example.com\"\ngit config --global user.name \"Your Name\"\n\n# Set proxy for git\ngit config --global http.proxy http://192.168.1.34:8889/\n\ngit config --global http.https://domain.com.proxy http://proxyUsername:proxyPassword@proxy.server.com:port\n# Which will result in the following in the ~/.gitconfig file:\n\n[http]\n[http \"https://domain.com\"]\n\tproxy = http://proxyUsername:proxyPassword@proxy.server.com:port\n\n# changing .gitignore and remove cache\ngit rm -r --cached .\n\n```\n### Clone a subdirectory only\n```sh \ngit clone --depth 1 --no-checkout git@github.com:mui/material-ui.git\nsparse-checkout set packages/mui-material/src\ngit checkout\n```\n\n## Installing necessary packages\n\n```sh\nsudo apt install vim curl wget net-tools\n```\n\n## Installing flatpak\n\n```sh\nsudo apt install flatpak\nflatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo\nflatpak remotes\n# Installing bottles\nflatpak install flathub com.usebottles.bottles\nflatpak run com.usebottles.bottles\n```\n\n## Changing TimeOut in GRUB\n\n```sh\nsudo vi /etc/default/grub\n# Change lines\nGRUB_TIMEOUT_STYLE=menu\nGRUB_TIMEOUT=3\n\nsudo update-grub\n\n```\n## Installing cobang,uget\n```sh\nsudo add-apt-repository ppa:ng-hong-quan/ppa\nsudo apt update\nsudo apt install cobang\n\nsudo add-apt-repository ppa:plushuang-tw/uget-stable\nsudo apt-get update\nsudo apt install uget\n\n```\n## Installing WineHQ\n[Wine](https://wiki.winehq.org/Ubuntu) enables Linux, Mac, FreeBSD, and Solaris users to run Windows applications without a copy of Microsoft Windows. Wine is free software under constant development. Other platforms may benefit as well.\n```sh\nsudo mkdir -pm755 /etc/apt/keyrings\nsudo wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key\nsudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/noble/winehq-noble.sources\nsudo apt update\n\t\nsudo apt install --install-recommends winehq-stable\n```\n## Customize Dock Panel on Ubuntu\n```sh\nsudo apt install dconf-editor\n\ndconf-editor\n\n/org/gnome/shell/extensions/dash-to-dock/\nclick-action: focus-minimize-or-appspread\nshow-mounts: false\n```\n## Repairing boot after install windows\n\n[Boot-Repair](https://help.ubuntu.com/community/Boot-Repair) is a simple tool to repair frequent boot issues you may encounter in Ubuntu like when you can't boot Ubuntu after installing Windows or another Linux distribution, or when you can't boot Windows after installing Ubuntu, or when GRUB is not displayed anymore, some upgrade breaks GRUB, etc.\n\n```sh\n# Ubuntu live-USB\nsudo add-apt-repository ppa:yannubuntu/boot-repair \u0026\u0026 sudo apt update\nsudo apt install -y boot-repair \u0026\u0026 boot-repair\n\n# login windows and run cmd\nbcdedit /set {bootmgr} path \\EFI\\ubuntu\\grubx64.efi\n\n```\n\n## Adding swap after system installation\n\n```sh\n# Adding partion's UUID in file\nsudo vi /etc/fstab\n\n# Example for find UUID\nsudo blkid /dev/sbd6\n\n```\n\n## Enabling AppImage Support in Ubuntu\n\n```sh\nsudo apt install libfuse2\n```\n\n## Installing rar/unrar\n\n```sh\nsudo apt install rar unrar\n\n# Creating RAR Files with setting password\nrar a -p filename.rar filename1\nrar a -p dir.rar dir1\n\n\n\n# Extract a .rar extension file in specific path\nunrar  e filename.rar /home/\n\n# Extract a .rar extension file in their original directory\nunrar x filename.rar\n\n# Testing a RAR File\nunrar t filename.rar\n\n# More Details\nman unrar\nman rar\n\n```\n\n## Installing zip/unzip\n\n```sh\nsudo apt install zip unzip\n\n#Adding multiple files and directories in the same archive\nzip -r archivename.zip directory_name1 directory_name2 file1 file1\n# Creating a password protected ZIP file\nzip -e  archivename.zip directory_name\n# Creating Split Zip File, k (kilobytes), m (megabytes), g (gigabytes), or t (terabytes)\nzip -s 1g -r archivename.zip directory_name\n\n# Unzip a password-protected zip file to a different directory\nunzip -P PasswOrd filename.zip -d /path/to/directory\n```\n\n## Installing tar\n\n```sh\nsudo apt install tar\n# Compress Files\ntar -czvf logs_archive.tar.gz *\n\n# Extract from a compressed file\ntar -xzvf logs_archive.tar.gz -C ./log\ntar -xJvf logs_archive.tar.xz -C ./log\n```\n\n## Installing [Qv2ray](https://github.com/Qv2ray/Qv2ray)\n\n- Download [Qv2ray-v2.7.0-linux-x64.AppImage ](https://github.com/Qv2ray/Qv2ray/releases/download/v2.7.0/Qv2ray-v2.7.0-linux-x64.AppImage).\n- Download [v2ray](https://github.com/v2fly/v2ray-core) then rename to vcore and place in `~/.config/qv2ray/`.\n- Download [QvPlugin-Trojan](https://github.com/Qv2ray/QvPlugin-Trojan/releases) and place in `~/.config/qv2ray/plugins`.\n\n```sh\nsudo chmod u+x Qv2ray-v2.7.0-linux-x64.AppImage\n./Qv2ray-v2.7.0-linux-x64.AppImage\n\nprintenv | grep -i proxy\n# no_proxy=localhost,127.0.0.0/8,::1\n# ftp_proxy=http://127.0.0.1:8889/\n# https_proxy=http://127.0.0.1:8889/\n# NO_PROXY=localhost,127.0.0.0/8,::1\n# FTP_PROXY=http://127.0.0.1:8889/\n# HTTPS_PROXY=http://127.0.0.1:8889/\n# HTTP_PROXY=http://127.0.0.1:8889/\n# http_proxy=http://127.0.0.1:8889/\n# ALL_PROXY=socks://127.0.0.1:1089/\n# all_proxy=socks://127.0.0.1:1089/\n```\n\n## Setting proxy on sudo\n\n```sh\nsudo visudo -f /etc/sudoers.d/NAME\n# Add to file NAME\nDefaults env_keep += \"no_proxy NO_PROXY http_proxy HTTP_PROXY https_proxy HTTPS_PROXY ftp_proxy FTP_PROXY all_proxy ALL_PROXY\"\n\n. ~/.bashrc\n\n# manual set var\nexport all_proxy=socks5://127.0.0.1:20170/\nexport ALL_PROXY=socks5://127.0.0.1:20170/\n# manual unset var\nunset all_proxy \u0026\u0026 unset ALL_PROXY\n```\n\n## Setting proxy on NPM\n\n```sh\nnpm config set proxy http://username:password@host:port\nnpm config set https-proxy http://username:password@host:port\n# example\nnpm config set proxy http://127.0.0.1:8889/\nnpm config set https-proxy http://127.0.0.1:8889/\n# Or you can edit directly your ~/.npmrc file:\nproxy=http://127.0.0.1:8889/\nhttps-proxy=http://127.0.0.1:8889/\n\n```\n\n## Installing pnpm\n\n```sh\nsudo chown -R root:$(whoami) /usr/local/lib/node_modules/\nsudo chmod -R 775 /usr/local/lib/node_modules/\n\ncorepack enable\ncorepack prepare pnpm@latest --activate\n```\n\n## Installing [V2raya](https://v2raya.org/en/docs/prologue/installation/debian/)\n\n```sh\nwget -qO - https://apt.v2raya.org/key/public-key.asc | sudo tee /etc/apt/trusted.gpg.d/v2raya.asc\necho \"deb https://apt.v2raya.org/ v2raya main\" | sudo tee /etc/apt/sources.list.d/v2raya.list\nsudo apt update\nsudo apt install v2raya\nsudo systemctl enable v2raya.service\nsudo systemctl start v2raya.service\n# Showing the list of services are active.\nsystemctl list-units --type=service --state=active\n```\n\n## Enabling wayland\n\n[Wayland](https://wayland.freedesktop.org/)is a replacement for the X11 window system protocol and architecture with the aim to be easier to develop, extend, and maintain.\n\n```sh\nsudo vi /etc/gdm3/custom.conf\nWaylandEnable=true\nsudo systemctl restart gdm3\n\n# The Wayland option was still missing from the login selector\nsudo vi /etc/default/grub\nGRUB_CMDLINE_LINUX_DEFAULT=\"quiet splash nvidia-drm.modeset=1\"\nsudo update-grub\n```\n\n[Environment variables for Wayland](https://discourse.ubuntu.com/t/environment-variables-for-wayland-hackers/12750) hackers\n\n```sh\nls $XDG_RUNTIME_DIR/wayland-*\n```\n\n## Installing Waydroid\n\n[Waydroid](https://docs.waydro.id/)is a container-based approach to boot a full Android system on a regular GNU/Linux system like Ubuntu.\n\n```sh\nsudo apt install curl ca-certificates -y\ncurl https://repo.waydro.id | sudo bash\nsudo apt install waydroid -y\n\n# Launch Waydroid In Full-Screen Mode\nsudo waydroid container start\nwaydroid session start\n\nwaydroid show-full-ui\n```\n\n[F-Droid](https://f-droid.org/en/) is an installable catalogue of FOSS (Free and Open Source Software) applications for the Android platform. The client makes it easy to browse, install, and keep track of updates on your device.\n\n```sh\n# Installing F-Droid\nwaydroid app install ./F-Droid.apk\n\n# Setting up a shared folder\nsudo mount --bind ~/Documents ~/.local/share/waydroid/data/media/0/Documents\n```\n\n## Installing Microsoft fonts\n\n```sh\nsudo add-apt-repository multiverse\nsudo apt update \u0026\u0026 sudo apt install ttf-mscorefonts-installer\n```\n\n## Installing [Docker](https://docs.docker.com/engine/install/ubuntu/)\n\n```sh\ncurl -fsSL https://get.docker.com | sh\n# OR\n\n# Install packages to allow apt to use a repository over HTTPS\nsudo apt-get update\nsudo apt-get install ca-certificates curl gnupg\n\n# Add Docker’s official GPG key\nsudo install -m 0755 -d /etc/apt/keyrings\ncurl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg\nsudo chmod a+r /etc/apt/keyrings/docker.gpg\n\n#set up the repository\necho \\\n  \"deb [arch=\"$(dpkg --print-architecture)\" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \\\n  \"$(. /etc/os-release \u0026\u0026 echo \"$VERSION_CODENAME\")\" stable\" | \\\n  sudo tee /etc/apt/sources.list.d/docker.list \u003e /dev/null\n\n  sudo apt-get update\n\n  # Install Docker Engine, containerd, and Docker Compose.\n\n  sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin\n  sudo docker run hello-world\n\n```\n\n## Setting proxy on Docker\n\n```sh\nvi ~/.docker/config.json\n{\n \"proxies\": {\n   \"default\": {\n     \"httpProxy\": \"http://127.0.0.1:8889/\",\n     \"httpsProxy\": \"http://127.0.0.1:8889/\",\n     \"noProxy\": \"localhost,127.0.0.0/8,::1\",\n     \"ftpProxy\":\"http://127.0.0.1:8889/\",\n     \"allProxy\":\"socks://127.0.0.1:1089/\"\n   }\n }\n}\n```\n\n## Backup / Export Docker Image\n\n```sh\ndocker info | grep \"Root Dir\"\ndocker info | grep -i \"Storage Driver\"\n\ndocker image ls\n\ndocker save my_image:my_tag | gzip \u003e my_image.tar.gz\ndocker load \u003c my_image.tar.gz\n\ndocker save \u003cimagename\u003e -o imagename_backup_yyyymmdd.tar\ndocker load \u003c imagename_backup_yyyymmdd.tar\n\ndocker container ls\ndocker export containerid -o imagename_backup_yyyymmdd.tar\n\n```\n\n## Installing Vscode\n\nDownload latest package [vscode](https://code.visualstudio.com/download):\n\n```sh\nsudo apt install ./code_1.78.0-1683145611_amd64.deb\n\n# Setting/Unsetting proxy via env\nprintenv | grep -i proxy\n\nunset no_proxy \u0026\u0026 unset NO_PROXY \u0026\u0026 unset all_proxy \u0026\u0026 unset ALL_PROXY \u0026\u0026 unset ftp_proxy \u0026\u0026 unset FTP_PROXY \u0026\u0026 unset http_proxy \u0026\u0026 unset HTTP_PROXY \u0026\u0026 unset https_proxy \u0026\u0026 unset HTTPS_PROXY\n\nexport no_proxy=localhost,127.0.0.0/8,::1\nexport NO_PROXY=localhost,127.0.0.0/8,::1\nexport ftp_proxy=http://127.0.0.1:8889/\nexport FTP_PROXY=http://127.0.0.1:8889/\nexport https_proxy=http://127.0.0.1:8889/\nexport HTTPS_PROXY=http://127.0.0.1:8889/\nexport http_proxy=http://127.0.0.1:8889/\nexport HTTP_PROXY=http://127.0.0.1:8889/\nexport all_proxy=socks5://127.0.0.1:1089/\nexport ALL_PROXY=socks5://127.0.0.1:1089/\n\n```\n\n## Installing Bing wallpaper\n\n```sh\nsudo snap remove snap-store\nsudo snap install snap-store\n\nsudo snap install bing-wall\n```\n\n## Installing Pomodoro\n\n```sh\nsudo snap install pomatez\n```\n\n## Fixing error: download is performed unsandboxed as root...\n\n```sh\nsudo chown -Rv _apt:root /var/cache/apt/archives/partial/\nsudo chmod -Rv 700 /var/cache/apt/archives/partial/\n# sudo apt autoremove\n```\n\n## Instaling [TLP](https://linrunner.de/tlp/index.html)\n\n```sh\nsudo add-apt-repository ppa:linrunner/tlp\nsudo apt update\nsudo apt install tlp tlp-rdw\n\nvi /etc/tlp.conf\n#(or a config file of your choice under /etc/tlp.d/):\n# example: conservation_mode = 1 \u003e charging stops at 60% | conservation_mode = 0 \u003e the battery gets fully charged (Lenovo Ideapad)\nSTOP_CHARGE_THRESH_BAT0=\"1\"\n\nsudo systemctl enable tlp\nsudo systemctl start tlp\n\ntlp start\ntlp-stat -s -c -b\n```\n\n## Forwarding all traffic from ssh ([sshuttle](https://github.com/sshuttle/sshuttle))\n\n```sh\nsudo apt install sshuttle\nsudo sshuttle -r username@sshserver 0/0 --dns\n```\n\n## Installing [Minikube](https://minikube.sigs.k8s.io/docs/start/)\n\n```sh\ncurl -LO https://github.com/kubernetes/minikube/releases/download/v1.30.1/minikube_1.30.1-0_amd64.deb\nsudo apt install minikube_1.30.1-0_amd64.deb\n\nsudo usermod -aG docker $USER \u0026\u0026 newgrp docker\n\nminikube start --driver=docker\nminikube config set driver docker\n\n\nminikube kubectl -- get po -A\necho \"alias kubectl='minikube kubectl --'\" \u003e\u003e ~/.bash_aliases\nsource ~/.bashrc\n\nkubectl get po -A\n\nminikube dashboard\n\n# Some dashboard features require the metrics-server addon.\nminikube addons enable metrics-server\n\n\n\n# Deploy applications\n\n# Type services [Cluster IP, Node Port, Load Balancer, External Name]\n\nkubectl create deployment hello-minikube --image=kicbase/echo-server:1.0\nkubectl get deployments\nkubectl describe deployment hello-minikube\nkubectl rollout restart deployment hello-minikube\nkubectl delete deployment hello-minikube\n\n# Service (Node Port)\nkubectl expose deployment hello-minikube --type=NodePort --port=8080\nkubectl get services hello-minikube\nkubectl describe service hello-minikube\nminikube service hello-minikube\n\n# http://localhost:7080/\nkubectl port-forward service/hello-minikube 7080:8080\n\nkubectl create deployment balanced --image=kicbase/echo-server:1.0\n# Service (Load Balancer)\nkubectl expose deployment balanced --type=LoadBalancer --port=8080\nkubectl get services balanced\n# \u003cEXTERNAL-IP\u003e:8080\nminikube tunnel\n\n# Ingress\nminikube addons enable ingress\nkubectl apply -f ingress-example.yaml\nkubectl get ingress\n# verify that the ingress works\nminikube tunnel\ncurl 127.0.0.1/foo\ncurl 127.0.0.1/bar\n\n# Manage cluster\nminikube pause\nminikube unpause\nminikube stop\n\nminikube config set memory 9001\n\nminikube addons list\n\n# Delete all of the minikube clusters:\nminikube delete --all\n\nminikube delete --purge\n```\n\n## Installing [MicroK8s](https://microk8s.io/docs/getting-started)\n\n```sh\n# Installing MicroK8s\nsudo snap install microk8s --classic --channel=1.27\n\n# Adding current user to the group and gain access to the .kube caching directory\nsudo usermod -a -G microk8s $USER\nsudo chown -f -R $USER ~/.kube\n#re-enter the session for the group update to take place\nsu - $USER\n\n# Checking the status\nmicrok8s status --wait-ready\n\n# WARNING:  Docker is installed.\nsudo vi /etc/docker/daemon.json\n{\n    \"insecure-registries\" : [\"localhost:32000\"]\n}\n\n\n# Adding alias kubectl\necho \"alias kubectl='microk8s kubectl'\" \u003e\u003e ~/.bash_aliases \u0026\u0026 source ~/.bashrc\n\n# Access Kubernetes\nmicrok8s kubectl get nodes\nmicrok8s kubectl get services\n\n# Use [add-ons](https://microk8s.io/docs/addons#heading--list)\nmicrok8s enable dns\nmicrok8s enable hostpath-storage\n\n# Starting and Stopping MicroK8s\nmicrok8s stop\nmicrok8s start\n\n# Enabling traffic forwarding with:\nsudo iptables -P FORWARD ACCEPT\n# The change can be made persistent with:\nsudo apt-get install iptables-persistent\n\n```\n\n## Install inside virtual environment:\n\n1. cd DIR\n2. pipenv install (installs virtual environment and all necessary dependencies from Pipfile).\n3. pipenv shell (enter virtual environment).\n4. pip install -e . (to install).\n\n## Installing Brave browser\n\n```sh\nsudo apt install curl\n\nsudo curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg\n\necho \"deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg] https://brave-browser-apt-release.s3.brave.com/ stable main\"|sudo tee /etc/apt/sources.list.d/brave-browser-release.list\n\nsudo apt update\n\nsudo apt install brave-browser\n```\n\n## Installing Node.js LTS via binary archive\n\n### nvm Commands\n\n```sh\n# check version\nnode -v || node --version\n\n# list locally installed versions of node\nnvm ls\n\n# list remove available versions of node\nnvm ls-remote\n\n# install specific version of node\nnvm install 18.16.1\n\n# set default version of node\nnvm alias default 18.16.1\nnvm unalias default\n\n# switch version of node\nnvm use 20.5.1\n\n# install latest LTS version of node (Long Term Support)\nnvm install --lts\n\n# install latest stable version of node\nnvm install stable\n```\n\nDownload the NodeJS : [https://nodejs.org/en/download/](https://nodejs.org/en/download/)\n```sh\n# installs nvm (Node Version Manager)\ncurl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash\n# download and install Node.js (you may need to restart the terminal)\nnvm install 20\n# verifies the right Node.js version is in the environment\nnode -v # should print `v20.17.0`\n# verifies the right npm version is in the environment\nnpm -v # should print `10.8.2`\n```\nOR\n\n```sh\ncurl -fsSLO https://nodejs.org/dist/v18.16.0/node-v18.16.0-linux-x64.tar.xz\ntar -xJvf node-v18.16.0-linux-x64.tar.xz\n\n# --- The First method\nsudo cp -r ./node-v18.16.0-linux-x64/{lib,share,include,bin} /usr\n\n\n# --- The second method\nsudo mkdir -p /usr/local/lib/node/v18.16.0\nsudo mv ./node-v18.16.0-linux-x64/{lib,share,include,bin} /usr/local/lib/node/v18.16.0\n# Checking ~/.bashrc\ncat \u003c\u003cEOF \u003e\u003e ~/.bashrc\nif [ -f ~/.bash_profile ]; then\n    . ~/.bash_profile\nfi\nEOF\n\necho \"export PATH=/usr/local/lib/node/v18.16.0/bin:$PATH\" \u003e\u003e ~/.bash_profile\nsource ~/.bash_profile\n\n#Zsh\nvi ~/.zshrc\nexport PATH=/usr/local/lib/node/v18.16.0/bin:$HOME/bin:/usr/local/bin:$PATH\n# ---\n\n\nnode -v\nnpm version\n```\n\n## Tips\n\n```sh\n# Copy just structure folders\nrsync -av -f\"+ */\" --exclude={'*.srt','*.mp4'} \"$SRC\" \"$DEST\"\n# Adding specific folder in subforlders (leve 1)\ncd \"$DESTF\"\nfor f in */\ndo\n  if [ -d \"$f\" ]; then\n    mkdir -p \"./${f}img\"\n  fi\ndone\n\n# How to check gtk version in ubuntu linux\ngtk-launch --version\n# How do I find the version of bash\necho \"${BASH_VERSION}\"\nbash --version\nCtrl+x Ctrl+v\n\n# logout in /bin/bash\ngnome-session-quit --logout --no-prompt\n```\n\n## Modifing style properties of GNOME Shell themes\n\n```sh\nsudo apt install gnome-shell-extensions gnome-tweaks\n```\n\n### Generating custom theme and changing panel background color\n\n```sh\n\nmkdir -p ~/.themes/mytheme/gnome-shell/\necho \"#panel {background-color: red;}\" \u003e ~/.themes/mytheme/gnome-shell/gnome-shell.css\n# Installing extension \u003e GNOME Shell integration\n# https://chrome.google.com/webstore/detail/gnome-shell-integration/gphhapmejobijbbhgpjhcjognlahblep\n# Go to https://extensions.gnome.org/extension/19/user-themes/ and enable user-themes\n# Launch the Tweaks app and change the GS theme from the “Appearance” tab to Mytheme\n# Reload the GNOME shell: \u003cALT+F2\u003e and input “r”\n```\n\n### Extracting original CSS file as a reference\n\n```sh\n# default system GS theme located at the “/usr/share/gnome-shell/theme” path\ncd /usr/share/gnome-shell/theme/Yaru\ngresource list gnome-shell-theme.gresource\ngresource extract gnome-shell-theme.gresource /org/gnome/shell/theme/Yaru/gnome-shell-dark.css \u003e output.css\n```\n\n## Zsh\n\n[Zsh](https://www.zsh.org/) is a shell designed for interactive use, although it is also a powerful scripting language.\n\n```sh\n# Install Zsh\nsudo apt install zsh\nzsh\n```\n\n### Oh my zsh\n\n[Oh My Zsh](https://ohmyz.sh/#install) is a delightful, open source, community-driven framework for managing your Zsh configuration. It comes bundled with thousands of helpful functions, helpers, plugins, themes, and a few things that make you shout...\n\nAll the current [themes](https://github.com/ohmyzsh/ohmyzsh/wiki/themes) can be found in the themes/ directory in the Oh My Zsh distribution. [See list here](https://github.com/robbyrussell/oh-my-zsh/tree/master/themes/).\n\n```sh\n# ~/.zshrc\nsh -c \"$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)\"\n\n# echo current shell\necho $SHELL\n# Set zsh as your default shell\nchsh -s $(which zsh)\n\ncat /etc/shells\n## find path to zsh ##\ntype -a zsh\ngrep ^USER /etc/passwd\nsu - USER\n\nopen ~/.zshrc\n# The list of plugins: \"~/.oh-my-zsh/plugins\". Each plugin directory has a README file explaining what the plugin does.\nplugins=(rails git textmate ruby lighthouse)\n# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes\nZSH_THEME=\"robbyrussell\"\n# Apply your changes\nsource ~/.zshrc\n```\n\n### Adding JAVA_HOME to PATH\n\n```sh\nvi ~/.zshrc\n\n# Java\nexport JAVA_HOME=$(dirname $(dirname $(readlink -f $(which java))))\ncase \":$PATH:\" in\n  *\":$JAVA_HOME:\"*) ;;\n  *) export PATH=\"$JAVA_HOME:$PATH\" ;;\nesac\n# Java end\n\n```\n\n## Changing Defualt Shell\n\n```sh\n# List of Shells\ncat /etc/shells\n\n# Change Shell\nchsh -s /bin/zsh\n# Then logout\n\n# Check\ngrep \"^${USER}\" /etc/passwd\n\nsu - USER\n```\n\n## Remount filesystem in the read-write mode\n\n```sh\ntouch file1\n# check if file system is read only\ncat /proc/mounts | grep datastore\nmount -v |grep datastore\n# check file system by running fsck on its volume\ndf -h /datastore\nfsck /dev/xvdf\n\n# Re-mount file system in read-write mode\nmount -o remount,rw /datastore\nmount -v |grep datastore\n\n# lists only ext4 file systems:\nfindmnt -t ext4\n# lists information about all available or the specified block devices\nlsblk\n\n\n```\n\n## InstallIng All Essential Media Codecs\n\nThe ubuntu-restricted-extras is a software package that consists various essential software like flash plugin, unrar, gstreamer, mp4, codecs for Chromium browser in Ubuntu etc.\n\n```sh\nsudo add-apt-repository multiverse\nsudo apt update\nsudo apt install ubuntu-restricted-extras\n```\n\n## Installing Jenkins\n\n[Jenkins](https://www.jenkins.io/doc/book/installing/linux/#debianubuntu) is a self-contained, open source automation server which can be used to automate all sorts of tasks related to building, testing, and delivering or deploying software.\n\nJenkins can be installed through native system packages, Docker, or even run standalone by any machine with a Java Runtime Environment (JRE) installed.\n\n```sh\n\nsudo apt update\nsudo apt install openjdk-17-jre\njava -version\n\n\ncurl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key | sudo tee /usr/share/keyrings/jenkins-keyring.asc \u003e /dev/null\n\necho 'deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] https://pkg.jenkins.io/debian-stable binary/' | sudo tee /etc/apt/sources.list.d/jenkins.list \u003e /dev/null\n\nsudo apt update\nsudo apt install jenkins\n\nsudo systemctl enable --now jenkins\nsudo systemctl status jenkins\n\n# Browse to http://localhost:8080\nsudo cat /var/lib/jenkins/secrets/initialAdminPassword\n```\n\n## Managing startup applications\n\n- press Alt+F2\n- run the gnome-session-properties command.\n\n## Encryption/decryption via GPG\n\n```sh\ngpg --full-generate-key\ngpg --list-keys\ngpg --fingerprint userid\ngpg --keyserver keyserver.ubuntu.com --send-key KEY-ID\ngpg --keyserver keyserver.ubuntu.com --recv-keys KEY-ID\n\ngpg -se -r recipient file.txt\n# --symmetric\ngpg -c file.txt\n\ngpg -b file.txt\ngpg --verify file.txt.sig\n\nsha1sum file.txt\n\ngpg -d -o file.txt file.txt.gpg\n\n```\n\n## How to Back Up and Restore Your GPG Keys\n\n```sh\ntree .gnupg\n\n```\n\n- openpgp-revocs.d: This subdirectory contains your revocation certificate.\n- private-keys-v1.d: This subdirectory stores your private keys.\n- pubring.kbx: It contains public keys, including yours, and some metadata about them.\n- pubring.kbx~: This is a backup copy of \"pubring.kbx.\"\n- trustdb.gpg: This holds the trust relationships you have established for your own keys and for any accepted public keys belonging to other people.\n\n```sh\ngpg -K --keyid-format LONG\n\n```\n\n- The \"sec\" (secret) number of bits in the encryption, the key ID, the date the key was created, and \"[SC].\" The \"S\" means the key can be used for digital signatures and the \"C\" means it can be used for certification.\n- The next line is the key fingerprint.\n- The \"uid\" line holds the ID of the key's owner.\n- The \"ssb\" line shows the secret subkey, when it was created, and \"E.\" The \"E\" indicates it can be used for encryption.\n\n```sh\ngpg --export --export-options backup -o public.gpg\ngpg --export-secret-keys --export-options backup -o private.gpg\ngpg --export-ownertrust \u003e trust.gpg\n\ngpg --import public.gpg\ngpg --import private.gpg\ngpg --import-ownertrust trust.gpg\n```\n\n## Using VeraCrypt encrypted volumes\n\n[VeraCrypt](https://veracrypt.fr/en/Documentation.html) is a free open source disk encryption software for Windows, Mac OSX and Linux. Brought to you by IDRIX (https://www.idrix.fr) and based on TrueCrypt 7.1a.\n\n## KeePassXC\n\nCross-platform Password Manager\n\n```sh\nsudo add-apt-repository ppa:phoerious/keepassxc\nsudo apt update\nsudo apt install keepassxc\n```\n\n## Encrypting google drive with rclone\n\n[Rclone](https://rclone.org/downloads/) is a command-line program to manage files on cloud storage. It is a feature-rich alternative to cloud vendors' web storage interfaces. Over 70 cloud storage products support rclone including S3 object stores, business \u0026 consumer file storage services, as well as standard transfer protocols.\n\n```sh\nrclone config\nrclone config file\n\nmkdir -p ~/path-local-dir\nrclone mount crypted-drive-name: ~/path-local-dir\n```\n\n### Docker installation\n\n```sh\n# perform mount inside Docker container, expose result to host\nmkdir -p ~/data/mount\ndocker run --rm \\\n    --volume ~/.config/rclone:/config/rclone \\\n    --volume ~/data:/data:shared \\\n    --user $(id -u):$(id -g) \\\n    --volume /etc/passwd:/etc/passwd:ro --volume /etc/group:/etc/group:ro \\\n    --device /dev/fuse --cap-add SYS_ADMIN --security-opt apparmor:unconfined \\\n    rclone/rclone \\\n    mount dropbox:Photos /data/mount \u0026\nls ~/data/mount\nkill %1\n```\n\n#### Uninstall Docker Engine\n\n```sh\nsudo apt-get purge docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-ce-rootless-extras\n\nsudo rm -rf /var/lib/docker\nsudo rm -rf /var/lib/containerd\n```\n### Docker backup and restore images\n```sh\ndocker image save -o images.tar fe8299495988 e0c9858e10ed \n\n\n docker image load -i images.tar\n\ndocker tag fe8299495988 node:lts-alpine3.20 \ndocker tag e0c9858e10ed nginx:latest \n```\n\n### Source installation\n\n```sh\ngit clone https://github.com/rclone/rclone.git\ncd rclone\ngo build\n```\n\n## Add an SSH fingerprint to your known_hosts file\n\n### Generate an SSH key pair\n\n[SSH](https://docs.gitlab.com/ee/user/ssh.html) uses two keys, a public key and a private key.\n\n```sh\nssh-keygen -t ed25519 -C \"\u003ccomment\u003e\"\n```\n\n### Update your SSH key passphrase\n\n```sh\nssh-keygen -p -f /path/to/ssh_key\n```\n\n### check your SSH key fingerprint\n\n```sh\nssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub\n\ncat .ssh/known_hosts\nssh-keygen -R github.com\n\n```\n\n## Create a new and push in Git repository\n\n### Git global setup\n\n```sh\ngit config --global user.name \"NAME\"\ngit config --global user.email \"EMAIL\"\n```\n\n### Create a new repository\n\n```sh\ngit clone git@github.com:PATH/REP.git\ncd security\ngit switch --create main\ntouch README.md\ngit add README.md\ngit commit -m \"add README\"\ngit push --set-upstream origin main\n\n```\n\n### Push an existing folder\n\n```sh\ncd existing_folder\ngit init --initial-branch=main\ngit remote add origin git@github.com:PATH/REP.git\ngit add .\ngit commit -m \"Initial commit\"\ngit push --set-upstream origin main\n\n```\n\n### Push an existing Git repository\n\n```sh\ncd existing_repo\ngit remote rename origin old-origin\ngit remote add origin git@github.com:PATH/REP.git\ngit push --set-upstream origin --all\ngit push --set-upstream origin --tags\n\n```\n\n## Installing Microsoft Edge\n\n```sh\ncurl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor \u003e microsoft.gpg\nsudo install -o root -g root -m 644 microsoft.gpg /etc/apt/trusted.gpg.d/\nsudo sh -c 'echo \"deb [arch=amd64] https://packages.microsoft.com/repos/edge stable main\" \u003e /etc/apt/sources.list.d/microsoft-edge-dev.list'\nsudo rm microsoft.gpg\n\nsudo apt update \u0026\u0026 sudo apt install microsoft-edge-stable\nsudo apt remove microsoft-edge-stable\n```\n\n## Install Xfce VNC remote desktop on Ubuntu\n\n```sh\nsudo apt update \u0026\u0026 sudo apt upgrade -y\nsudo apt install -y vim xfce4 xfce4-goodies tightvncserver autocutsel\n\nsudo useradd -m -s /bin/bash USERNAME\nsudo usermod -aG sudo USERNAME\nsudo passwd USERNAME\nsudo su - USERNAME\n\nsudo vncpasswd\n\nsudo vi ~/.vnc/xstartup\n\n#!/bin/bash\n\nxrdb $HOME/.Xresources\nautocutsel -fork\nstartxfce4 \u0026\n\nsudo chmod 755 ~/.vnc/xstartup\nvncserver\n# using Remmina app in clinet and connet to VNC server\n\nvncserver -kill :1\nexit\nwhoami\n\nsudo vi /etc/systemd/system/vncserver@.service\n\n[Unit]\nDescription=Start VNC server at startup\nAfter=syslog.target network.target\n\n[Service]\nType=forking\nUser=USERNAME\nGroup=USERNAME\nWorkingDirectory=/home/USERNAME\n\nPIDFile=/home/USERNAME/.vnc/%H:%i.pid\nExecStartPre=-/usr/bin/vncserver -kill :%i \u003e /dev/null 2\u003e\u00261\nExecStart=/usr/bin/vncserver -depth 24 -geometry 1920x1080  :%i\nExecStop=/usr/bin/vncserver -kill :%i\n\n[Install]\nWantedBy=multi-user.target\n\nsudo systemctl enable vncserver@1\nsudo systemctl start vncserver@1\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmehradi-github%2Fref-ubuntu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmehradi-github%2Fref-ubuntu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmehradi-github%2Fref-ubuntu/lists"}