Skip to content

Instantly share code, notes, and snippets.

View VirtuBox's full-sized avatar
🚀
Back to work

VirtuBox VirtuBox

🚀
Back to work
View GitHub Profile
@VirtuBox
VirtuBox / EasyDockerEngine.md
Last active October 17, 2019 10:31
Docker Apps with Nginx as reverse proxy using EasyEngine

easydockerengine

Small list of useful docker containers with nginx as reverse proxy using easyengine. To deploy on Debian/Ubuntu.

1) Install docker

   wget -qO- https://get.docker.com/ | sh

2) Install easyengine

@VirtuBox
VirtuBox / nginx-wordpress-settings
Created August 5, 2016 21:02
WordPress optimized settings for Nginx
gzip on;
gzip_comp_level 6;
gzip_http_version 1.0;
gzip_proxied any;
gzip_min_length 1100;
gzip_buffers 16 8k;
gzip_types text/plain text/html text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;
gzip_disable "MSIE [1-6].(?!.*SV1)";
gzip_vary on;
add_header X-Frame-Options "SAMEORIGIN" always;
@VirtuBox
VirtuBox / benchmarkvps.md
Created August 20, 2016 01:55
Benchmark your VPS

with vps bench

bash <(wget --no-check-certificate -O - https://raw.github.com/mgutz/vpsbench/master/vpsbench)

with speedtest

apt-get install -y python git
git clone https://github.com/sivel/speedtest-cli.git
python speedtest-cli/setup.py install

cd speedtest-cli

@VirtuBox
VirtuBox / install-Plesk.md
Last active August 23, 2016 15:09
install Plesk 12.5 or Plesk Onyx in a single command

auto-install Plesk 12.5

sh <(curl http://autoinstall.plesk.com/one-click-installer || wget -O - http://autoinstall.plesk.com/one-click-installer)

auto-install Plesk Onyx

sh <(curl http://autoinstall.plesk.com/one-click-installer || wget -O - http://autoinstall.plesk.com/one-click-installer) --tier testing

run Plesk 12.5 with Docker

install git

  apt-get install git

clone letsencrypt

git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt

setup letsencrypt with your domain

cd /opt/letsencrypt

@VirtuBox
VirtuBox / optipng-jpg.sh
Created October 7, 2016 07:23
Simple script to optimize your images with optipng and jpegoptim
#!/bin/bash
cd /var/www
find . -name *.jp* | xargs jpegoptim --strip-all -m76
find . -iname '*.png' -print0 | xargs -0 optipng -o7 -preserve
@VirtuBox
VirtuBox / magento-easyengine.conf
Created May 8, 2017 22:28
Nginx configuration for magento 2.1 with EasyEngine
## Example configuration:
# upstream fastcgi_backend {
# # use tcp connection
# # server 127.0.0.1:9000;
# # or socket
# server unix:/var/run/php5-fpm.sock;
# }
# server {
# listen 80;
# server_name mage.dev;
@VirtuBox
VirtuBox / env.php
Created May 8, 2017 22:31
env.php configuration example for magento 2.1 with redis cache
<?php
return array (
'backend' =>
array (
'frontName' => 'youradmin-url',
),
'crypt' =>
array (
'key' => 'thelongkey',
),
@VirtuBox
VirtuBox / 22222
Created May 25, 2017 10:56
protected area nginx configuration with easyengine
# EasyEngine admin NGINX CONFIGURATION
server {
listen 22222 default_server ssl http2;
access_log /var/log/nginx/22222.access.log rt_cache;
error_log /var/log/nginx/22222.error.log;
ssl_certificate /var/www/22222/cert/22222.crt;
@VirtuBox
VirtuBox / functions.md
Last active June 6, 2017 22:28
Remove Query strings and add featured images in WordPress feeds

WordPress Optimization

Remove Query strings on static assets

Add featured images in wordpress feeds

Add this code in your theme functions.php

//remove queries from static assets
function _remove_script_version( $src ){