Skip to content

Instantly share code, notes, and snippets.

View toabctl's full-sized avatar

Thomas Bechtold toabctl

  • Canonical
  • Berlin/Germany
View GitHub Profile
@toabctl
toabctl / os-server-running.py
Created April 2, 2020 18:38
Running OpenStack servers
#!/usr/bin/python3
import argparse
import datetime
import sys
import openstack
def _parser():
parser = argparse.ArgumentParser(
@toabctl
toabctl / teuthology-stats.py
Created January 24, 2020 07:32
Get number of Ceph teuthology test cases over time
#/usr/bin/python3
"""
Get statistics out of teuthology
This needs a ceph repo git checkout.
Author: Thomas Bechtold <[email protected]>
License: Apache-2.0
"""
@toabctl
toabctl / heat-template.yml
Created March 19, 2019 12:16
OpenStack Heat template example
heat_template_version: 2016-10-14
description: >
Template for deploying Ardana in a multinode setup
parameters:
key_name:
type: string
label: Key Name
description: Name of key-pair to be used for compute instance
#!/usr/bin/python
#
# Create insert statements and do rollbacks to a database (bsc#1120593)
# TODO:
# - Create the database 'testdb'
# - Grant user access with something like: GRANT ALL PRIVILEGES ON testdb.* TO 'keystone'@'%';
#
# Author: Thomas Bechtold <[email protected]>
#
@toabctl
toabctl / github-compare
Created January 4, 2019 06:03
Get changes for a github project
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2016 SUSE Linux GmbH
# Author: Thomas Bechtold <[email protected]>
from __future__ import print_function
import argparse
#!/bin/bash
set -e
# Author: Thomas Bechtold <[email protected]>
# License: Apache-2.0
# List of project for running the doc generation
heat_template_version: 2016-10-14
description: >
Template for deploying Ardana in a multinode setup
parameters:
key_name:
type: string
label: Key Name
description: Name of key-pair to be used for compute instance
@toabctl
toabctl / cloud-init-create-seed
Created November 22, 2017 09:17
Create a config drive iso for cloud-init
cat <<EOF > user-data
#cloud-config
debug: True
disable_root: False
ssh_deletekeys: False
ssh_pwauth: True
ssh_authorized_keys:
- ssh-rsa XXX
# users:
@toabctl
toabctl / picture-fill-location.py
Last active November 17, 2017 13:15
Fill Iptc/Xmp tags based on GPS location and OpenStreetMap data
#!/usr/bin/python3
# Author: Thomas Bechtold <[email protected]>
import argparse
import os
import requests
import time
# GNOME gobject introspection
@toabctl
toabctl / keystone_token_get.py
Created September 8, 2017 08:11
Get a keystone token for time measurements
#!/usr/bin/python
# Copy that script to the node where keystone API is running.
# Use it with:
# PYTHONPATH=. python -m timeit -n 100 -r 1 -s "from keystone_token_get import do_get" "do_get()"
import requests
headers = {'Content-Type': 'application/json'}
data = """