Skip to content

Instantly share code, notes, and snippets.

View RocketSharck's full-sized avatar

RocketSharck

View GitHub Profile
@RocketSharck
RocketSharck / yii2-server-config.md
Created August 6, 2021 14:50 — forked from yidas/yii2-server-config.md
Yii2 Server Configuration for Nginx & Apache (Subdirectory)

Yii2 Server Configuration for Nginx & Apache (Subdirectory)

It's easy to configurate a Yii2 server site with directory protection:

Yii2 Web Server Configuration

Sub Directory Site Application

With using Sub Directory for Yii2, you could set sub-directory path into yii2's config:

/**
* jQuery iLightBox - Revolutionary Lightbox Plugin
* http://www.ilightbox.net/
*
* @version: 2.2.3 - June 03, 2017
*
* @author: Hemn Chawroka
* http://www.iprodev.com/
*
*/
@RocketSharck
RocketSharck / install-docker.sh
Created July 25, 2021 15:48 — forked from p3jitnath/install-docker.sh
Docker and Nvidia Docker installation in Ubuntu 20.04 LTS
# WARNING : This gist in the current form is a collection of command examples. Please exercise caution where mentioned.
# Docker
sudo apt-get update
sudo apt-get remove docker docker-engine docker.io
sudo apt install docker.io
sudo systemctl start docker
sudo systemctl enable docker
docker --version
@RocketSharck
RocketSharck / nginx-wordpress.conf
Created October 10, 2020 16:29 — forked from nfsarmento/nginx-wordpress.conf
Harden wordpress security nginx
############ WordPress ####################
# Disable logging for favicon and robots.txt
location = /favicon.ico {
try_files /favicon.ico @empty;
access_log off;
log_not_found off;
expires max;
}
@RocketSharck
RocketSharck / protect.conf
Created October 10, 2020 15:03 — forked from VirtuBox/protect.conf
Nginx Configuration to block SQL Injection and similar attacks
location ~* "(eval\()" { deny all; }
location ~* "(127\.0\.0\.1)" { deny all; }
location ~* "([a-z0-9]{2000})" { deny all; }
location ~* "(javascript\:)(.*)(\;)" { deny all; }
location ~* "(base64_encode)(.*)(\()" { deny all; }
location ~* "(GLOBALS|REQUEST)(=|\[|%)" { deny all; }
location ~* "(<|%3C).*script.*(>|%3)" { deny all; }
location ~ "(\\|\.\.\.|\.\./|~|`|<|>|\|)" { deny all; }
location ~* "(boot\.ini|etc/passwd|self/environ)" { deny all; }
location ~* "(thumbs?(_editor|open)?|tim(thumb)?)\.php" { deny all; }
@RocketSharck
RocketSharck / rsync.sh
Created December 4, 2019 23:28 — forked from macmladen/exclude-rsync.sh
rsync exclude patterns
# /dir/ means exclude the root folder /dir
# /dir/* means get the root folder /dir but not the contents
# dir/ means exclude any folder anywhere where the name contains dir/
# Examples excluded: /dir/, /usr/share/mydir/, /var/spool/dir/
# /dir means exclude any folder anywhere where the name contains /dir
# Examples excluded: /dir/, /usr/share/directory/, /var/spool/dir/
# /var/spool/lpd//cf means skip files that start with cf within any folder within /var/spool/lpd
#
# include, +
# exclude, -
@RocketSharck
RocketSharck / sendy-server
Last active June 11, 2019 23:16 — forked from refringe/sendy-server
Nginx configuration file example for Sendy (http://sendy.co/).
# Marketing (Sendy) Installation
#
server {
root /var/www/marketing.site.com;
index index.php index.html index.htm;
server_name marketing.site.com;
autoindex off;
@RocketSharck
RocketSharck / class.envato2.php
Created December 12, 2018 17:01 — forked from dtbaker/class.envato2.php
Using the verify-purchase endpoint of the new Envato API to validate a purchase code.
<?php
// NOTE: verify-purchase has been deprecated and it's best to use the new /author/sale endpoint as documented on http://build.envato.com/
// created by Envato user wpdreams https://forums.envato.com/t/verify-purchase-class/3526
// usage example:
$o = EnvatoApi2::verifyPurchase( $purchase_code );
@RocketSharck
RocketSharck / nginx-webp-sample.conf
Created November 30, 2018 12:20 — forked from uhop/nginx-webp-sample.conf
Serving WEBP with nginx conditionally.
user www-data;
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
@RocketSharck
RocketSharck / ubuntu-nginx-init-script
Created October 12, 2018 21:40 — forked from nurrony/ubuntu-nginx-init-script
Nginx init script for Ubuntu 14.04/14.10. Basically a copy of @JasonGiedymin but path is changed to use for default installation path of Nginx `/etc/nginx` using `apt-get`
#! /bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: nginx init.d dash script for Ubuntu or other *nix.
# Description: nginx init.d dash script for Ubuntu or other *nix.
### END INIT INFO