Skip to content

Instantly share code, notes, and snippets.

View kenju254's full-sized avatar

Kenneth Kinyanjui kenju254

View GitHub Profile
@kenju254
kenju254 / gist:6451279
Created September 5, 2013 14:56
This is how i run my ENC on my puppetmaster
/usr/bin/puppet_node_classifier.py example.something.com
classes: [basenode]
TASK: [user | debug var=user_info] ********************************************
ok: [localhost] => {
"item": "",
"user_info": []
}
TASK: [user | create the edxadmin group] **************************************
ok: [localhost]
TASK: [user | ensure sudoers.d is read] ***************************************
TASK: [edxapp | create auth file] ********************************************
ok: [localhost] => (item=lms)
ok: [localhost] => (item=cms)
TASK: [edxapp | writing supervisor script] ***********************************
ok: [localhost] => (item=lms)
ok: [localhost] => (item=cms)
TASK: [edxapp | writing edxapp supervisor script] *****************************
ok: [localhost]
application: you-app-name-here
version: 1
runtime: python
api_version: 1
default_expiration: "30d"
handlers:
- url: /(.*\.(appcache|manifest))
mime_type: text/cache-manifest
def play_pig(A, B):
"""Lets play a small game of pig between two players, represented by
their strategy. Each time through the main loop, we ask the current player
for one decision which must be 'hold' or 'roll', and we update the state
accordingly when one player's score exceeds the goal, return that player"""
strategies = [A, B]
state = (0,0,0,0)
while True:
(p, me, you, pending) = state
# variables common to the lms role, automatically loaded
# when the role is included
---
# These are variables that default to a localhost
# setup and are meant to be overwritten for
# different environments.
#
# Variables in all caps are environment specific
# Lowercase variables are internal to the role
---
## build-version.yml
#
# Use with ansible bringup;
# - *_version specs can be branches, tags, or commits
# - you can comment out any items you do not want to override;
# they will retain their settings as in ansible playbooks
# for those items.
#
---
## build-version.yml
#
# Use with ansible bringup;
# - *_version specs can be branches, tags, or commits
# - you can comment out any items you do not want to override;
# they will retain their settings as in ansible playbooks
# for those items.
#
// These two need to be declared outside the try/catch
// so that they can be closed in the finally block.
HttpURLConnection urlConnection = null;
BufferedReader reader = null;
// Will contain the raw JSON response as a string.
String forecastJsonStr = null;
try {
// Construct the URL for the OpenWeatherMap query

Install Python

$ brew install readline sqlite gdbm
$ brew install python --universal --framework
$ python --version
Python 2.7

Symlinks...