Skip to content

Instantly share code, notes, and snippets.

mausch / Dockerfile
Created May 27, 2020
Nix on Jupyter on Docker
View Dockerfile
FROM jupyter/minimal-notebook:36bce751008f
USER root
RUN apt-get update && apt-get install -y curl
RUN mkdir /nix
RUN chown jovyan /nix
ENV PATH=/home/jovyan/.nix-profile/bin:$PATH
View gist:b94d8626e440d15b9eb944c6b1deab7c
Kudos to
$ docker run --rm -it -w /root alpine
$ apk add curl
$ curl -o nix && chmod +x nix
$ ./nix run -f channel:nixpkgs-unstable awscli -c aws --version
aws-cli/1.17.13 Python/3.7.7 Linux/4.19.116 botocore/1.14.13
View awscli2.nix
pkgs = import <nixpkgs> {};
awscli = with pkgs; stdenv.mkDerivation {
name = "awscli";
src = fetchzip {
url =;
sha256 = "1pqvqhxbikqnji7nazvaqnk2czlmr3kvs1zyl13w96ym4if3np1v";
propagatedBuildInputs = with pkgs; [
mausch /
Created May 13, 2020
Run DBeaver in docker
set -eu
cat << 'EOF' > ~/dbeaver.dockerfile
FROM openjdk:14-slim
RUN apt-get update && apt-get install -y wget libgtk-3-dev
RUN wget${VERSION}/dbeaver-ce-${VERSION}-linux.gtk.x86_64.tar.gz
RUN tar xvzf dbeaver-ce-${VERSION}-linux.gtk.x86_64.tar.gz
RUN rm dbeaver-ce-${VERSION}-linux.gtk.x86_64.tar.gz
mausch / crash.log
Created May 3, 2020
JetBrains Rider 2020.1 crash
View crash.log
Internal error. Please refer to
java.util.concurrent.CompletionException: com.intellij.ide.plugins.StartupAbortedException: Fatal error initializing 'com.jetbrains.rider.protocol.ProtocolManagerInitializer'
at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(
at java.base/java.util.concurrent.CompletableFuture.completeThrowable(
at java.base/java.util.concurrent.CompletableFuture$
at com.intellij.openapi.application.TransactionGuardImpl$
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(
at com.intellij.openapi.application.impl.ApplicationImpl.lambda$invokeLater$4(
at com.intellij.openapi.application.impl.FlushQueue.doRun(
mausch /
Last active Apr 27, 2020
Run AWS WorkSpaces client on any Linux distro supporting Docker
#!/usr/bin/env bash
set -eu
trap "rm $dockerfile" EXIT
cat << EOF > $dockerfile
FROM ubuntu:bionic
RUN apt-get update && apt-get install -y wget gnupg2
mausch / newtypes.cs
Created Apr 25, 2020
newtypes in C#
View newtypes.cs
interface IValue<out T>
T Value { get; }
interface INewTypeEq<TSelf, TValue> : IValue<TValue>, IEquatable<TSelf>
where TValue : IEquatable<TValue>
where TSelf : INewTypeEq<TSelf, TValue>
TSelf New(TValue value);
View configuration.nix
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, pkgs, ... }:
imports =
[ # Include the results of the hardware scan.
mausch / gist:7834888398af8bac39277fcecb394389
Created Jan 10, 2020
Get current EC2 spot prices in your region
View gist:7834888398af8bac39277fcecb394389
# thanks to for the CSV output
aws ec2 describe-spot-price-history --product-description "Linux/UNIX (Amazon VPC)" --start-time "$(date +%s)" | jq '.SpotPriceHistory | group_by(.InstanceType) | [.[] | min | {InstanceType, SpotPrice}]' | jq -r '(.[0] | keys_unsorted) as $keys | $keys, map([.[ $keys[] ]])[] | @csv' | less
mausch /
Last active Oct 21, 2019
Checks Avro compatibility between a schema stored in a Confluent schema registry and a schema stored in a local file
set -eu
curl -s $SCHEMA_REGISTRY_URL/subjects/${2}-value/versions/latest | jq '.schema' -r | jq '' > $tmpfile
trap "rm $tmpfile" INT TERM HUP EXIT
~/ check --old-schema /work/$tmpfile --new-schema /work/$1
You can’t perform that action at this time.