Skip to content

Instantly share code, notes, and snippets.

View danixmarques's full-sized avatar
🎯
Focusing

Daniel Marques danixmarques

🎯
Focusing
View GitHub Profile
@vielhuber
vielhuber / script.sh
Last active October 30, 2024 01:42
PostgreSQL: Backup and restore export import pg_dump with password on command line #sql
# best practice: linux
nano ~/.pgpass
*:5432:*:username:password
chmod 0600 ~/.pgpass
# best practice: windows
edit %APPDATA%\postgresql\pgpass.conf
*:5432:*:username:password
# linux
@dkt26111
dkt26111 / alert.rules.yml
Created June 6, 2019 18:32
High CPU usage alert rule for Prometheus
groups:
- name: example
rules:
# Alert for any cluster that has average CPU idle < 50%
- alert: HighUsage
expr: avg(irate(node_cpu_seconds_total{mode="idle"}[1m]) * 100) < 50
for: 1m
annotations:
summary: "High usage on {{ $labels.instance }}"
description: "{{ $labels.instance }} has a average CPU idle (current value: {{ $value }}s)"