Skip to content

Instantly share code, notes, and snippets.

View luison's full-sized avatar

luison

View GitHub Profile
@luison
luison / lxc_mount_bind.md
Created September 1, 2020 16:21 — forked from gionn/lxc_mount_bind.md
How to enable bind mount inside lxc container

How to enable bind mount inside lxc container

When mount is returning:

STDERR: mount: block device /srv/database-data/postgres is write-protected, mounting read-only
mount: cannot mount block device /srv/database-data/postgres read-only

and dmesg shows:

@luison
luison / nginx.conf
Created November 16, 2020 16:46 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@luison
luison / gist:4afc6caa962d5c9168a740b42c7d20b7
Last active December 10, 2020 19:27
Optimized NGINX CORS with more_header
# our server config for CORS as optimized as we can, supporting multiple domains, add_more_header and trying to avoid ifs as much as possible
# by Jose Luis Moya (alsur.es)
# sources include:
# https://gist.github.com/alexjs/4165271
# @todo need to confirm if more_set_headers 'Access-Control-Allow-Origin: $http_origin'; being http_origin blank would unset or blank
# in this case we would rather use https://enable-cors.org/server_nginx.html method
# map aceptable domains, var will be assigned if it coincides only
# map $http_origin $allow_origin {
# ~^https?://(.*\.)?my-domain.com(:\d+)?$ $http_origin;
@luison
luison / regex.custom.pm
Last active December 16, 2020 19:15 — forked from ethanpil/regex.custom.pm
Custom regex rules for CSF/LFD and NginX as a proxy
#!/usr/bin/perl
###############################################################################
# Copyright 2006-2015, Way to the Web Limited
# URL: http://www.configserver.com
# Email: [email protected]
###############################################################################
sub custom_line {
my $line = shift;
my $lgfile = shift;