Skip to content

Instantly share code, notes, and snippets.

@padajo
padajo / service-checklist.md
Last active April 25, 2023 13:34 — 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."

An update by Paul Johnston (paul@roundaboutlabs.com), for a Serverless Architecture scenario. This assumes something akin to AWS Lambda + API Gateway + DynamoDB (c. 2016) Function as a Service (FaaS) solution as the basis for deployment rather than a cloud-based virtual server approach which the original paper was based upon. The FaaS solution implies each function is separately scalable and the database is inherently partitioned (assuming designed/built well).

If you agree/disagree, please fork and share with me on twitter @pauldjohnston.

FROM ubuntu:16.04
RUN PACKAGES="\
php-cli \
php-mysql \
php-intl \
php-xml \
php-curl \
php-dom \
" && \
@robintema
robintema / GeneralSerializer.py
Last active December 7, 2020 14:10
General Django Rest Framework model serializer
import logging
from rest_framework import serializers
class GeneralModelSerializer(serializers.ModelSerializer):
""" General model serializer that will serialize a model object. It will return all the model fields.
"""
class Meta:
model = None
@thaJeztah
thaJeztah / docker-examples.md
Last active January 14, 2024 02:00
Some docker examples

Commit, clone a container

To 'clone' a container, you'll have to make an image of that container first, you can do so by "committing" the container. Docker will (by default) pause all processes running in the container during commit to preserve data-consistency.

For example;

docker commit --message="Snapshot of my container" my_container my_container_snapshot:yymmdd
@sorbits
sorbits / every
Last active February 22, 2024 03:58
Run «command» only every «number» time invoked
#!/usr/bin/env bash
progname=$(basename $0)
version="1.0 (2014-08-17)"
step=2
function create_hash {
openssl dgst -sha1 -binary <<< "$1" | xxd -p
}
@evanscottgray
evanscottgray / docker_kill.sh
Last active November 7, 2023 03:40
kill all docker containers at once...
docker ps | awk {' print $1 '} | tail -n+2 > tmp.txt; for line in $(cat tmp.txt); do docker kill $line; done; rm tmp.txt
@Mithrandir0x
Mithrandir0x / gist:3639232
Created September 5, 2012 16:15
Difference between Service, Factory and Provider in AngularJS
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
@ambv
ambv / map_reduce.py
Created November 29, 2011 21:16
Proper MapReduce in Python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" A response to http://terse-words.blogspot.com/2011/11/mapreduce-in-python.html """
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
@colwilson
colwilson / pymr.py
Created November 6, 2011 20:58
MapReduce in Python
from multiprocessing import Pool
import string
import random
def mapFunction(letter):
return (letter, 1)
def partition(tuples):
mapping = {}
for t in tuples:

(a gist based on the old toolmantim article on setting up remote repos)

To collaborate in a distributed development process you’ll need to push code to remotely accessible repositories.

This is somewhat of a follow-up to the previous article setting up a new rails app with git.

For the impatient

Set up the new bare repo on the server: