Skip to content

Instantly share code, notes, and snippets.

View kenju254's full-sized avatar

Kenneth Kinyanjui kenju254

View GitHub Profile
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...

Deploy your own PaaS!

Setting up Dokku with DigitalOcean and Namecheap

..or how I made my own heroku in a few hours for $3.98.

This write-up owes a great deal to dscape's Node.js Deployments with Docker, Dokku, & Digital Ocean, the dokku project itself, and the fine folks working on dokku's issues. I took dscape's article as a starting point when trying this out but found some details lacking so I documented my own process for getting dokku up and running.

1. Get a domain