Skip to content

Instantly share code, notes, and snippets.

{% for book in books %}
<li>{{ book }}</li>
{% empty %}
<li>Sorry, there are no books.</li>
{% endfor %}
@Alien-Leon
Alien-Leon / django.rules.yml
Created December 3, 2019 14:01
new prometheus rules for [django-prometheus](https://github.com/korfuri/django-prometheus)
groups:
- name: django.rules
rules:
- record: job:django_http_requests_before_middlewares_total:sum_rate30s
expr: sum(rate(django_http_requests_before_middlewares_total[30s])) BY (job)
- record: job:django_http_requests_unknown_latency_total:sum_rate30s
expr: sum(rate(django_http_requests_unknown_latency_total[30s])) BY (job)
- record: job:django_http_ajax_requests_total:sum_rate30s
expr: sum(rate(django_http_ajax_requests_total[30s])) BY (job)
- record: job:django_http_responses_before_middlewares_total:sum_rate30s
@alikins
alikins / start-bisect.sh
Created June 21, 2018 19:44
start-bisect.sh
#!/bin/bash
# This needs to be run from the ansible git checkout (not the repro dir,
# despite it living there)
git checkout devel
# flip the terms so we bisect inverse/backwards/flipflopped/orthonally
git bisect start --term-old broken --term-new fixed
@mkrizek
mkrizek / 36028.sh
Created February 26, 2018 13:42
repro-36028
#!/bin/bash
DIR=tmp_36028
mkdir -p $DIR/roles/{my_role,my_role2}/{tasks,library}
cat > $DIR/playbook.yml << EOF
- hosts: localhost
gather_facts: no
roles:
@jctanner
jctanner / reproducer.sh
Created January 3, 2018 19:54
openshfit ansible memory reproducer
#!/bin/bash
mkdir -p strategy_plugins
mkdir -p roles
# roles are in a nested dir from a separate tools repo
if [ ! -d openshift-tools ]; then
git clone https://github.com/openshift/openshift-tools
fi
if [ ! -s roles/tools_roles ]; then
- name: Demonstrate memory growth as tasks are included
hosts: localhost
gather_facts: false
tasks:
- include: foo/some_tasks.yml
with_sequence: start=1 end=10
- include: foo/some_tasks.yml
@jeremywen
jeremywen / community-builds-from-source.sh
Last active January 30, 2018 15:08
This script pulls down the VCV Rack community repo, finds source urls, pulls down source repos, and builds plugins.
#!/bin/bash
#################################################################################################################################
# community-builds-from-source.sh
# by Jeremy Wentworth
#
# This script pulls down the VCV Rack community repo, finds source urls, pulls down source repos, and builds plugins.
#
# This script requires:
# git - https://git-scm.com/
@ryantuck
ryantuck / gpg_test.py
Last active April 30, 2024 23:44
working example of using gnupg in python
# install:
# pip3 install python-gnupg
# note - gpg needs to be installed first:
# brew install gpg
# apt install gpg
# you may need to also:
# export GPG_TTY=$(tty)
@alikins
alikins / gist:11f21669b8a9e4a430531844ca3cbc20
Created November 16, 2017 17:32
issue_19305 verbose varman output
# running the playbook at https://gist.github.com/samdoran/339eb1fa15ab9c097859719c40faa5c4
# with ansible branch from https://github.com/alikins/ansible/tree/var_man_changed_inv_plugins
PLAYBOOK: issue_19305.yml ******************************************************************************************************************************************************************************************
1 plays in issue_19305.yml
play_get_vars: role_name=u'role1' scope_info: {'play': u'Issue 19305 - Include role and variable issues'}
magic_variables: play_hosts=[] scope_info: None
magic_variables: playbook_dir=u'/home/adrian/src/ansible' scope_info: None
magic_variables: role_names=[] scope_info: None
play_get_vars: role_name=u'role1' scope_info: {'play': u'Issue 19305 - Include role and variable issues'}
@samdoran
samdoran / issue-19305.yml
Last active November 17, 2017 16:23
Issue 19305
- name: Issue 19305 - Include role and variable issues
hosts: localhost
connection: local
become: no
gather_facts: no
tasks:
- name: Include some roles
include_role:
name: "{{ item }}"