Skip to content

Instantly share code, notes, and snippets.

@saderi
Last active January 23, 2021 09:01
Show Gist options
  • Save saderi/af196e947b5f913a32e188d901975f0e to your computer and use it in GitHub Desktop.
Save saderi/af196e947b5f913a32e188d901975f0e to your computer and use it in GitHub Desktop.
#!/bin/bash
# This script is meant for quick & easy install via:
# Tested in debian 9
# $ wget -q -O - "https://gist.github.com/saderi/af196e947b5f913a32e188d901975f0e/raw" | bash -
# install apache, mysql
apt-get update \
&& apt-get install -y curl vim git ca-certificates apt-transport-https gnupg && \
apt-get install -y apache2 mariadb-server
# install php
wget -q https://packages.sury.org/php/apt.gpg -O- | apt-key add - && \
echo "deb https://packages.sury.org/php/ stretch main" | tee /etc/apt/sources.list.d/php.list && \
apt update && \
apt-get install -y php php-mysql libapache2-mod-php php-xml php-gd php-zip php-mbstring php-json
apt-get install -y certbot python-certbot-apache
# Edit .bashrc enable color in bash
sed -i \
-e "s/# export LS_OPTIONS='--color=auto'/export LS_OPTIONS='--color=auto'/g" \
-e "s/# alias ls='ls \$LS_OPTIONS'/alias ls='ls \$LS_OPTIONS'/g" \
-e "s/# eval \"\`dircolors\`\"/eval \"\`dircolors\`\"/g" \
.bashrc
# Create custom .vimrc for disable VISUAL mod and enable syntax
echo "syntax on" > .vimrc \
&& echo "colorscheme desert" >> .vimrc \
&& echo "set mouse-=a" >> .vimrc
echo "Use this for MySQL root password";
echo "----------------------------------"
echo "SET PASSWORD FOR 'root'@'localhost' = PASSWORD('YOUR_ROOT_PASSWORD');"
echo "UPDATE mysql.user SET plugin='' WHERE User='root';"
echo "FLUSH PRIVILEGES;"
echo
echo
echo "Good Lock :) :D"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment