Skip to content

Instantly share code, notes, and snippets.

View julianpistorius's full-sized avatar

Julian Pistorius julianpistorius

View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@julianpistorius
julianpistorius / scanner.sh
Created September 8, 2025 18:04 — forked from andyrbell/scanner.sh
Make a pdf look scanned using ImageMagick
# use ImageMagick convert
# the order is important. the density argument applies to input.pdf and resize and rotate to output.pdf
convert -density 90 input.pdf -rotate 0.5 -attenuate 0.2 +noise Multiplicative -colorspace Gray output.pdf
@julianpistorius
julianpistorius / scancvt.sh
Created September 8, 2025 18:03
Digital Camera + This Software + Printer = A Document Photocopier - by Corey Satten - https://staff.washington.edu/corey/camscan/scancvt
#!/bin/bash
#
# Digital Camera + This Software + Printer = A Document Photocopier
#
# Input: pictures of B&W Text documents taken with a digital camera using
# flash from about 3 feet away with no dark border around the page.
#
# Output1: b-file.tif (a very small B&W TIF file)
# Output2: g-file.jpg (a alternative grayscale file)
#
@julianpistorius
julianpistorius / shelve_current_instance.py
Created March 4, 2025 19:21 — forked from zacharygraber/shelve_current_instance.py
This quick and dirty Python script runs on a Jetstream2 instance, causing it to shelve itself (as long as OpenStack credentials are present in the environment). Lacks any error handling!
#!/bin/python3
# Requires the openstacksdk pip package - openstacksdk==4.0.0
import openstack
from urllib.request import urlopen
import json
# Initiate connection to the OpenStack API (get a token)
# Expects credentials to be available in "OS_"-prefixed env vars
@julianpistorius
julianpistorius / bastion.yaml.example
Last active October 16, 2024 16:00
Run Cluster API demo
bastion:
enabled: true
spec:
flavor: m3.medium
image:
filter:
name: Featured-Ubuntu22
sshKeyName: your-key-name

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 / design-by-contract.py
Last active March 16, 2021 17:54
Simplistic 'design-by-contract' example in Python
def add(x, y):
# Precondition
assert isinstance(x, int), 'x is not an integer'
assert isinstance(y, int), 'y is not an integer'
answer = x + y
# Postcondition
assert isinstance(answer, int), 'answer is not an integer'
@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

Keybase proof

I hereby claim:

  • I am julianpistorius on github.
  • I am julianpistorius (https://keybase.io/julianpistorius) on keybase.
  • I have a public key ASDsBph-7ZMdJl0_5QatK6PNBfIQxk9FN93yh87VdLC8cwo

To claim this, I am signing this object:

@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