Skip to content

Instantly share code, notes, and snippets.

View AlanCoding's full-sized avatar

Alan Rominger AlanCoding

  • Red Hat
  • Durham, NC
View GitHub Profile
@AlanCoding
AlanCoding / README.md
Last active March 4, 2020 14:38
collection migration notes

AWX collection migration story

This gist is about a one-off process to convert the tower_* modules in Ansible core into the AWX collection, and some miscelaneous tasks like cherry picking content in the interium period.

We started out using the content collector tool, with some modifications. This extremely hacky bash script is what I used to document my steps. In the end, we did not use the tree created from this tool, but I did use it to check that what we had is right by diffing between the files it created and what my more

@halberom
halberom / ansible.cfg
Last active June 18, 2021 07:50
ansible - testing constructed inventory plugin
[inventory]
enable_plugins = ini, constructed
@AmeliaBR
AmeliaBR / basic-marker.svg
Created July 5, 2017 01:08
Testing SVG files in GitHub Gists
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@runekaagaard
runekaagaard / list_all_model_signals.py
Last active July 4, 2022 15:41 — forked from voldmar/signals.py
List all signals by model and signal type. Tested with Django 1.7.
# coding:utf-8
import gc
import inspect
import ctypes
from collections import defaultdict
from django.core.management.base import BaseCommand
from django.db.models.signals import *
@darklow
darklow / celery_tasks_error_handling.py
Last active April 20, 2024 16:25
Celery tasks error handling example
from celery import Task
from celery.task import task
from my_app.models import FailedTask
from django.db import models
@task(base=LogErrorsTask)
def some task():
return result
class LogErrorsTask(Task):
@jhgaylor
jhgaylor / through_relationships.py
Last active May 7, 2024 19:54
Example of using a through model in Django and filtering by a value on the custom through model.
class A(models.Model):
things = models.ManyToManyField("B", through=ThroughModel)
class B(models.Model):
text = models.TextField()
class ThroughModel(models.Model):
a = models.ForeignKey(A)
b = models.ForeignKey(B)
extra = models.BooleanField()
@martin-ueding
martin-ueding / dog.py
Created January 27, 2012 17:43
running dog with alarm clock
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2012 Martin Ueding <dev@martin-ueding.de>
"""
Based on a Question from "Physics - Stack Exchange".
http://physics.stackexchange.com/questions/20083/riddle-about-speed
"""