Skip to content

Instantly share code, notes, and snippets.

View VirtuBox's full-sized avatar
🏠
Working from home

VirtuBox VirtuBox

🏠
Working from home
View GitHub Profile
@VirtuBox
VirtuBox / ssl-ee-acme.sh
Last active February 28, 2018 17:46
.bashrc functions to use acme.sh with EasyEngine
ssl-ee-domain ()
{
read -p "Enter your domain name: " domain_name
~/.acme.sh/acme.sh --issue -d $domain_name -d www.$domain_name --keylength ec-384 --dns dns_cf --dnssleep 60
# create folder to store certificate
mkdir -p /etc/nginx/acme.sh/$domain_name
@VirtuBox
VirtuBox / backup.php
Last active May 19, 2023 19:18
A simple php script to backup a database and getting db parameters from wp-config.php if available
<?php
/** Define ABSPATH as this file's directory */
if (! defined('ABSPATH')) {
define('ABSPATH', __DIR__ . '/');
}
/* If wp-config.php exists in the WordPress root, or if it exists in the root and wp-settings.php
* doesn't, load wp-config.php. The secondary check for wp-settings.php has the added benefit
* of avoiding cases where the current directory is a nested installation, e.g. / is WordPress(a)
@VirtuBox
VirtuBox / munin.md
Created February 18, 2018 17:33
munin tips

Add a node

Install munin-node

apt install munin-node munin-plugins-extra -y

allow munin-master

#  /etc/munin/munin-node.conf
@VirtuBox
VirtuBox / stream.md
Last active September 1, 2018 15:01
netdata : adding slave

1) enable stream on the slave

In /etc/netdata/stream.conf (git install) : use the command uuidgen to generate your api key :

[stream]
    enabled = yes
    destination = IP:PORT
    api key = XXXXXXXXXXX
@VirtuBox
VirtuBox / configure.sh
Created January 28, 2018 19:26
configure.sh
./configure \
--with-cc-opt='-g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2' \
--with-ld-opt='-Wl,-Bsymbolic-functions -Wl,-z,relro' \
--prefix=/usr/share/nginx \
--conf-path=/etc/nginx/nginx.conf \
--http-log-path=/var/log/nginx/access.log \
--error-log-path=/var/log/nginx/error.log \
--lock-path=/var/lock/nginx.lock \
--pid-path=/run/nginx.pid \
--http-client-body-temp-path=/var/lib/nginx/body \
@VirtuBox
VirtuBox / jpg-png-optimize.md
Last active October 30, 2021 08:26
Optimize your jpg & png images with jpegoptim and optipng on linux

JPG and PNG image bulk optimization

Install jpegoptim and optipng

sudo apt update && apt install jpegoptim optipng -y

compile the latest release of optipng

Install dependencies

@VirtuBox
VirtuBox / php7.1.md
Last active June 14, 2021 19:50
How to install php7.1-fpm with EasyEngine

How to install php7.1-fpm with EasyEngine


Install php7.1-fpm

apt install php7.1-common php7.1-cli php7.1-zip php7.1-opcache php7.1-mysql php7.1-mcrypt php7.1-mbstring php7.1-json php7.1-intl php7.1-gd php7.1-fpm php7.1-curl php7.1-bz2

Copy the php7.1-fpm pool configuration from php7.0-fpm

cp -f /etc/php/7.0/fpm/pool.d/www.conf /etc/php/7.1/fpm/pool.d/www.conf
# Package generated configuration file
# See the sshd_config(5) manpage for details
# What ports, IPs and protocols we listen for
Port 22
# Use these options to restrict which interfaces/protocols sshd will bind to
#ListenAddress ::
#ListenAddress 0.0.0.0
Protocol 2
# HostKeys for protocol version 2
@VirtuBox
VirtuBox / ssl.conf
Last active May 20, 2022 09:48
Nginx SSL/TLS configuration with TLSv1.2 and TLSv1.3 - ECDHE and strong ciphers suite (Openssl 1.1.1)
##
# SSL Settings (TLSv1.2 and TLSv1.3)
##
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers 'TLS13+AESGCM+AES128:EECDH+AES128';
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:50m;
ssl_session_timeout 1d;
ssl_session_tickets off;
ssl_ecdh_curve X25519:sect571r1:secp521r1:secp384r1
@VirtuBox
VirtuBox / 22222
Created December 12, 2017 00:38
EasyEngine admin Configuration
# 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;