Skip to content

Instantly share code, notes, and snippets.

View mdigan's full-sized avatar

Matt Digan mdigan

View GitHub Profile
@mdigan
mdigan / test.py
Created September 15, 2016 20:19 — forked from anonymous/test.py
#!/usr/local/bin/python
import os
os.environ["PYSPARK_SUBMIT_ARGS"] = \
"--packages com.basho.riak:spark-riak-connector_2.10:1.6.0 \
pyspark-shell"
import findspark, time
findspark.init()
@mdigan
mdigan / service-checklist.md
Created September 13, 2016 16:02 — forked from acolyer/service-checklist.md
Internet Scale Services Checklist

Internet Scale Services Checklist

A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."

Basic tenets

  • Does the design expect failures to happen regularly and handle them gracefully?
  • Have we kept things as simple as possible?
####################################
# BASIC REQUIREMENTS
# http://graphite.wikidot.com/installation
# http://geek.michaelgrace.org/2011/09/how-to-install-graphite-on-ubuntu/
# Last tested & updated 10/13/2011
####################################
cd
sudo apt-get update
sudo apt-get upgrade

Node.js - npm Cheat Sheet

(Full description and list of commands at - https://npmjs.org/doc/index.html)

##List of less common (however useful) NPM commands

######Install a package and also update package.json with the installed version and package name.

# Load balancer configuration
upstream exampleApp {
# Directs to the process with least number of connections.
least_conn;
# One failed response will take a server out of circulation for 20 seconds.
server 127.0.0.1:10080 fail_timeout=20s;
server 127.0.0.1:10081 fail_timeout=20s;
#server 127.0.0.1:10082 fail_timeout=20s;
#server 127.0.0.1:10083 fail_timeout=20s;
@mdigan
mdigan / test_flask.py
Created October 5, 2012 15:57 — forked from k4ml/test_flask.py
Flask+SQLAlchemy
from flask import Flask, request, session
from sqlalchemy import create_engine, Table, MetaData
from sqlalchemy.orm import mapper, relationship, sessionmaker, scoped_session
from sqlalchemy.sql import select
app = Flask(__name__)
engine = create_engine('postgresql+psycopg2://kamal@localhost/clinic_dev')
metadata = MetaData(bind=engine)
DBSession = scoped_session(sessionmaker(bind=engine))