Skip to content

Instantly share code, notes, and snippets.

@lbragstad
lbragstad / ansible.log
Last active November 6, 2019 15:43
TripleO Deploy Logs
2019-11-05 19:58:55,443 p=23117 u=mistral | Using /var/lib/mistral/overcloud/ansible.cfg as config file
2019-11-05 19:58:57,325 passlib.registry registered 'md5_crypt' handler: <class 'passlib.handlers.md5_crypt.md5_crypt'>
2019-11-05 19:58:57,335 p=23117 u=mistral | PLAY [Gather facts from undercloud] ********************************************
2019-11-05 19:58:57,346 p=23117 u=mistral | Tuesday 05 November 2019 19:58:57 +0000 (0:00:00.132) 0:00:00.132 ******
2019-11-05 19:59:04,156 p=23117 u=mistral | TASK [Gathering Facts] *********************************************************
2019-11-05 19:59:04,157 p=23117 u=mistral | ok: [undercloud]
2019-11-05 19:59:04,196 p=23117 u=mistral | PLAY [Gather facts from overcloud] *********************************************
2019-11-05 19:59:04,284 p=23117 u=mistral | Tuesday 05 November 2019 19:59:04 +0000 (0:00:06.937) 0:00:07.069 ******
2019-11-05 19:59:06,436 p=23117 u=mistral | TASK [Gathering Facts] ***************************************
@lbragstad
lbragstad / README.md
Last active October 28, 2019 16:54
oslopolicy-checker demo

oslopolicy-checker demo

This document describes how you can get the right information to effectively use oslopolicy-checker. The tool requires a token which is evaluated by the oslo.policy enforcer object. You can do this easily by exporting a cloud profile and using python-openstackclient.

~ cat /etc/openstack/clouds.yaml 
clouds:
  devstack-system-admin:
    auth:
@lbragstad
lbragstad / README.md
Last active February 6, 2019 20:20
A simple exercise in go

Shapes

You need to use structs to model triangles and squares. Your module should have a printArea() that takes a shape as a receiver. The printArea() function should call an interface (e.g., getArea) that is implemented by your shapes and contains the implementation for calculating the area for those shapes. Shapes cannot have negative values.

Tests

@lbragstad
lbragstad / returning_pointers.go
Last active February 6, 2019 16:02
The difference in returning values and errors from methods in golang
package main
import (
"errors"
"fmt"
)
// Triangle is a struct for modeling triangle shapes
type Triangle struct {
base, height float64
@lbragstad
lbragstad / hash
Last active January 23, 2019 20:54
Hash a DN
#! /usr/bin/env python
import argparse
import hashlib
parser = argparse.ArgumentParser(description='Hash DN')
parser.add_argument('dn')
args = parser.parse_args()
hashed = hashlib.sha256(args.dn)
@lbragstad
lbragstad / README.md
Last active January 17, 2019 18:29
Simple Public Key Cryptography Examples

Simple Public Key Cryptography Examples

I was following the examples in a post but rewrote the mathematical terminology so that it read a little bit easier.

RSA Example

A simple RSA example showing how to generate a public and private key pair for asymmetric encryption.

@lbragstad
lbragstad / clouds.yaml
Created January 8, 2019 14:56
System scope clouds.yaml
clouds:
system-admin:
auth:
auth_url: http://localhost/identity
password: password
user_domain_id: default
username: admin
system_scope: all
identity_api_version: '3'
region_name: 'RegionOne'
@lbragstad
lbragstad / ftplugin-python.vim
Last active December 4, 2018 21:41
Dotfiles
" Set tabs to 4 spaces
set tabstop=4
" Use 4 spaces for auto indentation
set shiftwidth=4
" Use 4 spaces for tabs when editing
set softtabstop=4
" Number of space to use when replacing tabs
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCozwlzKqO1DB8Kjk0UwFutImiP0F2Jp082vd9UECRBEpGDk/egH25NhwdMBqEnG+VHmiB3KkR174oyomW2qcMxE45gx0nDfsaxuA0uT+s2YlvHAP09HRmHjlzEmtTtsUnAxmYkPZnzo74jcJE6fdszXOfOm+YvXfHdEU3JXS7U6C7giBZ1ThFExwRtlAYm9QZa3Uqe/xSl0p3T/BvvD3KimZlCI0iDHIHwSbm04KHjHrVnoG3jWMRZFHylnHzFbSihHIAK5xRhMw84+AicSf9h5mVNZGokby88qI6HDKJBqz4EK+PPnOMEGZw24vigtPucKju4znD2H7txwvZBosZb lance@x1c
@lbragstad
lbragstad / policies.yaml
Last active September 19, 2018 17:47
Inconsistent Policies
# cinder
"volume:create_volume_metadata": "rule:admin_or_owner"
"volume:delete_snapshot_metadata": "rule:admin_or_owner"
"backup:export-import": "rule:admin_api"
"volume:failover_host": "rule:admin_api"
"volume_extension:capabilities": "rule:admin_api"
"context_is_admin": "role:admin"
"volume_extension:volume_admin_actions:force_detach": "rule:admin_api"
"volume_extension:types_extra_specs:delete": "rule:admin_api"
"backup:delete": "rule:admin_or_owner"