Skip to content

Instantly share code, notes, and snippets.

@moaalaa
Last active June 3, 2024 10:43
Show Gist options
  • Save moaalaa/702e05f86ac030a17243ebefd5c63326 to your computer and use it in GitHub Desktop.
Save moaalaa/702e05f86ac030a17243ebefd5c63326 to your computer and use it in GitHub Desktop.
For Every New Ubunut or Linux Mint

Installing Nala

sudo apt install nala

Installing PHP

1. Import PHP LaunchPAD PPA

sudo nala install software-properties-common && sudo add-apt-repository ppa:ondrej/php

2. Update Package List

sudo nala update

3. Install php and PHP Extensions

sudo nala install php8.2 php8.2-fpm 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

4. (Optional) Install another php version

sudo nala 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

5. (Optional) Switching Bewteen Versions

# To Check your Versions
ls /usr/bin | grep php
//...
php
php7.4
php8.2

# For PHP 7.4
sudo update-alternatives --set php /usr/bin/php7.4

# For PHP 8.2
sudo update-alternatives --set php /usr/bin/php8.2

Install MySql

1. Install MySql Server

sudo nala install -y mysql-server

2. Enable MySql Service

sudo systemctl start mysql && sudo systemctl enable mysql

# Chck Status 
sudo systemctl status mysql

3. Removing Root Passwor Before Secure Instlation

sudo mysql

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '';

FLUSH PRIVILEGES;

exit

mysql_secure_installation

1. Os Packages

sudo nala install curl network-manager libnss3-tools jq xsel

2. Install Valet Linux+ with Composer

composer global require genesisweb/valet-linux-plus

3. Install and Configre

# It Will Install Nginx and Redis With It
valet install

Install Postman

Download Postman

$ wget https://dl.pstmn.io/download/latest/linux64 -O postman.tar.gz

Extract archive

$ sudo tar -xzf postman*.tar.gz -C ~/

Make symlink

$ sudo ln -s ~/Postman/Postman /usr/bin/postman

Optional: Remove downloaded file

$ rm postman*.tar.gz

Make Desktop icon

$ nano ~/.local/share/applications/postman.desktop

[Desktop Entry]
Type=Application
Name=Postman
Icon=/home/USERNAME/Postman/app/resources/app/assets/icon.png
Exec="/home/USERNAME/Postman/Postman"
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

Installing NVM

wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash

source ~/.bashrc

nvm install --lts

Installing Oh My ZSH

1. Install ZSH

sudo nala 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)"

Uninstalling libreoffice

sudo nala remove --purge libreoffice*

sudo nala autoremove && sudo nala clean

Remove Apache2

sudo systemctl stop apache2

sudo systemctl disable apache2

sudo nala remove --purge apache2 apache2-utils apache2-bin apache2-data

sudo nala autoremove && sudo apt-get clean

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
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
ZSH_THEME="robbyrussell"
# Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
# a theme from this variable instead of looking in $ZSH/themes/
# If set to an empty array, this variable will have no effect.
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"
# Uncomment one of the following lines to change the auto-update behavior
# zstyle ':omz:update' mode disabled # disable automatic updates
# zstyle ':omz:update' mode auto # update automatically without asking
# zstyle ':omz:update' mode reminder # just remind me to update when it's time
# Uncomment the following line to change how often to auto-update (in days).
# zstyle ':omz:update' frequency 13
# Uncomment the following line if pasting URLs and other text is messed up.
# DISABLE_MAGIC_FUNCTIONS="true"
# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"
# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
# You can also set it to another string to have that shown instead of the default red dots.
# e.g. COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f"
# Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765)
# COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
# HIST_STAMPS="mm/dd/yyyy"
# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder
# Which plugins would you like to load?
# Standard plugins can be found in $ZSH/plugins/
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(
git
cp
aliases
command-not-found
copypath
redis-cli
zsh-autosuggestions
zsh-syntax-highlighting
)
source $ZSH/oh-my-zsh.sh
# User configuration
# export MANPATH="/usr/local/man:$MANPATH"
# You may need to manually set your language environment
# export LANG=en_US.UTF-8
# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# fi
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
if [ -f ~/.bash_exports ]; then
. ~/.bash_exports
fi

Auto Suggestions

  1. Clone this repository into $ZSH_CUSTOM/plugins (by default ~/.oh-my-zsh/custom/plugins)
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
  1. Add the plugin to the list of plugins for Oh My Zsh to load (inside ~/.zshrc):
plugins=( 
    # other plugins...
    zsh-autosuggestions
)
  1. Source zshrc
source ~/.zshrc

Syntax Higliting

  1. Clone this repository into $ZSH_CUSTOM/plugins (by default ~/.oh-my-zsh/custom/plugins)
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
  1. Add the plugin to the list of plugins for Oh My Zsh to load (inside ~/.zshrc):
plugins=( 
    # other plugins...
    zsh-syntax-highlighting
)
  1. Source zshrc
source ~/.zshrc
# zshrc aliases
alias edalias='subl ~/.bash_aliases'
# source
alias soz='source ~/.zshrc'
alias sorc='source ~/.bashrc'
# phpunit
alias pint='./vendor/bin/pint'
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'
# Custom
alias mywork='cd /mnt/Games/work'
alias myplayground='cd /mnt/Anime/playground'
alias ls='ls --show-control-chars -F --color'
alias lsa='ls --show-control-chars -aF --color'
export PATH="$PATH:$HOME/.config/composer/vendor/bin"
LS_COLORS=$'rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=00:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.avif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:*~=00;90:*#=00;90:*.bak=00;90:*.old=00;90:*.orig=00;90:*.part=00;90:*.rej=00;90:*.swp=00;90:*.tmp=00;90:*.dpkg-dist=00;90:*.dpkg-old=00;90:*.ucf-dist=00;90:*.ucf-new=00;90:*.ucf-old=00;90:*.rpmnew=00;90:*.rpmorig=00;90:*.rpmsave=00;90:tw=94;01:ow=94;01:st=94;01:di=01;94:';
export LS_COLORS;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment