Skip to content

Instantly share code, notes, and snippets.

View Marquesledivan's full-sized avatar

Ledivan Bernardo Marques Marquesledivan

  • Ribeirão Pires - SP - Brazil
View GitHub Profile
# Install https://www.vaultproject.io/
brew install vault
# Start dev vault server in a separate terminal
vault server -dev
# ==> Vault server configuration:
# ...
# Unseal Key: 7ACQHhLZY5ivzNzhMruX9kSa+VXCah3y87hl3dPSWFk=
# Root Token: 858a6658-682e-345a-e4c4-a6e14e6f7853
@Marquesledivan
Marquesledivan / README.txt
Created March 21, 2022 20:13 — forked from ncw/README.txt
Client side certificates with go
This demonstrates how to make client side certificates with go
First generate the certificates with
./makecert.sh [email protected]
Run the server in one terminal
go run server.go
@Marquesledivan
Marquesledivan / gke-ingress-manged-tls.md
Created January 6, 2022 13:17 — forked from pydevops/gke-ingress-manged-tls.md
Create a GCP managed TLS certificate for the GKE ingress

Solution #1 (ManagedCertificate CRD in GKE)

  • GKE with Google-managed SSL certificates
    • Use ManagedCertificate CRD to create a object.
    • Associate the ManagedCertificate object to an Ingress by adding an annotation networking.gke.io/managed-certificates to the Ingress. This annotation is a comma-separated list of ManagedCertificate resources, cert1,cert2,cert3 for example.

Solution #2 (Google Cloud SSL Certificate)

Assumption

Assumes you are using the default L7 GLBC ingress controller. default for GKE cluster.

@Marquesledivan
Marquesledivan / mapping.yaml
Created January 4, 2022 20:58 — forked from mweibel/mapping.yaml
banzaicloud/logging-operator working ElasticSearch example with index lifecycle management
apiVersion: v1
kind: Secret
metadata:
name: index-template
stringData:
template: '{"index_patterns":["logstash-*"],"template":{"aliases":{"logstash":{}},"mappings":{"dynamic":"true","dynamic_date_formats":["strict_date_optional_time","yyyy/MM/dd HH:mm:ss Z||yyyy/MM/dd Z"],"dynamic_templates":[]},"settings":{"index":{"lifecycle":{"name":"logstash_policy","rollover_alias":"logstash"},"number_of_shards":"1","number_of_replicas":"0"}}}}'
@Marquesledivan
Marquesledivan / opt1_template.j2
Created May 27, 2021 19:46 — forked from halberom/opt1_template.j2
ansible - example of template if else
{# style 1 - long form #}
{% if filepath == '/var/opt/tomcat_1' %}
{% set tomcat_value = tomcat_1_value %}
{% else %}
{% set tomcat_value = tomcat_2_value %}
{% endif %}
{# style 2 - short form #}
{% set tomcat_value = tomcat_1_value if (filepath == '/var/opt/tomcat_1') else tomcat_2_value %}
@Marquesledivan
Marquesledivan / linux_find_size_modified_date_and_remove_files.sh
Last active August 23, 2020 04:00 — forked from joostvanveen/linux_find_size_modified_date_and_remove_files.sh
Linux commands to find all files modified older than a certain date or time, remove, find largest files or folder in a human readable way.
## NOTE: when finding file by time, use one of the following flags:
# ctime : the time a file was changed, in hours. On most systems this timestamp cannot be altered by any user, so it is fairly reliable
# atime : the time a file was last accessed, in hours. This is also set by the system.
# mtime : the modified time of a file, in hours. This can be set by any user. So if you are looking for mailcious files, never use this flag.
# cmin : same as mtime, but in minutes.
# amin : same as atime, but in minutes.
# mmin : same as mtime, but in minutes.
find /root/registro.json -cmin +480 -exec rm {} \;
@Marquesledivan
Marquesledivan / nginx-logs.conf
Created July 11, 2020 06:46 — forked from chiraggude/nginx-logs.conf
Rsyslog Client nginx conf
$ModLoad imfile
$InputFilePollInterval 10
$PrivDropToGroup adm
#NGINX access file:
# Path to the file which you want to monitor
$InputFileName /home/logs/nginx-access.log