Skip to content

Instantly share code, notes, and snippets.

View ckelner's full-sized avatar
🐕‍🦺
Datadog

Chris Kelner ckelner

🐕‍🦺
Datadog
View GitHub Profile
@ckelner
ckelner / BCN_2013.md
Last active December 27, 2015 09:09
Spain Trip 2013

#BCN 2013

Flights

Going

ATLANTA to DALLAS FT WORTH
American Flight #314
Take-off at: 12:45 PM Sunday Dec 08 2013
Lands at: 2:10 PM Sunday Dec 08 2013
Seats: 13A/B
@Gary-Armstrong
Gary-Armstrong / Cannot Destroy
Last active January 6, 2016 16:35
Terraform Adventure in which Commenting or Removing the Instance Resource does not Cause a Destroy
garmstrong-ml:config-qa-aws-us-east-1 gary.armstrong$ grep aws_instance terraform.tfstate
"aws_instance.bastion": {
"type": "aws_instance",
garmstrong-ml:config-qa-aws-us-east-1 gary.armstrong$ terraform destroy -target=aws_instance.bastion
Do you really want to destroy?
Terraform will delete all your managed infrastructure.
There is no undo. Only 'yes' will be accepted to confirm.
Enter a value: yes
@ssbarnea
ssbarnea / gitlab.py
Created June 26, 2015 13:33
datadog gitlab integration
from checks import AgentCheck
import psycopg2 as pg
class GitlabCheck(AgentCheck):
def __init__(self, name, init_config, agentConfig):
AgentCheck.__init__(self, name, init_config, agentConfig)
self.name = init_config.get('name', 'gitlab')
@olivielpeau
olivielpeau / README.md
Last active February 7, 2018 21:00
Run JMXFetch as a different user (to use AttachAPI for instance)

These instructions are known to work with version 5.10.1 of the packaged linux Datadog Agent

Using the AttachAPI can require running JMXFetch as the same user as the JVM you want to monitor.

To run JMXFetch as the jmv_user user (once you've identified which user your JVM is running as), please follow these steps:

  1. Make 2 changes on the /etc/dd-agent/supervisor.conf file: supervisord should be configured to run with user=root and jmxfetch with user=jvm_user. See lines 20 and 58 of the attached file below.
  2. Add jvm_user to the dd-agent group (on Debian distros: sudo usermod -G dd-agent jvm_user, on RHEL: sudo gpasswd -a jvm_user dd-agent)
  3. Grant the dd-agent group write access to the JMXFetch log file and the agent's run directory (/opt/datadog-agent/run/): sudo chmod -R g+w /var/log/datadog/jmxfetch.log /opt/datadog-agent/run/
@burnsie7
burnsie7 / multi_org_hosts_count.py
Created July 29, 2018 21:35
multi_org_hosts_count.py
import datetime
import time
import requests
import simplejson
from datadog import initialize, api
"""
This script gives a real time report on ec2 and Datadog agent host usage
from multiple organizations and reports them up to the 'main' parent account.
#!/usr/bin/env python
# This is a trick, to output the bash commands we need to run in shell, and just execute this script inside an eval within our shell, so it imports what we need
# Possibly tie this in with https://gist.github.com/mbainter/b38a4cb411c0b5c1bae6 for MFA support
# Will need to durably store MFA access tokens, possibly in some other env vars
# Could also store all different keys/info in different vars, to reuse as needed (lots of env vars though, file may be better)
import os
import sys
import getpass
@burnsie7
burnsie7 / log_redaction_examples.md
Created March 11, 2020 15:58
PII Log Redaction

Log Processing Rules

log_processing_rules:

Generic String: "sensitive-info"

  - type: exclude_at_match
    name: exclude_sensitive_info
    pattern: (?:sensitive\-info)
@tir38
tir38 / terminalTimer.sh
Last active August 26, 2020 14:10
in-terminal timer shell script
# script to create timer in terminal
# Jason Atwood
# 2013/6/22
#!/bin/sh
# start up
echo "starting timer script ..."
sleep 1 # seconds
# get input from user
@johnschrom
johnschrom / gist:8638763
Last active January 5, 2021 21:20
Making a map of foursquare checkins
library(ggplot2)
library(maps)
library(mapproj)
###############################################################################
# Step 1: Get data from Foursquare
# If you already have it, then great :) Otherwise, you can use RPI. The source
# is listed below, and there are instructions for getting keys in the readme.
# RPI: https://github.com/johnschrom/RPI
@rokibhasansagar
rokibhasansagar / gitclean.sh
Last active September 6, 2023 18:02 — forked from Zibri/gitclean.sh
Bash script to remove all revisions from github or gist repository.
#!/bin/bash
#
# By Zibri (2019)
# Modified by @rokibhasansagar
#
# Usage: gitclean git-repo-url
#
gitclean ()
{
git clone "$1" workDir && {