Skip to content

Instantly share code, notes, and snippets.

View wagnerbianchijr's full-sized avatar
:shipit:

Wagner Bianchi wagnerbianchijr

:shipit:
View GitHub Profile
@devops-school
devops-school / Example-prometheus-Recording-Rule.yaml
Created March 31, 2020 08:07
Example-prometheus Recording Rule
Recording Rule Example 1
================================
# Aggregating up requests per second that has a path label:
- record: instance_path:requests:rate5m
expr: rate(requests_total{job="myjob"}[5m])
- record: path:requests:rate5m
expr: sum without (instance)(instance_path:requests:rate5m{job="myjob"})
Recording Rule Example 2
# Many of these are obvious and stupidly simple, but for your reference and copy-pasting pleasure…
# Mextify all (with workaround for pesky samples that contain multi-line RSA key that breaks pt-mext)
for i in $(ls $1/*-mysqladmin); do { (cat $i | sed -e '/\-\-\-\-\-BEGIN\ PUBLIC\ KEY/,+9d' | pt-mext -r -- cat -) > $i.mext && echo $i.mext;} done;
# Inspect given variable through multiple mext samples (revealing ;-))
grep Table_locks_waited *.mext |less -S
#Find contentious tables
@scottames
scottames / MaxScale+Pacemaker.on.CentOS.7.md
Last active August 5, 2020 12:02
MaxScale & Pacemaker on CentOS 7

MaxScale & Pacemaker on CentOS 7

Install packages on both nodes

sudo yum install corosync pcs pacemaker maxscale

Set the password for the hacluster user [both nodes]

@leifg
leifg / Vagrantfile
Last active November 12, 2023 08:31
Add a second disk to system using vagrant
file_to_disk = './tmp/large_disk.vdi'
Vagrant::Config.run do |config|
config.vm.box = 'base'
config.vm.customize ['createhd', '--filename', file_to_disk, '--size', 500 * 1024]
config.vm.customize ['storageattach', :id, '--storagectl', 'SATA Controller', '--port', 1, '--device', 0, '--type', 'hdd', '--medium', file_to_disk]
end