Skip to content

Instantly share code, notes, and snippets.

View iamsudip's full-sized avatar
:octocat:
Email is the best way to reach me :)

iamsudip

:octocat:
Email is the best way to reach me :)
View GitHub Profile
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
labels:
app: kube-prometheus-stack
release: prometheus
name: job-failure-test
spec:
groups:
- name: CronJobAlert
- alert: CronJobStatusFailed
expr: |
job_cronjob:kube_job_status_failed:sum
* ON(cronjob) GROUP_RIGHT()
kube_cronjob_labels
> 0
for: 1m
annotations:
description: '{{ $labels.cronjob }} last run has failed {{$value }} times.'
@iamsudip
iamsudip / extract_tf_vars.py
Last active April 26, 2019 09:32
Terraform Varible Extractor
#!/usr/bin/env python
# I use it by keeping it in /usr/local/bin as extract_tf_vars
# When I'm finished writing module I execute $ extract_tf_vars `pwd`
import os
import re
import sys
module_path = sys.argv[1]
@iamsudip
iamsudip / gist:52e89c7671386ead230b
Last active August 29, 2015 14:24
Important links
http://curl.trillworks.com/ #Convert cURL syntax to Python requests, Node request
@iamsudip
iamsudip / random gist.py
Created April 10, 2015 19:56
random gist
import codecs, locale, sys
encoding = sys.stdout.encoding or locale.getpreferredencoding()
encoder = codecs.getwriter(encoding)
sys.stdout = encoder(sys.stdout,'backslashreplace')
@iamsudip
iamsudip / .bashrc
Last active September 23, 2015 15:04
.bashrc
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
# append to the history file, don't overwrite it
shopt -s histappend
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000