Skip to content

Instantly share code, notes, and snippets.

@jasonthomas
jasonthomas / bulkaddcerts.py
Created January 3, 2017 18:32 — forked from eviljeff/bulkaddcerts.py
snippet to be run in django-admin shell `./manage.py shell` to bulk add certs from 'certs.txt' file in format [issuer: xx serial: yy].
from olympia.blocklist.models import BlocklistDetail, BlocklistIssuerCert
def addCert(issuer, serial, name, bug):
detail = BlocklistDetail(name=name, why='.', who='.', bug=bug)
detail.save()
cert = BlocklistIssuerCert(issuer=issuer, serial=serial, details=detail)
cert.save()
@jasonthomas
jasonthomas / -
Last active August 29, 2015 14:25 — forked from anonymous/-
#!/bin/bash
#
# Poor mans Consul bootstrap helper. Originally we created a configuration snippit in
# /etc/consul.d with a retry_join host of an ELB endpoint. Murphy's law means that
# on occasion the ELB will have Consul connecting to itself.
#
# The AWS API is queried for a list of ELBs that we're behind, and then we get the
# IPs of all other ELB backends and attempt to join them.
# Print messages
DROP TABLE IF EXISTS auth_user_groups;
DROP TABLE IF EXISTS auth_user_user_permissions;
DROP TABLE IF EXISTS django_admin_log;
DROP TABLE IF EXISTS auth_user;
DROP TABLE IF EXISTS addons_categories;
DROP TABLE IF EXISTS categories;
ALTER TABLE files DROP COLUMN is_packaged;
ALTER TABLE addon_payment_account DROP COLUMN set_price;
@jasonthomas
jasonthomas / python27.spec
Created September 24, 2012 17:23 — forked from oremj/python27.spec
A simple RHEL 6 python2.7 spec file
%define binsuffix 27
%define pybasever 2.7
%define version 2.7.3
%define name python
%define release 1pydotorg
Name: %{name}%{binsuffix}
Version: %{version}
Release: %{release}
Summary: An interpreted, interactive, object-oriented programming language.