Skip to content

Instantly share code, notes, and snippets.

global:
scrape_interval: 60s
external_labels:
monitor: 'example'
rule_files:
- /etc/prometheus/config/*.rules
scrape_configs:
@patrickbcullen
patrickbcullen / install.sh
Last active September 13, 2019 11:07
Install PCP on Centos 7
# run these commands on a Centos 7 server as root
yum install -y pcp pcp-webapi pcp-system-tools
chkconfig pmcd on
service pmcd start
chkconfig pmlogger on
service pmlogger start
chkconfig pmwebd on
service pmwebd start
# open port 44323 in the firewall
# To start vector on your laptop
@reachlin
reachlin / prometheus.yml
Created April 19, 2017 07:06
sample prometheus configuration explained
// For all the confusing Prometheus configuration and
// regular expressions,
// explained in examples.
// Remember, there are default values for each item if it's missing.
// regex is (.*),
// replacement is $1,
// separator is ;
// ,and action is replace
@harlow
harlow / golang_job_queue.md
Last active August 23, 2025 04:12
Job queues in Golang
// XPath CheatSheet
// To test XPath in your Chrome Debugger: $x('/html/body')
// http://www.jittuu.com/2012/2/14/Testing-XPath-In-Chrome/
// 0. XPath Examples.
// More: http://xpath.alephzarro.com/content/cheatsheet.html
'//hr[@class="edge" and position()=1]' // every first hr of 'edge' class
@vy
vy / tc-port-delay.sh
Last active May 18, 2021 21:36
Add 5s delay to outgoing traffic from port 34001
tc qdisc add dev eth0 root handle 1: prio
tc qdisc add dev eth0 parent 1:3 handle 30: netem delay 5s
tc filter add dev eth0 protocol ip parent 1:0 u32 match ip sport 34001 0xffff flowid 1:3