This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# sudo apt install jq | |
# add this to ~/.bashrc | |
# source ~/.bashrc | |
function show_juju_env { | |
local model | |
local controller |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from charms.reactive import when_not, set_flag, hook, when | |
from charmhelpers.core.host import mount, mkdir | |
from charmhelpers.core.hookenv import storage_get, storage_list, status_set | |
from charmhelpers.contrib.storage.linux.utils import is_device_mounted | |
from charmhelpers.contrib.storage.linux.ceph import make_filesystem |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
instance-id: maas-region-controller-00 | |
local-hostname: maas-region-controller-00 | |
public-keys: | |
- ssh-key |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
basedir = os.path.abspath(os.path.dirname(__file__)) | |
APP_DIR = os.path.abspath(os.path.dirname(__file__)) | |
PROJECT_ROOT = os.path.abspath( | |
os.path.join(os.path.abspath(os.path.dirname(__file__)), os.pardir) | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import OrderedDict | |
# ... | |
class OrderFormMixin(object): | |
''' | |
To apply add to Meta 'order' iterable | |
''' | |
def __init__(self, *args, **kwargs): | |
super(OrderFormMixin, self).__init__(*args, **kwargs) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import yaml | |
PRIVATE_IP = "100.100.100.100" | |
WEB_PORT = 9000 | |
API_PORT = 9001 | |
services = [{'service_name': "mytestservice", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyspark.sql import SparkSession | |
from pyspark.ml import Pipeline | |
from pyspark.ml.classification import LogisticRegression | |
from pyspark.ml.feature import HashingTF, Tokenizer | |
import random | |
from random import randint | |
spark = SparkSession.builder.master("local").appName("Word Count").getOrCreate() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HttpProvides(Endpoint): | |
@when('endpoint.{endpoint_name}.joined') | |
def joined(self): | |
set_flag(self.expand_name('{endpoint_name}.available')) | |
@when_not('endpoint.{endpoint_name}.joined') | |
def broken(self): | |
clear_flag(self.expand_name('{endpoint_name}.available')) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask | |
app = Flask(__name__) | |
@app.route('/') | |
def hello_world(): | |
return "Hello World" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
applications: | |
easyrsa: | |
charm: 'cs:~containers/easyrsa-23' | |
constraints: "spaces=nat" | |
num_units: 1 | |
annotations: | |
gui-x: '450' | |
gui-y: '550' | |
etcd: | |
charm: 'cs:~containers/etcd-59' |