Skip to content

Instantly share code, notes, and snippets.

@pritdeveloper
Last active December 13, 2020 04:21
Show Gist options
  • Save pritdeveloper/a0f86e81aa28cdbe0b7bb4690f30eeca to your computer and use it in GitHub Desktop.
Save pritdeveloper/a0f86e81aa28cdbe0b7bb4690f30eeca to your computer and use it in GitHub Desktop.
after install linux

sudo without password

sudo visudo

{USER} ALL=(ALL) NOPASSWD: ALL

install vim

sudo apt install vim -y

update linux

sudo apt update
sudo apt upgrade
sudo apt autoremove

install git

sudo apt install git -y

install apache, mysql, php

sudo apt install apache2 mysql-server php php-mysql php-mbstring php-zip php-dom php-curl php-imagick php-gd -y

git config

git config --global user.name "Singh"
git config --global user.email "git@singhs.work"
git config --global core.excludesfile "~/.gitignore"
git config --global color.ui true
git config --global push.default current
sudo ln -s /bin/nano /usr/bin/nano

git aliases

curl https://gist.githubusercontent.com/pritdeveloper/703cb04659cd37d836fadbe0f02b0df6/raw >> ~/.gitconfig

global .gitignore

curl https://gist.githubusercontent.com/pritdeveloper/acfd4edd5cc3f43cb6b5f3338acd9fdf/raw > ~/.gitignore

install composer

sudo apt install composer -y

enable rewrite and ssl mod

sudo a2enmod rewrite
sudo a2enmod ssl

apache envvars ( apache run user and group )

sudo vi /etc/apache2/envvars

update bashrc file

sudo vi ~/.bashrc
parse_git_branch() {
	git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
if [ "$color_prompt" = yes ]; then
	PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\W\[\033[01;31m\]$(parse_git_branch)\[\033[00m\]\$ '
else
	PS1='${debian_chroot:+($debian_chroot)}\u@\h:\W$(parse_git_branch)\$ '
fi

bash aliases

curl https://gist.githubusercontent.com/pritdeveloper/7e703ce556680fb007b1d51090a6bfcf/raw > ~/.bash_aliases

reload terminal

. ~/.bashrc

create vhosts directory and permissions and user group

sudo mkdir /var/www/vhosts
sudo chown ${USER}:${USER} -R /var/www/html/ /var/www/vhosts/

linux host conf file

curl https://gist.githubusercontent.com/pritdeveloper/549542016e7f57c8c295e068b99c5e1e/raw | sudo tee /etc/apache2/sites-available/a.conf

reset mysql password

install phpmyadmin

sudo apt install phpmyadmin -y

warnings in phpmyadmin

sudo vi /usr/share/phpmyadmin/libraries/sql.lib.php
sudo vi /usr/share/phpmyadmin/libraries/plugin_interface.lib.php

Lines 613, 551 replace with

|| (count($analyzed_sql_results['select_expr']) == 1
if ($options != null && count( (array) $options) > 0) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment