/etc/security/limits.conf
elasticsearch hard memlock 100000
/etc/default/elasticsearch
| socat - udp4-listen:8125,fork | tee >(socat - udp-sendto:127.0.0.1:8135) >(socat - udp-sendto:127.0.0.1:8140) |
| #! /usr/bin/env python | |
| import argparse | |
| import sys | |
| import re | |
| import time | |
| line_nginx_full = re.compile(r"""(?P<ipaddress>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}) - - \[(?P<dateandtime>\d{2}\/[a-z]{3}\/\d{4}:\d{2}:\d{2}:\d{2} (\+|\-)\d{4})\] ((\"(GET|POST) )(?P<url>.+)(http\/1\.1")) (?P<statuscode>\d{3}) (?P<bytessent>\d+) (["](?P<refferer>(\-)|(.+))["]) (["](?P<useragent>.+)["])""", | |
| re.IGNORECASE) | |
| line_nginx_onlyStatus = re.compile(r'.+HTTP\/1\.1" (?P<statuscode>\d{3})') |
| class Array | |
| def to_csv(csv_filename="hash.csv") | |
| require 'csv' | |
| CSV.open(csv_filename, "wb") do |csv| | |
| csv << first.keys # adds the attributes name on the first line | |
| self.each do |hash| | |
| csv << hash.values | |
| end | |
| end | |
| end |
| server { | |
| client_body_in_file_only clean; | |
| client_body_buffer_size 32K; | |
| client_max_body_size 300M; | |
| sendfile on; | |
| send_timeout 300s; | |
| # Port that the web server will listen on. | |
| #listen 80; |
| <?php | |
| /* | |
| * Place this with the rest of your rules. | |
| * Doesn't need to be in an array as there are no pipes. | |
| * Password is required with a minimum of 6 characters | |
| * Should have at least 1 lowercase AND 1 uppercase AND 1 number | |
| */ | |
| $rules = [ | |
| 'password' => 'required|min:6|regex:/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).+$/' | |
| ]; |
Prerequisites : the letsencrypt CLI tool
This method allows your to generate and renew your Lets Encrypt certificates with 1 command. This is easily automatable to renew each 60 days, as advised.
You need nginx to answer on port 80 on all the domains you want a certificate for. Then you need to serve the challenge used by letsencrypt on /.well-known/acme-challenge.
Then we invoke the letsencrypt command, telling the tool to write the challenge files in the directory we used as a root in the nginx configuration.
I redirect all HTTP requests on HTTPS, so my nginx config looks like :
server {
/usr/share/GeoIP.http://example.com for current GeoIP and http://example.com/ip for current IP onlyhttp://example.com/x.x.x.x to query any IP.http://example.com/domain-name for GeoIP of domain-name and http://example.com/domain-name/ip to return IP of domain-name only. If multiple IPs are set to single domain-name, all of them will be returned. Only A record will be used.$ curl http://example.com/
x.x.x.x
Country, Region, City
ASN number
| # Kernel sysctl configuration file for Linux | |
| # | |
| # Version 1.12 - 2015-09-30 | |
| # Michiel Klaver - IT Professional | |
| # http://klaver.it/linux/ for the latest version - http://klaver.it/bsd/ for a BSD variant | |
| # | |
| # This file should be saved as /etc/sysctl.conf and can be activated using the command: | |
| # sysctl -e -p /etc/sysctl.conf | |
| # | |
| # For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and sysctl.conf(5) for more details. |