Create a template service file at /etc/systemd/system/[email protected]
. The template parameter will correspond to the name
of target host:
[Unit]
Description=Setup a secure tunnel to %I
After=network.target
Create a template service file at /etc/systemd/system/[email protected]
. The template parameter will correspond to the name
of target host:
[Unit]
Description=Setup a secure tunnel to %I
After=network.target
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
""" | |
## Install the Django reverse proxy package: `pip install django-revproxy` | |
## Enable auth.proxy authentication in Grafana like the following | |
``` | |
[auth.proxy] | |
enabled = true | |
header_name = X-WEBAUTH-USER | |
header_property = username |
-- Get Max ID from table | |
SELECT MAX(id) FROM table; | |
-- Get Next ID from table | |
SELECT nextval('table_id_seq'); | |
-- Set Next ID Value to MAX ID | |
SELECT setval('table_id_seq', (SELECT MAX(id) FROM table)); |
################################################### | |
## | |
## Alertmanager YAML configuration for routing. | |
## | |
## Will route alerts with a code_owner label to the slack-code-owners receiver | |
## configured above, but will continue processing them to send to both a | |
## central Slack channel (slack-monitoring) and PagerDuty receivers | |
## (pd-warning and pd-critical) | |
## |
global: | |
scrape_timeout: 10s | |
scrape_interval: 15s | |
external_labels: | |
cluster: 'MY CLUSTER NAME' | |
# alternatively can be found via consul -- for details see | |
# https://prometheus.io/docs/prometheus/latest/migration/#alertmanager-service-discovery | |
alerting: | |
alertmanagers: |
#! /bin/bash | |
# Assumes that you tag versions with the version number (e.g., "1.1") | |
# and then the build number is that plus the number of commits since | |
# the tag (e.g., "1.1.17") | |
DESCRIBE=`git describe --tags --always` | |
# increment the build number (ie 115 to 116) | |
VERSION=`echo $DESCRIBE | awk '{split($0,a,"-"); print a[1]}'` |
import sys | |
import os | |
import time | |
from watchdog.observers import Observer | |
from watchdog.events import FileModifiedEvent, FileCreatedEvent | |
import boto3 | |
import mimetypes | |
from botocore.exceptions import ClientError | |
# Create an S3 client |
#!/bin/bash | |
# Check if jq is installed | |
if ! type "jq" > /dev/null; then | |
echo please install jq | |
fi | |
title="$(git log --oneline | head -1 | cut -f 2- -d ' ')" | |
source_branch="$(git branch | grep '*' | cut -f 2 -d ' ')" | |
target_branch=master |
import boto3 | |
import re | |
from urllib.request import urlopen | |
import logging | |
# https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/config.html#ConfigService.Client.put_configuration_recorder | |
# Purpose: | |
# Activate Custom AWS Record for AWS Config | |
# Supported resource type: https://docs.aws.amazon.com/config/latest/developerguide/resource-config-reference.html#supported-resources |