Skip to content

Instantly share code, notes, and snippets.

@when('feed.redis.available', 'feed.postgresql.available',
'feed.installed', 'nginx.passenger.available',
'feed.env.vars.available', 'tls.server.certificate available')
@when_not('feed.web.configured')
def configure_webserver():
'''Configure nginx
'''
status_set('maintenance', 'Configuring website')
@jamesbeedy
jamesbeedy / Install-php7.md
Created September 28, 2016 03:14 — forked from hollodotme/Install-php7.md
Installing php7-fpm with phpredis and xdebug extension on Ubuntu 14.04

Install php7.0-fpm

# remove php5 modules
apt-get autoremove --purge php5-*
# add php-7.0 source list by [Ondřej Surý](https://github.com/oerdnj)
add-apt-repository ppa:ondrej/php
# Update index
apt-get update
# Install php7.0-fpm with needed extensions
@jamesbeedy
jamesbeedy / ssl_core_logic.py
Last active October 25, 2016 21:17
core logic outline for all-encompassing ssl/tls layer
# Generic core logic outline for all-encompassing ssl/tls layer
# user specified crt/key should get highest priority
# if you set 'key' and 'crt', they will be used above all else
if config('crt') and config('key'):
write_out_user_cert_key()
# config('use-le') will default to False, so if
# the user wants it, they can set this to get it
# alongside not specifying a key/crt
#!/bin/bash
set -e
# Export variables needed to build charms
echo "export CHARM_ROOT=$HOME/allcode/charms” >> ~/.bashrc
echo "export LAYER_PATH=$CHARM_ROOT/layers” >> ~/.bashrc 12:31
echo "export INTERFACE_PATH=$CHARM_ROOT/interfaces” >> ~/.bashrc
echo "export JUJU_REPOSITORY=$CHARM_ROOT/repo” >> ~/.bashrc 12:32
source ~/.bashrc
series: xenial
machines:
0:
series: xenial
constraints: "spaces=barbican"
1:
series: xenial
constraints: "spaces=barbican"
2:
series: xenial
@jamesbeedy
jamesbeedy / es.yaml
Created December 21, 2016 19:55
elasticsearch package doesn't work in lxc
#cloud-config
output:
all: "|tee -a /tmp/cloud.out"
bootcmd:
- curl -sL https://artifacts.elastic.co/GPG-KEY-elasticsearch | apt-key add -
apt_sources:
- source: "deb https://artifacts.elastic.co/packages/5.x/apt stable main"
packages:
- elasticsearch
runcmd:
#!/usr/bin/env python3
import sys
import asyncio
import aiohttp
from juju.model import Model
username = sys.argv[1]
password = sys.argv[2]
#!/usr/bin/env python3
import asyncio
import functools
import logging
import signal
import sys
from concurrent.futures import CancelledError
from juju.model import Model
#!/usr/bin/env python3
import functools
import sys
import signal
import asyncio
import aiohttp
import logging
from juju.model import Model
@jamesbeedy
jamesbeedy / .juju_context.py
Last active September 12, 2017 22:43
python script to show juju controller:model in bash prompt
#!/usr/bin/env python3
# For OS X
# brew install python3
# sudo -H pip3 install pyyaml
import yaml
import os
JUJU_HOME = os.path.join(os.environ['HOME'], '.local', 'share', 'juju')