Skip to content

Instantly share code, notes, and snippets.

View luison's full-sized avatar

luison

View GitHub Profile
@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;
@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 / 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 / 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 / fix-wordpress-permissions.sh
Last active July 18, 2019 19:19 — forked from Adirael/fix-wordpress-permissions.sh
Fix wordpress file permissions
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
# modified by Jose Luis Moya - alsur.es
#
WP_OWNER=www-data # <-- wordpress owner
WP_GROUP=www-data # <-- wordpress group
@luison
luison / .gitignore_wordpress
Last active July 9, 2019 19:03 — forked from gavin-hall/.gitignore_wordpress
Template .gitignore for git-managed WordPress projects
# This is a template .gitignore file for git-managed WordPress projects.
# This is my own implementation based on various files
#
# Fact: you don't want WordPress core files, or your server-specific
# configuration files etc., in your project's repository. You just don't.
#
# Solution: stick this file up your repository root (which it assumes is
# also the WordPress root directory) and add exceptions for any plugins,
# themes, and other directories that should be under version control.
#
@luison
luison / generate-wp-nginx.sh
Last active January 31, 2019 15:29 — forked from Tucker-Eric/generate.sh
Script to generate our WP proxied nginx configurations
SED=`which sed`
CURRENT_DIR=`dirname $0`
echo "Dominio?"
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]'`
@luison
luison / ubuntu-webmin.yml
Last active December 14, 2018 11:01 — forked from lzhengqc/ubuntu-webmin.yml
Ansible playbook: install Webmin on Ubuntu
---
#
# Ansible playbook: Webmin for Ubuntu v201501302302
# Louis T. Getterman IV (@LTGIV)
# www.GotGetLLC.com / www.opensour.cc
#
# Example Usage:
# [user@host ~$] ansible-playbook /etc/ansible/playbooks/webmin.yml --extra-vars 'target=nameFromHostsFile'
#
#- hosts: '{{ target }}'
@luison
luison / permanent.email.errors.txt
Created October 11, 2018 09:32
Errores permanentes email bounces de limpieza
220-fe23.mail.saunalahti.fi ESMTP Postfix\r\n
220-fe26.mail.saunalahti.fi ESMTP Postfix\r\n
220-mx02-out.cloud.vadesecure.com ESMTP vcfr1mtai06p\r\n
220-mx1.agenturserver.de ESMTP Postfix\r\n
220-pre-greet-you-are-not-allowed-to-talk-yet.mx2.asom-net.dk\r\n
220-redirect.ovh.net smtp6\r\n
220-spamcadiznew.cadiz.es ESMTP - AyuntamientodeCadiz\r\n
450 Requested mail action not taken: mailbox unavailable.\r\n
453 4.1.1 AIemgvTg3q8Q7 Too Many Invalid Recipients (TT510)\r\n
501 5.5.4 Invalid Address.\r\n
@luison
luison / SassMeister-input.scss
Created January 8, 2018 16:36 — forked from elijahmanor/SassMeister-input.scss
Generated by SassMeister.com.
// ----
// Sass (v3.3.9)
// Compass (v1.0.0.alpha.20)
// Scut (v0.10.4)
// ----
@import "scut";
@mixin typeset( $type: body-copy ) {
$types: (