Skip to content

Instantly share code, notes, and snippets.

View mafonso's full-sized avatar

Miguel Afonso mafonso

View GitHub Profile
@mafonso
mafonso / CloudFront
Last active November 16, 2022 20:58
DataDog Logs ParsingRule
cloudfront %{number:timestamp}\s%{ipv4:network.client.ip}\s%{number:time_to_first_byte}\s%{number:http.status_code}\s%{number:network.bytes_written}\s%{word:cs-method}\s%{word:http.url_details.scheme}\s%{notSpace:http.url_details.host}\s%{notSpace:http.url_details.path}\s%{number:network.bytes_read}\s%{notSpace:cloudfront.edge-location:nullIf("-")}\s%{notSpace:cloudfront.edge-request-id}\s%{notSpace:cloudfront.host-header}\s%{number:time-taken}\s%{notSpace:http.version}\s%{word:c-ip-version}\s%{notSpace:http.user-agent}\s%{notSpace:http.referer}\s%{notSpace:cs-cookie}\s%{notSpace:cs-uri-query}\s%{notSpace:cloudfront.edge-response-result-type:nullIf("-")}\s%{notSpace:x_forwarded_for}\s%{notSpace:ssl-protocol}\s%{notSpace:ssl-cipher}\s%{notSpace:cloudfront.edge-result-type:nullIf("-")}\s%{notSpace:fle-encrypted-fields:nullIf("-")}\s%{notSpace:fle-status:nullIf("-")}\s%{notSpace:sc-content-type:nullIf("-")}\s%{notSpace:sc-content-lenght:nullIf("-")}\s%{notSpace:sc-range-start:nullIf("-")}\s%{notSpace:sc-range-en
@mafonso
mafonso / gourcevideo.sh
Created November 3, 2022 17:34 — forked from Gnzlt/gourcevideo.sh
Gource video export command
#!/bin/bash
gource \
-s .03 \
-1280x720 \
--auto-skip-seconds .1 \
--multi-sampling \
--stop-at-end \
--key \
--highlight-users \
@mafonso
mafonso / docker-compose.yml
Created January 12, 2021 17:20
APM on a stack
version: '2.2'
services:
apm-server:
image: docker.elastic.co/apm/apm-server:7.10.1
depends_on:
elasticsearch:
condition: service_healthy
kibana:
condition: service_healthy
cap_add: ["CHOWN", "DAC_OVERRIDE", "SETGID", "SETUID"]
@mafonso
mafonso / docker-compose.yml
Created January 9, 2021 17:44
Metrics Dashboard Stack
version: "2"
services:
grafana:
image: grafana/grafana
container_name: grafana
restart: always
ports:
- 3000:3000
links:
- influxdb
@mafonso
mafonso / docker-compose.yml
Created January 7, 2021 11:49
ELK + APM stack
version: '2.2'
services:
apm-server:
image: docker.elastic.co/apm/apm-server:7.7.1
depends_on:
elasticsearch:
condition: service_healthy
kibana:
condition: service_healthy
cap_add: ["CHOWN", "DAC_OVERRIDE", "SETGID", "SETUID"]
@mafonso
mafonso / preseed.cfg
Created May 9, 2020 18:06
Ubuntu preseed
#### Contents of the preconfiguration file (for xenial)
### Localization
d-i debian-installer/locale string en_US
d-i console-setup/ask_detect boolean false
d-i keyboard-configuration/layoutcode string uk
d-i keyboard-configuration/layout select English (UK)
d-i keyboard-configuration/variant select English (UK)
d-i keyboard-configuration/xkb-keymap select uk
d-i keyboard-configuration/modelcode string pc105
d-i netcfg/choose_interface select auto
@mafonso
mafonso / ssl frontend
Created June 18, 2018 11:43
HAProxy examples
frontend app1_ssl
bind *:443 ssl crt /etc/haproxy/certs.d/example.com.crt crt /etc/haproxy/certs.d/ no-sslv3
option http-server-close
option forwardfor
reqadd X-Forwarded-Proto:\ https
reqadd X-Forwarded-Port:\ 443
# set HTTP Strict Transport Security (HTST) header
rspadd Strict-Transport-Security:\ max-age=15768000
@mafonso
mafonso / Gziped serde
Created June 15, 2018 16:51
ALB Logs Athena
CREATE EXTERNAL TABLE IF NOT EXISTS alb_logs (
type string,
time string,
elb string,
client_ip string,
client_port int,
target_ip string,
target_port int,
request_processing_time double,
target_processing_time double,
Error applying plan:
1 error(s) occurred:
* module.postgres.aws_db_instance.instance: aws_db_instance.instance: diffs didn't match during apply. This is a bug with Terraform and should be reported as a GitHub Issue.
Please include the following information in your report:
Terraform Version: 0.9.2
Resource ID: aws_db_instance.instance
On Vault:
$ vault auth-enable aws-ec2
Successfully enabled 'aws-ec2' at 'aws-ec2'!