Skip to content

Instantly share code, notes, and snippets.

View julianpistorius's full-sized avatar

Julian Pistorius julianpistorius

View GitHub Profile

microstack + microk8s

Problem: with both microk8s and microstack installed, the k8s' nginx server is started on the default port (8080)

Solution: Changing the default port for Horizon to 5001

sudo snap set microstack config.network.ports.dashboard=5001
sudo snap restart microstack

Additional notes: MySQL and RabbitMQ ports can also be changed similarly

@julianpistorius
julianpistorius / Architecture.md
Created November 29, 2019 22:47 — forked from evancz/Architecture.md
Ideas and guidelines for architecting larger applications in Elm to be modular and extensible

Architecture in Elm

This document is a collection of concepts and strategies to make large Elm projects modular and extensible.

We will start by thinking about the structure of signals in our program. Broadly speaking, your application state should live in one big foldp. You will probably merge a bunch of input signals into a single stream of updates. This sounds a bit crazy at first, but it is in the same ballpark as Om or Facebook's Flux. There are a couple major benefits to having a centralized home for your application state:

  1. There is a single source of truth. Traditional approaches force you to write a decent amount of custom and error prone code to synchronize state between many different stateful components. (The state of this widget needs to be synced with the application state, which needs to be synced with some other widget, etc.) By placing all of your state in one location, you eliminate an entire class of bugs in which two components get into inconsistent states. We also think yo
@julianpistorius
julianpistorius / too_afraid.md
Created October 1, 2019 03:10 — forked from mootpointer/too_afraid.md
Too Afraid to Try

Too afraid to try: Innovation is impossible without psychological safety

Innovation and creativity are inextricably linked. However, in the murky waters of ambiguity we often lose our way. We cling to what is known and what is safe, and create environments where accountability and preserving the status quo trumps the potential gains of innovation. For us to truly innovate, we need to foster environments of psychological safety: where we are certain about some things so we can embrace the uncertainty of others. In this session we will dig into research, some stories from the trenches and best practices to find how we can unlock innovation and creativity through creating a place where your team feels safe to try.

Resources

Books

The Fearless Organisation - Amy Edmondson: A book from the researcher who brought psychological safety to the fore. Brings stories of what psychological safety looks like (and

@julianpistorius
julianpistorius / docker.org
Created August 26, 2019 18:21 — forked from ashiklom/docker.org
PNNL PEcAn setup

PIC setup notes

VM instance setup

Start at cloud management console (https://dashboard.cloud.pnnl.gov).

Go to “Instances”, then “Launch Instance”.

Details: Give it a name (e.g. “pecan1”) Availability zone “nova” (only option).

@julianpistorius
julianpistorius / saas_metrics.sql
Created June 21, 2019 16:46 — forked from arikfr/saas_metrics.sql
SaaS Metrics Query
/*
Explanation of what's going on in this query can be found in this blog post: https://blog.redash.io/sql-query-to-calculate-saas-metrics-dd25d72a0521.
*/
WITH v_charges AS (
SELECT org_id,
date_trunc('month', start_date) AS month,
coalesce((extra::json->>'amount')::float, (extra::json->>'charged_amount')::integer/100) as total
FROM charges
WHERE extra::json->>'months' = '1'
@julianpistorius
julianpistorius / Containerfile
Created May 4, 2018 23:22 — forked from max-mapper/Containerfile
CALeDNA container (build with npm i mkcontainer -g)
ENV NSPAWN_BOOTSTRAP_IMAGE_SIZE=10GB
FROM ubuntu:xenial
# set unlimited bash history
# nspawn needs resolv.conf to be set up for internet to work
# password gets changed so we can login later
RUN mkdir /usr/local/anacapa && \
cd /usr/local/anacapa && \
echo "export HISTFILESIZE=" >> .bashrc && \
echo "export HISTSIZE=" >> .bashrc && \

So, as I mentioned last time, I have two fundamental goals with dat that are not addressed by simply running dat share.

  • Uptime: making sure that the site is seeded even if my local laptop is closed, eaten by a bear, or disconnected from the internet
  • Resilience: ensuring that there's a way to restart my website if the original seeding computer is lost. I try to make everything on my primary work/personal computer work in such a way that I can recover it all, easily, onto a new machine if I need to

To break these down a bit more, uptime is a combination of two things:

  • Ensuring that there are seeders
  • Ensuring that those seeders are seeding, and they're up-to-date
@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 {