Skip to content

Instantly share code, notes, and snippets.

View juangarcia4ks's full-sized avatar
💭
I may be slow to respond.

juangarcia4ks juangarcia4ks

💭
I may be slow to respond.
View GitHub Profile
@juangarcia4ks
juangarcia4ks / rhel-lemp.sh
Created September 15, 2022 16:08
Install LEMP stack on RHEL/CentOS 7/8.
#!/bin/bash
# @title LEMP Installer
# @author Kamaran Layne <github.com/KamaranL>
# @system CentOS 7 | 8
# @description This script will install Nginx 1.x.x, MariaDB 10.5.x, Php 7.4.x and PhpMyAdmin 5.0.x
__construct ()
{
RED='\033[0;31m'
YELLOW='\033[1;33m'
@juangarcia4ks
juangarcia4ks / Jenkinsfile
Created September 14, 2022 15:19 — forked from gfolga/Jenkinsfile
Jenkins pipeline to execute different playbooks, parametrized with limits, tags, extras and Slack messages
node(){
properties([
parameters([
booleanParam(name: 'slacknotify', defaultValue: false, description: 'Notify via Slack'),
choice (name: 'limit', choices: '\ntag_Name_Server1\ntag_Name_Server2\ntag_Name_Etc3', description: 'Limit execution to'),
choice (name: 'tags', choices: '\nlogstash\nsecurity\netc', description: 'Run the following tags'),
string (name: 'extras', defaultValue: '', description: 'Extra vars, example: -e "restart=true" '),
string (name: 'msg', defaultValue: '', description: 'Slack message" '),
])
@juangarcia4ks
juangarcia4ks / nginx-alertmanager-prometheus
Created September 2, 2022 13:26 — forked from flaviocarmo/nginx-alertmanager-prometheus
Nginx reverse proxy for Prometheus and Alertmanager
upstream @prometheus {
server MY_IP:9090;
}
upstream @alertmanager {
server MY_IP:9093;
}
server {
listen 80;
@juangarcia4ks
juangarcia4ks / gist:7c14983edfa1f0ebbabc437735de632a
Created August 17, 2022 20:06 — forked from kuleszaj/gist:1911014
Simple nginx load balancer.
upstream rails_application {
server 10.0.0.1 max_fails=1 fail_timeout=10s;
server 10.0.0.2 max_fails=1 fail_timeout=10s;
# and so on: server 10.0.0.x;
}
server {
listen 1.2.3.4:80;
location / {
proxy_pass http://rails_application;
@juangarcia4ks
juangarcia4ks / nginx-alertmanager-prometheus-grafana
Created August 17, 2022 19:37 — forked from kocercan/nginx-alertmanager-prometheus-grafana
Nginx reverse proxy for Prometheus, Alertmanager, Grafana one domain with subdirectories
# add to /lib/systemd/system/prometheus.service
# --web.external-url=https://monitoring.mydomain.com/prometheus/
# add to /lib/systemd/system/alertmanager.service
# --web.external-url=https://monitoring.mydomain.com/alertmanager \
# --web.route-prefix="/" \
# --cluster.advertise-address=0.0.0.0:9093
# systemctl daemon-reload
# systemctl restart prometheus alertmanager
#
cat <<EOF > /etc/nginx/conf.g/monitoring.conf