Skip to content

Instantly share code, notes, and snippets.

Avatar

Michael Rice michaelrice

View GitHub Profile
@michaelrice
michaelrice / pr.md
Created Nov 4, 2020 — forked from piscisaureus/pr.md
Checkout github pull requests locally
View pr.md

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@michaelrice
michaelrice / catalog_gen.py
Created Jan 23, 2020
Python script to generate a catalog file for digital rebar
View catalog_gen.py
import json
with open("rackn.json") as jf:
data = json.load(jf)
version = "stable"
new_file = "new_catalog.json"
items = data['sections']['catalog_items']
new_catalog = {}
new_catalog['meta'] = data['meta']
new_catalog['sections'] = {}
View 1. rackn-api-training-complete-stage.json
{
"Available": true,
"BootEnv": "local",
"Bundle": "",
"Description": "Stage that represents workflow completion to local disk boot but leaves the runner running.",
"Documentation": "",
"Endpoint": "",
"Errors": [],
"Meta": {
"color": "green",
View curves
secp112r1 : SECG/WTLS curve over a 112 bit prime field
secp112r2 : SECG curve over a 112 bit prime field
secp128r1 : SECG curve over a 128 bit prime field
secp128r2 : SECG curve over a 128 bit prime field
secp160k1 : SECG curve over a 160 bit prime field
secp160r1 : SECG curve over a 160 bit prime field
secp160r2 : SECG/WTLS curve over a 160 bit prime field
secp192k1 : SECG curve over a 192 bit prime field
secp224k1 : SECG curve over a 224 bit prime field
secp224r1 : NIST/SECG curve over a 224 bit prime field
View gist:add5068a5c31ea36c960f0cc82fa84b7
class GifViewsTest(TestCase):
def setUp(self):
self.user = CustomUser(username="test1", password="passthis")
self.user.save()
self.user.full_clean()
def test_logged_in_index_uses_correct_template(self):
self.client.login(
username=self.user.username,
View rules.json
[root@pike-aio ~(keystone_admin)]# keystone-manage mapping_engine --rules rules.json --input rules.test
{
"group_ids": [],
"user": {
"domain": {
"name": "Default"
},
"type": "local",
"name": "bob"
},
View saml.xml
<saml2:Attribute Name="groups" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified">
<saml2:AttributeValue
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="xs:string">
fed_member_of_fishing_accounting
</saml2:AttributeValue>
<saml2:AttributeValue
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
View mellon_create_metadata.sh
#!/usr/bin/env bash
# Copyright 2018 Michael Rice <michael@michaelrice.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
View gist:c843480802da5e1ba05309e89bbe5ff5
cinder_api_local_check--aio1_cinder_api_container-21f5dbb0.yaml
cinder_backup_check--aio1.yaml
cinder_scheduler_check--aio1_cinder_scheduler_container-ce43a4a2.yaml
cinder_vg_check--aio1.yaml
cinder_volume_lvm_check--aio1.yaml
conntrack_count--aio1.yaml
cpu_check--aio1.yaml
disk_utilisation--aio1.yaml
filesystem_.--aio1.yaml
filesystem_.srv.swift1.img--aio1.yaml
View gist:3c1531eba7edfad8f57c212e1dc70181
Deferring keystone exception: __init__() takes exactly 7 arguments (6 given)
command: token issue -> openstackclient.identity.v3.token.IssueToken
__init__() takes exactly 7 arguments (6 given)
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/cliff/app.py", line 380, in run_subcommand
self.prepare_to_run_command(cmd)
File "/usr/local/lib/python2.7/dist-packages/openstackclient/shell.py", line 196, in prepare_to_run_command
return super(OpenStackShell, self).prepare_to_run_command(cmd)
File "/usr/local/lib/python2.7/dist-packages/osc_lib/shell.py", line 429, in prepare_to_run_command
self.client_manager.setup_auth()