Skip to content

Instantly share code, notes, and snippets.

View julianpistorius's full-sized avatar

Julian Pistorius julianpistorius

View GitHub Profile
@julianpistorius
julianpistorius / k8s-pi.md
Created January 26, 2018 19:08 — forked from alexellis/k8s-pi.md
K8s on Raspbian

K8s on (vanilla) Raspbian Lite

Yes - you can create a Kubernetes cluster with Raspberry Pis with the default operating system Raspbian. Carry on using all the tools and packages you're used to with the officially-supported OS.

Pre-reqs:

  • You must use an RPi2 or 3 for Kubernetes
  • I'm assuming you're using wired ethernet (Wi-Fi also works)

Master node setup

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import React from 'react';
import { connect } from 'react-redux';
import { push, replace } from 'redux-router';
export function requireLoggedIn(Component) {
// a wrapper that requires a user be logged in. You can decide what 'logged in' means - in this example,
// a user is considered to be logged in if usersStore.meta.self !== null
class AuthComponent extends React.Component {
@julianpistorius
julianpistorius / Event-stream based GraphQL subscriptions.md
Created June 15, 2017 21:16 — forked from OlegIlyenko/Event-stream based GraphQL subscriptions.md
Event-stream based GraphQL subscriptions for real-time updates

In this gist I would like to describe an idea for GraphQL subscriptions. It was inspired by conversations about subscriptions in the GraphQL slack channel and different GH issues, like #89 and #411.

Conceptual Model

At the moment GraphQL allows 2 types of queries:

  • query
  • mutation

Reference implementation also adds the third type: subscription. It does not have any semantics yet, so here I would like to propose one possible semantics interpretation and the reasoning behind it.

@julianpistorius
julianpistorius / Event-stream based GraphQL subscriptions.md
Created June 15, 2017 21:16 — forked from OlegIlyenko/Event-stream based GraphQL subscriptions.md
Event-stream based GraphQL subscriptions for real-time updates

In this gist I would like to describe an idea for GraphQL subscriptions. It was inspired by conversations about subscriptions in the GraphQL slack channel and different GH issues, like #89 and #411.

Conceptual Model

At the moment GraphQL allows 2 types of queries:

  • query
  • mutation

Reference implementation also adds the third type: subscription. It does not have any semantics yet, so here I would like to propose one possible semantics interpretation and the reasoning behind it.

Docker In Production

There was once an oral surgeon named Lytle S. Adams. He lived a long time ago, when America was fighting a war against Japan. Japan had attacked a military base in Hawaii, and—the day that happened—Adams was on vacation at Carlsbad Caverns. That’s a system of caves in New Mexico, where thousands and thousands of bats live. Adams was very impressed with the bats, and he came up with an idea: a swarm of weaponized bats, with miniature incendiary bombs strapped to their bodies—bats that would be dropped over Japanese cities to streak through the air, scatter far and wide, and then explode, sparking thousands of little fires all over the place, burning down buildings and frightening everyone.

Adams was friendly with Eleanor Roosevelt, the president’s wife, and he used his connections to send a brief to the president; the president gave it to a military commander with a note that said, ‘This man is not a nut.’ And so, by 1943, there was a top secret bat-bomb project up a

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@julianpistorius
julianpistorius / quilt_proposal.edn
Created July 28, 2016 06:46 — forked from tgk/quilt_proposal.edn
An attempt at understanding Quilt
;; These notes describe the snapshots of a shared state between
;; pariticipants in a system co-ordinated using CRDT methods, hopefully
;; matching the Quilt notes from @cemerick at
;; http://writings.quilt.org/2014/05/12/distributed-systems-and-the-end-of-the-api/
;; The ambition is to built systems where network failures, replays
;; etc. can be safely ignored (instead of just being ignored).
;; Maintaining the "timestamps" for the append only database is the only
;; thing I feel I don't grok. There are some notes at the end of the
;; gist. Hoping for feedback or pointers!
@julianpistorius
julianpistorius / behave-parallel.py
Created July 12, 2016 22:46 — forked from remcowesterhoud/behave-parallel.py
All credit goes to s1ider https://gist.github.com/s1ider/f13c2f163282dbec7a61. All I did was fix it up, made it work in Python3 and added Behave Userdata support
"""
Behave runner for running features asynchronously.
"""
from multiprocessing import Pool
from subprocess import call, Popen, PIPE
from glob import glob
import logging
import argparse
import json
from functools import partial
@julianpistorius
julianpistorius / MyConsumer.java
Created June 6, 2016 02:02 — forked from claudemamo/MyConsumer.java
Apache Kafka for Event Sourcing
...
public class MyConsumer {
private static final int SO_TIMEOUT = 100000; // socket timeout
private static final int BUFFER_SIZE = 64 * 1024; // maximum socket receive buffer in bytes
private static final int FETCH_SIZE = 100000; // maximum bytes to fetch from topic
public static void main(String args[]) {
MyConsumer myConsumer = new MyConsumer();