Skip to content

Instantly share code, notes, and snippets.

View d0ugal's full-sized avatar
👋
Hi!

Dougal Matthews d0ugal

👋
Hi!
View GitHub Profile
@d0ugal
d0ugal / 0-user-setup.sh
Last active June 13, 2016 07:56
TripleO
#!/bin/bash -xe
sudo yum upgrade -y
sudo yum install -y tmux vim wget
sudo useradd stack
echo "stack ALL=(root) NOPASSWD:ALL" | sudo tee -a /etc/sudoers.d/stack
sudo chmod 0440 /etc/sudoers.d/stack
su - stack
pages:
- Home: index.md
- User Guide:
- Writing your docs: index.md
- About:
- License: index.md
- Release Notes:
- Version 1: index.md
- Version 2: index.md
- Version 3: index.md

This is an example of a C program.

You can copy it and try to change some value to try the library.

I exptect you understand all liblapin function
</font color="#A0522D">



import os
from heatclient.v1.client import Client as heat_client
from keystoneclient.v2_0 import client as ksclient
def keystoneclient():
return ksclient.Client(
username=os.environ.get('OS_USERNAME'),
tenant_name=os.environ.get('OS_TENANT_NAME'),
This assumes you already have the API running on the undercloud. Run the
following commands on the undercloud.
$ git clone https://github.com/openstack/tripleo-heat-templates.git
$ python mkplan.py tripleo-heat-templates > plan.json
NOTE: You will need httpie installed for the following commands, otherwise you
can figure out curl ;). It can be installed with:
sudo yum install -y python-pip
sudo pip install httpie
# Call with: python mkplan.py tripleo-heat-templates > plan.json
import sys
import yaml
template_path = sys.argv[1]
import os
templates_dict = {}
# Save this file somewhere and modify parameters as needed. The NeutronControlPlaneID
# must be edited, but the others are optional.
#
# Generate the Keystone certs to a new environment file.
#
# generate-keystone-pki --heatenv keystone-env.json
#
# Now you are ready to deploy.
#
# heat stack-create -t 420 \
@d0ugal
d0ugal / convert.py
Created June 3, 2015 09:27
A simple script to update MkDocs pages config to match the 0.13 style.
"""
This expects you to be in an environment with MkDocs 0.13 or greater installed.
Save the file, run it by passing in a mkdocs.yml and it will print out the
converted version. Copy this into the config, tweak test and you are done!
"""
import click
import yaml
from mkdocs import legacy
@d0ugal
d0ugal / tox.ini
Last active August 29, 2015 14:21
[tox]
envlist = py26,py27,py33,py34
skipsdist = true
[testenv]
commands=
python -c "import codecs, locale; l = codecs.lookup(locale.getpreferredencoding()).name; assert l == 'utf-8', l"
DEFAULTS = {
'title': None,
'output': 'build',
'strict': False,
}
VALIDATORS = {
'title': must_be(str, required=True),
'output': path_validator(exists=True, directory=True, file=False)
'title': must_be(bool, required=True),