Skip to content

Instantly share code, notes, and snippets.

@jamesbeedy
jamesbeedy / seqcompar.py
Last active December 30, 2015 05:09
to fight or lay.......
#to fight or lay......
# mysequ
# What some would call working against the language....
def sequ(minimum, maximum, incrementer=None):
seqarry = []
if not incrementer:
incrementer = 1
#!/usr/bin/env python
"""
Real time log files watcher supporting log rotation.
Author: Giampaolo Rodola' <g.rodola [AT] gmail [DOT] com>
License: MIT
"""
import os
server { listen 80;
server_name example.com;
access_log /var/log/example.com/nginx.access.log;
error_log /var/log/example.com/nginx.error.log;
root /var/www/apps/example.com/public;
charset utf-8;
location / {
rewrite ^ https://$host$request_uri? permanent;
}
@jamesbeedy
jamesbeedy / stack-up.sh
Created October 6, 2015 22:16
stack-up.sh
#!/bin/bash
# Bootstrap juju/add bootstrap node
juju bootstrap --to kilo-bootstrap.tfawint.com
sleep 5
# Deploy multi-host by tag
juju add-machine --constraints tags="multi"
sleep 5
# Deploy ceph-osd
juju deploy ceph-osd --constraints tags="osd" --config charmconf.yaml -n 3
sleep 5

OpenVSwitch

Set up bridge patches through openvswitch bridges

This assumes you have tagged vlans 17 and 18 connected to the interface that identifies as eth1

Initially create the bridge that will have a port on the external network, also set vlans to trunk into openvswitch on external port

Fake bridge method

- This will create "fake" bridges vlan17 and vlan18 on primary bridge br-eth1 
relations:
- - nova-compute:amqp
- rabbitmq-server:amqp
- - neutron-gateway:amqp
- rabbitmq-server:amqp
- - keystone:shared-db
- mysql:shared-db
- - nova-cloud-controller:identity-service
- keystone:identity-service
- - glance:identity-service
https://lxadm.wordpress.com/2012/10/17/lvm-thin-provisioning/
#!/bin/bash
apt install python-dev python3-dev python3-pip python-pip libtiff5-dev libjpeg8-dev zlib1g-dev \
libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python-tk virtualenv
virtualenv -p python3 oscar
. ./oscar/bin/activate
pip install django-oscar
series: xenial
description: |
Consul, Consul-agent, Vault bundle
tags:
- security
services:
vault:
charm: cs:~jamesbeedy/vault-12
num_units: 3
annotations: