Skip to content

LeandroAndrade2020/srcript-fedora

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 

Repository files navigation

CONFIGURANDO um AMBIENTE de DESENVOLVIMENTO LARAVEL no LINUX FEDORA

1.0 Instalar PHP e Instalar composer e Instalar nvm e Instalar valet-linux

PHP 8.4

#!/bin/bash

# Atualizar e instalar o repositório Remi
sudo dnf install -y dnf-utils
sudo dnf install -y http://rpms.remirepo.net/fedora/remi-release-$(rpm -E %fedora).rpm

# Resetar e habilitar o módulo PHP 8.4
sudo dnf module reset php -y
sudo dnf module enable php:remi-8.4 -y

# Instalar PHP 8.4 e extensões
sudo dnf install -y php php-cli php-fpm php-json php-common php-mysqlnd php-zip php-gd php-mbstring php-curl php-xml php-pear php-bcmath php-json

# Instalar NVM
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash

# Carregar NVM no shell atual
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"

# Instalar Node.js LTS e versão 16
nvm install --lts
nvm install 16
nvm use 16
nvm alias default 16

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

# Instalar Valet
composer global require cpriego/valet-linux
sudo dnf install -y nss-tools
sudo dnf install -y xsel

# Adicionar Composer ao PATH e carregar no shell atual
export PATH="$HOME/.config/composer/vendor/bin:$PATH"
source ~/.bashrc

# Instalar Valet
valet install

# Configurar Valet, Laravel e Zsh com Oh My Zsh
source ~/.bashrc && sudo setenforce 0 && valet install && sudo setenforce 1 && valet restart && valet paths && mkdir -p ~/code && cd ~/code && valet park && valet paths && composer global require laravel/installer && sudo dnf install -y zsh && sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

# Mudar o shell padrão para Zsh
chsh -s $(which zsh)

# Instalar tema Spaceship e plugins de Zsh
ZSH_CUSTOM=~/.oh-my-zsh/custom

# Clonar e configurar o tema Spaceship
git clone https://github.com/spaceship-prompt/spaceship-prompt.git "$ZSH_CUSTOM/themes/spaceship-prompt" --depth=1
ln -s "$ZSH_CUSTOM/themes/spaceship-prompt/spaceship.zsh-theme" "$ZSH_CUSTOM/themes/spaceship.zsh-theme"

# Clonar e configurar plugins de Zsh
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

# Adicionar plugins ao ~/.zshrc
sed -i 's/plugins=(git)/plugins=(git zsh-syntax-highlighting zsh-autosuggestions)/' ~/.zshrc

# Definir tema Spaceship no ~/.zshrc
sed -i 's/ZSH_THEME=".*"/ZSH_THEME="spaceship"/' ~/.zshrc

cat <<EOF | tee -a ~/.zshrc

# Minhas Configurações Personalizadas no Zsh

# ====== ALIASES PHP / LARAVEL ======
alias pa="php artisan"
alias cc="php artisan config:clear && php artisan route:clear && php artisan view:clear && php artisan config:cache && php artisan route:cache && php artisan view:cache"
alias nd="bun run dev"
alias nb="bun run build"
alias env="cp .env.example .env"
alias rl="php artisan route:list --except-vendor"
alias op="php artisan optimize:clear"
alias sl="php artisan storage:link"

# ====== ALIASES GIT ======
alias ga="git add ."
alias gs="git status"
alias gp="git pull"
alias gm="git commit -m"
alias gc="git clone"
alias wip="git add .; git commit -m 'wip' > /dev/null; git push"
alias gg="ga && gm"

# ====== ALIASES PARA GERENCIAMENTO DE BANCOS DE DADOS ======
alias db="php artisan migrate:fresh --seed"
alias ms="php artisan migrate:status"
alias m="php artisan migrate"
alias mr="php artisan migrate:rollback --step=1"
alias sqlite="touch database/database.sqlite"

# ====== ALIASES PARA GERENCIAMENTO DE DEPENDÊNCIAS ======
alias ci="composer install"
alias cu="composer update"
alias cn="composer install && npm install"
alias ni="bun install"
alias nu="bun update"
alias up="cu && nu && nb && cc && op && nd"
alias start="env && ci && cu && ni && nu && nb && cc && op && nd"
alias lf="rm -rf node_modules package-lock.json && npm install && npm run dev"

# ====== ALIASES PARA TESTES E FERRAMENTAS ======
alias tp="pa test --parallel"
alias tdd="./vendor/bin/pest --dirty"
alias t="pa test"
alias tinker="pa tinker"
alias pint="./vendor/bin/pint"
alias stan="./vendor/bin/phpstan analyse"

# ====== ALIASES PARA CRIAÇÃO DE ARQUIVOS LARAVEL ======
alias model="pa make:model"
alias control="pa make:controller"
alias live="pa make:livewire"
alias v="pa make:volt"
alias pg="php artisan powergrid:create"
alias form="pa livewire:form"

# ====== ALIASES PARA FERRAMENTAS / PLUGINS ======
alias debugbar="composer require barryvdh/laravel-debugbar --dev"
alias dompdf="composer require barryvdh/laravel-dompdf && pa vendor:publish --provider='Barryvdh\DomPDF\ServiceProvider'"
alias heroicons="composer require blade-ui-kit/blade-heroicons"
alias lang="php artisan lang:publish"
alias excel="composer require maatwebsite/excel"

# ====== ALIASES PARA TAKEOUT ======
alias tl="takeout list"
alias te="takeout enable"
alias ts="takeout start"
alias td="takeout disable --all"
alias tdb="takeout enable mariadb"

# ====== CONFIGURAÇÃO DO NVM ======
export NVM_DIR="\$HOME/.nvm"
[ -s "\$NVM_DIR/nvm.sh" ] && \. "\$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "\$NVM_DIR/bash_completion" ] && \. "\$NVM_DIR/bash_completion"  # This loads nvm bash_completion

# ====== CONFIGURAÇÃO DO PATH PARA COMPOSER ======
export PATH=\$PATH:\$HOME/.config/composer/vendor/bin/

# ====== CONFIGURAÇÃO DO PATH PARA BUN ======
export BUN_INSTALL="\$HOME/.bun"
export PATH="\$BUN_INSTALL/bin:\$PATH"

EOF

# Recarregar Zsh
source ~/.zshrc

# Instalar MySQL
sudo dnf install -y mysql-server
sudo systemctl start mysqld
sudo systemctl enable mysqld

# Configurar MySQL
sudo mysql -u root -e "
CREATE USER 'leandro'@'localhost' IDENTIFIED BY 'PASSWORD';
GRANT ALL PRIVILEGES ON *.* TO 'leandro'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
"

source ~/.zshrc && nano ~/.zshrc
# 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="spaceship"

# 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 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"

alias pa="php artisan"
alias cc="php artisan config:clear && php artisan route:clear && php artisan view:clear && php artisan config:cache && php artisan route:cache && php artisan view:cache"
alias nd="bun run dev"
alias nb="bun run build"
alias env="cp .env.example .env"
alias rl="php artisan route:list --except-vendor"
alias op="php artisan optimize:clear"

alias ga="git add ."
alias gs="git status"
alias gp="git pull"
alias gm="git commit -m"
alias gc="git clone"
alias wip="git add .;git commit -m 'wip' > /dev/null;git push"

alias db="php artisan migrate:fresh --seed"
alias ms="php artisan migrate:status"
alias m="php artisan migrate"
alias za="nano ~/.zshrc"
alias sl="php artisan storage:link"
alias tl="takeout list"
alias te="takeout enable"
alias ts="takeout start"
alias td="takeout disable --all"
alias tdb="takeout enable mariadb"
alias pc="gp && nb && cc"  
alias cn="composer install && npm install"
alias tp="pa test --parallel"
alias tdd="./vendor/bin/pest --dirty"
alias t="pa test"
alias tinker="pa tinker"
alias key="pa key:generate"
alias pint="./vendor/bin/pint"
alias stan="./vendor/bin/phpstan analyse"
alias gg="ga && gm"
alias gne="git config --global user.name ‘LeandroAndrade’; git config --global user.email profeleandro@outlook.com"
alias sqlite="touch database/database.sqlite"
alias pld="composer require pestphp/pest --dev --with-all-dependencies && composer require nunomaduro/larastan:^2.0 --dev && composer require barryvdh/laravel-debugbar --dev"
alias debugbar="composer require barryvdh/laravel-debugbar --dev"
alias model="pa make:model"
alias control="pa make:controller"
alias live="pa make:livewire"
alias log="composer require opcodesio/log-viewer && php artisan log-viewer:publish"
alias ms="php artisan migrate:status"
alias mr="php artisan migrate:rollback --step=1"
alias heroicons="composer require blade-ui-kit/blade-heroicons"
alias lang="php artisan lang:publish"
alias form="pa livewire:form"
alias v="pa make:volt"
alias pg="php artisan powergrid:create"
alias ds="php artisan ds:init $(pwd)"
alias pi="pa iseed"

alias ci="composer install"
alias cu="composer update"
alias ni="bun install"
alias nu="bun update"
alias up="cu && nu && nb && cc && op && nd"
alias start="env && ci && cu && ni && nu && nb && cc && op && nd"
alias lf="rm -rf node_modules package-lock.json && npm install && npm run dev"

#plugins
alias debugbar="composer require barryvdh/laravel-debugbar --dev"
alias dompdf="composer require barryvdh/laravel-dompdf && pa vendor:publish --provider='Barryvdh\DomPDF\ServiceProvider'"
alias iseed="composer require orangehill/iseed"
alias icon="composer require blade-ui-kit/blade-heroicons"
alias excel="composer require maatwebsite/excel"
alias bi="curl -fsSL https://bun.sh/install | bash"
alias volt="composer require livewire/volt && php artisan volt:install"
alias ide="composer require --dev barryvdh/laravel-ide-helper && php artisan ide-helper:generate && php artisan ide-helper:models"

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion

export PATH=$PATH:$HOME/.config/composer/vendor/bin/
source ~/.zshrc && nano ~/.zshrc

4.0 Instalar Bun e DBeaver e Google Chrome

curl -fsSL https://bun.sh/install | bash && wget https://dbeaver.io/files/dbeaver-ce_latest_amd64.deb && sudo dpkg -i dbeaver-ce_latest_amd64.deb && wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && sudo dpkg -i google-chrome-stable_current_amd64.deb

5.0 Aplicativos

https://www.microsoft.com/pt-br/edge/download
https://code.visualstudio.com/docs/?dv=linux64_deb

12.0 Dual boot Pop Os com Windows 11

sudo fdisk -l 
sudo mkdir /mnt/windows
sudo mount /dev/nvme0n1p1 /mnt/windows
sudo cp -r /mnt/windows/EFI/Microsoft /boot/efi/EFI
sudo ls /boot/efi/EFI
sudo nano /boot/efi/loader/loader.conf
default Pop_OS-current
timeout 5
console-mode max
sudo umount /mnt/windows 
sudo rm -rf /mnt/windows/
exit

Licença

Este projeto está licenciado sob a licença MIT. Consulte o arquivo LICENSE para obter mais detalhes.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published