Skip to content

Instantly share code, notes, and snippets.

Allegiance: Legion of Sacrament
Mortal Realm: Shyish
Arkhan the Black, Mortarch of Sacrament (320)
- General
Wight King with Baleful Tomb Blade (120)
- Mount: Steed
Necromancer (110)
Necromancer (110)
Necromancer (110)
40 x Skeleton Warriors (280)
foobar
@jaimegago
jaimegago / carbon-cache.conf
Created July 13, 2016 19:54 — forked from dbeckham/carbon-cache.conf
Graphite carbon-cache Upstart job - This upstart job attempts to duplicate the twistd configuration and command line options that carbon-cache.py uses, but will not daemonize so that an Ubuntu system can properly control carbon-cache. One caveat: the current version (as of 0.9.12) of the carbon code intentionally forces logging to STDOUT if the …
# carbon-cache-a upstart job
#
# Daniel Beckham
# @dbeckham
# https://github.com/dbeckham
#
# Tested with Graphite carbon tag v0.9.12 from:
# https://github.com/graphite-project/carbon
#
# Upstart config: /etc/init/carbon-cache-a.conf
@jaimegago
jaimegago / slack_graphite
Last active June 25, 2016 00:31
slack graphite integration in flask (/graphite command)
from flask import Flask
from flask import request
from flask import Response
import json
import urlparse
app = Flask(__name__)
@app.route('/graphite', methods=['GET', 'POST'])
def graphite_png():
@jaimegago
jaimegago / chef_lib_hash_to_string.rb
Last active May 24, 2016 04:27
chef_lib_hash_to_string
# This goes in <my_app_coobkook>/libraries/default.rb
class Chef
class Resource
def hash_to_s hash
hash.map do |k,v|
k.to_s + '=' + v.to_s
end.join("\n") + "\n"
end
end
@jaimegago
jaimegago / sensu-keepalive-delete
Created July 17, 2015 18:12
Sensu delete dead clients
#!/usr/bin/python -tt
import json
import optparse
import requests
import sys
def get_dead_sensu_clients(sensu_server, sensu_port):
get_dead_clients_url = 'http://%s:%s/events' % (sensu_server, sensu_port)
@jaimegago
jaimegago / ansible_download_apache_access_logs
Created June 16, 2015 06:11
An ansible playbook to dowwload all the apache access log files
---
- hosts: all
sudo: yes
tasks:
- name: "Get all the access log file paths"
shell: "ls /var/log/apache2/access.log*"
register: ls_output
- name: "Download all the apache logs"
fetch: src={{ item }} dest="logs"
@jaimegago
jaimegago / netscaler_nitro_config_stats
Last active June 21, 2023 18:36
Python script targeting Citrix Netscaler Nitro REST API to find which Netscaler config objects have stats associated with them
#!/usr/bin/python -tt
import requests
user = 'nsroot'
password = 'nsroot'
netscaler = 'my_netscaler_fqdn_or_ip'
url = 'http://%s/nitro/v1/config/' % netscaler
response = requests.get(url, auth=(user, password))
@jaimegago
jaimegago / graphite_url_api_pngs
Created March 5, 2015 02:31
Python script to create and download PNG graphs via Graphite Render URL API
#!/usr/bin/python -tt
import requests
graphite_targets = [
'some.graphite.metric.target',
'another.graphite.metric.target
]
graphite = 'some_graphite_host'
@jaimegago
jaimegago / install_ansible_from_source_deb
Created June 17, 2014 19:14
Ansible install from source on a debian/ubuntu box
#!/bin/bash
# bootstrap-ansible.sh: download and build Ansible on Debian host
# https://github.com/ginas/ginas/
set -e
# Create temporary directory for build
build_dir=$(mktemp -d)
trap "rm -rf ${build_dir}" EXIT