Skip to content

Instantly share code, notes, and snippets.

@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 / simple_juju_action.py
Last active January 18, 2017 20:17
simple_juju_action.py
#!/usr/bin/env python3.5
# This code runs a custom action called update-app
# on all units of app-web and app-worker applications
# Must have the following environment vars available
# - JUJU_USER
# - JUJU_PASSWORD
# - CONTROLLER_ENDPOINT
# - MODEL_UUID
# - GIT_COMMIT
@jamesbeedy
jamesbeedy / .bashrc
Last active January 19, 2017 16:52
.bashrc bit for .juju_context.py
#!/bin/bash
# ~/.bashrc or ~/.profile
function show_juju_env {
local currentEnv
currentEnv=`~/.juju_context.py`
printf "%s" "$currentEnv"
}
export PS1="[\[\e[38;5;70m\]\$(show_juju_env)\[\e[0m\]] ${PS1}";