This file contains 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
http://ur1.ca/mst49 | |
This file contains 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 python | |
class Foo(object): | |
def __init__(self, name): | |
self.name = name | |
def get_name(self): | |
return self.name |
This file contains 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
# suggested changes & improvements | |
- ensure all python code is pep8 compliant (pyflakes, flake8) | |
- ensure all bash code meets common bash standards (bashate) | |
- refactor brewpi-script into a proper python package | |
- move all executable scripts into a /bin directory to be installed to /usr/bin (or /usr/local/bin) | |
- reorganize remaining python modules into appropriate namespaces | |
- provide user expierence of "pip install brewpi-script" (or maybe brewpi-utils name would be more accurate) | |
- this will provide easier path to getting python-brewpi-utils packages into the distro repos | |
- refactor repo to be more platform/distro agnostic | |
- remove dependency checks in the code e.g. (try: import foo except ImportError: print("apt-get install...") |
This file contains 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
// This #include statement was automatically added by the Particle IDE. | |
#include "MQTT/MQTT.h" | |
void callback(char* topic, byte* payload, unsigned int length); | |
/** | |
* if want to use IP address, | |
* byte server[] = { XXX,XXX,XXX,XXX }; | |
* MQTT client(server, 1883, callback); |
This file contains 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
# Option #1, Separate classes w/ workflow class to orchestrate | |
PlanManager | |
create_plan(plan_name, templates) | |
get_plan(plan_name) | |
update_plan(plan_name, templates) | |
delete_plan(plan_name) | |
DeploymentOptionsManager | |
get_deployment_template_resource_types(plan_name) |
This file contains 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
// Josiah's sample cpp program with classes | |
// 3 files | |
// - main.cpp: this is the main program executed at the command line | |
// - hello_world.h: the header file for your class | |
// - hello_world.cpp: the implementation file for you class | |
// main.cpp | |
#include "hello_world.h" | |
int main () |
This file contains 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 argparse | |
import csv | |
import os | |
import sys | |
def parse_opts(argv): | |
parser = argparse.ArgumentParser( | |
description='Transform a csv file to desired formatting for ' | |
'dumb proprietary software that does not use a well' |
This file contains 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
# Copyright 2015 Red Hat, Inc. | |
# All Rights Reserved. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); you may | |
# not use this file except in compliance with the License. You may obtain | |
# a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software |
This file contains 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 django.http import HttpResponse | |
def index(request): | |
return HttpResponse("Hello, world.") |
This file contains 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
ERROR: An unexpected error prevented the server from fulfilling your request. [Errno 12] Cannot allocate memory (HTTP 500) | |
This problem can occur when running openstack in a memory constrained environment. | |
Mysql has a feature where it reserves a certain amount of ram based on the size of | |
the databases it contains. | |
The logs showed the following: | |
Dec 11 13:50:57 localhost.localdomain keystone-all[1777]: (keystone.common.wsgi): 2013-12-11 13:50:57,766 ERROR [Errno 12] Cannot allocate memory | |
Dec 11 13:50:57 localhost.localdomain keystone-all[1777]: Traceback (most recent call last): | |
Dec 11 13:50:57 localhost.localdomain keystone-all[1777]: File "/opt/stack/venvs/keystone/lib/python2.7/site-packages/keystone/common/wsgi.py", line 235, in __call__ |
OlderNewer