Skip to content

Instantly share code, notes, and snippets.

View zaourzag's full-sized avatar

Zakaria aourzag zaourzag

View GitHub Profile
@zaourzag
zaourzag / conf.tpl
Created March 26, 2022 01:17
Bash script to generate configuration file from template
OPTION_1=${OPTION_1}
OPTION_2=${OPTION_2}
OPTION_3=${OPTION_3}
OPTION_4=${OPTION_4}
OPTION_5=${OPTION_5}
@zaourzag
zaourzag / generate.sh
Last active March 18, 2021 21:18 — forked from Tucker-Eric/generate.sh
Script to generate nginx config
SED=`which sed`
CURRENT_DIR=`dirname $0`
echo "What is the domain?"
read DOMAIN
# check the domain is valid!
PATTERN="^(([a-zA-Z]|[a-zA-Z][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z]|[A-Za-z][A-Za-z0-9\-]*[A-Za-z0-9])$";
if [[ "$DOMAIN" =~ $PATTERN ]]; then
DOMAIN=`echo $DOMAIN | tr '[A-Z]' '[a-z]'`
@zaourzag
zaourzag / install.sh
Last active December 11, 2020 15:35 — forked from mkubenka/install.sh
OpenVPN Access Server Letsencrypt
#!/bin/sh
apt-get -y install git bc
git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt
mkdir /etc/letsencrypt
@zaourzag
zaourzag / multicraft.conf
Last active November 10, 2020 15:03 — forked from cloudrck/multicraft.conf
Nginx Configuration for running Multicraft Panel
upstream php5-fpm-sock {
server unix:/var/run/php5-fpm.sock;
}
server {
listen 80;
server_name 0.0.0.0;
root /var/www/multicraft/;
index index.php;
@zaourzag
zaourzag / server.conf
Created September 2, 2020 05:58 — forked from timcheadle/server.conf
SSL nginx config example
server {
listen 80;
server_name www.example.com example.com;
# Redirect all traffic to SSL
rewrite ^ https://$server_name$request_uri? permanent;
}
server {
listen 443 ssl default_server;
@zaourzag
zaourzag / openvpn-install.sh
Created June 21, 2020 16:43 — forked from yasyf/openvpn-install.sh
OpenVPN Server on CentOS OpenVZ VPS
#!/bin/bash
#OpenVPN Server on CentOS OpenVZ VPS Script by Yasyf Mohamedali (http://blog.yasyf.com/2012/08/01/openvpn-server-on-a-centos-openvz-vps)
#Adapted from various scripts around the net, including http://www.openvz.ca/blog/2010/11/18/setup-tuntap-openvpn-server-openvz-5-minutes/
#https://gist.github.com/3230440
tunstate=`cat /dev/net/tun`
if [ "$tunstate" = "cat: /dev/net/tun: Permission denied" ]
then
clear
echo "Sorry, but it seems that TUN/TAP is not enabled on your VPS."
exit