Skip to content

Instantly share code, notes, and snippets.

View marcoceppi's full-sized avatar
.

Marco Ceppi marcoceppi

.
View GitHub Profile
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>George Washington Leadership Lessons</title>
<style type="text/css">
body {
font: 100% LucidaSans, Verdana, Arial, Helvetica, sans-serif;
background-image: url(bg.jpg);
background-color: #444444;
@marcoceppi
marcoceppi / foo.js
Created April 15, 2011 11:56 — forked from lazypower/foo.js
function EmbedVid(someID)
{
html = $('#embed-template').clone();
html.attr('flashvars','value="file=upload/' + someID + '.flv&amp;image=images/vidThumbs/' + someID + '.jpg"');
html.find('embed').attr('flashvars','file=upload/' + someID + '.flv&amp;image=images/vidThumbs/' + someID + '.jpg"');
// better clear the video holder
$('#video-holder').empty();
$('#video-holder').append(html);
}
<html>
<head>
<style type="text/css">
.border{
border: 2px solid #000;
width: 605px;
overflow: hidden;
}
.steps {
border: 1px dashed #c0c0c0;
@marcoceppi
marcoceppi / install
Created November 3, 2011 14:16 — forked from mmm/install
sun java on ubuntu
#!/bin/bash
juju-log "Adding Canonical Partner repository"
RELEASE_CODE=`lsb_release -sc`
add-apt-repository "deb http://archive.canonical.com/ ${RELEASE_CODE} partner"
apt-get update
apt-get -y install -qq --no-install-recommends debconf-utils
echo "sun-java6-plugin shared/accepted-sun-dlj-v1-1 boolean true" | debconf-set-selections
#!/usr/bin/python3
import amulet
d = amulet.Deployment()
d.add('mysql')
d.add('wordpress', units=3)
d.relate('mysql:db', 'wordpress:db')
d.configure('wordpress', tuning='bare')
@marcoceppi
marcoceppi / looking.py
Last active August 29, 2015 13:55 — forked from lazypower/looking.py
def validate_database_relationship():
#Connect to the sentrys and fetch the transmitted details
sent_config = d.sentry.unit['mysql/0'].relation('db', 'owncloud:db')
#Connect to owncloud's sentry and read the configuration PHP file
prod_config = d.sentry.unit['owncloud/0'].file_contents('/var/www/owncloud/config/config.php')
cfg_to_check = {'dbuser': 'user', 'dbpass': 'password', 'dbhost': 'host'}
for cfg_file_key, juju_cfg_key in cfg_to_check.items():
#Search the return string of the config for the transmit values
if prod_config.find("'%s' => '%s'" % (cfg_file_key, sent_config[juju_cfg_key]) == -1:

Testing Juju Charms with Vagrant

Notes:

Place the vagrant file in your $CHARM_DIR root. This may move at a later date, but for internal testing, just put it there and stop fighting me on this.

Also fetch the supporting juju-vagrant-setup.sh script - this is the driver behind the vagrant automation until we find a better process to execute the code. Embedding bash inline in a yaml file is supported: but the yaml parser chokes if you have #'s inline. It interprets the rest of the line as a comment regardless of scope. end. of. story.

Instructions on Use:

@marcoceppi
marcoceppi / my-openstack.yaml
Last active October 6, 2015 22:57 — forked from jamesbeedy/stack-up.sh
stack-up.sh
services:
rabbitmq-server:
charm: cs:trusty/rabbitmq-server
options:
management_plugin: 'true'
to:
- lxc:10
ceilometer:
charm: ceilometer
options:
@when('leadership.is_leader')
def add_leader_config():
render_master_config()
@when_not('leadership.is_leader')
def add_slave_config():
render_slave_config()
@when('leadership.is_leader')

Assumptions: the charm name is fluentd

Submitting a layered charm

Register an account on launchpad, if you don't already have one. You'll need the name later in the process.

  1. Create a launchpad branch of the deployable charm
[~/charms/layers/fluentd] $ charm build