Skip to content

Instantly share code, notes, and snippets.

@moaalaa
Last active October 25, 2025 18:51
Show Gist options
  • Select an option

  • Save moaalaa/702e05f86ac030a17243ebefd5c63326 to your computer and use it in GitHub Desktop.

Select an option

Save moaalaa/702e05f86ac030a17243ebefd5c63326 to your computer and use it in GitHub Desktop.
For Every New Ubunut or Linux Mint

Installing ZSH

1. Install ZSH

# Ubuntu
sudo apt install zsh

# Fedora
sudo dnf install zsh

.2 Make ZSH the Default Shell

chsh -s $(which zsh)

.3 Install Oh My Zsh

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

.4 ZINIT

The easiest way to install Zinit is to execute:

bash -c "$(curl -fsSL https://git.io/zinit-install)"

source ~/.zshrc

This will install Zinit in ~/.zinit/bin. .zshrc will be updated with three lines of code that will be added to the bottom. The lines will be sourcing zinit.zsh and setting up completion for command zinit.

After installing and reloading the shell compile Zinit with zinit self-update.

.5 Fastfetch

sudo add-apt-repository ppa:zhangsongcui3371/fastfetch
sudo apt update
sudo apt install fastfetch
fastfetch

.6 Melo Font amd fira code

mkdir -p ~/.local/share/fonts/NerdFonts
cd ~/.local/share/fonts/NerdFonts

wget https://github.com/ryanoasis/nerd-fonts/releases/latest/download/Meslo.zip
unzip Meslo.zip
fc-cache -fv
echo ' 🔒 📁 ✔'
rm Meslo.zip

sudo apt install fonts-firacode

.7 ZINT Pluings

Open ZSHRC File

nano ~/.zshrc

Put the following lines in ~/.zssrc

# This must be the first liens in .zshrc so powek10k use it's instant prompt and make the zsh load faster with smothly scroll down when loaded
# --------------------
# Fastfetch (show system info)
# --------------------
if command -v fastfetch >/dev/null 2>&1; then
    fastfetch
fi

if [ -f ~/.bash_aliases ]; then
    . ~/.bash_aliases
fi

# --------------------
# Plugins
# --------------------
zinit light zsh-users/zsh-autosuggestions
zinit light zdharma-continuum/fast-syntax-highlighting
zinit light zsh-users/zsh-completions
zinit light agkozak/zsh-z
zinit light hlissner/zsh-autopair
zinit light MichaelAquilina/zsh-you-should-use


# --------------------
# Theme (Powerlevel10k)
# --------------------
zinit light romkatv/powerlevel10k
#remove or comment the original one in the first of the file and put thi afterthe zinit load it
ZSH_THEME="powerlevel10k/powerlevel10k"

Make the Canges

source ~/.zshrc

# Comment the follwing line if the follwing error happend even if the theme is applied
# Error [oh-my-zsh] theme 'powerlevel10k/powerlevel10k' not found
# comment this source $ZSH/oh-my-zsh.sh
# and ZSH_THEME to be like this ZSH_THEME="" or comment it entirly 

.8 powerlevel10k Config

p10k configure

.9 Optional quality shell tools

Table of Contents

  1. Showing Feedbacks on Password in Terminal
  2. Installing Nala
  3. Installing PHP
    3.1 Import PHP LaunchPAD PPA
    3.2 Update Package List
    3.3 Install PHP and PHP Extensions
    3.4 Install Another PHP Version
    3.5 Switching Between Versions
  4. Install Composer
    4.1 Install Composer
    4.2 Export Composer Path
  5. Install MySQL
    5.1 Install MySQL Server
    5.2 Enable MySQL Service
    5.3 Remove Root Password Before Secure Installation
  6. Install Valet Linux+
    6.1 Install OS Packages
    6.2 Install Valet Linux+ with Composer
    6.3 Install and Configure Valet
    6.4 Increase Nginx and PHP Upload Size
  7. Install Postman
    7.1 Download Postman
    7.2 Extract Archive
    7.3 Make Symlink
    7.4 Make Desktop Icon
    7.5 Make Desktop Executable
  8. Install Linux Mint’s Web App Manager
    8.1 Add Linux Mint Repository
    8.2 Set Priority for Webapp Manager
    8.3 Simulate Installation
    8.4 Install Webapp Manager
  9. Installing NVM
  10. Uninstalling LibreOffice
  11. Remove Apache2
  12. Prevent Laptop from Sleeping When Closing the Lid
  13. Fix Chromium Browsers Flickering in KDE Plasma
    14.1 Enable Wayland Support for Chromium
    14.2 Fix Electron Apps Flickering

Showing Feedbacks on password in terminal

1. enable the password feedback feature in /etc/sudoers file, open it for editing using the visudo command

sudo visudo 

2. Search for the following line

Defaults env_reset

3. Append pwfeedback

Defaults env_reset,pwfeedback

4. Exit then reset your terminal by reset command

reset

Aliases

wget https://gist.githubusercontent.com/moaalaa/702e05f86ac030a17243ebefd5c63326/raw/1d04c73b578ccf4879230cc0f36eba54bbcf1837/03%2520-%2520.bash_aliases -O ~/.bash_aliases

Installing most needed pacakges

# Linux Mint
sudo apt install nala git numlockx gpaste-2 gir1.2-gpaste-2 eza

# Ubuntu
sudo apt install nala

# Fedora (Nala is not applicable, use dnf)

Installing PHP

1. Import PHP LaunchPAD PPA

# Ubuntu
sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php

# Fedora
sudo dnf install https://rpms.remirepo.net/fedora/remi-release-$(rpm -E %fedora).rpm
sudo dnf config-manager --set-enabled remi
sudo dnf module reset php

2. Update Package List

# Ubuntu
sudo apt update

# Fedora
sudo dnf update

3. Install php and PHP Extensions

# Ubuntu
sudo apt install php8.2 php8.2-fpm php8.2-intl php8.2-mysqli php8.2-cli php8.2-common php8.2-curl php8.2-mbstring php8.2-opcache php8.2-readline php8.2-xml php8.2-zip php8.2-mysql php8.2-gd php8.2-imagick php8.2-memcached php8.2-pgsql php8.2-sqlite3

# Fedora
sudo dnf install php82 php82-php-fpm php82-php-mysqli php82-php-cli php82-php-common php82-php-curl php82-php-mbstring php82-php-opcache php82-php-readline php82-php-xml php82-php-zip php82-php-mysql php82-php-gd php82-php-imagick php82-php-memcached php82-php-pgsql php82-php-sqlite3

4. (Optional) Install another php version

# Ubuntu
sudo apt install php7.4 php7.4-fpm php7.4-mysqli php7.4-cli php7.4-common php7.4-curl php7.4-mbstring php7.4-opcache php7.4-readline php7.4-xml php7.4-zip php7.4-mysql php7.4-gd php7.4-imagick php7.4-memcached php7.4-pgsql php7.4-sqlite3

# Fedora
sudo dnf install php74 php74-php-fpm php74-php-mysqli php74-php-cli php74-php-common php74-php-curl php74-php-mbstring php74-php-opcache php74-php-readline php74-php-xml php74-php-zip php74-php-mysql php74-php-gd php74-php-imagick php74-php-memcached php74-php-pgsql php74-php-sqlite3

5. (Optional) Switching Bewteen Versions

# Ubuntu
sudo update-alternatives --set php /usr/bin/php7.4
sudo update-alternatives --set php /usr/bin/php8.2

# Fedora
sudo alternatives --install /usr/bin/php php /usr/bin/php82 1
sudo alternatives --install /usr/bin/php php /usr/bin/php74 2

sudo alternatives --config php

php -v
php82 -v
php74 -v

Install Composer

1. Install composer

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === 'dac665fdc30fdd8ec78b38b9800061b4150413ff2e3b6f88543c636f7cd84f6db9189d43a81e5503cda447da73c7e5b6') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
sudo mv composer.phar /usr/local/bin/composer

2. Export Composer Path

echo 'export PATH="$PATH:$HOME/.config/composer/vendor/bin"' >> ~/.zshrc

source ~/.zshrc

Install MySql

1. Install MySql Server

# Ubuntu
sudo apt install -y mysql-server

# Fedora
sudo dnf install mysql-server

2. Enable MySql Service

# Ubuntu
sudo systemctl start mysql && sudo systemctl enable mysql

# Fedora
sudo systemctl start mysqld && sudo systemctl enable mysqld


# Chck Status 
# Ubuntu
sudo systemctl status mysql

# Fedora
sudo systemctl status mysqld

3. Removing Root Passwor Before Secure Instlation

# Both Ubuntu and Fedora
sudo mysql
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '';
FLUSH PRIVILEGES;
exit

sudo mysql_secure_installation

1. Os Packages

# Ubuntu
sudo apt install curl libnss3-tools jq xsel openssl ca-certificates

# Fedora
sudo dnf install curl nss-tools jq xsel openssl ca-certificates

2. Install Valet Linux+ with Composer

# Both Ubuntu and Fedora
composer global require genesisweb/valet-linux-plus

3. Install and Configre

# It Will Install Nginx and Redis With It
# Both Ubuntu and Fedora
valet install

4. Increase Nginx and PHP upload size

# Increase nginx
sudo nano /etc/nginx/nginx.conf

# Add the folloing lines in http block
http {
    ...
    
    # Allow file uploads up to 1GB
    client_max_body_size 1024M;

    # Set timeouts for uploads
    client_body_timeout 300s;
    client_header_timeout 300s;
    send_timeout 300s;

    # Configure buffer sizes
    client_body_buffer_size 128k;
    client_header_buffer_size 1k;
    large_client_header_buffers 4 32k;
    
    ...
}
# Test nginx Config
sudo nginx -t
# Increase PHP for each version

# Ubunut
sudo nano /etc/php/8.x/fpm/php.ini

# Fedora
sudo nano /etc/php.ini
# Edit the folloing files
upload_max_filesize = 1024M
post_max_size = 1024M
max_execution_time = 300
max_input_time = 300
memory_limit = 1024M
# The restart Valet 
valet restart

Install Postman

Download Postman

# Both Ubuntu and Fedora
wget https://dl.pstmn.io/download/latest/linux64 -O postman.tar.gz

Extract archive

# Both Ubuntu and Fedora
tar -xzf postman*.tar.gz -C ~/

Make symlink

# Both Ubuntu and Fedora
sudo ln -s ~/Postman/Postman /usr/bin/postman

Optional: Remove downloaded file

# Both Ubuntu and Fedora
rm postman*.tar.gz

Make Desktop icon

# Both Ubuntu and Fedora
nano ~/.local/share/applications/postman.desktop

# Paste the same desktop entry config with updated paths for each distro.
[Desktop Entry]
Type=Application
Name=Postman
Icon=/home/USERNAME/Postman/app/resources/app/assets/icon.png
Exec=/home/USERNAME/Postman/Postman

# To Enable Wayland Support
#Exec=/home/USERNAME/Postman/Postman --enable-features=UseOzonePlatform --ozone-platform=wayland %U
Comment=Postman Desktop App
Categories=Development;Code;Programming;

Make Desktop Executable

chmod +x ~/.local/share/applications/postman.desktop

And Last Ensure that your user has access to write and read files to not failling auto update

Install Linux Mint’s Web App Manager

Download and Install Linux Mint reposatory Latest keyring

Linux Mint Keyring (Right-click and select "Open link in new tab")

1.Add Linux Mint 22 (Latest for now is 22 codename: wilma) repository

sudo sh -c 'echo "deb http://packages.linuxmint.com wilma main" >> /etc/apt/sources.list.d/mint.list'	

2. Set the priority to make Ubuntu only install webapp-manager from Linux Mint repository

sudo nano /etc/apt/preferences.d/mint-wilma-pin	

Add the following

# Allow upgrading only webapp-manager from Wilma repository	
Package: webapp-manager	
Pin: origin packages.linuxmint.com	
Pin-Priority: 500	

# Never prefer other packages from the Wilma repository	
Package: *	
Pin: origin packages.linuxmint.com	
Pin-Priority: 1	
# Update 	
sudo apt update	

3. Before installing the webapp-manager package check the packages that will install and no errors

sudo apt install webapp-manager --simulate	

4. Install webapp-manager

sudo apt install webapp-manager	

Installing NVM

# Both Ubuntu and Fedora
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash

source ~/.zshrc

nvm install --lts

Uninstalling libreoffice

# Ubuntu
sudo apt remove --purge libreoffice*
sudo apt autoremove && sudo apt clean

# Fedora
sudo dnf remove libreoffice*
sudo dnf autoremove && sudo dnf clean all

Remove Apache2

# Ubuntu
sudo systemctl stop apache2
sudo systemctl disable apache2
sudo apt remove --purge apache2 apache2-utils apache2-bin apache2-data
sudo apt autoremove && sudo apt-get clean

# Fedora
sudo systemctl stop httpd
sudo systemctl disable httpd
sudo dnf remove httpd httpd-tools httpd-manual
sudo dnf autoremove && sudo dnf clean all

Prevent Laptop sleeping when closing the lid and connected to external screen

1.Edit config file

# Ubuntu
sudo nano /etc/systemd/logind.conf

$ Fedora
sudo nano /usr/lib/systemd/logind.conf

2. Search for or add the following lines and change its values to ignore

HandleLidSwitch=ignore
HandleLidSwitchExternalPower=ignore

If Using KDE Plamsa and Chromium Browsers like chrome ad Electron Base Apps flickers

1.Go to flags in your browser

chrome://flags

2. Choose wayland suport from Ozone

search for `ozone`. Set the `Preferred Ozone platform` value to `Wayland` or `Auto` from the drop-down menu

3. To Fix Electron Apps Open .zshrc and add the following line

# Allow Electron Apps to use wayland if possible
# `auto` will use wayland if possible if not use x11
export ELECTRON_OZONE_PLATFORM_HINT=auto

4. For Best resualt restart your machine

Customizing Grub Theme (For Debin Based Deistro)

1. See Grup resloution

In grub menu press ctrl+c then run the following command and note the resolutions supported by your system.

vbeinfo
# or
videoinfo

1.Download a theme

gnome locks

2.Backup grub configs

sudo cp -r /boot/grub /boot/grub_backup_$(date +%F)
sudo cp /etc/default/grub /etc/default/grub.bak

3.Installing a GRUB theme

Manualty

sudo mkdir -p /boot/grub/themes
cd /boot/grub/themes
sudo mkdir mytheme
cd mytheme

Using Theme

sudo mkdir -p /boot/grub/themes

tar -xvzf mytheme.tar.gz
# or 
unzip mytheme.zip
sudo mv mytheme /boot/grub/themes/

4.Configure GRUB to Use the New Theme and Resloution

sudo nano /etc/default/grub

# Add this line and comment it if you want to disable the theme
GRUB_THEME="/boot/grub/themes/mytheme/theme.txt"

# To set GRUB resolution look for or add this line
GRUB_GFXMODE=1920x1080

# Then make sure this line is also present (to apply the resolution) If it’s not there, add it.
GRUB_GFXPAYLOAD_LINUX=keep

sudo update-grub
# zshrc aliases
alias edalias='nano ~/.bash_aliases'
# source
alias soz='source ~/.zshrc'
alias sorc='source ~/.bashrc'
# phpunit
alias pint='./vendor/bin/pint'
alias pest='./vendor/bin/pest'
alias pestf='./vendor/bin/pest --filter'
alias parapest='./vendor/bin/pest --parallel'
alias paratest='./vendor/bin/paratest'
alias pu='./vendor/bin/phpunit'
alias puf='./vendor/bin/phpunit --filter'
# git Aliases
alias g='git'
alias gi='git init'
alias ga='git add'
alias gaa='git add .'
alias gc='git commit -m'
alias gac='git add . && git commit -m'
alias wip='git add . && git commit -m WIP'
alias gs='git status'
alias gl="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
alias gcln='git clone'
alias gpsh='git push'
alias gpll='git pull'
alias gcom='git checkout master'
# laravel
laraPro () {
laravel new $1 && cd $1 && gi && gac "Installing Laravel"
}
alias artisan='php artisan'
alias art='artisan'
alias migrate='art migrate'
alias fresh='art migrate:fresh'
alias freshSeed='art migrate:fresh --seed'
alias tinker='art tinker'
alias serve='art serve'
# Composer
alias com='composer'
alias comi='com install'
alias comdump='com dump-autoload'
# Go
alias gor='go run'
alias gorm='gor main.go'
alias gora='gor *.go'
alias gobld='go build'
alias gobldm='gobld main.go'
alias goblda='gobld *.go'
# Useful aliases
# Replace ls with eza
alias ls='eza -al --color=always --group-directories-first --icons' # preferred listing
alias la='eza -a --color=always --group-directories-first --icons' # all files and dirs
alias ll='eza -l --color=always --group-directories-first --icons' # long format
alias lt='eza -aT --color=always --group-directories-first --icons' # tree listing
alias l.="eza -a | grep -e '^\.'"
# Common use
alias tarnow='tar -acf '
alias untar='tar -zxvf '
alias psmem='ps auxf | sort -nr -k 4'
alias psmem10='ps auxf | sort -nr -k 4 | head -10'
alias ..='cd ..'
# Custom
alias mywork='cd /mnt/Games/work'
alias myplayground='cd /mnt/Anime/playground'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment