Skip to content

Instantly share code, notes, and snippets.

View hgranillo's full-sized avatar

Horacio Granillo hgranillo

View GitHub Profile
@hgranillo
hgranillo / deletePrometheusData.md
Created January 3, 2018 00:03
Prometheus Cheatsheets

HOW TO DELETE DATA FOR A SPECIFIC JOB IN PROMETHEUS 2.0

For this you need to run prometheus with '--web.enable-admin-api'

Get date in ISO 8601 format date --iso-8601=seconds

Modify this json with date and job values, and save it as data.json

{
@hgranillo
hgranillo / redhat 7 install iptables.txt
Created July 18, 2017 14:35
Copy and paste these commands to get rid of firewalld and install iptables.
yum install -y iptables-services
sudo systemctl stop firewalld && sudo systemctl start iptables;
sudo systemctl mask firewalld
sudo systemctl enable iptables
sudo systemctl restart iptables
# Nginx SSL configuration used on butters.xcloud.com.ar to get a A+ on Qualys SSL Labs tests
# (https://www.ssllabs.com/ssltest/analyze.html)
# Check this gist for updates (https://gist.github.com/hgranillo/da7eef5045f57e5b4cd9c03bcfd44cbf)
# Path to certificate and private key.
# The .crt may omit the root CA cert, if it's a standard CA that ships with clients.
# You may want to configure this on your virtualhosts server block.
#ssl_certificate /path/to/unified.crt;
#ssl_certificate_key /path/to/my-private-decrypted.key;

Nginx.conf

Set resolver for nginx, you probably already have one if you use SSL OCSP stapling 8.8.8.8 are Google's public IPv4 DNS servers.

resolver 8.8.8.8 valid=86400;
resolver_timeout 10;

Error pages

Place this configuration on your server_block or create some .conf file on /etc/nginx and use include to call it, like you would with global SSL configuration.

@hgranillo
hgranillo / Vagrantfile
Last active July 11, 2017 18:52
Vagranfile for testing Ansible playbooks con several distros
Vagrant.require_version ">= 1.7.0"
Vagrant.configure(2) do |config|
config.vm.provider :virtualbox do |vb|
vb.gui = false
vb.customize [ 'modifyvm', :id, '--memory', '512' ]
vb.customize [ 'modifyvm', :id, '--nictype1', 'virtio' ]
vb.customize [ 'modifyvm', :id, '--natdnshostresolver1', 'on' ]
vb.customize [ 'modifyvm', :id, '--natdnsproxy1', 'on' ]
@hgranillo
hgranillo / Nginx_1.10_STABLE_Cent_6_7_Static_OpenSSL_1.1.sh
Last active April 2, 2017 10:46 — forked from kennwhite/Nginx_1.11_Mainline_Cent_6_7_Static_OpenSSL_1.1.sh
RPM build Nginx 1.10.x with ALPN on CentOS 6/7 using static OpenSSL 1.1 (v 1.02+ required for http/2 support in Chrome)
# Based on CentOS7 fork of @smartmadsoft: https://gist.github.com/moneytoo/ab3f34e4fddc2110675952f8280f49c5
# "6" for CentOS6 or Amazon Linux, "7" for CentOS7
CENTVER="6"
OPENSSL="openssl-1.0.2h"
NGINX="nginx-1.10.1-1"
http://nginx.org/packages/centos/6/SRPMS/nginx-1.10.1-1.el6.ngx.src.rpm