Skip to content

Instantly share code, notes, and snippets.

@Taidgh
Taidgh / DeleteServerBlock.sh
Last active March 31, 2018 21:54
Delete Nginx serverblock, folders and files
#!/usr/bin/env bash
#
# Nginx - delete block
# Based on this post: http://clubmate.fi/how-to-make-an-nginx-server-block-manually-or-with-a-shell-script/
# Functions
ok() { echo -e '\e[32m'$1'\e[m'; } # Green
die() { echo -e '\e[1;31m'$1'\e[m'; exit 1; }
read -p "Type the domain you want to remove (domain.com NOT http://domain.com/) then press enter: " delete
@Taidgh
Taidgh / CreateServerBlock.sh
Last active May 12, 2018 16:49
Wordpress or Clean Serverblock on Nginx RaspberryPi Dev@Home server PHP7
#!/usr/bin/env bash
#
# Nginx - new server block
# Based on this post: http://clubmate.fi/how-to-make-an-nginx-server-block-manually-or-with-a-shell-script/
# Functions
ok() { echo -e '\e[32m'$thedomainName'\e[m'; } # Green
die() { echo -e '\e[1;31m'$thedomainName'\e[m'; exit 1; }
# Choose your domain name
@Taidgh
Taidgh / setup.bash
Last active April 1, 2018 19:18 — forked from isc30/install.bash
Raspberry Pi Install PHP7 + Nginx + MySQL + PhpMyAdmin (last versions)
#!/bin/bash
# Thanks to https://gist.github.com/Lewiscowles1986/ce14296e3f5222082dbaa088ca1954f7
# To install
# Setup
# wget https://gist.githubusercontent.com/Taidgh/8a44217964078b63bd44b46bd04613e6/raw/setup.bash
# sudo bash setup.bash
if [ "$(whoami)" != "root" ]; then
echo "Run script as ROOT please. (sudo !!)"
exit