Skip to content

Instantly share code, notes, and snippets.

View zgmarx's full-sized avatar
🌴
On vacation

Philip LIN zgmarx

🌴
On vacation
  • Vienna, Austria
View GitHub Profile
@krisek
krisek / alert.rules.yml
Last active July 16, 2024 07:49
Prometheus alert rules for node exporter
groups:
- name: node_exporter_alerts
rules:
- alert: Node down
expr: up{job="monitoring-pi"} == 0
for: 2m
labels:
severity: warning
annotations:
title: Node {{ $labels.instance }} is down
#!/usr/bin/env bash
name=fooAlert-$RANDOM
url='http://localhost:9093/api/v1/alerts'
bold=$(tput bold)
normal=$(tput sgr0)
generate_post_data() {
cat <<EOF
[{
@caseywatts
caseywatts / 0-self-publishing.md
Last active June 4, 2024 20:23
Self-Publishing via Markdown
@vsouza
vsouza / .bashrc
Last active June 14, 2024 08:45
Golang setup in Mac OSX with HomeBrew. Set `GOPATH` and `GOROOT` variables in zshell, fish or bash.
# Set variables in .bashrc file
# don't forget to change your path correctly!
export GOPATH=$HOME/golang
export GOROOT=/usr/local/opt/go/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
@abhi-bit
abhi-bit / netstat.py
Created August 27, 2014 11:18
netstat in python
#!/usr/bin/python
import pwd
import os
import re
import glob
PROC_TCP = "/proc/net/tcp"
STATE = {
'01':'ESTABLISHED',