Skip to content

Instantly share code, notes, and snippets.

@jhedden
jhedden / gist:877b71537833df7875b5a16cb0b4284f
Created January 3, 2022 16:16
Prometheus curl snippets
# List all unhealthy targets
curl -s 'http://0.0.0.0/api/v1/targets' | jq -r '.data.activeTargets[] | select(.health=="down") | [.labels.job, .labels.app, .lastError] | @csv'
### Keybase proof
I hereby claim:
* I am jhedden on github.
* I am jhedden (https://keybase.io/jhedden) on keybase.
* I have a public key ASCf0PHoZ0_uurVDMZy5e0D2L71FsgcrPojC0CtpL9V0Owo
To claim this, I am signing this object:
@jhedden
jhedden / awx_ad_ldap_cfg.json
Created March 15, 2019 20:59
AWX AD LDAP Config
{
"AUTH_LDAP_SERVER_URI": "ldaps://<LDAP FQDN>:636",
"AUTH_LDAP_BIND_DN": "CN=<CN>,OU=<OU>,OU=UserObjects,DC=<DC HOSTNAME>,DC=<DC DOMAIN>,DC=<DC SUFFIX>",
"AUTH_LDAP_BIND_PASSWORD": "$encrypted$",
"AUTH_LDAP_START_TLS": false,
"AUTH_LDAP_CONNECTION_OPTIONS": {
"OPT_NETWORK_TIMEOUT": 30,
"OPT_REFERRALS": 0
},
"AUTH_LDAP_USER_SEARCH": [
@jhedden
jhedden / hlight.pl
Last active August 29, 2015 14:27 — forked from r4um/hlight.pl
rxvt-unicode highlighter module
#! perl
#
# rxvt-unicode highlighter module
# Highlight text on the console given regex and rendition string
# Specified via hlight.X and hlight.rend.X resources respectively
# Where X is any number for ex 0, 1 etc. for multiple entries.
#
# For example to hilight text "warning", put the following in .Xdefaults
#
# URxvt*hlight.0: warning
@jhedden
jhedden / osx_openstack_cli
Created March 26, 2015 15:17
OSX Openstack CLI tools
# Install home brew from http://brew.sh/
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install python
# Python and PIP brew locations
which python
# /usr/local/bin/python
which pip
# /usr/local/bin/pip
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'
@jhedden
jhedden / ansible_ssh_known_hosts
Created July 11, 2013 15:09
Ansible ssh_known_hosts template
{% for host in groups['all'] %}
{% set hostnames_ips = hostvars[host]['ansible_fqdn'] + ',' + hostvars[host]['ansible_hostname'] + ',' + hostvars[host]['ansible_all_ipv4_addresses']|join(',') %}
{% if hostvars[host]['ansible_ssh_host_key_rsa_public'] %}
{{ hostnames_ips }} ssh-rsa {{ hostvars[host]['ansible_ssh_host_key_rsa_public'] }}
{% endif %}
{% if hostvars[host]['ansible_ssh_host_key_dsa_public'] %}
{{ hostname_ips }} ssh-dsa {{ hostvars[host]['ansible_ssh_host_key_dsa_public'] }}
{% endif %}
{% endfor %}