Skip to content

Instantly share code, notes, and snippets.

@SaurabhKharivale
Last active December 14, 2020 18:44
Show Gist options
  • Select an option

  • Save SaurabhKharivale/1e99e736dbec6e88113dbee27de7642d to your computer and use it in GitHub Desktop.

Select an option

Save SaurabhKharivale/1e99e736dbec6e88113dbee27de7642d to your computer and use it in GitHub Desktop.
Dev machine setup

Dev machine setup

Steps for fresh installation

  1. Delete all fedora partitions through windows
  2. Install fedora

Setup Fedora

Make user admin

usermod -a -G wheel saurabh

Change root password

sudo -i
passwd

PHP and Laravel Setup

Step 1:

Install php-cli and extensions

sudo dnf install php-cli php-mbstring php-xml php-process php-mcrypt php-pdo php-zip php-mysqlnd php-json php-bcmath

Step 2:

Install composer ( https://getcomposer.org/download/ )

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('SHA384', 'composer-setup.php') === '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php --install-dir=bin --filename=composer
php -r "unlink('composer-setup.php');"

Step 3:

Install valet and it dependencies ( https://cpriego.github.io/valet-linux/requirements#fedora )

sudo dnf install nss-tools jq xsel
composer global require cpriego/valet-linux

Append $HOME/.config/composer/vendor/bin to PATH variable in ~/.bash_profile

sudo setenforce 0
valet install

Step 4:

Install node using nvm ( https://github.com/creationix/nvm )

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash

make sure below lines are added to .bashrc or .zshrc

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

reload rc file and install node

source ~/.bashrc
nvm install <node-version>

Step 5:

Install laravel lambo

composer global require tightenco/lambo

copy contents of this gist into files named 'config' and 'after' respectively and store them in '~/.lambo'

Step 6:

Install mariadb

su - root
dnf install mariadb mariadb-server
systemctl start mariadb
mysql_secure_installation
  • Set root password? [Y/n] n
  • Remove anonymous users? [Y/n] y
  • Disallow root login remotely? [Y/n] n
  • Remove test database and access to it? [Y/n] y
  • Reload privilege tables now? [Y/n] y
systemctl enable mariadb

Step 7:

Set git details

git config --global user.email "saurabh.kharivale@gmail.com"
git config --global user.name "Saurabh Kharivale"

Store creds

git config credential.helper store

Step 8:

Install Z

git clone https://github.com/rupa/z.git

add following script to .zshrc

# initalize z
. ~/z/z.sh

Additional setup and config

Install ESLint

npm install -g eslint

Install Php CS Fixer

composer global require friendsofphp/php-cs-fixer

Append below line to the PATH variable in ~/.bash_profile

$HOME/.config/composer/vendor/bin

copy contents of this gist into file named .phpcsfixer and store it under '~' directory

Note: Make sure VScode is configured to find php-cs-fixer file with below settings

"php-cs-fixer.onsave": true
"php-cs-fixer.config": "~/.phpcsfixer"

Add GPG key to github

gpg2 --full-generate-key

Above command will prompt few questions

  • Please select what kind of key you want: (1) RSA and RSA (default)
  • What keysize do you want? (2048): 4096
  • Key is valid for? (0): 0
  • Real name: < Your Name >
  • Email address: < Your Email >

List GPG key

gpg2 --list-secret-keys --keyid-format LONG

Above command will list a key copy the ID followed by /

eg. sec rsa4096/837AE7712D6FEEEA 2018-04-04 [SC]

here ID is 837AE7712D6FEEEA

Configure git to use gpg2 instead of gpg

git config --global gpg.program gpg2

Generate GPG public key

eg. gpg2 --armor --export 837AE7712D6FEEEA

gpg2 --armor --export

copy the public key and add it to your github account https://github.com/settings/gpg/new

Fixes

Fixes for possible issues during fresh npm install

Fix: autoreconf: command not found
sudo dnf install dh-autoreconf

Fix: no nasm (Netwide Assembler) found

sudo dnf install nasm

Fix: pngquant failed to build, make sure that libpng-dev is installed

sudo dnf install libpng-devel

Fix: /var/lib/nginx/tmp/client_body/0000000027" failed (13: Permission denied)

cd /etc/nginx
gedit nginx.conf

Add following line to http section

client_body_temp_path /tmp 1 2;

Fix: client intended to send too large body

client_max_body_size 5M;

Fix BrowserSync error: ENOSPC

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

Install deluge

sudo dnf install deluge
su -
dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
dnf install vlc
dnf install python-vlc npapi-vlc

Install zsh

sudo dnf install zsh

Reboot your computer

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Reboot your computer

find zsh using (which zsh) default location: /usr/bin/zsh

sudo chsh -s /usr/bin/zsh
pip install powerline-status --user

Pure Theme (option 1)

git clone https://github.com/sindresorhus/pure.git
ln -s "$PWD/pure.zsh" "$HOME/.zfunctions/prompt_pure_setup"
ln -s "$PWD/async.zsh" "$HOME/.zfunctions/async"

Add follown script to .zshrc

# zsh theme: pure
fpath=("$HOME/.zfunctions" $fpath)

autoload -U promptinit; promptinit

PURE_CMD_MAX_EXEC_TIME=0

prompt pure

Powerline Theme (option 2)

install powerline theme for zsh

git clone https://github.com/bhilburn/powerlevel9k.git ~/.oh-my-zsh/custom/themes/powerlevel9k

change theme to powerlevel9k by updating theme variable in .zshrc

ZSH_THEME="powerlevel9k/powerlevel9k"
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

Then add it to plugins list in ~/.zshrc

plugins=(zsh-autosuggestions)

for installing extensions directly through chrome

dnf install chrome-gnome-shell

install pomodoro extension

sudo dnf install gnome-shell-extension-pomodoro
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment